reactive-md 0.8.0 → 0.9.1

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 (441) hide show
  1. package/CHANGELOG-ch.md +54 -4
  2. package/CHANGELOG.md +55 -4
  3. package/CONTRIBUTING-ch.md +13 -2
  4. package/CONTRIBUTING.md +13 -2
  5. package/README-ch.md +132 -23
  6. package/README-en.md +130 -21
  7. package/README.md +128 -21
  8. package/SECURITY-ch.md +3 -3
  9. package/SECURITY.md +3 -3
  10. package/THIRD_PARTY_NOTICES.md +111 -1
  11. package/cli/args.mjs +51 -1
  12. package/cli/assets.mjs +6 -1
  13. package/cli/build.mjs +125 -9
  14. package/cli/fs-utils.mjs +3 -3
  15. package/cli/help.mjs +12 -5
  16. package/cli/init.mjs +1 -1
  17. package/cli/package.mjs +1 -0
  18. package/dist-library/LocalDocumentView-sthUP0ct.js +109 -0
  19. package/dist-library/LocalDocumentViewCore-GiWV3bey.js +9829 -0
  20. package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +275 -0
  21. package/dist-library/{authoring-BsfSwQRm.js → authoring-Dsune4Hy.js} +240 -218
  22. package/dist-library/compile-wUv8KEge.js +1249 -0
  23. package/dist-library/{compiler-core-kPiH-gOV.js → compiler-core-As_m-MNm.js} +5372 -5559
  24. package/dist-library/compiler-eOfcinZs.js +62 -0
  25. package/dist-library/component-state-BoLCGee4.js +801 -0
  26. package/dist-library/{component-state-D_cw_EHe.js → component-state-C52ZFJGl.js} +2 -2
  27. package/dist-library/{registry-B9Jc3FVe.js → config-BadfhjdP.js} +374 -457
  28. package/dist-library/{config-validation-DXTynAw7.js → config-validation-F47AcE6o.js} +549 -751
  29. package/dist-library/controls-CcT6n7k_.js +6740 -0
  30. package/dist-library/coordinate-CWS9p5q_.js +293 -0
  31. package/dist-library/data-table-Bgccxd7h.js +296 -0
  32. package/dist-library/{default-components-Z_YMio5P.js → default-components-BwQf0oP-.js} +344 -334
  33. package/dist-library/{math-display-BJz4gbFc.js → display-B-VhqVND.js} +1299 -1299
  34. package/dist-library/export-BqVmTXm8.js +369 -0
  35. package/dist-library/gallery-CY6mTx8i.js +360 -0
  36. package/dist-library/html-CNT4KD-2.js +757 -0
  37. package/dist-library/{math-sample-BGEW49zY.js → incremental-Dv0FSp_U.js} +476 -394
  38. package/dist-library/latex-1w7aQgD5.js +928 -0
  39. package/dist-library/layout-C0YlEPGr.js +562 -0
  40. package/dist-library/mount-preset-KxvtKgJb.js +13 -0
  41. package/dist-library/options-1aDLK7JY.js +121 -0
  42. package/dist-library/{react-ByOHunUW.js → package-core-WFK1RhAZ.js} +49 -55
  43. package/dist-library/{parser-standard-DlCk7sLo.js → parser-standard-Yuf3A_VI.js} +6605 -7097
  44. package/dist-library/plugin-packs-B1XPWcFs.js +18 -0
  45. package/dist-library/{identity-MYJXKSkB.js → preset-core-CKc5YXSM.js} +31 -31
  46. package/dist-library/{props-DGlBk0e5.js → props-sJ8vk0cr.js} +1 -1
  47. package/dist-library/react-BbyAgeXc.js +6070 -0
  48. package/dist-library/react-D5iGiUdL.js +7 -0
  49. package/dist-library/reactive-md-authoring.js +222 -223
  50. package/dist-library/reactive-md-build.js +126 -72
  51. package/dist-library/reactive-md-compiler-standard.js +12 -10
  52. package/dist-library/reactive-md-compiler.js +3 -3
  53. package/dist-library/reactive-md-default-packs.js +2 -2
  54. package/dist-library/reactive-md-default-preset.js +4 -4
  55. package/dist-library/reactive-md-export-assets.js +57 -0
  56. package/dist-library/reactive-md-export.js +5 -111
  57. package/dist-library/reactive-md-minimal-preset.js +24 -0
  58. package/dist-library/reactive-md-minimal-react-preset.js +26 -0
  59. package/dist-library/reactive-md-minimal-styles.js +80 -0
  60. package/dist-library/reactive-md-minimal.css +2 -0
  61. package/dist-library/reactive-md-pdf.js +7582 -0
  62. package/dist-library/reactive-md-plugin-chart.js +13 -0
  63. package/dist-library/reactive-md-plugin-data.js +17 -0
  64. package/dist-library/reactive-md-plugin-diagram.js +18 -0
  65. package/dist-library/reactive-md-plugin-forms.js +18 -0
  66. package/dist-library/reactive-md-plugin-gallery.js +12 -0
  67. package/dist-library/reactive-md-plugin-navigation.js +15 -0
  68. package/dist-library/reactive-md-plugin-network.js +222 -0
  69. package/dist-library/reactive-md-plugin-plot.js +24 -0
  70. package/dist-library/reactive-md-print.css +5 -0
  71. package/dist-library/reactive-md-react-minimal.js +28 -0
  72. package/dist-library/reactive-md-react-server.js +34 -32
  73. package/dist-library/reactive-md-react-unstyled.js +14 -9
  74. package/dist-library/reactive-md-react.js +14 -9
  75. package/dist-library/reactive-md-runtime-browser.js +847 -15
  76. package/dist-library/reactive-md-runtime.js +3 -3
  77. package/dist-library/reactive-md-sdk.js +8 -6
  78. package/dist-library/reactive-md-standalone-configured.js +16 -0
  79. package/dist-library/reactive-md-standalone-host.js +9 -438
  80. package/dist-library/reactive-md-testing-browser.js +5 -4
  81. package/dist-library/reactive-md-testing-react.js +46 -44
  82. package/dist-library/reactive-md-testing.js +45 -44
  83. package/dist-library/reactive-md-vite.js +135 -37
  84. package/dist-library/reactive-md.css +1 -1
  85. package/dist-library/reactive-md.js +590 -498
  86. package/dist-library/registry-B9NGct4d.js +20 -0
  87. package/dist-library/registry-core-Bbad9Bm2.js +479 -0
  88. package/dist-library/{resources-BGt8mpDA.js → resources-D2GDQS0p.js} +45 -45
  89. package/dist-library/{runtime-Dkq7ldyg.js → runtime-B2fxeveq.js} +1 -1
  90. package/dist-library/runtime-kcA7bG7G.js +1282 -0
  91. package/dist-library/sample-bP4zHB3L.js +289 -0
  92. package/dist-library/{schema-ZFufO8V0.js → schema-BufhKUSM.js} +12 -11
  93. package/dist-library/sdk-core-BoJT1SIt.js +1166 -0
  94. package/dist-library/session-core-nmJHuR9c.js +452 -0
  95. package/dist-library/{shareable-DDVL4Fi9.js → shareable-DpbE-59H.js} +250 -283
  96. package/dist-library/tooltip-layer-HDLrSWs0.js +28 -0
  97. package/dist-library/types/authoring/catalog.d.ts +2 -3
  98. package/dist-library/types/authoring/editor-i18n.d.ts +1 -1
  99. package/dist-library/types/authoring/index.d.ts +1 -1
  100. package/dist-library/types/authoring/insert.d.ts +1 -1
  101. package/dist-library/types/authoring/templates.d.ts +2 -2
  102. package/dist-library/types/build/diagnostics.d.ts +1 -1
  103. package/dist-library/types/build/host.d.ts +1 -1
  104. package/dist-library/types/build/index.d.ts +1 -1
  105. package/dist-library/types/build/notices.d.ts +1 -1
  106. package/dist-library/types/build/resources.d.ts +1 -1
  107. package/dist-library/types/build/vite.d.ts +1 -1
  108. package/dist-library/types/compiler/index.d.ts +2 -2
  109. package/dist-library/types/compiler/result.d.ts +1 -1
  110. package/dist-library/types/compiler/standard.d.ts +2 -2
  111. package/dist-library/types/compiler/types.d.ts +1 -1
  112. package/dist-library/types/components/{controls.d.ts → controls/controls.d.ts} +2 -3
  113. package/dist-library/types/components/{numeric-sliders.d.ts → controls/numeric-sliders.d.ts} +1 -1
  114. package/dist-library/types/components/{gallery.d.ts → gallery/gallery.d.ts} +1 -1
  115. package/dist-library/types/components/{layout.d.ts → layout/layout.d.ts} +1 -1
  116. package/dist-library/types/components/minimal-preset.d.ts +2 -0
  117. package/dist-library/types/components/mount-preset.d.ts +4 -0
  118. package/dist-library/types/components/network/submit-button.d.ts +10 -0
  119. package/dist-library/types/components/plot/coordinate.d.ts +2 -0
  120. package/dist-library/types/components/plugins/chart.d.ts +2 -0
  121. package/dist-library/types/components/plugins/data.d.ts +2 -0
  122. package/dist-library/types/components/plugins/diagram.d.ts +2 -0
  123. package/dist-library/types/components/plugins/forms.d.ts +2 -0
  124. package/dist-library/types/components/plugins/gallery.d.ts +2 -0
  125. package/dist-library/types/components/plugins/navigation.d.ts +2 -0
  126. package/dist-library/types/components/plugins/network.d.ts +2 -0
  127. package/dist-library/types/components/plugins/plot.d.ts +2 -0
  128. package/dist-library/types/components/shared/visual-frame.d.ts +12 -0
  129. package/dist-library/types/components/{visuals.d.ts → shared/visuals.d.ts} +1 -7
  130. package/dist-library/types/components/{data-table.d.ts → table/data-table.d.ts} +2 -2
  131. package/dist-library/types/export/component-state.d.ts +1 -1
  132. package/dist-library/types/export/index.d.ts +2 -1
  133. package/dist-library/types/export/print-document.d.ts +18 -0
  134. package/dist-library/types/export/render-markup.d.ts +23 -0
  135. package/dist-library/types/export/requirements.d.ts +1 -1
  136. package/dist-library/types/export/resources.d.ts +1 -1
  137. package/dist-library/types/export/restoration.d.ts +1 -1
  138. package/dist-library/types/export-assets/index.d.ts +25 -0
  139. package/dist-library/types/local/compilation/compiler-attributes.d.ts +8 -0
  140. package/dist-library/types/local/compilation/compiler-bindings.d.ts +19 -0
  141. package/dist-library/types/local/compilation/compiler-capabilities.d.ts +3 -0
  142. package/dist-library/types/local/compilation/compiler-core.d.ts +11 -3
  143. package/dist-library/types/local/compilation/compiler-declarations.d.ts +32 -0
  144. package/dist-library/types/local/compilation/compiler-expressions.d.ts +32 -0
  145. package/dist-library/types/local/compilation/compiler-services.d.ts +62 -16
  146. package/dist-library/types/local/compilation/compiler-structure.d.ts +38 -3
  147. package/dist-library/types/local/compilation/compiler-tables.d.ts +30 -0
  148. package/dist-library/types/local/compilation/compiler-validation.d.ts +15 -0
  149. package/dist-library/types/local/compilation/compiler-values.d.ts +39 -1
  150. package/dist-library/types/local/compilation/compiler.d.ts +7 -14
  151. package/dist-library/types/local/compilation/dependencies.d.ts +1 -1
  152. package/dist-library/types/local/compilation/session/incremental.d.ts +75 -0
  153. package/dist-library/types/local/{session → compilation/session}/row-reuse.d.ts +1 -1
  154. package/dist-library/types/local/{session/compiler-cache.d.ts → compilation/session/semantic-cache.d.ts} +5 -19
  155. package/dist-library/types/local/compilation/streaming.d.ts +27 -0
  156. package/dist-library/types/local/configuration/capability-policy.d.ts +3 -0
  157. package/dist-library/types/local/{compilation → configuration}/component-kernel.d.ts +3 -79
  158. package/dist-library/types/local/configuration/diagnostic-messages.d.ts +1104 -1056
  159. package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +731 -0
  160. package/dist-library/types/local/configuration/diagnostics.d.ts +1 -1
  161. package/dist-library/types/local/configuration/kernel-value-rules.d.ts +66 -0
  162. package/dist-library/types/local/configuration/official-leaf-syntax.d.ts +24 -0
  163. package/dist-library/types/local/configuration/options-core.d.ts +5 -4
  164. package/dist-library/types/local/configuration/options.d.ts +2 -1
  165. package/dist-library/types/local/configuration/portable-options.d.ts +1 -1
  166. package/dist-library/types/local/configuration/schema-core.d.ts +1 -1
  167. package/dist-library/types/local/configuration/schema.d.ts +1 -1
  168. package/dist-library/types/local/css/author-css.d.ts +66 -0
  169. package/dist-library/types/local/evaluation/computations.d.ts +2 -2
  170. package/dist-library/types/local/evaluation/expression/compile.d.ts +30 -0
  171. package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -0
  172. package/dist-library/types/local/evaluation/expression/inference.d.ts +4 -0
  173. package/dist-library/types/local/evaluation/expression/syntax.d.ts +72 -0
  174. package/dist-library/types/local/evaluation/expression/values.d.ts +56 -0
  175. package/dist-library/types/local/evaluation/{math-display.d.ts → math/display.d.ts} +2 -2
  176. package/dist-library/types/local/evaluation/math/evaluation.d.ts +10 -0
  177. package/dist-library/types/local/evaluation/{math.d.ts → math/latex.d.ts} +58 -17
  178. package/dist-library/types/local/evaluation/{math-sample.d.ts → math/sample.d.ts} +4 -2
  179. package/dist-library/types/local/evaluation/math/syntax.d.ts +72 -0
  180. package/dist-library/types/local/evaluation/validation.d.ts +1 -1
  181. package/dist-library/types/local/html/extended-fragment.d.ts +41 -0
  182. package/dist-library/types/local/html/html-details.d.ts +1 -1
  183. package/dist-library/types/local/html/html-entities.d.ts +11 -2
  184. package/dist-library/types/local/html/html-recovery.d.ts +1 -1
  185. package/dist-library/types/local/html/html-table.d.ts +1 -1
  186. package/dist-library/types/local/html/html.d.ts +40 -4
  187. package/dist-library/types/local/index.d.ts +14 -13
  188. package/dist-library/types/local/parsing/author-markdown.d.ts +11 -0
  189. package/dist-library/types/local/{markdown → parsing}/fast-markdown.d.ts +1 -1
  190. package/dist-library/types/local/{markdown → parsing}/footnotes.d.ts +1 -1
  191. package/dist-library/types/local/{markdown → parsing}/heading-anchors.d.ts +1 -1
  192. package/dist-library/types/local/parsing/html-attributes.d.ts +14 -0
  193. package/dist-library/types/local/parsing/parse-budget.d.ts +1 -1
  194. package/dist-library/types/local/{session → parsing}/parse-session.d.ts +5 -5
  195. package/dist-library/types/local/parsing/parser-capabilities.d.ts +7 -2
  196. package/dist-library/types/local/parsing/parser-convert.d.ts +26 -0
  197. package/dist-library/types/local/parsing/parser-core.d.ts +10 -4
  198. package/dist-library/types/local/parsing/parser-internals.d.ts +54 -0
  199. package/dist-library/types/local/parsing/parser-region.d.ts +46 -0
  200. package/dist-library/types/local/parsing/parser-standard.d.ts +3 -0
  201. package/dist-library/types/local/parsing/parser-tags.d.ts +108 -0
  202. package/dist-library/types/local/parsing/parser.d.ts +3 -3
  203. package/dist-library/types/local/{markdown → parsing}/plain-paragraphs.d.ts +1 -1
  204. package/dist-library/types/local/parsing/rmd-recovery.d.ts +1 -1
  205. package/dist-library/types/local/parsing/theme-declaration.d.ts +22 -0
  206. package/dist-library/types/local/rendering/document/ExtendedHtmlFragment.d.ts +14 -0
  207. package/dist-library/types/local/rendering/document/LocalDocumentView.d.ts +5 -0
  208. package/dist-library/types/local/rendering/{LocalDocumentView.d.ts → document/LocalDocumentViewCore.d.ts} +48 -9
  209. package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +6 -0
  210. package/dist-library/types/local/rendering/document/render-nodes.d.ts +24 -0
  211. package/dist-library/types/local/rendering/document/use-author-script.d.ts +3 -0
  212. package/dist-library/types/local/rendering/document/use-color-scheme.d.ts +10 -0
  213. package/dist-library/types/local/rendering/document/validation-state.d.ts +31 -0
  214. package/dist-library/types/local/rendering/document/view-render-context.d.ts +146 -0
  215. package/dist-library/types/local/rendering/{view-revision.d.ts → document/view-revision.d.ts} +31 -4
  216. package/dist-library/types/local/rendering/render-types.d.ts +1 -1
  217. package/dist-library/types/local/{widgets/table-surface.d.ts → rendering/table/data-table.d.ts} +3 -0
  218. package/dist-library/types/local/rendering/table/table-numeric-columns.d.ts +7 -0
  219. package/dist-library/types/local/runtime/author-script-protocol.d.ts +59 -0
  220. package/dist-library/types/local/runtime/retention.d.ts +1 -1
  221. package/dist-library/types/local/runtime/runtime-document.d.ts +71 -0
  222. package/dist-library/types/local/runtime/runtime-migration.d.ts +19 -0
  223. package/dist-library/types/local/runtime/runtime-values.d.ts +39 -0
  224. package/dist-library/types/local/runtime/runtime.d.ts +4 -2
  225. package/dist-library/types/local/runtime/state.d.ts +1 -1
  226. package/dist-library/types/local/source/authoring-syntax.d.ts +48 -0
  227. package/dist-library/types/local/source/authoring.d.ts +1 -1
  228. package/dist-library/types/local/source/source-context.d.ts +23 -0
  229. package/dist-library/types/local/source/source-migration.d.ts +2 -2
  230. package/dist-library/types/local/transport/compile-patch.d.ts +1 -1
  231. package/dist-library/types/local/transport/flat-compiled-data.d.ts +1 -1
  232. package/dist-library/types/local/transport/shared-data.d.ts +1 -1
  233. package/dist-library/types/local/transport/worker-handler.d.ts +30 -0
  234. package/dist-library/types/local/transport/worker-job.d.ts +28 -0
  235. package/dist-library/types/local/transport/worker.d.ts +32 -46
  236. package/dist-library/types/local/{contracts/types.d.ts → types.d.ts} +78 -21
  237. package/dist-library/types/pdf.d.ts +22 -0
  238. package/dist-library/types/presets/identity.d.ts +1 -0
  239. package/dist-library/types/presets/minimal.d.ts +2 -0
  240. package/dist-library/types/presets/plugin-packs.d.ts +1 -0
  241. package/dist-library/types/react/component-api.d.ts +20 -4
  242. package/dist-library/types/react/component-primitives.d.ts +10 -10
  243. package/dist-library/types/react/component-utils.d.ts +9 -1
  244. package/dist-library/types/react/index.d.ts +6 -5
  245. package/dist-library/types/{local/theme/i18n.d.ts → react/localization.d.ts} +2 -2
  246. package/dist-library/types/react/minimal.d.ts +13 -0
  247. package/dist-library/types/react/package-core.d.ts +67 -0
  248. package/dist-library/types/react/package.d.ts +3 -67
  249. package/dist-library/types/react/runtime/common.d.ts +1 -1
  250. package/dist-library/types/react/sdk-core.d.ts +115 -0
  251. package/dist-library/types/react/sdk.d.ts +4 -110
  252. package/dist-library/types/react/server.d.ts +2 -2
  253. package/dist-library/types/react/use-draft-field.d.ts +5 -1
  254. package/dist-library/types/runtime-services/browser/duplex.d.ts +163 -0
  255. package/dist-library/types/runtime-services/browser/http-sse.d.ts +117 -0
  256. package/dist-library/types/runtime-services/browser/index.d.ts +2 -1
  257. package/dist-library/types/runtime-services/component-state.d.ts +1 -1
  258. package/dist-library/types/runtime-services/index.d.ts +2 -0
  259. package/dist-library/types/runtime-services/network.d.ts +86 -0
  260. package/dist-library/types/runtime-services/runtime.d.ts +1 -1
  261. package/dist-library/types/sdk/config.d.ts +1 -1
  262. package/dist-library/types/sdk/index.d.ts +1 -0
  263. package/dist-library/types/sdk/props.d.ts +1 -1
  264. package/dist-library/types/sdk/registry-core.d.ts +1 -1
  265. package/dist-library/types/sdk/theme.d.ts +5 -4
  266. package/dist-library/types/sdk/types.d.ts +2 -2
  267. package/dist-library/types/shareable.d.ts +6 -5
  268. package/dist-library/types/standalone/diagnostics.d.ts +1 -1
  269. package/dist-library/types/standalone/host.d.ts +5 -0
  270. package/dist-library/types/standalone/payload.d.ts +1 -1
  271. package/dist-library/types/standalone/prepare.d.ts +2 -2
  272. package/dist-library/types/standalone/session-core.d.ts +68 -0
  273. package/dist-library/types/standalone/session.d.ts +6 -68
  274. package/dist-library/types/themes/contract.d.ts +7 -0
  275. package/dist-library/types/{local/theme/theme.d.ts → themes/document-theme.d.ts} +4 -3
  276. package/dist-library/types/vite/client.d.ts +19 -0
  277. package/dist-library/types/vite/index.d.ts +18 -3
  278. package/dist-library/types/vite/registration.d.ts +2 -2
  279. package/dist-library/{types-BFCrMrg0.js → types-BeNtPqdY.js} +1 -1
  280. package/dist-library/validation-BEBA_HvS.js +1121 -0
  281. package/dist-library/visual-frame-CyV1FXzs.js +48 -0
  282. package/dist-library/visuals-B5KSafVk.js +3 -0
  283. package/dist-library/visuals-BZbZYA7w.js +72572 -0
  284. package/dist-standalone/reactive-md-standalone.css +1 -1
  285. package/dist-standalone/reactive-md-standalone.js +146 -137
  286. package/docs/README-ch.md +16 -11
  287. package/docs/README.md +16 -11
  288. package/docs/compatibility/compatibility-ch.md +8 -8
  289. package/docs/compatibility/compatibility-en.md +8 -8
  290. package/docs/compatibility/source-versioning-ch.md +1 -1
  291. package/docs/compatibility/source-versioning-en.md +1 -1
  292. package/docs/development/component-development-ch.md +2 -2
  293. package/docs/development/component-development-en.md +2 -2
  294. package/docs/development/component-development-reference-ch.md +4 -4
  295. package/docs/development/component-development-reference-en.md +4 -4
  296. package/docs/development/component-protocol-ch.md +14 -14
  297. package/docs/development/component-protocol-en.md +14 -14
  298. package/docs/development/extension-tutorial-ch.md +308 -0
  299. package/docs/development/extension-tutorial-en.md +308 -0
  300. package/docs/development/local-module-layout-ch.md +10 -50
  301. package/docs/development/local-module-layout-en.md +9 -49
  302. package/docs/development/performance-overview-ch.md +174 -154
  303. package/docs/development/performance-overview-en.md +174 -154
  304. package/docs/guides/local-guide-ch.md +2 -2
  305. package/docs/guides/local-guide-en.md +2 -2
  306. package/docs/integration/author-tools-ch.md +2 -2
  307. package/docs/integration/author-tools-en.md +2 -2
  308. package/docs/integration/compiler-ch.md +4 -2
  309. package/docs/integration/compiler-en.md +4 -2
  310. package/docs/integration/directory-discovery-ch.md +5 -1
  311. package/docs/integration/directory-discovery-en.md +5 -1
  312. package/docs/integration/editor-ch.md +35 -5
  313. package/docs/integration/editor-en.md +42 -4
  314. package/docs/integration/extension-sdk-ch.md +6 -4
  315. package/docs/integration/extension-sdk-en.md +6 -4
  316. package/docs/integration/local-integration-ch.md +201 -19
  317. package/docs/integration/local-integration-en.md +194 -18
  318. package/docs/integration/network-host-ch.md +75 -0
  319. package/docs/integration/network-host-en.md +75 -0
  320. package/docs/integration/shareable-export-ch.md +58 -16
  321. package/docs/integration/shareable-export-en.md +57 -15
  322. package/docs/reference/html-compatibility-ch.md +20 -67
  323. package/docs/reference/html-compatibility-en.md +19 -64
  324. package/docs/reference/local-interaction-syntax-ch.md +199 -26
  325. package/docs/reference/local-interaction-syntax-en.md +194 -27
  326. package/docs/reference/public-api-ch.md +416 -0
  327. package/docs/reference/public-api-en.md +416 -0
  328. package/docs/reference/theme-protocol-ch.md +27 -8
  329. package/docs/reference/theme-protocol-en.md +46 -8
  330. package/docs/releases/release-0.4.0-ch.md +2 -2
  331. package/docs/releases/release-0.4.0-en.md +2 -2
  332. package/docs/releases/release-0.8.0-ch.md +19 -3
  333. package/docs/releases/release-0.8.0-en.md +19 -3
  334. package/docs/releases/release-0.9.0-ch.md +44 -0
  335. package/docs/releases/release-0.9.0-en.md +44 -0
  336. package/docs/releases/release-0.9.1-ch.md +29 -0
  337. package/docs/releases/release-0.9.1-en.md +29 -0
  338. package/examples/component-package/README-ch.md +1 -1
  339. package/examples/component-package/README.md +1 -1
  340. package/examples/conformance/README-ch.md +3 -3
  341. package/examples/conformance/README.md +3 -3
  342. package/examples/game-2048-package/README-ch.md +3 -9
  343. package/examples/game-2048-package/README.md +8 -12
  344. package/examples/integration/README-ch.md +21 -2
  345. package/examples/integration/README.md +21 -2
  346. package/examples/integration/extension-sdk/README-ch.md +1 -1
  347. package/examples/integration/extension-sdk/README.md +1 -1
  348. package/examples/integration/streaming/index.html +48 -0
  349. package/examples/integration/streaming/main.js +175 -0
  350. package/examples/integration/streaming/package.json +13 -0
  351. package/examples/integration/streaming/worker.js +3 -0
  352. package/examples/local/README-ch.md +3 -3
  353. package/examples/local/README.md +2 -2
  354. package/examples/local/minimal-budget.reactive.md +48 -0
  355. package/examples/minimal-extension/README-ch.md +78 -0
  356. package/examples/minimal-extension/README.md +78 -0
  357. package/examples/minimal-extension/index.html +15 -0
  358. package/examples/minimal-extension/package.json +26 -0
  359. package/examples/minimal-extension/sample/document.reactive.md +10 -0
  360. package/examples/minimal-extension/scripts/build.mjs +32 -0
  361. package/examples/minimal-extension/scripts/export.mjs +72 -0
  362. package/examples/minimal-extension/scripts/test-node.mjs +75 -0
  363. package/examples/minimal-extension/src/extension.tsx +90 -0
  364. package/examples/minimal-extension/src/preview.tsx +12 -0
  365. package/examples/minimal-extension/src/source.ts +4 -0
  366. package/examples/minimal-extension/tsconfig.json +14 -0
  367. package/examples/network-survey/README.md +200 -0
  368. package/examples/network-survey/index.html +49 -0
  369. package/examples/network-survey/package.json +26 -0
  370. package/examples/network-survey/sample/document.reactive.md +51 -0
  371. package/examples/network-survey/src/components.tsx +325 -0
  372. package/examples/network-survey/src/host.ts +316 -0
  373. package/examples/network-survey/src/main.tsx +91 -0
  374. package/examples/network-survey/src/source.ts +1 -0
  375. package/examples/network-survey/tsconfig.json +26 -0
  376. package/examples/network-survey/vite.config.ts +227 -0
  377. package/examples/sci-fi-theme/README-ch.md +4 -2
  378. package/examples/sci-fi-theme/README.md +4 -2
  379. package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -0
  380. package/examples/sci-fi-theme/demo/demo.css +129 -23
  381. package/examples/sci-fi-theme/demo/document.reactive.md +27 -6
  382. package/examples/sci-fi-theme/demo/main.tsx +45 -10
  383. package/examples/sci-fi-theme/docs/design-system-ch.md +6 -6
  384. package/examples/sci-fi-theme/package.json +2 -1
  385. package/examples/sci-fi-theme/src/components.css +1064 -154
  386. package/examples/sci-fi-theme/src/notch.css +142 -0
  387. package/examples/sci-fi-theme/src/sci-fi.css +3 -1
  388. package/examples/sci-fi-theme/src/theme.ts +2 -0
  389. package/examples/sci-fi-theme/src/tokens.css +512 -408
  390. package/examples/tetris-package/README-ch.md +4 -4
  391. package/examples/tetris-package/README.md +4 -4
  392. package/package.json +70 -3
  393. package/dist-library/LocalDocumentView-6trX7xJc.js +0 -97920
  394. package/dist-library/compiler--ea2CKQF.js +0 -61
  395. package/dist-library/component-state-Cq2K5gkS.js +0 -490
  396. package/dist-library/options-CX5m5n-J.js +0 -115
  397. package/dist-library/runtime-C-sbfpOX.js +0 -1157
  398. package/dist-library/types/local/contracts/locale.d.ts +0 -1
  399. package/dist-library/types/local/contracts/version.d.ts +0 -2
  400. package/dist-library/types/local/evaluation/dates.d.ts +0 -2
  401. package/dist-library/types/local/evaluation/expression.d.ts +0 -47
  402. package/dist-library/types/local/markdown/markdown-structure.d.ts +0 -3
  403. package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +0 -36
  404. package/dist-library/types/local/session/incremental.d.ts +0 -48
  405. package/dist-library/types/local/source/node-walk.d.ts +0 -3
  406. package/dist-library/types/local/source/text-length.d.ts +0 -13
  407. package/dist-library/types/local/theme/theme-name.d.ts +0 -3
  408. package/dist-library/types/local/widgets/visuals.d.ts +0 -25
  409. package/dist-library/types/react/default-theme.d.ts +0 -6
  410. package/dist-library/validation-W-bmny-x.js +0 -2253
  411. package/docs/development/releasing-ch.md +0 -12
  412. package/docs/development/releasing-en.md +0 -12
  413. package/docs/integration/codemirror-ch.md +0 -52
  414. package/docs/integration/codemirror-en.md +0 -29
  415. package/docs/integration/repository-split-ch.md +0 -40
  416. package/docs/integration/repository-split-en.md +0 -23
  417. package/docs/reference/computations-formatting-ch.md +0 -89
  418. package/docs/reference/computations-formatting-en.md +0 -89
  419. package/docs/reference/constraints-collections-ch.md +0 -104
  420. package/docs/reference/constraints-collections-en.md +0 -104
  421. package/docs/reference/local-components-v2-ch.md +0 -140
  422. package/docs/reference/local-components-v2-en.md +0 -106
  423. package/docs/reference/tolerance-ch.md +0 -64
  424. package/docs/reference/tolerance-en.md +0 -57
  425. /package/dist-library/types/components/{chart-motion.d.ts → chart/chart-motion.d.ts} +0 -0
  426. /package/dist-library/types/components/{default-chart-types.d.ts → chart/default-chart-types.d.ts} +0 -0
  427. /package/dist-library/types/components/{default-chart.d.ts → chart/default-chart.d.ts} +0 -0
  428. /package/dist-library/types/components/{diagram-inspector.d.ts → diagram/diagram-inspector.d.ts} +0 -0
  429. /package/dist-library/types/{local/widgets/diagram-layout.d.ts → components/diagram/layout.d.ts} +0 -0
  430. /package/dist-library/types/components/{mafs-plot-grid.d.ts → plot/mafs-plot-grid.d.ts} +0 -0
  431. /package/dist-library/types/components/{mafs-visuals.d.ts → plot/mafs-visuals.d.ts} +0 -0
  432. /package/dist-library/types/components/{use-hydrated.d.ts → shared/use-hydrated.d.ts} +0 -0
  433. /package/dist-library/types/local/{theme/colors.d.ts → configuration/color-values.d.ts} +0 -0
  434. /package/dist-library/types/local/evaluation/{collection-functions.d.ts → expression/collection-functions.d.ts} +0 -0
  435. /package/dist-library/types/local/evaluation/{data-functions.d.ts → expression/data-functions.d.ts} +0 -0
  436. /package/dist-library/types/local/evaluation/{formatting.d.ts → expression/formatting.d.ts} +0 -0
  437. /package/dist-library/types/local/{markdown → parsing}/markdown-blocks.d.ts +0 -0
  438. /package/dist-library/types/local/{widgets → rendering/code}/code-block.d.ts +0 -0
  439. /package/dist-library/types/local/{widgets → rendering/code}/code-languages.d.ts +0 -0
  440. /package/dist-library/types/local/{widgets → rendering/image}/image-view.d.ts +0 -0
  441. /package/dist-library/types/local/{widgets → rendering}/math-view.d.ts +0 -0
@@ -1,6 +1,228 @@
1
- import { A as e, D as t, F as n, G as r, H as i, M as a, O as o, P as s, Q as c, W as l, a as u, i as d, j as f, ot as ee, q as p, rt as te, z as m } from "./identity-MYJXKSkB.js";
1
+ import { B as e, F as t, G as n, I as r, J as i, K as a, M as o, N as s, O as c, U as l, it as u, j as d, k as f, n as p, r as m } from "./preset-core-CKc5YXSM.js";
2
+ // src/local/source/source-context.ts
3
+ function ee(e, t) {
4
+ let n = e[t];
5
+ if (n !== "`" && n !== "~") return;
6
+ let r = 0;
7
+ for (; e[t + r] === n;) r++;
8
+ return r >= 3 ? {
9
+ char: n,
10
+ length: r
11
+ } : void 0;
12
+ }
13
+ function h(e) {
14
+ if (!e.length) return {
15
+ lines: [],
16
+ maxMarkdownDepth: 0,
17
+ potentialDepth: 0,
18
+ fenceSpans: []
19
+ };
20
+ let t = [0];
21
+ for (let n = 0; n < e.length; n++) {
22
+ let r = e[n];
23
+ r === "\r" ? (e[n + 1] === "\n" && n++, t.push(n + 1)) : r === "\n" && t.push(n + 1);
24
+ }
25
+ let n = [], r = [], i = [], a = null, o = !1, s = 0, c = 0;
26
+ for (let l = 0; l < t.length; l++) {
27
+ let u = t[l], d = l + 1 < t.length ? t[l + 1] : e.length;
28
+ for (; d > u && (e[d - 1] === "\r" || e[d - 1] === "\n");) d--;
29
+ let f = e.slice(u, d), p = u, m = 0;
30
+ for (; p < d;) {
31
+ for (; e[p] === " " || e[p] === " ";) m += e[p] === " " ? 4 : 1, p++;
32
+ if (e[p] === ">") {
33
+ m++, p++;
34
+ continue;
35
+ }
36
+ let t = /^(?:[-+*]|\d{1,9}[.)])(?=[ \t])/.exec(e.slice(p, d));
37
+ if (t) m++, p += t[0].length;
38
+ else break;
39
+ }
40
+ c = Math.max(c, m);
41
+ let h = l === 0 && e.charCodeAt(0) === 65279 ? u + 1 : u, g = 0;
42
+ for (; e[h + g] === " " || e[h + g] === " ";) g++;
43
+ let _ = /^[ \t]*$/.test(e.slice(h, d)), v = h;
44
+ for (let t = 0; t < 3 && e[v] === " "; t++) v++;
45
+ let y = !1;
46
+ if (a) {
47
+ let t = e.slice(v, d), n = ee(t, 0);
48
+ if (n && n.char === a.char && n.length >= a.length && /^[ \t]*$/.test(t.slice(n.length))) {
49
+ a = null;
50
+ let e = r[r.length - 1];
51
+ e && (e.to = d);
52
+ }
53
+ y = !0;
54
+ } else {
55
+ let t = e.slice(v, d), n = ee(t, 0);
56
+ n && (n.char !== "`" || t.indexOf("`", n.length) < 0) && (a = {
57
+ char: n.char,
58
+ length: n.length
59
+ }, y = !0, r.push({
60
+ from: u,
61
+ to: e.length
62
+ }));
63
+ }
64
+ let b = 0, x = 0;
65
+ if (!y && !_) {
66
+ let t = h;
67
+ for (;;) {
68
+ let n = t;
69
+ for (let t = 0; t < 3 && e[n] === " "; t++) n++;
70
+ if (e[n] !== ">") break;
71
+ t = n + 1, e[t] === " " && t++, b++;
72
+ }
73
+ let n = t;
74
+ for (; n < d && (e[n] === " " || e[n] === " ");) n++;
75
+ let r = /^([-+*]|\d{1,9}[.)])(?=[ \t]|$)/.exec(e.slice(n, d)), a = n - t >= 4 && i.length === 0;
76
+ if (r && !a) {
77
+ let e = n - h;
78
+ for (; i.length && i[i.length - 1] >= e;) i.pop();
79
+ i.push(e);
80
+ } else {
81
+ let e = n - t;
82
+ for (; i.length && (e < i[i.length - 1] || o && e <= i[i.length - 1]);) i.pop();
83
+ }
84
+ x = b + i.length, x > s && (s = x);
85
+ }
86
+ o = !y && (_ || /^[ \t]*(?:>[ \t]*)*$/.test(f)), n.push({
87
+ from: u,
88
+ to: d,
89
+ text: f,
90
+ blank: _,
91
+ indent: g,
92
+ quoteDepth: b,
93
+ fenced: y,
94
+ depth: x
95
+ });
96
+ }
97
+ return {
98
+ lines: n,
99
+ maxMarkdownDepth: s,
100
+ potentialDepth: c,
101
+ fenceSpans: r
102
+ };
103
+ }
104
+ var g = class {
105
+ source;
106
+ lineStarts = [0];
107
+ logicalLines;
108
+ factsValue;
109
+ constructor(e) {
110
+ this.source = e;
111
+ for (let t = 0; t < e.length; t++) e[t] === "\n" && this.lineStarts.push(t + 1);
112
+ }
113
+ get logicalLineCount() {
114
+ if (this.logicalLines !== void 0) return this.logicalLines;
115
+ let e = this.source.length ? this.lineStarts.length : 0;
116
+ for (let t = this.source.indexOf("\r"); t >= 0; t = this.source.indexOf("\r", t + 1)) this.source[t + 1] !== "\n" && e++;
117
+ return this.logicalLines = e;
118
+ }
119
+ get facts() {
120
+ return this.factsValue ??= h(this.source);
121
+ }
122
+ lineIndexAt(e) {
123
+ let t = 0, n = this.lineStarts.length - 1;
124
+ for (; t < n;) {
125
+ let r = t + n + 1 >>> 1;
126
+ this.lineStarts[r] <= e ? t = r : n = r - 1;
127
+ }
128
+ return t;
129
+ }
130
+ lineStartAt(e) {
131
+ return this.lineStarts[this.lineIndexAt(e)];
132
+ }
133
+ }, _ = class {
134
+ context;
135
+ chunks = [];
136
+ segments = [];
137
+ end = 0;
138
+ recent = 0;
139
+ length = 0;
140
+ constructor(e) {
141
+ this.context = e;
142
+ }
143
+ get segmentCount() {
144
+ return this.segments.length;
145
+ }
146
+ append(e, t, n) {
147
+ if (!e.length) return;
148
+ let r = this.segments.at(-1);
149
+ r && r.step === n && r.source + (r.to - r.from) * n === t ? r.to += e.length : this.segments.push({
150
+ from: this.length,
151
+ to: this.length + e.length,
152
+ source: t,
153
+ step: n
154
+ }), this.chunks.push(e), this.length += e.length;
155
+ }
156
+ generated(e, t) {
157
+ this.append(e, t, 0);
158
+ }
159
+ original(e, t, n = 0, r = !1, i = !1) {
160
+ let { source: a, lineStarts: o } = this.context;
161
+ if (i && e === 0 && a.charCodeAt(0) === 65279 && e++, e >= t) return;
162
+ if (!n) {
163
+ this.append(a.slice(e, t), e, 1);
164
+ return;
165
+ }
166
+ let s = this.context.lineIndexAt(e);
167
+ for (; e < t;) {
168
+ let i = o[s], c = o[s + 1] ?? a.length, l = Math.min(t, c), u = r ? /^(?:[ \t]{0,3}>[ \t]?)+/.exec(a.slice(i, c))?.[0].length ?? 0 : 0, d = 0;
169
+ for (; d < n && (a[i + u] === " " || a[i + u] === " ");) u++, d++;
170
+ let f = Math.min(l, Math.max(e, i + u));
171
+ this.append(a.slice(f, l), f, 1), e = l, s++;
172
+ }
173
+ }
174
+ finish(e) {
175
+ this.end = e;
176
+ }
177
+ text() {
178
+ return this.chunks.join("");
179
+ }
180
+ at(e, t) {
181
+ if (e === this.length) return this.end;
182
+ if (e < 0 || e > this.length || !Number.isInteger(e)) return t;
183
+ let n = this.segments[this.recent];
184
+ if (!n || e < n.from || e >= n.to) {
185
+ let t = 0, r = this.segments.length - 1;
186
+ for (; t < r;) {
187
+ let n = t + r + 1 >>> 1;
188
+ this.segments[n].from <= e ? t = n : r = n - 1;
189
+ }
190
+ this.recent = t, n = this.segments[t];
191
+ }
192
+ return n ? n.source + (e - n.from) * n.step : t;
193
+ }
194
+ };
195
+ function v(e) {
196
+ if (typeof e != "string") return 0;
197
+ let t = 0;
198
+ for (let n of e) t += 1;
199
+ return t;
200
+ }
201
+ function y(e, t) {
202
+ let n = e.slice(0, Math.max(0, t)), r = n.charCodeAt(n.length - 1);
203
+ return r >= 55296 && r <= 56319 ? n.slice(0, -1) : n;
204
+ }
205
+ function* b(e, t = !1) {
206
+ let n = [{
207
+ nodes: e,
208
+ index: 0
209
+ }];
210
+ for (; n.length;) {
211
+ let e = n[n.length - 1];
212
+ if (e.index === e.nodes.length) {
213
+ n.pop(), t && e.owner && (yield e.owner);
214
+ continue;
215
+ }
216
+ let r = e.nodes[e.index++];
217
+ t || (yield r), r.children?.length ? n.push({
218
+ nodes: r.children,
219
+ index: 0,
220
+ owner: r
221
+ }) : t && (yield r);
222
+ }
223
+ }
2
224
  // src/local/configuration/diagnostic-messages.ts
3
- var h = {
225
+ var x = {
4
226
  "local.version.unsupported": {
5
227
  en: "This reader accepts {supported}; migrate {declared} or use a compatible reader.",
6
228
  zh: "此阅读器支持 {supported};请迁移 {declared} 或使用兼容的阅读器。"
@@ -277,6 +499,54 @@ var h = {
277
499
  en: "Unsafe URL in attribute {name} was removed.",
278
500
  zh: "属性 {name} 中的不安全 URL 已移除。"
279
501
  },
502
+ "local.author.disabled": {
503
+ en: "Author {feature} is disabled by the compile options.",
504
+ zh: "编译选项已关闭作者 {feature}。"
505
+ },
506
+ "local.author.placement": {
507
+ en: "Use paired tags for this declaration.",
508
+ zh: "请使用成对标签声明此能力。"
509
+ },
510
+ "local.author.unclosed": {
511
+ en: "Close the <{name}> declaration.",
512
+ zh: "请补全 <{name}> 声明的结束标签。"
513
+ },
514
+ "local.author.css-placement": {
515
+ en: "Move document CSS before the body.",
516
+ zh: "请将文档 CSS 移到正文之前。"
517
+ },
518
+ "local.author.script-placement": {
519
+ en: "Place author JavaScript at the document’s top level.",
520
+ zh: "请将 JavaScript 声明放在文档顶层。"
521
+ },
522
+ "local.author.component-conflict": {
523
+ en: "The registered <{name}> component owns this tag.",
524
+ zh: "此标签归已注册的 <{name}> 组件。"
525
+ },
526
+ "local.author.css-owned": {
527
+ en: "<{name}> defines its own css attribute.",
528
+ zh: "<{name}> 自行定义了 css 属性。"
529
+ },
530
+ "local.author.css-hidden": {
531
+ en: "<{name}> has no visible root for a css declaration.",
532
+ zh: "<{name}> 没有可应用 css 声明的可见根元素。"
533
+ },
534
+ "local.author.css-global-rule": {
535
+ en: "Author CSS does not support the global rule @{name}.",
536
+ zh: "作者 CSS 暂不支持全局规则 @{name}。"
537
+ },
538
+ "local.author.action-invalid": {
539
+ en: "Invalid or unsupported action target \"{id}\".",
540
+ zh: "动作目标 \"{id}\" 无效或不受支持。"
541
+ },
542
+ "local.author.action-duplicate": {
543
+ en: "Duplicate action target \"{id}\".",
544
+ zh: "动作目标 \"{id}\" 重复。"
545
+ },
546
+ "local.author.fragment-tag": {
547
+ en: "Use a document declaration or an extended element instead of <{name}>.",
548
+ zh: "<{name}> 已按原文显示。请使用文档声明或扩展元素。"
549
+ },
280
550
  "html.capability": {
281
551
  en: "Author {feature} was disabled by the compile options.",
282
552
  zh: "编译选项已禁用作者提供的{feature}。"
@@ -890,8 +1160,8 @@ var h = {
890
1160
  zh: "文档的绘图采样点总数超过上限 {limit}。"
891
1161
  },
892
1162
  "math.formulaShape": {
893
- en: "<plot> formulas must be an equation: y = f(x), a parametric cases block, or an implicit equation in x and y.",
894
- zh: "<plot> 的公式必须是方程:y = f(x)、参数方程 cases 块,或关于 x 和 y 的隐式方程。"
1163
+ en: "<plot> formulas must be an equation: y = f(x), a parametric cases block, r = f(\\theta), or an implicit equation in x and y.",
1164
+ zh: "<plot> 的公式必须是方程:y = f(x)、参数方程 cases 块、r = f(\\theta),或关于 x 和 y 的隐式方程。"
895
1165
  },
896
1166
  "math.computeFailed": {
897
1167
  en: "Cannot compute plot formula: {detail}",
@@ -1409,7 +1679,7 @@ var h = {
1409
1679
  en: "Dynamic {attribute} date bound for parameter {name} is not a valid YYYY-MM-DD value.",
1410
1680
  zh: "参数 {name} 的动态 {attribute} 日期边界不是合法的 YYYY-MM-DD。"
1411
1681
  }
1412
- }, g = {
1682
+ }, S = {
1413
1683
  "local.options.invalid.object": "options.notObject",
1414
1684
  "local.options.invalid.limits": "options.limitsNotObject",
1415
1685
  "local.options.invalid.max-syntax-nodes": "options.maxSyntaxNodes",
@@ -1702,57 +1972,57 @@ var h = {
1702
1972
  "local.runtime.value.option": "runtime.option",
1703
1973
  "local.runtime.value.budget": "runtime.budget",
1704
1974
  "local.runtime.value.range-order": "runtime.rangeOrder"
1705
- }, ne = 16, _ = 256, re = 2e3;
1706
- function ie(e) {
1707
- if (typeof e == "string") return e.length > _ ? `${e.slice(0, 255)}…` : e;
1975
+ }, te = 16, C = 256, ne = 2e3;
1976
+ function re(e) {
1977
+ if (typeof e == "string") return e.length > C ? `${y(e, 255)}…` : e;
1708
1978
  if (typeof e == "number") return Number.isFinite(e) ? e : String(e);
1709
1979
  if (typeof e == "boolean" || e === null) return e;
1710
1980
  if (e === void 0) return "";
1711
1981
  try {
1712
1982
  let t = JSON.stringify(e) ?? String(e);
1713
- return t.length > _ ? `${t.slice(0, 255)}…` : t;
1983
+ return t.length > C ? `${y(t, 255)}…` : t;
1714
1984
  } catch {
1715
- return String(e).slice(0, _);
1985
+ return y(String(e), C);
1716
1986
  }
1717
1987
  }
1718
- function ae(e) {
1988
+ function ie(e) {
1719
1989
  let t = Object.entries(e);
1720
1990
  if (t.length === 0) return;
1721
1991
  let n = {}, r = 0, i = 0;
1722
1992
  for (let [e, a] of t) {
1723
- if (i >= ne) break;
1993
+ if (i >= te) break;
1724
1994
  if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)) continue;
1725
1995
  let t;
1726
1996
  try {
1727
- t = ie(a);
1997
+ t = re(a);
1728
1998
  } catch {
1729
1999
  t = "";
1730
2000
  }
1731
2001
  let o = typeof t == "string" ? t.length : String(t).length;
1732
- if (r + o > re) break;
2002
+ if (r + o > ne) break;
1733
2003
  n[e] = t, r += o, i += 1;
1734
2004
  }
1735
2005
  return i > 0 ? n : void 0;
1736
2006
  }
1737
- function oe(e, t) {
1738
- let n = t ? ae(t) : void 0;
2007
+ function w(e, t) {
2008
+ let n = t ? ie(t) : void 0;
1739
2009
  return n ? {
1740
2010
  key: e,
1741
2011
  params: n
1742
2012
  } : { key: e };
1743
2013
  }
1744
- var se = /* @__PURE__ */ "local.parse,local.budget,local.options.invalid,local.theme.expression,local.theme.name,local.theme.attribute,local.theme.malformed,local.theme.duplicate,local.theme.late,local.theme.nested,local.attribute,local.attribute.name,local.attribute.duplicate,local.budget.name,local.budget.math,local.tag.unclosed,local.tag.closing,local.tag.name,local.tag.mismatch,local.tag.shape,local.footnote.unsupported,local.interpolation,local.math.unclosed,local.math.whitespace,local.component.unknown,local.html,local.html.fallback,local.html.table,local.html.repair,local.html.literal,local.recovery.unclosed,local.recovery.mismatch,local.recovery.stray-close".split(","), ce = /* @__PURE__ */ "local.budget.data-table.cells,local.budget.data-table.columns,local.budget.data-table.rows,local.computation.budget,local.computation.const,local.computation.cycle,local.computation.duplicate,local.computation.expression,local.computation.name,local.computation.placement,local.computation.reserved,local.computation.unknown,local.external.placement,local.external.name,local.external.reserved,local.external.duplicate,local.external.conflict,local.external.type,local.host.structure,local.computation.value,local.data-table.column,local.data-table.key,local.data-table.rows,local.data-table.value,local.validation.budget,local.validation.expression,local.validation.failed,local.validation.fields,local.validation.placement,local.validation.when,local.parse,local.legacy,local.component.unknown,local.host.attribute,local.attribute.unknown,local.budget.attribute,local.attribute.color,local.attribute.required,local.label.required,local.attribute.static,local.expression.empty,local.expression.invalid,local.attribute.type,local.attribute.range,local.constraint,local.selection.key,local.structure.parent,local.structure.children,local.budget.array,local.option.value,local.tab.value,local.step.value,local.quiz.answer,local.diagram.node,local.diagram.edge,local.checklist.body,local.budget.identifier,local.binding.name,local.binding.reserved,local.binding.type,local.binding.exclusive,local.binding.constraint,local.binding.option,local.initial.duplicate,local.initial.length,local.initial.email,local.initial.range,local.initial.option,local.initial.type,local.initial.date,local.initial,local.initial.step,local.binding.unknown,local.type,local.interpolation,local.attribute.interpolation,local.anchor.id,local.anchor.duplicate,local.jump.target,local.budget.plot.curves,local.budget.plot.points,local.math.formula,local.math,local.math.display,local.math.binding,local.table.header,local.table.row,local.chart.numeric,local.chart.column,local.chart.negative,local.timeline.header,local.timeline.value,local.html.extended,local.html.attribute,local.html.unsafe-url,local.html.capability,local.capability.html,local.capability.plot".split(","), le = [
2014
+ var ae = /* @__PURE__ */ "local.parse,local.budget,local.options.invalid,local.theme.expression,local.theme.name,local.theme.attribute,local.theme.malformed,local.theme.duplicate,local.theme.late,local.theme.nested,local.attribute,local.attribute.name,local.attribute.duplicate,local.budget.name,local.budget.math,local.tag.unclosed,local.tag.closing,local.tag.name,local.tag.mismatch,local.tag.shape,local.footnote.unsupported,local.interpolation,local.math.unclosed,local.math.whitespace,local.component.unknown,local.html,local.html.fallback,local.html.table,local.html.repair,local.html.literal,local.author.placement,local.author.unclosed,local.author.css-placement,local.author.script-placement,local.author.component-conflict,local.recovery.unclosed,local.recovery.mismatch,local.recovery.stray-close".split(","), oe = /* @__PURE__ */ "local.budget.data-table.cells,local.budget.data-table.columns,local.budget.data-table.rows,local.computation.budget,local.computation.const,local.computation.cycle,local.computation.duplicate,local.computation.expression,local.computation.name,local.computation.placement,local.computation.reserved,local.computation.unknown,local.external.placement,local.external.name,local.external.reserved,local.external.duplicate,local.external.conflict,local.external.type,local.host.structure,local.computation.value,local.data-table.column,local.data-table.key,local.data-table.rows,local.data-table.value,local.validation.budget,local.validation.expression,local.validation.failed,local.validation.fields,local.validation.placement,local.validation.when,local.parse,local.legacy,local.component.unknown,local.host.attribute,local.attribute.unknown,local.budget.attribute,local.attribute.color,local.attribute.required,local.label.required,local.attribute.static,local.expression.empty,local.expression.invalid,local.attribute.type,local.attribute.range,local.constraint,local.selection.key,local.structure.parent,local.structure.children,local.budget.array,local.option.value,local.tab.value,local.step.value,local.quiz.answer,local.diagram.node,local.diagram.edge,local.checklist.body,local.budget.identifier,local.binding.name,local.binding.reserved,local.binding.type,local.binding.exclusive,local.binding.constraint,local.binding.option,local.initial.duplicate,local.initial.length,local.initial.email,local.initial.range,local.initial.option,local.initial.type,local.initial.date,local.initial,local.initial.step,local.binding.unknown,local.type,local.interpolation,local.attribute.interpolation,local.anchor.id,local.anchor.duplicate,local.jump.target,local.budget.plot.curves,local.budget.plot.points,local.math.formula,local.math,local.math.display,local.math.binding,local.table.header,local.table.row,local.chart.numeric,local.chart.column,local.chart.negative,local.timeline.header,local.timeline.value,local.html.extended,local.html.attribute,local.html.unsafe-url,local.html.capability,local.capability.html,local.capability.plot".split(","), se = [
1745
2015
  "local.runtime.binding",
1746
2016
  "local.runtime.value",
1747
2017
  "local.runtime.external"
1748
- ], ue = [
2018
+ ], ce = [
1749
2019
  "local.theme.name",
1750
2020
  "local.theme.missing",
1751
2021
  "local.theme.manifest",
1752
2022
  "local.theme.duplicate",
1753
2023
  "local.theme.protocol",
1754
2024
  "local.theme.modes"
1755
- ], de = [
2025
+ ], T = [
1756
2026
  "expression-index",
1757
2027
  "expression-cycle",
1758
2028
  "expression-syntax",
@@ -1772,7 +2042,7 @@ var se = /* @__PURE__ */ "local.parse,local.budget,local.options.invalid,local.t
1772
2042
  "expression-domain",
1773
2043
  "expression-divide-by-zero",
1774
2044
  "expression-interpolation"
1775
- ], fe = [
2045
+ ], le = [
1776
2046
  "latex-budget",
1777
2047
  "latex-syntax",
1778
2048
  "latex-empty",
@@ -1787,7 +2057,7 @@ var se = /* @__PURE__ */ "local.parse,local.budget,local.options.invalid,local.t
1787
2057
  "latex-undefined",
1788
2058
  "latex-plot-range",
1789
2059
  "latex-plot-samples"
1790
- ], pe = [
2060
+ ], ue = [
1791
2061
  "local.version.unsupported",
1792
2062
  "local.version.malformed",
1793
2063
  "local.version.duplicate",
@@ -1798,46 +2068,46 @@ var se = /* @__PURE__ */ "local.parse,local.budget,local.options.invalid,local.t
1798
2068
  "local.upgrade.text-length",
1799
2069
  "local.upgrade.expression",
1800
2070
  "local.upgrade.version-missing",
2071
+ ...ae,
2072
+ ...oe,
1801
2073
  ...se,
1802
- ...ce,
1803
- ...le,
1804
- ...ue
1805
- ], me = Object.freeze(Array.from(/* @__PURE__ */ new Set([
1806
- ...pe,
1807
- ...de,
1808
- ...de.map((e) => `local.expression.${e}`),
1809
- ...fe
1810
- ]))), he = Object.freeze([...Object.keys(g), ...Object.keys(h).filter((e) => e.startsWith("error."))].sort());
1811
- function ge(e) {
1812
- if (Object.hasOwn(g, e)) return g[e];
1813
- if (Object.hasOwn(h, e)) return e;
1814
- }
1815
- function v(e, t = "en") {
1816
- let n = ge(e);
1817
- if (n) return h[n][t === "zh" ? "zh" : "en"];
1818
- }
1819
- function _e(e) {
1820
- return typeof e == "string" && me.includes(e);
1821
- }
1822
- function y(e, t) {
2074
+ ...ce
2075
+ ], E = Object.freeze(Array.from(/* @__PURE__ */ new Set([
2076
+ ...ue,
2077
+ ...T,
2078
+ ...T.map((e) => `local.expression.${e}`),
2079
+ ...le
2080
+ ]))), de = Object.freeze([...Object.keys(S), ...Object.keys(x).filter((e) => e.startsWith("error."))].sort());
2081
+ function D(e) {
2082
+ if (Object.hasOwn(S, e)) return S[e];
2083
+ if (Object.hasOwn(x, e)) return e;
2084
+ }
2085
+ function O(e, t = "en") {
2086
+ let n = D(e);
2087
+ if (n) return x[n][t === "zh" ? "zh" : "en"];
2088
+ }
2089
+ function fe(e) {
2090
+ return typeof e == "string" && E.includes(e);
2091
+ }
2092
+ function k(e, t) {
1823
2093
  return t ? e.replace(/\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (e, n) => {
1824
2094
  let r = t[n];
1825
2095
  return r === void 0 ? "" : String(r);
1826
2096
  }) : e;
1827
2097
  }
1828
- function b(e, t = "en", n) {
1829
- let r = v(e, t);
1830
- return r === void 0 ? "" : y(r, n);
2098
+ function A(e, t = "en", n) {
2099
+ let r = O(e, t);
2100
+ return r === void 0 ? "" : k(r, n);
1831
2101
  }
1832
- function ve(e) {
1833
- return b(e.key, "en", e.params);
2102
+ function j(e) {
2103
+ return A(e.key, "en", e.params);
1834
2104
  }
1835
- function ye(e, t = "en") {
1836
- let n = typeof e.messageKey == "string" ? e.messageKey : void 0, r = n === void 0 ? void 0 : v(n, t), i = e.params;
2105
+ function pe(e, t = "en") {
2106
+ let n = typeof e.messageKey == "string" ? e.messageKey : void 0, r = n === void 0 ? void 0 : O(n, t), i = e.params;
1837
2107
  if (t === "zh" && i) {
1838
- let e = n === void 0 ? void 0 : ge(n);
2108
+ let e = n === void 0 ? void 0 : D(n);
1839
2109
  if (e === "expression.error" || e === "math.computeFailed") {
1840
- let e = typeof i.code == "string" ? v(`error.${i.code}`, "zh") : void 0;
2110
+ let e = typeof i.code == "string" ? O(`error.${i.code}`, "zh") : void 0;
1841
2111
  if (e) {
1842
2112
  let t = typeof i.near == "string" && i.near ? ` 相关源码:${i.near}` : "";
1843
2113
  i = {
@@ -1846,454 +2116,18 @@ function ye(e, t = "en") {
1846
2116
  };
1847
2117
  }
1848
2118
  } else if (e === "runtime.budget" && typeof i.detailKey == "string") {
1849
- let e = v(i.detailKey, "zh");
2119
+ let e = O(i.detailKey, "zh");
1850
2120
  e && (i = {
1851
2121
  ...i,
1852
- detail: y(e, i)
1853
- });
1854
- }
1855
- }
1856
- let a = r === void 0 ? typeof e.message == "string" ? e.message : String(e.message ?? "") : y(r, i), o = typeof a == "string" ? a : String(a ?? "");
1857
- return o.length > 2e3 ? `${o.slice(0, te - 1)}…` : o;
1858
- }
1859
- // src/local/compilation/component-kernel.ts
1860
- function x(e, t, n) {
1861
- if (!e) return;
1862
- let r = e, i = e.options ?? [], a = e.constraints ?? (r.min !== void 0 || r.max !== void 0 || r.step !== void 0 ? {
1863
- ...r.min === void 0 ? {} : { min: { literal: r.min } },
1864
- ...r.max === void 0 ? {} : { max: { literal: r.max } },
1865
- ...r.step === void 0 ? {} : { step: { literal: r.step } }
1866
- } : void 0), o = e.family ?? (e.kind === "number" ? "number" : e.kind === "boolean" ? "boolean" : e.kind === "array" ? "multi-select" : i.length ? "choice" : "text");
1867
- return {
1868
- ...e,
1869
- family: o,
1870
- bind: e.bind ?? "bind",
1871
- initial: e.initial ?? "initial",
1872
- initialRule: e.initialRule ?? n ?? (t === "value" ? e.kind === "boolean" ? "false" : e.kind === "number" ? "nearest-zero" : "empty" : "nearest-zero"),
1873
- ...a ? { constraints: a } : {}
1874
- };
1875
- }
1876
- function be(e) {
1877
- return e.bindings.value;
1878
- }
1879
- function xe(e) {
1880
- let t = [];
1881
- for (let [n, r] of Object.entries(e.bindings)) n !== "value" && t.push({
1882
- ...r,
1883
- slot: n
1884
- });
1885
- return t;
1886
- }
1887
- function Se(e) {
1888
- return e.slotRelations;
1889
- }
1890
- function Ce(e) {
1891
- return e.structure ? e.structure : {
1892
- rule: e.childRule ?? (e.form === "leaf" ? "none" : e.form === "inline" ? "inline" : "any"),
1893
- label: e.label ?? "none",
1894
- ...e.parent ? { parents: e.parent } : {}
1895
- };
1896
- }
1897
- function we(e) {
1898
- return e.structure;
1899
- }
1900
- function S(e) {
1901
- return e.rules ?? [];
1902
- }
1903
- function Te(e, t) {
1904
- for (let n of S(e)) if (n.kind === t) return n;
1905
- }
1906
- function Ee(e, t) {
1907
- return S(e).filter((e) => e.kind === t);
1908
- }
1909
- function De(e) {
1910
- return e.legacyHost === !0;
1911
- }
1912
- function C(e, t) {
1913
- if (t === e.bind) return e.options, {
1914
- kind: "string",
1915
- static: !0
1916
- };
1917
- switch (e.kind) {
1918
- case "number": return {
1919
- kind: "number",
1920
- static: !0
1921
- };
1922
- case "boolean": return {
1923
- kind: "boolean",
1924
- static: !0
1925
- };
1926
- default: return {
1927
- kind: "string",
1928
- static: !0
1929
- };
1930
- }
1931
- }
1932
- function Oe(e, t) {
1933
- let n = { ...e.props }, r = t?.bindings ?? e.bindings, i = r?.value ?? e.binding, a = r ? Object.entries(r).filter(([e]) => e !== "value").map(([, e]) => e) : (e.slots ?? []).map((e) => ({
1934
- kind: e.kind,
1935
- family: e.family,
1936
- bind: e.bind,
1937
- initial: e.initial,
1938
- initialRule: e.initialRule ?? "nearest-zero"
1939
- }));
1940
- for (let e of i ? [i] : []) Object.hasOwn(n, e.bind) || (n[e.bind] = C(e, e.bind)), Object.hasOwn(n, e.initial) || (n[e.initial] = C(e, e.initial)), Object.hasOwn(n, "disabled") || (n.disabled = {
1941
- kind: "boolean",
1942
- dynamic: !0,
1943
- default: !1
1944
- });
1945
- for (let e of a) Object.hasOwn(n, e.bind) || (n[e.bind] = C(e, e.bind)), Object.hasOwn(n, e.initial) || (n[e.initial] = C(e, e.initial));
1946
- return {
1947
- ...e,
1948
- props: n,
1949
- ...t?.structure ?? e.structure ? { structure: t?.structure ?? e.structure } : {},
1950
- ...t?.rules ?? e.rules ? { rules: t?.rules ?? e.rules } : {},
1951
- ...r ? { bindings: r } : {},
1952
- ...t?.slotRelations ?? e.slotRelations ? { slotRelations: t?.slotRelations ?? e.slotRelations } : {},
1953
- ...t?.legacyHost === !0 || e.legacyHost === !0 ? { legacyHost: !0 } : {}
1954
- };
1955
- }
1956
- function w(e, t) {
1957
- let n = Oe(e, t), r = {}, i = t?.bindings ?? e.bindings;
1958
- if (i) for (let [t, n] of Object.entries(i)) {
1959
- let i = x(n, t, t === "value" ? e.initialRule : void 0);
1960
- i && (r[t] = i);
1961
- }
1962
- else if (e.binding) {
1963
- let t = x(e.binding, "value", e.initialRule);
1964
- t && (r.value = t);
1965
- }
1966
- for (let t of e.slots ?? []) {
1967
- if (r[t.name] !== void 0) continue;
1968
- let e = x({
1969
- kind: t.kind,
1970
- family: t.family,
1971
- bind: t.bind,
1972
- initial: t.initial,
1973
- ...t.exclusive === void 0 ? {} : { exclusive: t.exclusive },
1974
- ...t.initialRule === void 0 ? {} : { initialRule: t.initialRule }
1975
- }, t.name);
1976
- e && (r[t.name] = e);
1977
- }
1978
- let a = {};
1979
- for (let [e, t] of Object.entries(n.props)) {
1980
- let n = t.values ?? t.enum;
1981
- if (n === void 0) {
1982
- a[e] = t;
1983
- continue;
1984
- }
1985
- let { enum: r, ...i } = t;
1986
- a[e] = {
1987
- ...i,
1988
- values: n
1989
- };
1990
- }
1991
- return Object.freeze({
1992
- name: n.name,
1993
- form: n.form,
1994
- props: Object.freeze(a),
1995
- bindings: Object.freeze(r),
1996
- structure: Ce(n),
1997
- rules: n.rules ?? [],
1998
- slotRelations: n.slotRelations ?? [],
1999
- legacyHost: n.legacyHost === !0
2000
- });
2001
- }
2002
- function T(e, t, n) {
2003
- if (n === void 0) return;
2004
- let r = t[n];
2005
- if (r) return !r.dynamic && typeof r.value == "number" ? r.value : void 0;
2006
- let i = e.props[n]?.default;
2007
- return typeof i == "number" ? i : void 0;
2008
- }
2009
- function E(e, t, n) {
2010
- if (n === void 0) return;
2011
- let r = t[n];
2012
- if (r) return !r.dynamic && typeof r.value == "string" ? r.value : void 0;
2013
- let i = e.props[n]?.default;
2014
- return typeof i == "string" ? i : void 0;
2015
- }
2016
- function D(e, t, n) {
2017
- return n === void 0 ? t : e[n]?.offset ?? t;
2018
- }
2019
- function ke(e, t, n) {
2020
- let r = [], i = e.name, a = i, o = (e, t, n, i, a) => {
2021
- r.push({
2022
- code: e,
2023
- message: t,
2024
- start: n,
2025
- key: i,
2026
- ...a ? { params: a } : {}
2027
- });
2028
- };
2029
- for (let r of S(e)) switch (r.kind) {
2030
- case "numeric-range": {
2031
- let s = T(e, t, r.min), c = T(e, t, r.max);
2032
- s !== void 0 && c !== void 0 && (r.order === "increasing" ? !(s < c) : s > c) && o("local.constraint", r.order === "increasing" ? `${i} ${r.min ?? "min"} must be less than ${r.max ?? "max"}.` : `Component <${i}> min cannot exceed max.`, D(t, n.start, r.min), r.order === "increasing" ? "local.constraint.plot-range" : "local.constraint.number-min-max", r.order === "increasing" ? void 0 : { component: a });
2033
- let l = T(e, t, r.step);
2034
- l === void 0 || l > 0 && Number.isFinite(l) || o("local.constraint", `Component <${i}> step must be greater than 0.`, D(t, n.start, r.step), "local.constraint.number-step", { component: a });
2035
- let u = r.integer;
2036
- if (u !== void 0) {
2037
- let r = T(e, t, u);
2038
- r !== void 0 && !Number.isInteger(r) && o("local.constraint", `Attribute ${u} must be a whole number.`, D(t, n.start, u), "local.constraint.integer", {
2039
- name: u,
2040
- component: a
2041
- });
2042
- }
2043
- if (r.positiveInteger !== void 0) {
2044
- let i = T(e, t, r.positiveInteger);
2045
- i !== void 0 && (!Number.isInteger(i) || i <= 0) && o("local.constraint", `Attribute ${r.positiveInteger} must be a positive whole number.`, D(t, n.start, r.positiveInteger), "local.constraint.positive-integer", {
2046
- name: r.positiveInteger,
2047
- component: a
2048
- });
2049
- }
2050
- break;
2051
- }
2052
- case "text-length": {
2053
- let i = T(e, t, r.min) ?? 0, a = T(e, t, r.max);
2054
- a !== void 0 && a < i && o("local.constraint", "max-length cannot be less than min-length.", D(t, n.start, r.max), "local.constraint.length-order");
2055
- break;
2056
- }
2057
- case "date-bounds": {
2058
- let i = E(e, t, r.min), a = E(e, t, r.max);
2059
- i !== void 0 && !O(i) && o("local.attribute.type", `Date lower bound ${i} is not a valid YYYY-MM-DD.`, D(t, n.start, r.min), "local.attribute.type.date-lower", { value: i }), a !== void 0 && !O(a) && o("local.attribute.type", `Date upper bound ${a} is not a valid YYYY-MM-DD.`, D(t, n.start, r.max), "local.attribute.type.date-upper", { value: a }), i && a && i > a && o("local.constraint", "Date min cannot be later than max.", D(t, n.start, r.min), "local.constraint.date-order");
2060
- break;
2061
- }
2062
- case "nonempty": {
2063
- let e = t[r.attribute];
2064
- if (!e || e.dynamic) break;
2065
- (typeof e.value == "string" ? e.value : String(e.raw ?? "")).trim() || o("local.constraint", `Attribute ${r.attribute} of <${i}> cannot be empty.`, e.offset, `local.constraint.${i}-${r.attribute}`, {
2066
- name: r.attribute,
2067
- component: a
2068
- });
2069
- break;
2070
- }
2071
- case "progress-bounds": {
2072
- let n = T(e, t, r.max) ?? r.defaultMax, i = t[r.value];
2073
- i && !i.dynamic && typeof i.value == "number" && (i.value < 0 || i.value > n) && o("local.constraint", `progress value must be between 0 and ${n}, got ${i.value}.`, i.offset, "local.constraint.progress-range", {
2074
- max: n,
2075
- value: i.value
2122
+ detail: k(e, i)
2076
2123
  });
2077
- break;
2078
- }
2079
- case "timer-duration": {
2080
- let i = T(e, t, r.attribute) ?? r.default;
2081
- (!Number.isInteger(i) || i <= 0) && o("local.constraint", "timer duration must be a positive whole number of seconds.", D(t, n.start, r.attribute), "local.constraint.timer-duration");
2082
- break;
2083
- }
2084
- case "option-count": {
2085
- let a = T(e, t, r.max);
2086
- a !== void 0 && (!Number.isInteger(a) || a < 0) && o("local.constraint", `${i} ${r.max} must be a nonnegative whole number.`, D(t, n.start, r.max), `local.constraint.${i}`);
2087
- break;
2088
2124
  }
2089
- case "selection-requires":
2090
- if (Object.hasOwn(t, r.key)) break;
2091
- for (let e of r.attributes) {
2092
- let n = t[e];
2093
- n && o("local.selection.key", `<${i}> ${e} requires a key attribute naming the selection column.`, n.offset, "local.selection.key.required", {
2094
- component: a,
2095
- name: e
2096
- });
2097
- }
2098
- }
2099
- return r;
2100
- }
2101
- var Ae = /^(\d{4})-(\d{2})-(\d{2})$/;
2102
- function O(e) {
2103
- if (e === "") return !0;
2104
- let t = Ae.exec(e);
2105
- if (!t) return !1;
2106
- let n = Number(t[1]), r = Number(t[2]), i = Number(t[3]);
2107
- return n < 1 || r < 1 || r > 12 || i < 1 ? !1 : i <= [
2108
- 31,
2109
- n % 4 == 0 && n % 100 != 0 || n % 400 == 0 ? 29 : 28,
2110
- 31,
2111
- 30,
2112
- 31,
2113
- 30,
2114
- 31,
2115
- 31,
2116
- 30,
2117
- 31,
2118
- 30,
2119
- 31
2120
- ][r - 1];
2121
- }
2122
- function k(e, t, n) {
2123
- if (n === void 0) return;
2124
- if ("literal" in n) return n.literal;
2125
- let r = t[n.prop];
2126
- if (r) return r.dynamic ? void 0 : typeof r.value == "number" ? r.value : void 0;
2127
- let i = e.props[n.prop]?.default;
2128
- return typeof i == "number" ? i : void 0;
2129
- }
2130
- function je(e, t, n) {
2131
- let r = t.constraints;
2132
- if (!r) return { step: 1 };
2133
- let i = k(e, n, r.min), a = k(e, n, r.max), o = k(e, n, r.step) ?? 1, s = (e) => {
2134
- if (e === void 0 || !("prop" in e)) return;
2135
- let t = n[e.prop];
2136
- return t?.dynamic ? (t.expression ?? "").trim() : void 0;
2137
- }, c = s(r.min), l = s(r.max);
2138
- return {
2139
- ...i === void 0 ? {} : { min: i },
2140
- ...a === void 0 ? {} : { max: a },
2141
- step: o > 0 ? o : 1,
2142
- ...c === void 0 ? {} : { dynamicMin: c },
2143
- ...l === void 0 ? {} : { dynamicMax: l }
2144
- };
2145
- }
2146
- function Me(e, t, n) {
2147
- return k(e, n, t.maxItems);
2148
- }
2149
- function Ne(e, t, n) {
2150
- let r = n === "min" ? e.dynamicMin : e.dynamicMax, i = n === "min" ? t.dynamicMin : t.dynamicMax;
2151
- return r !== void 0 || i !== void 0 ? r === i : e[n] === t[n];
2152
- }
2153
- function Pe(e) {
2154
- return `[${e.dynamicMin === void 0 ? e.min === void 0 ? "-∞" : String(e.min) : `{{ ${e.dynamicMin} }}`}, ${e.dynamicMax === void 0 ? e.max === void 0 ? "∞" : String(e.max) : `{{ ${e.dynamicMax} }}`}] / ${e.step}`;
2155
- }
2156
- function Fe(e, t, n) {
2157
- let r = (e - t) / n;
2158
- return Math.abs(r - Math.round(r)) <= 1e-9 * Math.max(1, Math.abs(r));
2159
- }
2160
- function Ie(e, t, n) {
2161
- let r = e ?? 0, i = e === void 0 ? -Infinity : Math.ceil((e - r) / n), a = t === void 0 ? Infinity : Math.floor((t - r) / n);
2162
- if (i > a) return null;
2163
- let o = -r / n, s = null;
2164
- for (let e of [Math.floor(o), Math.ceil(o)]) {
2165
- let t = Math.min(a, Math.max(i, e));
2166
- if (!Number.isFinite(t)) continue;
2167
- if (s === null) {
2168
- s = t;
2169
- continue;
2170
- }
2171
- let o = r + t * n, c = r + s * n;
2172
- (Math.abs(o) < Math.abs(c) || Math.abs(o) === Math.abs(c) && o < c) && (s = t);
2173
- }
2174
- if (s === null) return null;
2175
- let c = r + s * n;
2176
- return e !== void 0 && c < e || t !== void 0 && c > t ? null : c;
2177
- }
2178
- function Le(e, t, n) {
2179
- switch (e) {
2180
- case "empty": return { value: "" };
2181
- case "false": return { value: !1 };
2182
- case "min": return { value: t?.min ?? 0 };
2183
- case "nearest-zero": {
2184
- let e = t ?? { step: 1 }, n = Ie(e.min, e.max, e.step);
2185
- return n === null ? { error: "no-step" } : { value: n };
2186
- }
2187
- case "duration": return { value: t?.max ?? 60 };
2188
- case "first-option":
2189
- case "first-tab":
2190
- case "first-step":
2191
- case "first-node": return { value: n[0] ?? "" };
2192
- case "checked": return { value: [] };
2193
- case "empty-array": return { value: [] };
2194
- case "max-step": {
2195
- let e = t ?? { step: 1 }, n = e.min ?? 0, r = (e.max ?? n) - n, i = n + Math.max(0, Math.floor(r / e.step + 1e-9)) * e.step;
2196
- return { value: Math.min(e.max ?? i, Math.max(e.min ?? i, i)) };
2197
- }
2198
- case "none": return { value: "" };
2199
- default: return { error: "cannot-derive" };
2200
- }
2201
- }
2202
- function Re(e) {
2203
- switch (e) {
2204
- case "choice":
2205
- case "multi-select": return "options";
2206
- case "tabs": return "tabs";
2207
- case "steps": return "steps";
2208
- case "selection": return "selection";
2209
- case "diagram": return "diagram-nodes";
2210
- case "checklist": return "checklist";
2211
- default: return;
2212
2125
  }
2126
+ let a = r === void 0 ? typeof e.message == "string" ? e.message : String(e.message ?? "") : k(r, i), o = typeof a == "string" ? a : String(a ?? "");
2127
+ return o.length > 2e3 ? `${y(o, u - 1)}…` : o;
2213
2128
  }
2214
- function A(e) {
2215
- let t = {};
2216
- for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
2217
- return t;
2218
- }
2219
- function ze(e) {
2220
- let t = [];
2221
- for (let n of S(e)) switch (n.kind) {
2222
- case "value-date":
2223
- t.push(A({
2224
- kind: "date",
2225
- min: n.min,
2226
- max: n.max,
2227
- required: n.required
2228
- }));
2229
- break;
2230
- case "value-length":
2231
- t.push(A({
2232
- kind: "length",
2233
- min: n.min,
2234
- max: n.max
2235
- })), (n.email !== void 0 || n.emailType !== void 0) && t.push(A({
2236
- kind: "email",
2237
- type: n.email ?? "type",
2238
- value: n.emailType ?? "email"
2239
- }));
2240
- break;
2241
- case "value-email":
2242
- t.push(A({
2243
- kind: "email",
2244
- type: n.type ?? "type",
2245
- value: n.value ?? "email"
2246
- }));
2247
- break;
2248
- case "value-required": t.push({
2249
- kind: "required",
2250
- required: n.required
2251
- });
2252
- }
2253
- return t;
2254
- }
2255
- function Be(e) {
2256
- if (!e || typeof e != "object") return;
2257
- let t = e.kernel;
2258
- if (t && typeof t == "object") return t;
2259
- }
2260
- var Ve = /^[A-Za-z_][A-Za-z0-9_-]*$/;
2261
- function He(e) {
2262
- return Ve.test(e);
2263
- }
2264
- function Ue(e, t, n) {
2265
- let r = [];
2266
- for (let i of e) {
2267
- let e = i.target;
2268
- e ? e.startsWith("#") || /\s/.test(e) ? r.push({
2269
- code: "local.jump.target",
2270
- message: `<${i.name}> target "${e}" must be a bare heading slug or anchor id without "#" or whitespace.`,
2271
- start: i.offset,
2272
- key: "local.jump.bad-target",
2273
- params: { target: e }
2274
- }) : !t.has(e) && !n.has(e) && r.push({
2275
- code: "local.jump.target",
2276
- message: `<${i.name}> target "${e}" does not resolve to a heading or explicit anchor in this document.`,
2277
- start: i.offset,
2278
- key: "local.jump.unresolved",
2279
- params: { target: e }
2280
- }) : r.push({
2281
- code: "local.jump.target",
2282
- message: "<jump> target cannot be empty.",
2283
- start: i.offset,
2284
- key: "local.jump.empty"
2285
- });
2286
- }
2287
- return r;
2288
- }
2289
- Object.freeze({
2290
- arrayLength: c,
2291
- dataTableColumns: 20,
2292
- plotCurves: 16,
2293
- plotPoints: ee
2294
- });
2295
2129
  // src/local/html/html-names.ts
2296
- var j = /* @__PURE__ */ new Set(/* @__PURE__ */ "b.strong.i.em.s.del.u.mark.sup.sub.br.hr.img.p.h1.h2.h3.h4.h5.h6.div.span.details.summary.blockquote.code.pre.ul.ol.li.a".split(".")), We = /* @__PURE__ */ new Set([
2130
+ var M = /* @__PURE__ */ new Set(/* @__PURE__ */ "b.strong.i.em.s.del.u.mark.sup.sub.br.hr.img.p.h1.h2.h3.h4.h5.h6.div.span.details.summary.blockquote.code.pre.ul.ol.li.a".split(".")), me = /* @__PURE__ */ new Set([
2297
2131
  "div",
2298
2132
  "p",
2299
2133
  "h1",
@@ -2303,16 +2137,16 @@ var j = /* @__PURE__ */ new Set(/* @__PURE__ */ "b.strong.i.em.s.del.u.mark.sup.
2303
2137
  "h5",
2304
2138
  "h6"
2305
2139
  ]);
2306
- function Ge(e) {
2140
+ function he(e) {
2307
2141
  let t = e.trim().toLowerCase();
2308
2142
  return t === "left" || t === "center" || t === "right" || t === "justify" ? t : null;
2309
2143
  }
2310
- var Ke = /* @__PURE__ */ new Set([
2144
+ var ge = /* @__PURE__ */ new Set([
2311
2145
  "href",
2312
2146
  "target",
2313
2147
  "rel"
2314
2148
  ]);
2315
- function qe(e, t) {
2149
+ function _e(e, t) {
2316
2150
  if (t?.toLowerCase() !== "_blank") return e;
2317
2151
  let n = [], r = /* @__PURE__ */ new Set();
2318
2152
  for (let t of (e ?? "").split(/[\t\n\f\r ]+/)) {
@@ -2322,7 +2156,98 @@ function qe(e, t) {
2322
2156
  for (let e of ["noopener", "noreferrer"]) r.has(e) || n.push(e);
2323
2157
  return n.join(" ");
2324
2158
  }
2325
- var M = Object.freeze([
2159
+ // src/themes/document-theme.ts
2160
+ var N = "reactive-md-theme-1", P = Object.freeze({
2161
+ name: "default",
2162
+ protocol: N,
2163
+ colorSchemes: Object.freeze(["light", "dark"])
2164
+ });
2165
+ function ve(e, t) {
2166
+ let n = typeof t == "string" ? t.length : Infinity;
2167
+ if (!e || typeof e.start != "number" || typeof e.end != "number" || !Number.isFinite(e.start) || !Number.isFinite(e.end)) return {
2168
+ start: 0,
2169
+ end: 0
2170
+ };
2171
+ let r = Math.max(0, Math.min(n, Math.floor(e.start)));
2172
+ return {
2173
+ start: r,
2174
+ end: Math.max(r, Math.min(n, Math.floor(e.end)))
2175
+ };
2176
+ }
2177
+ function ye(e, t) {
2178
+ if (typeof e != "string" || e.length === 0) return {
2179
+ line: 1,
2180
+ column: 1
2181
+ };
2182
+ let n = Math.min(t, e.length), r = 1, i = 0;
2183
+ for (let t = 0; t < n; t += 1) e[t] === "\n" && (r += 1, i = t + 1);
2184
+ return {
2185
+ line: r,
2186
+ column: t - i + 1
2187
+ };
2188
+ }
2189
+ function be(e, t, n, r) {
2190
+ let i = ve(n, r), { line: a, column: o } = ye(r, i.start);
2191
+ return {
2192
+ code: e,
2193
+ message: j(t),
2194
+ severity: "warning",
2195
+ range: i,
2196
+ line: a,
2197
+ column: o,
2198
+ messageKey: t.key,
2199
+ ...t.params ? { params: t.params } : {}
2200
+ };
2201
+ }
2202
+ function xe(e, t, n, r) {
2203
+ let i = (e, t) => ({
2204
+ name: P.name,
2205
+ diagnostics: [be(e, t, n, r)]
2206
+ }), a = e;
2207
+ if (a == null || a === "") return {
2208
+ name: P.name,
2209
+ diagnostics: []
2210
+ };
2211
+ if (!F(a)) return i("local.theme.name", w("local.theme.name", {
2212
+ name: String(a),
2213
+ limit: 64
2214
+ }));
2215
+ let o = a;
2216
+ if (o === P.name) return {
2217
+ name: P.name,
2218
+ diagnostics: []
2219
+ };
2220
+ if (!Array.isArray(t)) return i("local.theme.missing", w("local.theme.missing", { name: o }));
2221
+ let s = 0, c = null;
2222
+ try {
2223
+ for (let e of t) typeof e == "object" && e && !Array.isArray(e) && e.name === o && (s += 1, c = e);
2224
+ } catch {
2225
+ return i("local.theme.manifest", w("local.theme.manifest.unreadable"));
2226
+ }
2227
+ if (s === 0) return i("local.theme.missing", w("local.theme.missing", { name: o }));
2228
+ if (s > 1) return i("local.theme.duplicate", w("local.theme.duplicate", { name: o }));
2229
+ try {
2230
+ let e = c;
2231
+ if (!e || typeof e != "object") return i("local.theme.manifest", w("local.theme.manifest.definition", { name: o }));
2232
+ if (e.protocol !== "reactive-md-theme-1") return i("local.theme.protocol", w("local.theme.protocol", {
2233
+ name: o,
2234
+ protocol: N
2235
+ }));
2236
+ let t = e.colorSchemes;
2237
+ if (!Array.isArray(t) || !t.includes("light") || !t.includes("dark")) return i("local.theme.modes", w("local.theme.modes", { name: o }));
2238
+ } catch {
2239
+ return i("local.theme.manifest", w("local.theme.manifest.selected", { name: o }));
2240
+ }
2241
+ return {
2242
+ name: o,
2243
+ diagnostics: []
2244
+ };
2245
+ }
2246
+ var Se = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
2247
+ function F(e) {
2248
+ return typeof e == "string" && e.length > 0 && e.length <= 64 && Se.test(e);
2249
+ }
2250
+ var I = Object.freeze([
2326
2251
  Object.freeze({
2327
2252
  name: "computed",
2328
2253
  form: "leaf",
@@ -2403,7 +2328,7 @@ var M = Object.freeze([
2403
2328
  }
2404
2329
  })
2405
2330
  ]);
2406
- function Je(e, t) {
2331
+ function Ce(e, t) {
2407
2332
  let n = Array.from({ length: t.length + 1 }, (e, t) => t);
2408
2333
  for (let r = 1; r <= e.length; r++) {
2409
2334
  let i = n[0];
@@ -2415,154 +2340,27 @@ function Je(e, t) {
2415
2340
  }
2416
2341
  return n[t.length];
2417
2342
  }
2418
- function Ye(e, t) {
2343
+ function we(e, t) {
2419
2344
  let n, r = Infinity;
2420
2345
  for (let i of t) {
2421
- let t = Je(e, i);
2346
+ let t = Ce(e, i);
2422
2347
  t < r && (n = i, r = t);
2423
2348
  }
2424
2349
  return r <= 2 ? n : void 0;
2425
2350
  }
2426
- // src/local/theme/theme-name.ts
2427
- var Xe = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
2428
- function Ze(e) {
2429
- return typeof e == "string" && e.length > 0 && e.length <= 64 && Xe.test(e);
2430
- }
2431
- // src/sdk/registry-core.ts
2432
- var N = /* @__PURE__ */ new WeakMap();
2433
- function Qe(e) {
2434
- return {
2435
- kind: e.kind,
2436
- ...e.required === !0 ? { required: !0 } : {},
2437
- ...e.static === !0 ? { static: !0 } : {},
2438
- ...e.dynamic === void 0 ? {} : { dynamic: e.dynamic },
2439
- ...e.default === void 0 ? {} : { default: e.default },
2440
- ...e.nullable === !0 ? { nullable: !0 } : {},
2441
- ...e.enum ? { values: [...e.enum] } : {},
2442
- ...e.pattern === void 0 ? {} : { pattern: e.pattern },
2443
- ...e.min === void 0 ? {} : { min: e.min },
2444
- ...e.max === void 0 ? {} : { max: e.max },
2445
- ...e.integer === !0 ? { integer: !0 } : {},
2446
- ...e.positive === !0 ? { positive: !0 } : {},
2447
- ...e.color === !0 ? { color: !0 } : {},
2448
- ...e.coerce === void 0 ? {} : { coerce: e.coerce }
2449
- };
2450
- }
2451
- function $e(e) {
2452
- return {
2453
- kind: e.kind,
2454
- family: e.family,
2455
- bind: e.bind,
2456
- initial: e.initial,
2457
- initialRule: e.initialRule,
2458
- required: e.required === !0,
2459
- ...e.exclusive === !0 ? { exclusive: !0 } : {},
2460
- ...e.options ? { options: e.options } : {},
2461
- ...e.constraints ? { constraints: e.constraints } : {},
2462
- ...e.maxItems ? { maxItems: e.maxItems } : {},
2463
- ...e.requiresAttributes ? { requiresAttributes: e.requiresAttributes } : {},
2464
- ...e.compare ? { compare: e.compare } : {},
2465
- ...e.retain === !1 ? { retain: !1 } : {}
2466
- };
2467
- }
2468
- function et(e, t) {
2469
- if (t === e.bind) return {
2470
- kind: "string",
2471
- static: !0
2472
- };
2473
- switch (e.kind) {
2474
- case "number": return {
2475
- kind: "number",
2476
- static: !0
2477
- };
2478
- case "boolean": return {
2479
- kind: "boolean",
2480
- static: !0
2481
- };
2482
- default: return {
2483
- kind: "string",
2484
- static: !0
2485
- };
2486
- }
2487
- }
2488
- function P(e, t) {
2489
- if (e === void 0) return t === "leaf" ? "none" : "any";
2490
- switch (e.rule) {
2491
- case "components": return e.child === "card" ? "cards" : e.child === "disclosure" ? "disclosures" : e.child === "column" ? "columns" : "any";
2492
- default: return e.rule;
2493
- }
2494
- }
2495
- function F(t) {
2496
- let n = N.get(t);
2497
- if (n !== void 0) return n;
2498
- let r = t.bindings ?? {}, i = t.structure ?? e(t.children), a = r.value, o = [];
2499
- for (let [e, t] of Object.entries(r)) e !== "value" && o.push(Object.freeze({
2500
- name: e,
2501
- bind: t.bind,
2502
- initial: t.initial,
2503
- kind: t.kind,
2504
- family: t.family,
2505
- exclusive: t.exclusive === !0,
2506
- initialRule: t.initialRule
2507
- }));
2508
- let s = {};
2509
- for (let [e, n] of Object.entries(t.props)) s[e] = Qe(n);
2510
- for (let e of Object.values(r)) {
2511
- let t = [e.bind, e.initial];
2512
- for (let n of t) Object.hasOwn(s, n) || (n !== e.initial || e.initialRule !== "checked" && e.initialRule !== "duration") && (s[n] = et(e, n));
2513
- }
2514
- let c = Object.freeze({
2515
- name: t.name,
2516
- form: t.form,
2517
- props: Object.freeze(s),
2518
- ...a ? { binding: Object.freeze($e(a)) } : {},
2519
- ...Object.keys(r).length ? { bindings: Object.freeze({ ...r }) } : {},
2520
- ...o.length ? { slots: Object.freeze(o) } : {},
2521
- ...i ? { structure: i } : {},
2522
- ...t.rules ? { rules: t.rules } : {},
2523
- ...t.slotRelations ? { slotRelations: t.slotRelations } : {},
2524
- ...t.legacyHost === !0 ? { legacyHost: !0 } : {},
2525
- childRule: P(i, t.form),
2526
- label: i?.label ?? "none",
2527
- ...i?.parents ? { parent: i.parents } : {},
2528
- ...a ? { initialRule: a.initialRule } : {}
2529
- });
2530
- return N.set(t, c), c;
2531
- }
2532
- function tt(e) {
2533
- return F(e);
2534
- }
2535
- var I = /* @__PURE__ */ new WeakMap();
2536
- function nt(t) {
2537
- let n = I.get(t);
2538
- if (n !== void 0) return n;
2539
- let r = t.structure ?? e(t.children), i = w({
2540
- name: t.name,
2541
- form: t.form,
2542
- props: t.props,
2543
- childRule: P(r, t.form)
2544
- }, {
2545
- ...r ? { structure: r } : {},
2546
- ...t.rules ? { rules: t.rules } : {},
2547
- ...t.bindings ? { bindings: t.bindings } : {},
2548
- ...t.slotRelations ? { slotRelations: t.slotRelations } : {},
2549
- ...t.legacyHost ? { legacyHost: !0 } : {}
2550
- });
2551
- return I.set(t, i), i;
2552
- }
2553
2351
  // src/sdk/compat-profile.ts
2554
2352
  var L = Object.freeze([Object.freeze({
2555
2353
  name: "reactive-md-config/v1@0.7.0",
2556
- protocol: s,
2354
+ protocol: t,
2557
2355
  sdkRange: "0.7.0",
2558
- targetProtocol: n,
2356
+ targetProtocol: r,
2559
2357
  targetSdkRange: "0.7.0",
2560
2358
  preset: Object.freeze({
2561
2359
  id: "reactive-md/default",
2562
2360
  version: "0.7.0"
2563
2361
  }),
2564
2362
  legacyKeys: Object.freeze([Object.freeze({
2565
- profile: s,
2363
+ profile: t,
2566
2364
  algorithm: "external-components/v1"
2567
2365
  })]),
2568
2366
  source: "git tag v0.7.0:src/presets/default.ts and src/sdk/config.ts; docs/compatibility/compatibility-ch.md"
@@ -2570,11 +2368,11 @@ var L = Object.freeze([Object.freeze({
2570
2368
  function R(e, t = L) {
2571
2369
  for (let n of t) if (n.preset.id === e.id && n.preset.version === e.version) return n;
2572
2370
  }
2573
- function rt(e = []) {
2371
+ function Te(e = []) {
2574
2372
  return e.length === 0 ? L : Object.freeze([...L, ...e]);
2575
2373
  }
2576
2374
  // src/sdk/assembly.ts
2577
- var it = /* @__PURE__ */ new Set([
2375
+ var Ee = /* @__PURE__ */ new Set([
2578
2376
  "protocol",
2579
2377
  "presets",
2580
2378
  "components",
@@ -2607,11 +2405,11 @@ function K(e) {
2607
2405
  function q(e, t) {
2608
2406
  return JSON.stringify(K(e)) === JSON.stringify(K(t));
2609
2407
  }
2610
- function at(e) {
2408
+ function De(e) {
2611
2409
  Array.isArray(e) || H("assembly.presets", "must be an array."), e.length > z && H("assembly.presets", `accepts at most ${z} packages.`);
2612
2410
  let t = W(e.map((e, t) => {
2613
2411
  try {
2614
- return u(e);
2412
+ return m(e);
2615
2413
  } catch (e) {
2616
2414
  H(`assembly.presets[${t}]`, e instanceof Error ? e.message : String(e));
2617
2415
  }
@@ -2619,63 +2417,63 @@ function at(e) {
2619
2417
  for (let e of t) n.has(e.id) && H("assembly.presets", `preset "${e.id}" is selected more than once.`), n.add(e.id);
2620
2418
  return Object.freeze(t);
2621
2419
  }
2622
- function ot(e) {
2420
+ function Oe(e) {
2623
2421
  Array.isArray(e) || H("assembly.components", "must be an array."), e.length > B && H("assembly.components", `accepts at most ${B} components.`);
2624
2422
  let t = W(e.map((e, t) => {
2625
2423
  try {
2626
- return f(e);
2424
+ return o(e);
2627
2425
  } catch (e) {
2628
2426
  H(`assembly.components[${t}]`, e instanceof Error ? e.message : String(e));
2629
2427
  }
2630
2428
  }), (e) => e.id);
2631
2429
  return Object.freeze(t);
2632
2430
  }
2633
- function st(e) {
2431
+ function ke(e) {
2634
2432
  Array.isArray(e) || H("assembly.themes", "must be an array."), e.length > V && H("assembly.themes", `accepts at most ${V} themes.`);
2635
2433
  let t = /* @__PURE__ */ new Set();
2636
2434
  return Object.freeze(W(e.map((e, n) => {
2637
2435
  G(e) || H(`assembly.themes[${n}]`, "must be an object.");
2638
- let r = e.id, a = e.name, o = e.version;
2639
- return (typeof r != "string" || r.length === 0) && H(`assembly.themes[${n}].id`, "must be a non-empty string."), (typeof a != "string" || a.length === 0) && H(`assembly.themes[${n}].name`, "must be a non-empty string."), typeof o == "string" && i(o) || H(`assembly.themes[${n}].version`, "must be a semantic version."), t.has(r) && H("assembly.themes", `theme id "${r}" is declared more than once.`), t.add(r), Object.freeze({ ...e });
2436
+ let r = e.id, i = e.name, a = e.version;
2437
+ return (typeof r != "string" || r.length === 0) && H(`assembly.themes[${n}].id`, "must be a non-empty string."), (typeof i != "string" || i.length === 0) && H(`assembly.themes[${n}].name`, "must be a non-empty string."), typeof a == "string" && l(a) || H(`assembly.themes[${n}].version`, "must be a semantic version."), t.has(r) && H("assembly.themes", `theme id "${r}" is declared more than once.`), t.add(r), Object.freeze({ ...e });
2640
2438
  }), (e) => e.id));
2641
2439
  }
2642
- function ct(e) {
2440
+ function Ae(e) {
2643
2441
  G(e) || H("assembly", "must be an object.");
2644
- for (let t of Object.keys(e)) it.has(t) || H("assembly", `unknown field "${t}".`);
2645
- e.protocol !== "reactive-md-assembly/v1" && H("assembly.protocol", `must be "${a}".`);
2442
+ for (let t of Object.keys(e)) Ee.has(t) || H("assembly", `unknown field "${t}".`);
2443
+ e.protocol !== "reactive-md-assembly/v1" && H("assembly.protocol", `must be "${s}".`);
2646
2444
  let t = e.replacementPolicy;
2647
2445
  return t !== "allow" && t !== "forbid" && H("assembly.replacementPolicy", "must be \"allow\" or \"forbid\"."), Object.freeze({
2648
- protocol: a,
2649
- presets: at(e.presets),
2650
- components: ot(e.components),
2446
+ protocol: s,
2447
+ presets: De(e.presets),
2448
+ components: Oe(e.components),
2651
2449
  replacementPolicy: t,
2652
- themes: st(e.themes)
2450
+ themes: ke(e.themes)
2653
2451
  });
2654
2452
  }
2655
- function lt(e) {
2656
- let t = new Map(e.map((e) => [e.id, e])), n = /* @__PURE__ */ new Map(), r = [], a = (e) => {
2657
- let o = n.get(e);
2658
- if (o === "done") return;
2659
- o === "visiting" && H("assembly.presets", `preset dependency cycle at "${e}".`);
2660
- let s = t.get(e);
2661
- s || H("assembly.presets", `missing preset dependency "${e}".`), n.set(e, "visiting");
2662
- for (let e of W(s.dependencies ?? [], (e) => e.id)) {
2453
+ function je(e) {
2454
+ let t = new Map(e.map((e) => [e.id, e])), n = /* @__PURE__ */ new Map(), r = [], i = (e) => {
2455
+ let a = n.get(e);
2456
+ if (a === "done") return;
2457
+ a === "visiting" && H("assembly.presets", `preset dependency cycle at "${e}".`);
2458
+ let o = t.get(e);
2459
+ o || H("assembly.presets", `missing preset dependency "${e}".`), n.set(e, "visiting");
2460
+ for (let e of W(o.dependencies ?? [], (e) => e.id)) {
2663
2461
  let n = t.get(e.id);
2664
- n || H("assembly.presets", `preset "${s.id}" requires missing preset "${e.id}".`), i(e.version) || H("assembly.presets", `preset dependency "${e.id}" must use an exact version.`), n.version !== e.version && H("assembly.presets", `preset "${s.id}" requires "${e.id}" ${e.version}, but ${n.version} is installed.`), a(e.id);
2462
+ n || H("assembly.presets", `preset "${o.id}" requires missing preset "${e.id}".`), l(e.version) || H("assembly.presets", `preset dependency "${e.id}" must use an exact version.`), n.version !== e.version && H("assembly.presets", `preset "${o.id}" requires "${e.id}" ${e.version}, but ${n.version} is installed.`), i(e.id);
2665
2463
  }
2666
- n.set(e, "done"), r.push(s);
2464
+ n.set(e, "done"), r.push(o);
2667
2465
  };
2668
- for (let e of [...t.keys()].sort(U)) a(e);
2466
+ for (let e of [...t.keys()].sort(U)) i(e);
2669
2467
  return Object.freeze(r);
2670
2468
  }
2671
2469
  function J(e) {
2672
2470
  let { description: t, ...n } = e;
2673
2471
  return n;
2674
2472
  }
2675
- function Y(t) {
2676
- return t.structure ?? e(t.children) ?? null;
2473
+ function Y(e) {
2474
+ return e.structure ?? d(e.children) ?? null;
2677
2475
  }
2678
- function ut(e, t) {
2476
+ function Me(e, t) {
2679
2477
  for (let n of [
2680
2478
  "interactive",
2681
2479
  "static",
@@ -2684,7 +2482,7 @@ function ut(e, t) {
2684
2482
  ]) if (t.capabilities[n] && !e.capabilities[n]) return !1;
2685
2483
  return !0;
2686
2484
  }
2687
- function dt(e, t) {
2485
+ function Ne(e, t) {
2688
2486
  let n = e.definition, r = t.definition, i = `assembly.replacements["${n.id}"]`;
2689
2487
  (n.id !== r.id || n.name !== r.name) && H(i, "the replacement must keep the target id and tag name."), n.form !== r.form && H(i, "the replacement must keep the target form.");
2690
2488
  for (let e of Object.keys(n.props)) {
@@ -2695,24 +2493,24 @@ function dt(e, t) {
2695
2493
  let a = n.bindings ?? {}, o = r.bindings ?? {}, s = Object.keys(a).sort(U);
2696
2494
  q(s, Object.keys(o).sort(U)) || H(i, "the replacement must keep the target binding slots unchanged.");
2697
2495
  for (let e of s) q(a[e], o[e]) || H(i, `the replacement changed binding slot "${e}".`);
2698
- q(Y(n), Y(r)) || H(i, "the replacement changed the target child structure."), q(n.rules ?? [], r.rules ?? []) || H(i, "the replacement changed semantic rules."), q(n.slotRelations ?? [], r.slotRelations ?? []) || H(i, "the replacement changed slot relations."), n.legacyHost === !0 != (r.legacyHost === !0) && H(i, "the replacement changed legacyHost."), ut(r, n) || H(i, "the replacement downgraded a declared capability.");
2496
+ q(Y(n), Y(r)) || H(i, "the replacement changed the target child structure."), q(n.rules ?? [], r.rules ?? []) || H(i, "the replacement changed semantic rules."), q(n.slotRelations ?? [], r.slotRelations ?? []) || H(i, "the replacement changed slot relations."), n.legacyHost === !0 != (r.legacyHost === !0) && H(i, "the replacement changed legacyHost."), Me(r, n) || H(i, "the replacement downgraded a declared capability.");
2699
2497
  }
2700
- function ft(e, t) {
2701
- return e.id === t.id ? t.version === void 0 || r(t.version) !== null && l(e.version, t.version) : !1;
2498
+ function Pe(e, t) {
2499
+ return e.id === t.id ? t.version === void 0 || a(t.version) !== null && n(e.version, t.version) : !1;
2702
2500
  }
2703
- function pt(e, n) {
2501
+ function Fe(e, t) {
2704
2502
  return Object.freeze({
2705
2503
  id: e.definition.id,
2706
2504
  name: e.definition.name,
2707
2505
  fromVersion: e.definition.version,
2708
- toVersion: n.definition.version,
2709
- fromDigest: t(e.definition),
2710
- toDigest: t(n.definition),
2506
+ toVersion: t.definition.version,
2507
+ fromDigest: c(e.definition),
2508
+ toDigest: c(t.definition),
2711
2509
  ...e.origin.kind === "preset" ? { fromPreset: e.origin.id } : {},
2712
- ...n.origin.kind === "preset" ? { toPreset: n.origin.id } : {}
2510
+ ...t.origin.kind === "preset" ? { toPreset: t.origin.id } : {}
2713
2511
  });
2714
2512
  }
2715
- function mt(e, t) {
2513
+ function Ie(e, t) {
2716
2514
  let n = [], r = 0;
2717
2515
  for (let t of e) for (let e of t.components) n.push({
2718
2516
  definition: e,
@@ -2729,7 +2527,7 @@ function mt(e, t) {
2729
2527
  }), r += 1;
2730
2528
  return n;
2731
2529
  }
2732
- function ht(e) {
2530
+ function Le(e) {
2733
2531
  let t = /* @__PURE__ */ new Map();
2734
2532
  for (let n of e) n.authoring !== void 0 && n.authoring.length !== 0 && t.set(n.id, new Map(n.authoring.map((e) => [e.componentId, e.authoring])));
2735
2533
  return t;
@@ -2750,13 +2548,13 @@ function Z(e, t) {
2750
2548
  let n = e.origin.kind === "preset" ? t.get(e.origin.id)?.get(e.definition.id) : void 0;
2751
2549
  return X(e.definition.authoring, n);
2752
2550
  }
2753
- function gt(e, t) {
2754
- return t === void 0 || t === e.authoring ? e : f({
2551
+ function Re(e, t) {
2552
+ return t === void 0 || t === e.authoring ? e : o({
2755
2553
  ...e,
2756
2554
  authoring: t
2757
2555
  });
2758
2556
  }
2759
- function _t(e, t, n) {
2557
+ function ze(e, t, n) {
2760
2558
  let r = /* @__PURE__ */ new Map();
2761
2559
  for (let t of e) {
2762
2560
  let e = r.get(t.definition.id);
@@ -2782,42 +2580,42 @@ function _t(e, t, n) {
2782
2580
  let c = s[0];
2783
2581
  c.definition.replaces !== void 0 && H("assembly.replacements", `component id "${e[0].definition.id}" uses a replacement chain.`);
2784
2582
  let l = o.definition.replaces;
2785
- ft(c.definition, l) || H("assembly.replacements", `replacement for "${c.definition.id}" does not match base version ${c.definition.version}.`), dt(c, o);
2583
+ Pe(c.definition, l) || H("assembly.replacements", `replacement for "${c.definition.id}" does not match base version ${c.definition.version}.`), Ne(c, o);
2786
2584
  let u = X(Z(c, n), Z(o, n));
2787
2585
  i.push({
2788
2586
  ...o,
2789
2587
  position: c.index,
2790
2588
  ...u === void 0 ? {} : { authoring: u }
2791
- }), a.push(pt(c, o));
2589
+ }), a.push(Fe(c, o));
2792
2590
  }
2793
2591
  return i.sort((e, t) => e.position - t.position), {
2794
2592
  active: Object.freeze(i),
2795
2593
  replacements: Object.freeze(W(a, (e) => e.id))
2796
2594
  };
2797
2595
  }
2798
- function vt(e) {
2799
- let t = /* @__PURE__ */ new Map(), n = new Map(e.map((e) => [e.definition.id, e.definition]));
2800
- for (let r of e) {
2801
- let e = r.definition, i = t.get(e.name);
2802
- i !== void 0 && ((i.origin.kind === "preset" || r.origin.kind === "preset") && H("assembly.components", `name "${e.name}" conflicts with a built-in component "${i.definition.id}".`), H("assembly.components", `component name "${e.name}" is declared more than once by "${i.definition.id}" and "${e.id}".`)), t.set(e.name, r);
2803
- let a = e.requires?.kernel;
2804
- a !== void 0 && !l("0.7.0", a) && H("assembly.components", `component "${e.id}" requires kernel ${a}, but ${m} is installed.`);
2805
- for (let t of e.dependencies ?? []) {
2806
- let r = n.get(t.id);
2807
- r || H("assembly.dependencies", `component "${e.id}" requires missing component "${t.id}".`), t.version !== void 0 && !l(r.version, t.version) && H("assembly.dependencies", `component "${e.id}" requires "${t.id}" ${t.version}, but version ${r.version} is installed.`);
2596
+ function Be(t) {
2597
+ let r = /* @__PURE__ */ new Map(), i = new Map(t.map((e) => [e.definition.id, e.definition]));
2598
+ for (let a of t) {
2599
+ let t = a.definition, o = r.get(t.name);
2600
+ o !== void 0 && ((o.origin.kind === "preset" || a.origin.kind === "preset") && H("assembly.components", `name "${t.name}" conflicts with a built-in component "${o.definition.id}".`), H("assembly.components", `component name "${t.name}" is declared more than once by "${o.definition.id}" and "${t.id}".`)), r.set(t.name, a);
2601
+ let s = t.requires?.kernel;
2602
+ s !== void 0 && !n("0.7.0", s) && H("assembly.components", `component "${t.id}" requires kernel ${s}, but ${e} is installed.`);
2603
+ for (let e of t.dependencies ?? []) {
2604
+ let r = i.get(e.id);
2605
+ r || H("assembly.dependencies", `component "${t.id}" requires missing component "${e.id}".`), e.version !== void 0 && !n(r.version, e.version) && H("assembly.dependencies", `component "${t.id}" requires "${e.id}" ${e.version}, but version ${r.version} is installed.`);
2808
2606
  }
2809
2607
  }
2810
- let r = /* @__PURE__ */ new Map(), i = (e, t) => {
2811
- let a = r.get(e);
2812
- if (a !== "done") {
2813
- a === "visiting" && H("assembly.dependencies", `dependency cycle: ${[...t, e].join(" -> ")}.`), r.set(e, "visiting");
2814
- for (let r of n.get(e)?.dependencies ?? []) n.has(r.id) && i(r.id, [...t, e]);
2815
- r.set(e, "done");
2608
+ let a = /* @__PURE__ */ new Map(), o = (e, t) => {
2609
+ let n = a.get(e);
2610
+ if (n !== "done") {
2611
+ n === "visiting" && H("assembly.dependencies", `dependency cycle: ${[...t, e].join(" -> ")}.`), a.set(e, "visiting");
2612
+ for (let n of i.get(e)?.dependencies ?? []) i.has(n.id) && o(n.id, [...t, e]);
2613
+ a.set(e, "done");
2816
2614
  }
2817
2615
  };
2818
- for (let e of [...n.keys()].sort(U)) i(e, []);
2616
+ for (let e of [...i.keys()].sort(U)) o(e, []);
2819
2617
  }
2820
- function yt(e, t) {
2618
+ function Ve(e, t) {
2821
2619
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = (e, t) => {
2822
2620
  n.get(e.id) && H("assembly.themes", `theme id "${e.id}" is declared by both ${t} and another source.`), r.get(e.name) && H("assembly.themes", `theme name "${e.name}" is declared by both ${t} and another source.`), n.set(e.id, e), r.set(e.name, e);
2823
2621
  };
@@ -2825,30 +2623,30 @@ function yt(e, t) {
2825
2623
  for (let e of t) i(e, "external");
2826
2624
  return Object.freeze(W([...n.values()], (e) => e.id));
2827
2625
  }
2828
- function bt(e) {
2626
+ function He(e) {
2829
2627
  return Object.freeze(W(e.map((e) => ({
2830
2628
  id: e.id,
2831
2629
  version: e.version,
2832
- digest: d(e)
2630
+ digest: p(e)
2833
2631
  })), (e) => e.id));
2834
2632
  }
2835
- function xt(e, r, i) {
2633
+ function Ue(e, t, n) {
2836
2634
  let a = JSON.stringify({
2837
- protocol: n,
2635
+ protocol: r,
2838
2636
  presets: W(e, (e) => e.id),
2839
- registry: [...r].map((e) => ({
2637
+ registry: [...t].map((e) => ({
2840
2638
  id: e.id,
2841
2639
  name: e.name,
2842
2640
  version: e.version,
2843
- digest: t(e)
2641
+ digest: c(e)
2844
2642
  })).sort((e, t) => U(e.id, t.id)),
2845
- replacements: W(i, (e) => e.id)
2643
+ replacements: W(n, (e) => e.id)
2846
2644
  });
2847
- return p(a);
2645
+ return i(a);
2848
2646
  }
2849
2647
  function Q(e, n) {
2850
2648
  let r = JSON.stringify({
2851
- protocol: s,
2649
+ protocol: t,
2852
2650
  presets: [{
2853
2651
  id: e.id,
2854
2652
  version: e.version
@@ -2856,15 +2654,15 @@ function Q(e, n) {
2856
2654
  components: [...n].map((e) => ({
2857
2655
  id: e.id,
2858
2656
  version: e.version,
2859
- digest: t(e)
2657
+ digest: c(e)
2860
2658
  })).sort((e, t) => U(e.id, t.id))
2861
2659
  });
2862
- return p(r);
2660
+ return i(r);
2863
2661
  }
2864
- function St(e, t = {}) {
2865
- let n = lt(e.presets), r = _t(mt(n, e.components), e.replacementPolicy, ht(n));
2866
- vt(r.active);
2867
- let i = Object.freeze(r.active.map((e) => gt(e.definition, e.authoring))), a = Object.freeze(W(r.active.filter((e) => e.origin.kind === "external").map((e) => e.definition), (e) => e.id)), o = bt(n), s = yt(n, e.themes), c = xt(o, i, r.replacements), l = [], u = t.legacyProfiles === void 0 || n.length !== 1 || r.replacements.length !== 0 ? void 0 : R({
2662
+ function We(e, t = {}) {
2663
+ let n = je(e.presets), r = ze(Ie(n, e.components), e.replacementPolicy, Le(n));
2664
+ Be(r.active);
2665
+ let i = Object.freeze(r.active.map((e) => Re(e.definition, e.authoring))), a = Object.freeze(W(r.active.filter((e) => e.origin.kind === "external").map((e) => e.definition), (e) => e.id)), o = He(n), s = Ve(n, e.themes), c = Ue(o, i, r.replacements), l = [], u = t.legacyProfiles === void 0 || n.length !== 1 || r.replacements.length !== 0 ? void 0 : R({
2868
2666
  id: n[0].id,
2869
2667
  version: n[0].version
2870
2668
  }, t.legacyProfiles), d = u?.legacyKeys[0];
@@ -2881,9 +2679,9 @@ function St(e, t = {}) {
2881
2679
  legacyKeys: Object.freeze(l)
2882
2680
  });
2883
2681
  }
2884
- function Ct(e, t, r = t.legacyKeys) {
2682
+ function Ge(e, t, n = t.legacyKeys) {
2885
2683
  return Object.freeze({
2886
- protocol: n,
2684
+ protocol: r,
2887
2685
  assembly: e,
2888
2686
  key: t.key,
2889
2687
  presets: t.presets,
@@ -2891,31 +2689,31 @@ function Ct(e, t, r = t.legacyKeys) {
2891
2689
  replacements: t.replacements,
2892
2690
  registry: t.registry,
2893
2691
  themes: t.themes,
2894
- legacyKeys: Object.freeze(r)
2692
+ legacyKeys: Object.freeze(n)
2895
2693
  });
2896
2694
  }
2897
- function wt(e) {
2695
+ function Ke(e) {
2898
2696
  return Object.freeze({
2899
2697
  protocol: "reactive-md-assembly-seal/v1",
2900
2698
  configKey: e.key,
2901
2699
  presets: Object.freeze(W(e.presets, (e) => e.id)),
2902
- components: Object.freeze(W(e.registry.map(o), (e) => e.id)),
2700
+ components: Object.freeze(W(e.registry.map(f), (e) => e.id)),
2903
2701
  replacements: Object.freeze(W(e.replacements, (e) => e.id)),
2904
2702
  legacyKeys: Object.freeze(W(e.legacyKeys, (e) => e.key))
2905
2703
  });
2906
2704
  }
2907
- function Tt(e) {
2908
- return p(JSON.stringify(wt(e)));
2705
+ function qe(e) {
2706
+ return i(JSON.stringify(Ke(e)));
2909
2707
  }
2910
- function Et(e, t) {
2708
+ function Je(e, t) {
2911
2709
  return e.key === t || e.legacyKeys.some((e) => e.key === t);
2912
2710
  }
2913
2711
  // src/sdk/config-validation.ts
2914
- var Dt = 16777216, Ot = /* @__PURE__ */ new Set([
2712
+ var Ye = 16777216, Xe = /* @__PURE__ */ new Set([
2915
2713
  "__proto__",
2916
2714
  "constructor",
2917
2715
  "prototype"
2918
- ]), kt = /* @__PURE__ */ new Set([
2716
+ ]), Ze = /* @__PURE__ */ new Set([
2919
2717
  "protocol",
2920
2718
  "key",
2921
2719
  "assembly",
@@ -2929,15 +2727,15 @@ var Dt = 16777216, Ot = /* @__PURE__ */ new Set([
2929
2727
  function $(e, t) {
2930
2728
  throw Error(`Invalid local SDK config (${e}): ${t}`);
2931
2729
  }
2932
- function At(e) {
2730
+ function Qe(e) {
2933
2731
  if (typeof e != "object" || !e || Array.isArray(e)) return !1;
2934
2732
  let t = Object.getPrototypeOf(e);
2935
2733
  return t === Object.prototype || t === null;
2936
2734
  }
2937
- function jt(e, t, n) {
2938
- for (let r of Object.keys(e)) Ot.has(r) && $(n, `field "${r}" is not allowed.`), t.has(r) || $(n, `unknown field "${r}".`);
2735
+ function $e(e, t, n) {
2736
+ for (let r of Object.keys(e)) Xe.has(r) && $(n, `field "${r}" is not allowed.`), t.has(r) || $(n, `unknown field "${r}".`);
2939
2737
  }
2940
- function Mt(e, t, n = []) {
2738
+ function et(e, t, n = []) {
2941
2739
  if (e === void 0) return Object.freeze([t]);
2942
2740
  Array.isArray(e) || $("presets", "must be an array."), e.length === 0 && $("presets", "must select at least the default preset.");
2943
2741
  let r = [];
@@ -2945,7 +2743,7 @@ function Mt(e, t, n = []) {
2945
2743
  let i = /* @__PURE__ */ new Set(), a = [];
2946
2744
  for (let n = 0; n < e.length; n += 1) {
2947
2745
  let o = e[n], s, c;
2948
- typeof o == "string" ? s = o : At(o) ? ((o.id === void 0 || typeof o.id != "string") && $(`presets[${n}].id`, "must be a string."), s = o.id, o.version !== void 0 && (typeof o.version != "string" && $(`presets[${n}].version`, "must be a string."), c = o.version)) : $(`presets[${n}]`, "must be a preset id or preset reference.");
2746
+ typeof o == "string" ? s = o : Qe(o) ? ((o.id === void 0 || typeof o.id != "string") && $(`presets[${n}].id`, "must be a string."), s = o.id, o.version !== void 0 && (typeof o.version != "string" && $(`presets[${n}].version`, "must be a string."), c = o.version)) : $(`presets[${n}]`, "must be a preset id or preset reference.");
2949
2747
  let l = s === "default" ? t.id : s, u = r.filter((e) => e.id === l);
2950
2748
  u.length === 0 && $(`presets[${n}]`, `unsupported preset "${s}"; local.config.migration-unsupported: no compatibility profile matches this identity.`);
2951
2749
  let d = c === void 0 ? u.length === 1 ? u[0] : void 0 : u.find((e) => e.version === c);
@@ -2953,53 +2751,53 @@ function Mt(e, t, n = []) {
2953
2751
  }
2954
2752
  return Object.freeze(a);
2955
2753
  }
2956
- function Nt(e, n) {
2754
+ function tt(e, t) {
2957
2755
  if (e.components === void 0) return;
2958
- let r = new Map(n.map((e) => [e.id, e]));
2959
- for (let n of e.components) {
2960
- let i = r.get(n.id);
2961
- i && i.name === n.name && i.version === n.version && t(i) === n.digest || $("presets", `local.config.migration-unsupported: profile "${e.name}" cannot map legacy component "${n.id}".`);
2756
+ let n = new Map(t.map((e) => [e.id, e]));
2757
+ for (let t of e.components) {
2758
+ let r = n.get(t.id);
2759
+ r && r.name === t.name && r.version === t.version && c(r) === t.digest || $("presets", `local.config.migration-unsupported: profile "${e.name}" cannot map legacy component "${t.id}".`);
2962
2760
  }
2963
2761
  }
2964
- function Pt(e) {
2762
+ function nt(e) {
2965
2763
  let t = /* @__PURE__ */ new Set();
2966
2764
  for (let n of e) t.add(n.name), t.add(n.id);
2967
2765
  return t;
2968
2766
  }
2969
- function Ft(e, t) {
2970
- let n = new Map(e.map((e) => [e.id, e])), r = Pt(t);
2971
- for (let t of e) {
2972
- let e = t.requires?.kernel;
2973
- e !== void 0 && !l("0.7.0", e) && $("requires", `component "${t.id}" requires kernel ${e}, but ${m} is installed.`);
2974
- for (let e of t.dependencies ?? []) {
2975
- let i = n.get(e.id)?.version ?? (r.has(e.id) ? "0.7.0" : null);
2976
- i === null && $("dependencies", `component "${t.id}" requires missing component "${e.id}".`), e.version !== void 0 && !l(i, e.version) && $("dependencies", `component "${t.id}" requires "${e.id}" ${e.version}, but version ${i} is installed.`);
2767
+ function rt(t, r) {
2768
+ let i = new Map(t.map((e) => [e.id, e])), a = nt(r);
2769
+ for (let r of t) {
2770
+ let t = r.requires?.kernel;
2771
+ t !== void 0 && !n("0.7.0", t) && $("requires", `component "${r.id}" requires kernel ${t}, but ${e} is installed.`);
2772
+ for (let e of r.dependencies ?? []) {
2773
+ let t = i.get(e.id)?.version ?? (a.has(e.id) ? "0.7.0" : null);
2774
+ t === null && $("dependencies", `component "${r.id}" requires missing component "${e.id}".`), e.version !== void 0 && !n(t, e.version) && $("dependencies", `component "${r.id}" requires "${e.id}" ${e.version}, but version ${t} is installed.`);
2977
2775
  }
2978
2776
  }
2979
- let i = /* @__PURE__ */ new Map(), a = (e, t) => {
2777
+ let o = /* @__PURE__ */ new Map(), s = (e, t) => {
2778
+ let n = o.get(e);
2779
+ if (n === "done") return;
2780
+ n === "visiting" && $("dependencies", `dependency cycle: ${[...t, e].join(" -> ")}.`), o.set(e, "visiting");
2980
2781
  let r = i.get(e);
2981
- if (r === "done") return;
2982
- r === "visiting" && $("dependencies", `dependency cycle: ${[...t, e].join(" -> ")}.`), i.set(e, "visiting");
2983
- let o = n.get(e);
2984
- for (let r of o?.dependencies ?? []) n.has(r.id) && a(r.id, [...t, e]);
2985
- i.set(e, "done");
2782
+ for (let n of r?.dependencies ?? []) i.has(n.id) && s(n.id, [...t, e]);
2783
+ o.set(e, "done");
2986
2784
  };
2987
- for (let e of n.keys()) a(e, []);
2785
+ for (let e of i.keys()) s(e, []);
2988
2786
  }
2989
- function It(e, t) {
2787
+ function it(e, t) {
2990
2788
  if (e === void 0) return Object.freeze([]);
2991
2789
  Array.isArray(e) || $("components", "must be an array."), e.length > 64 && $("components", "accepts at most 64 external components.");
2992
2790
  let n = new Set([
2993
2791
  ...t.map((e) => e.name),
2994
- ...M.map((e) => e.name),
2995
- ...j
2792
+ ...I.map((e) => e.name),
2793
+ ...M
2996
2794
  ].map((e) => e.toLowerCase()));
2997
2795
  n.add("theme");
2998
2796
  let r = new Set(t.map((e) => e.id)), i = /* @__PURE__ */ new Set(), a = [];
2999
2797
  for (let t = 0; t < e.length; t += 1) {
3000
- let o = f(e[t]);
3001
- n.has(o.name.toLowerCase()) && $(`components[${t}]`, `name "${o.name}" conflicts with a built-in component, HTML tag or theme declaration.`), r.has(o.id) && $("components", `component id "${o.id}" is declared more than once.`), i.has(o.name) && $("components", `component name "${o.name}" is declared more than once.`), r.add(o.id), i.add(o.name), a.push(o);
2798
+ let s = o(e[t]);
2799
+ n.has(s.name.toLowerCase()) && $(`components[${t}]`, `name "${s.name}" conflicts with a built-in component, HTML tag or theme declaration.`), r.has(s.id) && $("components", `component id "${s.id}" is declared more than once.`), i.has(s.name) && $("components", `component name "${s.name}" is declared more than once.`), r.add(s.id), i.add(s.name), a.push(s);
3002
2800
  }
3003
- return Ft(a, t), Object.freeze(a);
2801
+ return rt(a, t), Object.freeze(a);
3004
2802
  }
3005
- export { ve as $, He as A, Re as B, M as C, j as D, Ke as E, Be as F, xe as G, S as H, Me as I, De as J, Se as K, Ue as L, ke as M, Le as N, Ge as O, Pe as P, me as Q, je as R, Ze as S, We as T, Ee as U, Te as V, Ne as W, ze as X, be as Y, w as Z, R as _, At as a, b as at, tt as b, Nt as c, Ct as d, ye as et, Et as f, L as g, St as h, $ as i, he as it, O as j, qe as k, wt as l, ct as m, Dt as n, oe as nt, It as o, Q as p, we as q, jt as r, v as rt, Mt as s, kt as t, _e as tt, Tt as u, rt as v, Ye as w, nt as x, F as y, Fe as z };
2803
+ export { E as A, v as B, F as C, M as D, ge as E, O as F, b as H, de as I, A as L, pe as M, fe as N, he as O, w as P, _ as R, N as S, me as T, y as V, R as _, Qe as a, we as b, tt as c, Ge as d, Je as f, L as g, We as h, $ as i, j, _e as k, Ke as l, Ae as m, Ye as n, it as o, Q as p, $e as r, et as s, Ze as t, qe as u, Te as v, xe as w, P as x, I as y, g as z };