@aceshooting/lyra-ui 29.2.2 → 30.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 (440) hide show
  1. package/CHANGELOG.md +126 -106
  2. package/README.md +8 -7
  3. package/dist/ai/snapshot.js +1 -1
  4. package/dist/all.d.ts +1 -1
  5. package/dist/all.js +1 -1
  6. package/dist/autoloader.js +1 -1
  7. package/dist/cli/component-inventory.mjs +1 -1
  8. package/dist/cli/lyra-rename-ledger.mjs +1 -1
  9. package/dist/cli/migrate-wa.mjs +7 -3
  10. package/dist/cli/migration-analysis.mjs +1 -1
  11. package/dist/cli/migration-contract.json +1 -1
  12. package/dist/cli/migration-contract.mjs +1 -1
  13. package/dist/cli/migration-immutable-collections.mjs +6 -0
  14. package/dist/cli/migration-renames.mjs +1 -1
  15. package/dist/cli/migration-transforms.mjs +1 -1
  16. package/dist/components/agent-tools/activity-feed/activity-feed.class.d.ts +1 -1
  17. package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.d.ts +1 -2
  18. package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.js +1 -1
  19. package/dist/components/agent-tools/agent-run/agent-run.class.d.ts +3 -4
  20. package/dist/components/agent-tools/agent-run/agent-run.class.js +1 -1
  21. package/dist/components/agent-tools/agent-trace/agent-trace.class.d.ts +1 -1
  22. package/dist/components/agent-tools/agent-trace/agent-trace.class.js +2 -2
  23. package/dist/components/agent-tools/background-runs/background-runs.class.d.ts +1 -2
  24. package/dist/components/agent-tools/background-runs/background-runs.class.js +1 -1
  25. package/dist/components/agent-tools/change-review/change-review.class.d.ts +1 -2
  26. package/dist/components/agent-tools/change-review/change-review.class.js +1 -1
  27. package/dist/components/agent-tools/eval-dataset/eval-dataset.class.d.ts +3 -2
  28. package/dist/components/agent-tools/eval-dataset/eval-dataset.class.js +1 -1
  29. package/dist/components/agent-tools/evaluation-run/evaluation-run.class.d.ts +7 -1
  30. package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +1 -1
  31. package/dist/components/agent-tools/prompt-studio/prompt-studio.class.d.ts +2 -2
  32. package/dist/components/agent-tools/prompt-studio/prompt-studio.class.js +3 -3
  33. package/dist/components/agent-tools/span-waterfall/span-waterfall.class.d.ts +1 -1
  34. package/dist/components/agent-tools/subagent-panel/subagent-panel.class.d.ts +1 -2
  35. package/dist/components/agent-tools/subagent-panel/subagent-panel.class.js +2 -2
  36. package/dist/components/agent-tools/task-list/task-list.class.d.ts +1 -1
  37. package/dist/components/agent-tools/test-results/test-results.class.d.ts +1 -1
  38. package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.d.ts +3 -4
  39. package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.js +1 -5
  40. package/dist/components/agent-tools/tool-timeline/tool-timeline.class.d.ts +3 -3
  41. package/dist/components/agent-tools/trace-tree/trace-tree.class.d.ts +1 -0
  42. package/dist/components/agent-tools/trace-tree/trace-tree.class.js +1 -1
  43. package/dist/components/charts/chart/chart.class.js +3 -3
  44. package/dist/components/charts/chart-3d/chart-3d-data.d.ts +50 -0
  45. package/dist/components/charts/chart-3d/chart-3d-data.js +1 -0
  46. package/dist/components/charts/chart-3d/chart-3d-engine.js +1 -0
  47. package/dist/components/charts/chart-3d/chart-3d.class.d.ts +96 -0
  48. package/dist/components/charts/chart-3d/chart-3d.class.js +47 -0
  49. package/dist/components/charts/chart-3d/chart-3d.d.ts +1 -0
  50. package/dist/components/charts/chart-3d/chart-3d.js +1 -0
  51. package/dist/components/charts/chart-3d/chart-3d.styles.js +1 -0
  52. package/dist/components/charts/index.d.ts +1 -1
  53. package/dist/components/charts/index.js +1 -1
  54. package/dist/components/conversation/agent-workspace/agent-workspace.class.d.ts +3 -3
  55. package/dist/components/conversation/agent-workspace/agent-workspace.class.js +4 -5
  56. package/dist/components/conversation/code-block/code-block-base.class.js +1 -1
  57. package/dist/components/conversation/code-block/shiki-oniguruma.d.ts +3 -0
  58. package/dist/components/conversation/code-block/shiki-oniguruma.js +1 -0
  59. package/dist/components/conversation/code-block/shiki-types.d.ts +3 -5
  60. package/dist/components/conversation/code-block/shiki-types.js +1 -1
  61. package/dist/components/conversation/generation-metrics/generation-metrics.class.js +1 -1
  62. package/dist/components/conversation/markdown/markdown-progressive.js +1 -1
  63. package/dist/components/conversation/message-actions/message-actions.class.js +1 -1
  64. package/dist/components/conversation/message-parts/message-parts.class.js +1 -1
  65. package/dist/components/conversation/model-select/model-select.class.js +1 -1
  66. package/dist/components/conversation/model-settings-panel/model-settings-panel.class.js +1 -1
  67. package/dist/components/conversation/prompt-input/prompt-input.class.js +3 -4
  68. package/dist/components/conversation/prompt-queue/prompt-queue.class.d.ts +1 -1
  69. package/dist/components/conversation/push-to-talk/push-to-talk.class.js +1 -1
  70. package/dist/components/conversation/selection-toolbar/selection-toolbar.class.js +1 -1
  71. package/dist/components/conversation/thread-list/thread-list.class.d.ts +2 -2
  72. package/dist/components/conversation/thread-list/thread-list.class.js +1 -1
  73. package/dist/components/conversation/widget-renderer/registry.js +1 -1
  74. package/dist/components/conversation/widget-renderer/resolve.js +1 -1
  75. package/dist/components/data/calendar/calendar.class.d.ts +3 -1
  76. package/dist/components/data/data-grid/data-grid.class.js +2 -2
  77. package/dist/components/data/flow-canvas/flow-canvas.class.js +2 -2
  78. package/dist/components/data/flow-canvas/flow-source.js +1 -1
  79. package/dist/components/data/flow-node/flow-node.class.d.ts +2 -3
  80. package/dist/components/data/flow-node/flow-node.class.js +2 -4
  81. package/dist/components/data/heatmap/heatmap.class.js +1 -1
  82. package/dist/components/data/sparkline/sparkline.class.d.ts +0 -1
  83. package/dist/components/data/sparkline/sparkline.class.js +1 -1
  84. package/dist/components/data/table/table.class.js +1 -1
  85. package/dist/components/forms/color-picker/color-core.js +1 -1
  86. package/dist/components/forms/date-picker/calendar-core.js +1 -1
  87. package/dist/components/forms/otp-input/otp-input.class.js +1 -1
  88. package/dist/components/forms/signature-pad/signature-pad.class.d.ts +4 -3
  89. package/dist/components/forms/signature-pad/signature-pad.class.js +1 -1
  90. package/dist/components/forms/swatch-picker/swatch-picker.class.d.ts +3 -2
  91. package/dist/components/forms/swatch-picker/swatch-picker.class.js +1 -1
  92. package/dist/components/layout/app-rail/app-rail-item.class.d.ts +0 -2
  93. package/dist/components/layout/app-rail/app-rail-item.class.js +1 -1
  94. package/dist/components/layout/app-rail/app-rail.class.d.ts +3 -3
  95. package/dist/components/layout/command-palette/command-palette.class.d.ts +1 -1
  96. package/dist/components/layout/details/accordion-item.class.d.ts +1 -2
  97. package/dist/components/layout/details/accordion-item.class.js +1 -1
  98. package/dist/components/layout/dock-panel/dock-panel.class.d.ts +4 -11
  99. package/dist/components/layout/dock-panel/dock-panel.class.js +1 -1
  100. package/dist/components/layout/drilldown-panel/drilldown-panel.class.js +1 -1
  101. package/dist/components/layout/menu/menu.class.js +1 -1
  102. package/dist/components/layout/menubar/menubar-item.class.d.ts +1 -1
  103. package/dist/components/layout/menubar/menubar.class.d.ts +1 -1
  104. package/dist/components/layout/multi-split/multi-split.class.d.ts +1 -1
  105. package/dist/components/layout/multi-split/multi-split.class.js +1 -1
  106. package/dist/components/layout/navigation-menu/navigation-menu.class.d.ts +2 -6
  107. package/dist/components/layout/navigation-menu/navigation-menu.class.js +1 -1
  108. package/dist/components/layout/tab-group/tab-group.class.js +1 -1
  109. package/dist/components/layout/virtual-list/virtual-list.class.d.ts +3 -2
  110. package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
  111. package/dist/components/layout/widget/widget.class.d.ts +5 -14
  112. package/dist/components/layout/widget/widget.class.js +2 -2
  113. package/dist/components/lr-chart-3d.js +1 -0
  114. package/dist/components/lr-model-viewer.js +1 -0
  115. package/dist/components/media/av-player/av-metadata.d.ts +1 -13
  116. package/dist/components/media/av-player/av-metadata.js +1 -1
  117. package/dist/components/media/av-player/av-player.class.js +1 -1
  118. package/dist/components/media/file-input/file-input.class.d.ts +10 -13
  119. package/dist/components/media/file-input/file-input.class.js +3 -3
  120. package/dist/components/media/file-input/file-input.styles.js +1 -1
  121. package/dist/components/media/image-viewer/image-viewer-panorama.d.ts +5 -0
  122. package/dist/components/media/image-viewer/image-viewer-panorama.js +8 -0
  123. package/dist/components/media/image-viewer/image-viewer-panorama.styles.js +1 -0
  124. package/dist/components/media/image-viewer/image-viewer.class.d.ts +29 -5
  125. package/dist/components/media/image-viewer/image-viewer.class.js +8 -5
  126. package/dist/components/media/image-viewer/image-viewer.styles.js +1 -1
  127. package/dist/components/media/map/map-anchor-controller.js +1 -0
  128. package/dist/components/media/map/map-anchor-options.d.ts +14 -0
  129. package/dist/components/media/map/map-anchor-options.js +1 -0
  130. package/dist/components/media/map/map-camera.d.ts +34 -0
  131. package/dist/components/media/map/map-camera.js +1 -0
  132. package/dist/components/media/map/map-construction-scheduler.d.ts +13 -0
  133. package/dist/components/media/map/map-construction-scheduler.js +1 -0
  134. package/dist/components/media/map/map-control-options.d.ts +39 -0
  135. package/dist/components/media/map/map-control-options.js +1 -0
  136. package/dist/components/media/map/map-controls-lifecycle.js +1 -0
  137. package/dist/components/media/map/map-cursor.js +1 -0
  138. package/dist/components/media/map/map-data-layer-model.d.ts +40 -0
  139. package/dist/components/media/map/map-data-layer-model.js +1 -0
  140. package/dist/components/media/map/map-drawing-controller.js +1 -0
  141. package/dist/components/media/map/map-drawing-gesture.js +1 -0
  142. package/dist/components/media/map/map-drawing-pan.js +1 -0
  143. package/dist/components/media/map/map-drawing-pointer.js +1 -0
  144. package/dist/components/media/map/map-drawing.d.ts +29 -0
  145. package/dist/components/media/map/map-drawing.js +1 -0
  146. package/dist/components/media/map/map-empty-style.d.ts +8 -0
  147. package/dist/components/media/map/map-empty-style.js +1 -0
  148. package/dist/components/media/map/map-engine-events.js +1 -0
  149. package/dist/components/media/map/map-export-attribution.js +1 -0
  150. package/dist/components/media/map/map-external-source-effects.js +1 -0
  151. package/dist/components/media/map/map-feature-loader-core.js +1 -0
  152. package/dist/components/media/map/map-feature-loader.js +1 -0
  153. package/dist/components/media/map/map-feature-state-router.d.ts +16 -0
  154. package/dist/components/media/map/map-feature-state-router.js +1 -0
  155. package/dist/components/media/map/map-feature-state-routes.js +1 -0
  156. package/dist/components/media/map/map-feature-state.d.ts +16 -0
  157. package/dist/components/media/map/map-feature-state.js +1 -0
  158. package/dist/components/media/map/map-hash-option.js +1 -0
  159. package/dist/components/media/map/map-hash-owner.js +1 -0
  160. package/dist/components/media/map/map-hash.js +1 -0
  161. package/dist/components/media/map/map-hit-test.d.ts +17 -0
  162. package/dist/components/media/map/map-hit-test.js +1 -0
  163. package/dist/components/media/map/map-image-admission.d.ts +7 -0
  164. package/dist/components/media/map/map-image-admission.js +1 -0
  165. package/dist/components/media/map/map-image-export-controller.js +1 -0
  166. package/dist/components/media/map/map-image-export-error.d.ts +3 -0
  167. package/dist/components/media/map/map-image-export-error.js +1 -0
  168. package/dist/components/media/map/map-image-export.d.ts +15 -0
  169. package/dist/components/media/map/map-image-export.js +5 -0
  170. package/dist/components/media/map/map-image-limits.d.ts +4 -0
  171. package/dist/components/media/map/map-image-limits.js +1 -0
  172. package/dist/components/media/map/map-image-metadata.js +3 -0
  173. package/dist/components/media/map/map-image-provider.d.ts +33 -0
  174. package/dist/components/media/map/map-image-provider.js +1 -0
  175. package/dist/components/media/map/map-images.d.ts +9 -0
  176. package/dist/components/media/map/map-images.js +1 -0
  177. package/dist/components/media/map/map-interaction-options.d.ts +26 -0
  178. package/dist/components/media/map/map-interaction-options.js +1 -0
  179. package/dist/components/media/map/map-layer-order.js +1 -0
  180. package/dist/components/media/map/map-loader.d.ts +35 -5
  181. package/dist/components/media/map/map-loader.js +1 -1
  182. package/dist/components/media/map/map-local-image-url.js +1 -0
  183. package/dist/components/media/map/map-local-image.js +1 -0
  184. package/dist/components/media/map/map-overlay-admission.d.ts +13 -0
  185. package/dist/components/media/map/map-overlay-admission.js +1 -0
  186. package/dist/components/media/map/map-owned-feature-input.js +1 -0
  187. package/dist/components/media/map/map-owned-features.js +1 -0
  188. package/dist/components/media/map/map-owned-resources.js +1 -0
  189. package/dist/components/media/map/map-paint-batch.js +1 -0
  190. package/dist/components/media/map/map-readers.js +1 -0
  191. package/dist/components/media/map/map-readiness.js +1 -0
  192. package/dist/components/media/map/map-resource-feature-loaders.js +1 -0
  193. package/dist/components/media/map/map-source-updates.js +1 -0
  194. package/dist/components/media/map/map-style-input.js +1 -0
  195. package/dist/components/media/map/map-style-lifecycle.js +1 -0
  196. package/dist/components/media/map/map-style-override-admission.d.ts +10 -0
  197. package/dist/components/media/map/map-style-override-admission.js +1 -0
  198. package/dist/components/media/map/map-style-overrides.js +1 -0
  199. package/dist/components/media/map/map-style-value.d.ts +3 -0
  200. package/dist/components/media/map/map-style-value.js +1 -0
  201. package/dist/components/media/map/map-vector-style.d.ts +10 -0
  202. package/dist/components/media/map/map-vector-style.js +1 -0
  203. package/dist/components/media/map/map.class.d.ts +558 -51
  204. package/dist/components/media/map/map.class.js +58 -11
  205. package/dist/components/media/map/map.styles.js +1 -1
  206. package/dist/components/media/qr-code/qr-code.class.d.ts +1 -3
  207. package/dist/components/media/qr-code/qr-code.class.js +1 -1
  208. package/dist/components/media/qr-code/qr-code.styles.js +1 -1
  209. package/dist/components/media/video/video.class.d.ts +25 -4
  210. package/dist/components/media/video/video.class.js +11 -3
  211. package/dist/components/media/video/video.styles.js +1 -1
  212. package/dist/components/media/video-playlist/video-playlist.class.d.ts +0 -1
  213. package/dist/components/media/video-playlist/video-playlist.class.js +1 -1
  214. package/dist/components/overlays/chip/chip-group.class.d.ts +1 -1
  215. package/dist/components/overlays/chip/chip-group.class.js +1 -1
  216. package/dist/components/overlays/dialog/confirm.js +1 -1
  217. package/dist/components/overlays/overlay/popover.class.d.ts +1 -1
  218. package/dist/components/overlays/overlay/popover.class.js +2 -1
  219. package/dist/components/overlays/overlay/tooltip.class.js +1 -1
  220. package/dist/components/retrieval/chunk-inspector/chunk-inspector.class.d.ts +4 -7
  221. package/dist/components/retrieval/chunk-inspector/chunk-inspector.class.js +2 -2
  222. package/dist/components/retrieval/claim-evidence/claim-evidence.class.d.ts +2 -2
  223. package/dist/components/retrieval/community-card/community-card.class.d.ts +1 -4
  224. package/dist/components/retrieval/community-card/community-card.class.js +1 -1
  225. package/dist/components/retrieval/embedding-explorer/embedding-explorer-data.d.ts +12 -0
  226. package/dist/components/retrieval/embedding-explorer/embedding-explorer-data.js +1 -0
  227. package/dist/components/retrieval/embedding-explorer/embedding-explorer-engine.js +1 -0
  228. package/dist/components/retrieval/embedding-explorer/embedding-explorer.class.d.ts +26 -7
  229. package/dist/components/retrieval/embedding-explorer/embedding-explorer.class.js +35 -4
  230. package/dist/components/retrieval/embedding-explorer/embedding-explorer.styles.js +1 -1
  231. package/dist/components/retrieval/entity-dossier/entity-dossier.class.d.ts +3 -9
  232. package/dist/components/retrieval/graph/graph-builtin-3d-engine.js +1 -0
  233. package/dist/components/retrieval/graph/graph-engine-adapter.js +1 -0
  234. package/dist/components/retrieval/graph/graph-engine-columns.js +1 -0
  235. package/dist/components/retrieval/graph/graph-model.js +1 -1
  236. package/dist/components/retrieval/graph/graph-spatial-controller.js +13 -8
  237. package/dist/components/retrieval/graph/graph-webgl-engine.js +1 -0
  238. package/dist/components/retrieval/graph/graph.class.d.ts +18 -5
  239. package/dist/components/retrieval/graph/graph.class.js +4 -4
  240. package/dist/components/retrieval/graph/graph.styles.js +1 -1
  241. package/dist/components/retrieval/grounding-summary/grounding-summary.class.d.ts +1 -1
  242. package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.d.ts +1 -1
  243. package/dist/components/retrieval/ingestion-queue/ingestion-queue.class.js +2 -2
  244. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +6 -3
  245. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +3 -3
  246. package/dist/components/retrieval/memory-panel/memory-panel.class.d.ts +3 -10
  247. package/dist/components/retrieval/memory-panel/memory-panel.class.js +1 -1
  248. package/dist/components/retrieval/node-palette/node-palette.class.d.ts +1 -1
  249. package/dist/components/retrieval/path-strip/path-strip.class.d.ts +1 -4
  250. package/dist/components/retrieval/path-strip/path-strip.class.js +1 -1
  251. package/dist/components/retrieval/provenance-panel/provenance-panel.class.d.ts +2 -8
  252. package/dist/components/retrieval/rag-answer/rag-answer.class.d.ts +2 -2
  253. package/dist/components/retrieval/rag-answer/rag-answer.class.js +2 -3
  254. package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.d.ts +1 -11
  255. package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.js +1 -1
  256. package/dist/components/retrieval/retrieval-results/retrieval-results.class.d.ts +8 -12
  257. package/dist/components/retrieval/retrieval-results/retrieval-results.class.js +5 -6
  258. package/dist/components/retrieval/retrieval-search/retrieval-search.class.d.ts +1 -1
  259. package/dist/components/retrieval/retrieval-trace/retrieval-trace.class.d.ts +4 -7
  260. package/dist/components/retrieval/retrieval-trace/retrieval-trace.class.js +2 -3
  261. package/dist/components/retrieval/source-card/source-card.class.d.ts +6 -9
  262. package/dist/components/retrieval/source-card/source-card.class.js +1 -1
  263. package/dist/components/retrieval/source-picker/source-picker.class.d.ts +1 -4
  264. package/dist/components/retrieval/source-picker/source-picker.class.js +1 -1
  265. package/dist/components/utility/diff-view/diff-view.class.js +1 -1
  266. package/dist/components/utility/format/format-options.js +1 -1
  267. package/dist/components/utility/icon/icon.class.d.ts +0 -5
  268. package/dist/components/utility/icon/icon.class.js +2 -2
  269. package/dist/components/utility/icon/icon.styles.js +1 -1
  270. package/dist/components/utility/json-viewer/json-viewer.class.js +1 -1
  271. package/dist/components/utility/known-date/known-date.class.d.ts +0 -3
  272. package/dist/components/utility/known-date/known-date.class.js +1 -1
  273. package/dist/components/utility/mention-popover/mention-popover.class.d.ts +3 -2
  274. package/dist/components/utility/mention-popover/mention-popover.class.js +1 -1
  275. package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
  276. package/dist/components/viewers/calendar-viewer/calendar-viewer.class.js +1 -1
  277. package/dist/components/viewers/contact-viewer/contact-viewer.class.js +1 -1
  278. package/dist/components/viewers/document-preview/document-preview.class.js +1 -1
  279. package/dist/components/viewers/document-viewer/document-viewer-kinds.d.ts +1 -1
  280. package/dist/components/viewers/document-viewer/document-viewer-kinds.js +1 -1
  281. package/dist/components/viewers/document-viewer/document-viewer.class.js +1 -1
  282. package/dist/components/viewers/document-viewer/registry.d.ts +1 -69
  283. package/dist/components/viewers/document-viewer/registry.js +1 -1
  284. package/dist/components/viewers/docx-viewer/docx-viewer.class.js +1 -1
  285. package/dist/components/viewers/email-viewer/email-viewer.class.js +1 -1
  286. package/dist/components/viewers/html-viewer/html-viewer.class.js +1 -1
  287. package/dist/components/viewers/include/include.class.js +1 -1
  288. package/dist/components/viewers/index.d.ts +1 -1
  289. package/dist/components/viewers/index.js +1 -1
  290. package/dist/components/viewers/model-viewer/model-viewer-document.js +1 -0
  291. package/dist/components/viewers/model-viewer/model-viewer-loader.js +1 -0
  292. package/dist/components/viewers/model-viewer/model-viewer-register.d.ts +1 -0
  293. package/dist/components/viewers/model-viewer/model-viewer-register.js +1 -0
  294. package/dist/components/viewers/model-viewer/model-viewer-source.d.ts +1 -0
  295. package/dist/components/viewers/model-viewer/model-viewer-source.js +1 -0
  296. package/dist/components/viewers/model-viewer/model-viewer.class.d.ts +61 -0
  297. package/dist/components/viewers/model-viewer/model-viewer.class.js +9 -0
  298. package/dist/components/viewers/model-viewer/model-viewer.d.ts +1 -0
  299. package/dist/components/viewers/model-viewer/model-viewer.js +1 -0
  300. package/dist/components/viewers/model-viewer/model-viewer.styles.js +1 -0
  301. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +2 -2
  302. package/dist/components/viewers/page-rail/page-rail.class.js +1 -1
  303. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +1 -1
  304. package/dist/components/viewers/pptx-viewer/pptx-viewer.class.js +3 -3
  305. package/dist/components/viewers/svg-viewer/svg-viewer.class.js +1 -1
  306. package/dist/components/viewers/table-viewer-shared.js +1 -1
  307. package/dist/components/viewers/xml-viewer/xml-viewer.class.js +1 -1
  308. package/dist/custom-elements-jsx.d.ts +1 -1
  309. package/dist/events.d.ts +137 -92
  310. package/dist/framework-types.d.ts +2 -2
  311. package/dist/hydration.d.ts +1 -1
  312. package/dist/internal/ansi.d.ts +3 -1
  313. package/dist/internal/ansi.js +1 -1
  314. package/dist/internal/autoloader-manifest.js +1 -1
  315. package/dist/internal/autoloader-tags.d.ts +1 -1
  316. package/dist/internal/autoloader-tags.js +1 -1
  317. package/dist/internal/av-metadata.d.ts +13 -0
  318. package/dist/internal/av-metadata.js +1 -0
  319. package/dist/internal/collection-snapshot.js +1 -1
  320. package/dist/internal/component-loaders.generated.js +1 -1
  321. package/dist/internal/data-descriptors.d.ts +30 -0
  322. package/dist/internal/default-strings/agent-tools.generated.js +1 -1
  323. package/dist/internal/default-strings/charts.generated.js +1 -1
  324. package/dist/internal/default-strings/conversation.generated.js +1 -1
  325. package/dist/internal/default-strings/media.generated.js +1 -1
  326. package/dist/internal/default-strings/shared.generated.js +1 -1
  327. package/dist/internal/default-strings/viewers.generated.js +1 -1
  328. package/dist/internal/document-renderer-registry.d.ts +75 -0
  329. package/dist/internal/document-renderer-registry.js +1 -0
  330. package/dist/internal/drop-session-controller.js +1 -1
  331. package/dist/internal/engine-3d-loader.d.ts +47 -0
  332. package/dist/internal/engine-3d-loader.js +1 -0
  333. package/dist/internal/engine-3d.d.ts +57 -0
  334. package/dist/internal/engine-3d.js +1 -0
  335. package/dist/internal/hierarchy-source-controller.js +1 -1
  336. package/dist/internal/localization-runtime.js +1 -1
  337. package/dist/internal/localization-types.d.ts +1 -1
  338. package/dist/internal/localization.js +1 -1
  339. package/dist/internal/lyra-element.d.ts +2 -2
  340. package/dist/internal/lyra-element.js +1 -1
  341. package/dist/internal/model-viewer-contract.d.ts +5 -0
  342. package/dist/internal/model-viewer-contract.js +1 -0
  343. package/dist/internal/package-metadata.js +1 -1
  344. package/dist/internal/positioner.js +1 -1
  345. package/dist/internal/rendered-state.js +1 -1
  346. package/dist/internal/root-registration-allowlist.js +1 -1
  347. package/dist/internal/scoped-definitions.generated.js +1 -1
  348. package/dist/internal/typed-columns.d.ts +39 -0
  349. package/dist/internal/typed-columns.js +1 -0
  350. package/dist/localization.js +1 -1
  351. package/dist/lyra.d.ts +1 -1
  352. package/dist/lyra.js +1 -1
  353. package/dist/ssr/all.d.ts +1 -1
  354. package/dist/ssr/all.js +1 -1
  355. package/dist/ssr.d.ts +4 -4
  356. package/dist/ssr.js +1 -1
  357. package/dist/svelte.d.ts +1 -1
  358. package/dist/testing/lyra-tag-event-map.d.ts +2 -2
  359. package/dist/testing/lyra-tag-event-map.js +1 -1
  360. package/dist/theme/theme-bootstrap.js +1 -1
  361. package/dist/theme/theme.js +1 -1
  362. package/dist/vue.d.ts +1 -1
  363. package/llms/components/lr-accordion-item.md +2 -2
  364. package/llms/components/lr-agent-eval-dashboard.md +3 -3
  365. package/llms/components/lr-agent-run.md +3 -3
  366. package/llms/components/lr-agent-trace.md +1 -1
  367. package/llms/components/lr-agent-workspace.md +1 -1
  368. package/llms/components/lr-app-rail-item.md +1 -1
  369. package/llms/components/lr-app-rail.md +5 -6
  370. package/llms/components/lr-background-runs.md +4 -4
  371. package/llms/components/lr-calendar.md +1 -1
  372. package/llms/components/lr-change-review.md +5 -5
  373. package/llms/components/lr-chart-3d.md +164 -0
  374. package/llms/components/lr-chunk-inspector.md +4 -5
  375. package/llms/components/lr-citation-badge.md +1 -1
  376. package/llms/components/lr-code-block-core.md +2 -4
  377. package/llms/components/lr-command-palette.md +3 -3
  378. package/llms/components/lr-community-card.md +2 -2
  379. package/llms/components/lr-date-picker.md +1 -1
  380. package/llms/components/lr-details.md +2 -2
  381. package/llms/components/lr-diff-view.md +2 -2
  382. package/llms/components/lr-dock-panel.md +5 -10
  383. package/llms/components/lr-document-viewer.md +21 -14
  384. package/llms/components/lr-embedding-explorer.md +24 -4
  385. package/llms/components/lr-entity-dossier.md +3 -4
  386. package/llms/components/lr-eval-dataset.md +3 -3
  387. package/llms/components/lr-eval-run.md +7 -1
  388. package/llms/components/lr-file-input.md +10 -11
  389. package/llms/components/lr-flow-node.md +2 -3
  390. package/llms/components/lr-geojson-viewer.md +1 -1
  391. package/llms/components/lr-graph.md +21 -2
  392. package/llms/components/lr-grounding-summary.md +1 -1
  393. package/llms/components/lr-icon.md +1 -3
  394. package/llms/components/lr-image-viewer.md +29 -2
  395. package/llms/components/lr-ingestion-queue.md +1 -1
  396. package/llms/components/lr-knowledge-base-admin.md +2 -2
  397. package/llms/components/lr-knowledge-graph-explorer.md +7 -1
  398. package/llms/components/lr-known-date.md +3 -10
  399. package/llms/components/lr-lite-chart.md +1 -1
  400. package/llms/components/lr-map.md +861 -49
  401. package/llms/components/lr-markdown-core.md +1 -2
  402. package/llms/components/lr-memory-panel.md +4 -8
  403. package/llms/components/lr-model-viewer.md +170 -0
  404. package/llms/components/lr-navigation-menu.md +3 -4
  405. package/llms/components/lr-node-palette.md +1 -1
  406. package/llms/components/lr-path-strip.md +2 -3
  407. package/llms/components/lr-provenance-panel.md +3 -5
  408. package/llms/components/lr-qr-code.md +3 -4
  409. package/llms/components/lr-rag-answer.md +1 -1
  410. package/llms/components/lr-rag-eval-dashboard.md +2 -5
  411. package/llms/components/lr-retrieval-results.md +6 -7
  412. package/llms/components/lr-retrieval-trace.md +3 -4
  413. package/llms/components/lr-signature-pad.md +4 -3
  414. package/llms/components/lr-source-card.md +1 -1
  415. package/llms/components/lr-source-list.md +5 -5
  416. package/llms/components/lr-source-picker.md +2 -3
  417. package/llms/components/lr-span-waterfall.md +4 -3
  418. package/llms/components/lr-sparkline.md +3 -3
  419. package/llms/components/lr-subagent-panel.md +3 -3
  420. package/llms/components/lr-tool-call-chip.md +6 -6
  421. package/llms/components/lr-tool-timeline.md +1 -1
  422. package/llms/components/lr-video-playlist.md +3 -3
  423. package/llms/components/lr-video.md +29 -2
  424. package/llms/components/lr-virtual-list.md +3 -2
  425. package/llms/components/lr-widget.md +6 -13
  426. package/llms/index.md +98 -95
  427. package/llms/migration.md +27 -38
  428. package/llms/peers.md +7 -6
  429. package/llms/shared/ai-and-peers.md +1 -1
  430. package/llms/shared/events-and-types.md +8 -0
  431. package/llms/shared/imports-and-registration.md +2 -2
  432. package/llms/shared/v29-to-v30-migration.md +256 -0
  433. package/llms/shared.md +11 -3
  434. package/llms.txt +4 -4
  435. package/locales.json +1 -2328
  436. package/package.json +41 -13
  437. package/registrations.json +1 -1
  438. package/skills/lyra-ui/SKILL.md +4 -3
  439. /package/dist/{components/viewers/document-viewer → internal}/deferred-teardown.js +0 -0
  440. /package/dist/{components/viewers/document-viewer/registry-ownership.js → internal/document-renderer-registry-ownership.js} +0 -0
@@ -1 +1 @@
1
- const LYRA_EVENT_CANCELABLE={"lr-accordion":{"lr-collapse":!0,"lr-expand":!0,"lr-toggle-request":!0},"lr-activity-feed":{"lr-toggle-request":!0},"lr-alert":{"lr-hide":!0,"lr-show":!0},"lr-app-rail":{"lr-rail-resize-request":!0,"lr-toggle-request":!0},"lr-app-rail-group":{"lr-toggle-request":!0},"lr-app-rail-item":{"lr-toggle-request":!0},"lr-approval-queue":{"lr-approval-decision-request":!0},"lr-bar-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-box-plot":{"lr-legend-visibility-change-request":!0},"lr-bubble-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-button":{"lr-invalid":!0},"lr-callout":{"lr-close-request":!0},"lr-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-chat-composer":{"lr-invalid":!0},"lr-chat-message":{"lr-toggle-request":!0},"lr-checkbox":{"lr-checkbox-toggle-request":!0,"lr-invalid":!0},"lr-checkbox-group":{"lr-checkbox-group-toggle-request":!0,"lr-invalid":!0},"lr-chip":{"lr-chip-toggle-request":!0},"lr-code-block":{"lr-toggle-request":!0},"lr-code-block-core":{"lr-toggle-request":!0},"lr-code-editor":{"lr-invalid":!0},"lr-color-picker":{"lr-hide":!0,"lr-invalid":!0,"lr-show":!0},"lr-combobox":{"lr-create":!0,"lr-hide":!0,"lr-invalid":!0,"lr-retry-request":!0,"lr-show":!0},"lr-command-palette":{"lr-close-request":!0,"lr-show":!0},"lr-commit-card":{"lr-toggle-request":!0},"lr-compare-panel":{"lr-vote-request":!0},"lr-confirm-bar":{"lr-approve-request":!0,"lr-deny-request":!0},"lr-context-inspector":{"lr-export-request":!0},"lr-context-menu":{"lr-hide":!0,"lr-select":!0,"lr-show":!0},"lr-context-meter":{"lr-segment-activate-request":!0},"lr-country-picker":{"lr-invalid":!0},"lr-currency-picker":{"lr-invalid":!0},"lr-data-grid":{"lr-cell-contextmenu":!0,"lr-column-resize-request":!0,"lr-retry-request":!0,"lr-sort-request":!0},"lr-date-input":{"lr-hide":!0,"lr-invalid":!0,"lr-show":!0},"lr-details":{"lr-hide":!0,"lr-show":!0},"lr-dialog":{"lr-close-request":!0,"lr-hide":!0,"lr-initial-focus":!0,"lr-request-close":!0,"lr-show":!0},"lr-dock-panel":{"lr-collapse-request":!0,"lr-resize-request":!0,"lr-toggle-request":!0},"lr-document-library":{"lr-retry-request":!0,"lr-sort-request":!0},"lr-doughnut-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-drawer":{"lr-close-request":!0,"lr-hide":!0,"lr-initial-focus":!0,"lr-request-close":!0,"lr-show":!0},"lr-dropdown":{"lr-hide":!0,"lr-select":!0,"lr-show":!0},"lr-dropdown-item":{"lr-menu-item-change-request":!0},"lr-emoji-picker":{"lr-invalid":!0},"lr-eval-result":{"lr-sort-request":!0},"lr-eval-run":{"lr-example-tool-approval-decide-request":!0},"lr-export-button":{"lr-export-request":!0,"lr-hide":!0,"lr-show":!0},"lr-file-input":{"lr-invalid":!0},"lr-graph-legend":{"lr-visibility-change-request":!0},"lr-graph-query-builder":{"lr-invalid":!0,"lr-query-delete-request":!0,"lr-query-load-request":!0,"lr-query-run-request":!0,"lr-query-save-request":!0},"lr-histogram":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-input":{"lr-invalid":!0},"lr-knowledge-base":{"lr-retry-request":!0,"lr-sort-request":!0},"lr-known-date":{"lr-invalid":!0},"lr-lightbox":{"lr-close-request":!0,"lr-hide":!0,"lr-show":!0},"lr-line-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-locale-picker":{"lr-change-request":!0,"lr-invalid":!0},"lr-map":{"lr-map-legend-panel-toggle-request":!0,"lr-map-legend-toggle-request":!0},"lr-media-card":{"lr-media-download-request":!0},"lr-menu":{"lr-select":!0},"lr-menu-item":{"lr-menu-item-change-request":!0},"lr-menubar":{"lr-select":!0},"lr-message-actions":{"lr-feedback-submit-request":!0},"lr-message-feedback":{"lr-feedback-submit-request":!0},"lr-model-select":{"lr-invalid":!0},"lr-multi-split":{"lr-resize-request":!0,"lr-toggle-request":!0},"lr-navigation-menu":{"lr-toggle-request":!0},"lr-number-input":{"lr-invalid":!0},"lr-otp-input":{"lr-complete":!0,"lr-invalid":!0},"lr-page":{"lr-nav-toggle-request":!0},"lr-pagination":{"lr-before-page-change":!0},"lr-phone-input":{"lr-invalid":!0},"lr-pie-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-polar-area-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-popover":{"lr-hide":!0,"lr-show":!0},"lr-prompt-input":{"lr-attachment-preview-request":!0},"lr-prompt-studio":{"lr-change-request":!0,"lr-message-reorder-request":!0},"lr-radar-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-radio":{"lr-invalid":!0},"lr-radio-button":{"lr-invalid":!0},"lr-radio-group":{"lr-invalid":!0},"lr-rating":{"lr-invalid":!0},"lr-reorder-list":{"lr-reorder-request":!0},"lr-responsive-panel":{"lr-close-request":!0},"lr-rubric-form":{"lr-invalid":!0},"lr-scatter-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-select":{"lr-change-request":!0,"lr-hide":!0,"lr-invalid":!0,"lr-show":!0},"lr-signature-pad":{"lr-invalid":!0},"lr-slider":{"lr-invalid":!0},"lr-split-panel":{"lr-reposition-request":!0,"lr-resize-request":!0},"lr-switch":{"lr-invalid":!0,"lr-switch-toggle-request":!0},"lr-table":{"lr-column-resize-request":!0,"lr-retry-request":!0,"lr-row-expand-request":!0,"lr-sort-request":!0},"lr-task-list":{"lr-toggle-request":!0},"lr-terminal":{"lr-download-request":!0},"lr-test-results":{"lr-toggle-request":!0},"lr-textarea":{"lr-invalid":!0},"lr-thinking-panel":{"lr-toggle-request":!0},"lr-thread-list":{"lr-group-toggle-request":!0,"lr-retry-request":!0},"lr-time-input":{"lr-hide":!0,"lr-invalid":!0,"lr-show":!0},"lr-time-range":{"lr-invalid":!0},"lr-time-zone-picker":{"lr-invalid":!0},"lr-toast-item":{"lr-hide":!0,"lr-show":!0},"lr-toggle":{"lr-toggle-toggle-request":!0},"lr-toggle-group":{"lr-toggle-group-toggle-request":!0},"lr-token-input":{"lr-invalid":!0,"lr-token-add-request":!0,"lr-token-edit-request":!0,"lr-token-remove-request":!0},"lr-tool-approval-dialog":{"lr-approve-request":!0,"lr-deny-request":!0},"lr-tool-param-form":{"lr-invalid":!0},"lr-tool-result-dialog":{"lr-maximize-change-request":!0},"lr-tool-select-dialog":{"lr-change-request":!0},"lr-tool-timeline":{"lr-tool-approval-decide-request":!0},"lr-tooltip":{"lr-hide":!0,"lr-show":!0},"lr-tour":{"lr-tour-end-request":!0,"lr-tour-step-change-request":!0},"lr-unit-picker":{"lr-invalid":!0},"lr-voice-picker":{"lr-invalid":!0,"lr-preview-request":!0},"lr-widget":{"lr-collapse-request":!0,"lr-fullscreen-request":!0,"lr-toggle-request":!0,"lr-view-request":!0}};export{LYRA_EVENT_CANCELABLE};
1
+ const LYRA_EVENT_CANCELABLE={"lr-accordion":{"lr-collapse":!0,"lr-expand":!0,"lr-toggle-request":!0},"lr-activity-feed":{"lr-toggle-request":!0},"lr-alert":{"lr-hide":!0,"lr-show":!0},"lr-app-rail":{"lr-rail-resize-request":!0,"lr-toggle-request":!0},"lr-app-rail-group":{"lr-toggle-request":!0},"lr-app-rail-item":{"lr-toggle-request":!0},"lr-approval-queue":{"lr-approval-decision-request":!0},"lr-bar-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-box-plot":{"lr-legend-visibility-change-request":!0},"lr-bubble-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-button":{"lr-invalid":!0},"lr-callout":{"lr-close-request":!0},"lr-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-chat-composer":{"lr-invalid":!0},"lr-chat-message":{"lr-toggle-request":!0},"lr-checkbox":{"lr-checkbox-toggle-request":!0,"lr-invalid":!0},"lr-checkbox-group":{"lr-checkbox-group-toggle-request":!0,"lr-invalid":!0},"lr-chip":{"lr-chip-toggle-request":!0},"lr-code-block":{"lr-toggle-request":!0},"lr-code-block-core":{"lr-toggle-request":!0},"lr-code-editor":{"lr-invalid":!0},"lr-color-picker":{"lr-hide":!0,"lr-invalid":!0,"lr-show":!0},"lr-combobox":{"lr-create":!0,"lr-hide":!0,"lr-invalid":!0,"lr-retry-request":!0,"lr-show":!0},"lr-command-palette":{"lr-close-request":!0,"lr-show":!0},"lr-commit-card":{"lr-toggle-request":!0},"lr-compare-panel":{"lr-vote-request":!0},"lr-confirm-bar":{"lr-approve-request":!0,"lr-deny-request":!0},"lr-context-inspector":{"lr-export-request":!0},"lr-context-menu":{"lr-hide":!0,"lr-select":!0,"lr-show":!0},"lr-context-meter":{"lr-segment-activate-request":!0},"lr-country-picker":{"lr-invalid":!0},"lr-currency-picker":{"lr-invalid":!0},"lr-data-grid":{"lr-cell-contextmenu":!0,"lr-column-resize-request":!0,"lr-retry-request":!0,"lr-sort-request":!0},"lr-date-input":{"lr-hide":!0,"lr-invalid":!0,"lr-show":!0},"lr-details":{"lr-hide":!0,"lr-show":!0},"lr-dialog":{"lr-close-request":!0,"lr-hide":!0,"lr-initial-focus":!0,"lr-request-close":!0,"lr-show":!0},"lr-dock-panel":{"lr-resize-request":!0,"lr-toggle-request":!0},"lr-document-library":{"lr-retry-request":!0,"lr-sort-request":!0},"lr-doughnut-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-drawer":{"lr-close-request":!0,"lr-hide":!0,"lr-initial-focus":!0,"lr-request-close":!0,"lr-show":!0},"lr-dropdown":{"lr-hide":!0,"lr-select":!0,"lr-show":!0},"lr-dropdown-item":{"lr-menu-item-change-request":!0},"lr-emoji-picker":{"lr-invalid":!0},"lr-eval-result":{"lr-sort-request":!0},"lr-eval-run":{"lr-example-tool-approval-decide-request":!0},"lr-export-button":{"lr-export-request":!0,"lr-hide":!0,"lr-show":!0},"lr-file-input":{"lr-invalid":!0},"lr-graph-legend":{"lr-visibility-change-request":!0},"lr-graph-query-builder":{"lr-invalid":!0,"lr-query-delete-request":!0,"lr-query-load-request":!0,"lr-query-run-request":!0,"lr-query-save-request":!0},"lr-histogram":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-input":{"lr-invalid":!0},"lr-knowledge-base":{"lr-retry-request":!0,"lr-sort-request":!0},"lr-known-date":{"lr-invalid":!0},"lr-lightbox":{"lr-close-request":!0,"lr-hide":!0,"lr-show":!0},"lr-line-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-locale-picker":{"lr-change-request":!0,"lr-invalid":!0},"lr-map":{"lr-map-legend-panel-toggle-request":!0,"lr-map-legend-toggle-request":!0},"lr-media-card":{"lr-media-download-request":!0},"lr-menu":{"lr-select":!0},"lr-menu-item":{"lr-menu-item-change-request":!0},"lr-menubar":{"lr-select":!0},"lr-message-actions":{"lr-feedback-submit-request":!0},"lr-message-feedback":{"lr-feedback-submit-request":!0},"lr-model-select":{"lr-invalid":!0},"lr-multi-split":{"lr-resize-request":!0,"lr-toggle-request":!0},"lr-navigation-menu":{"lr-toggle-request":!0},"lr-number-input":{"lr-invalid":!0},"lr-otp-input":{"lr-complete":!0,"lr-invalid":!0},"lr-page":{"lr-nav-toggle-request":!0},"lr-pagination":{"lr-before-page-change":!0},"lr-phone-input":{"lr-invalid":!0},"lr-pie-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-polar-area-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-popover":{"lr-hide":!0,"lr-show":!0},"lr-prompt-input":{"lr-attachment-preview-request":!0},"lr-prompt-studio":{"lr-change-request":!0,"lr-message-reorder-request":!0},"lr-radar-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-radio":{"lr-invalid":!0},"lr-radio-button":{"lr-invalid":!0},"lr-radio-group":{"lr-invalid":!0},"lr-rating":{"lr-invalid":!0},"lr-reorder-list":{"lr-reorder-request":!0},"lr-responsive-panel":{"lr-close-request":!0},"lr-rubric-form":{"lr-invalid":!0},"lr-scatter-chart":{"lr-datum-visibility-change-request":!0,"lr-legend-visibility-change-request":!0},"lr-select":{"lr-change-request":!0,"lr-hide":!0,"lr-invalid":!0,"lr-show":!0},"lr-signature-pad":{"lr-invalid":!0},"lr-slider":{"lr-invalid":!0},"lr-split-panel":{"lr-reposition-request":!0,"lr-resize-request":!0},"lr-switch":{"lr-invalid":!0,"lr-switch-toggle-request":!0},"lr-table":{"lr-column-resize-request":!0,"lr-retry-request":!0,"lr-row-expand-request":!0,"lr-sort-request":!0},"lr-task-list":{"lr-toggle-request":!0},"lr-terminal":{"lr-download-request":!0},"lr-test-results":{"lr-toggle-request":!0},"lr-textarea":{"lr-invalid":!0},"lr-thinking-panel":{"lr-toggle-request":!0},"lr-thread-list":{"lr-group-toggle-request":!0,"lr-retry-request":!0},"lr-time-input":{"lr-hide":!0,"lr-invalid":!0,"lr-show":!0},"lr-time-range":{"lr-invalid":!0},"lr-time-zone-picker":{"lr-invalid":!0},"lr-toast-item":{"lr-hide":!0,"lr-show":!0},"lr-toggle":{"lr-toggle-toggle-request":!0},"lr-toggle-group":{"lr-toggle-group-toggle-request":!0},"lr-token-input":{"lr-invalid":!0,"lr-token-add-request":!0,"lr-token-edit-request":!0,"lr-token-remove-request":!0},"lr-tool-approval-dialog":{"lr-approve-request":!0,"lr-deny-request":!0},"lr-tool-param-form":{"lr-invalid":!0},"lr-tool-result-dialog":{"lr-maximize-change-request":!0},"lr-tool-select-dialog":{"lr-change-request":!0},"lr-tool-timeline":{"lr-tool-approval-decide-request":!0},"lr-tooltip":{"lr-hide":!0,"lr-show":!0},"lr-tour":{"lr-tour-end-request":!0,"lr-tour-step-change-request":!0},"lr-unit-picker":{"lr-invalid":!0},"lr-voice-picker":{"lr-invalid":!0,"lr-preview-request":!0},"lr-widget":{"lr-fullscreen-request":!0,"lr-toggle-request":!0,"lr-view-request":!0}};export{LYRA_EVENT_CANCELABLE};
@@ -1 +1 @@
1
- (function(U,q,D,N,G,J,W,S){const{surfaces:R,contrast:H,accent:Q}=S,b=new Map;for(const r of S.inputs.split(" "))b.set(`--lr-theme-${r.slice(1)}`,Number(r[0]));const _=[...b.keys()];function v(r,n,s=!1){return`--_lr-${s?"a":"l"}${n==="light"?"l":"d"}-${r.slice(11)}`}function V(r,n){const s=b.get(r)??0;let g=`var(${v(r,n)})`;if(s&2){const k=n==="light"?"l":"d",u=r.replace(/color-(?:success|warning|danger|neutral)-/,"color-brand-");g=`var(--_lr-f${k}-${r.slice(11)},${g})var(--_lr-o${k}-${r.slice(11)},var(${v(u,n,!0)},var(${v(u,n)})))`}return s&4?`var(${v(r,n,!0)},${g})`:g}function X(r){const n=`var(--_lr-dark-on,${V(r,"light")})var(--_lr-light-on,${V(r,"dark")})`;if(!((b.get(r)??0)&1))return n;const s=r.startsWith("--lr-theme-space-");return`var(--_lr-dense-on,${n})var(--_lr-dense-off,max(calc((${n}) * var(--_lr-density-${s?"space":"control"},1)),${s?"0px":"var(--_lr-density-target-min,0px)"}))`}try{const r=document.currentScript,n=r?.getAttribute("data-lr-theme-restore"),s=(n==="all"||n==="mode"?n:S.restore)==="mode",g=r?.getAttribute("data-lr-theme-storage-key"),k=g&&g.length<=200?g:U,u=r?.getAttribute("data-lr-theme-attributes")?.trim().split(/\s+/),A=u?.length&&u.length<=8&&new Set(u).size===u.length&&u.every(t=>t.length<=64&&/^data-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(t))?u:q;let w;try{w=JSON.parse(localStorage.getItem(k)??"null")}catch{}if(s){const t=w;w={version:t?.version,mode:t?.mode}}const o=document.documentElement,[Z,tt,et]=D(),f=J(w,S.defaults,Z,tt,(t,e)=>N(t,e,_),Q),y=f.mode,$=y==="unset"?null:y==="system"?matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":y,p={},j=!s&&getComputedStyle(o).getPropertyValue("--_lr-style-resolver").trim()==="1",C=(t,e)=>typeof t=="string"?t:t?.[e],rt=f.tokens,ot=f.overrides,E={...rt,...ot},L=f.look;if(s||(p["data-lr-look"]=L,p["data-lr-density"]=f.density,p["data-lr-surface"]=f.treatment),y!=="unset"&&(p["data-lr-mode"]=y),$)for(const t of A)p[t]=$;const O=f.accentName;let h=f.accent;y!=="unset"&&h&&typeof h=="object"&&!Object.values(h).some(t=>typeof t=="string"||t&&Object.values(t).some(Boolean))&&(h=null),s||(p["data-lr-accent"]=O??(h?"custom":"none"));const a=new Map;if(y==="unset")for(const[t,e]of Object.entries(E))typeof e=="string"&&a.set(t,e);for(const t of s?[]:["light","dark"]){const e=C(f.surface,t),T=C(E["--lr-theme-color-surface-default"],t),c=(R[L]??R.lyra)[t],z=e??T??c[0];for(const m of[!1,!0]){if(m&&(!h||O))continue;const st=et(m?{}:E,t,z,m?h:null,m?H[t].map(l=>[1,3,5].map(d=>parseInt(l.slice(d,d+2),16))):[],c);for(const[l,d]of st){if(l==="--lr-theme-accent"){t===$&&a.set(l,d);continue}const B=b.get(l);if(B!==void 0&&N(l,d,_)){const F=l.match(/^--lr-theme-color-(?:success|warning|danger|neutral)-((?:fill|border|on)-(?:quiet|normal|loud))$/)?.[1],M=!m&&F&&d===`var(--lr-theme-color-brand-${F})`,I=l.slice(11),K=t==="light"?"l":"d";M||a.set(v(l,t,m),d),!m&&B&2&&(a.set(`--_lr-f${K}-${I}`,M?" ":"initial"),a.set(`--_lr-o${K}-${I}`,M?"initial":" ")),t===$&&a.set(l,j?X(l):d)}else t===$&&a.set(l,d)}}}(a.size||y==="unset"&&h&&!O)&&(p["data-lr-theme-scope"]=""),!s&&!j&&W(a,f.treatment);const Y=Symbol.for("@aceshooting/lyra-ui.style-ownership.v1"),P=o;let x;try{x=G(P[Y])}catch{}const i=x??{attributes:new Map,properties:new Map};if(y==="unset")for(const t of A)i.attributes.has(t)||o.removeAttribute(t);try{const t=Symbol.for("@aceshooting/lyra-ui.theme-tokens.v1"),e=P[t];if(!s&&Array.isArray(e)){const T=e.slice(0,528).filter(c=>typeof c=="string"&&c.length<=80&&/^--lr-theme-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(c));for(const c of[...T,..._.filter(z=>b.get(z)&4),"--lr-theme-accent"])!i.properties.has(c)&&o.style.getPropertyValue(c)&&i.properties.set(c,{before:null,priority:"",written:o.style.getPropertyValue(c)});try{delete P[t]}catch{}}}catch{}for(const[t,e]of i.attributes)s&&t!=="data-lr-mode"&&!A.includes(t)||Object.hasOwn(p,t)||(o.getAttribute(t)===e.written&&(e.before===null?o.removeAttribute(t):o.setAttribute(t,e.before)),i.attributes.delete(t));for(const[t,e]of Object.entries(p))i.attributes.has(t)||i.attributes.set(t,{before:o.getAttribute(t),priority:"",written:e}),o.setAttribute(t,e),i.attributes.get(t).written=e;for(const[t,e]of i.properties)s||a.has(t)||(o.style.getPropertyValue(t)===e.written&&!o.style.getPropertyPriority(t)&&(e.before?o.style.setProperty(t,e.before,e.priority):o.style.removeProperty(t)),i.properties.delete(t));for(const[t,e]of a)i.properties.has(t)||i.properties.set(t,{before:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t),written:null}),o.style.getPropertyPriority(t)&&o.style.removeProperty(t),o.style.setProperty(t,e,""),i.properties.get(t).written=o.style.getPropertyValue(t);try{P[Y]=i}catch{}}catch{}})("lyra-theme",["data-lr-theme","data-theme"],function(){const R=["brand","success","warning","danger","neutral"],Q=["quiet","normal","loud"],W=/^--lr-theme-[a-z0-9]+(?:-[a-z0-9]+)*$/,_="--lr-theme-accent",G=/[\x00-\x1f\x7f\\;{}!<>@[\]`$^|~=?&:\u2028\u2029]|\/\*|\*\//,H=/^(?:inherit|initial|revert(?:-layer)?|unset)$/i,J=/([a-z0-9_-]+)\s*\(/gi,K="rgb rgba hsl hsla hwb lab lch oklab oklch color color-mix light-dark calc min max clamp var cubic-bezier steps linear".split(" "),U={light:[255,255,255],dark:[10,10,10]},X=r=>{let o=0,h="";for(const a of r){if(h){a===h&&(h="");continue}if(a==="'"||a==='"')h=a;else if(a==="(")o+=1;else if(a===")"&&(o-=1)<0)return!1}return h===""&&o===0},Y=r=>typeof r=="string"&&r.length<=80&&W.test(r)&&r!==_,P=r=>{if(typeof r!="string")return null;const o=r.trim();if(!o||o.length>256||G.test(o)||H.test(o))return null;for(const h of o.matchAll(J))if(!K.includes((h[1]??"").toLowerCase()))return null;return X(o)?o:null},A=r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!1;const o=Object.getPrototypeOf(r);return o===Object.prototype||o===null},Z=r=>{const o={};try{if(!A(r))return o;const h=Object.keys(r);if(h.length<=512)for(const a of h){if(!Y(a))continue;const g=r[a];if(typeof g=="string"){const u=P(g);u!==null&&(o[a]=u);continue}if(!A(g))continue;const j=Object.hasOwn(g,"light"),i=Object.hasOwn(g,"dark");if(!j&&!i||Object.keys(g).some(u=>u!=="light"&&u!=="dark"))continue;const M=P(g.light),y=P(g.dark);(M!==null||y!==null)&&(o[a]={light:M,dark:y})}}catch{}return o},C=r=>{const o=P(r);if(!(!o||/\b(?:var|light-dark)\s*\(|\b(?:currentcolor|from)\b/i.test(o)||/^(?:accentcolor|accentcolortext|activetext|buttonborder|buttonface|buttontext|canvas|canvastext|field|fieldtext|graytext|highlight|highlighttext|linktext|mark|marktext|selecteditem|selecteditemtext|visitedtext)$/i.test(o)))return CSS.supports("color",o)?o:void 0};return[Z,C,(r,o,h,a,g,j)=>{const i=new Map;for(const[t,n]of Object.entries(r)){const e=typeof n=="string"?n:n[o];e&&i.set(t,e)}const M=typeof a=="string"?{brand:a}:a,y={};for(const t of R){const n=M?.[t],e=typeof n=="string"?n:n?.[o];e&&(y[t]=e)}let u=null;if(i.size>0||Object.keys(y).length>0)try{const t=document.createElement("canvas");t.width=1,t.height=1,u=t.getContext("2d",{willReadFrequently:!0})}catch{u=null}const S=(t,n)=>{if(!u)return null;try{u.clearRect(0,0,1,1),u.fillStyle=t,u.fillRect(0,0,1,1);const e=u.getImageData(0,0,1,1).data,c=(e[3]??0)/255;return[0,1,2].map(f=>Math.round((e[f]??0)*c+(n[f]??0)*(1-c)))}catch{return null}},z=(t,n,e)=>t.map((c,f)=>Math.round(c*(1-e)+(n[f]??0)*e)),B=t=>{const n=t.map(e=>{const c=e/255;return c<=.04045?c/12.92:((c+.055)/1.055)**2.4});return(n[0]??0)*.2126+(n[1]??0)*.7152+(n[2]??0)*.0722},O=(t,n)=>{const e=B(t),c=B(n);return(Math.max(e,c)+.05)/(Math.min(e,c)+.05)},v=[0,0,0],F=[255,255,255],w=t=>O(t,v)>=O(t,F)?v:F,q=(t,n,e=3,c=n)=>{const f=d=>O(d,n)>=e&&O(d,c)>=e&&g.every(k=>O(d,k)>=e);if(f(t))return t;const p=w(n);for(let d=1;d<=10;d+=1){const k=z(t,p,d/10);if(f(k))return k}return p},m=t=>`rgb(${t.join(" ")})`,D=U[o],E=C(h)??C(i.get("--lr-theme-color-surface-default")),s=E&&S(E,D)||D,l=new Map(i),b="--lr-theme-",$=(t,n)=>t!==void 0&&n&&C(t)?S(t,n):null,tt=`${b}color-surface-raised`,N=$(i.get(tt)??j[1],s),L=(t,n,e,c,f)=>{const p=l.get(t);if(p===void 0||!e||f===null)return;const d=$(p,n);if(!d)return;const k=q(d,e,c,f??e);k!==d&&l.set(t,m(k))};L(`${b}color-text-normal`,s,s,4.5,N),L(`${b}color-text-quiet`,s,s,4.5,N);const et=i.has(`${b}color-text-normal`)?$(l.get(`${b}color-text-normal`),s):$(j[2],s),I=(t,n)=>{if(!n)return;const e=l.get(t),c=e===void 0?null:$(e,n);(e===void 0||c&&O(c,n)<4.5)&&l.set(t,m(w(n)))};for(const t of R)for(const n of Q){const e=`${b}color-${t}-fill-${n}`;i.has(e)&&I(`${b}color-${t}-on-${n}`,$(i.get(e),s))}const T=`${b}color-overlay-strong`;(i.has(T)||i.has(`${b}color-on-strong-overlay`))&&I(`${b}color-on-strong-overlay`,i.has(T)?$(i.get(T),s):$(j[3],s));for(const t of i.keys())/^--lr-theme-color-(?:(?:brand|success|warning|danger|neutral)-border-(?:normal|loud)|surface-border|border-strong|focus|chart-\d+)$/.test(t)?L(t,s,s,3):/^--lr-theme-terminal-color-[a-z0-9-]+$/.test(t)?L(t,N,N,4.5):/^--lr-theme-terminal-bg-[a-z0-9-]+$/.test(t)&&L(t,N,et,4.5);if(!u)return l;let V=null;for(const t of R){const n=y[t];if(!n)continue;const e=S(n,s);if(!e)continue;const c=z(s,e,o==="dark"?.24:.14),f=z(s,e,o==="dark"?.62:.55),p=q(e,s,4.5,c),d=o==="dark"?F:v,k=z(s,e,o==="dark"?.46:.38),nt=q(z(s,e,o==="dark"?.78:.72),s),ot=q(z(p,d,.2),s),x=`--lr-theme-color-${t}`;l.set(`${x}-fill-quiet`,m(c)),l.set(`${x}-fill-normal`,m(f)),l.set(`${x}-fill-loud`,m(p)),l.set(`${x}-border-quiet`,m(k)),l.set(`${x}-border-normal`,m(nt)),l.set(`${x}-border-loud`,m(ot)),l.set(`${x}-on-quiet`,m(w(c))),l.set(`${x}-on-normal`,m(w(f))),l.set(`${x}-on-loud`,m(w(p))),t==="brand"&&(l.set("--lr-theme-color-focus",m(q(e,s))),V=n)}return V&&l.set("--lr-theme-accent",V),l}]},function(e,r,o=STYLE_SLOTTED){if(e.startsWith("--lr-theme-surface-")||typeof r!="string"&&!o.includes(e))return!1;for(const t of typeof r=="string"?[r]:[r.light,r.dark])if(t)for(const c of t.matchAll(/var\(\s*(--[\w-]+)/g)){if(c[1]==="--lr-theme-shadow-color")continue;const n=e.match(/^--lr-theme-color-(?:success|warning|danger|neutral)-((?:fill|border|on)-(?:quiet|normal|loud))$/)?.[1];if(!n||t!==`var(--lr-theme-color-brand-${n})`)return!1}return!0},function(i){try{if(!i||typeof i!="object")return;const e=(r,s)=>Object.getOwnPropertyDescriptor(r,s)?.value,c={attributes:new Map,properties:new Map};for(const r of["attributes","properties"]){const s=e(i,r);let d=0;Map.prototype.forEach.call(s,(t,o)=>{if(++d>8192||typeof o!="string"||o.length>96||!(r==="attributes"?/^data-[a-z0-9]+(?:-[a-z0-9]+)*$/:/^--(?:lr-theme-|_lr-)[a-z0-9-]+$/).test(o)||!t||typeof t!="object")throw new TypeError;const p=e(t,"before"),f=e(t,"written"),y=e(t,"priority"),n=e(t,"requested");if(p!==null&&typeof p!="string"||f!==null&&typeof f!="string"||typeof y!="string"||n!==void 0&&typeof n!="string")throw new TypeError;c[r].set(o,{before:p,written:f,priority:y,...n===void 0?{}:{requested:n}})})}return c}catch{return}},function(c,i,N,k,z,d){const f=n=>n!==null&&typeof n=="object"&&!Array.isArray(n),o=(n,t)=>{if(!f(n))return;const e=Object.getOwnPropertyDescriptor(n,t);return e&&"value"in e?e.value:void 0},m=n=>typeof n=="string"&&n.length<=64&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n),p=n=>{const t=N(n);return t&&Object.keys(t).length?t:null},l=n=>{if(n===null)return null;if(typeof n=="string")return k(n);if(!f(n))return;const t={};for(const e of["light","dark"]){const s=o(n,e),O=s===null?null:k(s);O!==void 0&&(t[e]=O)}return Object.keys(t).length?{light:t.light??null,dark:t.dark??null}:void 0},w=n=>{if(n===null||typeof n=="string")return l(n);if(!f(n))return;const t={};for(const e of["brand","success","warning","danger","neutral"]){const s=l(o(n,e));s!==void 0&&(t[e]=s)}return Object.keys(t).length?t:void 0},r={version:2,look:i.look,treatment:i.surface,density:i.density,mode:i.mode,accent:d[i.accent],accentName:i.accent,surface:null},a=o(c,"version");if(!f(c)||a!==void 0&&a!==2)return r;const y=o(c,"look"),g=p(o(c,"tokens"));(m(y)||g)&&(r.look=m(y)?y:"custom",g&&(r.tokens=g));for(const[n,t]of[["treatment",["solid","glass"]],["density",["comfortable","compact","touch"]],["mode",["light","dark","system","auto","unset"]]]){const e=o(c,n);typeof e=="string"&&t.includes(e)&&(r[n]=e==="auto"?"system":e)}const u=o(c,"accentName"),b=w(o(c,"accent"));a===2&&typeof u=="string"&&Object.hasOwn(d,u)?(r.accentName=u,r.accent=d[u]):b!==void 0&&(delete r.accentName,r.accent=b);const h=l(o(c,"surface"));h!==void 0&&(r.surface=h);const j=Object.entries(p(o(c,"overrides"))??{}).filter(([n,t])=>z(n,t));return j.length&&(r.overrides=Object.fromEntries(j)),r},function(l,n){const t=n==="glass";for(const[a,i]of Object.entries({enabled:t?"1":"0",content:t?"''":"none",isolation:t?"isolate":"auto","root-filter":t?"initial":"none","child-filter":t?"none":"initial","child-opacity":t?"1":"0"}))l.set(`--_lr-surface-${a}`,i);l.set("--_lr-glass-blocker",t?"initial":"none"),t||(l.set("--_lr-glass-parent-opacity","0"),l.set("--_lr-next-glass-opacity","0"))},{"restore":"all","defaults":{"look":"shadcn","surface":"glass","density":"comfortable","mode":"system","accent":"emerald"},"inputs":"0color-border-strong 4color-brand-border-loud 4color-brand-border-normal 4color-brand-border-quiet 4color-brand-fill-loud 4color-brand-fill-normal 4color-brand-fill-quiet 4color-brand-on-loud 4color-brand-on-normal 4color-brand-on-quiet 0color-chart-1 0color-chart-2 0color-chart-3 0color-chart-4 0color-chart-5 0color-chart-6 0color-chart-7 0color-chart-8 0color-chart-diverging-1 0color-chart-diverging-2 0color-chart-diverging-3 0color-chart-sequential-1 0color-chart-sequential-2 0color-chart-sequential-3 6color-danger-border-loud 6color-danger-border-normal 6color-danger-border-quiet 6color-danger-fill-loud 6color-danger-fill-normal 6color-danger-fill-quiet 6color-danger-on-loud 6color-danger-on-normal 6color-danger-on-quiet 4color-focus 0color-mix-partner 6color-neutral-border-loud 6color-neutral-border-normal 6color-neutral-border-quiet 6color-neutral-fill-loud 6color-neutral-fill-normal 6color-neutral-fill-quiet 6color-neutral-on-loud 6color-neutral-on-normal 6color-neutral-on-quiet 0color-no-data 0color-on-strong-overlay 0color-overlay 0color-overlay-strong 6color-success-border-loud 6color-success-border-normal 6color-success-border-quiet 6color-success-fill-loud 6color-success-fill-normal 6color-success-fill-quiet 6color-success-on-loud 6color-success-on-normal 6color-success-on-quiet 0color-surface-border 0color-surface-border-subtle 0color-surface-container 0color-surface-container-high 0color-surface-container-highest 0color-surface-container-low 0color-surface-container-lowest 0color-surface-default 0color-surface-overlay 0color-surface-raised 0color-text-normal 0color-text-quiet 6color-warning-border-loud 6color-warning-border-normal 6color-warning-border-quiet 6color-warning-fill-loud 6color-warning-fill-normal 6color-warning-fill-quiet 6color-warning-on-loud 6color-warning-on-normal 6color-warning-on-quiet 1form-control-height-2xs 1form-control-height-l 1form-control-height-m 1form-control-height-s 1form-control-height-xl 1form-control-height-xs 0graph-cat-1 0graph-cat-2 0graph-cat-3 0graph-cat-4 0graph-cat-5 0graph-cat-6 0graph-cat-7 0graph-cat-8 1icon-button-size 0shadow-l 0shadow-m 0shadow-s 0shadow-xl 0shadow-xs 1space-2xl 1space-2xs 1space-l 1space-m 1space-s 1space-xs 0terminal-bg-black 0terminal-bg-blue 0terminal-bg-bright-black 0terminal-bg-bright-blue 0terminal-bg-bright-cyan 0terminal-bg-bright-green 0terminal-bg-bright-magenta 0terminal-bg-bright-red 0terminal-bg-bright-white 0terminal-bg-bright-yellow 0terminal-bg-cyan 0terminal-bg-green 0terminal-bg-magenta 0terminal-bg-red 0terminal-bg-white 0terminal-bg-yellow 0terminal-color-black 0terminal-color-blue 0terminal-color-bright-black 0terminal-color-bright-blue 0terminal-color-bright-cyan 0terminal-color-bright-green 0terminal-color-bright-magenta 0terminal-color-bright-red 0terminal-color-bright-white 0terminal-color-bright-yellow 0terminal-color-cyan 0terminal-color-green 0terminal-color-magenta 0terminal-color-red 0terminal-color-white 0terminal-color-yellow","surfaces":{"lyra":{"light":["#ffffff","#f6f8fa","#1a1a1a","rgb(0 0 0 / 0.92)"],"dark":["#1a1a1a","#22272e","#f2f2f2","rgb(0 0 0 / 0.95)"]},"data":{"light":["#ffffff","#f2f5f8","#10202c","#17212b"],"dark":["#101820","#192630","#eef5fa","#e7eef4"]},"high-contrast":{"light":["#ffffff","#ffffff","#000000","#17212b"],"dark":["#000000","#000000","#ffffff","#e7eef4"]},"material":{"light":["#fff8f5","#f8eeea","#241b17","rgb(0 0 0 / 0.92)"],"dark":["#18120f","#251d19","#f8eee8","rgb(0 0 0 / 0.95)"]},"shadcn":{"light":["#ffffff","#fafafa","#0a0a0a","rgb(0 0 0 / 0.92)"],"dark":["#0a0a0a","#171717","#fafafa","rgb(0 0 0 / 0.95)"]},"terminal":{"light":["#fcfdf9","#f1f5eb","#0d2115","#17212b"],"dark":["#0e1713","#18271e","#e5f5e9","#e7eef4"]}},"contrast":{"light":["#ffffff","#f6f8fa","#f2f5f8","#fff8f5","#f8eeea","#fcf2ed","#f2e7e0","#ecdfd7","#fafafa","#fcfdf9","#f1f5eb"],"dark":["#1a1a1a","#22272e","#2b3038","#101820","#192630","#202e39","#000000","#18120f","#251d19","#302621","#120d0a","#211914","#352a24","#0a0a0a","#171717","#0e1713","#18271e","#203227"]},"accent":{"emerald":"#34d399","peridot":"#a8d84a","topaz":"#f0a83c","ruby":"#e63950","tourmaline":"#ec4899","amethyst":"#9d6df0","aquamarine":"#22d3ee","sapphire":"#4f8ff7","hematite":"#94a3b8"}});
1
+ (function(U,q,D,R,G,J,W,S){const{surfaces:_,contrast:H,accent:Q}=S,b=new Map;for(const r of S.inputs.split(" "))b.set(`--lr-theme-${r.slice(1)}`,Number(r[0]));const A=[...b.keys()];function v(r,n,s=!1){return`--_lr-${s?"a":"l"}${n==="light"?"l":"d"}-${r.slice(11)}`}function V(r,n){const s=b.get(r)??0;let g=`var(${v(r,n)})`;if(s&2){const k=n==="light"?"l":"d",u=r.replace(/color-(?:success|warning|danger|neutral)-/,"color-brand-");g=`var(--_lr-f${k}-${r.slice(11)},${g})var(--_lr-o${k}-${r.slice(11)},var(${v(u,n,!0)},var(${v(u,n)})))`}return s&4?`var(${v(r,n,!0)},${g})`:g}function X(r){const n=`var(--_lr-dark-on,${V(r,"light")})var(--_lr-light-on,${V(r,"dark")})`;if(!((b.get(r)??0)&1))return n;const s=r.startsWith("--lr-theme-space-");return`var(--_lr-dense-on,${n})var(--_lr-dense-off,max(calc((${n}) * var(--_lr-density-${s?"space":"control"},1)),${s?"0px":"var(--_lr-density-target-min,0px)"}))`}try{const r=document.currentScript,n=r?.getAttribute("data-lr-theme-restore"),s=(n==="all"||n==="mode"?n:S.restore)==="mode",g=r?.getAttribute("data-lr-theme-storage-key"),k=g&&g.length<=200?g:U,u=r?.getAttribute("data-lr-theme-attributes")?.trim().split(/\s+/),E=u?.length&&u.length<=8&&new Set(u).size===u.length&&u.every(t=>t.length<=64&&/^data-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(t))?u:q;let w;try{w=JSON.parse(localStorage.getItem(k)??"null")}catch{}if(s){const t=w;w={version:t?.version,mode:t?.mode}}const o=document.documentElement,[Z,tt,et]=D(),f=J(w,S.defaults,Z,tt,(t,e)=>R(t,e,A),Q),y=f.mode,$=y==="unset"?null:y==="system"?matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":y,p={},C=!s&&getComputedStyle(o).getPropertyValue("--_lr-style-resolver").trim()==="1",L=(t,e)=>typeof t=="string"?t:t?.[e],rt=f.tokens,ot=f.overrides,O={...rt,...ot},T=f.look;if(s||(p["data-lr-look"]=T,p["data-lr-density"]=f.density,p["data-lr-surface"]=f.treatment),y!=="unset"&&(p["data-lr-mode"]=y),$)for(const t of E)p[t]=$;const z=f.accentName;let h=f.accent;y!=="unset"&&h&&typeof h=="object"&&!Object.values(h).some(t=>typeof t=="string"||t&&Object.values(t).some(Boolean))&&(h=null),s||(p["data-lr-accent"]=z??(h?"custom":"none"));const a=new Map;if(y==="unset")for(const[t,e]of Object.entries(O))typeof e=="string"&&a.set(t,e);for(const t of s?[]:["light","dark"]){const e=L(f.surface,t),j=L(O["--lr-theme-color-surface-default"],t),c=(Object.hasOwn(_,T)?_[T]:_.lyra)[t],M=e??j??c[0];for(const m of[!1,!0]){if(m&&(!h||z))continue;const st=et(m?{}:O,t,M,m?h:null,m?H[t].map(l=>[1,3,5].map(d=>parseInt(l.slice(d,d+2),16))):[],c);for(const[l,d]of st){if(l==="--lr-theme-accent"){t===$&&a.set(l,d);continue}const B=b.get(l);if(B!==void 0&&R(l,d,A)){const F=l.match(/^--lr-theme-color-(?:success|warning|danger|neutral)-((?:fill|border|on)-(?:quiet|normal|loud))$/)?.[1],N=!m&&F&&d===`var(--lr-theme-color-brand-${F})`,I=l.slice(11),K=t==="light"?"l":"d";N||a.set(v(l,t,m),d),!m&&B&2&&(a.set(`--_lr-f${K}-${I}`,N?" ":"initial"),a.set(`--_lr-o${K}-${I}`,N?"initial":" ")),t===$&&a.set(l,C?X(l):d)}else t===$&&a.set(l,d)}}}(a.size||y==="unset"&&h&&!z)&&(p["data-lr-theme-scope"]=""),!s&&!C&&W(a,f.treatment);const Y=Symbol.for("@aceshooting/lyra-ui.style-ownership.v1"),P=o;let x;try{x=G(P[Y])}catch{}const i=x??{attributes:new Map,properties:new Map};if(y==="unset")for(const t of E)i.attributes.has(t)||o.removeAttribute(t);try{const t=Symbol.for("@aceshooting/lyra-ui.theme-tokens.v1"),e=P[t];if(!s&&Array.isArray(e)){const j=e.slice(0,528).filter(c=>typeof c=="string"&&c.length<=80&&/^--lr-theme-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(c));for(const c of[...j,...A.filter(M=>b.get(M)&4),"--lr-theme-accent"])!i.properties.has(c)&&o.style.getPropertyValue(c)&&i.properties.set(c,{before:null,priority:"",written:o.style.getPropertyValue(c)});try{delete P[t]}catch{}}}catch{}for(const[t,e]of i.attributes)s&&t!=="data-lr-mode"&&!E.includes(t)||Object.hasOwn(p,t)||(o.getAttribute(t)===e.written&&(e.before===null?o.removeAttribute(t):o.setAttribute(t,e.before)),i.attributes.delete(t));for(const[t,e]of Object.entries(p))i.attributes.has(t)||i.attributes.set(t,{before:o.getAttribute(t),priority:"",written:e}),o.setAttribute(t,e),i.attributes.get(t).written=e;for(const[t,e]of i.properties)s||a.has(t)||(o.style.getPropertyValue(t)===e.written&&!o.style.getPropertyPriority(t)&&(e.before?o.style.setProperty(t,e.before,e.priority):o.style.removeProperty(t)),i.properties.delete(t));for(const[t,e]of a)i.properties.has(t)||i.properties.set(t,{before:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t),written:null}),o.style.getPropertyPriority(t)&&o.style.removeProperty(t),o.style.setProperty(t,e,""),i.properties.get(t).written=o.style.getPropertyValue(t);try{P[Y]=i}catch{}}catch{}})("lyra-theme",["data-lr-theme","data-theme"],function(){const R=["brand","success","warning","danger","neutral"],Q=["quiet","normal","loud"],W=/^--lr-theme-[a-z0-9]+(?:-[a-z0-9]+)*$/,_="--lr-theme-accent",G=/[\x00-\x1f\x7f\\;{}!<>@[\]`$^|~=?&:\u2028\u2029]|\/\*|\*\//,H=/^(?:inherit|initial|revert(?:-layer)?|unset)$/i,J=/([a-z0-9_-]+)\s*\(/gi,K="rgb rgba hsl hsla hwb lab lch oklab oklch color color-mix light-dark calc min max clamp var cubic-bezier steps linear".split(" "),U={light:[255,255,255],dark:[10,10,10]},X=r=>{let o=0,h="";for(const a of r){if(h){a===h&&(h="");continue}if(a==="'"||a==='"')h=a;else if(a==="(")o+=1;else if(a===")"&&(o-=1)<0)return!1}return h===""&&o===0},Y=r=>typeof r=="string"&&r.length<=80&&W.test(r)&&r!==_,P=r=>{if(typeof r!="string")return null;const o=r.trim();if(!o||o.length>256||G.test(o)||H.test(o))return null;for(const h of o.matchAll(J))if(!K.includes((h[1]??"").toLowerCase()))return null;return X(o)?o:null},A=r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!1;const o=Object.getPrototypeOf(r);return o===Object.prototype||o===null},Z=r=>{const o={};try{if(!A(r))return o;const h=Object.keys(r);if(h.length<=512)for(const a of h){if(!Y(a))continue;const g=r[a];if(typeof g=="string"){const u=P(g);u!==null&&(o[a]=u);continue}if(!A(g))continue;const j=Object.hasOwn(g,"light"),i=Object.hasOwn(g,"dark");if(!j&&!i||Object.keys(g).some(u=>u!=="light"&&u!=="dark"))continue;const M=P(g.light),y=P(g.dark);(M!==null||y!==null)&&(o[a]={light:M,dark:y})}}catch{}return o},C=r=>{const o=P(r);if(!(!o||/\b(?:var|light-dark)\s*\(|\b(?:currentcolor|from)\b/i.test(o)||/^(?:accentcolor|accentcolortext|activetext|buttonborder|buttonface|buttontext|canvas|canvastext|field|fieldtext|graytext|highlight|highlighttext|linktext|mark|marktext|selecteditem|selecteditemtext|visitedtext)$/i.test(o)))return CSS.supports("color",o)?o:void 0};return[Z,C,(r,o,h,a,g,j)=>{const i=new Map;for(const[t,n]of Object.entries(r)){const e=typeof n=="string"?n:n[o];e&&i.set(t,e)}const M=typeof a=="string"?{brand:a}:a,y={};for(const t of R){const n=M?.[t],e=typeof n=="string"?n:n?.[o];e&&(y[t]=e)}let u=null;if(i.size>0||Object.keys(y).length>0)try{const t=document.createElement("canvas");t.width=1,t.height=1,u=t.getContext("2d",{willReadFrequently:!0})}catch{u=null}const S=(t,n)=>{if(!u)return null;try{u.clearRect(0,0,1,1),u.fillStyle=t,u.fillRect(0,0,1,1);const e=u.getImageData(0,0,1,1).data,c=(e[3]??0)/255;return[0,1,2].map(f=>Math.round((e[f]??0)*c+(n[f]??0)*(1-c)))}catch{return null}},z=(t,n,e)=>t.map((c,f)=>Math.round(c*(1-e)+(n[f]??0)*e)),B=t=>{const n=t.map(e=>{const c=e/255;return c<=.04045?c/12.92:((c+.055)/1.055)**2.4});return(n[0]??0)*.2126+(n[1]??0)*.7152+(n[2]??0)*.0722},O=(t,n)=>{const e=B(t),c=B(n);return(Math.max(e,c)+.05)/(Math.min(e,c)+.05)},v=[0,0,0],F=[255,255,255],w=t=>O(t,v)>=O(t,F)?v:F,q=(t,n,e=3,c=n)=>{const f=d=>O(d,n)>=e&&O(d,c)>=e&&g.every(k=>O(d,k)>=e);if(f(t))return t;const p=w(n);for(let d=1;d<=10;d+=1){const k=z(t,p,d/10);if(f(k))return k}return p},m=t=>`rgb(${t.join(" ")})`,D=U[o],E=C(h)??C(i.get("--lr-theme-color-surface-default")),s=E&&S(E,D)||D,l=new Map(i),b="--lr-theme-",$=(t,n)=>t!==void 0&&n&&C(t)?S(t,n):null,tt=`${b}color-surface-raised`,N=$(i.get(tt)??j[1],s),L=(t,n,e,c,f)=>{const p=l.get(t);if(p===void 0||!e||f===null)return;const d=$(p,n);if(!d)return;const k=q(d,e,c,f??e);k!==d&&l.set(t,m(k))};L(`${b}color-text-normal`,s,s,4.5,N),L(`${b}color-text-quiet`,s,s,4.5,N);const et=i.has(`${b}color-text-normal`)?$(l.get(`${b}color-text-normal`),s):$(j[2],s),I=(t,n)=>{if(!n)return;const e=l.get(t),c=e===void 0?null:$(e,n);(e===void 0||c&&O(c,n)<4.5)&&l.set(t,m(w(n)))};for(const t of R)for(const n of Q){const e=`${b}color-${t}-fill-${n}`;i.has(e)&&I(`${b}color-${t}-on-${n}`,$(i.get(e),s))}const T=`${b}color-overlay-strong`;(i.has(T)||i.has(`${b}color-on-strong-overlay`))&&I(`${b}color-on-strong-overlay`,i.has(T)?$(i.get(T),s):$(j[3],s));for(const t of i.keys())/^--lr-theme-color-(?:(?:brand|success|warning|danger|neutral)-border-(?:normal|loud)|surface-border|border-strong|focus|chart-\d+)$/.test(t)?L(t,s,s,3):/^--lr-theme-terminal-color-[a-z0-9-]+$/.test(t)?L(t,N,N,4.5):/^--lr-theme-terminal-bg-[a-z0-9-]+$/.test(t)&&L(t,N,et,4.5);if(!u)return l;let V=null;for(const t of R){const n=y[t];if(!n)continue;const e=S(n,s);if(!e)continue;const c=z(s,e,o==="dark"?.24:.14),f=z(s,e,o==="dark"?.62:.55),p=q(e,s,4.5,c),d=o==="dark"?F:v,k=z(s,e,o==="dark"?.46:.38),nt=q(z(s,e,o==="dark"?.78:.72),s),ot=q(z(p,d,.2),s),x=`--lr-theme-color-${t}`;l.set(`${x}-fill-quiet`,m(c)),l.set(`${x}-fill-normal`,m(f)),l.set(`${x}-fill-loud`,m(p)),l.set(`${x}-border-quiet`,m(k)),l.set(`${x}-border-normal`,m(nt)),l.set(`${x}-border-loud`,m(ot)),l.set(`${x}-on-quiet`,m(w(c))),l.set(`${x}-on-normal`,m(w(f))),l.set(`${x}-on-loud`,m(w(p))),t==="brand"&&(l.set("--lr-theme-color-focus",m(q(e,s))),V=n)}return V&&l.set("--lr-theme-accent",V),l}]},function(e,r,o=STYLE_SLOTTED){if(e.startsWith("--lr-theme-surface-")||typeof r!="string"&&!o.includes(e))return!1;for(const t of typeof r=="string"?[r]:[r.light,r.dark])if(t)for(const c of t.matchAll(/var\(\s*(--[\w-]+)/g)){if(c[1]==="--lr-theme-shadow-color")continue;const n=e.match(/^--lr-theme-color-(?:success|warning|danger|neutral)-((?:fill|border|on)-(?:quiet|normal|loud))$/)?.[1];if(!n||t!==`var(--lr-theme-color-brand-${n})`)return!1}return!0},function(i){try{if(!i||typeof i!="object")return;const e=(r,s)=>Object.getOwnPropertyDescriptor(r,s)?.value,c={attributes:new Map,properties:new Map};for(const r of["attributes","properties"]){const s=e(i,r);let d=0;Map.prototype.forEach.call(s,(t,o)=>{if(++d>8192||typeof o!="string"||o.length>96||!(r==="attributes"?/^data-[a-z0-9]+(?:-[a-z0-9]+)*$/:/^--(?:lr-theme-|_lr-)[a-z0-9-]+$/).test(o)||!t||typeof t!="object")throw new TypeError;const p=e(t,"before"),f=e(t,"written"),y=e(t,"priority"),n=e(t,"requested");if(p!==null&&typeof p!="string"||f!==null&&typeof f!="string"||typeof y!="string"||n!==void 0&&typeof n!="string")throw new TypeError;c[r].set(o,{before:p,written:f,priority:y,...n===void 0?{}:{requested:n}})})}return c}catch{return}},function(c,i,N,k,z,d){const f=n=>n!==null&&typeof n=="object"&&!Array.isArray(n),o=(n,t)=>{if(!f(n))return;const e=Object.getOwnPropertyDescriptor(n,t);return e&&"value"in e?e.value:void 0},m=n=>typeof n=="string"&&n.length<=64&&/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n),p=n=>{const t=N(n);return t&&Object.keys(t).length?t:null},l=n=>{if(n===null)return null;if(typeof n=="string")return k(n);if(!f(n))return;const t={};for(const e of["light","dark"]){const s=o(n,e),O=s===null?null:k(s);O!==void 0&&(t[e]=O)}return Object.keys(t).length?{light:t.light??null,dark:t.dark??null}:void 0},w=n=>{if(n===null||typeof n=="string")return l(n);if(!f(n))return;const t={};for(const e of["brand","success","warning","danger","neutral"]){const s=l(o(n,e));s!==void 0&&(t[e]=s)}return Object.keys(t).length?t:void 0},r={version:2,look:i.look,treatment:i.surface,density:i.density,mode:i.mode,accent:d[i.accent],accentName:i.accent,surface:null},a=o(c,"version");if(!f(c)||a!==void 0&&a!==2)return r;const y=o(c,"look"),g=p(o(c,"tokens"));(m(y)||g)&&(r.look=m(y)?y:"custom",g&&(r.tokens=g));for(const[n,t]of[["treatment",["solid","glass"]],["density",["comfortable","compact","touch"]],["mode",["light","dark","system","auto","unset"]]]){const e=o(c,n);typeof e=="string"&&t.includes(e)&&(r[n]=e==="auto"?"system":e)}const u=o(c,"accentName"),b=w(o(c,"accent"));a===2&&typeof u=="string"&&Object.hasOwn(d,u)?(r.accentName=u,r.accent=d[u]):b!==void 0&&(delete r.accentName,r.accent=b);const h=l(o(c,"surface"));h!==void 0&&(r.surface=h);const j=Object.entries(p(o(c,"overrides"))??{}).filter(([n,t])=>z(n,t));return j.length&&(r.overrides=Object.fromEntries(j)),r},function(l,n){const t=n==="glass";for(const[a,i]of Object.entries({enabled:t?"1":"0",content:t?"''":"none",isolation:t?"isolate":"auto","root-filter":t?"initial":"none","child-filter":t?"none":"initial","child-opacity":t?"1":"0"}))l.set(`--_lr-surface-${a}`,i);l.set("--_lr-glass-blocker",t?"initial":"none"),t||(l.set("--_lr-glass-parent-opacity","0"),l.set("--_lr-next-glass-opacity","0"))},{"restore":"all","defaults":{"look":"shadcn","surface":"glass","density":"comfortable","mode":"system","accent":"emerald"},"inputs":"0color-border-strong 4color-brand-border-loud 4color-brand-border-normal 4color-brand-border-quiet 4color-brand-fill-loud 4color-brand-fill-normal 4color-brand-fill-quiet 4color-brand-on-loud 4color-brand-on-normal 4color-brand-on-quiet 0color-chart-1 0color-chart-2 0color-chart-3 0color-chart-4 0color-chart-5 0color-chart-6 0color-chart-7 0color-chart-8 0color-chart-diverging-1 0color-chart-diverging-2 0color-chart-diverging-3 0color-chart-sequential-1 0color-chart-sequential-2 0color-chart-sequential-3 6color-danger-border-loud 6color-danger-border-normal 6color-danger-border-quiet 6color-danger-fill-loud 6color-danger-fill-normal 6color-danger-fill-quiet 6color-danger-on-loud 6color-danger-on-normal 6color-danger-on-quiet 4color-focus 0color-mix-partner 6color-neutral-border-loud 6color-neutral-border-normal 6color-neutral-border-quiet 6color-neutral-fill-loud 6color-neutral-fill-normal 6color-neutral-fill-quiet 6color-neutral-on-loud 6color-neutral-on-normal 6color-neutral-on-quiet 0color-no-data 0color-on-strong-overlay 0color-overlay 0color-overlay-strong 6color-success-border-loud 6color-success-border-normal 6color-success-border-quiet 6color-success-fill-loud 6color-success-fill-normal 6color-success-fill-quiet 6color-success-on-loud 6color-success-on-normal 6color-success-on-quiet 0color-surface-border 0color-surface-border-subtle 0color-surface-container 0color-surface-container-high 0color-surface-container-highest 0color-surface-container-low 0color-surface-container-lowest 0color-surface-default 0color-surface-overlay 0color-surface-raised 0color-text-normal 0color-text-quiet 6color-warning-border-loud 6color-warning-border-normal 6color-warning-border-quiet 6color-warning-fill-loud 6color-warning-fill-normal 6color-warning-fill-quiet 6color-warning-on-loud 6color-warning-on-normal 6color-warning-on-quiet 1form-control-height-2xs 1form-control-height-l 1form-control-height-m 1form-control-height-s 1form-control-height-xl 1form-control-height-xs 0graph-cat-1 0graph-cat-2 0graph-cat-3 0graph-cat-4 0graph-cat-5 0graph-cat-6 0graph-cat-7 0graph-cat-8 1icon-button-size 0shadow-l 0shadow-m 0shadow-s 0shadow-xl 0shadow-xs 1space-2xl 1space-2xs 1space-l 1space-m 1space-s 1space-xs 0terminal-bg-black 0terminal-bg-blue 0terminal-bg-bright-black 0terminal-bg-bright-blue 0terminal-bg-bright-cyan 0terminal-bg-bright-green 0terminal-bg-bright-magenta 0terminal-bg-bright-red 0terminal-bg-bright-white 0terminal-bg-bright-yellow 0terminal-bg-cyan 0terminal-bg-green 0terminal-bg-magenta 0terminal-bg-red 0terminal-bg-white 0terminal-bg-yellow 0terminal-color-black 0terminal-color-blue 0terminal-color-bright-black 0terminal-color-bright-blue 0terminal-color-bright-cyan 0terminal-color-bright-green 0terminal-color-bright-magenta 0terminal-color-bright-red 0terminal-color-bright-white 0terminal-color-bright-yellow 0terminal-color-cyan 0terminal-color-green 0terminal-color-magenta 0terminal-color-red 0terminal-color-white 0terminal-color-yellow","surfaces":{"lyra":{"light":["#ffffff","#f6f8fa","#1a1a1a","rgb(0 0 0 / 0.92)"],"dark":["#1a1a1a","#22272e","#f2f2f2","rgb(0 0 0 / 0.95)"]},"data":{"light":["#ffffff","#f2f5f8","#10202c","#17212b"],"dark":["#101820","#192630","#eef5fa","#e7eef4"]},"high-contrast":{"light":["#ffffff","#ffffff","#000000","#17212b"],"dark":["#000000","#000000","#ffffff","#e7eef4"]},"material":{"light":["#fff8f5","#f8eeea","#241b17","rgb(0 0 0 / 0.92)"],"dark":["#18120f","#251d19","#f8eee8","rgb(0 0 0 / 0.95)"]},"shadcn":{"light":["#ffffff","#fafafa","#0a0a0a","rgb(0 0 0 / 0.92)"],"dark":["#0a0a0a","#171717","#fafafa","rgb(0 0 0 / 0.95)"]},"terminal":{"light":["#fcfdf9","#f1f5eb","#0d2115","#17212b"],"dark":["#0e1713","#18271e","#e5f5e9","#e7eef4"]}},"contrast":{"light":["#ffffff","#f6f8fa","#f2f5f8","#fff8f5","#f8eeea","#fcf2ed","#f2e7e0","#ecdfd7","#fafafa","#fcfdf9","#f1f5eb"],"dark":["#1a1a1a","#22272e","#2b3038","#101820","#192630","#202e39","#000000","#18120f","#251d19","#302621","#120d0a","#211914","#352a24","#0a0a0a","#171717","#0e1713","#18271e","#203227"]},"accent":{"emerald":"#34d399","peridot":"#a8d84a","topaz":"#f0a83c","ruby":"#e63950","tourmaline":"#ec4899","amethyst":"#9d6df0","aquamarine":"#22d3ee","sapphire":"#4f8ff7","hematite":"#94a3b8"}});
@@ -1 +1 @@
1
- import{devWarnOnce,litDevWarnings}from"../internal/dev-warning.js";import{readStyleOwnership}from"./style-ownership.js";import{resolveStyleStartup}from"./startup-resolution.js";const STORAGE_KEY="lyra-theme",TOKEN_NAME_PATTERN=/^--lr-theme-[a-z0-9]+(?:-[a-z0-9]+)*$/,TOKEN_NAME_MAX_LENGTH=80,TOKEN_RESERVED_NAME="--lr-theme-accent",TOKEN_ENTRY_MAX=512,TOKEN_SYNTHESIZED_MAX=16,TOKEN_VALUE_MAX_LENGTH=256,TOKEN_FORBIDDEN_PATTERN=/[\x00-\x1f\x7f\\;{}!<>@[\]`$^|~=?&:\u2028\u2029]|\/\*|\*\//,TOKEN_CSS_WIDE_PATTERN=/^(?:inherit|initial|revert(?:-layer)?|unset)$/i,TOKEN_FUNCTION_PATTERN=/([a-z0-9_-]+)\s*\(/gi,TOKEN_ALLOWED_FUNCTIONS="rgb rgba hsl hsla hwb lab lch oklab oklch color color-mix light-dark calc min max clamp var cubic-bezier steps linear".split(" "),TOKEN_OWNERSHIP_MAX=TOKEN_ENTRY_MAX+TOKEN_SYNTHESIZED_MAX,TOKEN_OWNERSHIP_SYMBOL="@aceshooting/lyra-ui.theme-tokens.v1",MODE_SURFACES={light:[255,255,255],dark:[10,10,10]},COLOR_SCHEME_QUERY="(prefers-color-scheme: dark)",SEMANTIC_ROLES=["brand","success","warning","danger","neutral"],RAMP_CHANNELS=["fill","border","on"],RAMP_TIERS=["quiet","normal","loud"];function roleRampProperties(role){const properties=[];for(const channel of RAMP_CHANNELS)for(const tier of RAMP_TIERS)properties.push(`--lr-theme-color-${role}-${channel}-${tier}`);return properties}const ALL_RAMP_PROPERTIES=[...SEMANTIC_ROLES.flatMap(roleRampProperties),"--lr-theme-color-focus"],MODE_ATTRIBUTES=["data-lr-theme","data-theme"];function isBalancedCssValue(value){let depth=0,quote="";for(const character of value){if(quote){character===quote&&(quote="");continue}if(character==="'"||character==='"')quote=character;else if(character==="(")depth+=1;else if(character===")"&&(depth-=1)<0)return!1}return quote===""&&depth===0}function isLyraThemeTokenName(name){return typeof name=="string"&&name.length<=TOKEN_NAME_MAX_LENGTH&&TOKEN_NAME_PATTERN.test(name)&&name!==TOKEN_RESERVED_NAME}function isSafeLyraThemeTokenValue(value){if(typeof value!="string")return!1;const trimmed=value.trim();if(!trimmed||trimmed.length>TOKEN_VALUE_MAX_LENGTH||TOKEN_FORBIDDEN_PATTERN.test(trimmed)||TOKEN_CSS_WIDE_PATTERN.test(trimmed))return!1;for(const match of trimmed.matchAll(TOKEN_FUNCTION_PATTERN))if(!TOKEN_ALLOWED_FUNCTIONS.includes((match[1]??"").toLowerCase()))return!1;return isBalancedCssValue(trimmed)}function isPlainRecord(value){if(typeof value!="object"||value===null||Array.isArray(value))return!1;const prototype=Object.getPrototypeOf(value);if(prototype===Object.prototype||prototype===null)return!0;if(Object.getPrototypeOf(prototype)!==null)return!1;const constructor=Object.getOwnPropertyDescriptor(prototype,"constructor")?.value;return typeof constructor=="function"&&Function.prototype.toString.call(constructor)===Function.prototype.toString.call(Object)}function normalizeTokenBranch(value){return isSafeLyraThemeTokenValue(value)?value.trim():null}function normalizeTokens(raw){try{if(!isPlainRecord(raw))return null;const names=Object.keys(raw);if(names.length===0||names.length>TOKEN_ENTRY_MAX)return null;const result={};let kept=0;for(const name of names){if(!isLyraThemeTokenName(name))continue;const value=ownField(raw,name);if(typeof value=="string"){const normalized=normalizeTokenBranch(value);if(normalized===null)continue;result[name]=normalized,kept+=1;continue}if(!isPlainRecord(value))continue;const keys=Object.keys(value),hasLight=Object.prototype.hasOwnProperty.call(value,"light"),hasDark=Object.prototype.hasOwnProperty.call(value,"dark");if(!hasLight&&!hasDark||keys.some(key=>key!=="light"&&key!=="dark"))continue;const light=normalizeTokenBranch(ownField(value,"light")),dark=normalizeTokenBranch(ownField(value,"dark"));light===null&&dark===null||(result[name]=Object.freeze({light,dark}),kept+=1)}return kept>0?Object.freeze(result):null}catch{return null}}function tokensEqual(left,right){const leftNames=left?Object.keys(left):[],rightNames=right?Object.keys(right):[];if(leftNames.length!==rightNames.length)return!1;if(leftNames.length===0)return!0;const leftMap=left,rightMap=right;return leftNames.every(name=>{if(!Object.prototype.hasOwnProperty.call(rightMap,name))return!1;const a=leftMap[name],b=rightMap[name];return typeof a=="string"||typeof b=="string"?a===b:!a||!b?!1:(a.light??null)===(b.light??null)&&(a.dark??null)===(b.dark??null)})}function normalizeColor(value,owner=document){if(typeof value!="string"||!value.trim())return null;const candidate=value.trim();if(!isBalancedCssValue(candidate)||TOKEN_CSS_WIDE_PATTERN.test(candidate)||/^(?:accentcolor|accentcolortext|activetext|buttonborder|buttonface|buttontext|canvas|canvastext|field|fieldtext|graytext|highlight|highlighttext|linktext|mark|marktext|selecteditem|selecteditemtext|visitedtext)$/i.test(candidate)||/\bcurrentcolor\b/i.test(candidate)||/\bvar\s*\(/i.test(candidate)||/\blight-dark\s*\(/i.test(candidate)||/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\s*\(\s*from\b/i.test(candidate))return null;const probe=owner.createElement("span");return probe.style.color=candidate,probe.style.color?candidate:null}function normalizeAccentValue(value){if(typeof value=="string"||value===null)return normalizeColor(value);if(typeof value!="object"||Array.isArray(value))return null;const record=value;if(!("light"in record)&&!("dark"in record))return null;const light=normalizeColor(record.light),dark=normalizeColor(record.dark);return light||dark?{light,dark}:null}function normalizeAccent(value){if(typeof value=="string")return normalizeColor(value);if(value===null||typeof value!="object"||Array.isArray(value))return null;const record=value,result={};let hasRole=!1;for(const role of SEMANTIC_ROLES)role in record&&(hasRole=!0,result[role]=normalizeAccentValue(record[role]));return hasRole?result:null}function resolveAccentValueForMode(value,mode){return typeof value=="string"?value:value?value[mode]??null:null}function accentValueEqual(left,right){return left===right?!0:typeof left=="string"||typeof right=="string"||left===null||right===null?!1:(left.light??null)===(right.light??null)&&(left.dark??null)===(right.dark??null)}function accentsEqual(left,right){if(left===right)return!0;if(typeof left=="string"||typeof right=="string"||left===null||right===null)return!1;const leftKeys=Object.keys(left),rightKeys=Object.keys(right);return leftKeys.length!==rightKeys.length?!1:leftKeys.every(role=>accentValueEqual(left[role],right[role]))}function parseResolvedRgb(value,background,owner=document){if(!normalizeColor(value,owner))return null;try{const canvas=owner.createElement("canvas");canvas.width=1,canvas.height=1;const context=canvas.getContext("2d",{willReadFrequently:!0});if(!context)return null;context.clearRect(0,0,1,1),context.fillStyle=value,context.fillRect(0,0,1,1);const channels=context.getImageData(0,0,1,1).data,red=channels[0]??0,green=channels[1]??0,blue=channels[2]??0,alpha=(channels[3]??0)/255;return[Math.round(red*alpha+background[0]*(1-alpha)),Math.round(green*alpha+background[1]*(1-alpha)),Math.round(blue*alpha+background[2]*(1-alpha))]}catch{return null}}function hexRgb(color){return[parseInt(color.slice(1,3),16),parseInt(color.slice(3,5),16),parseInt(color.slice(5,7),16)]}function mixRgb(base,color,colorWeight){return[Math.round(base[0]*(1-colorWeight)+color[0]*colorWeight),Math.round(base[1]*(1-colorWeight)+color[1]*colorWeight),Math.round(base[2]*(1-colorWeight)+color[2]*colorWeight)]}function serializeRgb(color){return`rgb(${color.join(" ")})`}function relativeLuminance(color){const linearize=channel=>{const normalized=channel/255;return normalized<=.04045?normalized/12.92:((normalized+.055)/1.055)**2.4};return linearize(color[0])*.2126+linearize(color[1])*.7152+linearize(color[2])*.0722}function contrastRatio(left,right){const a=relativeLuminance(left),b=relativeLuminance(right);return(Math.max(a,b)+.05)/(Math.min(a,b)+.05)}function contrastForeground(fill){const black=[0,0,0],white=[255,255,255];return contrastRatio(fill,black)>=contrastRatio(fill,white)?black:white}function ensureSurfaceContrast(color,background,minimum=3,alsoAgainst=background,references=[]){const passes=candidate=>contrastRatio(candidate,background)>=minimum&&contrastRatio(candidate,alsoAgainst)>=minimum&&references.every(reference=>contrastRatio(candidate,reference)>=minimum);if(passes(color))return color;const black=[0,0,0],white=[255,255,255],target=contrastRatio(background,black)>=contrastRatio(background,white)?black:white;for(let step=1;step<=10;step+=1){const candidate=mixRgb(color,target,step/10);if(passes(candidate))return candidate}return target}function createRoleRamp(role,base,mode,background,owner=document){const references=STYLE_CONTRAST_SURFACES[mode].map(hexRgb),resolved=parseResolvedRgb(base,background,owner);if(!resolved)return null;const quiet=mixRgb(background,resolved,mode==="dark"?.24:.14),normal=mixRgb(background,resolved,mode==="dark"?.62:.55),loud=ensureSurfaceContrast(resolved,background,4.5,quiet,references),borderTarget=mode==="dark"?[255,255,255]:[0,0,0],borderQuiet=mixRgb(background,resolved,mode==="dark"?.46:.38),borderNormal=ensureSurfaceContrast(mixRgb(background,resolved,mode==="dark"?.78:.72),background,3,background,references),borderLoud=ensureSurfaceContrast(mixRgb(loud,borderTarget,.2),background,3,background,references),prefix=`--lr-theme-color-${role}`,ramp={[`${prefix}-fill-quiet`]:serializeRgb(quiet),[`${prefix}-fill-normal`]:serializeRgb(normal),[`${prefix}-fill-loud`]:serializeRgb(loud),[`${prefix}-border-quiet`]:serializeRgb(borderQuiet),[`${prefix}-border-normal`]:serializeRgb(borderNormal),[`${prefix}-border-loud`]:serializeRgb(borderLoud),[`${prefix}-on-quiet`]:serializeRgb(contrastForeground(quiet)),[`${prefix}-on-normal`]:serializeRgb(contrastForeground(normal)),[`${prefix}-on-loud`]:serializeRgb(contrastForeground(loud))};return role==="brand"&&(ramp["--lr-theme-color-focus"]=serializeRgb(ensureSurfaceContrast(resolved,background,3,background,references))),ramp}function paintAccent(accent,mode,background,owner=document){const properties=new Map;if(!accent)return{applied:null,properties};if(!mode)return{applied:accent,properties};if(typeof accent=="string"){const ramp=createRoleRamp("brand",accent,mode,background,owner);if(!ramp)return{applied:null,properties};properties.set("--lr-theme-accent",accent);for(const[property,value]of Object.entries(ramp))properties.set(property,value);return{applied:accent,properties}}const applied={};let appliedBrandColor=null;for(const role of SEMANTIC_ROLES){const value=accent[role];if(!value)continue;const isPerMode=typeof value!="string",base=resolveAccentValueForMode(value,mode);let painted=!1;if(base){const ramp=createRoleRamp(role,base,mode,background,owner);if(ramp){for(const[property,propertyValue]of Object.entries(ramp))properties.set(property,propertyValue);painted=!0,role==="brand"&&(appliedBrandColor=base)}}(painted||isPerMode)&&(applied[role]=value)}return appliedBrandColor&&properties.set("--lr-theme-accent",appliedBrandColor),{applied:Object.keys(applied).length>0?applied:null,properties}}function tokenEntries(tokens,mode){const entries=new Map;if(!tokens)return entries;for(const[name,value]of Object.entries(tokens))if(typeof value=="string")entries.set(name,value);else if(mode){const branch=value[mode];branch&&entries.set(name,branch)}return entries}function resolveTokenColor(value,background,owner){return value===void 0||!background||!normalizeColor(value,owner)?null:parseResolvedRgb(value,background,owner)}function floorTokenEntries(entries,surface,owner,references){if(!entries.size)return new Map;const resolveColor=(value,background)=>resolveTokenColor(value,background,owner),painted=new Map(entries),prefix="--lr-theme-",raised=resolveColor(entries.get(`${prefix}color-surface-raised`)??references[1],surface),floor=(name,over,against,minimum,alsoAgainst)=>{const value=painted.get(name);if(value===void 0||!against||alsoAgainst===null)return;const color=resolveColor(value,over);if(!color)return;const repaired=ensureSurfaceContrast(color,against,minimum,alsoAgainst??against);repaired!==color&&painted.set(name,serializeRgb(repaired))};floor(`${prefix}color-text-normal`,surface,surface,4.5,raised),floor(`${prefix}color-text-quiet`,surface,surface,4.5,raised);const text=entries.has(`${prefix}color-text-normal`)?resolveColor(painted.get(`${prefix}color-text-normal`),surface):resolveColor(references[2],surface),pairForeground=(onName,fill)=>{if(!fill)return;const on=painted.get(onName);if(on===void 0){painted.set(onName,serializeRgb(contrastForeground(fill)));return}const color=resolveColor(on,fill);color&&contrastRatio(color,fill)<4.5&&painted.set(onName,serializeRgb(contrastForeground(fill)))};for(const role of SEMANTIC_ROLES)for(const tier of RAMP_TIERS){const fillName=`${prefix}color-${role}-fill-${tier}`;entries.has(fillName)&&pairForeground(`${prefix}color-${role}-on-${tier}`,resolveColor(entries.get(fillName),surface))}const overlayName=`${prefix}color-overlay-strong`,overlay=entries.has(overlayName)?resolveColor(entries.get(overlayName),surface):resolveColor(references[3],surface);(entries.has(overlayName)||entries.has(`${prefix}color-on-strong-overlay`))&&pairForeground(`${prefix}color-on-strong-overlay`,overlay);for(const name of entries.keys())/^--lr-theme-color-(?:(?:brand|success|warning|danger|neutral)-border-(?:normal|loud)|surface-border|border-strong|focus|chart-\d+)$/.test(name)?floor(name,surface,surface,3):/^--lr-theme-terminal-color-[a-z0-9-]+$/.test(name)?floor(name,raised,raised,4.5):/^--lr-theme-terminal-bg-[a-z0-9-]+$/.test(name)&&floor(name,raised,text,4.5);return painted}function readOwnershipList(){try{const list=document.documentElement[Symbol.for(TOKEN_OWNERSHIP_SYMBOL)];if(!Array.isArray(list))return[];const names=[],length=Math.min(list.length,TOKEN_OWNERSHIP_MAX);for(let index=0;index<length;index+=1){const name=list[index];isLyraThemeTokenName(name)&&names.push(name)}return names}catch{return[]}}function applyStoredThemeBeforePaint(){const R=["brand","success","warning","danger","neutral"],Q=["quiet","normal","loud"],W=/^--lr-theme-[a-z0-9]+(?:-[a-z0-9]+)*$/,_="--lr-theme-accent",G=/[\x00-\x1f\x7f\\;{}!<>@[\]`$^|~=?&:\u2028\u2029]|\/\*|\*\//,H=/^(?:inherit|initial|revert(?:-layer)?|unset)$/i,J=/([a-z0-9_-]+)\s*\(/gi,K="rgb rgba hsl hsla hwb lab lch oklab oklch color color-mix light-dark calc min max clamp var cubic-bezier steps linear".split(" "),U={light:[255,255,255],dark:[10,10,10]},X=r=>{let o=0,h="";for(const a of r){if(h){a===h&&(h="");continue}if(a==="'"||a==='"')h=a;else if(a==="(")o+=1;else if(a===")"&&(o-=1)<0)return!1}return h===""&&o===0},Y=r=>typeof r=="string"&&r.length<=80&&W.test(r)&&r!==_,P=r=>{if(typeof r!="string")return null;const o=r.trim();if(!o||o.length>256||G.test(o)||H.test(o))return null;for(const h of o.matchAll(J))if(!K.includes((h[1]??"").toLowerCase()))return null;return X(o)?o:null},A=r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!1;const o=Object.getPrototypeOf(r);return o===Object.prototype||o===null},Z=r=>{const o={};try{if(!A(r))return o;const h=Object.keys(r);if(h.length<=512)for(const a of h){if(!Y(a))continue;const g=r[a];if(typeof g=="string"){const u=P(g);u!==null&&(o[a]=u);continue}if(!A(g))continue;const j=Object.hasOwn(g,"light"),i=Object.hasOwn(g,"dark");if(!j&&!i||Object.keys(g).some(u=>u!=="light"&&u!=="dark"))continue;const M=P(g.light),y=P(g.dark);(M!==null||y!==null)&&(o[a]={light:M,dark:y})}}catch{}return o},C=r=>{const o=P(r);if(!(!o||/\b(?:var|light-dark)\s*\(|\b(?:currentcolor|from)\b/i.test(o)||/^(?:accentcolor|accentcolortext|activetext|buttonborder|buttonface|buttontext|canvas|canvastext|field|fieldtext|graytext|highlight|highlighttext|linktext|mark|marktext|selecteditem|selecteditemtext|visitedtext)$/i.test(o)))return CSS.supports("color",o)?o:void 0};return[Z,C,(r,o,h,a,g,j)=>{const i=new Map;for(const[t,n]of Object.entries(r)){const e=typeof n=="string"?n:n[o];e&&i.set(t,e)}const M=typeof a=="string"?{brand:a}:a,y={};for(const t of R){const n=M?.[t],e=typeof n=="string"?n:n?.[o];e&&(y[t]=e)}let u=null;if(i.size>0||Object.keys(y).length>0)try{const t=document.createElement("canvas");t.width=1,t.height=1,u=t.getContext("2d",{willReadFrequently:!0})}catch{u=null}const S=(t,n)=>{if(!u)return null;try{u.clearRect(0,0,1,1),u.fillStyle=t,u.fillRect(0,0,1,1);const e=u.getImageData(0,0,1,1).data,c=(e[3]??0)/255;return[0,1,2].map(f=>Math.round((e[f]??0)*c+(n[f]??0)*(1-c)))}catch{return null}},z=(t,n,e)=>t.map((c,f)=>Math.round(c*(1-e)+(n[f]??0)*e)),B=t=>{const n=t.map(e=>{const c=e/255;return c<=.04045?c/12.92:((c+.055)/1.055)**2.4});return(n[0]??0)*.2126+(n[1]??0)*.7152+(n[2]??0)*.0722},O=(t,n)=>{const e=B(t),c=B(n);return(Math.max(e,c)+.05)/(Math.min(e,c)+.05)},v=[0,0,0],F=[255,255,255],w=t=>O(t,v)>=O(t,F)?v:F,q=(t,n,e=3,c=n)=>{const f=d=>O(d,n)>=e&&O(d,c)>=e&&g.every(k=>O(d,k)>=e);if(f(t))return t;const p=w(n);for(let d=1;d<=10;d+=1){const k=z(t,p,d/10);if(f(k))return k}return p},m=t=>`rgb(${t.join(" ")})`,D=U[o],E=C(h)??C(i.get("--lr-theme-color-surface-default")),s=E&&S(E,D)||D,l=new Map(i),b="--lr-theme-",$=(t,n)=>t!==void 0&&n&&C(t)?S(t,n):null,tt=`${b}color-surface-raised`,N=$(i.get(tt)??j[1],s),L=(t,n,e,c,f)=>{const p=l.get(t);if(p===void 0||!e||f===null)return;const d=$(p,n);if(!d)return;const k=q(d,e,c,f??e);k!==d&&l.set(t,m(k))};L(`${b}color-text-normal`,s,s,4.5,N),L(`${b}color-text-quiet`,s,s,4.5,N);const et=i.has(`${b}color-text-normal`)?$(l.get(`${b}color-text-normal`),s):$(j[2],s),I=(t,n)=>{if(!n)return;const e=l.get(t),c=e===void 0?null:$(e,n);(e===void 0||c&&O(c,n)<4.5)&&l.set(t,m(w(n)))};for(const t of R)for(const n of Q){const e=`${b}color-${t}-fill-${n}`;i.has(e)&&I(`${b}color-${t}-on-${n}`,$(i.get(e),s))}const T=`${b}color-overlay-strong`;(i.has(T)||i.has(`${b}color-on-strong-overlay`))&&I(`${b}color-on-strong-overlay`,i.has(T)?$(i.get(T),s):$(j[3],s));for(const t of i.keys())/^--lr-theme-color-(?:(?:brand|success|warning|danger|neutral)-border-(?:normal|loud)|surface-border|border-strong|focus|chart-\d+)$/.test(t)?L(t,s,s,3):/^--lr-theme-terminal-color-[a-z0-9-]+$/.test(t)?L(t,N,N,4.5):/^--lr-theme-terminal-bg-[a-z0-9-]+$/.test(t)&&L(t,N,et,4.5);if(!u)return l;let V=null;for(const t of R){const n=y[t];if(!n)continue;const e=S(n,s);if(!e)continue;const c=z(s,e,o==="dark"?.24:.14),f=z(s,e,o==="dark"?.62:.55),p=q(e,s,4.5,c),d=o==="dark"?F:v,k=z(s,e,o==="dark"?.46:.38),nt=q(z(s,e,o==="dark"?.78:.72),s),ot=q(z(p,d,.2),s),x=`--lr-theme-color-${t}`;l.set(`${x}-fill-quiet`,m(c)),l.set(`${x}-fill-normal`,m(f)),l.set(`${x}-fill-loud`,m(p)),l.set(`${x}-border-quiet`,m(k)),l.set(`${x}-border-normal`,m(nt)),l.set(`${x}-border-loud`,m(ot)),l.set(`${x}-on-quiet`,m(w(c))),l.set(`${x}-on-normal`,m(w(f))),l.set(`${x}-on-loud`,m(w(p))),t==="brand"&&(l.set("--lr-theme-color-focus",m(q(e,s))),V=n)}return V&&l.set("--lr-theme-accent",V),l}]}function styleMaterial(l,n){const t=n==="glass";for(const[a,i]of Object.entries({enabled:t?"1":"0",content:t?"''":"none",isolation:t?"isolate":"auto","root-filter":t?"initial":"none","child-filter":t?"none":"initial","child-opacity":t?"1":"0"}))l.set(`--_lr-surface-${a}`,i);l.set("--_lr-glass-blocker",t?"initial":"none"),t||(l.set("--_lr-glass-parent-opacity","0"),l.set("--_lr-next-glass-opacity","0"))}function applyStoredStyleBeforePaint(U,q,D,N,G,J,W,S){const{surfaces:R,contrast:H,accent:Q}=S,b=new Map;for(const r of S.inputs.split(" "))b.set(`--lr-theme-${r.slice(1)}`,Number(r[0]));const _=[...b.keys()];function v(r,n,s=!1){return`--_lr-${s?"a":"l"}${n==="light"?"l":"d"}-${r.slice(11)}`}function V(r,n){const s=b.get(r)??0;let g=`var(${v(r,n)})`;if(s&2){const k=n==="light"?"l":"d",u=r.replace(/color-(?:success|warning|danger|neutral)-/,"color-brand-");g=`var(--_lr-f${k}-${r.slice(11)},${g})var(--_lr-o${k}-${r.slice(11)},var(${v(u,n,!0)},var(${v(u,n)})))`}return s&4?`var(${v(r,n,!0)},${g})`:g}function X(r){const n=`var(--_lr-dark-on,${V(r,"light")})var(--_lr-light-on,${V(r,"dark")})`;if(!((b.get(r)??0)&1))return n;const s=r.startsWith("--lr-theme-space-");return`var(--_lr-dense-on,${n})var(--_lr-dense-off,max(calc((${n}) * var(--_lr-density-${s?"space":"control"},1)),${s?"0px":"var(--_lr-density-target-min,0px)"}))`}try{const r=document.currentScript,n=r?.getAttribute("data-lr-theme-restore"),s=(n==="all"||n==="mode"?n:S.restore)==="mode",g=r?.getAttribute("data-lr-theme-storage-key"),k=g&&g.length<=200?g:U,u=r?.getAttribute("data-lr-theme-attributes")?.trim().split(/\s+/),A=u?.length&&u.length<=8&&new Set(u).size===u.length&&u.every(t=>t.length<=64&&/^data-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(t))?u:q;let w;try{w=JSON.parse(localStorage.getItem(k)??"null")}catch{}if(s){const t=w;w={version:t?.version,mode:t?.mode}}const o=document.documentElement,[Z,tt,et]=D(),f=J(w,S.defaults,Z,tt,(t,e)=>N(t,e,_),Q),y=f.mode,$=y==="unset"?null:y==="system"?matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":y,p={},j=!s&&getComputedStyle(o).getPropertyValue("--_lr-style-resolver").trim()==="1",C=(t,e)=>typeof t=="string"?t:t?.[e],rt=f.tokens,ot=f.overrides,E={...rt,...ot},L=f.look;if(s||(p["data-lr-look"]=L,p["data-lr-density"]=f.density,p["data-lr-surface"]=f.treatment),y!=="unset"&&(p["data-lr-mode"]=y),$)for(const t of A)p[t]=$;const O=f.accentName;let h=f.accent;y!=="unset"&&h&&typeof h=="object"&&!Object.values(h).some(t=>typeof t=="string"||t&&Object.values(t).some(Boolean))&&(h=null),s||(p["data-lr-accent"]=O??(h?"custom":"none"));const a=new Map;if(y==="unset")for(const[t,e]of Object.entries(E))typeof e=="string"&&a.set(t,e);for(const t of s?[]:["light","dark"]){const e=C(f.surface,t),T=C(E["--lr-theme-color-surface-default"],t),c=(R[L]??R.lyra)[t],z=e??T??c[0];for(const m of[!1,!0]){if(m&&(!h||O))continue;const st=et(m?{}:E,t,z,m?h:null,m?H[t].map(l=>[1,3,5].map(d=>parseInt(l.slice(d,d+2),16))):[],c);for(const[l,d]of st){if(l==="--lr-theme-accent"){t===$&&a.set(l,d);continue}const B=b.get(l);if(B!==void 0&&N(l,d,_)){const F=l.match(/^--lr-theme-color-(?:success|warning|danger|neutral)-((?:fill|border|on)-(?:quiet|normal|loud))$/)?.[1],M=!m&&F&&d===`var(--lr-theme-color-brand-${F})`,I=l.slice(11),K=t==="light"?"l":"d";M||a.set(v(l,t,m),d),!m&&B&2&&(a.set(`--_lr-f${K}-${I}`,M?" ":"initial"),a.set(`--_lr-o${K}-${I}`,M?"initial":" ")),t===$&&a.set(l,j?X(l):d)}else t===$&&a.set(l,d)}}}(a.size||y==="unset"&&h&&!O)&&(p["data-lr-theme-scope"]=""),!s&&!j&&W(a,f.treatment);const Y=Symbol.for("@aceshooting/lyra-ui.style-ownership.v1"),P=o;let x;try{x=G(P[Y])}catch{}const i=x??{attributes:new Map,properties:new Map};if(y==="unset")for(const t of A)i.attributes.has(t)||o.removeAttribute(t);try{const t=Symbol.for("@aceshooting/lyra-ui.theme-tokens.v1"),e=P[t];if(!s&&Array.isArray(e)){const T=e.slice(0,528).filter(c=>typeof c=="string"&&c.length<=80&&/^--lr-theme-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(c));for(const c of[...T,..._.filter(z=>b.get(z)&4),"--lr-theme-accent"])!i.properties.has(c)&&o.style.getPropertyValue(c)&&i.properties.set(c,{before:null,priority:"",written:o.style.getPropertyValue(c)});try{delete P[t]}catch{}}}catch{}for(const[t,e]of i.attributes)s&&t!=="data-lr-mode"&&!A.includes(t)||Object.hasOwn(p,t)||(o.getAttribute(t)===e.written&&(e.before===null?o.removeAttribute(t):o.setAttribute(t,e.before)),i.attributes.delete(t));for(const[t,e]of Object.entries(p))i.attributes.has(t)||i.attributes.set(t,{before:o.getAttribute(t),priority:"",written:e}),o.setAttribute(t,e),i.attributes.get(t).written=e;for(const[t,e]of i.properties)s||a.has(t)||(o.style.getPropertyValue(t)===e.written&&!o.style.getPropertyPriority(t)&&(e.before?o.style.setProperty(t,e.before,e.priority):o.style.removeProperty(t)),i.properties.delete(t));for(const[t,e]of a)i.properties.has(t)||i.properties.set(t,{before:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t),written:null}),o.style.getPropertyPriority(t)&&o.style.removeProperty(t),o.style.setProperty(t,e,""),i.properties.get(t).written=o.style.getPropertyValue(t);try{P[Y]=i}catch{}}catch{}}const LINE_SEPARATOR="\u2028",PARAGRAPH_SEPARATOR="\u2029";function serializeInlineScriptData(value){return JSON.stringify(value).replace(/</g,"\\u003c").replace(new RegExp(LINE_SEPARATOR,"g"),"\\u2028").replace(new RegExp(PARAGRAPH_SEPARATOR,"g"),"\\u2029")}const BOOTSTRAP_FUNCTIONS=[applyStoredStyleBeforePaint,applyStoredThemeBeforePaint,styleTokenAllowed,readStyleOwnership,resolveStyleStartup,styleMaterial];function bootstrapParts(options){const storageKey=options.storageKey??STORAGE_KEY,inputs=STYLE_SLOTTED.map(name=>`${Number(STYLE_DENSITY.includes(name))|Number(STYLE_FOLLOW.includes(name))<<1|Number(ALL_RAMP_PROPERTIES.includes(name))<<2}${name.slice(11)}`).join(" "),model=JSON.stringify({restore:options.restore==="mode"?"mode":"all",defaults:STYLE_DEFAULTS,inputs,surfaces:STYLE_REFERENCE_SURFACES,contrast:STYLE_CONTRAST_SURFACES,accent:STYLE_GEMSTONES});return{storageKey,model}}function createLyraThemeBootstrap(options={}){const{storageKey,model}=bootstrapParts(options),functions=BOOTSTRAP_FUNCTIONS.map(helper=>helper.toString().replace(/^function\s+[\w$]+/,"function"));return`(${functions[0]})(${serializeInlineScriptData(storageKey)},${serializeInlineScriptData(MODE_ATTRIBUTES)},${functions.slice(1).join(",")},${model});`}const STYLE_DEFAULTS=Object.freeze({look:"shadcn",surface:"glass",density:"comfortable",mode:"system",accent:"emerald"}),STYLE_SLOTTED=["--lr-theme-color-border-strong","--lr-theme-color-brand-border-loud","--lr-theme-color-brand-border-normal","--lr-theme-color-brand-border-quiet","--lr-theme-color-brand-fill-loud","--lr-theme-color-brand-fill-normal","--lr-theme-color-brand-fill-quiet","--lr-theme-color-brand-on-loud","--lr-theme-color-brand-on-normal","--lr-theme-color-brand-on-quiet","--lr-theme-color-chart-1","--lr-theme-color-chart-2","--lr-theme-color-chart-3","--lr-theme-color-chart-4","--lr-theme-color-chart-5","--lr-theme-color-chart-6","--lr-theme-color-chart-7","--lr-theme-color-chart-8","--lr-theme-color-chart-diverging-1","--lr-theme-color-chart-diverging-2","--lr-theme-color-chart-diverging-3","--lr-theme-color-chart-sequential-1","--lr-theme-color-chart-sequential-2","--lr-theme-color-chart-sequential-3","--lr-theme-color-danger-border-loud","--lr-theme-color-danger-border-normal","--lr-theme-color-danger-border-quiet","--lr-theme-color-danger-fill-loud","--lr-theme-color-danger-fill-normal","--lr-theme-color-danger-fill-quiet","--lr-theme-color-danger-on-loud","--lr-theme-color-danger-on-normal","--lr-theme-color-danger-on-quiet","--lr-theme-color-focus","--lr-theme-color-mix-partner","--lr-theme-color-neutral-border-loud","--lr-theme-color-neutral-border-normal","--lr-theme-color-neutral-border-quiet","--lr-theme-color-neutral-fill-loud","--lr-theme-color-neutral-fill-normal","--lr-theme-color-neutral-fill-quiet","--lr-theme-color-neutral-on-loud","--lr-theme-color-neutral-on-normal","--lr-theme-color-neutral-on-quiet","--lr-theme-color-no-data","--lr-theme-color-on-strong-overlay","--lr-theme-color-overlay","--lr-theme-color-overlay-strong","--lr-theme-color-success-border-loud","--lr-theme-color-success-border-normal","--lr-theme-color-success-border-quiet","--lr-theme-color-success-fill-loud","--lr-theme-color-success-fill-normal","--lr-theme-color-success-fill-quiet","--lr-theme-color-success-on-loud","--lr-theme-color-success-on-normal","--lr-theme-color-success-on-quiet","--lr-theme-color-surface-border","--lr-theme-color-surface-border-subtle","--lr-theme-color-surface-container","--lr-theme-color-surface-container-high","--lr-theme-color-surface-container-highest","--lr-theme-color-surface-container-low","--lr-theme-color-surface-container-lowest","--lr-theme-color-surface-default","--lr-theme-color-surface-overlay","--lr-theme-color-surface-raised","--lr-theme-color-text-normal","--lr-theme-color-text-quiet","--lr-theme-color-warning-border-loud","--lr-theme-color-warning-border-normal","--lr-theme-color-warning-border-quiet","--lr-theme-color-warning-fill-loud","--lr-theme-color-warning-fill-normal","--lr-theme-color-warning-fill-quiet","--lr-theme-color-warning-on-loud","--lr-theme-color-warning-on-normal","--lr-theme-color-warning-on-quiet","--lr-theme-form-control-height-2xs","--lr-theme-form-control-height-l","--lr-theme-form-control-height-m","--lr-theme-form-control-height-s","--lr-theme-form-control-height-xl","--lr-theme-form-control-height-xs","--lr-theme-graph-cat-1","--lr-theme-graph-cat-2","--lr-theme-graph-cat-3","--lr-theme-graph-cat-4","--lr-theme-graph-cat-5","--lr-theme-graph-cat-6","--lr-theme-graph-cat-7","--lr-theme-graph-cat-8","--lr-theme-icon-button-size","--lr-theme-shadow-l","--lr-theme-shadow-m","--lr-theme-shadow-s","--lr-theme-shadow-xl","--lr-theme-shadow-xs","--lr-theme-space-2xl","--lr-theme-space-2xs","--lr-theme-space-l","--lr-theme-space-m","--lr-theme-space-s","--lr-theme-space-xs","--lr-theme-terminal-bg-black","--lr-theme-terminal-bg-blue","--lr-theme-terminal-bg-bright-black","--lr-theme-terminal-bg-bright-blue","--lr-theme-terminal-bg-bright-cyan","--lr-theme-terminal-bg-bright-green","--lr-theme-terminal-bg-bright-magenta","--lr-theme-terminal-bg-bright-red","--lr-theme-terminal-bg-bright-white","--lr-theme-terminal-bg-bright-yellow","--lr-theme-terminal-bg-cyan","--lr-theme-terminal-bg-green","--lr-theme-terminal-bg-magenta","--lr-theme-terminal-bg-red","--lr-theme-terminal-bg-white","--lr-theme-terminal-bg-yellow","--lr-theme-terminal-color-black","--lr-theme-terminal-color-blue","--lr-theme-terminal-color-bright-black","--lr-theme-terminal-color-bright-blue","--lr-theme-terminal-color-bright-cyan","--lr-theme-terminal-color-bright-green","--lr-theme-terminal-color-bright-magenta","--lr-theme-terminal-color-bright-red","--lr-theme-terminal-color-bright-white","--lr-theme-terminal-color-bright-yellow","--lr-theme-terminal-color-cyan","--lr-theme-terminal-color-green","--lr-theme-terminal-color-magenta","--lr-theme-terminal-color-red","--lr-theme-terminal-color-white","--lr-theme-terminal-color-yellow"],STYLE_DENSITY=["--lr-theme-space-2xs","--lr-theme-space-xs","--lr-theme-space-s","--lr-theme-space-m","--lr-theme-space-l","--lr-theme-space-2xl","--lr-theme-form-control-height-2xs","--lr-theme-form-control-height-xs","--lr-theme-form-control-height-s","--lr-theme-form-control-height-m","--lr-theme-form-control-height-l","--lr-theme-form-control-height-xl","--lr-theme-icon-button-size"],STYLE_FOLLOW=["--lr-theme-color-danger-border-loud","--lr-theme-color-danger-border-normal","--lr-theme-color-danger-border-quiet","--lr-theme-color-danger-fill-loud","--lr-theme-color-danger-fill-normal","--lr-theme-color-danger-fill-quiet","--lr-theme-color-danger-on-loud","--lr-theme-color-danger-on-normal","--lr-theme-color-danger-on-quiet","--lr-theme-color-neutral-border-loud","--lr-theme-color-neutral-border-normal","--lr-theme-color-neutral-border-quiet","--lr-theme-color-neutral-fill-loud","--lr-theme-color-neutral-fill-normal","--lr-theme-color-neutral-fill-quiet","--lr-theme-color-neutral-on-loud","--lr-theme-color-neutral-on-normal","--lr-theme-color-neutral-on-quiet","--lr-theme-color-success-border-loud","--lr-theme-color-success-border-normal","--lr-theme-color-success-border-quiet","--lr-theme-color-success-fill-loud","--lr-theme-color-success-fill-normal","--lr-theme-color-success-fill-quiet","--lr-theme-color-success-on-loud","--lr-theme-color-success-on-normal","--lr-theme-color-success-on-quiet","--lr-theme-color-warning-border-loud","--lr-theme-color-warning-border-normal","--lr-theme-color-warning-border-quiet","--lr-theme-color-warning-fill-loud","--lr-theme-color-warning-fill-normal","--lr-theme-color-warning-fill-quiet","--lr-theme-color-warning-on-loud","--lr-theme-color-warning-on-normal","--lr-theme-color-warning-on-quiet"],STYLE_REFERENCE_SURFACES={lyra:{light:["#ffffff","#f6f8fa","#1a1a1a","rgb(0 0 0 / 0.92)"],dark:["#1a1a1a","#22272e","#f2f2f2","rgb(0 0 0 / 0.95)"]},data:{light:["#ffffff","#f2f5f8","#10202c","#17212b"],dark:["#101820","#192630","#eef5fa","#e7eef4"]},"high-contrast":{light:["#ffffff","#ffffff","#000000","#17212b"],dark:["#000000","#000000","#ffffff","#e7eef4"]},material:{light:["#fff8f5","#f8eeea","#241b17","rgb(0 0 0 / 0.92)"],dark:["#18120f","#251d19","#f8eee8","rgb(0 0 0 / 0.95)"]},shadcn:{light:["#ffffff","#fafafa","#0a0a0a","rgb(0 0 0 / 0.92)"],dark:["#0a0a0a","#171717","#fafafa","rgb(0 0 0 / 0.95)"]},terminal:{light:["#fcfdf9","#f1f5eb","#0d2115","#17212b"],dark:["#0e1713","#18271e","#e5f5e9","#e7eef4"]}},STYLE_CONTRAST_SURFACES={light:["#ffffff","#f6f8fa","#f2f5f8","#fff8f5","#f8eeea","#fcf2ed","#f2e7e0","#ecdfd7","#fafafa","#fcfdf9","#f1f5eb"],dark:["#1a1a1a","#22272e","#2b3038","#101820","#192630","#202e39","#000000","#18120f","#251d19","#302621","#120d0a","#211914","#352a24","#0a0a0a","#171717","#0e1713","#18271e","#203227"]},STYLE_GEMSTONES={emerald:"#34d399",peridot:"#a8d84a",topaz:"#f0a83c",ruby:"#e63950",tourmaline:"#ec4899",amethyst:"#9d6df0",aquamarine:"#22d3ee",sapphire:"#4f8ff7",hematite:"#94a3b8"},LOOK_ID=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,LOOK_STAMP=Symbol.for("@aceshooting/lyra-ui.look.v1"),STYLE_OWNERSHIP=Symbol.for("@aceshooting/lyra-ui.style-ownership.v1"),STYLE_FIELDS=["look","surface","density","mode","accent","accentBackground","overrides"],DEFAULT_STYLE=Object.freeze({...STYLE_DEFAULTS,tokens:null,accent:STYLE_GEMSTONES[STYLE_DEFAULTS.accent],accentName:STYLE_DEFAULTS.accent,accentBackground:null,overrides:null});let lastStyle={...DEFAULT_STYLE},stylePersistenceFailed=!1,styleModeCleanup,styleModeRoot;const styleOwnershipFallback=new WeakMap,scopeModes=new WeakMap;function ownField(value,key){const descriptor=Object.getOwnPropertyDescriptor(value,key);return descriptor&&"value"in descriptor?descriptor.value:void 0}function styleId(value){return typeof value=="string"&&value.length<=64&&LOOK_ID.test(value)}function styleTokenAllowed(e,r,o=STYLE_SLOTTED){if(e.startsWith("--lr-theme-surface-")||typeof r!="string"&&!o.includes(e))return!1;for(const t of typeof r=="string"?[r]:[r.light,r.dark])if(t)for(const c of t.matchAll(/var\(\s*(--[\w-]+)/g)){if(c[1]==="--lr-theme-shadow-color")continue;const n=e.match(/^--lr-theme-color-(?:success|warning|danger|neutral)-((?:fill|border|on)-(?:quiet|normal|loud))$/)?.[1];if(!n||t!==`var(--lr-theme-color-brand-${n})`)return!1}return!0}function styleTokens(value){const tokens=normalizeTokens(value);if(!tokens)return null;const entries=Object.entries(tokens).filter(([name,input])=>styleTokenAllowed(name,input));return entries.length?Object.freeze(Object.fromEntries(entries)):null}function defineLyraLook(look){if(!look||!styleId(ownField(look,"id"))||look.id==="custom")throw new TypeError("Invalid look id");const raw=ownField(look,"tokens");if(!isPlainRecord(raw)||Object.keys(raw).length>TOKEN_ENTRY_MAX)throw new TypeError("Invalid look tokens");for(const[name,descriptor]of Object.entries(Object.getOwnPropertyDescriptors(raw))){if(!("value"in descriptor))throw new TypeError(`Look inputs must be data properties: ${name}`);const value=descriptor.value;if(typeof value=="string"){if(!isSafeLyraThemeTokenValue(value))throw new TypeError(`Invalid look value: ${name}`);continue}if(!isPlainRecord(value)||!STYLE_SLOTTED.includes(name))throw new TypeError(`Invalid per-mode look input: ${name}`);const branches=Object.entries(Object.getOwnPropertyDescriptors(value));if(!branches.length||branches.some(([key,branch])=>!["light","dark"].includes(key)||!("value"in branch)||branch.value!==null&&!isSafeLyraThemeTokenValue(branch.value)))throw new TypeError(`Invalid look mode pair: ${name}`)}const tokens=styleTokens(raw);if(Object.keys(raw).length!==Object.keys(tokens??{}).length)throw new TypeError("Invalid look token or cross-axis reference");const stamped={...tokens,[LOOK_STAMP]:look.id};return Object.freeze(stamped),Object.freeze({id:look.id,tokens:stamped})}function styleColor(value,browserColors=!1){if(!isSafeLyraThemeTokenValue(value))return null;const text=value.trim();return/\b(?:var|light-dark)\s*\(|\b(?:currentcolor|from)\b/i.test(text)||/^(?:accentcolor|accentcolortext|activetext|buttonborder|buttonface|buttontext|canvas|canvastext|field|fieldtext|graytext|highlight|highlighttext|linktext|mark|marktext|selecteditem|selecteditemtext|visitedtext)$/i.test(text)?null:browserColors&&typeof CSS<"u"?CSS.supports("color",text)?text:null:/^(?:#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})|[a-z]+|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.+\))$/i.test(text)?text:null}function styleColorPair(value){if(typeof value=="string")return styleColor(value);if(!isPlainRecord(value))return null;const light=styleColor(ownField(value,"light")),dark=styleColor(ownField(value,"dark"));return light||dark?Object.freeze({light,dark}):null}function styleAccent(value){if(typeof value=="string")return styleColor(value);if(!isPlainRecord(value))return null;const entries=SEMANTIC_ROLES.filter(role=>Object.hasOwn(value,role)).map(role=>[role,styleColorPair(ownField(value,role))]);return entries.length?Object.freeze(Object.fromEntries(entries)):null}function normalizeStyleChoices(raw,base){const next={...base};if(!isPlainRecord(raw))return next;const look=ownField(raw,"look");if(look!==void 0){if(next.look=DEFAULT_STYLE.look,next.tokens=null,styleId(look))next.look=look;else if(isPlainRecord(look))try{const definition=defineLyraLook(look);next.look=definition.id,next.tokens=definition.tokens}catch{}}const surface=ownField(raw,"surface");surface!==void 0&&(next.surface=surface==="glass"||surface==="solid"?surface:DEFAULT_STYLE.surface);const density=ownField(raw,"density");density!==void 0&&(next.density=density==="comfortable"||density==="compact"||density==="touch"?density:DEFAULT_STYLE.density);const mode=ownField(raw,"mode");mode!==void 0&&(next.mode=mode==="light"||mode==="dark"||mode==="system"||mode==="unset"?mode:DEFAULT_STYLE.mode);const accent=ownField(raw,"accent");accent!==void 0&&(next.accentName=typeof accent=="string"&&Object.hasOwn(STYLE_GEMSTONES,accent)?accent:null,next.accent=next.accentName?STYLE_GEMSTONES[next.accentName]:styleAccent(accent));const background=ownField(raw,"accentBackground");background!==void 0&&(next.accentBackground=styleColorPair(background));const overrides=ownField(raw,"overrides");return overrides!==void 0&&(next.overrides=styleTokens(overrides)),next}function styleFromRecord(value,browserColors=!1){const record=resolveStyleStartup(value,STYLE_DEFAULTS,normalizeTokens,input=>styleColor(input,browserColors)??void 0,styleTokenAllowed,STYLE_GEMSTONES),state=normalizeStyleChoices({look:ownField(record,"look"),mode:ownField(record,"mode"),density:ownField(record,"density"),surface:ownField(record,"treatment"),overrides:ownField(record,"overrides"),accentBackground:ownField(record,"surface")},{...DEFAULT_STYLE});state.accent=styleAccent(ownField(record,"accent"));const accentName=ownField(record,"accentName");return state.accentName=null,typeof accentName=="string"&&Object.hasOwn(STYLE_GEMSTONES,accentName)&&(state.accentName=accentName,state.accent=STYLE_GEMSTONES[accentName]),state.tokens=normalizeTokens(ownField(record,"tokens")),state.tokens&&!styleId(ownField(record,"look"))&&(state.look="custom"),state}function styleRecord(state){return{version:2,mode:state.mode,look:state.look,density:state.density,treatment:state.surface,accent:state.accent,surface:state.accentBackground,...state.accentName?{accentName:state.accentName}:{},...state.tokens?{tokens:state.tokens}:{},...state.overrides?{overrides:state.overrides}:{}}}function styleResolvedMode(mode,view){return mode==="unset"?null:mode!=="system"?mode:view?.matchMedia?.(COLOR_SCHEME_QUERY).matches?"dark":"light"}function styleSnapshot(state,view){return Object.freeze({look:state.look,lookForm:state.tokens?"runtime":"stylesheet",surface:state.surface,density:state.density,mode:state.mode,accent:state.accentName??state.accent,accentName:state.accentName,accentBackground:state.accentBackground,...state.overrides?{overrides:state.overrides}:{},resolvedMode:styleResolvedMode(state.mode,view)})}function parseLyraStyleRecord(value){const state=styleFromRecord(value),result=styleSnapshot(state);return state.mode==="system"?Object.freeze({...result,resolvedMode:null}):result}function lyraStyleAttributes(style){const attributes={};return styleId(style.look)&&(attributes["data-lr-look"]=style.look),(style.surface==="solid"||style.surface==="glass")&&(attributes["data-lr-surface"]=style.surface),(style.density==="compact"||style.density==="comfortable"||style.density==="touch")&&(attributes["data-lr-density"]=style.density),(style.mode==="light"||style.mode==="dark"||style.mode==="system")&&(attributes["data-lr-mode"]=style.mode),style.accent!==void 0&&(attributes["data-lr-accent"]=style.accent===null?"none":style.accentName===null?"custom":typeof style.accent=="string"&&Object.hasOwn(STYLE_GEMSTONES,style.accent)?style.accent:"custom"),Object.freeze(attributes)}function readStyleState(){if(stylePersistenceFailed)return{...lastStyle};let stored;try{stored=localStorage.getItem(STORAGE_KEY)}catch{return{...lastStyle}}try{return styleFromRecord(JSON.parse(stored??"null"),!0)}catch{return{...DEFAULT_STYLE}}}function persistStyle(state){try{localStorage.setItem(STORAGE_KEY,JSON.stringify(styleRecord(state))),stylePersistenceFailed=!1}catch{stylePersistenceFailed=!0}lastStyle=state}function ownershipFor(element){const node=element;try{const existing=readStyleOwnership(node[STYLE_OWNERSHIP]);if(existing){styleOwnershipFallback.set(element,existing);try{node[STYLE_OWNERSHIP]=existing}catch{}return existing}}catch{}const fallback=styleOwnershipFallback.get(element);if(fallback)return fallback;const record={attributes:new Map,properties:new Map};styleOwnershipFallback.set(element,record);try{node[STYLE_OWNERSHIP]=record}catch{}return record}function writeStyleAttributes(element,desired){const ownership=ownershipFor(element).attributes;for(const[name,value]of ownership)Object.hasOwn(desired,name)||(element.getAttribute(name)===value.written&&(value.before===null?element.removeAttribute(name):element.setAttribute(name,value.before)),ownership.delete(name));for(const[name,value]of Object.entries(desired))ownership.has(name)||ownership.set(name,{before:element.getAttribute(name),priority:"",written:value}),element.getAttribute(name)!==value&&element.setAttribute(name,value),ownership.get(name).written=value}function writeStyleProperties(element,desired){const style=element.style;if(!style)return;const ownership=ownershipFor(element).properties;for(const[name,value]of ownership)desired.has(name)||(style.getPropertyValue(name)===value.written&&style.getPropertyPriority(name)===""&&(value.before?style.setProperty(name,value.before,value.priority):style.removeProperty(name)),ownership.delete(name));for(const[name,value]of desired){ownership.has(name)||ownership.set(name,{before:style.getPropertyValue(name),priority:style.getPropertyPriority(name),written:null});const record=ownership.get(name);(style.getPropertyPriority(name)!==""||style.getPropertyValue(name)!==value&&!(record.requested===value&&record.written===style.getPropertyValue(name)))&&(style.getPropertyPriority(name)&&style.removeProperty(name),style.setProperty(name,value,"")),record.requested=value,record.written=style.getPropertyValue(name)}}function styleSlot(name,mode,accent=!1){return`--_lr-${accent?"a":"l"}${mode==="light"?"l":"d"}-${name.slice(11)}`}function styleFollow(name,value){const channel=name.match(/^--lr-theme-color-(?:success|warning|danger|neutral)-((?:fill|border|on)-(?:quiet|normal|loud))$/)?.[1];return!!(channel&&value===`var(--lr-theme-color-brand-${channel})`)}function styleBranch(name,mode){let result=`var(${styleSlot(name,mode)})`;if(STYLE_FOLLOW.includes(name)){const key=mode==="light"?"l":"d",target=name.replace(/color-(?:success|warning|danger|neutral)-/,"color-brand-");result=`var(--_lr-f${key}-${name.slice(11)},${result})var(--_lr-o${key}-${name.slice(11)},var(${styleSlot(target,mode,!0)},var(${styleSlot(target,mode)})))`}return ALL_RAMP_PROPERTIES.includes(name)?`var(${styleSlot(name,mode,!0)},${result})`:result}function styleResolvedInput(name){const input=`var(--_lr-dark-on,${styleBranch(name,"light")})var(--_lr-light-on,${styleBranch(name,"dark")})`;if(!STYLE_DENSITY.includes(name))return input;const spacing=name.startsWith("--lr-theme-space-");return`var(--_lr-dense-on,${input})var(--_lr-dense-off,max(calc((${input}) * var(--_lr-density-${spacing?"space":"control"},1)),${spacing?"0px":"var(--_lr-density-target-min,0px)"}))`}function styleReferences(state,entries,mode,element,previous){const look=element.closest("[data-lr-look]")?.getAttribute("data-lr-look"),colors=(STYLE_REFERENCE_SURFACES[look??STYLE_DEFAULTS.look]??STYLE_REFERENCE_SURFACES.lyra)[mode],names=["color-surface-default","color-surface-raised","color-text-normal","color-overlay-strong"].slice(0,entries.size?4:1).map(suffix=>`--lr-theme-${suffix}`),supplied=names.map(name=>entries.get(name)),background=typeof state.accentBackground=="string"?state.accentBackground:state.accentBackground?.[mode],style=element.style,ownership=ownershipFor(element).properties,projected=names.flatMap((name,index)=>{const slot=styleSlot(name,mode),owned=ownership.get(slot),before=style?.getPropertyValue(slot)??"",priority=style?.getPropertyPriority(slot)??"",owns=owned&&before===owned.written&&!priority;if(supplied[index]!==void 0&&previous?.[index]===supplied[index]&&owns)return[];if(supplied[index]===void 0&&!owns)return[];const value=supplied[index]??owned?.before??"",nextPriority=supplied[index]===void 0?owned?.priority??"":"";return before===value&&priority===nextPriority?[]:[{slot,before,priority,value,nextPriority}]});try{for(const{slot,value,nextPriority}of projected)style.getPropertyPriority(slot)&&style.removeProperty(slot),value?style.setProperty(slot,value,nextPriority):style.removeProperty(slot);const computed=element.ownerDocument.defaultView?.getComputedStyle(element);return{supplied,colors:names.map((name,index)=>(index===0?background:void 0)??supplied[index]??(computed?.getPropertyValue(styleSlot(name,mode)).trim()||colors[index]))}}finally{for(const{slot,before,priority}of projected)style.getPropertyPriority(slot)&&style.removeProperty(slot),before?style.setProperty(slot,before,priority):style.removeProperty(slot)}}const stylePaintCache=new WeakMap;function stylePaint(state,element,wholeDocument){const desired=new Map,mode=styleResolvedMode(state.mode,element.ownerDocument.defaultView),tokens={...state.tokens,...state.overrides};if(wholeDocument&&mode===null)for(const[name,value]of tokenEntries(tokens,null))desired.set(name,value);if(!Object.keys(tokens).length&&(!state.accent||state.accentName))return stylePaintCache.delete(element),desired;const resolver=element.ownerDocument.defaultView?.getComputedStyle(element).getPropertyValue("--_lr-style-resolver").trim()==="1";let cache=stylePaintCache.get(element);cache||(cache=new Map,stylePaintCache.set(element,cache));let applied=state.accent;for(const branch of["light","dark"]){const entries=tokenEntries(tokens,branch),{colors:references,supplied}=styleReferences(state,entries,branch,element,cache.get(branch)?.supplied),reference=references[0],key=JSON.stringify([tokens,state.accent,state.accentName,references]);let cached=cache.get(branch);if(!cached||cached.key!==key){const background=reference?parseResolvedRgb(reference,MODE_SURFACES[branch],element.ownerDocument)??MODE_SURFACES[branch]:MODE_SURFACES[branch],accent=state.accentName?{applied:state.accent,properties:new Map}:paintAccent(state.accent,branch,background,element.ownerDocument);cached={key,supplied,tokens:floorTokenEntries(entries,background,element.ownerDocument,references),accent:accent.properties,applied:accent.applied},cache.set(branch,cached)}branch===mode&&(applied=cached.applied);const painted=cached.tokens;for(const[name,value]of painted)STYLE_SLOTTED.includes(name)&&styleTokenAllowed(name,value)?(styleFollow(name,value)?(desired.set(`--_lr-f${branch==="light"?"l":"d"}-${name.slice(11)}`," "),desired.set(`--_lr-o${branch==="light"?"l":"d"}-${name.slice(11)}`,"initial")):(desired.set(styleSlot(name,branch),value),STYLE_FOLLOW.includes(name)&&(desired.set(`--_lr-f${branch==="light"?"l":"d"}-${name.slice(11)}`,"initial"),desired.set(`--_lr-o${branch==="light"?"l":"d"}-${name.slice(11)}`," "))),wholeDocument&&branch===mode&&desired.set(name,resolver?styleResolvedInput(name):value)):(wholeDocument?branch===mode:typeof tokens[name]=="string"&&!STYLE_SLOTTED.includes(name))&&desired.set(name,value);if(state.accent&&!state.accentName)for(const[name,value]of cached.accent){if(name==="--lr-theme-accent"){branch===mode&&desired.set(name,value);continue}desired.set(styleSlot(name,branch,!0),value),wholeDocument&&branch===mode&&desired.set(name,resolver?styleResolvedInput(name):value)}}return state.accent=applied,desired}const styleModeGroups=new WeakMap;function attachStyleMode(element,callback){const view=element.ownerDocument.defaultView;if(!view?.matchMedia)return()=>{};let group=styleModeGroups.get(view);if(!group){const query=view.matchMedia(COLOR_SCHEME_QUERY),subscriptions=new Set,modern=typeof query.addEventListener=="function"&&typeof query.removeEventListener=="function",detach=()=>{modern?query.removeEventListener("change",listener):query.removeListener?.(listener)},listener=()=>{for(const subscription2 of subscriptions){const node=subscription2.element.deref();node?.ownerDocument.defaultView===view?subscription2.callback(node):subscriptions.delete(subscription2)}subscriptions.size||(detach(),styleModeGroups.delete(view))};group={query,subscriptions,detach},styleModeGroups.set(view,group),modern?query.addEventListener("change",listener):query.addListener?.(listener)}const subscription={element:new WeakRef(element),callback};group.subscriptions.add(subscription);const active=group;return()=>{active.subscriptions.delete(subscription),active.subscriptions.size||(active.detach(),styleModeGroups.delete(view))}}function applyStyleState(element,state,fields){const snapshot=styleSnapshot(state,element.ownerDocument.defaultView),attributes={...lyraStyleAttributes(snapshot)};if(fields)for(const[field,name]of[["look","look"],["surface","surface"],["density","density"],["mode","mode"],["accent","accent"]])fields.has(field)||delete attributes[`data-lr-${name}`];state.accent&&!state.accentName&&(!fields||fields.has("accent"))&&(attributes["data-lr-accent"]="custom"),(!fields||fields.has("mode"))&&snapshot.resolvedMode&&(attributes["data-lr-theme"]=snapshot.resolvedMode,attributes["data-theme"]=snapshot.resolvedMode),(state.tokens||state.overrides||state.accent&&!state.accentName)&&(attributes["data-lr-theme-scope"]=""),writeStyleAttributes(element,attributes);const desired=stylePaint(state,element,!fields);(!fields||fields.has("surface"))&&element.ownerDocument.defaultView?.getComputedStyle(element).getPropertyValue("--_lr-style-resolver").trim()!=="1"&&styleMaterial(desired,state.surface),!state.accent&&snapshot.accent&&(attributes["data-lr-accent"]="none",!state.tokens&&!state.overrides&&delete attributes["data-lr-theme-scope"],writeStyleAttributes(element,attributes)),writeStyleProperties(element,desired),adoptTokenLayerForScope(element),diagnoseStyleSheets(element,state,fields)}function adoptTokenLayerForScope(element){const root=element.getRootNode();if(root===element.ownerDocument||root.nodeType!==11)return;const adopt=globalThis[Symbol.for("@aceshooting/lyra-ui.adopt-lyra-tokens.v1")];typeof adopt=="function"&&adopt(root)}function diagnoseStyleSheets(element,state,fields){if(!litDevWarnings())return;const selected=field=>!fields||fields.has(field),required=[];selected("look")&&!state.tokens&&state.look!=="lyra"&&state.look!==DEFAULT_STYLE.look&&required.push(["--_lr-look-installed",`${state.look}-1`,`the stylesheet for look '${state.look}'`]),selected("surface")&&state.surface==="glass"&&state.surface!==DEFAULT_STYLE.surface&&required.push(["--_lr-surface-installed","1","surfaces/glass.css"]),selected("density")&&state.density!=="comfortable"&&required.push(["--_lr-density-installed","1","density.css"]),selected("accent")&&state.accentName&&state.accentName!==DEFAULT_STYLE.accentName&&required.push(["--_lr-accent-installed",`${state.accentName}-1`,"accents.css"]);const scopedRuntime=!!(fields&&(state.tokens||state.overrides||state.accent&&!state.accentName)),alternateProfile=selected("look")&&!state.tokens&&state.look!==DEFAULT_STYLE.look||selected("accent")&&!state.accent;if(!required.length&&!scopedRuntime&&!alternateProfile)return;const computed=element.ownerDocument.defaultView?.getComputedStyle(element);if(computed){computed.getPropertyValue("--_lr-style-resolver").trim()!=="1"&&devWarnOnce("lyra-style:resolver","Lyra style choices require theme.css in the scope that owns their attributes.");for(const[property,expected,stylesheet]of required)computed.getPropertyValue(property).trim()!==expected&&devWarnOnce(`lyra-style:${property}:${expected}`,`Lyra could not find ${stylesheet} in this style scope; import or adopt the stylesheet before selecting it.`)}}function emitStyleChange(state,changed){const style=styleSnapshot(state,window);window.dispatchEvent(new CustomEvent("lr-style-change",{detail:Object.freeze({style,changed:Object.freeze([...changed])})}))}function setLyraStyle(choices){const before=readStyleState();return commitStyle(before,normalizeStyleChoices(choices,before))}function commitStyle(before,next){if(typeof document<"u"&&(next.accent=normalizeAccent(next.accent),typeof next.accentBackground=="string"&&(next.accentBackground=normalizeColor(next.accentBackground)),next.accent||(next.accentName=null)),persistStyle(next),typeof document<"u"){applyRootStyle(next)&&persistStyle(next);const changed=STYLE_FIELDS.filter(field=>field==="look"?before.look!==next.look||!tokensEqual(before.tokens,next.tokens):field==="accent"?before.accentName!==next.accentName||!accentsEqual(before.accent,next.accent):JSON.stringify(before[field])!==JSON.stringify(next[field]));emitStyleChange(next,changed)}return styleSnapshot(next,typeof window>"u"?void 0:window)}function applyRootStyle(next){const root=document.documentElement;(next.mode!=="system"||styleModeRoot?.deref()!==root)&&(styleModeCleanup?.(),styleModeCleanup=void 0,styleModeRoot=void 0),adoptLegacyOwnership(root);const requestedAccent=next.accent;return applyStyleState(root,next),next.mode==="system"&&!styleModeCleanup&&(styleModeRoot=new WeakRef(root),styleModeCleanup=attachStyleMode(root,element=>{applyStyleState(element,lastStyle),emitStyleChange(lastStyle,["resolvedMode"])})),!accentsEqual(requestedAccent,next.accent)}function adoptLegacyOwnership(root){const symbol=Symbol.for(TOKEN_OWNERSHIP_SYMBOL),node=root;try{if(!Array.isArray(node[symbol]))return}catch{return}const ownership=ownershipFor(root).properties;for(const name of[...readOwnershipList(),...ALL_RAMP_PROPERTIES,"--lr-theme-accent"])ownership.has(name)||!root.style.getPropertyValue(name)||ownership.set(name,{before:null,priority:"",written:root.style.getPropertyValue(name)});try{delete node[symbol]}catch{}}function getLyraStyle(){return styleSnapshot(readStyleState(),typeof window>"u"?void 0:window)}function startLyraStyle(){const state=readStyleState();return typeof document>"u"?styleSnapshot(state):(state.accent=normalizeAccent(state.accent),typeof state.accentBackground=="string"&&(state.accentBackground=normalizeColor(state.accentBackground)),state.accent||(state.accentName=null),lastStyle=state,applyRootStyle(state),styleSnapshot(state,window))}function resetLyraStyle(fields=STYLE_FIELDS){const defaults={...STYLE_DEFAULTS,accentBackground:null,overrides:null};return setLyraStyle(Object.fromEntries(fields.filter(field=>STYLE_FIELDS.includes(field)).map(field=>[field,defaults[field]])))}function applyLyraStyleScope(element,choices){if(scopeModes.get(element)?.(),scopeModes.delete(element),choices===null){writeStyleAttributes(element,{}),writeStyleProperties(element,new Map);return}const state=normalizeStyleChoices(choices,{...DEFAULT_STYLE}),fields=new Set(STYLE_FIELDS.filter(field=>ownField(choices,field)!==void 0));applyStyleState(element,state,fields),choices.mode==="system"&&scopeModes.set(element,attachStyleMode(element,node=>applyStyleState(node,state,fields)))}const lyraThemeBootstrap=/* @__PURE__ */createLyraThemeBootstrap();export{accentsEqual,applyLyraStyleScope,createLyraThemeBootstrap,defineLyraLook,getLyraStyle,isLyraThemeTokenName,isSafeLyraThemeTokenValue,lyraStyleAttributes,lyraThemeBootstrap,parseLyraStyleRecord,resetLyraStyle,setLyraStyle,startLyraStyle,tokensEqual};
1
+ import{devWarnOnce,litDevWarnings}from"../internal/dev-warning.js";import{readStyleOwnership}from"./style-ownership.js";import{resolveStyleStartup}from"./startup-resolution.js";const STORAGE_KEY="lyra-theme",TOKEN_NAME_PATTERN=/^--lr-theme-[a-z0-9]+(?:-[a-z0-9]+)*$/,TOKEN_NAME_MAX_LENGTH=80,TOKEN_RESERVED_NAME="--lr-theme-accent",TOKEN_ENTRY_MAX=512,TOKEN_SYNTHESIZED_MAX=16,TOKEN_VALUE_MAX_LENGTH=256,TOKEN_FORBIDDEN_PATTERN=/[\x00-\x1f\x7f\\;{}!<>@[\]`$^|~=?&:\u2028\u2029]|\/\*|\*\//,TOKEN_CSS_WIDE_PATTERN=/^(?:inherit|initial|revert(?:-layer)?|unset)$/i,TOKEN_FUNCTION_PATTERN=/([a-z0-9_-]+)\s*\(/gi,TOKEN_ALLOWED_FUNCTIONS="rgb rgba hsl hsla hwb lab lch oklab oklch color color-mix light-dark calc min max clamp var cubic-bezier steps linear".split(" "),TOKEN_OWNERSHIP_MAX=TOKEN_ENTRY_MAX+TOKEN_SYNTHESIZED_MAX,TOKEN_OWNERSHIP_SYMBOL="@aceshooting/lyra-ui.theme-tokens.v1",MODE_SURFACES={light:[255,255,255],dark:[10,10,10]},COLOR_SCHEME_QUERY="(prefers-color-scheme: dark)",SEMANTIC_ROLES=["brand","success","warning","danger","neutral"],RAMP_CHANNELS=["fill","border","on"],RAMP_TIERS=["quiet","normal","loud"];function roleRampProperties(role){const properties=[];for(const channel of RAMP_CHANNELS)for(const tier of RAMP_TIERS)properties.push(`--lr-theme-color-${role}-${channel}-${tier}`);return properties}const ALL_RAMP_PROPERTIES=[...SEMANTIC_ROLES.flatMap(roleRampProperties),"--lr-theme-color-focus"],MODE_ATTRIBUTES=["data-lr-theme","data-theme"];function isBalancedCssValue(value){let depth=0,quote="";for(const character of value){if(quote){character===quote&&(quote="");continue}if(character==="'"||character==='"')quote=character;else if(character==="(")depth+=1;else if(character===")"&&(depth-=1)<0)return!1}return quote===""&&depth===0}function isLyraThemeTokenName(name){return typeof name=="string"&&name.length<=TOKEN_NAME_MAX_LENGTH&&TOKEN_NAME_PATTERN.test(name)&&name!==TOKEN_RESERVED_NAME}function isSafeLyraThemeTokenValue(value){if(typeof value!="string")return!1;const trimmed=value.trim();if(!trimmed||trimmed.length>TOKEN_VALUE_MAX_LENGTH||TOKEN_FORBIDDEN_PATTERN.test(trimmed)||TOKEN_CSS_WIDE_PATTERN.test(trimmed))return!1;for(const match of trimmed.matchAll(TOKEN_FUNCTION_PATTERN))if(!TOKEN_ALLOWED_FUNCTIONS.includes((match[1]??"").toLowerCase()))return!1;return isBalancedCssValue(trimmed)}function isPlainRecord(value){if(typeof value!="object"||value===null||Array.isArray(value))return!1;const prototype=Object.getPrototypeOf(value);if(prototype===Object.prototype||prototype===null)return!0;if(Object.getPrototypeOf(prototype)!==null)return!1;const constructor=Object.getOwnPropertyDescriptor(prototype,"constructor")?.value;return typeof constructor=="function"&&Function.prototype.toString.call(constructor)===Function.prototype.toString.call(Object)}function normalizeTokenBranch(value){return isSafeLyraThemeTokenValue(value)?value.trim():null}function normalizeTokens(raw){try{if(!isPlainRecord(raw))return null;const names=Object.keys(raw);if(names.length===0||names.length>TOKEN_ENTRY_MAX)return null;const result={};let kept=0;for(const name of names){if(!isLyraThemeTokenName(name))continue;const value=ownField(raw,name);if(typeof value=="string"){const normalized=normalizeTokenBranch(value);if(normalized===null)continue;result[name]=normalized,kept+=1;continue}if(!isPlainRecord(value))continue;const keys=Object.keys(value),hasLight=Object.prototype.hasOwnProperty.call(value,"light"),hasDark=Object.prototype.hasOwnProperty.call(value,"dark");if(!hasLight&&!hasDark||keys.some(key=>key!=="light"&&key!=="dark"))continue;const light=normalizeTokenBranch(ownField(value,"light")),dark=normalizeTokenBranch(ownField(value,"dark"));light===null&&dark===null||(result[name]=Object.freeze({light,dark}),kept+=1)}return kept>0?Object.freeze(result):null}catch{return null}}function tokensEqual(left,right){const leftNames=left?Object.keys(left):[],rightNames=right?Object.keys(right):[];if(leftNames.length!==rightNames.length)return!1;if(leftNames.length===0)return!0;const leftMap=left,rightMap=right;return leftNames.every(name=>{if(!Object.prototype.hasOwnProperty.call(rightMap,name))return!1;const a=leftMap[name],b=rightMap[name];return typeof a=="string"||typeof b=="string"?a===b:!a||!b?!1:(a.light??null)===(b.light??null)&&(a.dark??null)===(b.dark??null)})}function normalizeColor(value,owner=document){if(typeof value!="string"||!value.trim())return null;const candidate=value.trim();if(!isBalancedCssValue(candidate)||TOKEN_CSS_WIDE_PATTERN.test(candidate)||/^(?:accentcolor|accentcolortext|activetext|buttonborder|buttonface|buttontext|canvas|canvastext|field|fieldtext|graytext|highlight|highlighttext|linktext|mark|marktext|selecteditem|selecteditemtext|visitedtext)$/i.test(candidate)||/\bcurrentcolor\b/i.test(candidate)||/\bvar\s*\(/i.test(candidate)||/\blight-dark\s*\(/i.test(candidate)||/\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)\s*\(\s*from\b/i.test(candidate))return null;const probe=owner.createElement("span");return probe.style.color=candidate,probe.style.color?candidate:null}function normalizeAccentValue(value){if(typeof value=="string"||value===null)return normalizeColor(value);if(typeof value!="object"||Array.isArray(value))return null;const record=value;if(!("light"in record)&&!("dark"in record))return null;const light=normalizeColor(record.light),dark=normalizeColor(record.dark);return light||dark?{light,dark}:null}function normalizeAccent(value){if(typeof value=="string")return normalizeColor(value);if(value===null||typeof value!="object"||Array.isArray(value))return null;const record=value,result={};let hasRole=!1;for(const role of SEMANTIC_ROLES)role in record&&(hasRole=!0,result[role]=normalizeAccentValue(record[role]));return hasRole?result:null}function resolveAccentValueForMode(value,mode){return typeof value=="string"?value:value?value[mode]??null:null}function accentValueEqual(left,right){return left===right?!0:typeof left=="string"||typeof right=="string"||left===null||right===null?!1:(left.light??null)===(right.light??null)&&(left.dark??null)===(right.dark??null)}function accentsEqual(left,right){if(left===right)return!0;if(typeof left=="string"||typeof right=="string"||left===null||right===null)return!1;const leftKeys=Object.keys(left),rightKeys=Object.keys(right);return leftKeys.length!==rightKeys.length?!1:leftKeys.every(role=>accentValueEqual(left[role],right[role]))}function parseResolvedRgb(value,background,owner=document){if(!normalizeColor(value,owner))return null;try{const canvas=owner.createElement("canvas");canvas.width=1,canvas.height=1;const context=canvas.getContext("2d",{willReadFrequently:!0});if(!context)return null;context.clearRect(0,0,1,1),context.fillStyle=value,context.fillRect(0,0,1,1);const channels=context.getImageData(0,0,1,1).data,red=channels[0]??0,green=channels[1]??0,blue=channels[2]??0,alpha=(channels[3]??0)/255;return[Math.round(red*alpha+background[0]*(1-alpha)),Math.round(green*alpha+background[1]*(1-alpha)),Math.round(blue*alpha+background[2]*(1-alpha))]}catch{return null}}function hexRgb(color){return[parseInt(color.slice(1,3),16),parseInt(color.slice(3,5),16),parseInt(color.slice(5,7),16)]}function mixRgb(base,color,colorWeight){return[Math.round(base[0]*(1-colorWeight)+color[0]*colorWeight),Math.round(base[1]*(1-colorWeight)+color[1]*colorWeight),Math.round(base[2]*(1-colorWeight)+color[2]*colorWeight)]}function serializeRgb(color){return`rgb(${color.join(" ")})`}function relativeLuminance(color){const linearize=channel=>{const normalized=channel/255;return normalized<=.04045?normalized/12.92:((normalized+.055)/1.055)**2.4};return linearize(color[0])*.2126+linearize(color[1])*.7152+linearize(color[2])*.0722}function contrastRatio(left,right){const a=relativeLuminance(left),b=relativeLuminance(right);return(Math.max(a,b)+.05)/(Math.min(a,b)+.05)}function contrastForeground(fill){const black=[0,0,0],white=[255,255,255];return contrastRatio(fill,black)>=contrastRatio(fill,white)?black:white}function ensureSurfaceContrast(color,background,minimum=3,alsoAgainst=background,references=[]){const passes=candidate=>contrastRatio(candidate,background)>=minimum&&contrastRatio(candidate,alsoAgainst)>=minimum&&references.every(reference=>contrastRatio(candidate,reference)>=minimum);if(passes(color))return color;const black=[0,0,0],white=[255,255,255],target=contrastRatio(background,black)>=contrastRatio(background,white)?black:white;for(let step=1;step<=10;step+=1){const candidate=mixRgb(color,target,step/10);if(passes(candidate))return candidate}return target}function createRoleRamp(role,base,mode,background,owner=document){const references=STYLE_CONTRAST_SURFACES[mode].map(hexRgb),resolved=parseResolvedRgb(base,background,owner);if(!resolved)return null;const quiet=mixRgb(background,resolved,mode==="dark"?.24:.14),normal=mixRgb(background,resolved,mode==="dark"?.62:.55),loud=ensureSurfaceContrast(resolved,background,4.5,quiet,references),borderTarget=mode==="dark"?[255,255,255]:[0,0,0],borderQuiet=mixRgb(background,resolved,mode==="dark"?.46:.38),borderNormal=ensureSurfaceContrast(mixRgb(background,resolved,mode==="dark"?.78:.72),background,3,background,references),borderLoud=ensureSurfaceContrast(mixRgb(loud,borderTarget,.2),background,3,background,references),prefix=`--lr-theme-color-${role}`,ramp={[`${prefix}-fill-quiet`]:serializeRgb(quiet),[`${prefix}-fill-normal`]:serializeRgb(normal),[`${prefix}-fill-loud`]:serializeRgb(loud),[`${prefix}-border-quiet`]:serializeRgb(borderQuiet),[`${prefix}-border-normal`]:serializeRgb(borderNormal),[`${prefix}-border-loud`]:serializeRgb(borderLoud),[`${prefix}-on-quiet`]:serializeRgb(contrastForeground(quiet)),[`${prefix}-on-normal`]:serializeRgb(contrastForeground(normal)),[`${prefix}-on-loud`]:serializeRgb(contrastForeground(loud))};return role==="brand"&&(ramp["--lr-theme-color-focus"]=serializeRgb(ensureSurfaceContrast(resolved,background,3,background,references))),ramp}function paintAccent(accent,mode,background,owner=document){const properties=new Map;if(!accent)return{applied:null,properties};if(!mode)return{applied:accent,properties};if(typeof accent=="string"){const ramp=createRoleRamp("brand",accent,mode,background,owner);if(!ramp)return{applied:null,properties};properties.set("--lr-theme-accent",accent);for(const[property,value]of Object.entries(ramp))properties.set(property,value);return{applied:accent,properties}}const applied={};let appliedBrandColor=null;for(const role of SEMANTIC_ROLES){const value=accent[role];if(!value)continue;const isPerMode=typeof value!="string",base=resolveAccentValueForMode(value,mode);let painted=!1;if(base){const ramp=createRoleRamp(role,base,mode,background,owner);if(ramp){for(const[property,propertyValue]of Object.entries(ramp))properties.set(property,propertyValue);painted=!0,role==="brand"&&(appliedBrandColor=base)}}(painted||isPerMode)&&(applied[role]=value)}return appliedBrandColor&&properties.set("--lr-theme-accent",appliedBrandColor),{applied:Object.keys(applied).length>0?applied:null,properties}}function tokenEntries(tokens,mode){const entries=new Map;if(!tokens)return entries;for(const[name,value]of Object.entries(tokens))if(typeof value=="string")entries.set(name,value);else if(mode){const branch=value[mode];branch&&entries.set(name,branch)}return entries}function resolveTokenColor(value,background,owner){return value===void 0||!background||!normalizeColor(value,owner)?null:parseResolvedRgb(value,background,owner)}function floorTokenEntries(entries,surface,owner,references){if(!entries.size)return new Map;const resolveColor=(value,background)=>resolveTokenColor(value,background,owner),painted=new Map(entries),prefix="--lr-theme-",raised=resolveColor(entries.get(`${prefix}color-surface-raised`)??references[1],surface),floor=(name,over,against,minimum,alsoAgainst)=>{const value=painted.get(name);if(value===void 0||!against||alsoAgainst===null)return;const color=resolveColor(value,over);if(!color)return;const repaired=ensureSurfaceContrast(color,against,minimum,alsoAgainst??against);repaired!==color&&painted.set(name,serializeRgb(repaired))};floor(`${prefix}color-text-normal`,surface,surface,4.5,raised),floor(`${prefix}color-text-quiet`,surface,surface,4.5,raised);const text=entries.has(`${prefix}color-text-normal`)?resolveColor(painted.get(`${prefix}color-text-normal`),surface):resolveColor(references[2],surface),pairForeground=(onName,fill)=>{if(!fill)return;const on=painted.get(onName);if(on===void 0){painted.set(onName,serializeRgb(contrastForeground(fill)));return}const color=resolveColor(on,fill);color&&contrastRatio(color,fill)<4.5&&painted.set(onName,serializeRgb(contrastForeground(fill)))};for(const role of SEMANTIC_ROLES)for(const tier of RAMP_TIERS){const fillName=`${prefix}color-${role}-fill-${tier}`;entries.has(fillName)&&pairForeground(`${prefix}color-${role}-on-${tier}`,resolveColor(entries.get(fillName),surface))}const overlayName=`${prefix}color-overlay-strong`,overlay=entries.has(overlayName)?resolveColor(entries.get(overlayName),surface):resolveColor(references[3],surface);(entries.has(overlayName)||entries.has(`${prefix}color-on-strong-overlay`))&&pairForeground(`${prefix}color-on-strong-overlay`,overlay);for(const name of entries.keys())/^--lr-theme-color-(?:(?:brand|success|warning|danger|neutral)-border-(?:normal|loud)|surface-border|border-strong|focus|chart-\d+)$/.test(name)?floor(name,surface,surface,3):/^--lr-theme-terminal-color-[a-z0-9-]+$/.test(name)?floor(name,raised,raised,4.5):/^--lr-theme-terminal-bg-[a-z0-9-]+$/.test(name)&&floor(name,raised,text,4.5);return painted}function readOwnershipList(){try{const list=document.documentElement[Symbol.for(TOKEN_OWNERSHIP_SYMBOL)];if(!Array.isArray(list))return[];const names=[],length=Math.min(list.length,TOKEN_OWNERSHIP_MAX);for(let index=0;index<length;index+=1){const name=list[index];isLyraThemeTokenName(name)&&names.push(name)}return names}catch{return[]}}function applyStoredThemeBeforePaint(){const R=["brand","success","warning","danger","neutral"],Q=["quiet","normal","loud"],W=/^--lr-theme-[a-z0-9]+(?:-[a-z0-9]+)*$/,_="--lr-theme-accent",G=/[\x00-\x1f\x7f\\;{}!<>@[\]`$^|~=?&:\u2028\u2029]|\/\*|\*\//,H=/^(?:inherit|initial|revert(?:-layer)?|unset)$/i,J=/([a-z0-9_-]+)\s*\(/gi,K="rgb rgba hsl hsla hwb lab lch oklab oklch color color-mix light-dark calc min max clamp var cubic-bezier steps linear".split(" "),U={light:[255,255,255],dark:[10,10,10]},X=r=>{let o=0,h="";for(const a of r){if(h){a===h&&(h="");continue}if(a==="'"||a==='"')h=a;else if(a==="(")o+=1;else if(a===")"&&(o-=1)<0)return!1}return h===""&&o===0},Y=r=>typeof r=="string"&&r.length<=80&&W.test(r)&&r!==_,P=r=>{if(typeof r!="string")return null;const o=r.trim();if(!o||o.length>256||G.test(o)||H.test(o))return null;for(const h of o.matchAll(J))if(!K.includes((h[1]??"").toLowerCase()))return null;return X(o)?o:null},A=r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!1;const o=Object.getPrototypeOf(r);return o===Object.prototype||o===null},Z=r=>{const o={};try{if(!A(r))return o;const h=Object.keys(r);if(h.length<=512)for(const a of h){if(!Y(a))continue;const g=r[a];if(typeof g=="string"){const u=P(g);u!==null&&(o[a]=u);continue}if(!A(g))continue;const j=Object.hasOwn(g,"light"),i=Object.hasOwn(g,"dark");if(!j&&!i||Object.keys(g).some(u=>u!=="light"&&u!=="dark"))continue;const M=P(g.light),y=P(g.dark);(M!==null||y!==null)&&(o[a]={light:M,dark:y})}}catch{}return o},C=r=>{const o=P(r);if(!(!o||/\b(?:var|light-dark)\s*\(|\b(?:currentcolor|from)\b/i.test(o)||/^(?:accentcolor|accentcolortext|activetext|buttonborder|buttonface|buttontext|canvas|canvastext|field|fieldtext|graytext|highlight|highlighttext|linktext|mark|marktext|selecteditem|selecteditemtext|visitedtext)$/i.test(o)))return CSS.supports("color",o)?o:void 0};return[Z,C,(r,o,h,a,g,j)=>{const i=new Map;for(const[t,n]of Object.entries(r)){const e=typeof n=="string"?n:n[o];e&&i.set(t,e)}const M=typeof a=="string"?{brand:a}:a,y={};for(const t of R){const n=M?.[t],e=typeof n=="string"?n:n?.[o];e&&(y[t]=e)}let u=null;if(i.size>0||Object.keys(y).length>0)try{const t=document.createElement("canvas");t.width=1,t.height=1,u=t.getContext("2d",{willReadFrequently:!0})}catch{u=null}const S=(t,n)=>{if(!u)return null;try{u.clearRect(0,0,1,1),u.fillStyle=t,u.fillRect(0,0,1,1);const e=u.getImageData(0,0,1,1).data,c=(e[3]??0)/255;return[0,1,2].map(f=>Math.round((e[f]??0)*c+(n[f]??0)*(1-c)))}catch{return null}},z=(t,n,e)=>t.map((c,f)=>Math.round(c*(1-e)+(n[f]??0)*e)),B=t=>{const n=t.map(e=>{const c=e/255;return c<=.04045?c/12.92:((c+.055)/1.055)**2.4});return(n[0]??0)*.2126+(n[1]??0)*.7152+(n[2]??0)*.0722},O=(t,n)=>{const e=B(t),c=B(n);return(Math.max(e,c)+.05)/(Math.min(e,c)+.05)},v=[0,0,0],F=[255,255,255],w=t=>O(t,v)>=O(t,F)?v:F,q=(t,n,e=3,c=n)=>{const f=d=>O(d,n)>=e&&O(d,c)>=e&&g.every(k=>O(d,k)>=e);if(f(t))return t;const p=w(n);for(let d=1;d<=10;d+=1){const k=z(t,p,d/10);if(f(k))return k}return p},m=t=>`rgb(${t.join(" ")})`,D=U[o],E=C(h)??C(i.get("--lr-theme-color-surface-default")),s=E&&S(E,D)||D,l=new Map(i),b="--lr-theme-",$=(t,n)=>t!==void 0&&n&&C(t)?S(t,n):null,tt=`${b}color-surface-raised`,N=$(i.get(tt)??j[1],s),L=(t,n,e,c,f)=>{const p=l.get(t);if(p===void 0||!e||f===null)return;const d=$(p,n);if(!d)return;const k=q(d,e,c,f??e);k!==d&&l.set(t,m(k))};L(`${b}color-text-normal`,s,s,4.5,N),L(`${b}color-text-quiet`,s,s,4.5,N);const et=i.has(`${b}color-text-normal`)?$(l.get(`${b}color-text-normal`),s):$(j[2],s),I=(t,n)=>{if(!n)return;const e=l.get(t),c=e===void 0?null:$(e,n);(e===void 0||c&&O(c,n)<4.5)&&l.set(t,m(w(n)))};for(const t of R)for(const n of Q){const e=`${b}color-${t}-fill-${n}`;i.has(e)&&I(`${b}color-${t}-on-${n}`,$(i.get(e),s))}const T=`${b}color-overlay-strong`;(i.has(T)||i.has(`${b}color-on-strong-overlay`))&&I(`${b}color-on-strong-overlay`,i.has(T)?$(i.get(T),s):$(j[3],s));for(const t of i.keys())/^--lr-theme-color-(?:(?:brand|success|warning|danger|neutral)-border-(?:normal|loud)|surface-border|border-strong|focus|chart-\d+)$/.test(t)?L(t,s,s,3):/^--lr-theme-terminal-color-[a-z0-9-]+$/.test(t)?L(t,N,N,4.5):/^--lr-theme-terminal-bg-[a-z0-9-]+$/.test(t)&&L(t,N,et,4.5);if(!u)return l;let V=null;for(const t of R){const n=y[t];if(!n)continue;const e=S(n,s);if(!e)continue;const c=z(s,e,o==="dark"?.24:.14),f=z(s,e,o==="dark"?.62:.55),p=q(e,s,4.5,c),d=o==="dark"?F:v,k=z(s,e,o==="dark"?.46:.38),nt=q(z(s,e,o==="dark"?.78:.72),s),ot=q(z(p,d,.2),s),x=`--lr-theme-color-${t}`;l.set(`${x}-fill-quiet`,m(c)),l.set(`${x}-fill-normal`,m(f)),l.set(`${x}-fill-loud`,m(p)),l.set(`${x}-border-quiet`,m(k)),l.set(`${x}-border-normal`,m(nt)),l.set(`${x}-border-loud`,m(ot)),l.set(`${x}-on-quiet`,m(w(c))),l.set(`${x}-on-normal`,m(w(f))),l.set(`${x}-on-loud`,m(w(p))),t==="brand"&&(l.set("--lr-theme-color-focus",m(q(e,s))),V=n)}return V&&l.set("--lr-theme-accent",V),l}]}function styleMaterial(l,n){const t=n==="glass";for(const[a,i]of Object.entries({enabled:t?"1":"0",content:t?"''":"none",isolation:t?"isolate":"auto","root-filter":t?"initial":"none","child-filter":t?"none":"initial","child-opacity":t?"1":"0"}))l.set(`--_lr-surface-${a}`,i);l.set("--_lr-glass-blocker",t?"initial":"none"),t||(l.set("--_lr-glass-parent-opacity","0"),l.set("--_lr-next-glass-opacity","0"))}function applyStoredStyleBeforePaint(U,q,D,R,G,J,W,S){const{surfaces:_,contrast:H,accent:Q}=S,b=new Map;for(const r of S.inputs.split(" "))b.set(`--lr-theme-${r.slice(1)}`,Number(r[0]));const A=[...b.keys()];function v(r,n,s=!1){return`--_lr-${s?"a":"l"}${n==="light"?"l":"d"}-${r.slice(11)}`}function V(r,n){const s=b.get(r)??0;let g=`var(${v(r,n)})`;if(s&2){const k=n==="light"?"l":"d",u=r.replace(/color-(?:success|warning|danger|neutral)-/,"color-brand-");g=`var(--_lr-f${k}-${r.slice(11)},${g})var(--_lr-o${k}-${r.slice(11)},var(${v(u,n,!0)},var(${v(u,n)})))`}return s&4?`var(${v(r,n,!0)},${g})`:g}function X(r){const n=`var(--_lr-dark-on,${V(r,"light")})var(--_lr-light-on,${V(r,"dark")})`;if(!((b.get(r)??0)&1))return n;const s=r.startsWith("--lr-theme-space-");return`var(--_lr-dense-on,${n})var(--_lr-dense-off,max(calc((${n}) * var(--_lr-density-${s?"space":"control"},1)),${s?"0px":"var(--_lr-density-target-min,0px)"}))`}try{const r=document.currentScript,n=r?.getAttribute("data-lr-theme-restore"),s=(n==="all"||n==="mode"?n:S.restore)==="mode",g=r?.getAttribute("data-lr-theme-storage-key"),k=g&&g.length<=200?g:U,u=r?.getAttribute("data-lr-theme-attributes")?.trim().split(/\s+/),E=u?.length&&u.length<=8&&new Set(u).size===u.length&&u.every(t=>t.length<=64&&/^data-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(t))?u:q;let w;try{w=JSON.parse(localStorage.getItem(k)??"null")}catch{}if(s){const t=w;w={version:t?.version,mode:t?.mode}}const o=document.documentElement,[Z,tt,et]=D(),f=J(w,S.defaults,Z,tt,(t,e)=>R(t,e,A),Q),y=f.mode,$=y==="unset"?null:y==="system"?matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":y,p={},C=!s&&getComputedStyle(o).getPropertyValue("--_lr-style-resolver").trim()==="1",L=(t,e)=>typeof t=="string"?t:t?.[e],rt=f.tokens,ot=f.overrides,O={...rt,...ot},T=f.look;if(s||(p["data-lr-look"]=T,p["data-lr-density"]=f.density,p["data-lr-surface"]=f.treatment),y!=="unset"&&(p["data-lr-mode"]=y),$)for(const t of E)p[t]=$;const z=f.accentName;let h=f.accent;y!=="unset"&&h&&typeof h=="object"&&!Object.values(h).some(t=>typeof t=="string"||t&&Object.values(t).some(Boolean))&&(h=null),s||(p["data-lr-accent"]=z??(h?"custom":"none"));const a=new Map;if(y==="unset")for(const[t,e]of Object.entries(O))typeof e=="string"&&a.set(t,e);for(const t of s?[]:["light","dark"]){const e=L(f.surface,t),j=L(O["--lr-theme-color-surface-default"],t),c=(Object.hasOwn(_,T)?_[T]:_.lyra)[t],M=e??j??c[0];for(const m of[!1,!0]){if(m&&(!h||z))continue;const st=et(m?{}:O,t,M,m?h:null,m?H[t].map(l=>[1,3,5].map(d=>parseInt(l.slice(d,d+2),16))):[],c);for(const[l,d]of st){if(l==="--lr-theme-accent"){t===$&&a.set(l,d);continue}const B=b.get(l);if(B!==void 0&&R(l,d,A)){const F=l.match(/^--lr-theme-color-(?:success|warning|danger|neutral)-((?:fill|border|on)-(?:quiet|normal|loud))$/)?.[1],N=!m&&F&&d===`var(--lr-theme-color-brand-${F})`,I=l.slice(11),K=t==="light"?"l":"d";N||a.set(v(l,t,m),d),!m&&B&2&&(a.set(`--_lr-f${K}-${I}`,N?" ":"initial"),a.set(`--_lr-o${K}-${I}`,N?"initial":" ")),t===$&&a.set(l,C?X(l):d)}else t===$&&a.set(l,d)}}}(a.size||y==="unset"&&h&&!z)&&(p["data-lr-theme-scope"]=""),!s&&!C&&W(a,f.treatment);const Y=Symbol.for("@aceshooting/lyra-ui.style-ownership.v1"),P=o;let x;try{x=G(P[Y])}catch{}const i=x??{attributes:new Map,properties:new Map};if(y==="unset")for(const t of E)i.attributes.has(t)||o.removeAttribute(t);try{const t=Symbol.for("@aceshooting/lyra-ui.theme-tokens.v1"),e=P[t];if(!s&&Array.isArray(e)){const j=e.slice(0,528).filter(c=>typeof c=="string"&&c.length<=80&&/^--lr-theme-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(c));for(const c of[...j,...A.filter(M=>b.get(M)&4),"--lr-theme-accent"])!i.properties.has(c)&&o.style.getPropertyValue(c)&&i.properties.set(c,{before:null,priority:"",written:o.style.getPropertyValue(c)});try{delete P[t]}catch{}}}catch{}for(const[t,e]of i.attributes)s&&t!=="data-lr-mode"&&!E.includes(t)||Object.hasOwn(p,t)||(o.getAttribute(t)===e.written&&(e.before===null?o.removeAttribute(t):o.setAttribute(t,e.before)),i.attributes.delete(t));for(const[t,e]of Object.entries(p))i.attributes.has(t)||i.attributes.set(t,{before:o.getAttribute(t),priority:"",written:e}),o.setAttribute(t,e),i.attributes.get(t).written=e;for(const[t,e]of i.properties)s||a.has(t)||(o.style.getPropertyValue(t)===e.written&&!o.style.getPropertyPriority(t)&&(e.before?o.style.setProperty(t,e.before,e.priority):o.style.removeProperty(t)),i.properties.delete(t));for(const[t,e]of a)i.properties.has(t)||i.properties.set(t,{before:o.style.getPropertyValue(t),priority:o.style.getPropertyPriority(t),written:null}),o.style.getPropertyPriority(t)&&o.style.removeProperty(t),o.style.setProperty(t,e,""),i.properties.get(t).written=o.style.getPropertyValue(t);try{P[Y]=i}catch{}}catch{}}const LINE_SEPARATOR="\u2028",PARAGRAPH_SEPARATOR="\u2029";function serializeInlineScriptData(value){return JSON.stringify(value).replace(/</g,"\\u003c").replace(new RegExp(LINE_SEPARATOR,"g"),"\\u2028").replace(new RegExp(PARAGRAPH_SEPARATOR,"g"),"\\u2029")}const BOOTSTRAP_FUNCTIONS=[applyStoredStyleBeforePaint,applyStoredThemeBeforePaint,styleTokenAllowed,readStyleOwnership,resolveStyleStartup,styleMaterial];function bootstrapParts(options){const storageKey=options.storageKey??STORAGE_KEY,inputs=STYLE_SLOTTED.map(name=>`${Number(STYLE_DENSITY.includes(name))|Number(STYLE_FOLLOW.includes(name))<<1|Number(ALL_RAMP_PROPERTIES.includes(name))<<2}${name.slice(11)}`).join(" "),model=JSON.stringify({restore:options.restore==="mode"?"mode":"all",defaults:STYLE_DEFAULTS,inputs,surfaces:STYLE_REFERENCE_SURFACES,contrast:STYLE_CONTRAST_SURFACES,accent:STYLE_GEMSTONES});return{storageKey,model}}function createLyraThemeBootstrap(options={}){const{storageKey,model}=bootstrapParts(options),functions=BOOTSTRAP_FUNCTIONS.map(helper=>helper.toString().replace(/^function\s+[\w$]+/,"function"));return`(${functions[0]})(${serializeInlineScriptData(storageKey)},${serializeInlineScriptData(MODE_ATTRIBUTES)},${functions.slice(1).join(",")},${model});`}const STYLE_DEFAULTS=Object.freeze({look:"shadcn",surface:"glass",density:"comfortable",mode:"system",accent:"emerald"}),STYLE_SLOTTED=["--lr-theme-color-border-strong","--lr-theme-color-brand-border-loud","--lr-theme-color-brand-border-normal","--lr-theme-color-brand-border-quiet","--lr-theme-color-brand-fill-loud","--lr-theme-color-brand-fill-normal","--lr-theme-color-brand-fill-quiet","--lr-theme-color-brand-on-loud","--lr-theme-color-brand-on-normal","--lr-theme-color-brand-on-quiet","--lr-theme-color-chart-1","--lr-theme-color-chart-2","--lr-theme-color-chart-3","--lr-theme-color-chart-4","--lr-theme-color-chart-5","--lr-theme-color-chart-6","--lr-theme-color-chart-7","--lr-theme-color-chart-8","--lr-theme-color-chart-diverging-1","--lr-theme-color-chart-diverging-2","--lr-theme-color-chart-diverging-3","--lr-theme-color-chart-sequential-1","--lr-theme-color-chart-sequential-2","--lr-theme-color-chart-sequential-3","--lr-theme-color-danger-border-loud","--lr-theme-color-danger-border-normal","--lr-theme-color-danger-border-quiet","--lr-theme-color-danger-fill-loud","--lr-theme-color-danger-fill-normal","--lr-theme-color-danger-fill-quiet","--lr-theme-color-danger-on-loud","--lr-theme-color-danger-on-normal","--lr-theme-color-danger-on-quiet","--lr-theme-color-focus","--lr-theme-color-mix-partner","--lr-theme-color-neutral-border-loud","--lr-theme-color-neutral-border-normal","--lr-theme-color-neutral-border-quiet","--lr-theme-color-neutral-fill-loud","--lr-theme-color-neutral-fill-normal","--lr-theme-color-neutral-fill-quiet","--lr-theme-color-neutral-on-loud","--lr-theme-color-neutral-on-normal","--lr-theme-color-neutral-on-quiet","--lr-theme-color-no-data","--lr-theme-color-on-strong-overlay","--lr-theme-color-overlay","--lr-theme-color-overlay-strong","--lr-theme-color-success-border-loud","--lr-theme-color-success-border-normal","--lr-theme-color-success-border-quiet","--lr-theme-color-success-fill-loud","--lr-theme-color-success-fill-normal","--lr-theme-color-success-fill-quiet","--lr-theme-color-success-on-loud","--lr-theme-color-success-on-normal","--lr-theme-color-success-on-quiet","--lr-theme-color-surface-border","--lr-theme-color-surface-border-subtle","--lr-theme-color-surface-container","--lr-theme-color-surface-container-high","--lr-theme-color-surface-container-highest","--lr-theme-color-surface-container-low","--lr-theme-color-surface-container-lowest","--lr-theme-color-surface-default","--lr-theme-color-surface-overlay","--lr-theme-color-surface-raised","--lr-theme-color-text-normal","--lr-theme-color-text-quiet","--lr-theme-color-warning-border-loud","--lr-theme-color-warning-border-normal","--lr-theme-color-warning-border-quiet","--lr-theme-color-warning-fill-loud","--lr-theme-color-warning-fill-normal","--lr-theme-color-warning-fill-quiet","--lr-theme-color-warning-on-loud","--lr-theme-color-warning-on-normal","--lr-theme-color-warning-on-quiet","--lr-theme-form-control-height-2xs","--lr-theme-form-control-height-l","--lr-theme-form-control-height-m","--lr-theme-form-control-height-s","--lr-theme-form-control-height-xl","--lr-theme-form-control-height-xs","--lr-theme-graph-cat-1","--lr-theme-graph-cat-2","--lr-theme-graph-cat-3","--lr-theme-graph-cat-4","--lr-theme-graph-cat-5","--lr-theme-graph-cat-6","--lr-theme-graph-cat-7","--lr-theme-graph-cat-8","--lr-theme-icon-button-size","--lr-theme-shadow-l","--lr-theme-shadow-m","--lr-theme-shadow-s","--lr-theme-shadow-xl","--lr-theme-shadow-xs","--lr-theme-space-2xl","--lr-theme-space-2xs","--lr-theme-space-l","--lr-theme-space-m","--lr-theme-space-s","--lr-theme-space-xs","--lr-theme-terminal-bg-black","--lr-theme-terminal-bg-blue","--lr-theme-terminal-bg-bright-black","--lr-theme-terminal-bg-bright-blue","--lr-theme-terminal-bg-bright-cyan","--lr-theme-terminal-bg-bright-green","--lr-theme-terminal-bg-bright-magenta","--lr-theme-terminal-bg-bright-red","--lr-theme-terminal-bg-bright-white","--lr-theme-terminal-bg-bright-yellow","--lr-theme-terminal-bg-cyan","--lr-theme-terminal-bg-green","--lr-theme-terminal-bg-magenta","--lr-theme-terminal-bg-red","--lr-theme-terminal-bg-white","--lr-theme-terminal-bg-yellow","--lr-theme-terminal-color-black","--lr-theme-terminal-color-blue","--lr-theme-terminal-color-bright-black","--lr-theme-terminal-color-bright-blue","--lr-theme-terminal-color-bright-cyan","--lr-theme-terminal-color-bright-green","--lr-theme-terminal-color-bright-magenta","--lr-theme-terminal-color-bright-red","--lr-theme-terminal-color-bright-white","--lr-theme-terminal-color-bright-yellow","--lr-theme-terminal-color-cyan","--lr-theme-terminal-color-green","--lr-theme-terminal-color-magenta","--lr-theme-terminal-color-red","--lr-theme-terminal-color-white","--lr-theme-terminal-color-yellow"],STYLE_DENSITY=["--lr-theme-space-2xs","--lr-theme-space-xs","--lr-theme-space-s","--lr-theme-space-m","--lr-theme-space-l","--lr-theme-space-2xl","--lr-theme-form-control-height-2xs","--lr-theme-form-control-height-xs","--lr-theme-form-control-height-s","--lr-theme-form-control-height-m","--lr-theme-form-control-height-l","--lr-theme-form-control-height-xl","--lr-theme-icon-button-size"],STYLE_FOLLOW=["--lr-theme-color-danger-border-loud","--lr-theme-color-danger-border-normal","--lr-theme-color-danger-border-quiet","--lr-theme-color-danger-fill-loud","--lr-theme-color-danger-fill-normal","--lr-theme-color-danger-fill-quiet","--lr-theme-color-danger-on-loud","--lr-theme-color-danger-on-normal","--lr-theme-color-danger-on-quiet","--lr-theme-color-neutral-border-loud","--lr-theme-color-neutral-border-normal","--lr-theme-color-neutral-border-quiet","--lr-theme-color-neutral-fill-loud","--lr-theme-color-neutral-fill-normal","--lr-theme-color-neutral-fill-quiet","--lr-theme-color-neutral-on-loud","--lr-theme-color-neutral-on-normal","--lr-theme-color-neutral-on-quiet","--lr-theme-color-success-border-loud","--lr-theme-color-success-border-normal","--lr-theme-color-success-border-quiet","--lr-theme-color-success-fill-loud","--lr-theme-color-success-fill-normal","--lr-theme-color-success-fill-quiet","--lr-theme-color-success-on-loud","--lr-theme-color-success-on-normal","--lr-theme-color-success-on-quiet","--lr-theme-color-warning-border-loud","--lr-theme-color-warning-border-normal","--lr-theme-color-warning-border-quiet","--lr-theme-color-warning-fill-loud","--lr-theme-color-warning-fill-normal","--lr-theme-color-warning-fill-quiet","--lr-theme-color-warning-on-loud","--lr-theme-color-warning-on-normal","--lr-theme-color-warning-on-quiet"],STYLE_REFERENCE_SURFACES={lyra:{light:["#ffffff","#f6f8fa","#1a1a1a","rgb(0 0 0 / 0.92)"],dark:["#1a1a1a","#22272e","#f2f2f2","rgb(0 0 0 / 0.95)"]},data:{light:["#ffffff","#f2f5f8","#10202c","#17212b"],dark:["#101820","#192630","#eef5fa","#e7eef4"]},"high-contrast":{light:["#ffffff","#ffffff","#000000","#17212b"],dark:["#000000","#000000","#ffffff","#e7eef4"]},material:{light:["#fff8f5","#f8eeea","#241b17","rgb(0 0 0 / 0.92)"],dark:["#18120f","#251d19","#f8eee8","rgb(0 0 0 / 0.95)"]},shadcn:{light:["#ffffff","#fafafa","#0a0a0a","rgb(0 0 0 / 0.92)"],dark:["#0a0a0a","#171717","#fafafa","rgb(0 0 0 / 0.95)"]},terminal:{light:["#fcfdf9","#f1f5eb","#0d2115","#17212b"],dark:["#0e1713","#18271e","#e5f5e9","#e7eef4"]}},STYLE_CONTRAST_SURFACES={light:["#ffffff","#f6f8fa","#f2f5f8","#fff8f5","#f8eeea","#fcf2ed","#f2e7e0","#ecdfd7","#fafafa","#fcfdf9","#f1f5eb"],dark:["#1a1a1a","#22272e","#2b3038","#101820","#192630","#202e39","#000000","#18120f","#251d19","#302621","#120d0a","#211914","#352a24","#0a0a0a","#171717","#0e1713","#18271e","#203227"]},STYLE_GEMSTONES={emerald:"#34d399",peridot:"#a8d84a",topaz:"#f0a83c",ruby:"#e63950",tourmaline:"#ec4899",amethyst:"#9d6df0",aquamarine:"#22d3ee",sapphire:"#4f8ff7",hematite:"#94a3b8"},LOOK_ID=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,LOOK_STAMP=Symbol.for("@aceshooting/lyra-ui.look.v1"),STYLE_OWNERSHIP=Symbol.for("@aceshooting/lyra-ui.style-ownership.v1"),STYLE_FIELDS=["look","surface","density","mode","accent","accentBackground","overrides"],DEFAULT_STYLE=Object.freeze({...STYLE_DEFAULTS,tokens:null,accent:STYLE_GEMSTONES[STYLE_DEFAULTS.accent],accentName:STYLE_DEFAULTS.accent,accentBackground:null,overrides:null});let lastStyle={...DEFAULT_STYLE},stylePersistenceFailed=!1,styleModeCleanup,styleModeRoot;const styleOwnershipFallback=new WeakMap,scopeModes=new WeakMap;function ownField(value,key){const descriptor=Object.getOwnPropertyDescriptor(value,key);return descriptor&&"value"in descriptor?descriptor.value:void 0}function styleId(value){return typeof value=="string"&&value.length<=64&&LOOK_ID.test(value)}function styleTokenAllowed(e,r,o=STYLE_SLOTTED){if(e.startsWith("--lr-theme-surface-")||typeof r!="string"&&!o.includes(e))return!1;for(const t of typeof r=="string"?[r]:[r.light,r.dark])if(t)for(const c of t.matchAll(/var\(\s*(--[\w-]+)/g)){if(c[1]==="--lr-theme-shadow-color")continue;const n=e.match(/^--lr-theme-color-(?:success|warning|danger|neutral)-((?:fill|border|on)-(?:quiet|normal|loud))$/)?.[1];if(!n||t!==`var(--lr-theme-color-brand-${n})`)return!1}return!0}function styleTokens(value){const tokens=normalizeTokens(value);if(!tokens)return null;const entries=Object.entries(tokens).filter(([name,input])=>styleTokenAllowed(name,input));return entries.length?Object.freeze(Object.fromEntries(entries)):null}function defineLyraLook(look){if(!look||!styleId(ownField(look,"id"))||look.id==="custom")throw new TypeError("Invalid look id");const raw=ownField(look,"tokens");if(!isPlainRecord(raw)||Object.keys(raw).length>TOKEN_ENTRY_MAX)throw new TypeError("Invalid look tokens");for(const[name,descriptor]of Object.entries(Object.getOwnPropertyDescriptors(raw))){if(!("value"in descriptor))throw new TypeError(`Look inputs must be data properties: ${name}`);const value=descriptor.value;if(typeof value=="string"){if(!isSafeLyraThemeTokenValue(value))throw new TypeError(`Invalid look value: ${name}`);continue}if(!isPlainRecord(value)||!STYLE_SLOTTED.includes(name))throw new TypeError(`Invalid per-mode look input: ${name}`);const branches=Object.entries(Object.getOwnPropertyDescriptors(value));if(!branches.length||branches.some(([key,branch])=>!["light","dark"].includes(key)||!("value"in branch)||branch.value!==null&&!isSafeLyraThemeTokenValue(branch.value)))throw new TypeError(`Invalid look mode pair: ${name}`)}const tokens=styleTokens(raw);if(Object.keys(raw).length!==Object.keys(tokens??{}).length)throw new TypeError("Invalid look token or cross-axis reference");const stamped={...tokens,[LOOK_STAMP]:look.id};return Object.freeze(stamped),Object.freeze({id:look.id,tokens:stamped})}function styleColor(value,browserColors=!1){if(!isSafeLyraThemeTokenValue(value))return null;const text=value.trim();return/\b(?:var|light-dark)\s*\(|\b(?:currentcolor|from)\b/i.test(text)||/^(?:accentcolor|accentcolortext|activetext|buttonborder|buttonface|buttontext|canvas|canvastext|field|fieldtext|graytext|highlight|highlighttext|linktext|mark|marktext|selecteditem|selecteditemtext|visitedtext)$/i.test(text)?null:browserColors&&typeof CSS<"u"?CSS.supports("color",text)?text:null:/^(?:#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})|[a-z]+|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix)\(.+\))$/i.test(text)?text:null}function styleColorPair(value){if(typeof value=="string")return styleColor(value);if(!isPlainRecord(value))return null;const light=styleColor(ownField(value,"light")),dark=styleColor(ownField(value,"dark"));return light||dark?Object.freeze({light,dark}):null}function styleAccent(value){if(typeof value=="string")return styleColor(value);if(!isPlainRecord(value))return null;const entries=SEMANTIC_ROLES.filter(role=>Object.hasOwn(value,role)).map(role=>[role,styleColorPair(ownField(value,role))]);return entries.length?Object.freeze(Object.fromEntries(entries)):null}function normalizeStyleChoices(raw,base){const next={...base};if(!isPlainRecord(raw))return next;const look=ownField(raw,"look");if(look!==void 0){if(next.look=DEFAULT_STYLE.look,next.tokens=null,styleId(look))next.look=look;else if(isPlainRecord(look))try{const definition=defineLyraLook(look);next.look=definition.id,next.tokens=definition.tokens}catch{}}const surface=ownField(raw,"surface");surface!==void 0&&(next.surface=surface==="glass"||surface==="solid"?surface:DEFAULT_STYLE.surface);const density=ownField(raw,"density");density!==void 0&&(next.density=density==="comfortable"||density==="compact"||density==="touch"?density:DEFAULT_STYLE.density);const mode=ownField(raw,"mode");mode!==void 0&&(next.mode=mode==="light"||mode==="dark"||mode==="system"||mode==="unset"?mode:DEFAULT_STYLE.mode);const accent=ownField(raw,"accent");accent!==void 0&&(next.accentName=typeof accent=="string"&&Object.hasOwn(STYLE_GEMSTONES,accent)?accent:null,next.accent=next.accentName?STYLE_GEMSTONES[next.accentName]:styleAccent(accent));const background=ownField(raw,"accentBackground");background!==void 0&&(next.accentBackground=styleColorPair(background));const overrides=ownField(raw,"overrides");return overrides!==void 0&&(next.overrides=styleTokens(overrides)),next}function styleFromRecord(value,browserColors=!1){const record=resolveStyleStartup(value,STYLE_DEFAULTS,normalizeTokens,input=>styleColor(input,browserColors)??void 0,styleTokenAllowed,STYLE_GEMSTONES),state=normalizeStyleChoices({look:ownField(record,"look"),mode:ownField(record,"mode"),density:ownField(record,"density"),surface:ownField(record,"treatment"),overrides:ownField(record,"overrides"),accentBackground:ownField(record,"surface")},{...DEFAULT_STYLE});state.accent=styleAccent(ownField(record,"accent"));const accentName=ownField(record,"accentName");return state.accentName=null,typeof accentName=="string"&&Object.hasOwn(STYLE_GEMSTONES,accentName)&&(state.accentName=accentName,state.accent=STYLE_GEMSTONES[accentName]),state.tokens=normalizeTokens(ownField(record,"tokens")),state.tokens&&!styleId(ownField(record,"look"))&&(state.look="custom"),state}function styleRecord(state){return{version:2,mode:state.mode,look:state.look,density:state.density,treatment:state.surface,accent:state.accent,surface:state.accentBackground,...state.accentName?{accentName:state.accentName}:{},...state.tokens?{tokens:state.tokens}:{},...state.overrides?{overrides:state.overrides}:{}}}function styleResolvedMode(mode,view){return mode==="unset"?null:mode!=="system"?mode:view?.matchMedia?.(COLOR_SCHEME_QUERY).matches?"dark":"light"}function styleSnapshot(state,view){return Object.freeze({look:state.look,lookForm:state.tokens?"runtime":"stylesheet",surface:state.surface,density:state.density,mode:state.mode,accent:state.accentName??state.accent,accentName:state.accentName,accentBackground:state.accentBackground,...state.overrides?{overrides:state.overrides}:{},resolvedMode:styleResolvedMode(state.mode,view)})}function parseLyraStyleRecord(value){const state=styleFromRecord(value),result=styleSnapshot(state);return state.mode==="system"?Object.freeze({...result,resolvedMode:null}):result}function lyraStyleAttributes(style){const attributes={};return styleId(style.look)&&(attributes["data-lr-look"]=style.look),(style.surface==="solid"||style.surface==="glass")&&(attributes["data-lr-surface"]=style.surface),(style.density==="compact"||style.density==="comfortable"||style.density==="touch")&&(attributes["data-lr-density"]=style.density),(style.mode==="light"||style.mode==="dark"||style.mode==="system")&&(attributes["data-lr-mode"]=style.mode),style.accent!==void 0&&(attributes["data-lr-accent"]=style.accent===null?"none":style.accentName===null?"custom":typeof style.accent=="string"&&Object.hasOwn(STYLE_GEMSTONES,style.accent)?style.accent:"custom"),Object.freeze(attributes)}function readStyleState(){if(stylePersistenceFailed)return{...lastStyle};let stored;try{stored=localStorage.getItem(STORAGE_KEY)}catch{return{...lastStyle}}try{return styleFromRecord(JSON.parse(stored??"null"),!0)}catch{return{...DEFAULT_STYLE}}}function persistStyle(state){try{localStorage.setItem(STORAGE_KEY,JSON.stringify(styleRecord(state))),stylePersistenceFailed=!1}catch{stylePersistenceFailed=!0}lastStyle=state}function ownershipFor(element){const node=element;try{const existing=readStyleOwnership(node[STYLE_OWNERSHIP]);if(existing){styleOwnershipFallback.set(element,existing);try{node[STYLE_OWNERSHIP]=existing}catch{}return existing}}catch{}const fallback=styleOwnershipFallback.get(element);if(fallback)return fallback;const record={attributes:new Map,properties:new Map};styleOwnershipFallback.set(element,record);try{node[STYLE_OWNERSHIP]=record}catch{}return record}function writeStyleAttributes(element,desired){const ownership=ownershipFor(element).attributes;for(const[name,value]of ownership)Object.hasOwn(desired,name)||(element.getAttribute(name)===value.written&&(value.before===null?element.removeAttribute(name):element.setAttribute(name,value.before)),ownership.delete(name));for(const[name,value]of Object.entries(desired))ownership.has(name)||ownership.set(name,{before:element.getAttribute(name),priority:"",written:value}),element.getAttribute(name)!==value&&element.setAttribute(name,value),ownership.get(name).written=value}function writeStyleProperties(element,desired){const style=element.style;if(!style)return;const ownership=ownershipFor(element).properties;for(const[name,value]of ownership)desired.has(name)||(style.getPropertyValue(name)===value.written&&style.getPropertyPriority(name)===""&&(value.before?style.setProperty(name,value.before,value.priority):style.removeProperty(name)),ownership.delete(name));for(const[name,value]of desired){ownership.has(name)||ownership.set(name,{before:style.getPropertyValue(name),priority:style.getPropertyPriority(name),written:null});const record=ownership.get(name);(style.getPropertyPriority(name)!==""||style.getPropertyValue(name)!==value&&!(record.requested===value&&record.written===style.getPropertyValue(name)))&&(style.getPropertyPriority(name)&&style.removeProperty(name),style.setProperty(name,value,"")),record.requested=value,record.written=style.getPropertyValue(name)}}function styleSlot(name,mode,accent=!1){return`--_lr-${accent?"a":"l"}${mode==="light"?"l":"d"}-${name.slice(11)}`}function styleFollow(name,value){const channel=name.match(/^--lr-theme-color-(?:success|warning|danger|neutral)-((?:fill|border|on)-(?:quiet|normal|loud))$/)?.[1];return!!(channel&&value===`var(--lr-theme-color-brand-${channel})`)}function styleBranch(name,mode){let result=`var(${styleSlot(name,mode)})`;if(STYLE_FOLLOW.includes(name)){const key=mode==="light"?"l":"d",target=name.replace(/color-(?:success|warning|danger|neutral)-/,"color-brand-");result=`var(--_lr-f${key}-${name.slice(11)},${result})var(--_lr-o${key}-${name.slice(11)},var(${styleSlot(target,mode,!0)},var(${styleSlot(target,mode)})))`}return ALL_RAMP_PROPERTIES.includes(name)?`var(${styleSlot(name,mode,!0)},${result})`:result}function styleResolvedInput(name){const input=`var(--_lr-dark-on,${styleBranch(name,"light")})var(--_lr-light-on,${styleBranch(name,"dark")})`;if(!STYLE_DENSITY.includes(name))return input;const spacing=name.startsWith("--lr-theme-space-");return`var(--_lr-dense-on,${input})var(--_lr-dense-off,max(calc((${input}) * var(--_lr-density-${spacing?"space":"control"},1)),${spacing?"0px":"var(--_lr-density-target-min,0px)"}))`}function styleReferences(state,entries,mode,element,previous){const look=element.closest("[data-lr-look]")?.getAttribute("data-lr-look")??STYLE_DEFAULTS.look,colors=(Object.hasOwn(STYLE_REFERENCE_SURFACES,look)?STYLE_REFERENCE_SURFACES[look]:STYLE_REFERENCE_SURFACES.lyra)[mode],names=["color-surface-default","color-surface-raised","color-text-normal","color-overlay-strong"].slice(0,entries.size?4:1).map(suffix=>`--lr-theme-${suffix}`),supplied=names.map(name=>entries.get(name)),background=typeof state.accentBackground=="string"?state.accentBackground:state.accentBackground?.[mode],style=element.style,ownership=ownershipFor(element).properties,projected=names.flatMap((name,index)=>{const slot=styleSlot(name,mode),owned=ownership.get(slot),before=style?.getPropertyValue(slot)??"",priority=style?.getPropertyPriority(slot)??"",owns=owned&&before===owned.written&&!priority;if(supplied[index]!==void 0&&previous?.[index]===supplied[index]&&owns)return[];if(supplied[index]===void 0&&!owns)return[];const value=supplied[index]??owned?.before??"",nextPriority=supplied[index]===void 0?owned?.priority??"":"";return before===value&&priority===nextPriority?[]:[{slot,before,priority,value,nextPriority}]});try{for(const{slot,value,nextPriority}of projected)style.getPropertyPriority(slot)&&style.removeProperty(slot),value?style.setProperty(slot,value,nextPriority):style.removeProperty(slot);const computed=element.ownerDocument.defaultView?.getComputedStyle(element);return{supplied,colors:names.map((name,index)=>(index===0?background:void 0)??supplied[index]??(computed?.getPropertyValue(styleSlot(name,mode)).trim()||colors[index]))}}finally{for(const{slot,before,priority}of projected)style.getPropertyPriority(slot)&&style.removeProperty(slot),before?style.setProperty(slot,before,priority):style.removeProperty(slot)}}const stylePaintCache=new WeakMap;function stylePaint(state,element,wholeDocument){const desired=new Map,mode=styleResolvedMode(state.mode,element.ownerDocument.defaultView),tokens={...state.tokens,...state.overrides};if(wholeDocument&&mode===null)for(const[name,value]of tokenEntries(tokens,null))desired.set(name,value);if(!Object.keys(tokens).length&&(!state.accent||state.accentName))return stylePaintCache.delete(element),desired;const resolver=element.ownerDocument.defaultView?.getComputedStyle(element).getPropertyValue("--_lr-style-resolver").trim()==="1";let cache=stylePaintCache.get(element);cache||(cache=new Map,stylePaintCache.set(element,cache));let applied=state.accent;for(const branch of["light","dark"]){const entries=tokenEntries(tokens,branch),{colors:references,supplied}=styleReferences(state,entries,branch,element,cache.get(branch)?.supplied),reference=references[0],key=JSON.stringify([tokens,state.accent,state.accentName,references]);let cached=cache.get(branch);if(!cached||cached.key!==key){const background=reference?parseResolvedRgb(reference,MODE_SURFACES[branch],element.ownerDocument)??MODE_SURFACES[branch]:MODE_SURFACES[branch],accent=state.accentName?{applied:state.accent,properties:new Map}:paintAccent(state.accent,branch,background,element.ownerDocument);cached={key,supplied,tokens:floorTokenEntries(entries,background,element.ownerDocument,references),accent:accent.properties,applied:accent.applied},cache.set(branch,cached)}branch===mode&&(applied=cached.applied);const painted=cached.tokens;for(const[name,value]of painted)STYLE_SLOTTED.includes(name)&&styleTokenAllowed(name,value)?(styleFollow(name,value)?(desired.set(`--_lr-f${branch==="light"?"l":"d"}-${name.slice(11)}`," "),desired.set(`--_lr-o${branch==="light"?"l":"d"}-${name.slice(11)}`,"initial")):(desired.set(styleSlot(name,branch),value),STYLE_FOLLOW.includes(name)&&(desired.set(`--_lr-f${branch==="light"?"l":"d"}-${name.slice(11)}`,"initial"),desired.set(`--_lr-o${branch==="light"?"l":"d"}-${name.slice(11)}`," "))),wholeDocument&&branch===mode&&desired.set(name,resolver?styleResolvedInput(name):value)):(wholeDocument?branch===mode:typeof tokens[name]=="string"&&!STYLE_SLOTTED.includes(name))&&desired.set(name,value);if(state.accent&&!state.accentName)for(const[name,value]of cached.accent){if(name==="--lr-theme-accent"){branch===mode&&desired.set(name,value);continue}desired.set(styleSlot(name,branch,!0),value),wholeDocument&&branch===mode&&desired.set(name,resolver?styleResolvedInput(name):value)}}return state.accent=applied,desired}const styleModeGroups=new WeakMap;function attachStyleMode(element,callback){const view=element.ownerDocument.defaultView;if(!view?.matchMedia)return()=>{};let group=styleModeGroups.get(view);if(!group){const query=view.matchMedia(COLOR_SCHEME_QUERY),subscriptions=new Set,modern=typeof query.addEventListener=="function"&&typeof query.removeEventListener=="function",detach=()=>{modern?query.removeEventListener("change",listener):query.removeListener?.(listener)},listener=()=>{for(const subscription2 of subscriptions){const node=subscription2.element.deref();node?.ownerDocument.defaultView===view?subscription2.callback(node):subscriptions.delete(subscription2)}subscriptions.size||(detach(),styleModeGroups.delete(view))};group={query,subscriptions,detach},styleModeGroups.set(view,group),modern?query.addEventListener("change",listener):query.addListener?.(listener)}const subscription={element:new WeakRef(element),callback};group.subscriptions.add(subscription);const active=group;return()=>{active.subscriptions.delete(subscription),active.subscriptions.size||(active.detach(),styleModeGroups.delete(view))}}function applyStyleState(element,state,fields){const snapshot=styleSnapshot(state,element.ownerDocument.defaultView),attributes={...lyraStyleAttributes(snapshot)};if(fields)for(const[field,name]of[["look","look"],["surface","surface"],["density","density"],["mode","mode"],["accent","accent"]])fields.has(field)||delete attributes[`data-lr-${name}`];state.accent&&!state.accentName&&(!fields||fields.has("accent"))&&(attributes["data-lr-accent"]="custom"),(!fields||fields.has("mode"))&&snapshot.resolvedMode&&(attributes["data-lr-theme"]=snapshot.resolvedMode,attributes["data-theme"]=snapshot.resolvedMode),(state.tokens||state.overrides||state.accent&&!state.accentName)&&(attributes["data-lr-theme-scope"]=""),writeStyleAttributes(element,attributes);const desired=stylePaint(state,element,!fields);(!fields||fields.has("surface"))&&element.ownerDocument.defaultView?.getComputedStyle(element).getPropertyValue("--_lr-style-resolver").trim()!=="1"&&styleMaterial(desired,state.surface),!state.accent&&snapshot.accent&&(attributes["data-lr-accent"]="none",!state.tokens&&!state.overrides&&delete attributes["data-lr-theme-scope"],writeStyleAttributes(element,attributes)),writeStyleProperties(element,desired),adoptTokenLayerForScope(element),diagnoseStyleSheets(element,state,fields)}function adoptTokenLayerForScope(element){const root=element.getRootNode();if(root===element.ownerDocument||root.nodeType!==11)return;const adopt=globalThis[Symbol.for("@aceshooting/lyra-ui.adopt-lyra-tokens.v1")];typeof adopt=="function"&&adopt(root)}function diagnoseStyleSheets(element,state,fields){if(!litDevWarnings())return;const selected=field=>!fields||fields.has(field),required=[];selected("look")&&!state.tokens&&state.look!=="lyra"&&state.look!==DEFAULT_STYLE.look&&required.push(["--_lr-look-installed",`${state.look}-1`,`the stylesheet for look '${state.look}'`]),selected("surface")&&state.surface==="glass"&&state.surface!==DEFAULT_STYLE.surface&&required.push(["--_lr-surface-installed","1","surfaces/glass.css"]),selected("density")&&state.density!=="comfortable"&&required.push(["--_lr-density-installed","1","density.css"]),selected("accent")&&state.accentName&&state.accentName!==DEFAULT_STYLE.accentName&&required.push(["--_lr-accent-installed",`${state.accentName}-1`,"accents.css"]);const scopedRuntime=!!(fields&&(state.tokens||state.overrides||state.accent&&!state.accentName)),alternateProfile=selected("look")&&!state.tokens&&state.look!==DEFAULT_STYLE.look||selected("accent")&&!state.accent;if(!required.length&&!scopedRuntime&&!alternateProfile)return;const computed=element.ownerDocument.defaultView?.getComputedStyle(element);if(computed){computed.getPropertyValue("--_lr-style-resolver").trim()!=="1"&&devWarnOnce("lyra-style:resolver","Lyra style choices require theme.css in the scope that owns their attributes.");for(const[property,expected,stylesheet]of required)computed.getPropertyValue(property).trim()!==expected&&devWarnOnce(`lyra-style:${property}:${expected}`,`Lyra could not find ${stylesheet} in this style scope; import or adopt the stylesheet before selecting it.`)}}function emitStyleChange(state,changed){const style=styleSnapshot(state,window);window.dispatchEvent(new CustomEvent("lr-style-change",{detail:Object.freeze({style,changed:Object.freeze([...changed])})}))}function setLyraStyle(choices){const before=readStyleState();return commitStyle(before,normalizeStyleChoices(choices,before))}function commitStyle(before,next){if(typeof document<"u"&&(next.accent=normalizeAccent(next.accent),typeof next.accentBackground=="string"&&(next.accentBackground=normalizeColor(next.accentBackground)),next.accent||(next.accentName=null)),persistStyle(next),typeof document<"u"){applyRootStyle(next)&&persistStyle(next);const changed=STYLE_FIELDS.filter(field=>field==="look"?before.look!==next.look||!tokensEqual(before.tokens,next.tokens):field==="accent"?before.accentName!==next.accentName||!accentsEqual(before.accent,next.accent):JSON.stringify(before[field])!==JSON.stringify(next[field]));emitStyleChange(next,changed)}return styleSnapshot(next,typeof window>"u"?void 0:window)}function applyRootStyle(next){const root=document.documentElement;(next.mode!=="system"||styleModeRoot?.deref()!==root)&&(styleModeCleanup?.(),styleModeCleanup=void 0,styleModeRoot=void 0),adoptLegacyOwnership(root);const requestedAccent=next.accent;return applyStyleState(root,next),next.mode==="system"&&!styleModeCleanup&&(styleModeRoot=new WeakRef(root),styleModeCleanup=attachStyleMode(root,element=>{applyStyleState(element,lastStyle),emitStyleChange(lastStyle,["resolvedMode"])})),!accentsEqual(requestedAccent,next.accent)}function adoptLegacyOwnership(root){const symbol=Symbol.for(TOKEN_OWNERSHIP_SYMBOL),node=root;try{if(!Array.isArray(node[symbol]))return}catch{return}const ownership=ownershipFor(root).properties;for(const name of[...readOwnershipList(),...ALL_RAMP_PROPERTIES,"--lr-theme-accent"])ownership.has(name)||!root.style.getPropertyValue(name)||ownership.set(name,{before:null,priority:"",written:root.style.getPropertyValue(name)});try{delete node[symbol]}catch{}}function getLyraStyle(){return styleSnapshot(readStyleState(),typeof window>"u"?void 0:window)}function startLyraStyle(){const state=readStyleState();return typeof document>"u"?styleSnapshot(state):(state.accent=normalizeAccent(state.accent),typeof state.accentBackground=="string"&&(state.accentBackground=normalizeColor(state.accentBackground)),state.accent||(state.accentName=null),lastStyle=state,applyRootStyle(state),styleSnapshot(state,window))}function resetLyraStyle(fields=STYLE_FIELDS){const defaults={...STYLE_DEFAULTS,accentBackground:null,overrides:null};return setLyraStyle(Object.fromEntries(fields.filter(field=>STYLE_FIELDS.includes(field)).map(field=>[field,defaults[field]])))}function applyLyraStyleScope(element,choices){if(scopeModes.get(element)?.(),scopeModes.delete(element),choices===null){writeStyleAttributes(element,{}),writeStyleProperties(element,new Map);return}const state=normalizeStyleChoices(choices,{...DEFAULT_STYLE}),fields=new Set(STYLE_FIELDS.filter(field=>ownField(choices,field)!==void 0));applyStyleState(element,state,fields),choices.mode==="system"&&scopeModes.set(element,attachStyleMode(element,node=>applyStyleState(node,state,fields)))}const lyraThemeBootstrap=/* @__PURE__ */createLyraThemeBootstrap();export{accentsEqual,applyLyraStyleScope,createLyraThemeBootstrap,defineLyraLook,getLyraStyle,isLyraThemeTokenName,isSafeLyraThemeTokenValue,lyraStyleAttributes,lyraThemeBootstrap,parseLyraStyleRecord,resetLyraStyle,setLyraStyle,startLyraStyle,tokensEqual};