reactive-md 0.9.1 → 0.9.3

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 (428) hide show
  1. package/CHANGELOG-ch.md +44 -0
  2. package/CHANGELOG.md +44 -0
  3. package/README-ch.md +7 -7
  4. package/README-en.md +6 -6
  5. package/README.md +7 -7
  6. package/cli/init.mjs +1 -1
  7. package/dist-library/LocalDocumentView-D6zQkTkt.js +112 -0
  8. package/dist-library/{LocalDocumentViewCore-GiWV3bey.js → LocalDocumentViewCore-CmJhemcA.js} +387 -9471
  9. package/dist-library/LocalReactiveDocumentCore-lAKOGAZ7.js +283 -0
  10. package/dist-library/LocalStaticDocumentView-2J7w0sKm.js +143 -0
  11. package/dist-library/{authoring-Dsune4Hy.js → authoring-B14SsOXZ.js} +68 -67
  12. package/dist-library/chart-B1TUtzm-.js +3 -0
  13. package/dist-library/color-values-r8Wf7ALn.js +6 -0
  14. package/dist-library/{compile-wUv8KEge.js → compile-D50B5_Ww.js} +32 -32
  15. package/dist-library/compile-cache-key-6GgpETz_.js +28 -0
  16. package/dist-library/compiler-DLkKUK4t.js +98 -0
  17. package/dist-library/{compiler-core-As_m-MNm.js → compiler-core-Niqhp9wV.js} +2963 -3283
  18. package/dist-library/{registry-core-Bbad9Bm2.js → component-kernel-IG4wOO0i.js} +72 -195
  19. package/dist-library/component-state-CwKX_SN5.js +763 -0
  20. package/dist-library/{component-state-C52ZFJGl.js → component-state-Ht-hOK0W.js} +15 -14
  21. package/dist-library/component-utils-eSj5IdG4.js +338 -0
  22. package/dist-library/computations-CffoW7Ff.js +340 -0
  23. package/dist-library/config-validation-Cpol91_M.js +456 -0
  24. package/dist-library/controls-B-CLSK8Q.js +5927 -0
  25. package/dist-library/controls-DWlx-AQl.js +3 -0
  26. package/dist-library/{coordinate-CWS9p5q_.js → coordinate-PyLPMIQK.js} +85 -85
  27. package/dist-library/data-BtFlkJzp.js +3 -0
  28. package/dist-library/{data-table-Bgccxd7h.js → data-table-Kv_ZA2Z2.js} +14 -13
  29. package/dist-library/data-visuals-_Z7QqYTk.js +384 -0
  30. package/dist-library/{default-components-BwQf0oP-.js → default-components-jugH7Ubr.js} +333 -331
  31. package/dist-library/{config-BadfhjdP.js → default-config-DIrRpuQz.js} +96 -79
  32. package/dist-library/default-options-DU5dxuU6.js +125 -0
  33. package/dist-library/{registry-B9NGct4d.js → default-registry-BlloaZi7.js} +4 -4
  34. package/dist-library/default-schema-Ch-Vznpm.js +33 -0
  35. package/dist-library/diagram-BLepzI8l.js +3 -0
  36. package/dist-library/{display-B-VhqVND.js → display-y4v9v0Qd.js} +1 -1
  37. package/dist-library/dist-Cueh1Psp.js +4761 -0
  38. package/dist-library/{config-validation-F47AcE6o.js → document-theme-DBAfnk7y.js} +248 -731
  39. package/dist-library/{export-BqVmTXm8.js → export-heVBqgxA.js} +46 -44
  40. package/dist-library/gallery-BC6FYTqw.js +3 -0
  41. package/dist-library/{gallery-CY6mTx8i.js → gallery-Q6VPS2ep.js} +1 -1
  42. package/dist-library/{html-CNT4KD-2.js → html-CCnvzan1.js} +56 -54
  43. package/dist-library/identity-BUx0Q_-d.js +40 -0
  44. package/dist-library/{incremental-Dv0FSp_U.js → incremental-Bzvh8_lB.js} +529 -380
  45. package/dist-library/{layout-C0YlEPGr.js → layout-BfUzzO2b.js} +147 -156
  46. package/dist-library/layout-BnfDeUNy.js +3 -0
  47. package/dist-library/limits-CFERRrlC.js +10 -0
  48. package/dist-library/localization-COdJ6lw2.js +6 -0
  49. package/dist-library/mafs-CnzDC5CR.js +3 -0
  50. package/dist-library/math-view-B0jthpRw.js +20 -0
  51. package/dist-library/motion-tokens-Czk0RDmS.js +283 -0
  52. package/dist-library/mount-preset-C_i37FvY.js +24 -0
  53. package/dist-library/numeric-sliders-CkWS0-ja.js +542 -0
  54. package/dist-library/observability-CYLuvFfL.js +502 -0
  55. package/dist-library/observability-core-Bcu7vpnl.js +24 -0
  56. package/dist-library/{package-core-WFK1RhAZ.js → package-core-9UK5ZdqB.js} +57 -46
  57. package/dist-library/parser-9yNJxGip.js +8 -0
  58. package/dist-library/parser-standard-BPIy4HOu.js +4872 -0
  59. package/dist-library/plugin-packs-CZb46nuv.js +19 -0
  60. package/dist-library/preset-core-BW3NWZJ9.js +1300 -0
  61. package/dist-library/props-pJRrfDc6.js +179 -0
  62. package/dist-library/react-BSo0o998.js +32 -0
  63. package/dist-library/reactive-md-authoring.js +274 -263
  64. package/dist-library/reactive-md-build.js +55 -20
  65. package/dist-library/reactive-md-compiler-session.js +4 -0
  66. package/dist-library/reactive-md-compiler-standard.js +6 -6
  67. package/dist-library/reactive-md-compiler.js +3 -3
  68. package/dist-library/reactive-md-contracts.js +6 -0
  69. package/dist-library/reactive-md-default-packs.js +31 -14
  70. package/dist-library/reactive-md-default-preset.js +7 -6
  71. package/dist-library/reactive-md-export.js +6 -5
  72. package/dist-library/reactive-md-minimal-preset.js +2 -2
  73. package/dist-library/reactive-md-minimal-react-preset.js +22 -20
  74. package/dist-library/reactive-md-minimal.css +1 -1
  75. package/dist-library/reactive-md-observability.js +126 -0
  76. package/dist-library/reactive-md-pack-style-manifest.js +797 -0
  77. package/dist-library/reactive-md-plugin-chart.js +6 -5
  78. package/dist-library/reactive-md-plugin-data.js +8 -8
  79. package/dist-library/reactive-md-plugin-diagram.js +7 -6
  80. package/dist-library/reactive-md-plugin-forms.js +14 -13
  81. package/dist-library/reactive-md-plugin-gallery.js +6 -5
  82. package/dist-library/reactive-md-plugin-navigation.js +9 -9
  83. package/dist-library/reactive-md-plugin-network.js +13 -12
  84. package/dist-library/reactive-md-plugin-plot.js +7 -6
  85. package/dist-library/reactive-md-react-component-accordion.js +10 -0
  86. package/dist-library/reactive-md-react-component-alert.js +10 -0
  87. package/dist-library/reactive-md-react-component-anchor.js +10 -0
  88. package/dist-library/reactive-md-react-component-badge.js +10 -0
  89. package/dist-library/reactive-md-react-component-card.js +10 -0
  90. package/dist-library/reactive-md-react-component-chart.js +22 -0
  91. package/dist-library/reactive-md-react-component-checkbox.js +10 -0
  92. package/dist-library/reactive-md-react-component-checklist.js +10 -0
  93. package/dist-library/reactive-md-react-component-choices.js +10 -0
  94. package/dist-library/reactive-md-react-component-column.js +6 -0
  95. package/dist-library/reactive-md-react-component-coordinate.js +21 -0
  96. package/dist-library/reactive-md-react-component-counter.js +10 -0
  97. package/dist-library/reactive-md-react-component-data-table.js +14 -0
  98. package/dist-library/reactive-md-react-component-date.js +10 -0
  99. package/dist-library/reactive-md-react-component-diagram.js +22 -0
  100. package/dist-library/reactive-md-react-component-disclosure.js +10 -0
  101. package/dist-library/reactive-md-react-component-edge.js +22 -0
  102. package/dist-library/reactive-md-react-component-gallery-item.js +10 -0
  103. package/dist-library/reactive-md-react-component-gallery.js +10 -0
  104. package/dist-library/reactive-md-react-component-grid.js +10 -0
  105. package/dist-library/reactive-md-react-component-if.js +10 -0
  106. package/dist-library/reactive-md-react-component-input.js +10 -0
  107. package/dist-library/reactive-md-react-component-jump.js +10 -0
  108. package/dist-library/reactive-md-react-component-multi-select.js +10 -0
  109. package/dist-library/reactive-md-react-component-node.js +22 -0
  110. package/dist-library/reactive-md-react-component-number.js +10 -0
  111. package/dist-library/reactive-md-react-component-option.js +10 -0
  112. package/dist-library/reactive-md-react-component-panel.js +10 -0
  113. package/dist-library/reactive-md-react-component-plot.js +26 -0
  114. package/dist-library/reactive-md-react-component-progress.js +10 -0
  115. package/dist-library/reactive-md-react-component-quiz.js +10 -0
  116. package/dist-library/reactive-md-react-component-radio-group.js +10 -0
  117. package/dist-library/reactive-md-react-component-range-slider.js +10 -0
  118. package/dist-library/reactive-md-react-component-section.js +10 -0
  119. package/dist-library/reactive-md-react-component-select.js +10 -0
  120. package/dist-library/reactive-md-react-component-slider.js +10 -0
  121. package/dist-library/reactive-md-react-component-step.js +10 -0
  122. package/dist-library/reactive-md-react-component-steps.js +10 -0
  123. package/dist-library/reactive-md-react-component-tab.js +10 -0
  124. package/dist-library/reactive-md-react-component-table.js +14 -0
  125. package/dist-library/reactive-md-react-component-tabs.js +10 -0
  126. package/dist-library/reactive-md-react-component-text.js +10 -0
  127. package/dist-library/reactive-md-react-component-textarea.js +10 -0
  128. package/dist-library/reactive-md-react-component-timeline.js +14 -0
  129. package/dist-library/reactive-md-react-component-timer.js +10 -0
  130. package/dist-library/reactive-md-react-component-toggle.js +10 -0
  131. package/dist-library/reactive-md-react-component-tooltip.js +10 -0
  132. package/dist-library/reactive-md-react-component-validation.js +10 -0
  133. package/dist-library/reactive-md-react-minimal.js +4 -4
  134. package/dist-library/reactive-md-react-pack-controls.js +44 -0
  135. package/dist-library/reactive-md-react-pack-data.js +21 -0
  136. package/dist-library/reactive-md-react-pack-layout.js +36 -0
  137. package/dist-library/reactive-md-react-pack-visuals.js +43 -0
  138. package/dist-library/reactive-md-react-packed.js +50 -0
  139. package/dist-library/reactive-md-react-server.js +26 -25
  140. package/dist-library/reactive-md-react-static-server.js +24 -0
  141. package/dist-library/reactive-md-react-static.js +1 -0
  142. package/dist-library/reactive-md-react-unstyled.js +15 -12
  143. package/dist-library/reactive-md-react.js +15 -12
  144. package/dist-library/reactive-md-runtime-browser.js +2 -1
  145. package/dist-library/reactive-md-runtime.js +4 -3
  146. package/dist-library/reactive-md-scan.js +1 -0
  147. package/dist-library/reactive-md-sdk.js +9 -8
  148. package/dist-library/reactive-md-standalone-configured.js +2 -2
  149. package/dist-library/reactive-md-standalone-host.js +2 -2
  150. package/dist-library/reactive-md-testing-browser.js +2 -2
  151. package/dist-library/reactive-md-testing-react.js +32 -32
  152. package/dist-library/reactive-md-testing.js +12 -12
  153. package/dist-library/reactive-md-worker-pool.js +401 -0
  154. package/dist-library/reactive-md.css +1 -1
  155. package/dist-library/reactive-md.js +84 -1361
  156. package/dist-library/registry-core-CziAIP5P.js +125 -0
  157. package/dist-library/render-nodes-DKjg_TR1.js +9369 -0
  158. package/dist-library/{resources-D2GDQS0p.js → requirements-DhIkxAbl.js} +37 -84
  159. package/dist-library/resources-B_nbROgj.js +74 -0
  160. package/dist-library/rmd-pack-controls.css +1032 -0
  161. package/dist-library/rmd-pack-data.css +724 -0
  162. package/dist-library/rmd-pack-layout.css +1825 -0
  163. package/dist-library/rmd-pack-resource-chart.css +300 -0
  164. package/dist-library/rmd-pack-resource-controls.css +781 -0
  165. package/dist-library/rmd-pack-resource-data-visuals.css +501 -0
  166. package/dist-library/rmd-pack-resource-diagram.css +106 -0
  167. package/dist-library/rmd-pack-resource-gallery.css +346 -0
  168. package/dist-library/rmd-pack-resource-graphics.css +516 -0
  169. package/dist-library/rmd-pack-resource-layout.css +1480 -0
  170. package/dist-library/rmd-pack-resource-mafs-core.css +124 -0
  171. package/dist-library/rmd-pack-resource-mafs.css +129 -0
  172. package/dist-library/rmd-pack-resource-visual-base.css +224 -0
  173. package/dist-library/rmd-pack-visuals.css +1394 -0
  174. package/dist-library/{runtime-B2fxeveq.js → runtime-BDnnimPA.js} +17 -16
  175. package/dist-library/{runtime-kcA7bG7G.js → runtime-CuJndKqK.js} +320 -313
  176. package/dist-library/runtime-requirement-C4-vNcf5.js +769 -0
  177. package/dist-library/schema-core-4sd1Vu7V.js +132 -0
  178. package/dist-library/{sdk-core-BoJT1SIt.js → sdk-core-BLsW9cCy.js} +494 -520
  179. package/dist-library/{session-core-nmJHuR9c.js → session-core-DLBRPV7f.js} +33 -31
  180. package/dist-library/{shareable-DpbE-59H.js → shareable-C6mUerpQ.js} +215 -209
  181. package/dist-library/shared-bTzN-F4g.js +3 -0
  182. package/dist-library/structural-views-30-YD_TJ.js +11 -0
  183. package/dist-library/table-surface-CfZn_tk-.js +13 -0
  184. package/dist-library/types/assemblies/compile-cache-key.d.ts +11 -0
  185. package/dist-library/types/assemblies/default-config.d.ts +35 -0
  186. package/dist-library/types/{local/configuration/options.d.ts → assemblies/default-options.d.ts} +4 -4
  187. package/dist-library/types/assemblies/default-registry.d.ts +18 -0
  188. package/dist-library/types/{local/configuration/schema.d.ts → assemblies/default-schema.d.ts} +4 -4
  189. package/dist-library/types/authoring/catalog.d.ts +11 -1
  190. package/dist-library/types/authoring/extensions.d.ts +1 -1
  191. package/dist-library/types/authoring/index.d.ts +3 -3
  192. package/dist-library/types/authoring/templates.d.ts +1 -1
  193. package/dist-library/types/build/diagnostics.d.ts +1 -1
  194. package/dist-library/types/compiler/index.d.ts +1 -0
  195. package/dist-library/types/compiler/session.d.ts +19 -0
  196. package/dist-library/types/compiler/standard.d.ts +1 -0
  197. package/dist-library/types/components/entries/accordion.d.ts +3 -0
  198. package/dist-library/types/components/entries/alert.d.ts +3 -0
  199. package/dist-library/types/components/entries/anchor.d.ts +3 -0
  200. package/dist-library/types/components/entries/badge.d.ts +3 -0
  201. package/dist-library/types/components/entries/card.d.ts +3 -0
  202. package/dist-library/types/components/entries/chart.d.ts +3 -0
  203. package/dist-library/types/components/entries/checkbox.d.ts +3 -0
  204. package/dist-library/types/components/entries/checklist.d.ts +3 -0
  205. package/dist-library/types/components/entries/choices.d.ts +3 -0
  206. package/dist-library/types/components/entries/column.d.ts +3 -0
  207. package/dist-library/types/components/entries/coordinate.d.ts +3 -0
  208. package/dist-library/types/components/entries/counter.d.ts +3 -0
  209. package/dist-library/types/components/entries/data-table.d.ts +3 -0
  210. package/dist-library/types/components/entries/date.d.ts +3 -0
  211. package/dist-library/types/components/entries/diagram.d.ts +3 -0
  212. package/dist-library/types/components/entries/disclosure.d.ts +3 -0
  213. package/dist-library/types/components/entries/edge.d.ts +3 -0
  214. package/dist-library/types/components/entries/gallery-item.d.ts +3 -0
  215. package/dist-library/types/components/entries/gallery.d.ts +3 -0
  216. package/dist-library/types/components/entries/grid.d.ts +3 -0
  217. package/dist-library/types/components/entries/if.d.ts +3 -0
  218. package/dist-library/types/components/entries/input.d.ts +3 -0
  219. package/dist-library/types/components/entries/jump.d.ts +3 -0
  220. package/dist-library/types/components/entries/multi-select.d.ts +3 -0
  221. package/dist-library/types/components/entries/node.d.ts +3 -0
  222. package/dist-library/types/components/entries/number.d.ts +3 -0
  223. package/dist-library/types/components/entries/option.d.ts +3 -0
  224. package/dist-library/types/components/entries/panel.d.ts +3 -0
  225. package/dist-library/types/components/entries/plot.d.ts +3 -0
  226. package/dist-library/types/components/entries/progress.d.ts +3 -0
  227. package/dist-library/types/components/entries/quiz.d.ts +3 -0
  228. package/dist-library/types/components/entries/radio-group.d.ts +3 -0
  229. package/dist-library/types/components/entries/range-slider.d.ts +3 -0
  230. package/dist-library/types/components/entries/section.d.ts +3 -0
  231. package/dist-library/types/components/entries/select.d.ts +3 -0
  232. package/dist-library/types/components/entries/slider.d.ts +3 -0
  233. package/dist-library/types/components/entries/step.d.ts +3 -0
  234. package/dist-library/types/components/entries/steps.d.ts +3 -0
  235. package/dist-library/types/components/entries/tab.d.ts +3 -0
  236. package/dist-library/types/components/entries/table.d.ts +3 -0
  237. package/dist-library/types/components/entries/tabs.d.ts +3 -0
  238. package/dist-library/types/components/entries/text.d.ts +3 -0
  239. package/dist-library/types/components/entries/textarea.d.ts +3 -0
  240. package/dist-library/types/components/entries/timeline.d.ts +3 -0
  241. package/dist-library/types/components/entries/timer.d.ts +3 -0
  242. package/dist-library/types/components/entries/toggle.d.ts +3 -0
  243. package/dist-library/types/components/entries/tooltip.d.ts +3 -0
  244. package/dist-library/types/components/entries/validation.d.ts +3 -0
  245. package/dist-library/types/components/layout/layout.d.ts +1 -3
  246. package/dist-library/types/components/layout/structural-views.d.ts +3 -0
  247. package/dist-library/types/components/mount-preset.d.ts +2 -0
  248. package/dist-library/types/components/packs/controls.d.ts +2 -0
  249. package/dist-library/types/components/packs/data.d.ts +2 -0
  250. package/dist-library/types/components/packs/layout.d.ts +2 -0
  251. package/dist-library/types/components/packs/visuals.d.ts +2 -0
  252. package/dist-library/types/components/shared/data-visuals.d.ts +3 -0
  253. package/dist-library/types/components/shared/table-surface.d.ts +10 -0
  254. package/dist-library/types/components/shared/visual-helpers.d.ts +24 -0
  255. package/dist-library/types/components/shared/visuals.d.ts +0 -2
  256. package/dist-library/types/components/table/data-table-model.d.ts +48 -0
  257. package/dist-library/types/components/table/data-table.d.ts +1 -48
  258. package/dist-library/types/{local/configuration → contracts}/component-kernel.d.ts +4 -2
  259. package/dist-library/types/contracts/index.d.ts +8 -0
  260. package/dist-library/types/{local/configuration → contracts}/limits.d.ts +9 -1
  261. package/dist-library/types/contracts/localization.d.ts +6 -0
  262. package/dist-library/types/contracts/runtime-types.d.ts +19 -0
  263. package/dist-library/types/local/compilation/cache-version.d.ts +1 -0
  264. package/dist-library/types/local/compilation/compile-status.d.ts +2 -0
  265. package/dist-library/types/local/compilation/compiler-bindings.d.ts +1 -1
  266. package/dist-library/types/local/compilation/compiler-capabilities.d.ts +4 -1
  267. package/dist-library/types/local/compilation/compiler-core.d.ts +1 -1
  268. package/dist-library/types/local/compilation/compiler-embedding.d.ts +20 -0
  269. package/dist-library/types/local/compilation/compiler-expressions.d.ts +5 -4
  270. package/dist-library/types/local/compilation/compiler-structure.d.ts +1 -1
  271. package/dist-library/types/local/compilation/compiler-tables.d.ts +3 -2
  272. package/dist-library/types/local/compilation/compiler-validation.d.ts +5 -9
  273. package/dist-library/types/local/compilation/compiler-values.d.ts +1 -1
  274. package/dist-library/types/local/compilation/compiler.d.ts +1 -1
  275. package/dist-library/types/local/compilation/component-usage.d.ts +2 -0
  276. package/dist-library/types/local/compilation/runtime-requirement.d.ts +3 -0
  277. package/dist-library/types/local/compilation/session/incremental.d.ts +5 -1
  278. package/dist-library/types/local/compilation/streaming.d.ts +1 -1
  279. package/dist-library/types/local/configuration/diagnostic-messages.d.ts +55 -0
  280. package/dist-library/types/local/configuration/embedding.d.ts +4 -0
  281. package/dist-library/types/local/configuration/kernel-value-rules.d.ts +1 -1
  282. package/dist-library/types/local/configuration/options-core.d.ts +8 -2
  283. package/dist-library/types/local/index.d.ts +12 -1
  284. package/dist-library/types/local/observability-codes.d.ts +2 -0
  285. package/dist-library/types/local/observability-core.d.ts +44 -0
  286. package/dist-library/types/local/observability-messages.d.ts +6 -0
  287. package/dist-library/types/local/observability.d.ts +45 -0
  288. package/dist-library/types/local/parsing/parse-budget.d.ts +18 -2
  289. package/dist-library/types/local/parsing/parser-internals.d.ts +2 -1
  290. package/dist-library/types/local/parsing/parser-region.d.ts +13 -2
  291. package/dist-library/types/local/parsing/parser-tags.d.ts +6 -1
  292. package/dist-library/types/local/parsing/rmd-recovery.d.ts +8 -0
  293. package/dist-library/types/local/performance-report.d.ts +70 -0
  294. package/dist-library/types/local/runtime/runtime-pool.d.ts +14 -0
  295. package/dist-library/types/local/transport/worker-handler.d.ts +3 -0
  296. package/dist-library/types/local/transport/worker-job.d.ts +12 -2
  297. package/dist-library/types/local/transport/worker-pool.d.ts +68 -0
  298. package/dist-library/types/local/transport/worker.d.ts +66 -1
  299. package/dist-library/types/local/types.d.ts +45 -25
  300. package/dist-library/types/observability.d.ts +8 -0
  301. package/dist-library/types/presets/default-semantics.d.ts +1 -1
  302. package/dist-library/types/presets/identity.d.ts +1 -8
  303. package/dist-library/types/presets/pack-style-entry.d.ts +3 -0
  304. package/dist-library/types/presets/pack-style-manifest.d.ts +11 -0
  305. package/dist-library/types/react/component-api.d.ts +3 -2
  306. package/dist-library/types/react/component-loader.d.ts +61 -0
  307. package/dist-library/types/react/component-primitives.d.ts +5 -5
  308. package/dist-library/types/react/index.d.ts +9 -5
  309. package/dist-library/types/react/localization.d.ts +5 -6
  310. package/dist-library/types/react/minimal.d.ts +2 -2
  311. package/dist-library/types/react/package-core.d.ts +3 -0
  312. package/dist-library/types/react/packed.d.ts +17 -0
  313. package/dist-library/types/react/render-lifecycle.d.ts +9 -0
  314. package/dist-library/types/{local → react}/rendering/document/ExtendedHtmlFragment.d.ts +1 -1
  315. package/dist-library/types/{local → react}/rendering/document/LocalDocumentViewCore.d.ts +11 -4
  316. package/dist-library/types/react/rendering/document/LocalPooledDocumentView.d.ts +8 -0
  317. package/dist-library/types/react/rendering/document/LocalReactiveDocumentCore.d.ts +6 -0
  318. package/dist-library/types/react/rendering/document/LocalStaticDocumentView.d.ts +18 -0
  319. package/dist-library/types/react/rendering/document/StaticExternalSlot.d.ts +25 -0
  320. package/dist-library/types/react/rendering/document/StaticHostData.d.ts +14 -0
  321. package/dist-library/types/{local → react}/rendering/document/render-nodes.d.ts +8 -8
  322. package/dist-library/types/react/rendering/document/static-runtime.d.ts +11 -0
  323. package/dist-library/types/{local → react}/rendering/document/use-author-script.d.ts +2 -2
  324. package/dist-library/types/{local → react}/rendering/document/validation-state.d.ts +2 -2
  325. package/dist-library/types/{local → react}/rendering/document/view-render-context.d.ts +40 -8
  326. package/dist-library/types/{local → react}/rendering/document/view-revision.d.ts +2 -2
  327. package/dist-library/types/{local → react}/rendering/render-types.d.ts +5 -5
  328. package/dist-library/types/react/rendering/table/data-table.d.ts +5 -0
  329. package/dist-library/types/{local → react}/rendering/table/table-numeric-columns.d.ts +3 -3
  330. package/dist-library/types/react/sdk-core.d.ts +12 -3
  331. package/dist-library/types/react/sdk.d.ts +2 -1
  332. package/dist-library/types/react/server.d.ts +3 -10
  333. package/dist-library/types/react/static-server.d.ts +12 -0
  334. package/dist-library/types/scan/index.d.ts +15 -0
  335. package/dist-library/types/sdk/config.d.ts +2 -35
  336. package/dist-library/types/sdk/default-identity.d.ts +3 -0
  337. package/dist-library/types/sdk/index.d.ts +1 -1
  338. package/dist-library/types/sdk/preset.d.ts +9 -0
  339. package/dist-library/types/sdk/props.d.ts +8 -3
  340. package/dist-library/types/sdk/registry-core.d.ts +2 -2
  341. package/dist-library/types/sdk/registry.d.ts +2 -18
  342. package/dist-library/types/sdk/types.d.ts +2 -2
  343. package/dist-library/types/sdk/version.d.ts +2 -0
  344. package/dist-library/types/standalone/session-core.d.ts +1 -1
  345. package/dist-library/{types-BeNtPqdY.js → types-Bza88SGK.js} +1 -1
  346. package/dist-library/types-daDo2c_w.js +3 -0
  347. package/dist-library/use-hydrated-W-laKPhY.js +22975 -0
  348. package/dist-library/validation-XXlb-spV.js +860 -0
  349. package/dist-library/version-B0G1699c.js +138 -0
  350. package/dist-library/visual-frame-y5RFhJ0_.js +19 -0
  351. package/dist-library/visual-helpers-CRmaqCHX.js +75 -0
  352. package/dist-library/visuals-CdHezgh5.js +3 -0
  353. package/dist-library/visuals-CoVSjVD8.js +49159 -0
  354. package/dist-library/worker-D6WMV8xJ.js +1632 -0
  355. package/dist-standalone/reactive-md-standalone.css +1 -1
  356. package/dist-standalone/reactive-md-standalone.js +119 -118
  357. package/docs/README-ch.md +8 -1
  358. package/docs/README.md +8 -1
  359. package/docs/compatibility/api-stability-ch.md +25 -0
  360. package/docs/compatibility/api-stability-en.md +25 -0
  361. package/docs/compatibility/compatibility-ch.md +32 -15
  362. package/docs/compatibility/compatibility-en.md +32 -15
  363. package/docs/compatibility/compatibility-manifest.schema.json +161 -0
  364. package/docs/compatibility/deprecation-ch.md +21 -0
  365. package/docs/compatibility/deprecation-en.md +21 -0
  366. package/docs/compatibility/source-versioning-ch.md +1 -1
  367. package/docs/compatibility/source-versioning-en.md +1 -1
  368. package/docs/compatibility/support-matrix-ch.md +108 -0
  369. package/docs/compatibility/support-matrix-en.md +108 -0
  370. package/docs/development/component-development-ch.md +2 -2
  371. package/docs/development/component-development-en.md +2 -2
  372. package/docs/development/component-development-reference-ch.md +16 -0
  373. package/docs/development/component-development-reference-en.md +16 -0
  374. package/docs/development/component-protocol-ch.md +31 -11
  375. package/docs/development/component-protocol-en.md +31 -11
  376. package/docs/integration/author-tools-ch.md +3 -1
  377. package/docs/integration/author-tools-en.md +3 -1
  378. package/docs/integration/compiler-ch.md +42 -1
  379. package/docs/integration/compiler-en.md +42 -1
  380. package/docs/integration/editor-ch.md +2 -2
  381. package/docs/integration/editor-en.md +2 -2
  382. package/docs/integration/extension-sdk-ch.md +6 -2
  383. package/docs/integration/extension-sdk-en.md +6 -2
  384. package/docs/integration/local-integration-ch.md +4 -2
  385. package/docs/integration/local-integration-en.md +4 -2
  386. package/docs/reference/public-api-ch.md +143 -7
  387. package/docs/reference/public-api-en.md +143 -7
  388. package/docs/releases/release-0.9.2-ch.md +33 -0
  389. package/docs/releases/release-0.9.2-en.md +33 -0
  390. package/docs/releases/release-0.9.3-ch.md +45 -0
  391. package/docs/releases/release-0.9.3-en.md +45 -0
  392. package/examples/integration/README-ch.md +36 -4
  393. package/examples/integration/README.md +36 -4
  394. package/examples/integration/chat-session/index.mjs +91 -0
  395. package/examples/integration/chat-session/package.json +10 -0
  396. package/examples/integration/static-embed/embed.mjs +44 -0
  397. package/examples/integration/static-embed/index.html +12 -0
  398. package/examples/integration/static-embed/main.mjs +24 -0
  399. package/examples/integration/static-embed/references.mjs +5 -0
  400. package/examples/integration/static-embed/render.mjs +10 -0
  401. package/package.json +67 -2
  402. package/dist-library/LocalDocumentView-sthUP0ct.js +0 -109
  403. package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +0 -275
  404. package/dist-library/compiler-eOfcinZs.js +0 -62
  405. package/dist-library/component-state-BoLCGee4.js +0 -801
  406. package/dist-library/controls-CcT6n7k_.js +0 -6740
  407. package/dist-library/mount-preset-KxvtKgJb.js +0 -13
  408. package/dist-library/options-1aDLK7JY.js +0 -121
  409. package/dist-library/parser-standard-Yuf3A_VI.js +0 -9630
  410. package/dist-library/plugin-packs-B1XPWcFs.js +0 -18
  411. package/dist-library/preset-core-CKc5YXSM.js +0 -1443
  412. package/dist-library/props-sJ8vk0cr.js +0 -183
  413. package/dist-library/react-D5iGiUdL.js +0 -7
  414. package/dist-library/schema-BufhKUSM.js +0 -40
  415. package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +0 -6
  416. package/dist-library/types/local/rendering/table/data-table.d.ts +0 -13
  417. package/dist-library/validation-BEBA_HvS.js +0 -1121
  418. package/dist-library/visual-frame-CyV1FXzs.js +0 -48
  419. package/dist-library/visuals-BZbZYA7w.js +0 -72572
  420. /package/dist-library/types/{local/configuration → contracts}/color-values.d.ts +0 -0
  421. /package/dist-library/types/{local/html → contracts}/html-names.d.ts +0 -0
  422. /package/dist-library/types/{local/configuration → contracts}/schema-core.d.ts +0 -0
  423. /package/dist-library/types/{local → react}/rendering/code/code-block.d.ts +0 -0
  424. /package/dist-library/types/{local → react}/rendering/code/code-languages.d.ts +0 -0
  425. /package/dist-library/types/{local → react}/rendering/document/LocalDocumentView.d.ts +0 -0
  426. /package/dist-library/types/{local → react}/rendering/document/use-color-scheme.d.ts +0 -0
  427. /package/dist-library/types/{local → react}/rendering/image/image-view.d.ts +0 -0
  428. /package/dist-library/types/{local → react}/rendering/math-view.d.ts +0 -0
@@ -0,0 +1,1300 @@
1
+ import { b as e, c as t, o as n, s as r, u as i } from "./limits-CFERRrlC.js";
2
+ import { f as a, h as o, l as s, n as c, s as l } from "./version-B0G1699c.js";
3
+ // src/sdk/hash.ts
4
+ function u(e) {
5
+ let t = 2166136261, n = 16777619;
6
+ for (let r = 0; r < e.length; r += 1) {
7
+ let i = e.charCodeAt(r);
8
+ t ^= i, t = Math.imul(t, 16777619) >>> 0, n ^= i + r, n = Math.imul(n, 2246822507) >>> 0;
9
+ }
10
+ let r = e.length;
11
+ return t ^= r, t = Math.imul(t, 16777619) >>> 0, n ^= r, n = Math.imul(n, 3266489909) >>> 0, `rmd-${t.toString(16).padStart(8, "0")}${n.toString(16).padStart(8, "0")}`;
12
+ }
13
+ // src/sdk/pattern.ts
14
+ function d(e, t) {
15
+ let n = e[t];
16
+ if (n === "*" || n === "+" || n === "?") return { length: e[t + 1] === "?" ? 2 : 1 };
17
+ if (n !== "{") return null;
18
+ let r = /^\{(\d+)(?:,(\d*))?\}/.exec(e.slice(t));
19
+ return r ? { length: r[0].length + +(e[t + r[0].length] === "?") } : null;
20
+ }
21
+ function f(e) {
22
+ let t = [], n = !1, r = !1;
23
+ for (let i = 0; i < e.length; i += 1) {
24
+ let a = e[i];
25
+ if (n) {
26
+ n = !1;
27
+ continue;
28
+ }
29
+ if (a === "\\") {
30
+ let t = e[i + 1];
31
+ if (t !== void 0 && t >= "1" && t <= "9" || t === "k" && e[i + 2] === "<") return !1;
32
+ n = !0;
33
+ continue;
34
+ }
35
+ if (r) {
36
+ a === "]" && (r = !1);
37
+ continue;
38
+ }
39
+ if (a === "[") {
40
+ r = !0;
41
+ continue;
42
+ }
43
+ if (a === "(") {
44
+ if (e[i + 1] === "?") {
45
+ if (e[i + 2] !== ":") return !1;
46
+ t.push({
47
+ quantified: !1,
48
+ alternation: !1
49
+ }), i += 2;
50
+ continue;
51
+ }
52
+ t.push({
53
+ quantified: !1,
54
+ alternation: !1
55
+ });
56
+ continue;
57
+ }
58
+ if (a === "|") {
59
+ let e = t[t.length - 1];
60
+ e && (e.alternation = !0);
61
+ continue;
62
+ }
63
+ if (a === ")") {
64
+ let n = t.pop();
65
+ if (!n) return !1;
66
+ let r = d(e, i + 1);
67
+ if (r && (n.quantified || n.alternation)) return !1;
68
+ let a = t[t.length - 1];
69
+ a && (a.quantified = a.quantified || n.quantified || r !== null, a.alternation = a.alternation || n.alternation), r && (i += r.length);
70
+ continue;
71
+ }
72
+ let o = d(e, i);
73
+ if (o) {
74
+ let e = t[t.length - 1];
75
+ e && (e.quantified = !0), i += o.length - 1;
76
+ }
77
+ }
78
+ return t.length === 0 && !n && !r;
79
+ }
80
+ // src/sdk/manifest.ts
81
+ var p = 64, m = 64, h = 128, g = 160, _ = 64, v = 64, y = 512, b = 4096, x = 16, ee = 32, te = 256, S = 65536, C = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, w = /^[a-z0-9][a-z0-9._-]*(?:\/[a-z0-9][a-z0-9._-]*)*$/, ne = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/, re = /^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/, T = /* @__PURE__ */ new Set([
82
+ "__proto__",
83
+ "constructor",
84
+ "prototype"
85
+ ]), E = /* @__PURE__ */ new WeakSet(), ie = /* @__PURE__ */ new Set([
86
+ "string",
87
+ "number",
88
+ "boolean",
89
+ "enum"
90
+ ]), ae = /* @__PURE__ */ new Set([
91
+ "leaf",
92
+ "inline",
93
+ "container"
94
+ ]), oe = /* @__PURE__ */ new Set([
95
+ "string",
96
+ "number",
97
+ "boolean",
98
+ "null",
99
+ "array",
100
+ "number-array"
101
+ ]), se = /* @__PURE__ */ new Set([
102
+ "text",
103
+ "number",
104
+ "boolean",
105
+ "choice",
106
+ "date",
107
+ "timer",
108
+ "checklist",
109
+ "tabs",
110
+ "diagram",
111
+ "multi-select",
112
+ "selection",
113
+ "steps",
114
+ "collection"
115
+ ]), ce = /* @__PURE__ */ new Set([
116
+ "empty",
117
+ "false",
118
+ "max-step",
119
+ "nearest-zero",
120
+ "min",
121
+ "first-option",
122
+ "first-tab",
123
+ "first-step",
124
+ "first-node",
125
+ "checked",
126
+ "duration",
127
+ "empty-array",
128
+ "none"
129
+ ]), le = /* @__PURE__ */ new Set([
130
+ "none",
131
+ "inline",
132
+ "markdown"
133
+ ]), ue = /* @__PURE__ */ new Set([
134
+ "none",
135
+ "any",
136
+ "inline",
137
+ "raw-body",
138
+ "content",
139
+ "table",
140
+ "plot",
141
+ "diagram",
142
+ "quiz",
143
+ "options",
144
+ "tabs",
145
+ "steps",
146
+ "components"
147
+ ]), de = /* @__PURE__ */ new Set(/* @__PURE__ */ "numeric-range.text-length.date-bounds.nonempty.progress-bounds.timer-duration.option-count.selection-requires.inline-body.no-components.single-table.math-body.options-body.value-sequence.only-children.diagram-body.quiz-body.checklist-body.dynamic-constraints.require-full-interpolation.scoped-expressions.row-values.validation-rule.anchor.navigation.data-table.plot-math.chart-table.timeline-table.table-selection.retain.self-binding-read.inline-math-reads.value-date.value-length.value-required.value-email".split(".")), fe = /* @__PURE__ */ new Set([
148
+ "none",
149
+ "required",
150
+ "optional"
151
+ ]), pe = /* @__PURE__ */ new Set([
152
+ "id",
153
+ "name",
154
+ "version",
155
+ "protocol",
156
+ "form",
157
+ "props",
158
+ "bindings",
159
+ "children",
160
+ "structure",
161
+ "rules",
162
+ "slotRelations",
163
+ "legacyHost",
164
+ "capabilities",
165
+ "authoring",
166
+ "dependencies",
167
+ "styles",
168
+ "requires",
169
+ "replaces"
170
+ ]), me = /* @__PURE__ */ new Set([
171
+ "kind",
172
+ "required",
173
+ "static",
174
+ "dynamic",
175
+ "default",
176
+ "nullable",
177
+ "enum",
178
+ "values",
179
+ "pattern",
180
+ "min",
181
+ "max",
182
+ "integer",
183
+ "positive",
184
+ "color",
185
+ "coerce",
186
+ "description"
187
+ ]), he = /* @__PURE__ */ new Set([
188
+ "kind",
189
+ "family",
190
+ "bind",
191
+ "initial",
192
+ "initialRule",
193
+ "required",
194
+ "exclusive",
195
+ "constraints",
196
+ "options",
197
+ "maxItems",
198
+ "requiresAttributes",
199
+ "compare",
200
+ "retain"
201
+ ]), ge = /* @__PURE__ */ new Set([
202
+ "min",
203
+ "max",
204
+ "step"
205
+ ]), _e = /* @__PURE__ */ new Set([
206
+ "interactive",
207
+ "static",
208
+ "ssr",
209
+ "offline"
210
+ ]), ve = /* @__PURE__ */ new Set([
211
+ "title",
212
+ "description",
213
+ "category",
214
+ "insertText"
215
+ ]), ye = /* @__PURE__ */ new Set(["kind", "required"]), be = /* @__PURE__ */ new Set([
216
+ "rule",
217
+ "label",
218
+ "parents",
219
+ "child",
220
+ "children",
221
+ "min",
222
+ "max",
223
+ "inlineOnly",
224
+ "noComponents",
225
+ "valueAttribute",
226
+ "generatedPrefix",
227
+ "forbidSeparator",
228
+ "maxItems"
229
+ ]), xe = /* @__PURE__ */ new Set(["id", "version"]), Se = /* @__PURE__ */ new Set(["kernel"]), Ce = /* @__PURE__ */ new Set(["id", "version"]), we = /^[A-Za-z0-9][A-Za-z0-9._/-]*$/, Te = /^[A-Za-z][A-Za-z0-9]*$/, D = /* @__PURE__ */ new Set(["setMany"]), Ee = 16, De = 32, Oe = 16, ke = 32, Ae = /* @__PURE__ */ new Set([
230
+ "bind",
231
+ "initial",
232
+ "disabled"
233
+ ]);
234
+ function O(e, t) {
235
+ throw Error(`Invalid local component manifest (${e}): ${t}`);
236
+ }
237
+ function k(e) {
238
+ try {
239
+ let t = JSON.stringify(e);
240
+ return typeof t == "string" ? typeof TextEncoder == "function" ? new TextEncoder().encode(t).length : t.length * 2 : Infinity;
241
+ } catch {
242
+ return Infinity;
243
+ }
244
+ }
245
+ function A(e) {
246
+ if (typeof e != "object" || !e || Array.isArray(e)) return !1;
247
+ let t = Object.getPrototypeOf(e);
248
+ return t === Object.prototype || t === null;
249
+ }
250
+ function j(e, t, n) {
251
+ for (let r of Object.keys(e)) T.has(r) && O(n, `field "${r}" is not allowed.`), t.has(r) || O(n, `unknown field "${r}".`);
252
+ }
253
+ function M(e, t) {
254
+ return typeof e != "boolean" && O(t, "must be a boolean."), e;
255
+ }
256
+ function N(e, t, n = b) {
257
+ return typeof e != "string" && O(t, "must be a string."), e.length > n && O(t, `exceeds the ${n}-character limit.`), e;
258
+ }
259
+ function P(e, t) {
260
+ return typeof e == "number" && Number.isFinite(e) || O(t, "must be a finite number."), e;
261
+ }
262
+ function F(e, t) {
263
+ return typeof e != "string" && O(t, "must be a string."), e.length > 128 && O(t, "exceeds the 128-character limit."), C.test(e) || O(t, "must use lowercase kebab-case."), e;
264
+ }
265
+ function I(e, t) {
266
+ A(e) || O(t, "must be an object.");
267
+ let n = {}, r = Object.keys(e).sort();
268
+ for (let i of r) T.has(i) && O(t, `locale "${i}" is not allowed.`), re.test(i) || O(t, `locale "${i}" must look like "en" or "zh-CN".`), n[i] = N(e[i], `${t}.${i}`, 256);
269
+ return n;
270
+ }
271
+ function je(e, t) {
272
+ A(e) || O(t, "must be an object."), j(e, ve, t);
273
+ let n = {};
274
+ return e.title !== void 0 && (n.title = I(e.title, `${t}.title`)), e.description !== void 0 && (n.description = I(e.description, `${t}.description`)), e.category !== void 0 && (n.category = N(e.category, `${t}.category`, 64)), e.insertText !== void 0 && (n.insertText = N(e.insertText, `${t}.insertText`, b)), n;
275
+ }
276
+ function Me(e, t, n) {
277
+ A(e) || O(n, "must be an object."), j(e, ye, n);
278
+ let r = e.kind;
279
+ typeof r == "string" && le.has(r) || O(`${n}.kind`, "must be \"none\", \"inline\" or \"markdown\".");
280
+ let i = r;
281
+ e.required !== void 0 && M(e.required, `${n}.required`);
282
+ let a = e.required === !0;
283
+ return t === "leaf" && i !== "none" && O(n, "a leaf component cannot declare body content."), t === "inline" && i === "markdown" && O(n, "an inline component cannot declare Markdown block content."), a && i === "none" && O(n, "cannot require body content of kind \"none\"."), {
284
+ kind: i,
285
+ ...a ? { required: !0 } : {}
286
+ };
287
+ }
288
+ function L(e) {
289
+ if (e !== void 0) return e.kind === "none" ? Object.freeze({
290
+ rule: "none",
291
+ label: "none"
292
+ }) : e.kind === "inline" ? Object.freeze({
293
+ rule: "inline",
294
+ label: "none",
295
+ inlineOnly: !0,
296
+ noComponents: !0,
297
+ ...e.required ? { min: 1 } : {}
298
+ }) : Object.freeze({
299
+ rule: "any",
300
+ label: "none",
301
+ ...e.required ? { min: 1 } : {}
302
+ });
303
+ }
304
+ function R(e, t) {
305
+ Array.isArray(e) || O(t, "must be an array of component names."), e.length > 32 && O(t, "accepts at most 32 names.");
306
+ let n = /* @__PURE__ */ new Set(), r = [];
307
+ for (let i of e) {
308
+ let e = F(i, t);
309
+ n.has(e) && O(t, `name "${e}" is declared more than once.`), n.add(e), r.push(e);
310
+ }
311
+ return r;
312
+ }
313
+ function z(e, t) {
314
+ let n = P(e, t);
315
+ return (!Number.isInteger(n) || n < 0) && O(t, "must be a nonnegative integer."), n;
316
+ }
317
+ function Ne(e, t, r) {
318
+ A(e) || O(r, "must be an object."), j(e, be, r);
319
+ let i = e.rule;
320
+ typeof i == "string" && ue.has(i) || O(`${r}.rule`, "is not a supported child rule.");
321
+ let a = i;
322
+ a === "raw-body" && t !== "container" && O(r, "\"raw-body\" requires form \"container\"."), t === "leaf" && a !== "none" && O(r, "a leaf component cannot declare body content."), t === "inline" && a !== "none" && a !== "inline" && a !== "any" && O(r, "an inline component only supports \"none\", \"inline\" or \"any\".");
323
+ let o = { rule: a };
324
+ if (e.label !== void 0 && (typeof e.label == "string" && fe.has(e.label) || O(`${r}.label`, "must be \"none\", \"required\" or \"optional\"."), o.label = e.label), e.parents !== void 0 && (o.parents = R(e.parents, `${r}.parents`)), e.child !== void 0 && (o.child = F(e.child, `${r}.child`)), e.children !== void 0 && (o.children = R(e.children, `${r}.children`)), e.min !== void 0 && (o.min = H(e.min, `${r}.min`, n)), e.max !== void 0 && (o.max = H(e.max, `${r}.max`, n)), o.min !== void 0 && o.max !== void 0 && o.min > o.max && O(r, "\"min\" cannot exceed \"max\"."), e.inlineOnly !== void 0 && (o.inlineOnly = M(e.inlineOnly, `${r}.inlineOnly`)), e.noComponents !== void 0 && (o.noComponents = M(e.noComponents, `${r}.noComponents`)), e.valueAttribute !== void 0 && (o.valueAttribute = F(e.valueAttribute, `${r}.valueAttribute`)), e.generatedPrefix !== void 0) {
325
+ let t = N(e.generatedPrefix, `${r}.generatedPrefix`, 128);
326
+ t.length === 0 && O(`${r}.generatedPrefix`, "must not be empty."), o.generatedPrefix = t;
327
+ }
328
+ if (e.forbidSeparator !== void 0) {
329
+ let t = N(e.forbidSeparator, `${r}.forbidSeparator`, 4);
330
+ t.length === 0 && O(`${r}.forbidSeparator`, "must not be empty."), o.forbidSeparator = t;
331
+ }
332
+ return e.maxItems !== void 0 && (o.maxItems = H(e.maxItems, `${r}.maxItems`, n)), o;
333
+ }
334
+ function B(e, t) {
335
+ return F(e, t);
336
+ }
337
+ function V(e, t) {
338
+ return z(e, t);
339
+ }
340
+ function H(e, t, n) {
341
+ let r = z(e, t);
342
+ return r > n && O(t, `cannot exceed the kernel limit ${n}.`), r;
343
+ }
344
+ function U(e, t) {
345
+ return R(e, t);
346
+ }
347
+ function Pe(e, t) {
348
+ return Array.isArray(e) || O(t, "must be an array of strings."), e.length > 32 && O(t, "accepts at most 32 values."), e.map((e) => N(e, t, 128));
349
+ }
350
+ function Fe(a, o) {
351
+ A(a) || O(o, "must be an object.");
352
+ let s = a.kind;
353
+ typeof s == "string" && de.has(s) || O(`${o}.kind`, "is not a supported rule.");
354
+ let c = (e) => j(a, /* @__PURE__ */ new Set(["kind", ...e]), o), l = (e) => {
355
+ let t = {};
356
+ for (let n of e) a[n] !== void 0 && (t[n] = B(a[n], `${o}.${n}`));
357
+ return t;
358
+ };
359
+ switch (s) {
360
+ case "numeric-range": {
361
+ c([
362
+ "min",
363
+ "max",
364
+ "step",
365
+ "order",
366
+ "integer",
367
+ "positiveInteger"
368
+ ]);
369
+ let e;
370
+ return a.order !== void 0 && (a.order !== "nondecreasing" && a.order !== "increasing" && O(`${o}.order`, "must be \"nondecreasing\" or \"increasing\"."), e = a.order), {
371
+ kind: s,
372
+ ...l([
373
+ "min",
374
+ "max",
375
+ "step",
376
+ "integer",
377
+ "positiveInteger"
378
+ ]),
379
+ ...e ? { order: e } : {}
380
+ };
381
+ }
382
+ case "text-length": return c(["min", "max"]), {
383
+ kind: s,
384
+ ...l(["min", "max"])
385
+ };
386
+ case "date-bounds": return c([
387
+ "min",
388
+ "max",
389
+ "required"
390
+ ]), {
391
+ kind: s,
392
+ ...l([
393
+ "min",
394
+ "max",
395
+ "required"
396
+ ])
397
+ };
398
+ case "nonempty": return c(["attribute"]), {
399
+ kind: s,
400
+ attribute: B(a.attribute, `${o}.attribute`)
401
+ };
402
+ case "progress-bounds": return c([
403
+ "value",
404
+ "max",
405
+ "defaultMax"
406
+ ]), {
407
+ kind: s,
408
+ value: B(a.value, `${o}.value`),
409
+ max: B(a.max, `${o}.max`),
410
+ defaultMax: P(a.defaultMax, `${o}.defaultMax`)
411
+ };
412
+ case "timer-duration": return c(["attribute", "default"]), {
413
+ kind: s,
414
+ attribute: B(a.attribute, `${o}.attribute`),
415
+ default: P(a.default, `${o}.default`)
416
+ };
417
+ case "option-count": return c(["max"]), {
418
+ kind: s,
419
+ ...a.max === void 0 ? {} : { max: B(a.max, `${o}.max`) }
420
+ };
421
+ case "selection-requires": return c(["key", "attributes"]), {
422
+ kind: s,
423
+ key: B(a.key, `${o}.key`),
424
+ attributes: U(a.attributes, `${o}.attributes`)
425
+ };
426
+ case "inline-body": return c(["strict"]), {
427
+ kind: s,
428
+ ...a.strict === void 0 ? {} : { strict: M(a.strict, `${o}.strict`) }
429
+ };
430
+ case "no-components":
431
+ case "math-body":
432
+ case "inline-math-reads": return c([]), { kind: s };
433
+ case "single-table": return c(["fallbackSingle"]), {
434
+ kind: s,
435
+ ...a.fallbackSingle === void 0 ? {} : { fallbackSingle: M(a.fallbackSingle, `${o}.fallbackSingle`) }
436
+ };
437
+ case "options-body": return c([
438
+ "child",
439
+ "valueAttribute",
440
+ "unique",
441
+ "max",
442
+ "forbidSeparator"
443
+ ]), {
444
+ kind: s,
445
+ child: B(a.child, `${o}.child`),
446
+ valueAttribute: B(a.valueAttribute, `${o}.valueAttribute`),
447
+ unique: a.unique === void 0 || M(a.unique, `${o}.unique`),
448
+ ...a.max === void 0 ? {} : { max: H(a.max, `${o}.max`, n) },
449
+ ...a.forbidSeparator === void 0 ? {} : { forbidSeparator: N(a.forbidSeparator, `${o}.forbidSeparator`, 4) }
450
+ };
451
+ case "value-sequence": return c([
452
+ "child",
453
+ "valueAttribute",
454
+ "min",
455
+ "generatedPrefix",
456
+ "unique",
457
+ "duplicateCode"
458
+ ]), {
459
+ kind: s,
460
+ child: B(a.child, `${o}.child`),
461
+ valueAttribute: B(a.valueAttribute, `${o}.valueAttribute`),
462
+ min: V(a.min, `${o}.min`),
463
+ generatedPrefix: N(a.generatedPrefix, `${o}.generatedPrefix`, 128),
464
+ unique: a.unique === void 0 || M(a.unique, `${o}.unique`),
465
+ ...a.duplicateCode === void 0 ? {} : { duplicateCode: N(a.duplicateCode, `${o}.duplicateCode`, 128) }
466
+ };
467
+ case "only-children": return c([
468
+ "children",
469
+ "min",
470
+ "max",
471
+ "maxCode",
472
+ "onlyCode"
473
+ ]), {
474
+ kind: s,
475
+ children: U(a.children, `${o}.children`),
476
+ min: V(a.min, `${o}.min`),
477
+ ...a.max === void 0 ? {} : { max: H(a.max, `${o}.max`, n) },
478
+ ...a.maxCode === void 0 ? {} : { maxCode: N(a.maxCode, `${o}.maxCode`, 128) },
479
+ ...a.onlyCode === void 0 ? {} : { onlyCode: N(a.onlyCode, `${o}.onlyCode`, 128) }
480
+ };
481
+ case "diagram-body": return c([
482
+ "node",
483
+ "edge",
484
+ "id",
485
+ "from",
486
+ "to",
487
+ "label"
488
+ ]), {
489
+ kind: s,
490
+ node: B(a.node, `${o}.node`),
491
+ edge: B(a.edge, `${o}.edge`),
492
+ id: B(a.id, `${o}.id`),
493
+ from: B(a.from, `${o}.from`),
494
+ to: B(a.to, `${o}.to`),
495
+ ...a.label === void 0 ? {} : { label: B(a.label, `${o}.label`) }
496
+ };
497
+ case "quiz-body": return c([
498
+ "type",
499
+ "answer",
500
+ "tolerance",
501
+ "child",
502
+ "valueAttribute",
503
+ "max"
504
+ ]), {
505
+ kind: s,
506
+ type: B(a.type, `${o}.type`),
507
+ answer: B(a.answer, `${o}.answer`),
508
+ tolerance: B(a.tolerance, `${o}.tolerance`),
509
+ child: B(a.child, `${o}.child`),
510
+ valueAttribute: B(a.valueAttribute, `${o}.valueAttribute`),
511
+ ...a.max === void 0 ? {} : { max: H(a.max, `${o}.max`, n) }
512
+ };
513
+ case "checklist-body": return c(["itemLimit"]), {
514
+ kind: s,
515
+ itemLimit: H(a.itemLimit, `${o}.itemLimit`, n)
516
+ };
517
+ case "dynamic-constraints":
518
+ case "require-full-interpolation": return c(["attributes"]), {
519
+ kind: s,
520
+ attributes: U(a.attributes, `${o}.attributes`)
521
+ };
522
+ case "scoped-expressions": return c(["attributes", "scope"]), a.scope !== "row" && a.scope !== "validation" && O(`${o}.scope`, "must be \"row\" or \"validation\"."), {
523
+ kind: s,
524
+ attributes: U(a.attributes, `${o}.attributes`),
525
+ scope: a.scope
526
+ };
527
+ case "row-values": return c([
528
+ "rows",
529
+ "key",
530
+ "child",
531
+ "childValue"
532
+ ]), {
533
+ kind: s,
534
+ rows: B(a.rows, `${o}.rows`),
535
+ key: B(a.key, `${o}.key`),
536
+ child: B(a.child, `${o}.child`),
537
+ childValue: B(a.childValue, `${o}.childValue`)
538
+ };
539
+ case "validation-rule": return c([
540
+ "when",
541
+ "fields",
542
+ "message",
543
+ "placement",
544
+ "max"
545
+ ]), a.placement !== "container" && a.placement !== "prose" && O(`${o}.placement`, "must be \"container\" or \"prose\"."), {
546
+ kind: s,
547
+ when: B(a.when, `${o}.when`),
548
+ fields: B(a.fields, `${o}.fields`),
549
+ message: B(a.message, `${o}.message`),
550
+ placement: a.placement,
551
+ max: H(a.max, `${o}.max`, 100)
552
+ };
553
+ case "anchor": return c(["id"]), {
554
+ kind: s,
555
+ id: B(a.id, `${o}.id`)
556
+ };
557
+ case "navigation": return c(["target"]), {
558
+ kind: s,
559
+ target: B(a.target, `${o}.target`)
560
+ };
561
+ case "data-table": return c([
562
+ "rows",
563
+ "key",
564
+ "child",
565
+ "childValue",
566
+ "label",
567
+ "maxRows",
568
+ "defaultMaxRows",
569
+ "documentRows",
570
+ "documentCells",
571
+ "maxColumns"
572
+ ]), {
573
+ kind: s,
574
+ rows: B(a.rows, `${o}.rows`),
575
+ key: B(a.key, `${o}.key`),
576
+ child: B(a.child, `${o}.child`),
577
+ childValue: B(a.childValue, `${o}.childValue`),
578
+ label: B(a.label, `${o}.label`),
579
+ maxRows: B(a.maxRows, `${o}.maxRows`),
580
+ defaultMaxRows: H(a.defaultMaxRows, `${o}.defaultMaxRows`, i),
581
+ documentRows: H(a.documentRows, `${o}.documentRows`, t),
582
+ documentCells: H(a.documentCells, `${o}.documentCells`, r),
583
+ maxColumns: H(a.maxColumns, `${o}.maxColumns`, 20)
584
+ };
585
+ case "plot-math": return c([
586
+ "min",
587
+ "max",
588
+ "samples",
589
+ "samplesAlias",
590
+ "curves",
591
+ "points"
592
+ ]), {
593
+ kind: s,
594
+ min: B(a.min, `${o}.min`),
595
+ max: B(a.max, `${o}.max`),
596
+ samples: B(a.samples, `${o}.samples`),
597
+ ...a.samplesAlias === void 0 ? {} : { samplesAlias: B(a.samplesAlias, `${o}.samplesAlias`) },
598
+ curves: H(a.curves, `${o}.curves`, 16),
599
+ points: H(a.points, `${o}.points`, e)
600
+ };
601
+ case "chart-table": return c([
602
+ "chartKind",
603
+ "x",
604
+ "y"
605
+ ]), {
606
+ kind: s,
607
+ chartKind: B(a.chartKind, `${o}.chartKind`),
608
+ x: B(a.x, `${o}.x`),
609
+ y: B(a.y, `${o}.y`)
610
+ };
611
+ case "timeline-table": return c(["headerSets"]), Array.isArray(a.headerSets) || O(`${o}.headerSets`, "must be an array."), {
612
+ kind: s,
613
+ headerSets: a.headerSets.map((e, t) => Pe(e, `${o}.headerSets[${t}]`))
614
+ };
615
+ case "table-selection": return c(["key", "bindings"]), {
616
+ kind: s,
617
+ key: B(a.key, `${o}.key`),
618
+ bindings: U(a.bindings, `${o}.bindings`)
619
+ };
620
+ case "retain": return c(["value"]), {
621
+ kind: s,
622
+ value: M(a.value, `${o}.value`)
623
+ };
624
+ case "self-binding-read": return c(["mode", "attribute"]), a.mode !== "always" && a.mode !== "attribute" && O(`${o}.mode`, "must be \"always\" or \"attribute\"."), {
625
+ kind: s,
626
+ mode: a.mode,
627
+ ...a.attribute === void 0 ? {} : { attribute: B(a.attribute, `${o}.attribute`) }
628
+ };
629
+ case "value-date": return c([
630
+ "min",
631
+ "max",
632
+ "required"
633
+ ]), {
634
+ kind: s,
635
+ ...l([
636
+ "min",
637
+ "max",
638
+ "required"
639
+ ])
640
+ };
641
+ case "value-length": return c([
642
+ "min",
643
+ "max",
644
+ "email",
645
+ "emailType"
646
+ ]), {
647
+ kind: s,
648
+ ...l([
649
+ "min",
650
+ "max",
651
+ "email"
652
+ ]),
653
+ ...a.emailType === void 0 ? {} : { emailType: N(a.emailType, `${o}.emailType`, 128) }
654
+ };
655
+ case "value-required": return c(["required"]), {
656
+ kind: s,
657
+ required: B(a.required, `${o}.required`)
658
+ };
659
+ case "value-email": return c(["type", "value"]), {
660
+ kind: s,
661
+ ...l(["type"]),
662
+ ...a.value === void 0 ? {} : { value: N(a.value, `${o}.value`, 128) }
663
+ };
664
+ default: O(`${o}.kind`, "is not a supported rule.");
665
+ }
666
+ }
667
+ function Ie(e) {
668
+ Array.isArray(e) || O("rules", "must be an array."), e.length > 32 && O("rules", "accepts at most 32 rules.");
669
+ let t = [];
670
+ for (let n = 0; n < e.length; n += 1) t.push(Fe(e[n], `rules[${n}]`));
671
+ return t;
672
+ }
673
+ function Le(e) {
674
+ Array.isArray(e) || O("slotRelations", "must be an array."), e.length > 16 && O("slotRelations", "accepts at most 16 relations.");
675
+ let t = [];
676
+ for (let n = 0; n < e.length; n += 1) {
677
+ let r = e[n], i = `slotRelations[${n}]`;
678
+ A(r) || O(i, "must be an object."), j(r, /* @__PURE__ */ new Set(["lower", "upper"]), i), t.push({
679
+ lower: F(r.lower, `${i}.lower`),
680
+ upper: F(r.upper, `${i}.upper`)
681
+ });
682
+ }
683
+ return t;
684
+ }
685
+ function Re(e, t) {
686
+ A(e) || O(t, "must be an object."), j(e, _e, t);
687
+ let n = (n) => e[n] !== void 0 && M(e[n], `${t}.${n}`);
688
+ return {
689
+ interactive: n("interactive"),
690
+ static: n("static"),
691
+ ssr: n("ssr"),
692
+ offline: n("offline")
693
+ };
694
+ }
695
+ function ze(e, t) {
696
+ A(e) || O(t, "must be an object."), j(e, me, t);
697
+ let n = e.kind;
698
+ typeof n == "string" && ie.has(n) || O(`${t}.kind`, "must be \"string\", \"number\", \"boolean\" or \"enum\".");
699
+ let r = n, i = { kind: r };
700
+ for (let n of [
701
+ "required",
702
+ "static",
703
+ "dynamic",
704
+ "integer",
705
+ "positive",
706
+ "color",
707
+ "nullable"
708
+ ]) e[n] !== void 0 && (i[n] = M(e[n], `${t}.${n}`));
709
+ i.static === !0 && i.dynamic === !0 && O(t, "cannot be both static and dynamic."), e.coerce !== void 0 && (e.coerce !== "text" && O(`${t}.coerce`, "must be \"text\"."), r !== "string" && O(`${t}.coerce`, "is only valid for kind \"string\"."), i.coerce = "text");
710
+ let a = e.enum === void 0 ? e.values : e.enum, o = a !== void 0;
711
+ if (r !== "enum") o && O(t, `"enum" is only valid for kind "enum", not "${r}".`);
712
+ else {
713
+ e.enum !== void 0 && e.values !== void 0 && O(t, "use \"enum\" or \"values\", not both."), Array.isArray(a) && a.length !== 0 || O(`${t}.enum`, "must be a non-empty string array."), a.length > 64 && O(`${t}.enum`, "accepts at most 64 values.");
714
+ let n = /* @__PURE__ */ new Set(), r = [];
715
+ for (let e of a) {
716
+ let i = N(e, `${t}.enum`, 128);
717
+ n.has(i) && O(`${t}.enum`, `value "${i}" is declared more than once.`), n.add(i), r.push(i);
718
+ }
719
+ i.enum = r;
720
+ }
721
+ let s = e.pattern !== void 0;
722
+ if (r !== "string") s && O(t, `"pattern" is only valid for kind "string", not "${r}".`);
723
+ else if (s) {
724
+ typeof e.pattern != "string" && O(`${t}.pattern`, "must be a string."), e.pattern.length > 512 && O(`${t}.pattern`, "exceeds the 512-character limit.");
725
+ try {
726
+ new RegExp(e.pattern);
727
+ } catch {
728
+ O(`${t}.pattern`, "is not a valid regular expression.");
729
+ }
730
+ f(e.pattern) || O(`${t}.pattern`, "uses unsupported regex syntax; nested quantifiers, quantified alternation, backreferences and lookarounds are rejected."), i.pattern = e.pattern;
731
+ }
732
+ let c = e.min !== void 0, l = e.max !== void 0;
733
+ if (r === "number" ? (c && (i.min = P(e.min, `${t}.min`)), l && (i.max = P(e.max, `${t}.max`)), i.min !== void 0 && i.max !== void 0 && i.min > i.max && O(t, "\"min\" cannot exceed \"max\".")) : ((c || l) && O(t, "\"min\" and \"max\" are only valid for kind \"number\"."), i.integer === !0 && O(t, "\"integer\" is only valid for kind \"number\"."), i.positive === !0 && O(t, "\"positive\" is only valid for kind \"number\".")), i.color === !0 && r !== "string" && O(t, "\"color\" is only valid for kind \"string\"."), e.description !== void 0 && (i.description = I(e.description, `${t}.description`)), e.default !== void 0) {
734
+ let n = e.default;
735
+ if (n === null) i.nullable !== !0 && O(`${t}.default`, "is null but the prop is not nullable."), i.default = null;
736
+ else if (r === "string") i.default = N(n, `${t}.default`);
737
+ else if (r === "number") {
738
+ let e = P(n, `${t}.default`);
739
+ i.integer === !0 && !Number.isInteger(e) && O(`${t}.default`, "must be an integer."), i.positive === !0 && !(e > 0) && O(`${t}.default`, "must be greater than zero."), i.min !== void 0 && e < i.min && O(`${t}.default`, `is below the minimum ${i.min}.`), i.max !== void 0 && e > i.max && O(`${t}.default`, `exceeds the maximum ${i.max}.`), i.default = e;
740
+ } else if (r === "boolean") i.default = M(n, `${t}.default`);
741
+ else {
742
+ let e = N(n, `${t}.default`, 128);
743
+ i.enum?.includes(e) || O(`${t}.default`, `"${e}" is not an allowed enum value.`), i.default = e;
744
+ }
745
+ if (i.pattern !== void 0 && r === "string" && typeof i.default == "string") {
746
+ let e = !0;
747
+ try {
748
+ e = new RegExp(i.pattern).test(i.default);
749
+ } catch {
750
+ e = !1;
751
+ }
752
+ e || O(`${t}.default`, `does not match pattern ${i.pattern}.`);
753
+ }
754
+ }
755
+ return i;
756
+ }
757
+ function Be(e, t) {
758
+ A(e) || O(t, "must be an object with \"literal\" or \"prop\".");
759
+ let n = Object.keys(e);
760
+ n.length !== 1 && O(t, "must contain exactly one of \"literal\" or \"prop\".");
761
+ let r = n[0];
762
+ if (T.has(r) && O(t, `field "${r}" is not allowed.`), r === "literal") return { literal: P(e.literal, `${t}.literal`) };
763
+ if (r === "prop") return { prop: F(e.prop, `${t}.prop`) };
764
+ O(t, `unknown field "${r}"; use "literal" or "prop".`);
765
+ }
766
+ function Ve(e, t, n, r) {
767
+ A(e) || O(r, "must be an object."), j(e, ge, r);
768
+ let i = {};
769
+ for (let n of [
770
+ "min",
771
+ "max",
772
+ "step"
773
+ ]) {
774
+ if (e[n] === void 0) continue;
775
+ let a = Be(e[n], `${r}.${n}`);
776
+ if ("prop" in a) {
777
+ let e = t[a.prop];
778
+ e === void 0 && O(`${r}.${n}`, `references undeclared prop "${a.prop}".`), e.kind !== "number" && O(`${r}.${n}`, `references prop "${a.prop}", which is not a number.`);
779
+ }
780
+ n === "step" && "literal" in a && !(a.literal > 0) && O(`${r}.step`, "must be greater than 0."), i[n] = a;
781
+ }
782
+ return n !== "number" && (i.min || i.max || i.step) && O(r, "\"min\", \"max\" and \"step\" are only valid for number bindings."), i.min && "literal" in i.min && i.max && "literal" in i.max && i.min.literal > i.max.literal && O(r, "\"min\" cannot exceed \"max\"."), i;
783
+ }
784
+ function He(e, t) {
785
+ if (e === "number") return t === "timer" ? /* @__PURE__ */ new Set([
786
+ "duration",
787
+ "min",
788
+ "nearest-zero"
789
+ ]) : /* @__PURE__ */ new Set([
790
+ "min",
791
+ "nearest-zero",
792
+ "max-step"
793
+ ]);
794
+ if (e === "boolean") return /* @__PURE__ */ new Set(["false"]);
795
+ if (e === "null") return /* @__PURE__ */ new Set(["empty"]);
796
+ if (e === "array") return t === "checklist" ? /* @__PURE__ */ new Set(["checked", "empty-array"]) : /* @__PURE__ */ new Set(["empty-array"]);
797
+ if (e === "number-array") return /* @__PURE__ */ new Set(["empty-array"]);
798
+ switch (t) {
799
+ case "choice":
800
+ case "selection": return /* @__PURE__ */ new Set(["first-option", "none"]);
801
+ case "tabs": return /* @__PURE__ */ new Set(["first-tab"]);
802
+ case "steps": return /* @__PURE__ */ new Set(["first-step"]);
803
+ case "diagram": return /* @__PURE__ */ new Set(["first-node"]);
804
+ case "date": return /* @__PURE__ */ new Set(["empty"]);
805
+ default: return /* @__PURE__ */ new Set(["empty"]);
806
+ }
807
+ }
808
+ function Ue(e, t, n, r = !1) {
809
+ A(e) || O(n, "must be an object."), j(e, he, n);
810
+ let i = e.kind;
811
+ typeof i == "string" && oe.has(i) || O(`${n}.kind`, "must be \"string\", \"number\", \"boolean\", \"array\", \"number-array\" or \"null\".");
812
+ let a = i, o = e.family;
813
+ typeof o == "string" && se.has(o) || O(`${n}.family`, "must be a supported binding family.");
814
+ let s = o;
815
+ ({
816
+ number: /* @__PURE__ */ new Set(["number", "timer"]),
817
+ boolean: /* @__PURE__ */ new Set(["boolean"]),
818
+ string: /* @__PURE__ */ new Set([
819
+ "text",
820
+ "choice",
821
+ "date",
822
+ "tabs",
823
+ "diagram",
824
+ "steps",
825
+ "selection"
826
+ ]),
827
+ array: /* @__PURE__ */ new Set([
828
+ "multi-select",
829
+ "checklist",
830
+ "collection"
831
+ ]),
832
+ "number-array": /* @__PURE__ */ new Set(["collection"]),
833
+ null: /* @__PURE__ */ new Set(["text"])
834
+ })[a]?.has(s) || O(`${n}.family`, `"${s}" is not supported for a ${a} binding.`);
835
+ let c;
836
+ if (e.options !== void 0) {
837
+ a !== "string" && O(`${n}.options`, "is only valid for a string binding."), s !== "choice" && O(`${n}.options`, "requires family \"choice\".");
838
+ let t = e.options;
839
+ Array.isArray(t) && t.length !== 0 || O(`${n}.options`, "must be a non-empty string array."), t.length > 64 && O(`${n}.options`, "accepts at most 64 values.");
840
+ let r = /* @__PURE__ */ new Set(), i = [];
841
+ for (let e of t) {
842
+ let t = N(e, `${n}.options`, 128);
843
+ t.length === 0 && O(`${n}.options`, "values must be non-empty."), r.has(t) && O(`${n}.options`, `value "${t}" is declared more than once.`), r.add(t), i.push(t);
844
+ }
845
+ c = i;
846
+ }
847
+ a === "string" && s === "choice" && c === void 0 && !r && O(`${n}.options`, "is required for a choice binding."), s !== "choice" && c !== void 0 && O(`${n}.options`, "is only valid for family \"choice\".");
848
+ let l = F(e.bind, `${n}.bind`), u = F(e.initial, `${n}.initial`);
849
+ l === u && O(n, "\"bind\" and \"initial\" must name different attributes."), (D.has(l) || D.has(u)) && O(n, "binding attributes cannot use a reserved slot name."), (Object.hasOwn(t, l) || Object.hasOwn(t, u)) && O(n, "binding attributes are reserved and cannot be declared as props.");
850
+ let d = He(a, s), f;
851
+ if (e.initialRule === void 0) switch (a) {
852
+ case "number":
853
+ f = s === "timer" ? "duration" : "nearest-zero";
854
+ break;
855
+ case "boolean":
856
+ f = "false";
857
+ break;
858
+ case "array":
859
+ f = s === "checklist" ? "checked" : "empty-array";
860
+ break;
861
+ case "number-array":
862
+ f = "empty-array";
863
+ break;
864
+ case "null":
865
+ f = "empty";
866
+ break;
867
+ default: f = s === "choice" ? "first-option" : s === "tabs" ? "first-tab" : s === "steps" ? "first-step" : s === "diagram" ? "first-node" : s === "selection" ? "none" : "empty";
868
+ }
869
+ else typeof e.initialRule == "string" && ce.has(e.initialRule) || O(`${n}.initialRule`, "is not a supported initial rule."), f = e.initialRule;
870
+ d.has(f) || O(`${n}.initialRule`, `is not supported for a ${a} ${s} binding.`), e.required !== void 0 && M(e.required, `${n}.required`), e.exclusive !== void 0 && M(e.exclusive, `${n}.exclusive`), e.retain !== void 0 && M(e.retain, `${n}.retain`);
871
+ let p;
872
+ e.constraints !== void 0 && (p = Ve(e.constraints, t, a, `${n}.constraints`));
873
+ let m;
874
+ if (e.maxItems !== void 0) {
875
+ if (a !== "array" && a !== "number-array" && O(`${n}.maxItems`, "is only valid for array or number-array bindings."), m = Be(e.maxItems, `${n}.maxItems`), "prop" in m) {
876
+ let e = t[m.prop];
877
+ e === void 0 && O(`${n}.maxItems`, `references undeclared prop "${m.prop}".`), e.kind !== "number" && O(`${n}.maxItems`, `references prop "${m.prop}", which is not a number.`), e.dynamic === !0 && O(`${n}.maxItems`, "requires a static numeric property.");
878
+ } else (!Number.isInteger(m.literal) || m.literal < 0) && O(`${n}.maxItems`, "must be a nonnegative integer.");
879
+ }
880
+ let h;
881
+ if (e.requiresAttributes !== void 0) {
882
+ h = R(e.requiresAttributes, `${n}.requiresAttributes`);
883
+ for (let e of h) Object.hasOwn(t, e) || O(`${n}.requiresAttributes`, `references undeclared prop "${e}".`);
884
+ }
885
+ let g;
886
+ if (e.compare !== void 0) {
887
+ g = R(e.compare, `${n}.compare`);
888
+ for (let e of g) Object.hasOwn(t, e) || O(`${n}.compare`, `references undeclared prop "${e}".`);
889
+ }
890
+ return {
891
+ kind: a,
892
+ family: s,
893
+ bind: l,
894
+ initial: u,
895
+ initialRule: f,
896
+ ...e.required === !0 ? { required: !0 } : {},
897
+ ...e.exclusive === !0 ? { exclusive: !0 } : {},
898
+ ...c ? { options: c } : {},
899
+ ...p ? { constraints: p } : {},
900
+ ...m ? { maxItems: m } : {},
901
+ ...h ? { requiresAttributes: h } : {},
902
+ ...g ? { compare: g } : {},
903
+ ...e.retain === !1 ? { retain: !1 } : {}
904
+ };
905
+ }
906
+ function We(e, t) {
907
+ A(e) || O(t, "must be an object."), j(e, xe, t);
908
+ let n = e.id;
909
+ (typeof n != "string" || !w.test(n) || n.length > 160) && O(`${t}.id`, "must be a lowercase namespaced id.");
910
+ let r;
911
+ if (e.version !== void 0) {
912
+ let n = e.version, i = o(n);
913
+ i === null && O(`${t}.version`, "must be an exact version or a supported range (exact, ^, ~, >=, <=, >, <)."), r = i.source;
914
+ }
915
+ return {
916
+ id: n,
917
+ ...r ? { version: r } : {}
918
+ };
919
+ }
920
+ function Ge(e) {
921
+ A(e) || O("requires", "must be an object."), j(e, Se, "requires");
922
+ let t;
923
+ if (e.kernel !== void 0) {
924
+ let n = o(e.kernel);
925
+ n === null && O("requires.kernel", "must be a supported kernel version range (exact, ^, ~, >=, <=, >, <)."), t = n.source;
926
+ }
927
+ return { ...t ? { kernel: t } : {} };
928
+ }
929
+ function Ke(e, t) {
930
+ A(e) || O("replaces", "must be an object."), j(e, Ce, "replaces");
931
+ let n = e.id;
932
+ (typeof n != "string" || !w.test(n) || n.length > 160) && O("replaces.id", "must be a lowercase namespaced id."), n !== t && O("replaces.id", "must equal the declaring manifest id.");
933
+ let r;
934
+ if (e.version !== void 0) {
935
+ let t = o(e.version);
936
+ t === null && O("replaces.version", "must be an exact version or a supported range (exact, ^, ~, >=, <=, >, <)."), r = t.source;
937
+ }
938
+ return {
939
+ id: n,
940
+ ...r ? { version: r } : {}
941
+ };
942
+ }
943
+ function qe(e) {
944
+ Array.isArray(e) || O("styles", "must be an array of style-resource ids."), e.length > 32 && O("styles", "accepts at most 32 resources.");
945
+ let t = /* @__PURE__ */ new Set(), n = [];
946
+ for (let r = 0; r < e.length; r += 1) {
947
+ let i = e[r];
948
+ (typeof i != "string" || i.length === 0 || i.length > 256) && O(`styles[${r}]`, "must be a non-empty string of at most 256 characters."), we.test(i) || O(`styles[${r}]`, "must be a bounded resource id."), t.has(i) && O("styles", `resource "${i}" is declared more than once.`), t.add(i), n.push(i);
949
+ }
950
+ return n;
951
+ }
952
+ function W(e) {
953
+ if (typeof e == "object" && e && E.has(e)) return e;
954
+ A(e) || O("manifest", "must be an object."), j(e, pe, "manifest");
955
+ let t = e.id;
956
+ (typeof t != "string" || t.length > 160 || !w.test(t)) && O("id", "must be a lowercase namespaced id such as \"example/rating\".");
957
+ let n = F(e.name, "name"), r = e.version;
958
+ (typeof r != "string" || r.length > 64 || !ne.test(r)) && O("version", "must be a semantic version such as 1.0.0."), e.protocol !== "reactive-md-component/v1" && O("protocol", `must be "${c}".`);
959
+ let i = e.form;
960
+ typeof i == "string" && ae.has(i) || O("form", "must be \"leaf\", \"inline\" or \"container\".");
961
+ let a = i;
962
+ A(e.props) || O("props", "must be an object.");
963
+ let o = Object.keys(e.props).sort();
964
+ o.length > 64 && O("props", "accepts at most 64 properties.");
965
+ let s = {};
966
+ for (let t of o) T.has(t) && O("props", `property "${t}" is not allowed.`), (!C.test(t) || t.length > 128) && O("props", `property "${t}" must use lowercase kebab-case.`), s[t] = ze(e.props[t], `props.${t}`);
967
+ let l;
968
+ if (e.bindings !== void 0) {
969
+ A(e.bindings) || O("bindings", "must be an object.");
970
+ let t = Object.keys(e.bindings);
971
+ t.length === 0 && O("bindings", "must declare at least one binding slot."), t.length > 16 && O("bindings", "accepts at most 16 slots.");
972
+ let n = {}, r = /* @__PURE__ */ new Set();
973
+ for (let i of t) {
974
+ T.has(i) && O("bindings", `field "${i}" is not allowed.`), Te.test(i) || O("bindings", `slot "${i}" must be a letter followed by letters or digits.`), D.has(i) && O("bindings", `slot "${i}" is reserved by the runtime.`);
975
+ let t = Ue(e.bindings[i], s, `bindings.${i}`, a === "container" && Array.isArray(e.rules) && e.rules.some((e) => A(e) && e.kind === "options-body"));
976
+ i !== "value" && (t.kind !== "number" || t.family !== "number") && O(`bindings.${i}`, "numeric named slots support kind \"number\" with family \"number\" in this contract."), i !== "value" && A(e.bindings[i]) && e.bindings[i].exclusive === !1 && O(`bindings.${i}.exclusive`, "named slots require exclusive ownership in this contract.");
977
+ for (let e of [t.bind, t.initial]) r.has(e) && O("bindings", `attribute "${e}" is claimed by more than one binding.`), r.add(e);
978
+ n[i] = i === "value" ? t : {
979
+ ...t,
980
+ exclusive: !0
981
+ };
982
+ }
983
+ l = n;
984
+ }
985
+ let u = e.children === void 0 ? void 0 : Me(e.children, a, "children");
986
+ e.children !== void 0 && e.structure !== void 0 && O("manifest", "cannot declare both \"children\" and \"structure\"; use \"structure\".");
987
+ let d = e.structure === void 0 ? L(u) : Ne(e.structure, a, "structure"), f = e.rules === void 0 ? void 0 : Ie(e.rules), p = e.slotRelations === void 0 ? void 0 : Le(e.slotRelations);
988
+ e.legacyHost !== void 0 && M(e.legacyHost, "legacyHost");
989
+ let m = Re(e.capabilities, "capabilities"), h = e.authoring === void 0 ? void 0 : je(e.authoring, "authoring"), g = e.styles === void 0 ? void 0 : qe(e.styles), _ = e.requires === void 0 ? void 0 : Ge(e.requires), v = e.replaces === void 0 ? void 0 : Ke(e.replaces, t), y;
990
+ if (e.dependencies !== void 0) {
991
+ Array.isArray(e.dependencies) || O("dependencies", "must be an array."), e.dependencies.length > 16 && O("dependencies", "accepts at most 16 entries.");
992
+ let t = /* @__PURE__ */ new Set(), n = [];
993
+ for (let r = 0; r < e.dependencies.length; r += 1) {
994
+ let i = We(e.dependencies[r], `dependencies[${r}]`);
995
+ t.has(i.id) && O("dependencies", `"${i.id}" is declared more than once.`), t.add(i.id), n.push(i);
996
+ }
997
+ y = n;
998
+ }
999
+ let b = {
1000
+ id: t,
1001
+ name: n,
1002
+ version: r,
1003
+ protocol: c,
1004
+ form: a,
1005
+ props: s,
1006
+ ...l ? { bindings: l } : {},
1007
+ ...u ? { children: u } : {},
1008
+ ...d && !u ? { structure: d } : {},
1009
+ ...f ? { rules: f } : {},
1010
+ ...p ? { slotRelations: p } : {},
1011
+ ...e.legacyHost === !0 ? { legacyHost: !0 } : {},
1012
+ capabilities: m,
1013
+ ...h ? { authoring: h } : {},
1014
+ ...g ? { styles: g } : {},
1015
+ ..._ ? { requires: _ } : {},
1016
+ ...y ? { dependencies: y } : {},
1017
+ ...v ? { replaces: v } : {}
1018
+ };
1019
+ k(b) > 65536 && O("manifest", `serialized size exceeds the ${S}-byte budget.`);
1020
+ let x = Ye(b);
1021
+ return E.add(x), x;
1022
+ }
1023
+ function Je(e) {
1024
+ return W(e);
1025
+ }
1026
+ function Ye(e) {
1027
+ if (typeof e != "object" || !e) return e;
1028
+ for (let t of Object.keys(e)) Ye(e[t]);
1029
+ return Object.freeze(e);
1030
+ }
1031
+ function Xe(e) {
1032
+ return {
1033
+ kind: e.kind,
1034
+ ...e.required === !0 ? { required: !0 } : {},
1035
+ ...e.static === !0 ? { static: !0 } : {},
1036
+ ...e.dynamic === void 0 ? {} : { dynamic: e.dynamic },
1037
+ ...e.default === void 0 ? {} : { default: e.default },
1038
+ ...e.nullable === !0 ? { nullable: !0 } : {},
1039
+ ...e.enum ? { enum: [...e.enum] } : {},
1040
+ ...e.pattern === void 0 ? {} : { pattern: e.pattern },
1041
+ ...e.min === void 0 ? {} : { min: e.min },
1042
+ ...e.max === void 0 ? {} : { max: e.max },
1043
+ ...e.integer === !0 ? { integer: !0 } : {},
1044
+ ...e.positive === !0 ? { positive: !0 } : {},
1045
+ ...e.color === !0 ? { color: !0 } : {},
1046
+ ...e.coerce === void 0 ? {} : { coerce: e.coerce }
1047
+ };
1048
+ }
1049
+ function G(e) {
1050
+ return "literal" in e ? { literal: e.literal } : { prop: e.prop };
1051
+ }
1052
+ function Ze(e) {
1053
+ return {
1054
+ ...e.min ? { min: G(e.min) } : {},
1055
+ ...e.max ? { max: G(e.max) } : {},
1056
+ ...e.step ? { step: G(e.step) } : {}
1057
+ };
1058
+ }
1059
+ function Qe(e) {
1060
+ let t = e.constraints;
1061
+ return {
1062
+ kind: e.kind,
1063
+ family: e.family,
1064
+ bind: e.bind,
1065
+ initial: e.initial,
1066
+ initialRule: e.initialRule,
1067
+ ...e.required === !0 ? { required: !0 } : {},
1068
+ ...e.exclusive === !0 ? { exclusive: !0 } : {},
1069
+ ...e.options ? { options: [...e.options] } : {},
1070
+ ...t ? { constraints: Ze(t) } : {},
1071
+ ...e.maxItems ? { maxItems: G(e.maxItems) } : {},
1072
+ ...e.requiresAttributes ? { requiresAttributes: [...e.requiresAttributes] } : {},
1073
+ ...e.compare ? { compare: [...e.compare] } : {},
1074
+ ...e.retain === !1 ? { retain: !1 } : {}
1075
+ };
1076
+ }
1077
+ function $e(e) {
1078
+ return {
1079
+ rule: e.rule,
1080
+ ...e.label === void 0 ? {} : { label: e.label },
1081
+ ...e.parents ? { parents: [...e.parents] } : {},
1082
+ ...e.child === void 0 ? {} : { child: e.child },
1083
+ ...e.children ? { children: [...e.children] } : {},
1084
+ ...e.min === void 0 ? {} : { min: e.min },
1085
+ ...e.max === void 0 ? {} : { max: e.max },
1086
+ ...e.inlineOnly === void 0 ? {} : { inlineOnly: e.inlineOnly },
1087
+ ...e.noComponents === void 0 ? {} : { noComponents: e.noComponents },
1088
+ ...e.valueAttribute === void 0 ? {} : { valueAttribute: e.valueAttribute },
1089
+ ...e.generatedPrefix === void 0 ? {} : { generatedPrefix: e.generatedPrefix },
1090
+ ...e.forbidSeparator === void 0 ? {} : { forbidSeparator: e.forbidSeparator },
1091
+ ...e.maxItems === void 0 ? {} : { maxItems: e.maxItems }
1092
+ };
1093
+ }
1094
+ function et(e) {
1095
+ let t = e, n = Object.keys(t).sort(), r = {};
1096
+ for (let e of n) {
1097
+ let n = t[e];
1098
+ r[e] = Array.isArray(n) ? n.map((e) => Array.isArray(e) ? [...e] : e) : n;
1099
+ }
1100
+ return r;
1101
+ }
1102
+ function tt(e) {
1103
+ let t = {};
1104
+ for (let n of Object.keys(e.props).sort()) t[n] = Xe(e.props[n]);
1105
+ let n = {};
1106
+ if (e.bindings) for (let t of Object.keys(e.bindings).sort()) n[t] = Qe(e.bindings[t]);
1107
+ return {
1108
+ protocol: e.protocol,
1109
+ id: e.id,
1110
+ name: e.name,
1111
+ version: e.version,
1112
+ form: e.form,
1113
+ props: t,
1114
+ ...e.bindings ? { bindings: n } : {},
1115
+ ...e.children ? { children: {
1116
+ kind: e.children.kind,
1117
+ ...e.children.required ? { required: !0 } : {}
1118
+ } } : {},
1119
+ ...e.structure ? { structure: $e(e.structure) } : {},
1120
+ ...e.rules ? { rules: e.rules.map(et) } : {},
1121
+ ...e.slotRelations ? { slotRelations: e.slotRelations.map((e) => ({ ...e })) } : {},
1122
+ capabilities: {
1123
+ interactive: e.capabilities.interactive,
1124
+ static: e.capabilities.static,
1125
+ ssr: e.capabilities.ssr,
1126
+ offline: e.capabilities.offline
1127
+ },
1128
+ ...e.styles ? { styles: [...e.styles] } : {},
1129
+ ...e.requires?.kernel ? { requires: { kernel: e.requires.kernel } } : {},
1130
+ ...e.dependencies ? { dependencies: [...e.dependencies].map((e) => ({ ...e })).sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)) } : {},
1131
+ ...e.replaces ? { replaces: {
1132
+ id: e.replaces.id,
1133
+ ...e.replaces.version ? { version: e.replaces.version } : {}
1134
+ } } : {}
1135
+ };
1136
+ }
1137
+ var nt = /* @__PURE__ */ new WeakMap();
1138
+ function K(e) {
1139
+ let t = E.has(e) ? e : W(e), n = nt.get(t);
1140
+ if (n !== void 0) return n;
1141
+ let r = u(JSON.stringify(tt(t)));
1142
+ return nt.set(t, r), r;
1143
+ }
1144
+ function rt(e) {
1145
+ return Object.freeze({
1146
+ id: e.id,
1147
+ name: e.name,
1148
+ version: e.version,
1149
+ digest: K(e)
1150
+ });
1151
+ }
1152
+ function it(e) {
1153
+ return typeof e == "string" && e.length <= 128 && C.test(e);
1154
+ }
1155
+ function q(e) {
1156
+ return typeof e == "string" && e.length > 0 && e.length <= 160 && w.test(e);
1157
+ }
1158
+ // src/sdk/default-identity.ts
1159
+ var at = "reactive-md/default", ot = "reactive-md/minimal", st = s, ct = 160, lt = 256, ut = 32, dt = 256, ft = 4096, pt = /^[a-z0-9][a-z0-9._-]*(?:\/[a-z0-9][a-z0-9._-]*)*$/, mt = /* @__PURE__ */ new Set([
1160
+ "__proto__",
1161
+ "constructor",
1162
+ "prototype"
1163
+ ]), ht = /* @__PURE__ */ new Set([
1164
+ "protocol",
1165
+ "id",
1166
+ "version",
1167
+ "components",
1168
+ "authoring",
1169
+ "themes",
1170
+ "dependencies",
1171
+ "metadata"
1172
+ ]), gt = /* @__PURE__ */ new Set([
1173
+ "title",
1174
+ "description",
1175
+ "category",
1176
+ "insertText"
1177
+ ]), _t = /* @__PURE__ */ new Set(["title", "description"]), vt = /* @__PURE__ */ new Set(["id", "version"]), J = /* @__PURE__ */ new WeakSet();
1178
+ function Y(e, t) {
1179
+ throw Error(`Invalid local preset (${e}): ${t}`);
1180
+ }
1181
+ function X(e) {
1182
+ if (typeof e != "object" || !e || Array.isArray(e)) return !1;
1183
+ let t = Object.getPrototypeOf(e);
1184
+ return t === Object.prototype || t === null;
1185
+ }
1186
+ function Z(e, t, n) {
1187
+ for (let r of Object.keys(e)) mt.has(r) && Y(n, `field "${r}" is not allowed.`), t.has(r) || Y(n, `unknown field "${r}".`);
1188
+ }
1189
+ function Q(e, t) {
1190
+ X(e) || Y(t, "must be a locale-keyed string map.");
1191
+ let n = {};
1192
+ for (let r of Object.keys(e).sort()) {
1193
+ mt.has(r) && Y(t, `locale "${r}" is not allowed.`), /^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/.test(r) || Y(t, `locale "${r}" must look like "en" or "zh-CN".`);
1194
+ let i = e[r];
1195
+ (typeof i != "string" || i.length > ft) && Y(t, `locale "${r}" must be a bounded string.`), n[r] = i;
1196
+ }
1197
+ return Object.freeze(n);
1198
+ }
1199
+ function yt(e) {
1200
+ X(e) || Y("authoring", "must be an object."), Z(e, gt, "authoring");
1201
+ let t = {};
1202
+ return e.title !== void 0 && (t.title = Q(e.title, "authoring.title")), e.description !== void 0 && (t.description = Q(e.description, "authoring.description")), e.category !== void 0 && ((typeof e.category != "string" || e.category.length > 64) && Y("authoring.category", "must be a bounded string."), t.category = e.category), e.insertText !== void 0 && ((typeof e.insertText != "string" || e.insertText.length > ft) && Y("authoring.insertText", "must be a bounded string."), t.insertText = e.insertText), Object.freeze(t);
1203
+ }
1204
+ function bt(e, t) {
1205
+ Array.isArray(e) || Y("authoring", "must be an array."), e.length > dt && Y("authoring", `accepts at most ${dt} entries.`);
1206
+ let n = new Set(t.map((e) => e.id)), r = /* @__PURE__ */ new Set(), i = [];
1207
+ for (let t = 0; t < e.length; t += 1) {
1208
+ let a = e[t];
1209
+ X(a) || Y(`authoring[${t}]`, "must be an object."), Z(a, /* @__PURE__ */ new Set(["componentId", "authoring"]), `authoring[${t}]`);
1210
+ let o = a.componentId;
1211
+ typeof o == "string" && q(o) || Y(`authoring[${t}].componentId`, "must be a lowercase namespaced id."), n.has(o) || Y(`authoring[${t}].componentId`, `"${o}" is not declared by this preset.`), r.has(o) && Y("authoring", `component "${o}" is declared more than once.`), r.add(o), i.push(Object.freeze({
1212
+ componentId: o,
1213
+ authoring: yt(a.authoring)
1214
+ }));
1215
+ }
1216
+ return Object.freeze(i.sort((e, t) => e.componentId < t.componentId ? -1 : +(e.componentId > t.componentId)));
1217
+ }
1218
+ function xt(e) {
1219
+ Array.isArray(e) || Y("dependencies", "must be an array."), e.length > ut && Y("dependencies", `accepts at most ${ut} entries.`);
1220
+ let t = /* @__PURE__ */ new Set(), n = [];
1221
+ for (let r = 0; r < e.length; r += 1) {
1222
+ let i = e[r];
1223
+ X(i) || Y(`dependencies[${r}]`, "must be an object."), Z(i, vt, `dependencies[${r}]`);
1224
+ let o = i.id;
1225
+ typeof o == "string" && q(o) || Y(`dependencies[${r}].id`, "must be a lowercase namespaced id."), t.has(o) && Y("dependencies", `"${o}" is declared more than once.`), t.add(o);
1226
+ let s = i.version;
1227
+ typeof s == "string" && a(s) || Y(`dependencies[${r}].version`, "must be an exact semantic version."), n.push(Object.freeze({
1228
+ id: o,
1229
+ version: s
1230
+ }));
1231
+ }
1232
+ return Object.freeze(n.sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)));
1233
+ }
1234
+ function St(e) {
1235
+ Array.isArray(e) || Y("themes", "must be an array.");
1236
+ let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
1237
+ for (let i = 0; i < e.length; i += 1) {
1238
+ let o = e[i];
1239
+ X(o) || Y(`themes[${i}]`, "must be an object.");
1240
+ let s = o.id, c = o.name, l = o.version;
1241
+ (typeof s != "string" || s.length === 0) && Y(`themes[${i}].id`, "must be a non-empty string."), (typeof c != "string" || c.length === 0) && Y(`themes[${i}].name`, "must be a non-empty string."), typeof l == "string" && a(l) || Y(`themes[${i}].version`, "must be a semantic version."), n.has(s) && Y("themes", `theme id "${s}" is declared more than once.`), r.has(c) && Y("themes", `theme name "${c}" is declared more than once.`), n.add(s), r.add(c), t.push(Object.freeze({ ...o }));
1242
+ }
1243
+ return Object.freeze(t.sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)));
1244
+ }
1245
+ function Ct(e) {
1246
+ return X(e) || Y("metadata", "must be an object."), Z(e, _t, "metadata"), Object.freeze({
1247
+ ...e.title === void 0 ? {} : { title: Q(e.title, "metadata.title") },
1248
+ ...e.description === void 0 ? {} : { description: Q(e.description, "metadata.description") }
1249
+ });
1250
+ }
1251
+ function $(e) {
1252
+ if (X(e) && J.has(e)) return e;
1253
+ X(e) || Y("preset", "must be an object."), Z(e, ht, "preset"), e.protocol !== "reactive-md-preset/v1" && Y("protocol", `must be "${l}".`);
1254
+ let t = e.id;
1255
+ (typeof t != "string" || t.length > ct || !pt.test(t)) && Y("id", "must be a lowercase namespaced id.");
1256
+ let n = e.version;
1257
+ typeof n == "string" && a(n) || Y("version", "must be a semantic version such as \"1.0.0\"."), Array.isArray(e.components) || Y("components", "must be an array."), e.components.length > lt && Y("components", `accepts at most ${lt} components.`);
1258
+ let r = [], i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
1259
+ for (let t = 0; t < e.components.length; t += 1) {
1260
+ let n;
1261
+ try {
1262
+ n = Je(e.components[t]);
1263
+ } catch (e) {
1264
+ Y(`components[${t}]`, e instanceof Error ? e.message : String(e));
1265
+ }
1266
+ i.has(n.id) && Y("components", `component id "${n.id}" is declared more than once.`), o.has(n.name) && Y("components", `component name "${n.name}" is declared more than once.`), i.add(n.id), o.add(n.name), r.push(n);
1267
+ }
1268
+ let s = e.authoring === void 0 ? void 0 : bt(e.authoring, r), c = e.themes === void 0 ? void 0 : St(e.themes), u = e.dependencies === void 0 ? void 0 : xt(e.dependencies), d = e.metadata === void 0 ? void 0 : Ct(e.metadata), f = e.components, p = Object.isFrozen(f) && f.length === r.length && f.every((e, t) => e === r[t]) ? f : Object.freeze(r), m = Object.freeze({
1269
+ protocol: l,
1270
+ id: t,
1271
+ version: n,
1272
+ components: p,
1273
+ ...s ? { authoring: s } : {},
1274
+ ...c ? { themes: c } : {},
1275
+ ...u ? { dependencies: u } : {},
1276
+ ...d ? { metadata: d } : {}
1277
+ });
1278
+ return J.add(m), m;
1279
+ }
1280
+ function wt(e) {
1281
+ return $(e);
1282
+ }
1283
+ function Tt(e) {
1284
+ let t = $(e);
1285
+ return u(JSON.stringify({
1286
+ protocol: l,
1287
+ id: t.id,
1288
+ version: t.version,
1289
+ components: [...t.components].map((e) => ({
1290
+ id: e.id,
1291
+ version: e.version,
1292
+ digest: K(e)
1293
+ })).sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)),
1294
+ dependencies: [...t.dependencies ?? []].map((e) => ({
1295
+ id: e.id,
1296
+ version: e.version
1297
+ })).sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id))
1298
+ }));
1299
+ }
1300
+ export { k as A, _ as C, it as D, q as E, W as M, f as N, K as O, u as P, te as S, Je as T, De as _, st as a, ke as b, Ee as c, v as d, g as f, m as g, y as h, at as i, L as j, rt as k, p as l, h as m, Tt as n, ot as o, S as p, $ as r, Ae as s, wt as t, x as u, Oe as v, tt as w, ee as x, b as y };