@aceshooting/lyra-ui 16.0.0 → 17.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 (296) hide show
  1. package/CHANGELOG.md +504 -0
  2. package/custom-elements.json +1 -1
  3. package/dist/cli/migration-contract.json +1 -1
  4. package/dist/components/agent-tools/browser-frame/browser-frame.class.d.ts +3 -3
  5. package/dist/components/agent-tools/browser-frame/browser-frame.class.js +2 -2
  6. package/dist/components/agent-tools/compare-panel/compare-panel.class.d.ts +2 -2
  7. package/dist/components/agent-tools/compare-panel/compare-panel.class.js +3 -3
  8. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.d.ts +37 -13
  9. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.js +2 -2
  10. package/dist/components/agent-tools/task-list/task-list.class.js +2 -2
  11. package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.d.ts +4 -0
  12. package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.js +2 -2
  13. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.d.ts +3 -3
  14. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +1 -1
  15. package/dist/components/charts/chart/chart.class.d.ts +117 -17
  16. package/dist/components/charts/chart/chart.class.js +3 -3
  17. package/dist/components/charts/chart/histogram-bin.d.ts +5 -1
  18. package/dist/components/charts/chart/histogram-bin.js +1 -1
  19. package/dist/components/charts/chart/lite-chart.class.d.ts +9 -0
  20. package/dist/components/conversation/code-block/code-block.styles.js +1 -1
  21. package/dist/components/conversation/message-actions/message-actions.styles.js +1 -1
  22. package/dist/components/conversation/model-select/model-select.class.d.ts +13 -4
  23. package/dist/components/conversation/model-select/model-select.class.js +2 -1
  24. package/dist/components/conversation/model-select/model-select.styles.js +1 -1
  25. package/dist/components/conversation/streaming-text/streaming-text-base.class.d.ts +40 -2
  26. package/dist/components/conversation/streaming-text/streaming-text-base.class.js +2 -2
  27. package/dist/components/conversation/streaming-text/streaming-text-core.class.d.ts +5 -3
  28. package/dist/components/conversation/streaming-text/streaming-text-core.class.js +10 -0
  29. package/dist/components/conversation/streaming-text/streaming-text.class.d.ts +9 -3
  30. package/dist/components/conversation/streaming-text/streaming-text.class.js +10 -0
  31. package/dist/components/conversation/suggestion-chips/suggestion-chips.class.d.ts +30 -2
  32. package/dist/components/conversation/suggestion-chips/suggestion-chips.class.js +4 -3
  33. package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +1 -1
  34. package/dist/components/conversation/transcript-feed/transcript-feed.class.js +1 -1
  35. package/dist/components/conversation/usage-badge/usage-badge-overlay-runtime.js +1 -1
  36. package/dist/components/conversation/usage-badge/usage-badge.class.d.ts +4 -0
  37. package/dist/components/conversation/voice-picker/voice-picker.class.d.ts +16 -4
  38. package/dist/components/conversation/voice-picker/voice-picker.class.js +2 -1
  39. package/dist/components/conversation/voice-picker/voice-picker.styles.js +1 -1
  40. package/dist/components/data/context-meter/context-meter.class.d.ts +23 -4
  41. package/dist/components/data/context-meter/context-meter.class.js +10 -7
  42. package/dist/components/data/context-meter/context-meter.styles.js +1 -1
  43. package/dist/components/data/data-grid/data-grid.class.d.ts +5 -2
  44. package/dist/components/data/data-grid/data-grid.class.js +1 -1
  45. package/dist/components/data/flow-canvas/flow-canvas.class.d.ts +32 -5
  46. package/dist/components/data/flow-canvas/flow-canvas.class.js +3 -1
  47. package/dist/components/data/flow-canvas/flow-canvas.styles.js +1 -1
  48. package/dist/components/data/flow-canvas/flow-model.js +1 -1
  49. package/dist/components/data/flow-canvas/flow-types.d.ts +10 -1
  50. package/dist/components/data/gauge/gauge.class.d.ts +15 -2
  51. package/dist/components/data/gauge/gauge.class.js +20 -20
  52. package/dist/components/data/gauge/gauge.styles.js +1 -1
  53. package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +14 -5
  54. package/dist/components/data/graph-query-builder/graph-query-builder.class.js +2 -2
  55. package/dist/components/data/sequence-strip/sequence-strip.class.d.ts +28 -2
  56. package/dist/components/data/sequence-strip/sequence-strip.class.js +3 -2
  57. package/dist/components/data/sequence-strip/sequence-strip.styles.js +1 -1
  58. package/dist/components/data/table/table.class.d.ts +155 -30
  59. package/dist/components/data/table/table.class.js +6 -4
  60. package/dist/components/data/table/table.styles.js +1 -1
  61. package/dist/components/data/timeline/timeline-item.class.d.ts +9 -1
  62. package/dist/components/data/timeline/timeline-item.class.js +2 -2
  63. package/dist/components/data/word-cloud/word-cloud.class.js +1 -1
  64. package/dist/components/data/word-cloud/word-cloud.styles.js +1 -1
  65. package/dist/components/forms/button/button.class.d.ts +30 -1
  66. package/dist/components/forms/button/button.class.js +2 -2
  67. package/dist/components/forms/checkbox/checkbox.class.d.ts +8 -6
  68. package/dist/components/forms/checkbox/checkbox.class.js +2 -2
  69. package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +7 -5
  70. package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
  71. package/dist/components/forms/color-picker/color-picker.class.d.ts +16 -2
  72. package/dist/components/forms/color-picker/color-picker.class.js +2 -2
  73. package/dist/components/forms/color-picker/color-picker.styles.js +1 -1
  74. package/dist/components/forms/combobox/combobox.class.d.ts +43 -8
  75. package/dist/components/forms/combobox/combobox.class.js +2 -2
  76. package/dist/components/forms/date-picker/date-input.class.d.ts +4 -0
  77. package/dist/components/forms/date-picker/date-input.class.js +1 -1
  78. package/dist/components/forms/icon-button/icon-button.class.d.ts +20 -3
  79. package/dist/components/forms/icon-button/icon-button.class.js +1 -1
  80. package/dist/components/forms/icon-button/icon-button.styles.js +1 -1
  81. package/dist/components/forms/input/input.class.d.ts +5 -2
  82. package/dist/components/forms/input/input.class.js +1 -1
  83. package/dist/components/forms/input/time-input.class.d.ts +4 -0
  84. package/dist/components/forms/input/time-input.class.js +1 -1
  85. package/dist/components/forms/locale-picker/locale-picker.class.d.ts +11 -5
  86. package/dist/components/forms/locale-picker/locale-picker.class.js +1 -1
  87. package/dist/components/forms/otp-input/otp-input.class.d.ts +7 -2
  88. package/dist/components/forms/otp-input/otp-input.class.js +2 -2
  89. package/dist/components/forms/radio/radio-button.class.d.ts +2 -1
  90. package/dist/components/forms/radio/radio-group.class.d.ts +9 -4
  91. package/dist/components/forms/radio/radio-group.class.js +1 -1
  92. package/dist/components/forms/radio/radio.class.d.ts +13 -7
  93. package/dist/components/forms/radio/radio.class.js +1 -1
  94. package/dist/components/forms/rubric-form/rubric-form.class.d.ts +16 -6
  95. package/dist/components/forms/rubric-form/rubric-form.class.js +2 -2
  96. package/dist/components/forms/select/select.class.d.ts +19 -8
  97. package/dist/components/forms/select/select.class.js +2 -2
  98. package/dist/components/forms/slider/slider.class.d.ts +4 -2
  99. package/dist/components/forms/slider/slider.class.js +1 -1
  100. package/dist/components/forms/switch/switch.class.d.ts +8 -6
  101. package/dist/components/forms/switch/switch.class.js +1 -1
  102. package/dist/components/forms/textarea/textarea.class.d.ts +5 -3
  103. package/dist/components/forms/textarea/textarea.class.js +1 -1
  104. package/dist/components/forms/time-range/time-range.class.d.ts +12 -7
  105. package/dist/components/forms/time-range/time-range.class.js +1 -1
  106. package/dist/components/forms/time-range/time-range.styles.js +1 -1
  107. package/dist/components/forms/token-input/token-input.class.d.ts +6 -4
  108. package/dist/components/forms/token-input/token-input.class.js +1 -1
  109. package/dist/components/layout/app-rail/app-rail-item.class.d.ts +109 -4
  110. package/dist/components/layout/app-rail/app-rail-item.class.js +34 -29
  111. package/dist/components/layout/app-rail/app-rail-item.styles.js +1 -1
  112. package/dist/components/layout/app-rail/app-rail.class.d.ts +25 -3
  113. package/dist/components/layout/app-rail/app-rail.styles.js +1 -1
  114. package/dist/components/layout/app-rail-group/app-rail-group.class.d.ts +2 -2
  115. package/dist/components/layout/app-rail-group/app-rail-group.class.js +2 -2
  116. package/dist/components/layout/carousel/carousel.class.d.ts +1 -1
  117. package/dist/components/layout/carousel/carousel.class.js +1 -1
  118. package/dist/components/layout/details/accordion.class.d.ts +2 -2
  119. package/dist/components/layout/details/accordion.class.js +2 -2
  120. package/dist/components/layout/filter-bar/filter-bar-register.d.ts +1 -0
  121. package/dist/components/layout/filter-bar/filter-bar-register.js +1 -0
  122. package/dist/components/layout/filter-bar/filter-bar.class.d.ts +85 -10
  123. package/dist/components/layout/filter-bar/filter-bar.class.js +7 -4
  124. package/dist/components/layout/menu/menu-item.class.d.ts +3 -3
  125. package/dist/components/layout/menu/menu-item.class.js +3 -3
  126. package/dist/components/layout/menu/menu.class.d.ts +5 -1
  127. package/dist/components/layout/menu/menu.class.js +2 -2
  128. package/dist/components/layout/reorder-list/reorder-item.styles.js +1 -1
  129. package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
  130. package/dist/components/media/attachment-trigger/attachment-trigger.styles.js +1 -1
  131. package/dist/components/media/avatar-group/avatar-group.class.d.ts +12 -1
  132. package/dist/components/media/avatar-group/avatar-group.class.js +2 -2
  133. package/dist/components/media/drop-zone/drop-zone.class.d.ts +32 -11
  134. package/dist/components/media/drop-zone/drop-zone.class.js +2 -2
  135. package/dist/components/media/file-input/file-input.class.d.ts +40 -19
  136. package/dist/components/media/file-input/file-input.class.js +2 -2
  137. package/dist/components/overlays/callout/callout.styles.js +1 -1
  138. package/dist/components/overlays/dialog/dialog.styles.js +1 -1
  139. package/dist/components/overlays/overlay/dropdown.class.d.ts +13 -3
  140. package/dist/components/overlays/overlay/dropdown.class.js +2 -2
  141. package/dist/components/overlays/overlay/popover.class.d.ts +12 -3
  142. package/dist/components/overlays/overlay/popover.class.js +2 -2
  143. package/dist/components/overlays/rating/rating.class.d.ts +9 -7
  144. package/dist/components/overlays/rating/rating.class.js +1 -1
  145. package/dist/components/retrieval/citation-badge/citation-badge.class.d.ts +5 -1
  146. package/dist/components/retrieval/citation-badge/citation-badge.class.js +1 -1
  147. package/dist/components/retrieval/embedding-explorer/embedding-explorer.styles.js +1 -1
  148. package/dist/components/retrieval/entity-chip/entity-chip.class.d.ts +5 -1
  149. package/dist/components/retrieval/entity-chip/entity-chip.class.js +1 -1
  150. package/dist/components/retrieval/graph-legend/graph-legend.styles.js +1 -1
  151. package/dist/components/retrieval/retrieval-value-format.js +1 -1
  152. package/dist/components/retrieval/source-list/source-list.styles.js +1 -1
  153. package/dist/components/utility/copy-button/copy-button.class.d.ts +23 -11
  154. package/dist/components/utility/copy-button/copy-button.class.js +2 -2
  155. package/dist/components/utility/copy-button/copy-button.styles.js +1 -1
  156. package/dist/components/utility/diff-view/diff-view.styles.js +1 -1
  157. package/dist/components/utility/export-button/export-button.class.d.ts +4 -0
  158. package/dist/components/utility/export-button/export-button.class.js +1 -1
  159. package/dist/components/utility/json-viewer/json-viewer.styles.js +1 -1
  160. package/dist/components/utility/known-date/known-date.class.js +1 -1
  161. package/dist/components/utility/mention-popover/mention-popover.class.d.ts +38 -3
  162. package/dist/components/utility/mention-popover/mention-popover.class.js +2 -1
  163. package/dist/components/utility/mention-popover/mention-popover.styles.js +1 -1
  164. package/dist/components/utility/poll-status/poll-status.styles.js +1 -1
  165. package/dist/components/utility/tour/tour.class.d.ts +4 -0
  166. package/dist/components/utility/tour/tour.class.js +1 -1
  167. package/dist/components/utility/tour/tour.styles.js +1 -1
  168. package/dist/components/viewers/document-preview/document-preview.class.js +2 -2
  169. package/dist/components/viewers/docx-viewer/docx-viewer.class.js +2 -2
  170. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +2 -2
  171. package/dist/components/viewers/highlight-layer/highlight-layer.class.js +2 -2
  172. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +2 -2
  173. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +2 -2
  174. package/dist/components/viewers/pptx-viewer/pptx-viewer.class.js +2 -2
  175. package/dist/components/viewers/xml-viewer/xml-viewer.class.js +2 -2
  176. package/dist/custom-elements-jsx.d.ts +2 -2
  177. package/dist/events.d.ts +13 -12
  178. package/dist/internal/aggregate-file-limits.d.ts +33 -0
  179. package/dist/internal/aggregate-file-limits.js +1 -0
  180. package/dist/internal/catalog-picker.d.ts +15 -2
  181. package/dist/internal/catalog-picker.js +1 -1
  182. package/dist/internal/debounce-controller.d.ts +14 -0
  183. package/dist/internal/debounce-controller.js +1 -1
  184. package/dist/internal/default-strings.generated.d.ts +1 -1
  185. package/dist/internal/default-strings.generated.js +2 -2
  186. package/dist/internal/focus-navigation.d.ts +45 -0
  187. package/dist/internal/focus-navigation.js +1 -1
  188. package/dist/internal/form-associated.js +1 -1
  189. package/dist/internal/initial-slot-collection.d.ts +30 -0
  190. package/dist/internal/initial-slot-collection.js +1 -0
  191. package/dist/internal/intl-cache.js +1 -1
  192. package/dist/internal/invalid-event-alias.d.ts +46 -0
  193. package/dist/internal/invalid-event-alias.js +1 -1
  194. package/dist/internal/localization-runtime.d.ts +24 -0
  195. package/dist/internal/localization-runtime.js +1 -1
  196. package/dist/internal/localization-types.d.ts +1 -1
  197. package/dist/internal/localization.js +1 -1
  198. package/dist/internal/package-metadata.d.ts +1 -1
  199. package/dist/internal/package-metadata.js +1 -1
  200. package/dist/internal/positioning-strategy.d.ts +3 -1
  201. package/dist/internal/state-part.d.ts +49 -0
  202. package/dist/internal/state-part.js +1 -0
  203. package/dist/internal/variants.styles.js +1 -1
  204. package/dist/lyra.d.ts +1 -1
  205. package/dist/svelte.d.ts +2 -2
  206. package/dist/testing/index.d.ts +1 -1
  207. package/dist/testing/index.js +1 -1
  208. package/dist/testing/lyra-tag-event-map.d.ts +2 -2
  209. package/dist/testing/lyra-tag-event-map.js +1 -1
  210. package/dist/testing/wait-for-mount.d.ts +46 -0
  211. package/dist/testing/wait-for-mount.js +1 -0
  212. package/dist/theme/theme-bootstrap.js +1 -1
  213. package/dist/theme/theme.d.ts +11 -2
  214. package/dist/theme/theme.js +1 -1
  215. package/dist/translations/ar/layout.js +1 -1
  216. package/dist/translations/de/layout.js +1 -1
  217. package/dist/translations/es/layout.js +1 -1
  218. package/dist/translations/fa/layout.js +1 -1
  219. package/dist/translations/fr/layout.js +1 -1
  220. package/dist/translations/he/layout.js +1 -1
  221. package/dist/translations/it/layout.js +1 -1
  222. package/dist/translations/ja/layout.js +1 -1
  223. package/dist/translations/pt-BR/layout.js +1 -1
  224. package/dist/translations/ru/layout.js +1 -1
  225. package/dist/translations/zh-CN/layout.js +1 -1
  226. package/dist/utilities/format.d.ts +17 -0
  227. package/dist/utilities/format.js +1 -1
  228. package/dist/vue.d.ts +2 -2
  229. package/llms/components/lr-app-rail-group.md +87 -10
  230. package/llms/components/lr-app-rail-item.md +88 -11
  231. package/llms/components/lr-app-rail.md +88 -11
  232. package/llms/components/lr-attachment-trigger.md +21 -0
  233. package/llms/components/lr-bar-chart.md +3 -2
  234. package/llms/components/lr-bubble-chart.md +3 -2
  235. package/llms/components/lr-callout.md +10 -0
  236. package/llms/components/lr-chart.md +43 -12
  237. package/llms/components/lr-citation-badge.md +7 -1
  238. package/llms/components/lr-code-block.md +21 -0
  239. package/llms/components/lr-color-picker.md +12 -7
  240. package/llms/components/lr-combobox.md +13 -1
  241. package/llms/components/lr-confirm-bar.md +36 -7
  242. package/llms/components/lr-context-meter.md +17 -4
  243. package/llms/components/lr-date-input.md +7 -1
  244. package/llms/components/lr-date-picker.md +6 -0
  245. package/llms/components/lr-dialog.md +21 -0
  246. package/llms/components/lr-doughnut-chart.md +3 -2
  247. package/llms/components/lr-drawer.md +10 -0
  248. package/llms/components/lr-drop-zone.md +16 -7
  249. package/llms/components/lr-dropdown-item.md +7 -0
  250. package/llms/components/lr-entity-chip.md +7 -1
  251. package/llms/components/lr-export-button.md +7 -1
  252. package/llms/components/lr-file-input.md +21 -10
  253. package/llms/components/lr-filter-bar.md +91 -15
  254. package/llms/components/lr-flow-canvas.md +16 -9
  255. package/llms/components/lr-gauge.md +22 -2
  256. package/llms/components/lr-histogram.md +7 -2
  257. package/llms/components/lr-icon-button.md +15 -7
  258. package/llms/components/lr-input.md +3 -1
  259. package/llms/components/lr-line-chart.md +3 -2
  260. package/llms/components/lr-lite-chart.md +13 -0
  261. package/llms/components/lr-locale-picker.md +7 -1
  262. package/llms/components/lr-mention-popover.md +16 -3
  263. package/llms/components/lr-menu-item.md +7 -0
  264. package/llms/components/lr-menu.md +8 -1
  265. package/llms/components/lr-message-actions.md +10 -0
  266. package/llms/components/lr-model-select.md +8 -3
  267. package/llms/components/lr-native-time-input.md +8 -1
  268. package/llms/components/lr-number-input.md +8 -1
  269. package/llms/components/lr-option.md +12 -0
  270. package/llms/components/lr-otp-input.md +6 -0
  271. package/llms/components/lr-pie-chart.md +3 -2
  272. package/llms/components/lr-polar-area-chart.md +3 -2
  273. package/llms/components/lr-prompt-input.md +2 -2
  274. package/llms/components/lr-radar-chart.md +3 -2
  275. package/llms/components/lr-reorder-item.md +12 -0
  276. package/llms/components/lr-reorder-list.md +12 -0
  277. package/llms/components/lr-scatter-chart.md +3 -2
  278. package/llms/components/lr-sequence-strip.md +10 -4
  279. package/llms/components/lr-streaming-text-core.md +21 -8
  280. package/llms/components/lr-streaming-text.md +34 -4
  281. package/llms/components/lr-suggestion-chips.md +8 -4
  282. package/llms/components/lr-table.md +47 -10
  283. package/llms/components/lr-textarea.md +1 -1
  284. package/llms/components/lr-time-input.md +7 -1
  285. package/llms/components/lr-tool-call-chip.md +7 -1
  286. package/llms/components/lr-tour.md +7 -1
  287. package/llms/components/lr-usage-badge.md +7 -1
  288. package/llms/components/lr-voice-picker.md +7 -3
  289. package/llms/shared.md +169 -16
  290. package/llms/tokens.md +17 -1
  291. package/llms-full.txt +941 -147
  292. package/package.json +16 -2
  293. package/registrations.json +1 -1
  294. package/vscode-css-data.json +1 -1
  295. package/vscode-html-data.json +1 -1
  296. package/web-types.json +1 -1
@@ -11,7 +11,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
11
11
  aria-valuemax=${Number.isFinite(maxWidth)?Math.round(maxWidth):UNBOUNDED_RESIZE_ARIA_MAX}
12
12
  @pointerdown=${this.onResizePointerDown}
13
13
  @keydown=${this.onResizeKeyDown}
14
- ></span>`}syncResizeHandleValues(){for(const handle of this.renderRoot.querySelectorAll('[part="resize-handle"]')){const key=handle.dataset.colKey;if(!key)continue;const column=this.columnsByKey.get(key);if(!column||this.resizedColumnWidths.has(key)||this.parsePixelLength(column.width)!==void 0)continue;const rendered=handle.closest("th[data-col-key]")?.getBoundingClientRect().width;if(rendered&&rendered>0){const width=Math.round(rendered);handle.setAttribute("aria-valuenow",String(width)),handle.setAttribute("aria-valuetext",this.resizeValueText(width))}}}detachResizePointerListeners(){const resizeEventWindow=this.resizeEventWindow;resizeEventWindow&&(resizeEventWindow.removeEventListener("pointermove",this.onResizePointerMove),resizeEventWindow.removeEventListener("pointerup",this.onResizePointerEnd),resizeEventWindow.removeEventListener("pointercancel",this.onResizePointerEnd),resizeEventWindow.removeEventListener("lostpointercapture",this.onResizePointerEnd),this.resizeEventWindow=void 0)}rollbackResizePreview(state2){const reverted=new Map(this.resizedColumnWidths);state2.previousWidth===void 0?reverted.delete(state2.key):reverted.set(state2.key,state2.previousWidth),this.resizedColumnWidths=reverted}cancelResizeGesture(){const state2=this.resizeState;if(this.resizeState=void 0,this.detachResizePointerListeners(),!!state2){state2.handle.removeAttribute("data-resizing");try{state2.handle.releasePointerCapture?.(state2.pointerId)}catch{}this.rollbackResizePreview(state2)}}firstUpdated(changed){super.firstUpdated(changed),!this.accessibleLabel&&!this.hasAttribute("aria-label")&&!this.caption&&devWarnOnce(MISSING_ACCESSIBLE_NAME_WARNING,"<lr-table> has no accessible name: set `accessibleLabel`, a host `aria-label`, or `caption` so assistive technology can identify the grid.")}connectedCallback(){super.connectedCallback(),this.syncAnnouncementSink();const owner=this.ownerDocument.defaultView,ResizeObserverCtor=owner?.ResizeObserver;let observer;ResizeObserverCtor&&(observer=new ResizeObserverCtor(()=>{!this.isConnected||this.ownerDocument.defaultView!==owner||this.resizeObserver!==observer||this.scheduleLayoutSync()})),this.resizeObserver=observer;const base=this.renderRoot?.querySelector('[part="base"]');base&&(this.observeBase(base),this.observeTable(this.renderRoot.querySelector('[part="table"]')??void 0),this.observeHeaders())}disconnectedCallback(){super.disconnectedCallback(),this.releaseAnnouncementSink(),this.cancelResizeGesture(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0;const frame=this.layoutFrame;frame&&frame.owner.cancelAnimationFrame(frame.handle),this.layoutFrame=null,this.observedBase=void 0,this.observedTable=void 0,this.observedHeaders.clear()}releaseAnnouncementSink(){this.announcementSink?.release(),this.announcementSink=void 0,this.errorAnnouncementSink?.release(),this.errorAnnouncementSink=void 0}syncAnnouncementSink(){if(!this.isConnected){this.releaseAnnouncementSink();return}this.announcementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseAnnouncementSink(),this.announcementSink=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}),this.errorAnnouncementSink=acquireAnnouncementSink("assertive",{document:this.ownerDocument,source:this}))}localizedOverride(key,override){return override??this.localize(key)}loadingText(){return this.localizedOverride("tableLoading",this.loadingLabel)}observeBase(base){this.observedBase!==base&&(this.observedBase&&this.resizeObserver?.unobserve(this.observedBase),this.resizeObserver?.observe(base),this.observedBase=base)}observeTable(table){this.observedTable!==table&&(this.observedTable&&this.resizeObserver?.unobserve(this.observedTable),table&&this.resizeObserver?.observe(table),this.observedTable=table)}syncAutoScrollMode(){const base=this.renderRoot.querySelector('[part="base"]');if(!base)return;const overflows=this.scrollMode==="auto"&&base.scrollWidth-base.clientWidth>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX;base.toggleAttribute("data-scroll-overflow",overflows)}observeHeaders(){const headers=new Set(this.columns.some(column=>column.sticky||column.resizable)?this.renderRoot.querySelectorAll("th[data-col-key]"):[]);for(const header of this.observedHeaders)headers.has(header)||(this.resizeObserver?.unobserve(header),this.observedHeaders.delete(header));for(const header of headers)this.observedHeaders.has(header)||(this.observedHeaders.add(header),this.resizeObserver?.observe(header))}priorityTierHeaders(tier){return[...this.renderRoot.querySelectorAll(`th[data-priority="${tier}"]`)]}recomputeHiddenPriorityColumns(){const hasLowColumn=this.columns.some(col=>col.priority==="low"),hasMediumColumn=this.columns.some(col=>col.priority==="medium"),base=this.renderRoot.querySelector('[part="base"]');if(!hasLowColumn&&!hasMediumColumn){this.priorityTierNaturalWidth.clear(),base?.removeAttribute("data-hide-priority-low"),base?.removeAttribute("data-hide-priority-medium"),this.rehomeFocusedColumn(),this.priorityToggleAvailable&&(this.priorityToggleAvailable=!1),this.hasHiddenPriorityColumns&&(this.hasHiddenPriorityColumns=!1);return}if(!base||base.clientWidth<=0){this.rehomeFocusedColumn();return}const lowHeaders=hasLowColumn?this.priorityTierHeaders("low"):[],mediumHeaders=hasMediumColumn?this.priorityTierHeaders("medium"):[],refreshNaturalWidth=(tier,headers)=>{if(headers.length===0)return!1;const currentlyHidden=headers.every(header=>header.offsetParent===null);if(!currentlyHidden){const width=headers.reduce((sum,header)=>sum+header.getBoundingClientRect().width,0);width>0&&this.priorityTierNaturalWidth.set(tier,width)}return currentlyHidden},lowActuallyHidden=refreshNaturalWidth("low",lowHeaders),mediumActuallyHidden=refreshNaturalWidth("medium",mediumHeaders),lowNaturalWidth=this.priorityTierNaturalWidth.get("low")??0,mediumNaturalWidth=this.priorityTierNaturalWidth.get("medium")??0,overflowAtFull=base.scrollWidth+(lowActuallyHidden?lowNaturalWidth:0)+(mediumActuallyHidden?mediumNaturalWidth:0)-base.clientWidth,needsLow=hasLowColumn&&overflowAtFull>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,overflowAfterLow=needsLow?overflowAtFull-lowNaturalWidth:overflowAtFull,needsMedium=hasMediumColumn&&overflowAfterLow>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX;base.toggleAttribute("data-hide-priority-low",needsLow),base.toggleAttribute("data-hide-priority-medium",needsMedium),this.rehomeFocusedColumn();const toggleAvailable=needsLow||needsMedium,anyPriorityHidden=toggleAvailable&&!this.priorityColumnsVisible;this.priorityToggleAvailable!==toggleAvailable&&(this.priorityToggleAvailable=toggleAvailable),this.hasHiddenPriorityColumns!==anyPriorityHidden&&(this.hasHiddenPriorityColumns=anyPriorityHidden)}rehomeFocusedColumn(){const visible=this.visibleHeaders();visible.length===0||this.activeColKey===null||visible.some(header=>header.dataset.colKey===this.activeColKey)||(this.activeColKey=visible[0].dataset.colKey??null)}keyOf(row,index){try{const key=this.rowKey?this.rowKey(row):index;return typeof key=="string"?key.trim().length===0?void 0:key:typeof key=="number"?key:void 0}catch{return}}canonicalRowEntries(){const inputs=this.canonicalRowEntriesInputs;if(this.cachedCanonicalRowEntries!==null&&inputs?.rows===this.rows&&inputs.rowKey===this.rowKey)return this.cachedCanonicalRowEntries;const entries=[],seen=new Set;return this.rows.forEach((row,index)=>{const key=this.keyOf(row,index);if(key===void 0)return;const encoded=encodeKey(key);seen.has(encoded)||(seen.add(encoded),entries.push({row,index,key}))}),this.canonicalRowEntriesInputs={rows:this.rows,rowKey:this.rowKey},this.cachedCanonicalRowEntries=entries,entries}matchingEntries(){const text=(this.filterText??"").trim(),locale=text===""?"":this.effectiveLocale,canonicalEntries=this.canonicalRowEntries(),inputs=this.matchingEntriesInputs;if(this.cachedMatchingEntries!==null&&inputs!==null&&inputs.entries===canonicalEntries&&inputs.filter===this.filter&&inputs.text===text&&inputs.locale===locale)return this.cachedMatchingEntries;let entries;if(text==="")entries=canonicalEntries;else{const intlLocale=this.effectiveLocale,normalized=text.toLocaleLowerCase(intlLocale);entries=canonicalEntries.filter(({row})=>this.filter?this.filter(row,text):safeStringifyForFilter(row).toLocaleLowerCase(intlLocale).includes(normalized))}return this.matchingEntriesInputs={entries:canonicalEntries,filter:this.filter,text,locale},this.cachedMatchingEntries=entries,entries}get normalizedPageSize(){return finiteInteger(this.pageSize,DEFAULT_PAGE_SIZE,1,MAX_PAGE_SIZE)}get effectiveSkeletonRows(){const explicit=finiteCount(this.skeletonRows,0,MAX_SKELETON_ROWS);if(explicit>0)return explicit;const pageSize=this.normalizedPageSize;return pageSize===DEFAULT_PAGE_SIZE?DEFAULT_SKELETON_ROWS:Math.min(pageSize,MAX_SKELETON_ROWS)}get matchingTotalItems(){const totalItems=finiteInteger(this.totalItems,-1);return totalItems>=0?totalItems:this.matchingEntries().length}get serverUnknownTotal(){return this.paginationMode==="server"&&this.unknownTotal}get pageCount(){const pageSize=this.normalizedPageSize;return pageSize>0?Math.ceil(this.matchingTotalItems/pageSize):0}get appliedPage(){return this.pageCount===0?1:finiteInteger(this.page,1,1,this.pageCount)}sortedEntries(){const entries=this.matchingEntries();if(this.sortMode!=="client"||this.sortKey==="")return entries;const col=this.columnsByKey.get(this.sortKey);if(!col?.sortable)return entries;const locale=this.effectiveLocale,inputs=this.sortedEntriesInputs;if(this.cachedSortedEntries!==null&&inputs!==null&&inputs.entries===entries&&inputs.columns===this.columns&&inputs.mode===this.sortMode&&inputs.key===this.sortKey&&inputs.dir===this.sortDir&&inputs.locale===locale&&inputs.groupBy===this.groupBy)return this.cachedSortedEntries;const collator=getCollator(locale,{numeric:!0}),dir=this.sortDir==="desc"?-1:1,decorated=entries.map(entry=>{const raw=typeof col.sortValue=="function"?col.sortValue(entry.row):typeof col.cell=="function"?String(col.cell(entry.row)??""):"";return{entry,value:typeof raw=="number"&&!Number.isFinite(raw)?null:raw}}),compare=(a,b)=>{const av=a.value,bv=b.value;return av==null&&bv==null?0:av==null?1:bv==null?-1:typeof av=="number"&&typeof bv=="number"?(av-bv)*dir:collator.compare(String(av),String(bv))*dir};let sorted;const groupBy=this.groupBy;if(groupBy===void 0)decorated.sort(compare),sorted=decorated.map(decoration=>decoration.entry);else{const buckets=new Map;for(const decoration of decorated){const groupKey=groupBy(decoration.entry.row),bucket=buckets.get(groupKey);bucket===void 0?buckets.set(groupKey,[decoration]):bucket.push(decoration)}const ordered=[...buckets.values()],constantWithinEveryGroup=ordered.every(bucket=>bucket.every(decoration=>compare(decoration,bucket[0])===0));constantWithinEveryGroup&&ordered.sort((a,b)=>compare(a[0],b[0])),sorted=[];for(const bucket of ordered){constantWithinEveryGroup||bucket.sort(compare);for(const decoration of bucket)sorted.push(decoration.entry)}}return this.sortedEntriesInputs={entries,columns:this.columns,mode:this.sortMode,key:this.sortKey,dir:this.sortDir,locale,groupBy},this.cachedSortedEntries=sorted,sorted}renderedEntries(){const entries=this.sortedEntries();if(this.paginationMode==="server")return entries.slice(0,this.normalizedPageSize);const start=(this.appliedPage-1)*this.normalizedPageSize;return entries.slice(start,start+this.normalizedPageSize)}get viewRows(){return Object.freeze(this.sortedEntries().map(entry=>entry.row))}get pageRows(){return Object.freeze(this.renderedEntries().map(entry=>entry.row))}focusedColKey(){const visible=this.visibleHeaders(),visibleKeys=new Set(visible.map(el=>el.dataset.colKey).filter(key=>key!==void 0&&this.columnsByKey.has(key)));return this.activeColKey!==null&&this.columnsByKey.has(this.activeColKey)&&(visibleKeys.size===0||visibleKeys.has(this.activeColKey))?this.activeColKey:visible.find(el=>el.dataset.colKey!==void 0&&this.columnsByKey.has(el.dataset.colKey))?.dataset.colKey??this.columns[0]?.key??null}focusedRowKey(){if(this.activeRowKey!==null&&this.rowsByKey.has(this.activeRowKey))return this.activeRowKey;const selectedKey=this._selectedKeys.values().next().value;if(selectedKey!==void 0){const selected=encodeKey(selectedKey);if(this.rowsByKey.has(selected))return selected}const first=this.renderedEntries()[0];return first?encodeKey(first.key):null}rowsAffectingRovingFocusChanged(changed){return changed.has("rows")||changed.has("rowKey")||changed.has("filterText")||changed.has("filter")||changed.has("page")||changed.has("pageSize")||changed.has("paginationMode")||changed.has("totalItems")||changed.has("columns")||changed.has("sortKey")||changed.has("sortDir")||changed.has("sortMode")||changed.has("groupBy")||this.rowsLocale!==this.effectiveLocale}captureRovingFocus(changed){this.rovingFocusSnapshot=null;const active=activeElementIn(this.shadowRoot),HTMLElementCtor=this.ownerDocument?.defaultView?.HTMLElement;if(!(!HTMLElementCtor||!(active instanceof HTMLElementCtor))){if(changed.has("columns")&&active.matches("th[data-col-key]")){const headers=this.visibleHeaders(),key=active.dataset.colKey,index=headers.indexOf(active);key!==void 0&&index>=0&&(this.rovingFocusSnapshot={kind:"header",key,index,targetKey:null,element:active});return}if(this.rowsAffectingRovingFocusChanged(changed)&&active.matches("tr[data-row-key]")){const renderedRows=[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")],key=active.dataset.rowKey,index=renderedRows.indexOf(active);key!==void 0&&index>=0&&(this.rovingFocusSnapshot={kind:"row",key,index,targetKey:null,element:active})}}}resolveRovingFocusTarget(){const snapshot=this.rovingFocusSnapshot;if(snapshot===null)return;const keys=snapshot.kind==="header"?this.columns.map(column=>column.key):[...this.rowsByKey.keys()];snapshot.targetKey=keys.includes(snapshot.key)?snapshot.key:keys[Math.min(snapshot.index,keys.length-1)]??null,snapshot.kind==="header"?this.activeColKey=snapshot.targetKey:this.activeRowKey=snapshot.targetKey}willUpdate(changed){if(super.willUpdate(changed),this.captureRovingFocus(changed),this.selectionMode==="single"&&this._selectedKeys.size>1&&(changed.has("selectionMode")||changed.has("selectedRowKeys"))){const first=this._selectedKeys.values().next().value;if(this.selectedRowKeys=this.asKeySet(first===void 0?new Set:new Set([first])),this.hasUpdated){const rowKeys=this.asKeyList(Object.freeze(first===void 0?[]:[first]));this.emit("lr-selection-change",Object.freeze({rowKeys}))}}if(this.expansionMode==="single"&&this._expandedKeys.size>1&&(changed.has("expansionMode")||changed.has("expandedRowKeys"))){const first=this._expandedKeys.values().next().value;this.expandedRowKeys=this.asKeySet(first===void 0?new Set:new Set([first]))}if(!this.hasUpdated){const parsed=readPersistedState(this.storageFullKey,v=>typeof v=="object"&&v!==null);parsed&&typeof parsed.priorityColumnsVisible=="boolean"&&!isPersistedPropertyExplicitlySet(this,"priorityColumnsVisible")&&(this.priorityColumnsVisible=parsed.priorityColumnsVisible)}if(changed.has("columns")&&(this.columnsByKey=new Map(this.columns.map(c=>[c.key,c]))),this.rowsAffectingRovingFocusChanged(changed)&&(this.rowsByKey=new Map(this.renderedEntries().map(entry=>[encodeKey(entry.key),entry])),this.rowsLocale=this.effectiveLocale),this.resolveRovingFocusTarget(),this.editingCell!==null){const column=this.columnsByKey.get(this.editingCell.columnKey);(!this.rowsByKey.has(this.editingCell.rowKey)||normalizedEditTrigger(column?.editTrigger)!=="double-click")&&(this.editingCell=null)}this.editorHadFocusBeforeUpdate=this.focusedEditorCell!==null&&activeElementIn(this.shadowRoot)===this.editorElementFor(this.focusedEditorCell.rowKey,this.focusedEditorCell.columnKey)}stickyOffsets(){const offsets=new Map,headerWidths=new Map;for(const el of this.renderRoot.querySelectorAll("th[data-col-key]")){const key=el.dataset.colKey;key!==void 0&&!headerWidths.has(key)&&headerWidths.set(key,el.offsetWidth)}const headerWidth=key=>headerWidths.get(key)??0;let runningStart=0;for(const col of this.columns)stickyDirection(col.sticky)==="start"&&(offsets.set(col.key,runningStart),runningStart+=headerWidth(col.key));let runningEnd=0;for(let i=this.columns.length-1;i>=0;i--){const col=this.columns[i];col&&stickyDirection(col.sticky)==="end"&&(offsets.set(col.key,runningEnd),runningEnd+=headerWidth(col.key))}return offsets}computeHeatDomain(hasHeatTint){if(!hasHeatTint)return null;const values=[];for(const entry of this.matchingEntries())for(const col of this.columns){const v=col.heatValue?.(entry.row);v!=null&&Number.isFinite(v)&&values.push(v)}const auto=minMax(values),lo=this.heatTintScale?.min??auto?.[0],hi=this.heatTintScale?.max??auto?.[1];return lo===void 0||hi===void 0?null:[lo,hi]}heatShare(col,row,domain){if(!col.heatValue||!domain)return null;const v=col.heatValue(row);if(v==null||!Number.isFinite(v))return null;const[lo,hi]=domain;return`${(finiteRatio(v,lo,hi)*100).toFixed(2)}%`}applyStickyOffsets(){if(!this.columns.some(c=>c.sticky))return;const offsets=this.stickyOffsets();this.renderRoot.querySelectorAll("[data-col-key]").forEach(el=>{const key=el.dataset.colKey;key!==void 0&&offsets.has(key)&&el.style.setProperty("--lr-table-sticky-offset",`${offsets.get(key)}px`)})}updated(changed){super.updated(changed),this.firstUpdateAnnouncementsReady&&changed.has("loading")&&this.loading&&this.announcementSink?.announce(this.loadingText());const announcesErrorTransition=this.firstUpdateAnnouncementsReady&&changed.has("error")&&this.error,announcesMountedError=!this.firstUpdateAnnouncementsReady&&this.announce&&this.error;if((announcesErrorTransition||announcesMountedError)&&this.errorAnnouncementSink?.announce(this.localizedOverride("tableLoadFailed",this.errorHeading)),this.firstUpdateAnnouncementsReady=!0,this.persistReady&&changed.has("priorityColumnsVisible")&&writePersistedState(this.storageFullKey,{priorityColumnsVisible:this.priorityColumnsVisible}),this.persistReady=!0,changed.has("columns")||changed.has("revealColumnsLabel")||changed.has("hideColumnsLabel")||changed.has("priorityColumnsVisible")||changed.has("storageKey")){const inertMembers=[],labelsInert=this.revealColumnsLabel!==void 0||this.hideColumnsLabel!==void 0;labelsInert&&inertMembers.push("`revealColumnsLabel`/`hideColumnsLabel`"),isPersistedPropertyExplicitlySet(this,"priorityColumnsVisible")&&inertMembers.push("`priorityColumnsVisible`"),this.storageKey&&inertMembers.push("`storageKey`"),inertMembers.length>0&&this.columns.length>0&&!this.columns.some(col=>col.priority)&&devWarnOnce(INERT_PRIORITY_COLUMN_CONFIG_WARNING,`<lr-table>: ${inertMembers.join(", ")} `+(inertMembers.length>1||labelsInert?"have":"has")+" no effect unless at least one column declares `priority`.")}(changed.has("columns")||changed.has("rows")||changed.has("rowKey"))&&this.applyStickyOffsets(),this.syncResizeHandleValues();const base=this.renderRoot.querySelector('[part="base"]');if(base&&this.observeBase(base),this.observeTable(this.renderRoot.querySelector('[part="table"]')??void 0),this.syncAutoScrollMode(),this.observeHeaders(),this.restoreRovingFocus(),this.hasAlwaysOnEditors&&this.restoreAlwaysOnEditorFocus(),changed.has("editingCell")&&this.editingCell){const{rowKey,columnKey}=this.editingCell;queueMicrotask(()=>this.editorElementFor(rowKey,columnKey)?.focus())}queueMicrotask(()=>this.recomputeHiddenPriorityColumns())}restoreRovingFocus(){const snapshot=this.rovingFocusSnapshot;if(this.rovingFocusSnapshot=null,snapshot===null)return;const internalActive=activeElementIn(this.shadowRoot);if(internalActive!==null&&internalActive!==snapshot.element)return;const documentActive=activeElementIn(this.ownerDocument);if(documentActive!==null&&documentActive!==this&&documentActive!==this.ownerDocument.body)return;const candidates=snapshot.kind==="header"?this.visibleHeaders():[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")],target=candidates.find(candidate=>snapshot.kind==="header"?candidate.dataset.colKey===snapshot.targetKey:candidate.dataset.rowKey===snapshot.targetKey)??candidates[Math.min(snapshot.index,candidates.length-1)]??null;snapshot.kind==="header"?this.focusHeader(target):this.focusRow(target)}activateColumn(key){this.activeColKey=key;const col=this.columnsByKey.get(key);if(!col?.sortable)return;const sortDir=this.sortKey===key?this.sortDir==="asc"?"desc":"asc":col.defaultSortDir??this.defaultSortDir,request=Object.freeze({phase:"request",sortKey:col.key,sortDir});this.emit("lr-sort-request",request,{cancelable:!0}).defaultPrevented||(this.sortMode==="client"&&(this.sortKey=col.key,this.sortDir=sortDir),this.emit("lr-sort",Object.freeze({phase:"commit",sortKey:col.key,sortDir})))}activateRow(key){this.activeRowKey=key;const entry=this.rowsByKey.get(key);if(entry===void 0)return;const{row,key:selectedKey}=entry;if(this.emit("lr-row-click",Object.freeze({row})),this.selectionMode==="single"){this.selectedRowKeys=this.asKeySet(new Set([selectedKey]));const rowKeys=this.asKeyList(Object.freeze([selectedKey]));this.emit("lr-selection-change",Object.freeze({rowKeys}))}else if(this.selectionMode==="multiple"){const rawKey=selectedKey,next=new Set(this._selectedKeys);next.has(rawKey)?next.delete(rawKey):next.add(rawKey),this.selectedRowKeys=this.asKeySet(next);const rowKeys=this.asKeyList(Object.freeze([...next]));this.emit("lr-selection-change",Object.freeze({rowKeys}))}}get hasAlwaysOnEditors(){return this.columns.some(col=>normalizedEditTrigger(col.editTrigger)==="always")}editorValue(row,column){const value=column.editValue?.(row)??row[column.key]??"";return String(value)}startEditing(rowKey,columnKey){const column=this.columnsByKey.get(columnKey);normalizedEditTrigger(column?.editTrigger)!=="double-click"||!this.rowsByKey.has(rowKey)||(this.editingCell={rowKey,columnKey})}commitEdit(event,rowKey,columnKey){event.stopPropagation();const field=event.currentTarget,entry=this.rowsByKey.get(rowKey),column=this.columnsByKey.get(columnKey),isTransient=this.editingCell?.rowKey===rowKey&&this.editingCell.columnKey===columnKey;if(!entry||!column||normalizedEditTrigger(column.editTrigger)===void 0){isTransient&&(this.editingCell=null);return}const value=column.editType==="number"&&field.value!==""?Number(field.value):field.value;this.emit("lr-cell-edit",Object.freeze({row:entry.row,columnKey,value})),isTransient&&(this.editingCell=null)}editorElementFor(rowKey,columnKey){return this.cellElementForToken(rowKey,columnKey)?.querySelector('[part="cell-editor"]')??null}restoreAlwaysOnEditorFocus(){const cell=this.focusedEditorCell;if(cell===null)return;const editor=this.editorElementFor(cell.rowKey,cell.columnKey);editor===null?this.focusedEditorCell=null:this.editorHadFocusBeforeUpdate&&activeElementIn(this.shadowRoot)!==editor&&editor.focus(),this.editorHadFocusBeforeUpdate=!1}activateExpandToggle(key){const entry=this.rowsByKey.get(encodeKey(key));if(entry===void 0)return;const expanded=!this._expandedKeys.has(key),detail=Object.freeze({row:entry.row,rowKey:key,expanded});if(this.expansionMode!=="single"&&this.expansionMode!=="multiple"){this.emit("lr-row-expand-toggle",detail);return}requestThenCommit({requestDetail:detail,emitRequest:(requestDetail,init)=>this.emit("lr-row-expand-request",requestDetail,init),commit:()=>{const next=this.expansionMode==="single"?new Set:new Set(this._expandedKeys);expanded?next.add(key):next.delete(key);const displaced=[...this._expandedKeys].filter(other=>other!==key&&!next.has(other));this.expandedRowKeys=this.asKeySet(next);for(const other of displaced){const displacedEntry=this.rowsByKey.get(encodeKey(other));displacedEntry!==void 0&&this.emit("lr-row-expand-toggle",Object.freeze({row:displacedEntry.row,rowKey:other,expanded:!1}))}this.emit("lr-row-expand-toggle",detail)}})}rowElement(rowKey){return this.rowElementForToken(encodeKey(rowKey))}cellElement(rowKey,columnKey){return this.cellElementForToken(encodeKey(rowKey),columnKey)}expandedContentElement(rowKey){const token=encodeKey(rowKey);return[...this.renderRoot.querySelectorAll("tbody tr[data-expanded-row-key]")].find(el=>el.dataset.expandedRowKey===token)?.querySelector('[part="expanded-cell"]')??null}rowElementForToken(token){return[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")].find(el=>el.dataset.rowKey===token)??null}cellElementForToken(token,columnKey){return[...this.rowElementForToken(token)?.querySelectorAll("td[data-col-key]")??[]].find(el=>el.dataset.colKey===columnKey)??null}visibleHeaders(){return[...this.renderRoot?.querySelectorAll("th[data-col-key]")??[]].filter(el=>el.offsetParent!==null)}focusHeader(el){el?.dataset.colKey&&(this.activeColKey=el.dataset.colKey,el.focus())}focusRow(el){el?.dataset.rowKey&&(this.activeRowKey=el.dataset.rowKey,el.focus())}onHeaderKeyDown(e,th){if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.activateColumn(th.dataset.colKey);return}const headers=this.visibleHeaders(),index=headers.indexOf(th);if(index<0)return;const rtl=isRtl(this);switch(e.key){case"ArrowLeft":e.preventDefault(),this.focusHeader(headers[rtl?Math.min(headers.length-1,index+1):Math.max(0,index-1)]??null);return;case"ArrowRight":e.preventDefault(),this.focusHeader(headers[rtl?Math.max(0,index-1):Math.min(headers.length-1,index+1)]??null);return;case"Home":e.preventDefault(),this.focusHeader(headers[0]??null);return;case"End":e.preventDefault(),this.focusHeader(headers[headers.length-1]??null);return;case"ArrowDown":{e.preventDefault();const rows=[...this.renderRoot.querySelectorAll("[data-row-key]")],key=this.focusedRowKey();this.focusRow(rows.find(r=>r.dataset.rowKey===key)??rows[0]??null);return}default:return}}onRowKeyDown(e,tr){if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.activateRow(tr.dataset.rowKey);return}const bodyRows=[...this.renderRoot.querySelectorAll("[data-row-key]")],index=bodyRows.indexOf(tr);if(!(index<0))switch(e.key){case"ArrowDown":e.preventDefault(),this.focusRow(bodyRows[Math.min(bodyRows.length-1,index+1)]??null);return;case"ArrowUp":if(e.preventDefault(),index===0){const headers=this.visibleHeaders(),key=this.focusedColKey();this.focusHeader(headers.find(h=>h.dataset.colKey===key)??headers[0]??null)}else this.focusRow(bodyRows[index-1]??null);return;case"Home":e.preventDefault(),this.focusRow(bodyRows[0]??null);return;case"End":e.preventDefault(),this.focusRow(bodyRows[bodyRows.length-1]??null);return;default:return}}renderCellValue(col,row){return typeof col.cell=="function"?col.cell(row):(devWarnOnce(MISSING_CELL_RENDERER_WARNING,"<lr-table>: a column has no required `cell` renderer, so its cells render empty. Supply a `cell` callback for every column."),nothing)}renderCellEditor(row,col,rowKey,alwaysOn){const type=col.editType??"text",value=this.editorValue(row,col),label=this.localize("tableEditCell",void 0,{column:col.label}),onChange=event=>this.commitEdit(event,rowKey,col.key),onKeyDown=event=>this.onEditorKeyDown(event,rowKey,col.key);if(type==="select"){const options=col.editOptions??[];return html`<select
14
+ ></span>`}syncResizeHandleValues(){for(const handle of this.renderRoot.querySelectorAll('[part="resize-handle"]')){const key=handle.dataset.colKey;if(!key)continue;const column=this.columnsByKey.get(key);if(!column||this.resizedColumnWidths.has(key)||this.parsePixelLength(column.width)!==void 0)continue;const rendered=handle.closest("th[data-col-key]")?.getBoundingClientRect().width;if(rendered&&rendered>0){const width=Math.round(rendered);handle.setAttribute("aria-valuenow",String(width)),handle.setAttribute("aria-valuetext",this.resizeValueText(width))}}}detachResizePointerListeners(){const resizeEventWindow=this.resizeEventWindow;resizeEventWindow&&(resizeEventWindow.removeEventListener("pointermove",this.onResizePointerMove),resizeEventWindow.removeEventListener("pointerup",this.onResizePointerEnd),resizeEventWindow.removeEventListener("pointercancel",this.onResizePointerEnd),resizeEventWindow.removeEventListener("lostpointercapture",this.onResizePointerEnd),this.resizeEventWindow=void 0)}rollbackResizePreview(state2){const reverted=new Map(this.resizedColumnWidths);state2.previousWidth===void 0?reverted.delete(state2.key):reverted.set(state2.key,state2.previousWidth),this.resizedColumnWidths=reverted}cancelResizeGesture(){const state2=this.resizeState;if(this.resizeState=void 0,this.detachResizePointerListeners(),!!state2){state2.handle.removeAttribute("data-resizing");try{state2.handle.releasePointerCapture?.(state2.pointerId)}catch{}this.rollbackResizePreview(state2)}}firstUpdated(changed){super.firstUpdated(changed),!this.accessibleLabel&&!this.hasAttribute("aria-label")&&!this.caption&&devWarnOnce(MISSING_ACCESSIBLE_NAME_WARNING,"<lr-table> has no accessible name: set `accessibleLabel`, a host `aria-label`, or `caption` so assistive technology can identify the grid.")}connectedCallback(){super.connectedCallback(),this.syncAnnouncementSink();const owner=this.ownerDocument.defaultView,ResizeObserverCtor=owner?.ResizeObserver;let observer;ResizeObserverCtor&&(observer=new ResizeObserverCtor(()=>{!this.isConnected||this.ownerDocument.defaultView!==owner||this.resizeObserver!==observer||this.scheduleLayoutSync()})),this.resizeObserver=observer;const base=this.renderRoot?.querySelector('[part="base"]');base&&(this.observeBase(base),this.observeTable(this.renderRoot.querySelector('[part="table"]')??void 0),this.observeHeaders())}disconnectedCallback(){super.disconnectedCallback(),this.releaseAnnouncementSink(),this.cancelResizeGesture(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0;const frame=this.layoutFrame;frame&&frame.owner.cancelAnimationFrame(frame.handle),this.layoutFrame=null,this.observedBase=void 0,this.observedTable=void 0,this.observedHeaders.clear()}releaseAnnouncementSink(){this.announcementSink?.release(),this.announcementSink=void 0,this.errorAnnouncementSink?.release(),this.errorAnnouncementSink=void 0}syncAnnouncementSink(){if(!this.isConnected){this.releaseAnnouncementSink();return}this.announcementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseAnnouncementSink(),this.announcementSink=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}),this.errorAnnouncementSink=acquireAnnouncementSink("assertive",{document:this.ownerDocument,source:this}))}localizedOverride(key,override){return override??this.localize(key)}loadingText(){return this.localizedOverride("tableLoading",this.loadingLabel)}observeBase(base){this.observedBase!==base&&(this.observedBase&&this.resizeObserver?.unobserve(this.observedBase),this.resizeObserver?.observe(base),this.observedBase=base)}observeTable(table){this.observedTable!==table&&(this.observedTable&&this.resizeObserver?.unobserve(this.observedTable),table&&this.resizeObserver?.observe(table),this.observedTable=table)}syncAutoScrollMode(){const base=this.renderRoot.querySelector('[part="base"]');if(!base)return;const overflows=this.scrollMode==="auto"&&base.scrollWidth-base.clientWidth>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX;base.toggleAttribute("data-scroll-overflow",overflows)}observeHeaders(){const headers=new Set(this.columns.some(column=>column.sticky||column.resizable)?this.renderRoot.querySelectorAll("th[data-col-key]"):[]);for(const header of this.observedHeaders)headers.has(header)||(this.resizeObserver?.unobserve(header),this.observedHeaders.delete(header));for(const header of headers)this.observedHeaders.has(header)||(this.observedHeaders.add(header),this.resizeObserver?.observe(header))}priorityTierHeaders(tier){return[...this.renderRoot.querySelectorAll(`th[data-priority="${tier}"]`)]}recomputeHiddenPriorityColumns(){const hasLowColumn=this.columns.some(col=>col.priority==="low"),hasMediumColumn=this.columns.some(col=>col.priority==="medium"),base=this.renderRoot.querySelector('[part="base"]');if(!hasLowColumn&&!hasMediumColumn){this.priorityTierNaturalWidth.clear(),this.alwaysVisibleNaturalWidth=void 0,base?.removeAttribute("data-hide-priority-low"),base?.removeAttribute("data-hide-priority-medium"),this.rehomeFocusedColumn(),this.priorityToggleAvailable&&(this.priorityToggleAvailable=!1),this.hasHiddenPriorityColumns&&(this.hasHiddenPriorityColumns=!1);return}if(!base||base.clientWidth<=0){this.rehomeFocusedColumn();return}const genuineOverflow=base.scrollWidth-base.clientWidth>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,lowHeaders=hasLowColumn?this.priorityTierHeaders("low"):[],mediumHeaders=hasMediumColumn?this.priorityTierHeaders("medium"):[],refreshNaturalWidth=(tier,headers)=>{if(headers.length===0)return!1;const currentlyHidden=headers.every(header=>header.offsetParent===null);if(!currentlyHidden&&genuineOverflow){const width=headers.reduce((sum,header)=>sum+header.getBoundingClientRect().width,0);width>0&&this.priorityTierNaturalWidth.set(tier,width)}return currentlyHidden},lowActuallyHidden=refreshNaturalWidth("low",lowHeaders),mediumActuallyHidden=refreshNaturalWidth("medium",mediumHeaders);if(genuineOverflow){const alwaysWidth=[...this.renderRoot.querySelectorAll("th[data-col-key]")].filter(header=>!header.hasAttribute("data-priority")).reduce((sum,header)=>sum+header.getBoundingClientRect().width,0);alwaysWidth>0&&(this.alwaysVisibleNaturalWidth=alwaysWidth)}const lowNaturalWidth=this.priorityTierNaturalWidth.get("low")??0,mediumNaturalWidth=this.priorityTierNaturalWidth.get("medium")??0,overflowAtFull=(lowActuallyHidden||mediumActuallyHidden?(this.alwaysVisibleNaturalWidth??0)+lowNaturalWidth+mediumNaturalWidth:base.scrollWidth)-base.clientWidth,needsLow=hasLowColumn&&overflowAtFull>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX,overflowAfterLow=needsLow?overflowAtFull-lowNaturalWidth:overflowAtFull,needsMedium=hasMediumColumn&&overflowAfterLow>TABLE_SCROLL_OVERFLOW_TOLERANCE_PX;base.toggleAttribute("data-hide-priority-low",needsLow),base.toggleAttribute("data-hide-priority-medium",needsMedium),this.rehomeFocusedColumn();const toggleAvailable=needsLow||needsMedium,anyPriorityHidden=toggleAvailable&&!this.priorityColumnsVisible;this.priorityToggleAvailable!==toggleAvailable&&(this.priorityToggleAvailable=toggleAvailable),this.hasHiddenPriorityColumns!==anyPriorityHidden&&(this.hasHiddenPriorityColumns=anyPriorityHidden)}rehomeFocusedColumn(){const visible=this.visibleHeaders();visible.length===0||this.activeColKey===null||visible.some(header=>header.dataset.colKey===this.activeColKey)||(this.activeColKey=visible[0].dataset.colKey??null)}keyOf(row,index){try{const key=this.rowKey?this.rowKey(row):index;return typeof key=="string"?key.trim().length===0?void 0:key:typeof key=="number"?key:void 0}catch{return}}canonicalRowEntries(){const inputs=this.canonicalRowEntriesInputs;if(this.cachedCanonicalRowEntries!==null&&inputs?.rows===this.rows&&inputs.rowKey===this.rowKey)return this.cachedCanonicalRowEntries;const entries=[],seen=new Set;return this.rows.forEach((row,index)=>{const key=this.keyOf(row,index);if(key===void 0)return;const encoded=encodeKey(key);seen.has(encoded)||(seen.add(encoded),entries.push({row,index,key}))}),this.canonicalRowEntriesInputs={rows:this.rows,rowKey:this.rowKey},this.cachedCanonicalRowEntries=entries,entries}matchingEntries(){const text=(this.filterText??"").trim(),locale=text===""?"":this.effectiveLocale,canonicalEntries=this.canonicalRowEntries(),inputs=this.matchingEntriesInputs;if(this.cachedMatchingEntries!==null&&inputs!==null&&inputs.entries===canonicalEntries&&inputs.filter===this.filter&&inputs.text===text&&inputs.locale===locale)return this.cachedMatchingEntries;let entries;if(text==="")entries=canonicalEntries;else{const intlLocale=this.effectiveLocale,normalized=text.toLocaleLowerCase(intlLocale);entries=canonicalEntries.filter(({row})=>this.filter?this.filter(row,text):safeStringifyForFilter(row).toLocaleLowerCase(intlLocale).includes(normalized))}return this.matchingEntriesInputs={entries:canonicalEntries,filter:this.filter,text,locale},this.cachedMatchingEntries=entries,entries}get normalizedPageSize(){return finiteInteger(this.pageSize,DEFAULT_PAGE_SIZE,1,MAX_PAGE_SIZE)}get effectiveSkeletonRows(){const explicit=finiteCount(this.skeletonRows,0,MAX_SKELETON_ROWS);if(explicit>0)return explicit;const pageSize=this.normalizedPageSize;return pageSize===DEFAULT_PAGE_SIZE?DEFAULT_SKELETON_ROWS:Math.min(pageSize,MAX_SKELETON_ROWS)}get matchingTotalItems(){const totalItems=finiteInteger(this.totalItems,-1);return totalItems>=0?totalItems:this.matchingEntries().length}get serverUnknownTotal(){return this.paginationMode==="server"&&this.unknownTotal}get pageCount(){const pageSize=this.normalizedPageSize;return pageSize>0?Math.ceil(this.matchingTotalItems/pageSize):0}get appliedPage(){return this.pageCount===0?1:finiteInteger(this.page,1,1,this.pageCount)}sortedEntries(){const entries=this.matchingEntries();if(this.sortMode!=="client"||this.sortKey==="")return entries;const col=this.columnsByKey.get(this.sortKey);if(!col?.sortable)return entries;const locale=this.effectiveLocale,inputs=this.sortedEntriesInputs;if(this.cachedSortedEntries!==null&&inputs!==null&&inputs.entries===entries&&inputs.columns===this.columns&&inputs.mode===this.sortMode&&inputs.key===this.sortKey&&inputs.dir===this.sortDir&&inputs.locale===locale&&inputs.groupBy===this.groupBy)return this.cachedSortedEntries;const collator=getCollator(locale,{numeric:!0}),dir=this.sortDir==="desc"?-1:1,decorated=entries.map(entry=>{const raw=typeof col.sortValue=="function"?col.sortValue(entry.row):typeof col.cell=="function"?String(col.cell(entry.row)??""):"";return{entry,value:typeof raw=="number"&&!Number.isFinite(raw)?null:raw}}),compare=(a,b)=>{const av=a.value,bv=b.value;return av==null&&bv==null?0:av==null?1:bv==null?-1:typeof av=="number"&&typeof bv=="number"?(av-bv)*dir:collator.compare(String(av),String(bv))*dir};let sorted;const groupBy=this.groupBy;if(groupBy===void 0)decorated.sort(compare),sorted=decorated.map(decoration=>decoration.entry);else{const buckets=new Map;for(const decoration of decorated){const groupKey=groupBy(decoration.entry.row),bucket=buckets.get(groupKey);bucket===void 0?buckets.set(groupKey,[decoration]):bucket.push(decoration)}const ordered=[...buckets.values()],constantWithinEveryGroup=ordered.every(bucket=>bucket.every(decoration=>compare(decoration,bucket[0])===0));constantWithinEveryGroup&&ordered.sort((a,b)=>compare(a[0],b[0])),sorted=[];for(const bucket of ordered){constantWithinEveryGroup||bucket.sort(compare);for(const decoration of bucket)sorted.push(decoration.entry)}}return this.sortedEntriesInputs={entries,columns:this.columns,mode:this.sortMode,key:this.sortKey,dir:this.sortDir,locale,groupBy},this.cachedSortedEntries=sorted,sorted}renderedEntries(){const entries=this.sortedEntries();if(this.paginationMode==="server")return entries.slice(0,this.normalizedPageSize);const start=(this.appliedPage-1)*this.normalizedPageSize;return entries.slice(start,start+this.normalizedPageSize)}get viewRows(){return Object.freeze(this.sortedEntries().map(entry=>entry.row))}get pageRows(){return Object.freeze(this.renderedEntries().map(entry=>entry.row))}focusedColKey(){const visible=this.visibleHeaders(),visibleKeys=new Set(visible.map(el=>el.dataset.colKey).filter(key=>key!==void 0&&this.columnsByKey.has(key)));return this.activeColKey!==null&&this.columnsByKey.has(this.activeColKey)&&(visibleKeys.size===0||visibleKeys.has(this.activeColKey))?this.activeColKey:visible.find(el=>el.dataset.colKey!==void 0&&this.columnsByKey.has(el.dataset.colKey))?.dataset.colKey??this.columns[0]?.key??null}focusedRowKey(){if(this.activeRowKey!==null&&this.rowsByKey.has(this.activeRowKey))return this.activeRowKey;const selectedKey=this._selectedKeys.values().next().value;if(selectedKey!==void 0){const selected=encodeKey(selectedKey);if(this.rowsByKey.has(selected))return selected}const first=this.renderedEntries()[0];return first?encodeKey(first.key):null}rowsAffectingRovingFocusChanged(changed){return changed.has("rows")||changed.has("rowKey")||changed.has("filterText")||changed.has("filter")||changed.has("page")||changed.has("pageSize")||changed.has("paginationMode")||changed.has("totalItems")||changed.has("columns")||changed.has("sortKey")||changed.has("sortDir")||changed.has("sortMode")||changed.has("groupBy")||this.rowsLocale!==this.effectiveLocale}captureRovingFocus(changed){this.rovingFocusSnapshot=null;const active=activeElementIn(this.shadowRoot),HTMLElementCtor=this.ownerDocument?.defaultView?.HTMLElement;if(!(!HTMLElementCtor||!(active instanceof HTMLElementCtor))){if(changed.has("columns")&&active.matches("th[data-col-key]")){const headers=this.visibleHeaders(),key=active.dataset.colKey,index=headers.indexOf(active);key!==void 0&&index>=0&&(this.rovingFocusSnapshot={kind:"header",key,index,targetKey:null,element:active});return}if(this.rowsAffectingRovingFocusChanged(changed)&&active.matches("tr[data-row-key]")){const renderedRows=[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")],key=active.dataset.rowKey,index=renderedRows.indexOf(active);key!==void 0&&index>=0&&(this.rovingFocusSnapshot={kind:"row",key,index,targetKey:null,element:active})}}}resolveRovingFocusTarget(){const snapshot=this.rovingFocusSnapshot;if(snapshot===null)return;const keys=snapshot.kind==="header"?this.columns.map(column=>column.key):[...this.rowsByKey.keys()];snapshot.targetKey=keys.includes(snapshot.key)?snapshot.key:keys[Math.min(snapshot.index,keys.length-1)]??null,snapshot.kind==="header"?this.activeColKey=snapshot.targetKey:this.activeRowKey=snapshot.targetKey}willUpdate(changed){if(super.willUpdate(changed),this.captureRovingFocus(changed),this.selectionMode==="single"&&this._selectedKeys.size>1&&(changed.has("selectionMode")||changed.has("selectedRowKeys"))){const first=this._selectedKeys.values().next().value;if(this.selectedRowKeys=this.asKeySet(first===void 0?new Set:new Set([first])),this.hasUpdated){const rowKeys=this.asKeyList(Object.freeze(first===void 0?[]:[first]));this.emit("lr-selection-change",Object.freeze({rowKeys}))}}if(this.expansionMode==="single"&&this._expandedKeys.size>1&&(changed.has("expansionMode")||changed.has("expandedRowKeys"))){const first=this._expandedKeys.values().next().value;this.expandedRowKeys=this.asKeySet(first===void 0?new Set:new Set([first]))}if(!this.hasUpdated){const parsed=readPersistedState(this.storageFullKey,v=>typeof v=="object"&&v!==null);parsed&&typeof parsed.priorityColumnsVisible=="boolean"&&!isPersistedPropertyExplicitlySet(this,"priorityColumnsVisible")&&(this.priorityColumnsVisible=parsed.priorityColumnsVisible)}if(changed.has("columns")&&(this.columnsByKey=new Map(this.columns.map(c=>[c.key,c]))),this.rowsAffectingRovingFocusChanged(changed)&&(this.rowsByKey=new Map(this.renderedEntries().map(entry=>[encodeKey(entry.key),entry])),this.rowsLocale=this.effectiveLocale),this.resolveRovingFocusTarget(),this.editingCell!==null){const column=this.columnsByKey.get(this.editingCell.columnKey);(!this.rowsByKey.has(this.editingCell.rowKey)||normalizedEditTrigger(column?.editTrigger)!=="double-click")&&(this.editingCell=null)}this.editorHadFocusBeforeUpdate=this.focusedEditorCell!==null&&activeElementIn(this.shadowRoot)===this.editorElementFor(this.focusedEditorCell.rowKey,this.focusedEditorCell.columnKey)}stickyOffsets(){const offsets=new Map,headerWidths=new Map;for(const el of this.renderRoot.querySelectorAll("th[data-col-key]")){const key=el.dataset.colKey;key!==void 0&&!headerWidths.has(key)&&headerWidths.set(key,el.offsetWidth)}const headerWidth=key=>headerWidths.get(key)??0;let runningStart=0;for(const col of this.columns)stickyDirection(col.sticky)==="start"&&(offsets.set(col.key,runningStart),runningStart+=headerWidth(col.key));let runningEnd=0;for(let i=this.columns.length-1;i>=0;i--){const col=this.columns[i];col&&stickyDirection(col.sticky)==="end"&&(offsets.set(col.key,runningEnd),runningEnd+=headerWidth(col.key))}return offsets}computeHeatDomain(hasHeatTint){if(!hasHeatTint)return null;const values=[];for(const entry of this.matchingEntries())for(const col of this.columns){const v=col.heatValue?.(entry.row);v!=null&&Number.isFinite(v)&&values.push(v)}const auto=minMax(values),lo=this.heatTintScale?.min??auto?.[0],hi=this.heatTintScale?.max??auto?.[1];return lo===void 0||hi===void 0?null:[lo,hi]}heatShare(col,row,domain){if(!col.heatValue||!domain)return null;const v=col.heatValue(row);if(v==null||!Number.isFinite(v))return null;const[lo,hi]=domain;return`${(finiteRatio(v,lo,hi)*100).toFixed(2)}%`}applyStickyOffsets(){if(!this.columns.some(c=>c.sticky))return;const offsets=this.stickyOffsets();this.renderRoot.querySelectorAll("[data-col-key]").forEach(el=>{const key=el.dataset.colKey;key!==void 0&&offsets.has(key)&&el.style.setProperty("--lr-table-sticky-offset",`${offsets.get(key)}px`)})}updated(changed){super.updated(changed),this.firstUpdateAnnouncementsReady&&changed.has("loading")&&this.loading&&this.announcementSink?.announce(this.loadingText());const announcesErrorTransition=this.firstUpdateAnnouncementsReady&&changed.has("error")&&this.error,announcesMountedError=!this.firstUpdateAnnouncementsReady&&this.announce&&this.error;if((announcesErrorTransition||announcesMountedError)&&this.errorAnnouncementSink?.announce(this.localizedOverride("tableLoadFailed",this.errorHeading)),this.firstUpdateAnnouncementsReady=!0,this.persistReady&&changed.has("priorityColumnsVisible")&&writePersistedState(this.storageFullKey,{priorityColumnsVisible:this.priorityColumnsVisible}),this.persistReady=!0,changed.has("columns")||changed.has("revealColumnsLabel")||changed.has("hideColumnsLabel")||changed.has("priorityColumnsVisible")||changed.has("storageKey")){const inertMembers=[],labelsInert=this.revealColumnsLabel!==void 0||this.hideColumnsLabel!==void 0;labelsInert&&inertMembers.push("`revealColumnsLabel`/`hideColumnsLabel`"),isPersistedPropertyExplicitlySet(this,"priorityColumnsVisible")&&inertMembers.push("`priorityColumnsVisible`"),this.storageKey&&inertMembers.push("`storageKey`"),inertMembers.length>0&&this.columns.length>0&&!this.columns.some(col=>col.priority)&&devWarnOnce(INERT_PRIORITY_COLUMN_CONFIG_WARNING,`<lr-table>: ${inertMembers.join(", ")} `+(inertMembers.length>1||labelsInert?"have":"has")+" no effect unless at least one column declares `priority`.")}(changed.has("columns")||changed.has("rows")||changed.has("rowKey"))&&this.applyStickyOffsets(),this.syncResizeHandleValues();const base=this.renderRoot.querySelector('[part="base"]');if(base&&this.observeBase(base),this.observeTable(this.renderRoot.querySelector('[part="table"]')??void 0),this.syncAutoScrollMode(),this.observeHeaders(),this.restoreRovingFocus(),this.hasAlwaysOnEditors&&this.restoreAlwaysOnEditorFocus(),changed.has("editingCell"))if(this.editingCell){const{rowKey,columnKey}=this.editingCell;queueMicrotask(()=>this.editorElementFor(rowKey,columnKey)?.focus())}else{const previous=changed.get("editingCell");if(previous){const{rowKey,columnKey}=previous;queueMicrotask(()=>this.cellElementForToken(rowKey,columnKey)?.focus())}}queueMicrotask(()=>this.recomputeHiddenPriorityColumns())}restoreRovingFocus(){const snapshot=this.rovingFocusSnapshot;if(this.rovingFocusSnapshot=null,snapshot===null)return;const internalActive=activeElementIn(this.shadowRoot);if(internalActive!==null&&internalActive!==snapshot.element)return;const documentActive=activeElementIn(this.ownerDocument);if(documentActive!==null&&documentActive!==this&&documentActive!==this.ownerDocument.body)return;const candidates=snapshot.kind==="header"?this.visibleHeaders():[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")],target=candidates.find(candidate=>snapshot.kind==="header"?candidate.dataset.colKey===snapshot.targetKey:candidate.dataset.rowKey===snapshot.targetKey)??candidates[Math.min(snapshot.index,candidates.length-1)]??null;snapshot.kind==="header"?this.focusHeader(target):this.focusRow(target)}activateColumn(key){this.activeColKey=key;const col=this.columnsByKey.get(key);if(!col?.sortable)return;const sortDir=this.sortKey===key?this.sortDir==="asc"?"desc":"asc":col.defaultSortDir??this.defaultSortDir,request=Object.freeze({phase:"request",sortKey:col.key,sortDir});this.emit("lr-sort-request",request,{cancelable:!0}).defaultPrevented||(this.sortMode==="client"&&(this.sortKey=col.key,this.sortDir=sortDir),this.emit("lr-sort",Object.freeze({phase:"commit",sortKey:col.key,sortDir})))}activateRow(key){this.activeRowKey=key;const entry=this.rowsByKey.get(key);if(entry===void 0)return;const{row,key:selectedKey}=entry;if(this.emit("lr-row-click",Object.freeze({row})),this.selectionMode==="single"){this.selectedRowKeys=this.asKeySet(new Set([selectedKey]));const rowKeys=this.asKeyList(Object.freeze([selectedKey]));this.emit("lr-selection-change",Object.freeze({rowKeys}))}else if(this.selectionMode==="multiple"){const rawKey=selectedKey,next=new Set(this._selectedKeys);next.has(rawKey)?next.delete(rawKey):next.add(rawKey),this.selectedRowKeys=this.asKeySet(next);const rowKeys=this.asKeyList(Object.freeze([...next]));this.emit("lr-selection-change",Object.freeze({rowKeys}))}}get hasAlwaysOnEditors(){return this.columns.some(col=>normalizedEditTrigger(col.editTrigger)==="always")}editorValue(row,column){const value=column.editValue?.(row)??row[column.key]??"";return String(value)}startEditing(rowKey,columnKey){const column=this.columnsByKey.get(columnKey);normalizedEditTrigger(column?.editTrigger)!=="double-click"||!this.rowsByKey.has(rowKey)||(this.editingCell={rowKey,columnKey})}commitEdit(event,rowKey,columnKey){event.stopPropagation();const field=event.currentTarget,entry=this.rowsByKey.get(rowKey),column=this.columnsByKey.get(columnKey),isTransient=this.editingCell?.rowKey===rowKey&&this.editingCell.columnKey===columnKey;if(!entry||!column||normalizedEditTrigger(column.editTrigger)===void 0){isTransient&&(this.editingCell=null);return}const value=column.editType==="number"&&field.value!==""?Number(field.value):field.value;this.emit("lr-cell-edit",Object.freeze({row:entry.row,columnKey,value})),isTransient&&(this.editingCell=null)}editorElementFor(rowKey,columnKey){return this.cellElementForToken(rowKey,columnKey)?.querySelector('[part="cell-editor"]')??null}restoreAlwaysOnEditorFocus(){const cell=this.focusedEditorCell;if(cell===null)return;const editor=this.editorElementFor(cell.rowKey,cell.columnKey);editor===null?this.focusedEditorCell=null:this.editorHadFocusBeforeUpdate&&activeElementIn(this.shadowRoot)!==editor&&editor.focus(),this.editorHadFocusBeforeUpdate=!1}activateExpandToggle(key){const entry=this.rowsByKey.get(encodeKey(key));if(entry===void 0)return;const expanded=!this._expandedKeys.has(key),detail=Object.freeze({row:entry.row,rowKey:key,expanded});if(this.expansionMode!=="single"&&this.expansionMode!=="multiple"){this.emit("lr-row-expand-toggle",detail);return}requestThenCommit({requestDetail:detail,emitRequest:(requestDetail,init)=>this.emit("lr-row-expand-request",requestDetail,init),commit:()=>{const next=this.expansionMode==="single"?new Set:new Set(this._expandedKeys);expanded?next.add(key):next.delete(key);const displaced=[...this._expandedKeys].filter(other=>other!==key&&!next.has(other));this.expandedRowKeys=this.asKeySet(next);for(const other of displaced){const displacedEntry=this.rowsByKey.get(encodeKey(other));displacedEntry!==void 0&&this.emit("lr-row-expand-toggle",Object.freeze({row:displacedEntry.row,rowKey:other,expanded:!1}))}this.emit("lr-row-expand-toggle",detail)}})}rowElement(rowKey){return this.rowElementForToken(encodeKey(rowKey))}cellElement(rowKey,columnKey){return this.cellElementForToken(encodeKey(rowKey),columnKey)}editCell(rowKey,columnKey){const token=encodeKey(rowKey),trigger=normalizedEditTrigger(this.columnsByKey.get(columnKey)?.editTrigger);if(!(trigger===void 0||!this.rowsByKey.has(token))){if(trigger==="always"){this.editorElementFor(token,columnKey)?.focus();return}this.startEditing(token,columnKey)}}expandedContentElement(rowKey){const token=encodeKey(rowKey);return[...this.renderRoot.querySelectorAll("tbody tr[data-expanded-row-key]")].find(el=>el.dataset.expandedRowKey===token)?.querySelector('[part="expanded-cell"]')??null}rowElementForToken(token){return[...this.renderRoot.querySelectorAll("tbody tr[data-row-key]")].find(el=>el.dataset.rowKey===token)??null}cellElementForToken(token,columnKey){return[...this.rowElementForToken(token)?.querySelectorAll("td[data-col-key]")??[]].find(el=>el.dataset.colKey===columnKey)??null}visibleHeaders(){return[...this.renderRoot?.querySelectorAll("th[data-col-key]")??[]].filter(el=>el.offsetParent!==null)}focusHeader(el){el?.dataset.colKey&&(this.activeColKey=el.dataset.colKey,el.focus())}focusRow(el){el?.dataset.rowKey&&(this.activeRowKey=el.dataset.rowKey,el.focus())}onHeaderKeyDown(e,th){if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.activateColumn(th.dataset.colKey);return}const headers=this.visibleHeaders(),index=headers.indexOf(th);if(index<0)return;const rtl=isRtl(this);switch(e.key){case"ArrowLeft":e.preventDefault(),this.focusHeader(headers[rtl?Math.min(headers.length-1,index+1):Math.max(0,index-1)]??null);return;case"ArrowRight":e.preventDefault(),this.focusHeader(headers[rtl?Math.max(0,index-1):Math.min(headers.length-1,index+1)]??null);return;case"Home":e.preventDefault(),this.focusHeader(headers[0]??null);return;case"End":e.preventDefault(),this.focusHeader(headers[headers.length-1]??null);return;case"ArrowDown":{e.preventDefault();const rows=[...this.renderRoot.querySelectorAll("[data-row-key]")],key=this.focusedRowKey();this.focusRow(rows.find(r=>r.dataset.rowKey===key)??rows[0]??null);return}default:return}}editableCellFor(target){const columnKey=target.dataset.colKey;return target.tagName!=="TD"||columnKey===void 0?null:normalizedEditTrigger(this.columnsByKey.get(columnKey)?.editTrigger)==="double-click"?{element:target,columnKey}:null}editableCellsInRow(tr){return[...tr.querySelectorAll("td[data-editable]")].filter(td=>td.offsetParent!==null&&!td.inert&&!td.closest("[inert]"))}onRowKeyDown(e,tr){const cell=this.editableCellFor(e.target);if((e.key==="Enter"||e.key==="F2")&&cell){e.preventDefault(),this.startEditing(tr.dataset.rowKey,cell.columnKey);return}if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.activateRow(tr.dataset.rowKey);return}if(e.key==="ArrowLeft"||e.key==="ArrowRight"){this.onRowLateralKeyDown(e,tr,cell);return}const bodyRows=[...this.renderRoot.querySelectorAll("[data-row-key]")],index=bodyRows.indexOf(tr);if(!(index<0))switch(e.key){case"ArrowDown":e.preventDefault(),this.focusRow(bodyRows[Math.min(bodyRows.length-1,index+1)]??null);return;case"ArrowUp":if(e.preventDefault(),index===0){const headers=this.visibleHeaders(),key=this.focusedColKey();this.focusHeader(headers.find(h=>h.dataset.colKey===key)??headers[0]??null)}else this.focusRow(bodyRows[index-1]??null);return;case"Home":e.preventDefault(),this.focusRow(bodyRows[0]??null);return;case"End":e.preventDefault(),this.focusRow(bodyRows[bodyRows.length-1]??null);return;default:return}}onRowLateralKeyDown(e,tr,cell){const cells=this.editableCellsInRow(tr);if(cells.length===0)return;e.preventDefault();const forward=e.key===(isRtl(this)?"ArrowLeft":"ArrowRight");if(cell===null){(forward?cells[0]:cells[cells.length-1])?.focus();return}const index=cells.indexOf(cell.element);forward?cells[index+1]?.focus():index<=0?this.focusRow(tr):cells[index-1]?.focus()}renderCellValue(col,row){return typeof col.cell=="function"?col.cell(row):(devWarnOnce(MISSING_CELL_RENDERER_WARNING,"<lr-table>: a column has no required `cell` renderer, so its cells render empty. Supply a `cell` callback for every column."),nothing)}renderCellEditor(row,col,rowKey,alwaysOn){const type=col.editType??"text",value=this.editorValue(row,col),label=col.editLabel?.(row)??this.localize("tableEditCell",void 0,{column:col.label}),onChange=event=>this.commitEdit(event,rowKey,col.key),onKeyDown=event=>this.onEditorKeyDown(event,rowKey,col.key);if(type==="select"){const options=col.editOptions??[];return html`<select
15
15
  part="cell-editor"
16
16
  aria-label=${label}
17
17
  .value=${value}
@@ -152,13 +152,13 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
152
152
  type="button"
153
153
  part="row-expand-toggle"
154
154
  aria-expanded=${String(rowExpanded)}
155
- aria-label=${this.localize(rowExpanded?"collapse":"expand")}
155
+ aria-label=${this.rowExpandLabel?.(row,rowExpanded)??this.localize(rowExpanded?"collapse":"expand")}
156
156
  @click=${()=>this.activateExpandToggle(key)}
157
157
  >
158
158
  <span part="row-expand-icon" aria-hidden="true">${chevronIcon()}</span>
159
159
  </button>`:nothing}
160
160
  </td>`:nothing}
161
- ${this.columns.map(col=>{const heatShare=this.heatShare(col,row,heatDomain),cellStyle={...sanitizeCellStyle(typeof col.cellStyle=="function"?col.cellStyle(row)??{}:void 0),...heatShare!==null?{"--lr-table-heat-t":heatShare}:{}},alwaysOn=normalizedEditTrigger(col.editTrigger)==="always",editing=alwaysOn||normalizedEditTrigger(col.editTrigger)==="double-click"&&this.editingCell?.rowKey===encodeKey(key)&&this.editingCell.columnKey===col.key,cellTitle=editing?void 0:col.cellTitle?.(row);return html`<td
161
+ ${this.columns.map(col=>{const heatShare=this.heatShare(col,row,heatDomain),cellStyle={...sanitizeCellStyle(typeof col.cellStyle=="function"?col.cellStyle(row)??{}:void 0),...heatShare!==null?{"--lr-table-heat-t":heatShare}:{}},trigger=normalizedEditTrigger(col.editTrigger),alwaysOn=trigger==="always",doubleClickEditable=trigger==="double-click",editing=alwaysOn||doubleClickEditable&&this.editingCell?.rowKey===encodeKey(key)&&this.editingCell.columnKey===col.key,cellTitle=editing?void 0:col.cellTitle?.(row);return html`<td
162
162
  part="cell"
163
163
  role="gridcell"
164
164
  data-col-key=${col.key}
@@ -166,6 +166,8 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
166
166
  data-priority=${col.priority??nothing}
167
167
  data-sticky=${stickyDirection(col.sticky)??nothing}
168
168
  ?data-heat=${heatShare!==null}
169
+ ?data-editable=${doubleClickEditable}
170
+ tabindex=${doubleClickEditable?"-1":nothing}
169
171
  title=${cellTitle||nothing}
170
172
  style=${Object.keys(cellStyle).length?styleMap(cellStyle):nothing}
171
173
  >
@@ -241,4 +243,4 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
241
243
  @lr-page-change=${this.onPaginationChange}
242
244
  ></lr-pagination>`:nothing}
243
245
  </div>
244
- `}}__decorate([property({attribute:!1})],LyraTable.prototype,"columns",null),__decorate([property({attribute:!1})],LyraTable.prototype,"rows",null),__decorate([property({reflect:!0,converter:TABLE_LAYOUT})],LyraTable.prototype,"layout",null),__decorate([property({attribute:"sort-key"})],LyraTable.prototype,"sortKey",void 0),__decorate([property({attribute:"sort-dir"})],LyraTable.prototype,"sortDir",void 0),__decorate([property({attribute:"sort-indicators",converter:literalSetConverter(["active","all"],"active")})],LyraTable.prototype,"sortIndicators",void 0),__decorate([property({reflect:!0,attribute:"sort-mode"})],LyraTable.prototype,"sortMode",void 0),__decorate([property({attribute:"default-sort-dir"})],LyraTable.prototype,"defaultSortDir",void 0),__decorate([property({attribute:"accessible-label"})],LyraTable.prototype,"accessibleLabel",void 0),__decorate([property()],LyraTable.prototype,"caption",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"rowKey",void 0),__decorate([property({reflect:!0,attribute:"selection-mode"})],LyraTable.prototype,"selectionMode",void 0),__decorate([property({reflect:!0,attribute:"expansion-mode"})],LyraTable.prototype,"expansionMode",void 0),__decorate([property({reflect:!0,attribute:"scroll-mode"})],LyraTable.prototype,"scrollMode",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"selectedRowKeys",null),__decorate([property({type:Boolean,reflect:!0})],LyraTable.prototype,"filterable",void 0),__decorate([property({attribute:"filter-text"})],LyraTable.prototype,"filterText",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"filter",void 0),__decorate([property({attribute:"filter-label"})],LyraTable.prototype,"filterLabel",void 0),__decorate([property({attribute:"filter-placeholder"})],LyraTable.prototype,"filterPlaceholder",void 0),__decorate([property({converter:spellcheckConverter})],LyraTable.prototype,"spellcheck",void 0),__decorate([property()],LyraTable.prototype,"autocapitalize",void 0),__decorate([property({attribute:"autocorrect"})],LyraTable.prototype,"autoCorrect",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraTable.prototype,"loading",void 0),__decorate([property({attribute:"loading-label"})],LyraTable.prototype,"loadingLabel",void 0),__decorate([property({reflect:!0,attribute:"loading-appearance"})],LyraTable.prototype,"loadingAppearance",void 0),__decorate([property({type:Number,attribute:"skeleton-rows"})],LyraTable.prototype,"skeletonRows",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"groupBy",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"groupLabel",void 0),__decorate([property({type:Number,attribute:"page-size"})],LyraTable.prototype,"pageSize",void 0),__decorate([property({type:Number,reflect:!0})],LyraTable.prototype,"page",void 0),__decorate([property({type:Number,attribute:"total-items"})],LyraTable.prototype,"totalItems",void 0),__decorate([property({reflect:!0,attribute:"pagination-mode"})],LyraTable.prototype,"paginationMode",void 0),__decorate([property({type:Boolean,attribute:"unknown-total",reflect:!0})],LyraTable.prototype,"unknownTotal",void 0),__decorate([property({type:Boolean,attribute:"has-next",reflect:!0,converter:trueDefaultBooleanConverter})],LyraTable.prototype,"hasNext",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"expandedContent",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"canExpand",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"expandedRowKeys",null),__decorate([property({attribute:!1})],LyraTable.prototype,"heatTintScale",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"rowTotal",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"grandTotal",void 0),__decorate([property({type:Boolean,attribute:"has-more",reflect:!0})],LyraTable.prototype,"hasMore",void 0),__decorate([property({attribute:"more-label"})],LyraTable.prototype,"moreLabel",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraTable.prototype,"error",void 0),__decorate([property({attribute:"error-heading"})],LyraTable.prototype,"errorHeading",void 0),__decorate([property({attribute:"error-description"})],LyraTable.prototype,"errorDescription",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraTable.prototype,"announce",void 0),__decorate([property({attribute:"empty-heading"})],LyraTable.prototype,"emptyHeading",void 0),__decorate([property({attribute:"empty-description"})],LyraTable.prototype,"emptyDescription",void 0),__decorate([property({attribute:"empty-compact",converter:optionalBooleanConverter})],LyraTable.prototype,"emptyCompact",void 0),__decorate([property({attribute:"no-columns-heading"})],LyraTable.prototype,"noColumnsHeading",void 0),__decorate([property({attribute:"no-columns-description"})],LyraTable.prototype,"noColumnsDescription",void 0),__decorate([property({attribute:"reveal-columns-label"})],LyraTable.prototype,"revealColumnsLabel",void 0),__decorate([property({attribute:"hide-columns-label"})],LyraTable.prototype,"hideColumnsLabel",void 0),__decorate([property({type:Boolean,attribute:"has-hidden-priority-columns",reflect:!0})],LyraTable.prototype,"hasHiddenPriorityColumns",void 0),__decorate([state()],LyraTable.prototype,"priorityToggleAvailable",void 0),__decorate([property({type:Boolean,attribute:"priority-columns-visible",reflect:!0,noAccessor:!0})],LyraTable.prototype,"priorityColumnsVisible",void 0),__decorate([property({attribute:"storage-key"})],LyraTable.prototype,"storageKey",void 0),__decorate([state()],LyraTable.prototype,"activeColKey",void 0),__decorate([state()],LyraTable.prototype,"activeRowKey",void 0),__decorate([state()],LyraTable.prototype,"editingCell",void 0),__decorate([state()],LyraTable.prototype,"resizedColumnWidths",null);export{LyraTable};
246
+ `}}__decorate([property({attribute:!1})],LyraTable.prototype,"columns",null),__decorate([property({attribute:!1})],LyraTable.prototype,"rows",null),__decorate([property({reflect:!0,converter:TABLE_LAYOUT})],LyraTable.prototype,"layout",null),__decorate([property({attribute:"sort-key"})],LyraTable.prototype,"sortKey",void 0),__decorate([property({attribute:"sort-dir"})],LyraTable.prototype,"sortDir",void 0),__decorate([property({attribute:"sort-indicators",converter:literalSetConverter(["active","all"],"active")})],LyraTable.prototype,"sortIndicators",void 0),__decorate([property({reflect:!0,attribute:"sort-mode"})],LyraTable.prototype,"sortMode",void 0),__decorate([property({attribute:"default-sort-dir"})],LyraTable.prototype,"defaultSortDir",void 0),__decorate([property({attribute:"accessible-label"})],LyraTable.prototype,"accessibleLabel",void 0),__decorate([property()],LyraTable.prototype,"caption",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"rowKey",void 0),__decorate([property({reflect:!0,attribute:"selection-mode"})],LyraTable.prototype,"selectionMode",void 0),__decorate([property({reflect:!0,attribute:"expansion-mode"})],LyraTable.prototype,"expansionMode",void 0),__decorate([property({reflect:!0,attribute:"scroll-mode"})],LyraTable.prototype,"scrollMode",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"selectedRowKeys",null),__decorate([property({type:Boolean,reflect:!0})],LyraTable.prototype,"filterable",void 0),__decorate([property({attribute:"filter-text"})],LyraTable.prototype,"filterText",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"filter",void 0),__decorate([property({attribute:"filter-label"})],LyraTable.prototype,"filterLabel",void 0),__decorate([property({attribute:"filter-placeholder"})],LyraTable.prototype,"filterPlaceholder",void 0),__decorate([property({converter:spellcheckConverter})],LyraTable.prototype,"spellcheck",void 0),__decorate([property()],LyraTable.prototype,"autocapitalize",void 0),__decorate([property({attribute:"autocorrect"})],LyraTable.prototype,"autoCorrect",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraTable.prototype,"loading",void 0),__decorate([property({attribute:"loading-label"})],LyraTable.prototype,"loadingLabel",void 0),__decorate([property({reflect:!0,attribute:"loading-appearance"})],LyraTable.prototype,"loadingAppearance",void 0),__decorate([property({type:Number,attribute:"skeleton-rows"})],LyraTable.prototype,"skeletonRows",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"groupBy",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"groupLabel",void 0),__decorate([property({type:Number,attribute:"page-size"})],LyraTable.prototype,"pageSize",void 0),__decorate([property({type:Number,reflect:!0})],LyraTable.prototype,"page",void 0),__decorate([property({type:Number,attribute:"total-items"})],LyraTable.prototype,"totalItems",void 0),__decorate([property({reflect:!0,attribute:"pagination-mode"})],LyraTable.prototype,"paginationMode",void 0),__decorate([property({type:Boolean,attribute:"unknown-total",reflect:!0})],LyraTable.prototype,"unknownTotal",void 0),__decorate([property({type:Boolean,attribute:"has-next",reflect:!0,converter:trueDefaultBooleanConverter})],LyraTable.prototype,"hasNext",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"expandedContent",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"canExpand",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"rowExpandLabel",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"expandedRowKeys",null),__decorate([property({attribute:!1})],LyraTable.prototype,"heatTintScale",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"rowTotal",void 0),__decorate([property({attribute:!1})],LyraTable.prototype,"grandTotal",void 0),__decorate([property({type:Boolean,attribute:"has-more",reflect:!0})],LyraTable.prototype,"hasMore",void 0),__decorate([property({attribute:"more-label"})],LyraTable.prototype,"moreLabel",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraTable.prototype,"error",void 0),__decorate([property({attribute:"error-heading"})],LyraTable.prototype,"errorHeading",void 0),__decorate([property({attribute:"error-description"})],LyraTable.prototype,"errorDescription",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraTable.prototype,"announce",void 0),__decorate([property({attribute:"empty-heading"})],LyraTable.prototype,"emptyHeading",void 0),__decorate([property({attribute:"empty-description"})],LyraTable.prototype,"emptyDescription",void 0),__decorate([property({attribute:"empty-compact",converter:optionalBooleanConverter})],LyraTable.prototype,"emptyCompact",void 0),__decorate([property({attribute:"no-columns-heading"})],LyraTable.prototype,"noColumnsHeading",void 0),__decorate([property({attribute:"no-columns-description"})],LyraTable.prototype,"noColumnsDescription",void 0),__decorate([property({attribute:"reveal-columns-label"})],LyraTable.prototype,"revealColumnsLabel",void 0),__decorate([property({attribute:"hide-columns-label"})],LyraTable.prototype,"hideColumnsLabel",void 0),__decorate([property({type:Boolean,attribute:"has-hidden-priority-columns",reflect:!0})],LyraTable.prototype,"hasHiddenPriorityColumns",void 0),__decorate([state()],LyraTable.prototype,"priorityToggleAvailable",void 0),__decorate([property({type:Boolean,attribute:"priority-columns-visible",reflect:!0,noAccessor:!0})],LyraTable.prototype,"priorityColumnsVisible",void 0),__decorate([property({attribute:"storage-key"})],LyraTable.prototype,"storageKey",void 0),__decorate([state()],LyraTable.prototype,"activeColKey",void 0),__decorate([state()],LyraTable.prototype,"activeRowKey",void 0),__decorate([state()],LyraTable.prototype,"editingCell",void 0),__decorate([state()],LyraTable.prototype,"resizedColumnWidths",null);export{LyraTable};
@@ -1 +1 @@
1
- import{css}from"lit";const styles=css`:host{--_lr-table-heat-tint-lo-default:var(--lr-color-brand-quiet);--_lr-table-heat-tint-hi-default:var(--lr-color-brand);--_lr-table-resize-min-width-default:var(--lr-size-3rem);--_lr-table-resize-handle-opacity-default:.12;inline-size:100%;display:block}[part=base]{max-block-size:var(--lr-table-max-height,none);border:var(--lr-border-width-thin) solid var(--lr-color-border);border-radius:var(--lr-radius);scrollbar-width:var(--lr-theme-scrollbar-width,auto);scrollbar-gutter:var(--lr-theme-scrollbar-gutter,auto);overflow:auto}:host([scroll-mode=page]) [part=base],:host([scroll-mode=auto]) [part=base]:not([data-scroll-overflow]){max-block-size:none;overflow:visible}[part=filter-label]{align-items:center;gap:var(--lr-space-s);padding:var(--lr-space-s);border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);color:var(--lr-color-text-quiet);font-size:var(--lr-font-size-md-sm);display:flex}[part=filter]{min-inline-size:0;padding:var(--lr-space-xs) var(--lr-space-s);border:var(--lr-border-width-thin) solid var(--lr-color-border);border-radius:var(--lr-radius-xs);background:var(--lr-color-surface);color:var(--lr-color-text);font:inherit;flex:1}[part=filter]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}:where([part=filter]):hover{background:var(--lr-color-brand-quiet)}:where([part=filter]):active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=filter]::placeholder{color:var(--lr-color-text-quiet);opacity:1}[part=filter][type=search]::-webkit-search-cancel-button,[part=filter][type=search]::-webkit-search-decoration{appearance:none}[part=filter-clear]{min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);border-radius:var(--lr-radius-xs);cursor:pointer;color:var(--lr-color-text-quiet);padding:var(--lr-space-xs);transition:background-color var(--lr-transition-fast), color var(--lr-transition-fast);background:0 0;border:0;flex:none;justify-content:center;align-items:center;display:inline-flex}[part=filter-clear]:hover{color:var(--lr-color-text)}[part=filter-clear]:active{color:var(--lr-color-text);background:color-mix(in oklab, var(--lr-color-surface), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=filter-clear]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:calc(-1 * var(--lr-focus-ring-width))}[part=loading]:not(.sr-only){min-block-size:var(--lr-size-8rem);padding:var(--lr-space-l);place-items:center;display:grid}[part=pagination]{border-block-start:var(--lr-border-width-thin) solid var(--lr-color-border);display:block}[part=base][data-hide-priority-low]:not([data-force-visible]) [data-priority=low],[part=base][data-hide-priority-medium]:not([data-force-visible]) [data-priority=medium]{display:none}[part=table]{border-collapse:collapse;inline-size:100%;font:inherit;font-size:var(--lr-table-font-size,inherit)}[part=table][data-layout=fixed]{table-layout:fixed}[part=header-cell]{background:var(--_lr-table-header-bg,var(--lr-color-surface));text-align:start;font-weight:var(--lr-font-weight-semibold);padding:var(--lr-table-cell-padding,var(--lr-space-s));border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);cursor:default;white-space:nowrap;position:sticky;inset-block-start:0}[part=header-cell][data-resizable]{padding-inline-end:calc(var(--lr-space-s) + var(--lr-size-0-5rem))}[part=resize-handle]{inline-size:var(--lr-size-0-5rem);min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);cursor:col-resize;touch-action:none;position:absolute;inset-block:0;inset-inline-end:0}[part=resize-handle]:hover,[part=resize-handle]:focus-visible{background:var(--lr-table-resize-handle-hover-bg,var(--lr-color-brand));opacity:var(--lr-table-resize-handle-hover-opacity,var(--lr-table-resize-handle-opacity,var(--_lr-table-resize-handle-opacity-default)))}[part=resize-handle]:active,[part=resize-handle][data-resizing]{background:var(--lr-table-resize-handle-active-bg,var(--lr-table-resize-handle-hover-bg,var(--lr-color-brand)));opacity:var(--lr-table-resize-handle-active-opacity,calc(var(--lr-table-resize-handle-hover-opacity,var(--lr-table-resize-handle-opacity,var(--_lr-table-resize-handle-opacity-default))) * 2))}[part=resize-handle]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:calc(-1 * var(--lr-focus-ring-offset))}:where([part=header-cell][aria-sort]:not([aria-sort=none])),:where([part=header-cell][data-sortable]){cursor:pointer}[part=header-cell]:where([aria-sort]:not([aria-sort=none])){--_lr-table-header-bg:var(--lr-table-header-sorted-bg,var(--lr-color-surface));background:var(--_lr-table-header-bg);color:var(--lr-table-header-sorted-color,inherit)}[part=header-cell][data-sortable]:hover{background:var(--lr-color-brand-quiet)}[part=header-cell][data-sortable]:active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=header-cell]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=header-cell][data-align=end]{text-align:end}[part~=sort-icon]{vertical-align:middle;transition:transform var(--lr-transition-fast);margin-inline-start:var(--lr-space-xs);display:inline-block}[part~=sort-icon-inactive]{color:var(--lr-color-text-quiet)}@media (forced-colors:active){[part~=sort-icon-inactive]{color:canvastext!important}}[part~=sort-icon] svg{display:block}[part~=sort-icon][data-dir=asc]{transform:rotate(-90deg)}[part~=sort-icon][data-dir=desc]{transform:rotate(90deg)}@media (prefers-reduced-motion:reduce){[part~=sort-icon]{transition:none!important}}[part=row][data-stripe]{background:var(--lr-table-row-stripe-bg,transparent);--_lr-table-row-bg:var(--lr-table-row-stripe-bg,var(--lr-color-surface))}[part=row][aria-selected=true]{--_lr-table-row-bg:var(--lr-table-row-selected-bg,var(--lr-color-brand-quiet));background:var(--_lr-table-row-bg)}[part=row]:hover{--_lr-table-row-bg:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-hover));background:var(--_lr-table-row-bg)}[part=row]:active{--_lr-table-row-bg:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active));background:var(--_lr-table-row-bg)}@media (forced-colors:active){:where([part~=row][aria-selected=true]){outline:var(--lr-border-width-medium) solid Highlight;outline-offset:calc(-1 * var(--lr-border-width-medium))}:where([part~=row]:hover:not([aria-selected=true])){outline:var(--lr-border-width-thin) dashed Highlight;outline-offset:calc(-1 * var(--lr-border-width-thin))}}[part=group-cell]{padding:var(--lr-table-cell-padding-compact,var(--lr-space-xs) var(--lr-space-s));border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);background:var(--lr-color-surface-raised);color:var(--lr-color-text-quiet);font-weight:var(--lr-font-weight-semibold);text-align:start}[part=row]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=cell]{padding:var(--lr-table-cell-padding,var(--lr-space-s));border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);color:var(--lr-table-cell-color,inherit)}[part=cell] a:where(:any-link){color:var(--lr-table-cell-link-color,var(--lr-color-brand))}[part=cell] a:where(:any-link):hover,[part=cell] a:where(:any-link):focus-visible,[part=cell] a:where(:any-link):active{color:var(--lr-table-cell-link-hover-color,var(--lr-table-cell-link-color,var(--lr-color-brand)));text-decoration-thickness:var(--lr-border-width-medium)}[part=cell-editor]{box-sizing:border-box;inline-size:100%;min-inline-size:0;padding:var(--lr-space-xs) var(--lr-space-s);border:var(--lr-border-width-thin) solid var(--lr-color-brand);border-radius:var(--lr-radius-xs);background:var(--lr-color-surface);color:var(--lr-color-text);font:inherit}[part=cell-editor]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}:where([part=cell-editor]):hover{background:var(--lr-color-brand-quiet)}:where([part=cell-editor]):active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=cell-editor][type=number]{appearance:textfield}[part=cell-editor][type=number]::-webkit-inner-spin-button,[part=cell-editor][type=number]::-webkit-outer-spin-button{appearance:none;margin:0}select[part=cell-editor]{appearance:none;cursor:pointer}select[part=cell-editor] option{background:var(--lr-color-surface);color:var(--lr-color-text)}[part=cell][data-align=end]{text-align:end}[part=row-total-cell]{padding:var(--lr-table-cell-padding,var(--lr-space-s));border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);font-weight:var(--lr-font-weight-semibold);text-align:end}[part=cell][data-heat]{background:color-mix(in srgb, var(--lr-table-heat-tint-hi,var(--_lr-table-heat-tint-hi-default)) var(--lr-table-heat-t), var(--lr-table-heat-tint-lo,var(--_lr-table-heat-tint-lo-default)))}[part=expand-toggle-cell]{padding:var(--lr-space-s);border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);text-align:center}[part=row-expand-toggle]{font:inherit;padding:var(--lr-space-xs);cursor:pointer;color:inherit;min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}[part=row-expand-toggle]:hover{background:var(--lr-color-brand-quiet)}[part=row-expand-toggle]:active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=row-expand-toggle]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=row-expand-icon]{transition:transform var(--lr-transition-fast);display:inline-block}[part=row-expand-icon] svg{display:block}[part=row-expand-toggle][aria-expanded=true] [part=row-expand-icon]{transform:rotate(90deg)}:host(:dir(rtl)) [part=row-expand-icon]{transform:rotate(180deg)}:host(:dir(rtl)) [part=row-expand-toggle][aria-expanded=true] [part=row-expand-icon]{transform:rotate(90deg)}@media (prefers-reduced-motion:reduce){[part=row-expand-icon]{transition:none!important}}[part=expanded-row] [part=expanded-cell]{padding:var(--lr-space-s);border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);background:var(--lr-color-surface)}[part=header-cell][data-sticky],[part=cell][data-sticky]{z-index:var(--lr-layer-content);box-shadow:var(--lr-size-1px) 0 0 0 var(--lr-color-border);position:sticky;inset-inline-start:var(--lr-table-sticky-offset,0)}[part=cell][data-sticky]{background:var(--_lr-table-row-bg,var(--lr-color-surface))}[part=header-cell][data-sticky]{background:var(--_lr-table-header-bg,var(--lr-color-surface))}[part=header-cell][data-sticky=end],[part=cell][data-sticky=end]{box-shadow:calc(-1 * var(--lr-size-1px)) 0 0 0 var(--lr-color-border);inset-inline-start:auto;inset-inline-end:var(--lr-table-sticky-offset,0)}:host(:dir(rtl)) [part=header-cell][data-sticky],:host(:dir(rtl)) [part=cell][data-sticky]{box-shadow:calc(-1 * var(--lr-size-1px)) 0 0 0 var(--lr-color-border)}:host(:dir(rtl)) [part=header-cell][data-sticky=end],:host(:dir(rtl)) [part=cell][data-sticky=end]{box-shadow:var(--lr-size-1px) 0 0 0 var(--lr-color-border)}[part=foot]{background:var(--lr-color-surface);position:sticky;inset-block-end:0}[part=footer-cell]{padding:var(--lr-table-cell-padding-compact,var(--lr-space-xs) var(--lr-space-s));border-block-start:var(--lr-border-width-thin) solid var(--lr-color-border);font-weight:var(--lr-font-weight-semibold);text-align:start}[part=footer-cell][data-align=end]{text-align:end}[part=more-button],[part=reveal-columns-button]{inline-size:100%;padding:var(--lr-space-s);color:var(--lr-color-brand);font:inherit;cursor:pointer;border:none;border-block-start:var(--lr-border-width-thin) solid var(--lr-color-border);background:0 0;display:block}[part=more-button]:hover,[part=reveal-columns-button]:hover{background:var(--lr-color-brand-quiet)}[part=more-button]:active,[part=reveal-columns-button]:active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=more-button]:focus-visible,[part=reveal-columns-button]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=error-row] [part=error-cell]{padding:var(--lr-space-s);border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);background:var(--lr-color-surface)}[part=retry-button]{padding:var(--lr-space-2xs) var(--lr-space-s);border:var(--lr-border-width-thin) solid var(--lr-color-border);border-radius:var(--lr-radius-xs);color:var(--lr-color-brand);font:inherit;cursor:pointer;background:0 0;justify-content:center;align-items:center;display:inline-flex}[part=retry-button]:hover{background:var(--lr-color-brand-quiet)}[part=retry-button]:active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=retry-button]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}`;export{styles};
1
+ import{css}from"lit";const styles=css`:host{--_lr-table-heat-tint-lo-default:var(--lr-color-brand-quiet);--_lr-table-heat-tint-hi-default:var(--lr-color-brand);--_lr-table-resize-min-width-default:var(--lr-size-3rem);--_lr-table-resize-handle-opacity-default:.12;inline-size:100%;display:block}[part=base]{max-block-size:var(--lr-table-max-height,none);border:var(--lr-border-width-thin) solid var(--lr-color-border);border-radius:var(--lr-radius);scrollbar-width:var(--lr-theme-scrollbar-width,auto);scrollbar-gutter:var(--lr-theme-scrollbar-gutter,auto);overflow:auto}:host([scroll-mode=page]) [part=base],:host([scroll-mode=auto]) [part=base]:not([data-scroll-overflow]){max-block-size:none;overflow:visible}[part=filter-label]{align-items:center;gap:var(--lr-space-s);padding:var(--lr-space-s);border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);color:var(--lr-color-text-quiet);font-size:var(--lr-font-size-md-sm);display:flex}[part=filter]{min-inline-size:0;padding:var(--lr-space-xs) var(--lr-space-s);border:var(--lr-border-width-thin) solid var(--lr-color-border);border-radius:var(--lr-radius-xs);background:var(--lr-color-surface);color:var(--lr-color-text);font:inherit;flex:1}[part=filter]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}:where([part=filter]):hover{background:var(--lr-color-brand-quiet)}:where([part=filter]):active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=filter]::placeholder{color:var(--lr-color-text-quiet);opacity:1}[part=filter][type=search]::-webkit-search-cancel-button,[part=filter][type=search]::-webkit-search-decoration{appearance:none}[part=filter-clear]{min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);border-radius:var(--lr-radius-xs);cursor:pointer;color:var(--lr-color-text-quiet);padding:var(--lr-space-xs);transition:background-color var(--lr-transition-fast), color var(--lr-transition-fast);background:0 0;border:0;flex:none;justify-content:center;align-items:center;display:inline-flex}[part=filter-clear]:hover{color:var(--lr-color-text)}[part=filter-clear]:active{color:var(--lr-color-text);background:color-mix(in oklab, var(--lr-color-surface), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=filter-clear]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:calc(-1 * var(--lr-focus-ring-width))}[part=loading]:not(.sr-only){min-block-size:var(--lr-size-8rem);padding:var(--lr-space-l);place-items:center;display:grid}[part=pagination]{border-block-start:var(--lr-border-width-thin) solid var(--lr-color-border);display:block}[part=base][data-hide-priority-low]:not([data-force-visible]) [data-priority=low],[part=base][data-hide-priority-medium]:not([data-force-visible]) [data-priority=medium]{display:none}[part=table]{border-collapse:collapse;inline-size:100%;font:inherit;font-size:var(--lr-table-font-size,inherit)}[part=table][data-layout=fixed]{table-layout:fixed}[part=header-cell]{background:var(--_lr-table-header-bg,var(--lr-color-surface));text-align:start;font-weight:var(--lr-font-weight-semibold);padding:var(--lr-table-cell-padding,var(--lr-space-s));border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);cursor:default;white-space:nowrap;position:sticky;inset-block-start:0}[part=header-cell][data-resizable]{padding-inline-end:calc(var(--lr-space-s) + var(--lr-size-0-5rem))}[part=resize-handle]{inline-size:var(--lr-size-0-5rem);min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);cursor:col-resize;touch-action:none;position:absolute;inset-block:0;inset-inline-end:0}[part=resize-handle]:hover,[part=resize-handle]:focus-visible{background:var(--lr-table-resize-handle-hover-bg,var(--lr-color-brand));opacity:var(--lr-table-resize-handle-hover-opacity,var(--lr-table-resize-handle-opacity,var(--_lr-table-resize-handle-opacity-default)))}[part=resize-handle]:active,[part=resize-handle][data-resizing]{background:var(--lr-table-resize-handle-active-bg,var(--lr-table-resize-handle-hover-bg,var(--lr-color-brand)));opacity:var(--lr-table-resize-handle-active-opacity,calc(var(--lr-table-resize-handle-hover-opacity,var(--lr-table-resize-handle-opacity,var(--_lr-table-resize-handle-opacity-default))) * 2))}[part=resize-handle]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:calc(-1 * var(--lr-focus-ring-offset))}:where([part=header-cell][aria-sort]:not([aria-sort=none])),:where([part=header-cell][data-sortable]){cursor:pointer}[part=header-cell]:where([aria-sort]:not([aria-sort=none])){--_lr-table-header-bg:var(--lr-table-header-sorted-bg,var(--lr-color-surface));background:var(--_lr-table-header-bg);color:var(--lr-table-header-sorted-color,inherit)}[part=header-cell][data-sortable]:hover{background:var(--lr-color-brand-quiet)}[part=header-cell][data-sortable]:active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=header-cell]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=header-cell][data-align=end]{text-align:end}[part~=sort-icon]{vertical-align:middle;transition:transform var(--lr-transition-fast);margin-inline-start:var(--lr-space-xs);display:inline-block}[part~=sort-icon-inactive]{color:var(--lr-color-text-quiet)}@media (forced-colors:active){[part~=sort-icon-inactive]{color:canvastext!important}}[part~=sort-icon] svg{display:block}[part~=sort-icon][data-dir=asc]{transform:rotate(-90deg)}[part~=sort-icon][data-dir=desc]{transform:rotate(90deg)}@media (prefers-reduced-motion:reduce){[part~=sort-icon]{transition:none!important}}[part=row][data-stripe]{background:var(--lr-table-row-stripe-bg,transparent);--_lr-table-row-bg:var(--lr-table-row-stripe-bg,var(--lr-color-surface))}[part=row][aria-selected=true]{--_lr-table-row-bg:var(--lr-table-row-selected-bg,var(--lr-color-brand-quiet));background:var(--_lr-table-row-bg)}[part=row]:hover{--_lr-table-row-bg:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-hover));background:var(--_lr-table-row-bg)}[part=row]:active{--_lr-table-row-bg:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active));background:var(--_lr-table-row-bg)}@media (forced-colors:active){:where([part~=row][aria-selected=true]){outline:var(--lr-border-width-medium) solid Highlight;outline-offset:calc(-1 * var(--lr-border-width-medium))}:where([part~=row]:hover:not([aria-selected=true])){outline:var(--lr-border-width-thin) dashed Highlight;outline-offset:calc(-1 * var(--lr-border-width-thin))}}[part=group-cell]{padding:var(--lr-table-cell-padding-compact,var(--lr-space-xs) var(--lr-space-s));border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);background:var(--lr-color-surface-raised);color:var(--lr-color-text-quiet);font-weight:var(--lr-font-weight-semibold);text-align:start}[part=row]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=cell]{padding:var(--lr-table-cell-padding,var(--lr-space-s));border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);color:var(--lr-table-cell-color,inherit)}[part=cell][data-editable]{transition:var(--lr-transition-interactive)}:where([part=cell][data-editable]):hover{cursor:pointer;background:var(--lr-color-brand-quiet)}:where([part=cell][data-editable]):active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=cell][data-editable]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=cell] a:where(:any-link){color:var(--lr-table-cell-link-color,var(--lr-color-brand))}[part=cell] a:where(:any-link):hover,[part=cell] a:where(:any-link):focus-visible,[part=cell] a:where(:any-link):active{color:var(--lr-table-cell-link-hover-color,var(--lr-table-cell-link-color,var(--lr-color-brand)));text-decoration-thickness:var(--lr-border-width-medium)}[part=cell-editor]{box-sizing:border-box;inline-size:100%;min-inline-size:0;padding:var(--lr-space-xs) var(--lr-space-s);border:var(--lr-border-width-thin) solid var(--lr-color-brand);border-radius:var(--lr-radius-xs);background:var(--lr-color-surface);color:var(--lr-color-text);font:inherit}[part=cell-editor]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}:where([part=cell-editor]):hover{background:var(--lr-color-brand-quiet)}:where([part=cell-editor]):active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=cell-editor][type=number]{appearance:textfield}[part=cell-editor][type=number]::-webkit-inner-spin-button,[part=cell-editor][type=number]::-webkit-outer-spin-button{appearance:none;margin:0}select[part=cell-editor]{appearance:none;cursor:pointer}select[part=cell-editor] option{background:var(--lr-color-surface);color:var(--lr-color-text)}[part=cell][data-align=end]{text-align:end}[part=row-total-cell]{padding:var(--lr-table-cell-padding,var(--lr-space-s));border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);font-weight:var(--lr-font-weight-semibold);text-align:end}[part=cell][data-heat]{background:color-mix(in srgb, var(--lr-table-heat-tint-hi,var(--_lr-table-heat-tint-hi-default)) var(--lr-table-heat-t), var(--lr-table-heat-tint-lo,var(--_lr-table-heat-tint-lo-default)))}[part=expand-toggle-cell]{padding:var(--lr-space-s);border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);text-align:center}[part=row-expand-toggle]{font:inherit;padding:var(--lr-space-xs);cursor:pointer;color:inherit;min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}[part=row-expand-toggle]:hover{background:var(--lr-color-brand-quiet)}[part=row-expand-toggle]:active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=row-expand-toggle]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=row-expand-icon]{transition:transform var(--lr-transition-fast);display:inline-block}[part=row-expand-icon] svg{display:block}[part=row-expand-toggle][aria-expanded=true] [part=row-expand-icon]{transform:rotate(90deg)}:host(:dir(rtl)) [part=row-expand-icon]{transform:rotate(180deg)}:host(:dir(rtl)) [part=row-expand-toggle][aria-expanded=true] [part=row-expand-icon]{transform:rotate(90deg)}@media (prefers-reduced-motion:reduce){[part=row-expand-icon]{transition:none!important}}[part=expanded-row] [part=expanded-cell]{padding:var(--lr-space-s);border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);background:var(--lr-color-surface)}[part=header-cell][data-sticky],[part=cell][data-sticky]{z-index:var(--lr-layer-content);box-shadow:var(--lr-size-1px) 0 0 0 var(--lr-color-border);position:sticky;inset-inline-start:var(--lr-table-sticky-offset,0)}[part=cell][data-sticky]{background:var(--_lr-table-row-bg,var(--lr-color-surface))}[part=header-cell][data-sticky]{background:var(--_lr-table-header-bg,var(--lr-color-surface))}[part=header-cell][data-sticky=end],[part=cell][data-sticky=end]{box-shadow:calc(-1 * var(--lr-size-1px)) 0 0 0 var(--lr-color-border);inset-inline-start:auto;inset-inline-end:var(--lr-table-sticky-offset,0)}:host(:dir(rtl)) [part=header-cell][data-sticky],:host(:dir(rtl)) [part=cell][data-sticky]{box-shadow:calc(-1 * var(--lr-size-1px)) 0 0 0 var(--lr-color-border)}:host(:dir(rtl)) [part=header-cell][data-sticky=end],:host(:dir(rtl)) [part=cell][data-sticky=end]{box-shadow:var(--lr-size-1px) 0 0 0 var(--lr-color-border)}[part=foot]{background:var(--lr-color-surface);position:sticky;inset-block-end:0}[part=footer-cell]{padding:var(--lr-table-cell-padding-compact,var(--lr-space-xs) var(--lr-space-s));border-block-start:var(--lr-border-width-thin) solid var(--lr-color-border);font-weight:var(--lr-font-weight-semibold);text-align:start}[part=footer-cell][data-align=end]{text-align:end}[part=more-button],[part=reveal-columns-button]{inline-size:100%;padding:var(--lr-space-s);color:var(--lr-color-brand);font:inherit;cursor:pointer;border:none;border-block-start:var(--lr-border-width-thin) solid var(--lr-color-border);background:0 0;display:block}[part=more-button]:hover,[part=reveal-columns-button]:hover{background:var(--lr-color-brand-quiet)}[part=more-button]:active,[part=reveal-columns-button]:active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=more-button]:focus-visible,[part=reveal-columns-button]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=error-row] [part=error-cell]{padding:var(--lr-space-s);border-block-end:var(--lr-border-width-thin) solid var(--lr-color-border);background:var(--lr-color-surface)}[part=retry-button]{padding:var(--lr-space-2xs) var(--lr-space-s);border:var(--lr-border-width-thin) solid var(--lr-color-border);border-radius:var(--lr-radius-xs);color:var(--lr-color-brand);font:inherit;cursor:pointer;background:0 0;justify-content:center;align-items:center;display:inline-flex}[part=retry-button]:hover{background:var(--lr-color-brand-quiet)}[part=retry-button]:active{background:color-mix(in oklab, var(--lr-color-brand-quiet), var(--lr-color-mix-partner) var(--lr-color-mix-active))}[part=retry-button]:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}`;export{styles};
@@ -113,4 +113,12 @@ private _variant;get variant():LyraVariant;set variant(value:LyraVariant);
113
113
  /** Marks this as the current/in-progress item (e.g. "the agent is executing this step right now"),
114
114
  * as opposed to a resolved past entry. Drives a pulsing marker (disabled under
115
115
  * `prefers-reduced-motion: reduce`) and an explicit `aria-current` state on the host. */
116
- active:boolean;private hasIconSlot;private hasTimestampSlot;private hasDescriptionSlot;private clusterPresentation?;private readonly timestampObservers;private timestampObserversReady;connectedCallback():void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private get normalizedTimestamp();private onIconSlotChange;private onTimestampSlotChange;private onDescriptionSlotChange;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-timeline-item':LyraTimelineItem;}}
116
+ active:boolean;private hasIconSlot;private hasTimestampSlot;private hasDescriptionSlot;private clusterPresentation?;private markerIconSlot?;private timestampSlotEl?;private descriptionSlotEl?;private readonly timestampObservers;private timestampObserversReady;connectedCallback():void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private get normalizedTimestamp();
117
+ /**
118
+ * Also called once from `firstUpdated()` (see `collectInitialSlotAssignment`) to cover an
119
+ * environment, or a real-browser timing race, where a slot's initial assignment never fires
120
+ * `slotchange`. Idempotent: re-reading the same still-assigned elements just re-derives the same
121
+ * boolean, so running once from `firstUpdated()` and again from a real initial `slotchange` (every
122
+ * real-browser connect) produces no duplicate side effect.
123
+ */
124
+ private onIconSlotChange;private collectIconSlotAssignment;private onTimestampSlotChange;private collectTimestampSlotAssignment;private onDescriptionSlotChange;private collectDescriptionSlotAssignment;protected firstUpdated(changed:PropertyValues):void;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-timeline-item':LyraTimelineItem;}}
@@ -1,4 +1,4 @@
1
- var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{styles}from"./timeline-item.styles.js";import{getDateTimeFormat}from"../../../internal/intl-cache.js";import{OBSERVE_TIMELINE_ITEM_TIMESTAMP,SET_TIMELINE_CLUSTER_PRESENTATION}from"./timeline-cluster.js";const timelineItemVariantConverter={fromAttribute(value){return normalizeTimelineItemVariant(value)},toAttribute(value){return value==="neutral"?null:value}},normalizeTimelineItemVariant=value=>value==="brand"||value==="success"||value==="warning"||value==="danger"?value:"neutral";class LyraTimelineItem extends LyraElement{constructor(){super(...arguments),this.sync=!1,this._variant="neutral",this.active=!1,this.hasIconSlot=!1,this.hasTimestampSlot=!1,this.hasDescriptionSlot=!1,this.timestampObservers=new Set,this.timestampObserversReady=!1,this.onIconSlotChange=()=>{const markerIconSlot=this.renderRoot.querySelector('slot[name="marker-icon"]');this.hasIconSlot=!!markerIconSlot?.assignedElements({flatten:!0}).length},this.onTimestampSlotChange=e=>{this.hasTimestampSlot=e.target.assignedElements({flatten:!0}).length>0},this.onDescriptionSlotChange=e=>{this.hasDescriptionSlot=e.target.assignedElements({flatten:!0}).length>0}}static{this.styles=[LyraElement.styles,styles]}get variant(){return this._variant}set variant(value){const normalized=normalizeTimelineItemVariant(value),previous=this._variant;if(previous===normalized){value!==normalized&&this.requestUpdate("variant",previous);return}this._variant=normalized,this.requestUpdate("variant",previous)}[SET_TIMELINE_CLUSTER_PRESENTATION](presentation){const current=this.clusterPresentation;current===presentation||current!==void 0&&presentation!==void 0&&current.accessibleLabel===presentation.accessibleLabel&&current.countText===presentation.countText&&current.activate===presentation.activate||(this.clusterPresentation=presentation)}[OBSERVE_TIMELINE_ITEM_TIMESTAMP](observer,observe){observe?this.timestampObservers.add(observer):this.timestampObservers.delete(observer)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","listitem")}willUpdate(changed){super.willUpdate(changed),this.clusterPresentation?this.removeAttribute("aria-current"):this.setAttribute("aria-current",String(this.active))}updated(changed){if(super.updated(changed),changed.has("variant")){const reflected=timelineItemVariantConverter.toAttribute(this.variant);reflected===null?this.removeAttribute("variant"):this.getAttribute("variant")!==reflected&&this.setAttribute("variant",reflected)}this.timestampObserversReady&&changed.has("timestamp")&&this.scheduleAfterUpdate(()=>{for(const observer of[...this.timestampObservers])observer()},"timeline-item-timestamp-observers"),this.timestampObserversReady=!0}get normalizedTimestamp(){if(this.timestamp===void 0)return;const date=this.timestamp instanceof Date?this.timestamp:new Date(this.timestamp);return Number.isNaN(date.getTime())?void 0:date}render(){if(this.clusterPresentation)return html`
1
+ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{styles}from"./timeline-item.styles.js";import{getDateTimeFormat}from"../../../internal/intl-cache.js";import{collectInitialSlotAssignment}from"../../../internal/initial-slot-collection.js";import{OBSERVE_TIMELINE_ITEM_TIMESTAMP,SET_TIMELINE_CLUSTER_PRESENTATION}from"./timeline-cluster.js";const timelineItemVariantConverter={fromAttribute(value){return normalizeTimelineItemVariant(value)},toAttribute(value){return value==="neutral"?null:value}},normalizeTimelineItemVariant=value=>value==="brand"||value==="success"||value==="warning"||value==="danger"?value:"neutral";class LyraTimelineItem extends LyraElement{constructor(){super(...arguments),this.sync=!1,this._variant="neutral",this.active=!1,this.hasIconSlot=!1,this.hasTimestampSlot=!1,this.hasDescriptionSlot=!1,this.timestampObservers=new Set,this.timestampObserversReady=!1,this.onIconSlotChange=()=>{this.collectIconSlotAssignment(this.markerIconSlot)},this.onTimestampSlotChange=e=>{this.collectTimestampSlotAssignment(e.target)},this.onDescriptionSlotChange=e=>{this.collectDescriptionSlotAssignment(e.target)}}static{this.styles=[LyraElement.styles,styles]}get variant(){return this._variant}set variant(value){const normalized=normalizeTimelineItemVariant(value),previous=this._variant;if(previous===normalized){value!==normalized&&this.requestUpdate("variant",previous);return}this._variant=normalized,this.requestUpdate("variant",previous)}[SET_TIMELINE_CLUSTER_PRESENTATION](presentation){const current=this.clusterPresentation;current===presentation||current!==void 0&&presentation!==void 0&&current.accessibleLabel===presentation.accessibleLabel&&current.countText===presentation.countText&&current.activate===presentation.activate||(this.clusterPresentation=presentation)}[OBSERVE_TIMELINE_ITEM_TIMESTAMP](observer,observe){observe?this.timestampObservers.add(observer):this.timestampObservers.delete(observer)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","listitem")}willUpdate(changed){super.willUpdate(changed),this.clusterPresentation?this.removeAttribute("aria-current"):this.setAttribute("aria-current",String(this.active))}updated(changed){if(super.updated(changed),changed.has("variant")){const reflected=timelineItemVariantConverter.toAttribute(this.variant);reflected===null?this.removeAttribute("variant"):this.getAttribute("variant")!==reflected&&this.setAttribute("variant",reflected)}this.timestampObserversReady&&changed.has("timestamp")&&this.scheduleAfterUpdate(()=>{for(const observer of[...this.timestampObservers])observer()},"timeline-item-timestamp-observers"),this.timestampObserversReady=!0}get normalizedTimestamp(){if(this.timestamp===void 0)return;const date=this.timestamp instanceof Date?this.timestamp:new Date(this.timestamp);return Number.isNaN(date.getTime())?void 0:date}collectIconSlotAssignment(slot){this.hasIconSlot=!!slot?.assignedElements({flatten:!0}).length}collectTimestampSlotAssignment(slot){this.hasTimestampSlot=slot.assignedElements({flatten:!0}).length>0}collectDescriptionSlotAssignment(slot){this.hasDescriptionSlot=slot.assignedElements({flatten:!0}).length>0}firstUpdated(changed){super.firstUpdated(changed);const markerIconSlot=this.markerIconSlot,timestampSlot=this.timestampSlotEl,descriptionSlot=this.descriptionSlotEl;queueMicrotask(()=>{collectInitialSlotAssignment(markerIconSlot,s=>this.collectIconSlotAssignment(s)),collectInitialSlotAssignment(timestampSlot,s=>this.collectTimestampSlotAssignment(s)),collectInitialSlotAssignment(descriptionSlot,s=>this.collectDescriptionSlotAssignment(s))})}render(){if(this.clusterPresentation)return html`
2
2
  <button
3
3
  part="cluster"
4
4
  type="button"
@@ -48,4 +48,4 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
48
48
  </span>
49
49
  </div>
50
50
  </div>
51
- `}}__decorate([property({attribute:!1})],LyraTimelineItem.prototype,"timestamp",void 0),__decorate([property({type:Boolean})],LyraTimelineItem.prototype,"sync",void 0),__decorate([property({reflect:!0,converter:timelineItemVariantConverter})],LyraTimelineItem.prototype,"variant",null),__decorate([property({type:Boolean,reflect:!0})],LyraTimelineItem.prototype,"active",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasIconSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasTimestampSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasDescriptionSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"clusterPresentation",void 0);export{LyraTimelineItem};
51
+ `}}__decorate([property({attribute:!1})],LyraTimelineItem.prototype,"timestamp",void 0),__decorate([property({type:Boolean})],LyraTimelineItem.prototype,"sync",void 0),__decorate([property({reflect:!0,converter:timelineItemVariantConverter})],LyraTimelineItem.prototype,"variant",null),__decorate([property({type:Boolean,reflect:!0})],LyraTimelineItem.prototype,"active",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasIconSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasTimestampSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"hasDescriptionSlot",void 0),__decorate([state()],LyraTimelineItem.prototype,"clusterPresentation",void 0),__decorate([query('slot[name="marker-icon"]')],LyraTimelineItem.prototype,"markerIconSlot",void 0),__decorate([query('slot[name="timestamp"]')],LyraTimelineItem.prototype,"timestampSlotEl",void 0),__decorate([query('slot[name="description"]')],LyraTimelineItem.prototype,"descriptionSlotEl",void 0);export{LyraTimelineItem};
@@ -1,4 +1,4 @@
1
- var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing,svg}from"lit";import{property,query,state}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{LyraElement}from"../../../internal/lyra-element.js";import{specialistTokens}from"../../../internal/specialist-tokens.styles.js";import{hostAriaLabel,srOnly}from"../../../internal/a11y.js";import{isRtl}from"../../../internal/rtl.js";import{getScratchCtx}from"../../../internal/canvas.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{finiteNumber,finiteRange}from"../../../internal/numbers.js";import{sanitizeCssColor}from"../../../internal/safe-css.js";import{ThemeWatcher}from"../../../internal/theme-watcher.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{layoutWordCloud,MAX_FONT_SIZE_PX,MAX_WORDS,MIN_SANE_FONT_SIZE}from"./word-cloud-layout.js";import{styles}from"./word-cloud.styles.js";import{LYRA_DEFAULT_items,LYRA_DEFAULT_noData,LYRA_DEFAULT_paginationSummary,LYRA_DEFAULT_wordCloud,LYRA_DEFAULT_wordCloudLegend,LYRA_DEFAULT_wordCloudWord,LYRA_DEFAULT_wordCloudWordAnnouncement,LYRA_DEFAULT_wordCloudWords}from"../../../internal/default-strings.generated.js";const DEFAULT_MIN_FONT_SIZE=12,DEFAULT_MAX_FONT_SIZE=48,PALETTE_SIZE=8,FALLBACK_PALETTE=["#0969da","#1a7f37","#9a6700","#cf222e","#8250df","#bf3989","#0a7d91","#57606a"],DEFAULT_WORD_FONT_WEIGHT="600",NAV_KEYS=new Set(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"]),FOCUS_RING_PAD=2,MAX_INPUT_WORDS=1e4,MAX_WORD_TEXT=256,MAX_TOTAL_WORD_TEXT=16384,MAX_LEGEND_ITEMS=100,MAX_LEGEND_TEXT=256,MAX_TOTAL_LEGEND_TEXT=8192,MAX_PALETTE_ITEMS=64;function warnSkippedWords(count,warnedSkipCounts){warnedSkipCounts.has(count)||(warnedSkipCounts.add(count),console.warn(`<lr-word-cloud> could not place ${count} word(s) (blank text, over the ${MAX_WORDS}-word cap, or the layout search was exhausted) -- they were dropped, not rendered.`))}function boundedText(value,limit){return value.length<=limit?value:`${value.slice(0,Math.max(0,limit-1))}…`}function normalizeWords(value){let input;try{input=Array.isArray(value)?value:[]}catch{input=[]}let inputCount=0;try{inputCount=Math.max(0,Math.min(Number.MAX_SAFE_INTEGER,input.length))}catch{inputCount=0}const scanCount=Math.min(inputCount,MAX_INPUT_WORDS),words=[];let dropped=Math.max(0,inputCount-scanCount),truncated=0,characters=0;for(let index=0;index<scanCount;index++)try{const candidate=input[index];if(typeof candidate!="object"||candidate===null){dropped++;continue}const rawText=candidate.text,rawWeight=candidate.weight,rawColor=candidate.color,rawGroup=candidate.group;if(typeof rawText!="string"){dropped++;continue}const remaining=MAX_TOTAL_WORD_TEXT-characters;if(remaining<=0){dropped+=scanCount-index;break}const textLimit=Math.min(MAX_WORD_TEXT,remaining),text=boundedText(rawText,textLimit);if(!text.trim()){dropped++;continue}let itemTruncated=rawText.length>textLimit;characters+=text.length;const boundedOptionalText=raw=>{if(typeof raw!="string")return;const available=MAX_TOTAL_WORD_TEXT-characters;if(available<=0){raw.length>0&&(itemTruncated=!0);return}const limit=Math.min(MAX_WORD_TEXT,available),result=boundedText(raw,limit);return raw.length>limit&&(itemTruncated=!0),characters+=result.length,result},color=boundedOptionalText(rawColor),group=boundedOptionalText(rawGroup),word={text,weight:Math.max(0,finiteNumber(typeof rawWeight=="number"?rawWeight:0,0)),...color===void 0?{}:{color},...group===void 0?{}:{group}};itemTruncated&&truncated++,words.push(Object.freeze(word))}catch{dropped++}return{items:Object.freeze(words),dropped,truncated,inputCount}}function normalizeLegend(value){let input;try{input=Array.isArray(value)?value:[]}catch{input=[]}let inputCount=0;try{inputCount=Math.max(0,Math.min(Number.MAX_SAFE_INTEGER,input.length))}catch{inputCount=0}const length=Math.min(inputCount,MAX_LEGEND_ITEMS),legend=[];let dropped=Math.max(0,inputCount-length),truncated=0,characters=0;for(let index=0;index<length;index++)try{const item=input[index];if(typeof item!="object"||item===null){dropped++;continue}const rawLabel=item.label,rawColor=item.color;if(typeof rawLabel!="string"||typeof rawColor!="string"){dropped++;continue}const remaining=MAX_TOTAL_LEGEND_TEXT-characters;if(remaining<=0){dropped+=length-index;break}const labelLimit=Math.min(MAX_LEGEND_TEXT,remaining),label=boundedText(rawLabel,labelLimit);if(!label.trim()){dropped++;continue}let itemTruncated=rawLabel.length>labelLimit;characters+=label.length;const colorRemaining=MAX_TOTAL_LEGEND_TEXT-characters,colorLimit=Math.min(MAX_WORD_TEXT,Math.max(0,colorRemaining)),color=colorLimit>0?boundedText(rawColor,colorLimit):"";rawColor.length>colorLimit&&(itemTruncated=!0),characters+=color.length,itemTruncated&&truncated++,legend.push(Object.freeze({label,color}))}catch{dropped++}return{items:Object.freeze(legend),dropped,truncated,inputCount}}function normalizePalette(value){let input;try{input=Array.isArray(value)?value:[]}catch{return}let length=0;try{length=Math.min(input.length,MAX_PALETTE_ITEMS)}catch{return}const palette=[];for(let index=0;index<length;index++)try{const entry=input[index];typeof entry=="string"&&palette.push(boundedText(entry,MAX_WORD_TEXT))}catch{}return Object.freeze(palette)}class LyraWordCloud extends LyraElement{static{this.defaultStrings={...super.defaultStrings,items:LYRA_DEFAULT_items,noData:LYRA_DEFAULT_noData,paginationSummary:LYRA_DEFAULT_paginationSummary,wordCloud:LYRA_DEFAULT_wordCloud,wordCloudLegend:LYRA_DEFAULT_wordCloudLegend,wordCloudWord:LYRA_DEFAULT_wordCloudWord,wordCloudWordAnnouncement:LYRA_DEFAULT_wordCloudWordAnnouncement,wordCloudWords:LYRA_DEFAULT_wordCloudWords}}static{this.styles=[LyraElement.styles,specialistTokens,styles,srOnly]}get words(){return this._words}set words(value){const previous=this._words,normalized=normalizeWords(value);this._words=normalized.items,this.inputDroppedCount=normalized.dropped,this.inputTruncatedCount=normalized.truncated,this.inputWordCount=normalized.inputCount,this.requestUpdate("words",previous)}get scale(){return this._scale}set scale(value){const normalized=value==="sqrt"?"sqrt":"linear",previous=this._scale;if(previous===normalized){value!==normalized&&this.requestUpdate("scale",previous);return}this._scale=normalized,this.requestUpdate("scale",previous)}get wordRotation(){return this._wordRotation}set wordRotation(value){const normalized=value==="mixed"?"mixed":"none",previous=this._wordRotation;if(previous===normalized){value!==normalized&&this.requestUpdate("wordRotation",previous);return}this._wordRotation=normalized,this.requestUpdate("wordRotation",previous)}get palette(){return this._palette}set palette(value){const previous=this._palette;this._palette=normalizePalette(value),this.requestUpdate("palette",previous)}get legend(){return this._legend}set legend(value){const previous=this._legend,normalized=normalizeLegend(value);this._legend=normalized.items,this.legendDroppedCount=normalized.dropped,this.legendTruncatedCount=normalized.truncated,this.legendInputCount=normalized.inputCount,this.requestUpdate("legend",previous)}constructor(){super(),this._words=[],this.inputDroppedCount=0,this.inputTruncatedCount=0,this.inputWordCount=0,this.minFontSize=DEFAULT_MIN_FONT_SIZE,this.maxFontSize=DEFAULT_MAX_FONT_SIZE,this._scale="linear",this._wordRotation="none",this._legend=[],this.legendDroppedCount=0,this.legendTruncatedCount=0,this.legendInputCount=0,this.showLegend=!1,this.cachedLayout={placed:[],skipped:[],skippedCount:0,width:0,height:0},this.focusedIndex=null,this.liveText="",this.pressedOriginalIndex=null,this.hoveredOriginalIndex=null,this.warnedSkipCounts=new Set,this.typographyThemeSignature="",this.paletteThemeSignature="",this.onThemeInvalidated=()=>{const typography=`${this.fontWeight()}\0${this.fontFamily()}`,palette=this.paletteColors().join("\0");if(!this.typographyThemeSignature||typography!==this.typographyThemeSignature){this.refreshTheme();return}palette!==this.paletteThemeSignature&&(this.paletteThemeSignature=palette,this.requestUpdate())},this.onSvgFocus=()=>{this.focusedIndex===null&&this.cachedLayout.placed.length>0&&(this.focusedIndex=0)},this.onSvgPointerDown=event=>{const word=this.nearestWord(event);if(!word)return;const index=this.wordIndex(word);index<0||(this.focusedIndex=index,this.pressedOriginalIndex=word.originalIndex,this.svgEl?.focus())},this.onSvgPointerMove=event=>{this.hoveredOriginalIndex=this.nearestWord(event)?.originalIndex??null},this.clearPointerPress=()=>{this.pressedOriginalIndex=null},this.onSvgPointerLeave=()=>{this.pressedOriginalIndex=null,this.hoveredOriginalIndex=null},this.onSvgClick=event=>{const word=this.nearestWord(event);word&&this.onWordClick(word)},this.onWordClick=word=>{const order=this.navOrder(),idx=order.findIndex(w=>w.originalIndex===word.originalIndex);this.focusedIndex=idx===-1?null:idx,idx!==-1&&this.announce(order[idx]),this.svgEl?.focus(),this.activate(word)},this.onKeyDown=e=>{const order=this.navOrder();if(order.length===0)return;if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.focusedIndex!==null&&this.activate(order[this.focusedIndex]);return}if(!NAV_KEYS.has(e.key))return;if(e.preventDefault(),this.focusedIndex===null){const next2=e.key==="End"?order.length-1:0;this.focusedIndex=next2,this.announce(order[next2]);return}const rtl=isRtl(this),forwardKey=rtl?"ArrowLeft":"ArrowRight",backwardKey=rtl?"ArrowRight":"ArrowLeft";let next=this.focusedIndex;e.key===forwardKey||e.key==="ArrowDown"?next=Math.min(order.length-1,this.focusedIndex+1):e.key===backwardKey||e.key==="ArrowUp"?next=Math.max(0,this.focusedIndex-1):e.key==="Home"?next=0:e.key==="End"&&(next=order.length-1),this.focusedIndex=next,this.announce(order[next])},new ThemeWatcher(this,this.onThemeInvalidated)}connectedCallback(){super.connectedCallback(),this.syncAnnouncementSink()}disconnectedCallback(){super.disconnectedCallback(),this.releaseAnnouncementSink(),this.focusedIndex=null,this.liveText="",this.pressedOriginalIndex=null,this.hoveredOriginalIndex=null}releaseAnnouncementSink(){this.announcementSink?.release(),this.announcementSink=void 0}syncAnnouncementSink(){if(!this.isConnected){this.releaseAnnouncementSink();return}this.announcementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseAnnouncementSink(),this.announcementSink=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}))}fontFamily(){return getComputedStyle(this).getPropertyValue("--lr-font").trim()||"sans-serif"}fontWeight(){return getComputedStyle(this).getPropertyValue("--lr-font-weight-semibold").trim()||DEFAULT_WORD_FONT_WEIGHT}paletteColors(){if(this.palette?.length){const colors2=this.palette.map(sanitizeCssColor).filter(color=>color!==void 0);if(colors2.length)return colors2}const cs=getComputedStyle(this),colors=[];for(let i=0;i<PALETTE_SIZE;i++)colors.push(cs.getPropertyValue(`--lr-word-cloud-color-${i+1}`).trim()||cs.getPropertyValue(`--_lr-word-cloud-color-${i+1}-default`).trim()||FALLBACK_PALETTE[i]);return colors}navOrder(){return[...this.cachedLayout.placed].sort((a,b)=>a.originalIndex-b.originalIndex)}willUpdate(changed){super.willUpdate(changed),(changed.has("words")||changed.has("minFontSize")||changed.has("maxFontSize")||changed.has("domain")||changed.has("scale")||changed.has("wordRotation"))&&this.relayout()}relayout(preserveInteraction=!1){const focusedOriginalIndex=preserveInteraction&&this.focusedIndex!==null?this.navOrder()[this.focusedIndex]?.originalIndex:void 0,priorLiveText=this.liveText,fontWeight=this.fontWeight(),fontFamily=this.fontFamily(),measureText=(text,fontSize)=>{const ctx=getScratchCtx();return ctx?(ctx.font=`${fontWeight} ${fontSize}px ${fontFamily}`,ctx.measureText(text).width):text.length*fontSize*.6},minFontSize=finiteRange(this.minFontSize,DEFAULT_MIN_FONT_SIZE,MIN_SANE_FONT_SIZE,MAX_FONT_SIZE_PX),maxFontSize=finiteRange(this.maxFontSize,DEFAULT_MAX_FONT_SIZE,MIN_SANE_FONT_SIZE,MAX_FONT_SIZE_PX);this.cachedLayout=layoutWordCloud(this.words,{minFontSize,maxFontSize,domain:this.domain,scale:this.scale,wordRotation:this.wordRotation,measureText});const skippedCount=this.inputDroppedCount+this.cachedLayout.skippedCount;if(skippedCount>0&&warnSkippedWords(skippedCount,this.warnedSkipCounts),focusedOriginalIndex!==void 0){const nextIndex=this.navOrder().findIndex(word=>word.originalIndex===focusedOriginalIndex);this.focusedIndex=nextIndex<0?null:nextIndex,this.liveText=nextIndex<0?"":priorLiveText}else this.focusedIndex=null,this.liveText="";this.hoveredOriginalIndex=null}refreshTheme(){this.relayout(!0),this.captureThemeSignatures(),this.requestUpdate()}captureThemeSignatures(){this.typographyThemeSignature=`${this.fontWeight()}\0${this.fontFamily()}`,this.paletteThemeSignature=this.paletteColors().join("\0")}firstUpdated(changed){super.firstUpdated(changed),this.captureThemeSignatures()}activate(word){this.emit("lr-word-activate",Object.freeze({text:word.text,weight:word.weight,group:word.group}))}announce(word){const text=this.localize("wordCloudWordAnnouncement",void 0,{text:word.text,weight:getNumberFormat(this.effectiveLocale).format(word.weight)});this.liveText=text,this.announcementSink?.announce(text)}wordIndex(word){return this.navOrder().findIndex(candidate=>candidate.originalIndex===word.originalIndex)}nearestWord(event){const svgElement=this.svgEl;if(!svgElement||this.cachedLayout.placed.length===0)return;let x,y;try{const matrix=svgElement.getScreenCTM(),DOMPointCtor=this.ownerDocument.defaultView?.DOMPoint;if(!matrix||!DOMPointCtor)throw new Error("No SVG transform");const point=new DOMPointCtor(event.clientX,event.clientY).matrixTransform(matrix.inverse());x=point.x,y=point.y}catch{const rect=svgElement.getBoundingClientRect();if(rect.width<=0||rect.height<=0)return;x=(event.clientX-rect.left)/rect.width*this.cachedLayout.width,y=(event.clientY-rect.top)/rect.height*this.cachedLayout.height}let nearest,distance=Number.POSITIVE_INFINITY;for(const word of this.cachedLayout.placed){const dx=word.x-x,dy=word.y-y,candidateDistance=dx*dx+dy*dy;candidateDistance<distance&&(distance=candidateDistance,nearest=word)}return nearest}collectionSummary(shown,total,itemLabel){return this.localize("paginationSummary",void 0,{start:this.formatCount(shown===0?0:1),end:this.formatCount(shown),total:this.formatCount(total),itemLabel})}renderLegend(entries,explicitInput){if(!this.showLegend)return nothing;const hasLimit=explicitInput&&(this.legendDroppedCount>0||this.legendTruncatedCount>0);if(entries.length===0&&!hasLimit)return nothing;const limitText=hasLimit?this.collectionSummary(entries.length,this.legendInputCount,this.localize("items")):"";return html`
1
+ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing,svg}from"lit";import{property,query,state}from"lit/decorators.js";import{styleMap}from"lit/directives/style-map.js";import{LyraElement}from"../../../internal/lyra-element.js";import{specialistTokens}from"../../../internal/specialist-tokens.styles.js";import{hostAriaLabel,srOnly}from"../../../internal/a11y.js";import{isRtl}from"../../../internal/rtl.js";import{getScratchCtx}from"../../../internal/canvas.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{finiteNumber,finiteRange}from"../../../internal/numbers.js";import{sanitizeCssColor}from"../../../internal/safe-css.js";import{ThemeWatcher}from"../../../internal/theme-watcher.js";import{acquireAnnouncementSink}from"../../../internal/announcer.js";import{devWarn}from"../../../internal/dev-mode-attribute-warning.js";import{layoutWordCloud,MAX_FONT_SIZE_PX,MAX_WORDS,MIN_SANE_FONT_SIZE}from"./word-cloud-layout.js";import{styles}from"./word-cloud.styles.js";import{LYRA_DEFAULT_items,LYRA_DEFAULT_noData,LYRA_DEFAULT_paginationSummary,LYRA_DEFAULT_wordCloud,LYRA_DEFAULT_wordCloudLegend,LYRA_DEFAULT_wordCloudWord,LYRA_DEFAULT_wordCloudWordAnnouncement,LYRA_DEFAULT_wordCloudWords}from"../../../internal/default-strings.generated.js";const DEFAULT_MIN_FONT_SIZE=12,DEFAULT_MAX_FONT_SIZE=48,PALETTE_SIZE=8,FALLBACK_PALETTE=["#0969da","#1a7f37","#9a6700","#cf222e","#8250df","#bf3989","#0a7d91","#57606a"],DEFAULT_WORD_FONT_WEIGHT="600",NAV_KEYS=new Set(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"]),FOCUS_RING_PAD=2,MAX_INPUT_WORDS=1e4,MAX_WORD_TEXT=256,MAX_TOTAL_WORD_TEXT=16384,MAX_LEGEND_ITEMS=100,MAX_LEGEND_TEXT=256,MAX_TOTAL_LEGEND_TEXT=8192,MAX_PALETTE_ITEMS=64;function warnSkippedWords(count,warnedSkipCounts){warnedSkipCounts.has(count)||(warnedSkipCounts.add(count),devWarn(`<lr-word-cloud> could not place ${count} word(s) (blank text, over the ${MAX_WORDS}-word cap, or the layout search was exhausted) -- they were dropped, not rendered.`))}function boundedText(value,limit){return value.length<=limit?value:`${value.slice(0,Math.max(0,limit-1))}…`}function normalizeWords(value){let input;try{input=Array.isArray(value)?value:[]}catch{input=[]}let inputCount=0;try{inputCount=Math.max(0,Math.min(Number.MAX_SAFE_INTEGER,input.length))}catch{inputCount=0}const scanCount=Math.min(inputCount,MAX_INPUT_WORDS),words=[];let dropped=Math.max(0,inputCount-scanCount),truncated=0,characters=0;for(let index=0;index<scanCount;index++)try{const candidate=input[index];if(typeof candidate!="object"||candidate===null){dropped++;continue}const rawText=candidate.text,rawWeight=candidate.weight,rawColor=candidate.color,rawGroup=candidate.group;if(typeof rawText!="string"){dropped++;continue}const remaining=MAX_TOTAL_WORD_TEXT-characters;if(remaining<=0){dropped+=scanCount-index;break}const textLimit=Math.min(MAX_WORD_TEXT,remaining),text=boundedText(rawText,textLimit);if(!text.trim()){dropped++;continue}let itemTruncated=rawText.length>textLimit;characters+=text.length;const boundedOptionalText=raw=>{if(typeof raw!="string")return;const available=MAX_TOTAL_WORD_TEXT-characters;if(available<=0){raw.length>0&&(itemTruncated=!0);return}const limit=Math.min(MAX_WORD_TEXT,available),result=boundedText(raw,limit);return raw.length>limit&&(itemTruncated=!0),characters+=result.length,result},color=boundedOptionalText(rawColor),group=boundedOptionalText(rawGroup),word={text,weight:Math.max(0,finiteNumber(typeof rawWeight=="number"?rawWeight:0,0)),...color===void 0?{}:{color},...group===void 0?{}:{group}};itemTruncated&&truncated++,words.push(Object.freeze(word))}catch{dropped++}return{items:Object.freeze(words),dropped,truncated,inputCount}}function normalizeLegend(value){let input;try{input=Array.isArray(value)?value:[]}catch{input=[]}let inputCount=0;try{inputCount=Math.max(0,Math.min(Number.MAX_SAFE_INTEGER,input.length))}catch{inputCount=0}const length=Math.min(inputCount,MAX_LEGEND_ITEMS),legend=[];let dropped=Math.max(0,inputCount-length),truncated=0,characters=0;for(let index=0;index<length;index++)try{const item=input[index];if(typeof item!="object"||item===null){dropped++;continue}const rawLabel=item.label,rawColor=item.color;if(typeof rawLabel!="string"||typeof rawColor!="string"){dropped++;continue}const remaining=MAX_TOTAL_LEGEND_TEXT-characters;if(remaining<=0){dropped+=length-index;break}const labelLimit=Math.min(MAX_LEGEND_TEXT,remaining),label=boundedText(rawLabel,labelLimit);if(!label.trim()){dropped++;continue}let itemTruncated=rawLabel.length>labelLimit;characters+=label.length;const colorRemaining=MAX_TOTAL_LEGEND_TEXT-characters,colorLimit=Math.min(MAX_WORD_TEXT,Math.max(0,colorRemaining)),color=colorLimit>0?boundedText(rawColor,colorLimit):"";rawColor.length>colorLimit&&(itemTruncated=!0),characters+=color.length,itemTruncated&&truncated++,legend.push(Object.freeze({label,color}))}catch{dropped++}return{items:Object.freeze(legend),dropped,truncated,inputCount}}function normalizePalette(value){let input;try{input=Array.isArray(value)?value:[]}catch{return}let length=0;try{length=Math.min(input.length,MAX_PALETTE_ITEMS)}catch{return}const palette=[];for(let index=0;index<length;index++)try{const entry=input[index];typeof entry=="string"&&palette.push(boundedText(entry,MAX_WORD_TEXT))}catch{}return Object.freeze(palette)}class LyraWordCloud extends LyraElement{static{this.defaultStrings={...super.defaultStrings,items:LYRA_DEFAULT_items,noData:LYRA_DEFAULT_noData,paginationSummary:LYRA_DEFAULT_paginationSummary,wordCloud:LYRA_DEFAULT_wordCloud,wordCloudLegend:LYRA_DEFAULT_wordCloudLegend,wordCloudWord:LYRA_DEFAULT_wordCloudWord,wordCloudWordAnnouncement:LYRA_DEFAULT_wordCloudWordAnnouncement,wordCloudWords:LYRA_DEFAULT_wordCloudWords}}static{this.styles=[LyraElement.styles,specialistTokens,styles,srOnly]}get words(){return this._words}set words(value){const previous=this._words,normalized=normalizeWords(value);this._words=normalized.items,this.inputDroppedCount=normalized.dropped,this.inputTruncatedCount=normalized.truncated,this.inputWordCount=normalized.inputCount,this.requestUpdate("words",previous)}get scale(){return this._scale}set scale(value){const normalized=value==="sqrt"?"sqrt":"linear",previous=this._scale;if(previous===normalized){value!==normalized&&this.requestUpdate("scale",previous);return}this._scale=normalized,this.requestUpdate("scale",previous)}get wordRotation(){return this._wordRotation}set wordRotation(value){const normalized=value==="mixed"?"mixed":"none",previous=this._wordRotation;if(previous===normalized){value!==normalized&&this.requestUpdate("wordRotation",previous);return}this._wordRotation=normalized,this.requestUpdate("wordRotation",previous)}get palette(){return this._palette}set palette(value){const previous=this._palette;this._palette=normalizePalette(value),this.requestUpdate("palette",previous)}get legend(){return this._legend}set legend(value){const previous=this._legend,normalized=normalizeLegend(value);this._legend=normalized.items,this.legendDroppedCount=normalized.dropped,this.legendTruncatedCount=normalized.truncated,this.legendInputCount=normalized.inputCount,this.requestUpdate("legend",previous)}constructor(){super(),this._words=[],this.inputDroppedCount=0,this.inputTruncatedCount=0,this.inputWordCount=0,this.minFontSize=DEFAULT_MIN_FONT_SIZE,this.maxFontSize=DEFAULT_MAX_FONT_SIZE,this._scale="linear",this._wordRotation="none",this._legend=[],this.legendDroppedCount=0,this.legendTruncatedCount=0,this.legendInputCount=0,this.showLegend=!1,this.cachedLayout={placed:[],skipped:[],skippedCount:0,width:0,height:0},this.focusedIndex=null,this.liveText="",this.pressedOriginalIndex=null,this.hoveredOriginalIndex=null,this.warnedSkipCounts=new Set,this.typographyThemeSignature="",this.paletteThemeSignature="",this.onThemeInvalidated=()=>{const typography=`${this.fontWeight()}\0${this.fontFamily()}`,palette=this.paletteColors().join("\0");if(!this.typographyThemeSignature||typography!==this.typographyThemeSignature){this.refreshTheme();return}palette!==this.paletteThemeSignature&&(this.paletteThemeSignature=palette,this.requestUpdate())},this.onSvgFocus=()=>{this.focusedIndex===null&&this.cachedLayout.placed.length>0&&(this.focusedIndex=0)},this.onSvgPointerDown=event=>{const word=this.nearestWord(event);if(!word)return;const index=this.wordIndex(word);index<0||(this.focusedIndex=index,this.pressedOriginalIndex=word.originalIndex,this.svgEl?.focus())},this.onSvgPointerMove=event=>{this.hoveredOriginalIndex=this.nearestWord(event)?.originalIndex??null},this.clearPointerPress=()=>{this.pressedOriginalIndex=null},this.onSvgPointerLeave=()=>{this.pressedOriginalIndex=null,this.hoveredOriginalIndex=null},this.onSvgClick=event=>{const word=this.nearestWord(event);word&&this.onWordClick(word)},this.onWordClick=word=>{const order=this.navOrder(),idx=order.findIndex(w=>w.originalIndex===word.originalIndex);this.focusedIndex=idx===-1?null:idx,idx!==-1&&this.announce(order[idx]),this.svgEl?.focus(),this.activate(word)},this.onKeyDown=e=>{const order=this.navOrder();if(order.length===0)return;if(e.key==="Enter"||e.key===" "){e.preventDefault(),this.focusedIndex!==null&&this.activate(order[this.focusedIndex]);return}if(!NAV_KEYS.has(e.key))return;if(e.preventDefault(),this.focusedIndex===null){const next2=e.key==="End"?order.length-1:0;this.focusedIndex=next2,this.announce(order[next2]);return}const rtl=isRtl(this),forwardKey=rtl?"ArrowLeft":"ArrowRight",backwardKey=rtl?"ArrowRight":"ArrowLeft";let next=this.focusedIndex;e.key===forwardKey||e.key==="ArrowDown"?next=Math.min(order.length-1,this.focusedIndex+1):e.key===backwardKey||e.key==="ArrowUp"?next=Math.max(0,this.focusedIndex-1):e.key==="Home"?next=0:e.key==="End"&&(next=order.length-1),this.focusedIndex=next,this.announce(order[next])},new ThemeWatcher(this,this.onThemeInvalidated)}connectedCallback(){super.connectedCallback(),this.syncAnnouncementSink()}disconnectedCallback(){super.disconnectedCallback(),this.releaseAnnouncementSink(),this.focusedIndex=null,this.liveText="",this.pressedOriginalIndex=null,this.hoveredOriginalIndex=null}releaseAnnouncementSink(){this.announcementSink?.release(),this.announcementSink=void 0}syncAnnouncementSink(){if(!this.isConnected){this.releaseAnnouncementSink();return}this.announcementSink?.element.ownerDocument!==this.ownerDocument&&(this.releaseAnnouncementSink(),this.announcementSink=acquireAnnouncementSink("polite",{document:this.ownerDocument,source:this}))}fontFamily(){return getComputedStyle(this).getPropertyValue("--lr-font").trim()||"sans-serif"}fontWeight(){return getComputedStyle(this).getPropertyValue("--lr-font-weight-semibold").trim()||DEFAULT_WORD_FONT_WEIGHT}paletteColors(){if(this.palette?.length){const colors2=this.palette.map(sanitizeCssColor).filter(color=>color!==void 0);if(colors2.length)return colors2}const cs=getComputedStyle(this),colors=[];for(let i=0;i<PALETTE_SIZE;i++)colors.push(cs.getPropertyValue(`--lr-word-cloud-color-${i+1}`).trim()||cs.getPropertyValue(`--_lr-word-cloud-color-${i+1}-default`).trim()||FALLBACK_PALETTE[i]);return colors}navOrder(){return[...this.cachedLayout.placed].sort((a,b)=>a.originalIndex-b.originalIndex)}willUpdate(changed){super.willUpdate(changed),(changed.has("words")||changed.has("minFontSize")||changed.has("maxFontSize")||changed.has("domain")||changed.has("scale")||changed.has("wordRotation"))&&this.relayout()}relayout(preserveInteraction=!1){const focusedOriginalIndex=preserveInteraction&&this.focusedIndex!==null?this.navOrder()[this.focusedIndex]?.originalIndex:void 0,priorLiveText=this.liveText,fontWeight=this.fontWeight(),fontFamily=this.fontFamily(),measureText=(text,fontSize)=>{const ctx=getScratchCtx();return ctx?(ctx.font=`${fontWeight} ${fontSize}px ${fontFamily}`,ctx.measureText(text).width):text.length*fontSize*.6},minFontSize=finiteRange(this.minFontSize,DEFAULT_MIN_FONT_SIZE,MIN_SANE_FONT_SIZE,MAX_FONT_SIZE_PX),maxFontSize=finiteRange(this.maxFontSize,DEFAULT_MAX_FONT_SIZE,MIN_SANE_FONT_SIZE,MAX_FONT_SIZE_PX);this.cachedLayout=layoutWordCloud(this.words,{minFontSize,maxFontSize,domain:this.domain,scale:this.scale,wordRotation:this.wordRotation,measureText});const skippedCount=this.inputDroppedCount+this.cachedLayout.skippedCount;if(skippedCount>0&&warnSkippedWords(skippedCount,this.warnedSkipCounts),focusedOriginalIndex!==void 0){const nextIndex=this.navOrder().findIndex(word=>word.originalIndex===focusedOriginalIndex);this.focusedIndex=nextIndex<0?null:nextIndex,this.liveText=nextIndex<0?"":priorLiveText}else this.focusedIndex=null,this.liveText="";this.hoveredOriginalIndex=null}refreshTheme(){this.relayout(!0),this.captureThemeSignatures(),this.requestUpdate()}captureThemeSignatures(){this.typographyThemeSignature=`${this.fontWeight()}\0${this.fontFamily()}`,this.paletteThemeSignature=this.paletteColors().join("\0")}firstUpdated(changed){super.firstUpdated(changed),this.captureThemeSignatures()}activate(word){this.emit("lr-word-activate",Object.freeze({text:word.text,weight:word.weight,group:word.group}))}announce(word){const text=this.localize("wordCloudWordAnnouncement",void 0,{text:word.text,weight:getNumberFormat(this.effectiveLocale).format(word.weight)});this.liveText=text,this.announcementSink?.announce(text)}wordIndex(word){return this.navOrder().findIndex(candidate=>candidate.originalIndex===word.originalIndex)}nearestWord(event){const svgElement=this.svgEl;if(!svgElement||this.cachedLayout.placed.length===0)return;let x,y;try{const matrix=svgElement.getScreenCTM(),DOMPointCtor=this.ownerDocument.defaultView?.DOMPoint;if(!matrix||!DOMPointCtor)throw new Error("No SVG transform");const point=new DOMPointCtor(event.clientX,event.clientY).matrixTransform(matrix.inverse());x=point.x,y=point.y}catch{const rect=svgElement.getBoundingClientRect();if(rect.width<=0||rect.height<=0)return;x=(event.clientX-rect.left)/rect.width*this.cachedLayout.width,y=(event.clientY-rect.top)/rect.height*this.cachedLayout.height}let nearest,distance=Number.POSITIVE_INFINITY;for(const word of this.cachedLayout.placed){const dx=word.x-x,dy=word.y-y,candidateDistance=dx*dx+dy*dy;candidateDistance<distance&&(distance=candidateDistance,nearest=word)}return nearest}collectionSummary(shown,total,itemLabel){return this.localize("paginationSummary",void 0,{start:this.formatCount(shown===0?0:1),end:this.formatCount(shown),total:this.formatCount(total),itemLabel})}renderLegend(entries,explicitInput){if(!this.showLegend)return nothing;const hasLimit=explicitInput&&(this.legendDroppedCount>0||this.legendTruncatedCount>0);if(entries.length===0&&!hasLimit)return nothing;const limitText=hasLimit?this.collectionSummary(entries.length,this.legendInputCount,this.localize("items")):"";return html`
2
2
  ${entries.length?html`<div
3
3
  part="legend"
4
4
  role="list"
@@ -1 +1 @@
1
- import{css}from"lit";const styles=css`:host{--_lr-word-cloud-color-1-default:var(--lr-color-brand);--_lr-word-cloud-color-2-default:var(--lr-color-success);--_lr-word-cloud-color-3-default:var(--lr-color-warning);--_lr-word-cloud-color-4-default:var(--lr-color-danger);--_lr-word-cloud-color-5-default:var(--lr-color-chart-1);--_lr-word-cloud-color-6-default:var(--lr-color-chart-2);--_lr-word-cloud-color-7-default:var(--lr-color-chart-3);--_lr-word-cloud-color-8-default:var(--lr-color-chart-4);display:block}[part=base]{gap:var(--lr-space-xs);flex-direction:column;block-size:100%;display:flex}svg{block-size:100%;inline-size:100%;min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);cursor:pointer;display:block}svg:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=word]{pointer-events:none;font-family:var(--lr-font);font-weight:var(--lr-font-weight-semibold);text-anchor:middle;dominant-baseline:middle;transition:text-decoration-color var(--lr-transition-fast);text-decoration:underline #0000}[part=word][data-hovered]{text-decoration-color:currentColor}[part=focus-ring]{fill:none;stroke:var(--lr-focus-ring-color);stroke-width:var(--lr-focus-ring-width);pointer-events:none}[part=focus-ring][data-pressed]{stroke-width:var(--lr-border-width-thick);stroke-dasharray:var(--lr-size-4px) var(--lr-size-2px)}[part=empty]{color:var(--lr-color-text-quiet);font-size:var(--lr-font-size-md-sm)}[part=legend]{gap:var(--lr-space-s);min-inline-size:0;max-inline-size:100%;color:var(--lr-color-text-quiet);font-size:var(--lr-font-size-sm);flex-wrap:wrap;align-items:center;display:flex}[part=legend-item]{align-items:center;gap:var(--lr-space-2xs);min-inline-size:0;max-inline-size:100%;display:inline-flex}[part=legend-swatch]{inline-size:var(--lr-size-0-75rem);block-size:var(--lr-size-0-75rem);border-radius:var(--lr-radius-xs);flex:none}[part=legend-label]{overflow-wrap:anywhere;min-inline-size:0}[part=limit],[part=legend-limit]{color:var(--lr-color-text-quiet);font-size:var(--lr-font-size-xs);font-variant-numeric:tabular-nums;text-align:end}@media (prefers-reduced-motion:reduce){[part=word]{transition:none!important}}@media (forced-colors:active){[part=word]{fill:canvastext}[part=focus-ring]{stroke:highlight}[part=focus-ring][data-pressed]{fill:highlight;fill-opacity:.2}}`;export{styles};
1
+ import{css}from"lit";const styles=css`:host{--_lr-word-cloud-color-1-default:var(--lr-color-brand);--_lr-word-cloud-color-2-default:var(--lr-color-success);--_lr-word-cloud-color-3-default:var(--lr-color-warning);--_lr-word-cloud-color-4-default:var(--lr-color-danger);--_lr-word-cloud-color-5-default:var(--lr-color-chart-1);--_lr-word-cloud-color-6-default:var(--lr-color-chart-2);--_lr-word-cloud-color-7-default:var(--lr-color-chart-3);--_lr-word-cloud-color-8-default:var(--lr-color-chart-4);display:block}[part=base]{gap:var(--lr-space-xs);flex-direction:column;block-size:100%;display:flex}svg{block-size:100%;inline-size:100%;min-inline-size:var(--lr-icon-button-size);min-block-size:var(--lr-icon-button-size);cursor:pointer;display:block}svg:hover{outline:var(--lr-border-width-thin) solid var(--lr-color-border-strong);outline-offset:var(--lr-focus-ring-offset)}svg:focus-visible{outline:var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);outline-offset:var(--lr-focus-ring-offset)}[part=word]{pointer-events:none;font-family:var(--lr-font);font-weight:var(--lr-font-weight-semibold);text-anchor:middle;dominant-baseline:middle;transition:text-decoration-color var(--lr-transition-fast);text-decoration:underline #0000}[part=word][data-hovered]{text-decoration-color:currentColor}[part=focus-ring]{fill:none;stroke:var(--lr-focus-ring-color);stroke-width:var(--lr-focus-ring-width);pointer-events:none}[part=focus-ring][data-pressed]{stroke-width:var(--lr-border-width-thick);stroke-dasharray:var(--lr-size-4px) var(--lr-size-2px)}[part=empty]{color:var(--lr-color-text-quiet);font-size:var(--lr-font-size-md-sm)}[part=legend]{gap:var(--lr-space-s);min-inline-size:0;max-inline-size:100%;color:var(--lr-color-text-quiet);font-size:var(--lr-font-size-sm);flex-wrap:wrap;align-items:center;display:flex}[part=legend-item]{align-items:center;gap:var(--lr-space-2xs);min-inline-size:0;max-inline-size:100%;display:inline-flex}[part=legend-swatch]{inline-size:var(--lr-size-0-75rem);block-size:var(--lr-size-0-75rem);border-radius:var(--lr-radius-xs);flex:none}[part=legend-label]{overflow-wrap:anywhere;min-inline-size:0}[part=limit],[part=legend-limit]{color:var(--lr-color-text-quiet);font-size:var(--lr-font-size-xs);font-variant-numeric:tabular-nums;text-align:end}@media (prefers-reduced-motion:reduce){[part=word]{transition:none!important}}@media (forced-colors:active){[part=word]{fill:canvastext}[part=focus-ring]{stroke:highlight}[part=focus-ring][data-pressed]{fill:highlight;fill-opacity:.2}}`;export{styles};
@@ -373,7 +373,32 @@ download?:string;
373
373
  * `--lr-button-gap` of inline space (a bare `<slot>` is an element child, so a `:empty` rule
374
374
  * could never match it). Seeded synchronously in `willUpdate` before the first paint, then kept
375
375
  * current by each slot's `slotchange` — mirrors `<lr-input>`'s identical pattern. */
376
- private hasStartSlot;private hasEndSlot;private isIconButton;private baseEl?;
376
+ private hasStartSlot;private hasEndSlot;
377
+ /** Whether the default slot's visible content is a single icon-like element (see
378
+ * `hasIconOnlyDefaultContent()`). Seeded synchronously in `willUpdate` before the first paint,
379
+ * then kept current by the default slot's own `slotchange` for a DOM mutation AND by
380
+ * `resizeObserver` below for a CSS-only visibility flip (a container/media query hiding or
381
+ * revealing a slotted label) that mutates no DOM at all and so fires no `slotchange`. */
382
+ private isIconButton;
383
+ /** Watches `labelEl` -- the internal default-slot wrapper, never the host or `baseEl` -- so a
384
+ * consumer's CSS-only rule (a container/media query hiding the visible label at a narrow width,
385
+ * with no accompanying DOM mutation) still re-evaluates `isIconButton`. `slotchange` only fires
386
+ * on a DOM mutation, and there is no `matchMedia` here bound to a breakpoint this component
387
+ * doesn't know about, so a resize of the element that actually wraps the label is the
388
+ * mechanism-agnostic signal a vanishing/returning label produces. Deliberately NOT the host or
389
+ * `baseEl`: once `isIconButton` is `true`, `[part~='base'][data-icon-button]` gives `baseEl` (and
390
+ * therefore the content-sized host) a fixed, definite `inline-size` that no longer depends on the
391
+ * label at all -- watching either one would report a resize on the way IN, then never resize
392
+ * again on the way back out no matter how much wider the label's own container becomes,
393
+ * permanently wedging the button in icon-only mode. `labelEl`'s own box is never touched by
394
+ * `data-icon-button`, so it keeps tracking the label's actual rendered presence in both
395
+ * directions. Armed once `labelEl` exists (from `updated()`, and from a reconnect's
396
+ * `connectedCallback`), torn down in `disconnectedCallback`. */
397
+ private resizeObserver?;
398
+ /** The pending "commit the recompute" animation-frame token armIconOnlyResizeObserver() schedules,
399
+ * and the window that owns it -- both cleared in `disconnectedCallback` so a frame callback never
400
+ * fires against a torn-down or reparented host. */
401
+ private iconOnlyResizeRaf?;private iconOnlyResizeRafOwner?;private baseEl?;private labelEl?;
377
402
  /** Activates the internal base element. In `<button>` mode this also runs the component's
378
403
  * submit/reset behavior (via the button's own `@click`); in anchor mode it triggers native
379
404
  * navigation (the anchor has no `@click` handler of its own). Disabled and loading buttons
@@ -412,6 +437,10 @@ private submitAsNamedSubmitter;
412
437
  * mirrors `<lr-checkbox>`'s/`<lr-switch>`'s identical `_fieldsetDisabled` pattern.
413
438
  */
414
439
  formDisabledCallback(disabled:boolean):void;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;protected willUpdate(changed:PropertyValues):void;private syncAdornmentSlots;private onStartSlotChange;private onEndSlotChange;private hasIconOnlyDefaultContent;private onDefaultSlotChange;
440
+ /** Starts watching `labelEl`, unless already watching, `labelEl` doesn't exist yet (true before
441
+ * the first render), or the realm provides no `ResizeObserver` at all (absent under SSR).
442
+ * Idempotent -- safe to call from every `updated()` and from a reconnect's `connectedCallback`. */
443
+ private armIconOnlyResizeObserver;
415
444
  /** Whether the label takes the row's slack so a trailing affordance stays pinned to the trailing
416
445
  * content edge. Exactly the caret and the `end`/`suffix` adornment qualify: both read as
417
446
  * detached glyphs when they float mid-row. A plain button (or one with only a `start`
@@ -1,4 +1,4 @@
1
- var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r},_a;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{tag}from"../../../internal/prefix.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{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{getFormOwner,installCustomErrorProperty,setFormOwner}from"../../../internal/direct-form-associated.js";import{attachInternalsSafely}from"../../../internal/element-internals.js";import{AnchoredValidityController,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{setCustomState}from"../../../internal/custom-states.js";import{omittedEmptyStringConverter}from"../../../internal/converters.js";import{currentValidityValidator}from"../form-validator.js";import{createButtonExternalLabelController}from"./button-external-label.js";import{LYRA_DEFAULT_fieldRequired}from"../../../internal/default-strings.generated.js";installFormControlInternalsCapture();function isVisuallyHidden(element){if(element.localName===tag("visually-hidden"))return!0;const view=element.ownerDocument.defaultView;if(!view)return!1;const style=view.getComputedStyle(element);return style.display==="none"||style.visibility==="hidden"?!0:style.position==="absolute"&&style.clipPath.startsWith("inset(50%")}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.requestUpdate("disabled",old),this.updateValidity()}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("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.localDescriptionIds="",this.customValidityMessage="",this.reflectingCustomError=!1,this.accessibleLabel=null,this.triggerHasPopup=null,this.triggerExpanded=null,this.triggerPressed=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.type="button",this.formNoValidate=!1,this.loading=!1,this.hasStartSlot=!1,this.hasEndSlot=!1,this.isIconButton=!1,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.onFocus=event=>{relayNativeEvent(this,event)},this.onBlur=event=>{relayNativeEvent(this,event)},this.onStartSlotChange=()=>{this.syncAdornmentSlots()},this.onEndSlotChange=()=>{this.syncAdornmentSlots()},this.onDefaultSlotChange=()=>{this.isIconButton=this.hasIconOnlyDefaultContent(),this.syncButtonStates()},installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init)),this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.customValidityMessage),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 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(){const authored=(this.rel??"").split(/\s+/).filter(token=>token!==""&&token.toLowerCase()!=="opener"),tokens=new Set(authored);return this.target&&(tokens.add("noopener"),tokens.add("noreferrer")),tokens.size>0?[...tokens].join(" "):void 0}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.internals.checkValidity()}reportValidity(){return 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:""}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){this._fieldsetDisabled=disabled,this.updateValidity(),this.syncButtonStates(),this.requestUpdate()}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.syncDescribedByElements(),this.updateValidity(),this.syncButtonStates()}disconnectedCallback(){this.releaseExternalDescription(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.releaseExternalDescription(),this.isConnected&&this.hasUpdated&&this.syncDescribedByElements()}willUpdate(changed){super.willUpdate(changed),this.hasUpdated||(this.syncAdornmentSlots(),this.isIconButton=this.hasIconOnlyDefaultContent())}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"})}hasIconOnlyDefaultContent(){const childElements=this.children,elements=(childElements?Array.from(childElements):[]).filter(element=>!element.getAttribute("slot")).filter(element=>!isVisuallyHidden(element));if(elements.length!==1)return!1;const childNodes=this.childNodes;return(childNodes?Array.from(childNodes):[]).filter(node=>node.nodeType===3).map(node=>node.textContent??"").join("").trim()===""&&(elements[0]?.textContent??"").trim()===""}get labelGrows(){return this.withCaret||this.hasEndSlot||this.withEnd}updated(changed){super.updated(changed),syncAriaControlsElements(this,this.baseEl,this.triggerControls),this.syncDescribedByElements(),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=["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 __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r},_a;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{tag}from"../../../internal/prefix.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{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{getFormOwner,installCustomErrorProperty,setFormOwner}from"../../../internal/direct-form-associated.js";import{attachInternalsSafely}from"../../../internal/element-internals.js";import{AnchoredValidityController,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{setCustomState}from"../../../internal/custom-states.js";import{omittedEmptyStringConverter}from"../../../internal/converters.js";import{currentValidityValidator}from"../form-validator.js";import{createButtonExternalLabelController}from"./button-external-label.js";import{LYRA_DEFAULT_fieldRequired}from"../../../internal/default-strings.generated.js";installFormControlInternalsCapture();function isVisuallyHidden(element){if(element.localName===tag("visually-hidden"))return!0;const view=element.ownerDocument.defaultView;if(!view)return!1;const style=view.getComputedStyle(element);return style.display==="none"||style.visibility==="hidden"?!0:style.position==="absolute"&&style.clipPath.startsWith("inset(50%")}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.requestUpdate("disabled",old),this.updateValidity()}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("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.localDescriptionIds="",this.customValidityMessage="",this.reflectingCustomError=!1,this.accessibleLabel=null,this.triggerHasPopup=null,this.triggerExpanded=null,this.triggerPressed=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.type="button",this.formNoValidate=!1,this.loading=!1,this.hasStartSlot=!1,this.hasEndSlot=!1,this.isIconButton=!1,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.onFocus=event=>{relayNativeEvent(this,event)},this.onBlur=event=>{relayNativeEvent(this,event)},this.onStartSlotChange=()=>{this.syncAdornmentSlots()},this.onEndSlotChange=()=>{this.syncAdornmentSlots()},this.onDefaultSlotChange=()=>{this.isIconButton=this.hasIconOnlyDefaultContent(),this.syncButtonStates()},installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init)),this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.customValidityMessage),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 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(){const authored=(this.rel??"").split(/\s+/).filter(token=>token!==""&&token.toLowerCase()!=="opener"),tokens=new Set(authored);return this.target&&(tokens.add("noopener"),tokens.add("noreferrer")),tokens.size>0?[...tokens].join(" "):void 0}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.internals.checkValidity()}reportValidity(){return 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:""}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){this._fieldsetDisabled=disabled,this.updateValidity(),this.syncButtonStates(),this.requestUpdate()}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.syncDescribedByElements(),this.updateValidity(),this.syncButtonStates(),this.hasUpdated&&this.armIconOnlyResizeObserver()}disconnectedCallback(){this.releaseExternalDescription(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.iconOnlyResizeRaf!==void 0&&this.iconOnlyResizeRafOwner?.cancelAnimationFrame(this.iconOnlyResizeRaf),this.iconOnlyResizeRaf=void 0,this.iconOnlyResizeRafOwner=void 0,super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.releaseExternalDescription(),this.isConnected&&this.hasUpdated&&this.syncDescribedByElements()}willUpdate(changed){super.willUpdate(changed),this.hasUpdated||(this.syncAdornmentSlots(),this.isIconButton=this.hasIconOnlyDefaultContent())}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"})}hasIconOnlyDefaultContent(){const childElements=this.children,elements=(childElements?Array.from(childElements):[]).filter(element=>!element.getAttribute("slot")).filter(element=>!isVisuallyHidden(element));if(elements.length!==1)return!1;const childNodes=this.childNodes;return(childNodes?Array.from(childNodes):[]).filter(node=>node.nodeType===3).map(node=>node.textContent??"").join("").trim()===""&&(elements[0]?.textContent??"").trim()===""}armIconOnlyResizeObserver(){const labelEl=this.labelEl;if(this.resizeObserver||!labelEl)return;const view=this.ownerDocument.defaultView,ResizeObserverCtor=view?.ResizeObserver;!view||!ResizeObserverCtor||(this.resizeObserver=new ResizeObserverCtor(()=>{!this.isConnected||this.ownerDocument.defaultView!==view||(this.iconOnlyResizeRaf!==void 0&&this.iconOnlyResizeRafOwner?.cancelAnimationFrame(this.iconOnlyResizeRaf),this.iconOnlyResizeRafOwner=view,this.iconOnlyResizeRaf=view.requestAnimationFrame(()=>{if(this.iconOnlyResizeRaf=void 0,this.iconOnlyResizeRafOwner=void 0,!this.isConnected||this.ownerDocument.defaultView!==view)return;const next=this.hasIconOnlyDefaultContent();next!==this.isIconButton&&(this.isIconButton=next,this.syncButtonStates())}))}),this.resizeObserver.observe(labelEl))}get labelGrows(){return this.withCaret||this.hasEndSlot||this.withEnd}updated(changed){super.updated(changed),syncAriaControlsElements(this,this.baseEl,this.triggerControls),this.syncDescribedByElements(),this.armIconOnlyResizeObserver(),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=["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)}
@@ -57,4 +57,4 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
57
57
  >
58
58
  ${content}
59
59
  </button>
60
- `}}__decorate([property({attribute:"form"})],LyraButton.prototype,"form",null),__decorate([property({attribute:"aria-label"})],LyraButton.prototype,"accessibleLabel",void 0),__decorate([property({attribute:"aria-haspopup"})],LyraButton.prototype,"triggerHasPopup",void 0),__decorate([property({attribute:"aria-expanded"})],LyraButton.prototype,"triggerExpanded",void 0),__decorate([property({attribute:"aria-pressed"})],LyraButton.prototype,"triggerPressed",void 0),__decorate([property({attribute:"aria-current"})],LyraButton.prototype,"triggerCurrent",void 0),__decorate([property({attribute:"aria-controls"})],LyraButton.prototype,"triggerControls",void 0),__decorate([property({attribute:"aria-describedby"})],LyraButton.prototype,"triggerDescribedBy",void 0),__decorate([property({reflect:!0})],LyraButton.prototype,"variant",null),__decorate([property({reflect:!0})],LyraButton.prototype,"appearance",void 0),__decorate([property({reflect:!0})],LyraButton.prototype,"size",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"pill",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"circle",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"outline",void 0),__decorate([property({attribute:"with-caret",type:Boolean,reflect:!0})],LyraButton.prototype,"withCaret",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"caret",null),__decorate([property({attribute:"with-start",type:Boolean})],LyraButton.prototype,"withStart",void 0),__decorate([property({attribute:"with-end",type:Boolean})],LyraButton.prototype,"withEnd",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"wrap",void 0),__decorate([property()],LyraButton.prototype,"type",void 0),__decorate([property({reflect:!0})],LyraButton.prototype,"value",null),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"required",null),__decorate([property({attribute:"formaction"})],LyraButton.prototype,"formAction",void 0),__decorate([property({attribute:"formenctype"})],LyraButton.prototype,"formEnctype",void 0),__decorate([property({attribute:"formmethod"})],LyraButton.prototype,"formMethod",void 0),__decorate([property({attribute:"formnovalidate",type:Boolean})],LyraButton.prototype,"formNoValidate",void 0),__decorate([property({attribute:"formtarget"})],LyraButton.prototype,"formTarget",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"loading",void 0),__decorate([property({reflect:!0})],LyraButton.prototype,"href",void 0),__decorate([property()],LyraButton.prototype,"target",void 0),__decorate([property()],LyraButton.prototype,"rel",void 0),__decorate([property()],LyraButton.prototype,"download",void 0),__decorate([state()],LyraButton.prototype,"hasStartSlot",void 0),__decorate([state()],LyraButton.prototype,"hasEndSlot",void 0),__decorate([state()],LyraButton.prototype,"isIconButton",void 0),__decorate([query('[part~="base"]')],LyraButton.prototype,"baseEl",void 0);export{LyraButton};
60
+ `}}__decorate([property({attribute:"form"})],LyraButton.prototype,"form",null),__decorate([property({attribute:"aria-label"})],LyraButton.prototype,"accessibleLabel",void 0),__decorate([property({attribute:"aria-haspopup"})],LyraButton.prototype,"triggerHasPopup",void 0),__decorate([property({attribute:"aria-expanded"})],LyraButton.prototype,"triggerExpanded",void 0),__decorate([property({attribute:"aria-pressed"})],LyraButton.prototype,"triggerPressed",void 0),__decorate([property({attribute:"aria-current"})],LyraButton.prototype,"triggerCurrent",void 0),__decorate([property({attribute:"aria-controls"})],LyraButton.prototype,"triggerControls",void 0),__decorate([property({attribute:"aria-describedby"})],LyraButton.prototype,"triggerDescribedBy",void 0),__decorate([property({reflect:!0})],LyraButton.prototype,"variant",null),__decorate([property({reflect:!0})],LyraButton.prototype,"appearance",void 0),__decorate([property({reflect:!0})],LyraButton.prototype,"size",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"pill",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"circle",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"outline",void 0),__decorate([property({attribute:"with-caret",type:Boolean,reflect:!0})],LyraButton.prototype,"withCaret",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"caret",null),__decorate([property({attribute:"with-start",type:Boolean})],LyraButton.prototype,"withStart",void 0),__decorate([property({attribute:"with-end",type:Boolean})],LyraButton.prototype,"withEnd",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"wrap",void 0),__decorate([property()],LyraButton.prototype,"type",void 0),__decorate([property({reflect:!0})],LyraButton.prototype,"value",null),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"required",null),__decorate([property({attribute:"formaction"})],LyraButton.prototype,"formAction",void 0),__decorate([property({attribute:"formenctype"})],LyraButton.prototype,"formEnctype",void 0),__decorate([property({attribute:"formmethod"})],LyraButton.prototype,"formMethod",void 0),__decorate([property({attribute:"formnovalidate",type:Boolean})],LyraButton.prototype,"formNoValidate",void 0),__decorate([property({attribute:"formtarget"})],LyraButton.prototype,"formTarget",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraButton.prototype,"loading",void 0),__decorate([property({reflect:!0})],LyraButton.prototype,"href",void 0),__decorate([property()],LyraButton.prototype,"target",void 0),__decorate([property()],LyraButton.prototype,"rel",void 0),__decorate([property()],LyraButton.prototype,"download",void 0),__decorate([state()],LyraButton.prototype,"hasStartSlot",void 0),__decorate([state()],LyraButton.prototype,"hasEndSlot",void 0),__decorate([state()],LyraButton.prototype,"isIconButton",void 0),__decorate([query('[part~="base"]')],LyraButton.prototype,"baseEl",void 0),__decorate([query('[part="label"]')],LyraButton.prototype,"labelEl",void 0);export{LyraButton};