reactive-md 0.9.3 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/CHANGELOG-ch.md +34 -0
  2. package/CHANGELOG.md +34 -0
  3. package/README-ch.md +7 -7
  4. package/README-en.md +7 -7
  5. package/README.md +7 -7
  6. package/THIRD_PARTY_NOTICES.md +0 -57
  7. package/cli/help.mjs +6 -4
  8. package/cli/init.mjs +1 -1
  9. package/cli/migrate.mjs +1 -1
  10. package/dist-library/{LocalDocumentView-D6zQkTkt.js → LocalDocumentView-CP2QG86k.js} +46 -44
  11. package/dist-library/{LocalDocumentViewCore-CmJhemcA.js → LocalDocumentViewCore-Cd6yMEkg.js} +284 -265
  12. package/dist-library/{LocalReactiveDocumentCore-lAKOGAZ7.js → LocalReactiveDocumentCore-VuYpZqdn.js} +7 -7
  13. package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
  14. package/dist-library/authoring-Bwu_zCWs.js +768 -0
  15. package/dist-library/choice-values-BItGjPD2.js +58 -0
  16. package/dist-library/compile-B35rfzKr.js +1742 -0
  17. package/dist-library/{compile-cache-key-6GgpETz_.js → compile-cache-key-D21X2Obx.js} +5 -5
  18. package/dist-library/{compiler-DLkKUK4t.js → compiler-DBwLawMZ.js} +4 -4
  19. package/dist-library/{compiler-core-Niqhp9wV.js → compiler-core-kkDiQ1RK.js} +3146 -2055
  20. package/dist-library/{component-kernel-IG4wOO0i.js → component-kernel-CsJSabHX.js} +42 -26
  21. package/dist-library/{component-state-Ht-hOK0W.js → component-state-Da0G8Ajc.js} +1 -1
  22. package/dist-library/{component-utils-eSj5IdG4.js → component-utils-ZM3jUJNy.js} +80 -79
  23. package/dist-library/conditional-branches-CIhJXasR.js +17 -0
  24. package/dist-library/{config-validation-Cpol91_M.js → config-validation-DbmsWAEV.js} +165 -152
  25. package/dist-library/{controls-B-CLSK8Q.js → controls-DRy5rzzN.js} +271 -228
  26. package/dist-library/{coordinate-PyLPMIQK.js → coordinate-c54pHfgf.js} +29 -29
  27. package/dist-library/data-table-CSAkm1eU.js +290 -0
  28. package/dist-library/data-table-model-DruztQFt.js +391 -0
  29. package/dist-library/{data-visuals-_Z7QqYTk.js → data-visuals-rZQUeQM0.js} +14 -14
  30. package/dist-library/{default-components-jugH7Ubr.js → default-components-B-39etG9.js} +233 -71
  31. package/dist-library/{default-config-DIrRpuQz.js → default-config-CCa8rm2k.js} +236 -216
  32. package/dist-library/default-options-By16CVw1.js +131 -0
  33. package/dist-library/{default-registry-BlloaZi7.js → default-registry-DXJy66xj.js} +3 -3
  34. package/dist-library/{default-schema-Ch-Vznpm.js → default-schema-CeYiEW1K.js} +3 -3
  35. package/dist-library/display-Bb6hAG5T.js +2065 -0
  36. package/dist-library/{document-theme-DBAfnk7y.js → document-theme-CJvN-nC1.js} +190 -3
  37. package/dist-library/{export-heVBqgxA.js → export-BSV4E0jv.js} +105 -106
  38. package/dist-library/font-aliases-CKYjwn4o.js +4 -0
  39. package/dist-library/{gallery-Q6VPS2ep.js → gallery-DM2yTVZJ.js} +1 -1
  40. package/dist-library/{html-CCnvzan1.js → html-CY9mC3Sr.js} +5 -5
  41. package/dist-library/{incremental-Bzvh8_lB.js → incremental-B-wW4H3F.js} +251 -245
  42. package/dist-library/{display-y4v9v0Qd.js → katex-4ukd4ZxT.js} +1555 -3618
  43. package/dist-library/layout-CPQggKxk.js +592 -0
  44. package/dist-library/{layout-BnfDeUNy.js → layout-CaDWsDof.js} +1 -1
  45. package/dist-library/{math-view-B0jthpRw.js → math-view-CyGTS6kv.js} +1 -1
  46. package/dist-library/{mount-preset-C_i37FvY.js → mount-preset-DtrCX4G8.js} +4 -4
  47. package/dist-library/{numeric-sliders-CkWS0-ja.js → numeric-sliders-BmJ1LCLx.js} +190 -190
  48. package/dist-library/{observability-CYLuvFfL.js → observability-BVQ16ByQ.js} +5 -4
  49. package/dist-library/{package-core-9UK5ZdqB.js → package-core-Cu_r_qs7.js} +7 -6
  50. package/dist-library/{parser-9yNJxGip.js → parser-BHl9Lxbw.js} +2 -2
  51. package/dist-library/{parser-standard-BPIy4HOu.js → parser-standard-DDAKv_DZ.js} +247 -247
  52. package/dist-library/{plugin-packs-CZb46nuv.js → plugin-packs-CkI0floL.js} +3 -3
  53. package/dist-library/{preset-core-BW3NWZJ9.js → preset-core-BKPbH_Nv.js} +377 -306
  54. package/dist-library/{props-pJRrfDc6.js → props-0iDqxlTk.js} +56 -61
  55. package/dist-library/{react-BSo0o998.js → react-74jdGBmu.js} +2 -2
  56. package/dist-library/reactive-md-authoring.js +277 -269
  57. package/dist-library/reactive-md-build.js +327 -33
  58. package/dist-library/reactive-md-compiler-session.js +3 -3
  59. package/dist-library/reactive-md-compiler-standard.js +10 -10
  60. package/dist-library/reactive-md-compiler.js +3 -3
  61. package/dist-library/reactive-md-contracts.js +4 -4
  62. package/dist-library/reactive-md-default-packs.js +4 -3
  63. package/dist-library/reactive-md-default-preset.js +3 -3
  64. package/dist-library/reactive-md-export.js +6 -6
  65. package/dist-library/reactive-md-minimal-preset.js +3 -2
  66. package/dist-library/reactive-md-minimal-react-preset.js +18 -17
  67. package/dist-library/reactive-md-minimal.css +1 -1
  68. package/dist-library/reactive-md-observability.js +2 -2
  69. package/dist-library/reactive-md-pack-style-manifest.js +8 -0
  70. package/dist-library/reactive-md-plugin-chart.js +13 -9
  71. package/dist-library/reactive-md-plugin-data.js +4 -4
  72. package/dist-library/reactive-md-plugin-diagram.js +3 -3
  73. package/dist-library/reactive-md-plugin-forms.js +5 -5
  74. package/dist-library/reactive-md-plugin-gallery.js +3 -3
  75. package/dist-library/reactive-md-plugin-navigation.js +10 -10
  76. package/dist-library/reactive-md-plugin-network.js +5 -5
  77. package/dist-library/reactive-md-plugin-plot.js +4 -4
  78. package/dist-library/reactive-md-react-component-accordion.js +3 -3
  79. package/dist-library/reactive-md-react-component-alert.js +3 -3
  80. package/dist-library/reactive-md-react-component-anchor.js +3 -3
  81. package/dist-library/reactive-md-react-component-badge.js +3 -3
  82. package/dist-library/reactive-md-react-component-card.js +3 -3
  83. package/dist-library/reactive-md-react-component-chart.js +2 -2
  84. package/dist-library/reactive-md-react-component-checkbox.js +2 -2
  85. package/dist-library/reactive-md-react-component-checklist.js +2 -2
  86. package/dist-library/reactive-md-react-component-choices.js +2 -2
  87. package/dist-library/reactive-md-react-component-column.js +1 -1
  88. package/dist-library/reactive-md-react-component-coordinate.js +2 -2
  89. package/dist-library/reactive-md-react-component-counter.js +2 -2
  90. package/dist-library/reactive-md-react-component-data-table.js +2 -2
  91. package/dist-library/reactive-md-react-component-date.js +2 -2
  92. package/dist-library/reactive-md-react-component-diagram.js +2 -2
  93. package/dist-library/reactive-md-react-component-disclosure.js +3 -3
  94. package/dist-library/reactive-md-react-component-edge.js +1 -1
  95. package/dist-library/reactive-md-react-component-else.js +10 -0
  96. package/dist-library/reactive-md-react-component-gallery-item.js +2 -2
  97. package/dist-library/reactive-md-react-component-gallery.js +2 -2
  98. package/dist-library/reactive-md-react-component-grid.js +3 -3
  99. package/dist-library/reactive-md-react-component-if.js +3 -3
  100. package/dist-library/reactive-md-react-component-input.js +2 -2
  101. package/dist-library/reactive-md-react-component-jump.js +3 -3
  102. package/dist-library/reactive-md-react-component-multi-select.js +2 -2
  103. package/dist-library/reactive-md-react-component-node.js +2 -2
  104. package/dist-library/reactive-md-react-component-number.js +2 -2
  105. package/dist-library/reactive-md-react-component-option.js +1 -1
  106. package/dist-library/reactive-md-react-component-panel.js +3 -3
  107. package/dist-library/reactive-md-react-component-plot.js +2 -2
  108. package/dist-library/reactive-md-react-component-progress.js +2 -2
  109. package/dist-library/reactive-md-react-component-quiz.js +2 -2
  110. package/dist-library/reactive-md-react-component-radio-group.js +2 -2
  111. package/dist-library/reactive-md-react-component-range-slider.js +2 -2
  112. package/dist-library/reactive-md-react-component-section.js +3 -3
  113. package/dist-library/reactive-md-react-component-select.js +2 -2
  114. package/dist-library/reactive-md-react-component-slider.js +2 -2
  115. package/dist-library/reactive-md-react-component-step.js +3 -3
  116. package/dist-library/reactive-md-react-component-steps.js +3 -3
  117. package/dist-library/reactive-md-react-component-tab.js +3 -3
  118. package/dist-library/reactive-md-react-component-table.js +2 -2
  119. package/dist-library/reactive-md-react-component-tabs.js +3 -3
  120. package/dist-library/reactive-md-react-component-text.js +3 -3
  121. package/dist-library/reactive-md-react-component-textarea.js +2 -2
  122. package/dist-library/reactive-md-react-component-timeline.js +2 -2
  123. package/dist-library/reactive-md-react-component-timer.js +2 -2
  124. package/dist-library/reactive-md-react-component-toggle.js +2 -2
  125. package/dist-library/reactive-md-react-component-tooltip.js +3 -3
  126. package/dist-library/reactive-md-react-component-validation.js +3 -3
  127. package/dist-library/reactive-md-react-minimal.js +4 -4
  128. package/dist-library/reactive-md-react-pack-controls.js +4 -4
  129. package/dist-library/reactive-md-react-pack-data.js +3 -3
  130. package/dist-library/reactive-md-react-pack-layout.js +25 -24
  131. package/dist-library/reactive-md-react-pack-visuals.js +2 -2
  132. package/dist-library/reactive-md-react-packed.js +6 -6
  133. package/dist-library/reactive-md-react-server.js +37 -36
  134. package/dist-library/reactive-md-react-static-server.js +2 -2
  135. package/dist-library/reactive-md-react-static.js +1 -1
  136. package/dist-library/reactive-md-react-unstyled.js +12 -12
  137. package/dist-library/reactive-md-react.js +12 -12
  138. package/dist-library/reactive-md-scan.js +1 -1
  139. package/dist-library/reactive-md-sdk.js +23 -9
  140. package/dist-library/reactive-md-standalone-configured.js +2 -2
  141. package/dist-library/reactive-md-standalone-host.js +2 -2
  142. package/dist-library/reactive-md-testing-browser.js +2 -2
  143. package/dist-library/reactive-md-testing-react.js +6 -6
  144. package/dist-library/reactive-md-testing.js +6 -6
  145. package/dist-library/reactive-md-vite.js +25 -9
  146. package/dist-library/reactive-md-worker-pool.js +3 -3
  147. package/dist-library/reactive-md.css +1 -1
  148. package/dist-library/reactive-md.js +52 -43
  149. package/dist-library/{registry-core-CziAIP5P.js → registry-core-DxEaxhJ6.js} +3 -2
  150. package/dist-library/{render-nodes-DKjg_TR1.js → render-nodes-B6j6Ip5I.js} +766 -731
  151. package/dist-library/{requirements-DhIkxAbl.js → requirements-C56sFIEs.js} +2 -2
  152. package/dist-library/{resources-B_nbROgj.js → resources-6VaNgk-h.js} +2 -2
  153. package/dist-library/rmd-pack-layout.css +9 -0
  154. package/dist-library/rmd-pack-resource-layout.css +9 -0
  155. package/dist-library/runtime-BHeuLOv_.js +1369 -0
  156. package/dist-library/{runtime-requirement-C4-vNcf5.js → runtime-requirement-DzPO8raU.js} +166 -163
  157. package/dist-library/{schema-core-4sd1Vu7V.js → schema-core-CDXfxdID.js} +24 -1
  158. package/dist-library/{sdk-core-BLsW9cCy.js → sdk-core-CnE-n0Z7.js} +469 -314
  159. package/dist-library/{session-core-DLBRPV7f.js → session-core-C071yQwV.js} +140 -127
  160. package/dist-library/{validation-XXlb-spV.js → sha256-utf16-Bmandi_H.js} +392 -315
  161. package/dist-library/shareable-CHCDnl6j.js +844 -0
  162. package/dist-library/types/authoring/catalog.d.ts +3 -1
  163. package/dist-library/types/authoring/index.d.ts +1 -1
  164. package/dist-library/types/components/chart/default-chart-types.d.ts +3 -0
  165. package/dist-library/types/components/chart/default-chart.d.ts +7 -0
  166. package/dist-library/types/components/entries/else.d.ts +3 -0
  167. package/dist-library/types/components/layout/layout.d.ts +5 -0
  168. package/dist-library/types/components/shared/visuals.d.ts +1 -1
  169. package/dist-library/types/components/table/data-table-model.d.ts +95 -2
  170. package/dist-library/types/components/table/data-table.d.ts +2 -2
  171. package/dist-library/types/contracts/component-kernel.d.ts +5 -0
  172. package/dist-library/types/contracts/font-aliases.d.ts +18 -0
  173. package/dist-library/types/contracts/number-literal.d.ts +2 -0
  174. package/dist-library/types/contracts/sha256-utf16.d.ts +2 -0
  175. package/dist-library/types/export/index.d.ts +4 -1
  176. package/dist-library/types/local/compilation/compiler-choices.d.ts +4 -0
  177. package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
  178. package/dist-library/types/local/compilation/compiler-expressions.d.ts +12 -1
  179. package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
  180. package/dist-library/types/local/compilation/compiler-structure.d.ts +8 -2
  181. package/dist-library/types/local/compilation/compiler-tables.d.ts +1 -0
  182. package/dist-library/types/local/compilation/compiler-validation.d.ts +11 -0
  183. package/dist-library/types/local/compilation/compiler-values.d.ts +1 -2
  184. package/dist-library/types/local/configuration/diagnostic-messages.d.ts +173 -2
  185. package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -0
  186. package/dist-library/types/local/evaluation/choice-values.d.ts +22 -0
  187. package/dist-library/types/local/evaluation/computations.d.ts +13 -5
  188. package/dist-library/types/local/evaluation/dataset.d.ts +4 -0
  189. package/dist-library/types/local/evaluation/expression/collection-functions.d.ts +13 -0
  190. package/dist-library/types/local/evaluation/expression/compile.d.ts +11 -4
  191. package/dist-library/types/local/evaluation/expression/data-functions.d.ts +23 -0
  192. package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -1
  193. package/dist-library/types/local/evaluation/expression/internal-names.d.ts +8 -0
  194. package/dist-library/types/local/evaluation/expression/syntax.d.ts +19 -2
  195. package/dist-library/types/local/evaluation/expression/transform-budget.d.ts +13 -0
  196. package/dist-library/types/local/evaluation/expression/values.d.ts +9 -1
  197. package/dist-library/types/local/evaluation/validation.d.ts +8 -6
  198. package/dist-library/types/local/index.d.ts +4 -3
  199. package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
  200. package/dist-library/types/local/parsing/source-revision.d.ts +3 -0
  201. package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -0
  202. package/dist-library/types/local/runtime/runtime.d.ts +3 -1
  203. package/dist-library/types/local/runtime/state.d.ts +30 -15
  204. package/dist-library/types/local/source/authoring-requirements.d.ts +3 -0
  205. package/dist-library/types/local/source/authoring-syntax.d.ts +3 -2
  206. package/dist-library/types/local/source/authoring.d.ts +10 -0
  207. package/dist-library/types/local/source/source-migration.d.ts +1 -0
  208. package/dist-library/types/local/types.d.ts +33 -2
  209. package/dist-library/types/react/component-api.d.ts +21 -2
  210. package/dist-library/types/react/component-utils.d.ts +11 -0
  211. package/dist-library/types/react/font-aliases.d.ts +2 -0
  212. package/dist-library/types/react/package-core.d.ts +3 -0
  213. package/dist-library/types/react/rendering/document/validation-state.d.ts +1 -1
  214. package/dist-library/types/react/rendering/document/view-revision.d.ts +3 -12
  215. package/dist-library/types/react/rendering/table/data-table.d.ts +1 -1
  216. package/dist-library/types/react/sdk-core.d.ts +3 -1
  217. package/dist-library/types/sdk/assembly.d.ts +3 -0
  218. package/dist-library/types/sdk/font.d.ts +13 -0
  219. package/dist-library/types/sdk/index.d.ts +1 -0
  220. package/dist-library/types/sdk/theme.d.ts +5 -0
  221. package/dist-library/types/sdk/types.d.ts +6 -0
  222. package/dist-library/types/sdk/version.d.ts +1 -1
  223. package/dist-library/types/shareable.d.ts +15 -3
  224. package/dist-library/types/standalone/prepare.d.ts +4 -2
  225. package/dist-library/types/standalone/session-core.d.ts +4 -1
  226. package/dist-library/types/vite/index.d.ts +3 -0
  227. package/dist-library/types/vite/registration.d.ts +1 -0
  228. package/dist-library/{types-Bza88SGK.js → types-B4qG8J4S.js} +1 -1
  229. package/dist-library/types-FYhRWRn9.js +3 -0
  230. package/dist-library/use-hydrated-D1gFY2Dq.js +2655 -0
  231. package/dist-library/validation-DRuW0Wl9.js +433 -0
  232. package/dist-library/{version-B0G1699c.js → version-4wzhbvDG.js} +1 -1
  233. package/dist-library/{visual-helpers-CRmaqCHX.js → visual-helpers-UU6xiL8g.js} +3 -3
  234. package/dist-library/visuals-7xzoL9ql.js +49340 -0
  235. package/dist-library/{worker-D6WMV8xJ.js → worker-3ldRjOEG.js} +9 -9
  236. package/dist-standalone/reactive-md-standalone.css +1 -1
  237. package/dist-standalone/reactive-md-standalone.js +128 -368
  238. package/docs/README-ch.md +3 -1
  239. package/docs/README.md +3 -1
  240. package/docs/compatibility/api-stability-ch.md +1 -1
  241. package/docs/compatibility/api-stability-en.md +1 -1
  242. package/docs/compatibility/compatibility-ch.md +15 -15
  243. package/docs/compatibility/compatibility-en.md +15 -15
  244. package/docs/compatibility/compatibility-manifest.schema.json +3 -2
  245. package/docs/compatibility/deprecation-ch.md +2 -2
  246. package/docs/compatibility/deprecation-en.md +2 -2
  247. package/docs/compatibility/source-versioning-ch.md +22 -14
  248. package/docs/compatibility/source-versioning-en.md +22 -13
  249. package/docs/compatibility/support-matrix-ch.md +4 -3
  250. package/docs/compatibility/support-matrix-en.md +4 -3
  251. package/docs/development/component-development-ch.md +2 -2
  252. package/docs/development/component-development-en.md +2 -2
  253. package/docs/development/component-protocol-ch.md +18 -18
  254. package/docs/development/component-protocol-en.md +14 -14
  255. package/docs/guides/local-guide-ch.md +109 -20
  256. package/docs/guides/local-guide-en.md +109 -20
  257. package/docs/integration/author-tools-ch.md +1 -1
  258. package/docs/integration/author-tools-en.md +1 -1
  259. package/docs/integration/editor-ch.md +3 -3
  260. package/docs/integration/editor-en.md +3 -3
  261. package/docs/integration/extension-sdk-ch.md +29 -3
  262. package/docs/integration/extension-sdk-en.md +29 -3
  263. package/docs/integration/local-integration-ch.md +3 -3
  264. package/docs/integration/local-integration-en.md +3 -3
  265. package/docs/integration/pdf-export-ch.md +42 -0
  266. package/docs/integration/pdf-export-en.md +42 -0
  267. package/docs/integration/shareable-export-ch.md +11 -19
  268. package/docs/integration/shareable-export-en.md +11 -19
  269. package/docs/reference/diagnostics-counting-ch.md +24 -1
  270. package/docs/reference/diagnostics-counting-en.md +24 -1
  271. package/docs/reference/local-interaction-syntax-ch.md +222 -33
  272. package/docs/reference/local-interaction-syntax-en.md +220 -31
  273. package/docs/reference/public-api-ch.md +24 -18
  274. package/docs/reference/public-api-en.md +24 -18
  275. package/docs/reference/theme-protocol-ch.md +1 -1
  276. package/docs/reference/theme-protocol-en.md +1 -1
  277. package/docs/releases/release-0.10.0-ch.md +45 -0
  278. package/docs/releases/release-0.10.0-en.md +45 -0
  279. package/examples/conformance/README-ch.md +3 -3
  280. package/examples/conformance/README.md +3 -3
  281. package/examples/conformance/local-draft-4.json +441 -0
  282. package/examples/integration/README-ch.md +3 -3
  283. package/examples/integration/README.md +3 -3
  284. package/examples/integration/chat-session/package.json +1 -1
  285. package/examples/local/README-ch.md +1 -1
  286. package/examples/local/README.md +1 -1
  287. package/package.json +6 -1
  288. package/dist-library/LocalStaticDocumentView-2J7w0sKm.js +0 -143
  289. package/dist-library/authoring-B14SsOXZ.js +0 -893
  290. package/dist-library/compile-D50B5_Ww.js +0 -1249
  291. package/dist-library/computations-CffoW7Ff.js +0 -340
  292. package/dist-library/data-table-Kv_ZA2Z2.js +0 -297
  293. package/dist-library/default-options-DU5dxuU6.js +0 -125
  294. package/dist-library/layout-BfUzzO2b.js +0 -553
  295. package/dist-library/runtime-CuJndKqK.js +0 -1289
  296. package/dist-library/shareable-C6mUerpQ.js +0 -817
  297. package/dist-library/types-daDo2c_w.js +0 -3
  298. package/dist-library/use-hydrated-W-laKPhY.js +0 -22975
  299. package/dist-library/visuals-CoVSjVD8.js +0 -49159
@@ -1,19 +1,19 @@
1
- import { t as e } from "./compiler-core-Niqhp9wV.js";
2
- import { t } from "./types-daDo2c_w.js";
3
- import { t as n } from "./compiler-DLkKUK4t.js";
4
- import { r } from "./html-CCnvzan1.js";
5
- import { b as i, s as a } from "./default-config-DIrRpuQz.js";
6
- import { r as o } from "./default-options-DU5dxuU6.js";
1
+ import { t as e } from "./compiler-core-kkDiQ1RK.js";
2
+ import { t } from "./types-FYhRWRn9.js";
3
+ import { t as n } from "./compiler-DBwLawMZ.js";
4
+ import { r } from "./html-CY9mC3Sr.js";
5
+ import { b as i, s as a } from "./default-config-CCa8rm2k.js";
6
+ import { r as o } from "./default-options-By16CVw1.js";
7
7
  import { u as s } from "./component-state-CwKX_SN5.js";
8
- import { n as c } from "./runtime-CuJndKqK.js";
9
- import { a as l } from "./identity-BUx0Q_-d.js";
10
- import { _ as u, d, h as f, i as p, u as m } from "./shareable-C6mUerpQ.js";
11
- import { r as h } from "./requirements-DhIkxAbl.js";
12
- import { t as g } from "./resources-B_nbROgj.js";
13
- import { jsx as _ } from "react/jsx-runtime";
14
- import { createRoot as v, hydrateRoot as y } from "react-dom/client";
8
+ import { i as c, n as l } from "./runtime-BHeuLOv_.js";
9
+ import { a as u } from "./identity-BUx0Q_-d.js";
10
+ import { S as d, a as f, d as p, f as m, g as h, v as g, x as _, y as v } from "./shareable-CHCDnl6j.js";
11
+ import { r as y } from "./requirements-C56sFIEs.js";
12
+ import { t as b } from "./resources-6VaNgk-h.js";
13
+ import { jsx as x } from "react/jsx-runtime";
14
+ import { createRoot as ee, hydrateRoot as te } from "react-dom/client";
15
15
  // src/standalone/diagnostics.ts
16
- function b(e, t) {
16
+ function S(e, t) {
17
17
  return {
18
18
  code: e,
19
19
  message: t,
@@ -26,44 +26,44 @@ function b(e, t) {
26
26
  column: 1
27
27
  };
28
28
  }
29
- function x(e, t = 8) {
29
+ function C(e, t = 8) {
30
30
  let n = e.slice(0, t).map((e) => `- [${e.code}] ${e.message} (line ${e.line}, column ${e.column})`);
31
31
  return e.length > n.length && n.push(`- ${e.length - n.length} more diagnostic(s).`), n.join("\n");
32
32
  }
33
- function S(e) {
33
+ function w(e) {
34
34
  return e instanceof Error ? e.message : String(e);
35
35
  }
36
- var C = class extends Error {
36
+ var T = class extends Error {
37
37
  diagnostics;
38
38
  constructor(e, t) {
39
- let n = x(t);
39
+ let n = C(t);
40
40
  super(n ? `${e}\n${n}` : e), this.name = "ReactiveMDMountError", this.diagnostics = t;
41
41
  }
42
42
  };
43
- function w(e, t = "standalone.mount") {
43
+ function E(e, t = "standalone.mount") {
44
44
  if (typeof e == "object" && e && Array.isArray(e.diagnostics)) {
45
45
  let t = e.diagnostics;
46
46
  if (t.length > 0) return t;
47
47
  }
48
- return [b(t, S(e))];
48
+ return [S(t, w(e))];
49
49
  }
50
50
  // src/standalone/events.ts
51
- var T = "reactive-md-diagnostics", E = "reactive-md-state-change", D = /^[A-Za-z][A-Za-z0-9_-]*$/, O = 256, k = /^data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/, A = /[\u0000-\u001f\u007f-\u009f]/, j = 64, M = 4096, N = 41943040;
52
- function P(e, t) {
51
+ var D = "reactive-md-diagnostics", O = "reactive-md-state-change", k = /^[A-Za-z][A-Za-z0-9_-]*$/, A = 256, j = /^data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/, M = /[\u0000-\u001f\u007f-\u009f]/, N = 64, P = 4096, F = 41943040;
52
+ function I(e, t) {
53
53
  if (e === void 0) return;
54
- if (!I(e)) {
54
+ if (!R(e)) {
55
55
  t("standalone.payload.images", "images must be a JSON object mapping image URLs to data URLs.");
56
56
  return;
57
57
  }
58
58
  let n = Object.entries(e);
59
- if (n.length > j) {
60
- t("standalone.payload.images", `images cannot contain more than ${j} entries.`);
59
+ if (n.length > N) {
60
+ t("standalone.payload.images", `images cannot contain more than ${N} entries.`);
61
61
  return;
62
62
  }
63
63
  let r = Object.create(null), i = 0;
64
- for (let [e, a] of n) if (!e || e.length > M || e === "__proto__" || A.test(e) || typeof a != "string" || !k.test(a)) t("standalone.payload.images", "Every image entry must use a bounded URL key and a base64 raster data URL.");
64
+ for (let [e, a] of n) if (!e || e.length > P || e === "__proto__" || M.test(e) || typeof a != "string" || !j.test(a)) t("standalone.payload.images", "Every image entry must use a bounded URL key and a base64 raster data URL.");
65
65
  else {
66
- if (i += a.length, i > N) {
66
+ if (i += a.length, i > F) {
67
67
  t("standalone.payload.images", "The embedded image map exceeds the 40 MiB budget.");
68
68
  return;
69
69
  }
@@ -71,30 +71,30 @@ function P(e, t) {
71
71
  }
72
72
  return r;
73
73
  }
74
- function F(e, t) {
74
+ function L(e, t) {
75
75
  if (e === void 0) return;
76
76
  let n = o(e);
77
77
  if (!n.ok) t("standalone.payload.compile-options", `The payload compile options are invalid: ${n.message}`);
78
- else return d(e);
78
+ else return m(e);
79
79
  }
80
- function I(e) {
80
+ function R(e) {
81
81
  if (typeof e != "object" || !e || Array.isArray(e)) return !1;
82
82
  let t = Object.getPrototypeOf(e);
83
83
  return t === Object.prototype || t === null;
84
84
  }
85
- function L(e, t) {
85
+ function z(e, t) {
86
86
  if (e === void 0) return;
87
- let n = l(e);
87
+ let n = u(e);
88
88
  if (typeof e != "string" || n !== e) t("standalone.payload.document-id", "The payload documentId must be a canonical 1-256 character string.");
89
89
  else return n;
90
90
  }
91
- function R(e, t) {
91
+ function B(e, t) {
92
92
  if (e !== void 0) {
93
93
  if (typeof e != "number" || !Number.isInteger(e) || e < 0 || e > 4294967295) t("standalone.payload.random-seed", "The payload randomSeed must be a 32-bit unsigned integer.");
94
94
  else return e;
95
95
  }
96
96
  }
97
- function z(e, t) {
97
+ function V(e, t) {
98
98
  if (e === void 0) return;
99
99
  let n = s(e);
100
100
  if (!n.ok || n.diagnostics.length > 0) {
@@ -103,17 +103,17 @@ function z(e, t) {
103
103
  for (let n of e) t("standalone.payload.component-state", n.message);
104
104
  } else return n.document;
105
105
  }
106
- function B(e) {
106
+ function H(e) {
107
107
  let t = [], n = (e, n) => {
108
- t.push(b(e, n));
108
+ t.push(S(e, n));
109
109
  };
110
- if (!I(e)) return {
110
+ if (!R(e)) return {
111
111
  ok: !1,
112
- diagnostics: [b("standalone.payload.shape", "The reactive-md payload must be a JSON object.")]
112
+ diagnostics: [S("standalone.payload.shape", "The reactive-md payload must be a JSON object.")]
113
113
  };
114
114
  e.version !== 1 && e.version !== 2 && n("standalone.payload.version", "The reactive-md payload must use version 1 or 2."), e.version === 2 && e.restoration === void 0 && n("standalone.payload.requirements", "Version 2 requires restoration contracts."), e.version === 1 && (e.restoration !== void 0 || e.resources !== void 0) && n("standalone.payload.version", "Restoration contracts require payload version 2.");
115
115
  let r = e.target;
116
- typeof r != "string" || r.length === 0 || r.length > O ? n("standalone.payload.target", `The payload target must be an element id of 1-${O} characters.`) : D.test(r) || n("standalone.payload.target", "The payload target must start with a letter and use only letters, digits, underscores or hyphens.");
116
+ typeof r != "string" || r.length === 0 || r.length > A ? n("standalone.payload.target", `The payload target must be an element id of 1-${A} characters.`) : k.test(r) || n("standalone.payload.target", "The payload target must start with a letter and use only letters, digits, underscores or hyphens.");
117
117
  let i = e.source;
118
118
  typeof i != "string" && n("standalone.payload.source", "The payload source must be a string.");
119
119
  let a = e.locale === void 0 ? "en" : e.locale;
@@ -123,22 +123,22 @@ function B(e) {
123
123
  let s = e.hydrate !== void 0 && e.hydrate;
124
124
  typeof s != "boolean" && n("standalone.payload.hydrate", "The payload hydrate flag must be a boolean.");
125
125
  let c = e.state;
126
- I(c) || n("standalone.payload.state", "The payload state must be a JSON object.");
126
+ R(c) || n("standalone.payload.state", "The payload state must be a JSON object.");
127
127
  let l = e.sourceSemantics;
128
128
  l !== void 0 && l !== "mixed-rmd-v1" && n("standalone.payload.source-semantics", "Unsupported Reactive MD source semantics.");
129
- let u = F(l === void 0 && I(e.compileOptions) ? {
129
+ let u = L(l === void 0 && R(e.compileOptions) ? {
130
130
  enableCss: !1,
131
131
  ...e.compileOptions
132
132
  } : e.compileOptions, n);
133
- t.push(...h(e.extensions, u?.config));
134
- let d = g(e.resources ?? []);
135
- t.push(...d.diagnostics), t.push(...m(e.restoration, {
133
+ t.push(...y(e.extensions, u?.config));
134
+ let d = b(e.resources ?? []);
135
+ t.push(...d.diagnostics), t.push(...p(e.restoration, {
136
136
  config: u?.config,
137
137
  source: typeof i == "string" ? i : "",
138
138
  resources: d.resources
139
139
  }));
140
- let f = P(e.images, n), p = L(e.documentId, n), _ = R(e.randomSeed, n), v = z(e.componentState, n);
141
- return t.length > 0 ? {
140
+ let f = I(e.images, n), m = z(e.documentId, n), h = B(e.randomSeed, n), g = V(e.componentState, n), v = e.macroState === void 0 ? void 0 : _(e.macroState);
141
+ return v && !v.ok && t.push(...v.diagnostics), t.length > 0 ? {
142
142
  ok: !1,
143
143
  diagnostics: t
144
144
  } : {
@@ -149,6 +149,7 @@ function B(e) {
149
149
  target: r,
150
150
  source: i,
151
151
  state: c,
152
+ ...v?.ok ? { macroState: v.file } : {},
152
153
  locale: a,
153
154
  colorScheme: o,
154
155
  hydrate: s,
@@ -159,37 +160,37 @@ function B(e) {
159
160
  resources: d.resources
160
161
  },
161
162
  ...f && Object.keys(f).length > 0 ? { images: f } : {},
162
- ...p === void 0 ? {} : { documentId: p },
163
- ..._ === void 0 ? {} : { randomSeed: _ },
164
- ...v === void 0 ? {} : { componentState: v }
163
+ ...m === void 0 ? {} : { documentId: m },
164
+ ...h === void 0 ? {} : { randomSeed: h },
165
+ ...g === void 0 ? {} : { componentState: g }
165
166
  }
166
167
  };
167
168
  }
168
- function V(e) {
169
+ function U(e) {
169
170
  try {
170
- return B(e);
171
+ return H(e);
171
172
  } catch (e) {
172
173
  return {
173
174
  ok: !1,
174
- diagnostics: [b("standalone.payload.invalid", `The reactive-md payload could not be read: ${S(e)}`)]
175
+ diagnostics: [S("standalone.payload.invalid", `The reactive-md payload could not be read: ${w(e)}`)]
175
176
  };
176
177
  }
177
178
  }
178
179
  // src/standalone/prepare.ts
179
- function H(i, a, s, c, l, d = !1) {
180
- if (typeof i != "string") throw new C("Cannot mount a Reactive MD document: source must be a string.", [b("standalone.source", "source must be a string.")]);
181
- let f = d && c?.enableCss === void 0 ? {
180
+ function W(i, a, s, c, l, u = !1, p) {
181
+ if (typeof i != "string") throw new T("Cannot mount a Reactive MD document: source must be a string.", [S("standalone.source", "source must be a string.")]);
182
+ let m = u && c?.enableCss === void 0 ? {
182
183
  ...c,
183
184
  enableCss: !1
184
- } : c, m = o(f), h = d && m.ok && (m.html.enableCss || m.html.enableJavaScript || m.html.enableExtendedHtml), g = h ? e(i, m, r) : n(i, f), _;
185
- if (g.ok) _ = g.document;
185
+ } : c, h = o(m), _ = u && h.ok && (h.html.enableCss || h.html.enableJavaScript || h.html.enableExtendedHtml), v = _ ? e(i, h, r) : n(i, m), y;
186
+ if (v.ok) y = v.document;
186
187
  else {
187
- if (!h) throw new C("Cannot mount a Reactive MD document: the source contains syntax errors.", g.diagnostics);
188
- _ = {
188
+ if (!_) throw new T("Cannot mount a Reactive MD document: the source contains syntax errors.", v.diagnostics);
189
+ y = {
189
190
  syntax: "local",
190
191
  syntaxVersion: t,
191
192
  source: i,
192
- html: m.html,
193
+ html: h.html,
193
194
  initialState: {},
194
195
  bindings: {},
195
196
  nodes: [{
@@ -203,30 +204,33 @@ function H(i, a, s, c, l, d = !1) {
203
204
  }]
204
205
  };
205
206
  }
206
- if (l?.(_), a !== void 0) {
207
- let e = u(a);
208
- if (!e.ok) throw new C("Cannot mount a Reactive MD document: the state payload is invalid.", e.diagnostics);
209
- let t = p(_, e.file);
210
- if (!t.ok) throw new C("Cannot mount a Reactive MD document: the state does not match this source.", t.diagnostics);
211
- _ = t.baseline.document;
207
+ l?.(y);
208
+ let b;
209
+ if (a !== void 0 || p !== void 0) {
210
+ let e = d(a ?? g(y, y.initialState));
211
+ if (!e.ok) throw new T("Cannot mount a Reactive MD document: the state payload is invalid.", e.diagnostics);
212
+ let t = f(y, e.file, p);
213
+ if (!t.ok) throw new T("Cannot mount a Reactive MD document: the state does not match this source.", t.diagnostics);
214
+ y = t.baseline.document, p !== void 0 && (b = t.baseline.state);
212
215
  }
213
- return typeof s == "string" && s.trim().length > 0 && (_ = {
214
- ..._,
216
+ return typeof s == "string" && s.trim().length > 0 && (y = {
217
+ ...y,
215
218
  theme: s.trim(),
216
219
  themeRange: void 0
217
220
  }), {
218
- document: _,
219
- diagnostics: g.diagnostics.slice()
221
+ document: y,
222
+ ...b ? { restoredValues: b } : {},
223
+ diagnostics: v.diagnostics.slice()
220
224
  };
221
225
  }
222
- var U = Object.freeze({
226
+ var G = Object.freeze({
223
227
  name: "reactive-md-standalone",
224
228
  version: "0.4.0"
225
- }), W = "data-reactive-md-mounted", G = "script[type=\"application/reactive-md+json\"][data-reactive-md-auto]", K = /^data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/, q = 64;
226
- function J(e) {
229
+ }), K = "data-reactive-md-mounted", q = "script[type=\"application/reactive-md+json\"][data-reactive-md-auto]", J = /^data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/, ne = 64;
230
+ function re(e) {
227
231
  if (!e) return {};
228
232
  let t = /* @__PURE__ */ new Map();
229
- for (let [n, r] of Object.entries(e).slice(0, q)) typeof n == "string" && n.length > 0 && typeof r == "string" && K.test(r) && t.set(n, r);
233
+ for (let [n, r] of Object.entries(e).slice(0, ne)) typeof n == "string" && n.length > 0 && typeof r == "string" && J.test(r) && t.set(n, r);
230
234
  return t.size === 0 ? {} : {
231
235
  urlPolicy: (e, n) => n === "link" || t.has(e),
232
236
  imageResolver: (e) => t.get(e) ?? null
@@ -236,15 +240,15 @@ var Y = /* @__PURE__ */ new WeakSet();
236
240
  function X(e) {
237
241
  return Y.has(e) || e.hasAttribute("data-reactive-md-mounted");
238
242
  }
239
- function ee(e, t) {
240
- return f(e, t);
243
+ function ie(e, t) {
244
+ return v(e, t);
241
245
  }
242
246
  function Z(e) {
243
247
  if (e) try {
244
248
  e();
245
249
  } catch {}
246
250
  }
247
- function te(e) {
251
+ function ae(e) {
248
252
  let t = () => {
249
253
  let t = e.querySelector("article.local-document");
250
254
  t && (t.classList.remove("local-static-first", "reactive-md-static-first", "reactive-md-hydrating"), t.removeAttribute("data-static-first"), t.removeAttribute("data-reactive-md-static-first")), e.classList.remove("local-static-first", "reactive-md-static-first"), e.removeAttribute("data-static-first");
@@ -258,71 +262,75 @@ function te(e) {
258
262
  };
259
263
  }
260
264
  function Q(e, t, n, r = {}) {
261
- if (!e || typeof e != "object" || !("nodeType" in e) || !e.hasAttribute) throw new C("Cannot mount a Reactive MD document: element must be an HTMLElement.", [b("standalone.element", "element must be an HTMLElement.")]);
262
- if (X(e)) throw new C("Cannot mount a Reactive MD document: this element is already mounted.", [b("standalone.mount", "The target element already hosts a Reactive MD document.")]);
263
- if (!t || typeof t != "object") throw new C("Cannot mount a Reactive MD document: options are required.", [b("standalone.options", "mount requires an options object with a source string.")]);
265
+ if (!e || typeof e != "object" || !("nodeType" in e) || !e.hasAttribute) throw new T("Cannot mount a Reactive MD document: element must be an HTMLElement.", [S("standalone.element", "element must be an HTMLElement.")]);
266
+ if (X(e)) throw new T("Cannot mount a Reactive MD document: this element is already mounted.", [S("standalone.mount", "The target element already hosts a Reactive MD document.")]);
267
+ if (!t || typeof t != "object") throw new T("Cannot mount a Reactive MD document: options are required.", [S("standalone.options", "mount requires an options object with a source string.")]);
264
268
  let o = t.compileOptions;
265
269
  if (t.reactConfig) {
266
- if (o?.hostComponents !== void 0 || t.themes !== void 0) throw new C("Conflicting extension registration.", [b("local.extension.config", "reactConfig cannot be combined with hostComponents or themes.")]);
267
- if (o?.config && a(o.config).key !== t.reactConfig.config.key) throw new C("The export configuration differs from the installed bundle.", [b("local.extension.config", "Compile configuration does not match installed implementations.")]);
270
+ if (o?.hostComponents !== void 0 || t.themes !== void 0) throw new T("Conflicting extension registration.", [S("local.extension.config", "reactConfig cannot be combined with hostComponents or themes.")]);
271
+ if (o?.config && a(o.config).key !== t.reactConfig.config.key) throw new T("The export configuration differs from the installed bundle.", [S("local.extension.config", "Compile configuration does not match installed implementations.")]);
268
272
  o = {
269
273
  ...o,
270
274
  config: t.reactConfig.config
271
275
  };
272
276
  }
273
- let s = h(t.extensions, t.reactConfig?.config);
274
- if (s.length) throw new C("Extension requirements are not satisfied.", s);
275
- let l = m(t.restoration, {
277
+ let s = y(t.extensions, t.reactConfig?.config);
278
+ if (s.length) throw new T("Extension requirements are not satisfied.", s);
279
+ let u = p(t.restoration, {
276
280
  config: t.reactConfig?.config ?? o?.config,
277
281
  source: t.source,
278
282
  resources: t.resources
279
283
  });
280
- if (l.length) throw new C("Restoration requirements are not satisfied.", l);
281
- let u = g(t.resources ?? []);
282
- if (u.diagnostics.length) throw new C("Style resources are invalid.", u.diagnostics);
283
- let d = H(t.source, t.state, r.theme, o, (e) => {
284
- let n = h(e.extensions, t.reactConfig?.config);
285
- if (n.push(...m(t.restoration, {
284
+ if (u.length) throw new T("Restoration requirements are not satisfied.", u);
285
+ let d = b(t.resources ?? []);
286
+ if (d.diagnostics.length) throw new T("Style resources are invalid.", d.diagnostics);
287
+ let f = W(t.source, t.state, r.theme, o, (e) => {
288
+ let n = y(e.extensions, t.reactConfig?.config);
289
+ if (n.push(...p(t.restoration, {
286
290
  config: t.reactConfig?.config ?? o?.config,
287
291
  source: t.source,
288
292
  resources: t.resources,
289
293
  document: e
290
- })), n.length) throw new C("Installed contracts must match before state recovery.", n);
291
- }, r.legacyPayload), f = h(d.document.extensions, t.reactConfig?.config);
292
- if (f.length) throw new C("Installed extension implementations are required.", f);
293
- let p = o?.config, x = p?.key ?? d.document.componentConfigKey, T = p?.legacyKeys.map((e) => e.key) ?? [], E;
294
+ })), n.length) throw new T("Installed contracts must match before state recovery.", n);
295
+ }, r.legacyPayload, t.macroState), m = y(f.document.extensions, t.reactConfig?.config);
296
+ if (m.length) throw new T("Installed extension implementations are required.", m);
297
+ let g = o?.config, _ = g?.key ?? f.document.componentConfigKey, v = g?.legacyKeys.map((e) => e.key) ?? [], C;
294
298
  try {
295
- E = c(d.document, {
299
+ C = l(f.document, {
296
300
  documentId: t.documentId,
297
301
  randomSeed: t.randomSeed,
298
302
  componentState: t.componentState,
299
- ...x === void 0 ? {} : { configKey: x },
300
- ...T.length === 0 ? {} : { legacyConfigKeys: T }
303
+ ..._ === void 0 ? {} : { configKey: _ },
304
+ ...v.length === 0 ? {} : { legacyConfigKeys: v }
301
305
  });
302
306
  } catch (e) {
303
- throw new C("Cannot mount a Reactive MD document: the interactive runtime could not be created.", [b("standalone.runtime", S(e))]);
307
+ throw new T("Cannot mount a Reactive MD document: the interactive runtime could not be created.", [S("standalone.runtime", w(e))]);
304
308
  }
305
- let D = t.generator ?? U, O = J(t.images), k = t.urlPolicy ?? O.urlPolicy, A = t.imageResolver ?? O.imageResolver, j = () => ee(E, D), M;
309
+ if (f.restoredValues) {
310
+ let e = c(C, f.restoredValues);
311
+ if (e.length) throw C.dispose(), new T("Cannot mount a Reactive MD document: macro state restoration failed.", e);
312
+ }
313
+ let D = t.generator ?? G, O = re(t.images), k = t.urlPolicy ?? O.urlPolicy, A = t.imageResolver ?? O.imageResolver, j = () => ie(C, D), M;
306
314
  try {
307
315
  M = j();
308
316
  } catch (e) {
309
317
  try {
310
- E.dispose();
318
+ C.dispose();
311
319
  } catch {}
312
- throw new C("Cannot mount a Reactive MD document: the initial state could not be captured.", [b("standalone.state", S(e))]);
320
+ throw new T("Cannot mount a Reactive MD document: the initial state could not be captured.", [S("standalone.state", w(e))]);
313
321
  }
314
322
  let N = !1, P = (e) => {
315
323
  N || Z(r.onDiagnostics ? () => r.onDiagnostics(e) : void 0);
316
324
  }, F = (() => {
317
325
  try {
318
- return E.services?.state.diagnostics() ?? [];
326
+ return C.services?.state.diagnostics() ?? [];
319
327
  } catch {
320
328
  return [];
321
329
  }
322
- })(), I = t.hydrate === !0 && e.hasChildNodes(), L = /* @__PURE__ */ _(n, {
323
- document: d.document,
330
+ })(), I = t.hydrate === !0 && e.hasChildNodes(), L = /* @__PURE__ */ x(n, {
331
+ document: f.document,
324
332
  capabilityGrants: o,
325
- runtime: E,
333
+ runtime: C,
326
334
  onDiagnostics: P,
327
335
  urlPolicy: k,
328
336
  locale: t.locale ?? "en",
@@ -336,23 +344,23 @@ function Q(e, t, n, r = {}) {
336
344
  if (!I) for (; e.firstChild;) e.removeChild(e.firstChild);
337
345
  let R = null, z = [];
338
346
  try {
339
- for (let [t, n] of u.resources.entries()) {
347
+ for (let [t, n] of d.resources.entries()) {
340
348
  let r = e.ownerDocument.createElement("style");
341
349
  r.setAttribute("data-reactive-md-resource", n.id), r.textContent = t === 0 ? `${i}\n${n.css}` : n.css, (e.ownerDocument.head ?? e.ownerDocument.documentElement).appendChild(r), z.push(r);
342
350
  }
343
- R = I ? y(e, L) : v(e), I || R.render(L);
351
+ R = I ? te(e, L) : ee(e), I || R.render(L);
344
352
  } catch (e) {
345
353
  z.forEach((e) => e.remove());
346
354
  try {
347
355
  R?.unmount();
348
356
  } catch {}
349
357
  try {
350
- E.dispose();
358
+ C.dispose();
351
359
  } catch {}
352
- throw new C("Cannot mount a Reactive MD document: React could not render the document.", w(e, "standalone.render"));
360
+ throw new T("Cannot mount a Reactive MD document: React could not render the document.", E(e, "standalone.render"));
353
361
  }
354
- Y.add(e), e.setAttribute(W, "");
355
- let B = r.onStateChange ? E.subscribe(() => {
362
+ Y.add(e), e.setAttribute(K, "");
363
+ let B = r.onStateChange ? C.subscribe(() => {
356
364
  if (N) return;
357
365
  let e;
358
366
  try {
@@ -362,14 +370,18 @@ function Q(e, t, n, r = {}) {
362
370
  }
363
371
  Z(r.onStateChange ? () => r.onStateChange(e) : void 0);
364
372
  }) : () => {};
365
- Z(r.onStateChange ? () => r.onStateChange(M) : void 0), d.diagnostics.length > 0 && P(d.diagnostics), F.length > 0 && P([...F]);
366
- let V = I ? te(e) : () => {};
373
+ Z(r.onStateChange ? () => r.onStateChange(M) : void 0), f.diagnostics.length > 0 && P(f.diagnostics), F.length > 0 && P([...F]);
374
+ let V = I ? ae(e) : () => {};
367
375
  return {
368
376
  element: e,
369
377
  getState() {
370
378
  if (N) throw Error("This Reactive MD document has been unmounted.");
371
379
  return j();
372
380
  },
381
+ getMacroState() {
382
+ if (N) throw Error("This Reactive MD document has been unmounted.");
383
+ return C.document.macroConfigKey ? h(C) : void 0;
384
+ },
373
385
  unmount: () => {
374
386
  if (!N) {
375
387
  N = !0, B(), V(), z.forEach((e) => e.remove());
@@ -377,9 +389,9 @@ function Q(e, t, n, r = {}) {
377
389
  R?.unmount();
378
390
  } catch {}
379
391
  try {
380
- E.dispose();
392
+ C.dispose();
381
393
  } catch {}
382
- Y.delete(e), e.getAttribute("data-reactive-md-mounted") === "" && e.removeAttribute(W);
394
+ Y.delete(e), e.getAttribute("data-reactive-md-mounted") === "" && e.removeAttribute(K);
383
395
  }
384
396
  }
385
397
  };
@@ -390,31 +402,31 @@ function $(e, t, n) {
390
402
  } catch {}
391
403
  let r = e.defaultView?.CustomEvent;
392
404
  if (typeof r == "function") try {
393
- t.dispatchEvent(new r(T, {
405
+ t.dispatchEvent(new r(D, {
394
406
  detail: n,
395
407
  bubbles: !0,
396
408
  composed: !0
397
409
  }));
398
410
  } catch {}
399
411
  }
400
- function ne(e, t) {
412
+ function oe(e, t) {
401
413
  let n = t.defaultView?.HTMLElement;
402
414
  return n ? e instanceof n : e.namespaceURI === "http://www.w3.org/1999/xhtml";
403
415
  }
404
- function re(e, t, n = {}) {
416
+ function se(e, t, n = {}) {
405
417
  if (typeof document > "u") return [];
406
418
  let r = t ?? document, i = r, a = i.nodeType === 9 ? r : i.ownerDocument ?? document, o = [], s;
407
419
  try {
408
- s = Array.from(r.querySelectorAll(G));
420
+ s = Array.from(r.querySelectorAll(q));
409
421
  } catch {
410
422
  return o;
411
423
  }
412
424
  for (let t of s) {
413
425
  let s;
414
426
  try {
415
- s = V(JSON.parse(t.textContent ?? ""));
427
+ s = U(JSON.parse(t.textContent ?? ""));
416
428
  } catch (e) {
417
- $(a, t, [b("standalone.payload.json", `The reactive-md payload is not valid JSON: ${S(e)}`)]);
429
+ $(a, t, [S("standalone.payload.json", `The reactive-md payload is not valid JSON: ${w(e)}`)]);
418
430
  continue;
419
431
  }
420
432
  if (!s.ok) {
@@ -422,13 +434,14 @@ function re(e, t, n = {}) {
422
434
  continue;
423
435
  }
424
436
  let c = s.payload, l = r, u = (typeof l.getElementById == "function" ? l.getElementById(c.target) : null) ?? a.getElementById(c.target);
425
- if (!u) $(a, t, [b("standalone.target.missing", `The reactive-md payload target "#${c.target}" was not found.`)]);
426
- else if (i !== a && !i.contains(u)) $(a, t, [b("standalone.target.scope", "The reactive-md payload target is outside the scanned root.")]);
427
- else if (!ne(u, a)) $(a, t, [b("standalone.target.type", "The reactive-md payload target must be an HTML element.")]);
437
+ if (!u) $(a, t, [S("standalone.target.missing", `The reactive-md payload target "#${c.target}" was not found.`)]);
438
+ else if (i !== a && !i.contains(u)) $(a, t, [S("standalone.target.scope", "The reactive-md payload target is outside the scanned root.")]);
439
+ else if (!oe(u, a)) $(a, t, [S("standalone.target.type", "The reactive-md payload target must be an HTML element.")]);
428
440
  else if (!X(u)) try {
429
441
  o.push(Q(u, {
430
442
  source: c.source,
431
443
  state: c.state,
444
+ macroState: c.macroState,
432
445
  locale: c.locale,
433
446
  colorScheme: c.colorScheme,
434
447
  hydrate: c.hydrate,
@@ -446,9 +459,9 @@ function re(e, t, n = {}) {
446
459
  onDiagnostics: (e) => $(a, u, e)
447
460
  }));
448
461
  } catch (e) {
449
- $(a, u, w(e));
462
+ $(a, u, E(e));
450
463
  }
451
464
  }
452
465
  return o;
453
466
  }
454
- export { V as a, C as c, re as i, Q as n, T as o, X as r, E as s, W as t };
467
+ export { U as a, T as c, se as i, Q as n, D as o, X as r, O as s, K as t };