reactive-md 0.9.0 → 0.9.2

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 (338) hide show
  1. package/CHANGELOG-ch.md +333 -306
  2. package/CHANGELOG.md +334 -307
  3. package/CONTRIBUTING-ch.md +22 -22
  4. package/CONTRIBUTING.md +22 -22
  5. package/README-ch.md +431 -431
  6. package/README-en.md +431 -431
  7. package/README.md +429 -429
  8. package/SECURITY-ch.md +83 -83
  9. package/SECURITY.md +83 -83
  10. package/THIRD_PARTY_NOTICES.md +111 -1
  11. package/bin/reactive-md.mjs +39 -39
  12. package/cli/args.mjs +263 -263
  13. package/cli/assets.mjs +395 -395
  14. package/cli/build.mjs +445 -444
  15. package/cli/check.mjs +444 -444
  16. package/cli/document.mjs +130 -130
  17. package/cli/errors.mjs +61 -61
  18. package/cli/fs-utils.mjs +133 -133
  19. package/cli/glob.mjs +203 -203
  20. package/cli/help.mjs +323 -323
  21. package/cli/init.mjs +1577 -1577
  22. package/cli/lint.mjs +177 -177
  23. package/cli/main.mjs +65 -65
  24. package/cli/migrate.mjs +368 -368
  25. package/cli/package-loader.mjs +41 -41
  26. package/cli/package.mjs +211 -211
  27. package/dist-library/{LocalDocumentView-K7Y-2bRJ.js → LocalDocumentView-BuqgJZEY.js} +11 -11
  28. package/dist-library/LocalDocumentViewCore-DXE0I0Qc.js +9830 -0
  29. package/dist-library/LocalReactiveDocumentCore-CWBe4Mm5.js +275 -0
  30. package/dist-library/{authoring-Co_TiE-P.js → authoring-Ci_KzJ0q.js} +87 -67
  31. package/dist-library/{compile-LhpTKqCR.js → compile-Dx6Uw3D9.js} +11 -11
  32. package/dist-library/{compiler-core-DTxY-qYz.js → compiler-core-DDDdvuLy.js} +2618 -1846
  33. package/dist-library/compiler-dxLPB9Ym.js +86 -0
  34. package/dist-library/{component-state-BBJ08vML.js → component-state-BRwvTV0d.js} +15 -14
  35. package/dist-library/component-state-CwKX_SN5.js +763 -0
  36. package/dist-library/{config-BUo-8O5C.js → config-DXLvctiZ.js} +68 -66
  37. package/dist-library/config-validation-D3D7Dy2J.js +586 -0
  38. package/dist-library/{controls-BWiLLtBO.js → controls-DoZyLCrV.js} +2434 -2410
  39. package/dist-library/{coordinate-BSl6enWV.js → coordinate-B1VFK9fd.js} +108 -107
  40. package/dist-library/{data-table-DfvytZKQ.js → data-table-8-3F15Jf.js} +69 -66
  41. package/dist-library/{default-components-BwQf0oP-.js → default-components-s21NevON.js} +29 -28
  42. package/dist-library/{display-lw3BT1TA.js → display-B_uutKkN.js} +1 -1
  43. package/dist-library/{config-validation-C5kJYk-J.js → document-theme-C8J6UyNO.js} +241 -731
  44. package/dist-library/export-CIAIPBov.js +370 -0
  45. package/dist-library/{gallery-B8kSt1oI.js → gallery-Dv1rOvL0.js} +151 -147
  46. package/dist-library/html-Cr4CBwAH.js +758 -0
  47. package/dist-library/identity-BUx0Q_-d.js +40 -0
  48. package/dist-library/{incremental-D_6vwAAE.js → incremental-9nx92u9c.js} +407 -143
  49. package/dist-library/layout-BBB2VF0S.js +562 -0
  50. package/dist-library/{mount-preset-C5s9ebEH.js → mount-preset-DMZ5wd3t.js} +3 -3
  51. package/dist-library/observability-4KqXhIEU.js +421 -0
  52. package/dist-library/observability-core-Bcu7vpnl.js +24 -0
  53. package/dist-library/options-BBp9IcHm.js +121 -0
  54. package/dist-library/{package-core-D0POW4Gd.js → package-core-K5xesGqy.js} +30 -29
  55. package/dist-library/{parser-standard-OToYcOBL.js → parser-standard-CBA1-hdG.js} +3332 -3840
  56. package/dist-library/{plugin-packs-B1XPWcFs.js → plugin-packs-Bh1HhLym.js} +3 -2
  57. package/dist-library/preset-core-DeZPA8IE.js +1298 -0
  58. package/dist-library/react-0DCh-Mar.js +7 -0
  59. package/dist-library/reactive-md-authoring.js +28 -30
  60. package/dist-library/reactive-md-build.js +99 -61
  61. package/dist-library/reactive-md-compiler-standard.js +10 -9
  62. package/dist-library/reactive-md-compiler.js +3 -3
  63. package/dist-library/reactive-md-default-packs.js +3 -2
  64. package/dist-library/reactive-md-default-preset.js +3 -2
  65. package/dist-library/reactive-md-export.js +4 -4
  66. package/dist-library/reactive-md-minimal-preset.js +2 -2
  67. package/dist-library/reactive-md-minimal-react-preset.js +3 -3
  68. package/dist-library/reactive-md-observability.js +4 -0
  69. package/dist-library/reactive-md-pdf.js +127 -3
  70. package/dist-library/reactive-md-plugin-chart.js +3 -3
  71. package/dist-library/reactive-md-plugin-data.js +5 -5
  72. package/dist-library/reactive-md-plugin-diagram.js +4 -4
  73. package/dist-library/reactive-md-plugin-forms.js +4 -4
  74. package/dist-library/reactive-md-plugin-gallery.js +3 -3
  75. package/dist-library/reactive-md-plugin-navigation.js +3 -3
  76. package/dist-library/reactive-md-plugin-network.js +119 -116
  77. package/dist-library/reactive-md-plugin-plot.js +4 -4
  78. package/dist-library/reactive-md-print.css +304 -304
  79. package/dist-library/reactive-md-react-minimal.js +4 -4
  80. package/dist-library/reactive-md-react-server.js +6 -6
  81. package/dist-library/reactive-md-react-unstyled.js +11 -12
  82. package/dist-library/reactive-md-react.js +11 -12
  83. package/dist-library/reactive-md-runtime-browser.js +2 -1
  84. package/dist-library/reactive-md-runtime.js +4 -3
  85. package/dist-library/reactive-md-sdk.js +8 -7
  86. package/dist-library/reactive-md-standalone-configured.js +2 -2
  87. package/dist-library/reactive-md-standalone-host.js +2 -2
  88. package/dist-library/reactive-md-testing-browser.js +2 -2
  89. package/dist-library/reactive-md-testing-react.js +6 -6
  90. package/dist-library/reactive-md-testing.js +5 -5
  91. package/dist-library/reactive-md.js +649 -373
  92. package/dist-library/{registry-05JiqmEp.js → registry-D6OGkOcX.js} +3 -3
  93. package/dist-library/{registry-core-Bbad9Bm2.js → registry-core-C9xOunaw.js} +1 -1
  94. package/dist-library/{resources-IeJomeUT.js → resources-B0x_w3s9.js} +71 -46
  95. package/dist-library/{runtime-B2fxeveq.js → runtime-BDnnimPA.js} +17 -16
  96. package/dist-library/{runtime-CuOyRe9f.js → runtime-BpQdZmFI.js} +269 -263
  97. package/dist-library/{schema-C-AeByPp.js → schema-BryM_VRW.js} +14 -14
  98. package/dist-library/{sdk-core-BJLJaVR5.js → sdk-core-ChslheKs.js} +499 -158
  99. package/dist-library/{session-core-BGka5D1J.js → session-core-dxQCJBNa.js} +171 -156
  100. package/dist-library/{shareable-jkGi2g6y.js → shareable-B8xMoGEa.js} +265 -297
  101. package/dist-library/types/authoring/catalog.d.ts +1 -2
  102. package/dist-library/types/build/diagnostics.d.ts +1 -1
  103. package/dist-library/types/components/shared/visual-frame.d.ts +6 -2
  104. package/dist-library/types/local/compilation/compiler-capabilities.d.ts +3 -0
  105. package/dist-library/types/local/compilation/compiler-core.d.ts +11 -3
  106. package/dist-library/types/local/compilation/compiler-services.d.ts +8 -4
  107. package/dist-library/types/local/compilation/compiler.d.ts +3 -3
  108. package/dist-library/types/local/compilation/session/incremental.d.ts +20 -5
  109. package/dist-library/types/local/compilation/streaming.d.ts +27 -0
  110. package/dist-library/types/local/configuration/capability-policy.d.ts +3 -0
  111. package/dist-library/types/local/configuration/diagnostic-messages.d.ts +48 -0
  112. package/dist-library/types/local/configuration/options-core.d.ts +1 -2
  113. package/dist-library/types/local/configuration/options.d.ts +1 -0
  114. package/dist-library/types/local/css/author-css.d.ts +66 -0
  115. package/dist-library/types/local/html/extended-fragment.d.ts +41 -0
  116. package/dist-library/types/local/html/html.d.ts +39 -3
  117. package/dist-library/types/local/index.d.ts +7 -1
  118. package/dist-library/types/local/observability-codes.d.ts +2 -0
  119. package/dist-library/types/local/observability-core.d.ts +25 -0
  120. package/dist-library/types/local/observability-messages.d.ts +6 -0
  121. package/dist-library/types/local/observability.d.ts +43 -0
  122. package/dist-library/types/local/parsing/author-markdown.d.ts +11 -0
  123. package/dist-library/types/local/parsing/parse-session.d.ts +2 -2
  124. package/dist-library/types/local/parsing/parser-convert.d.ts +2 -1
  125. package/dist-library/types/local/parsing/parser-core.d.ts +8 -1
  126. package/dist-library/types/local/parsing/parser-internals.d.ts +2 -1
  127. package/dist-library/types/local/parsing/parser.d.ts +2 -2
  128. package/dist-library/types/local/rendering/document/ExtendedHtmlFragment.d.ts +14 -0
  129. package/dist-library/types/local/rendering/document/LocalDocumentViewCore.d.ts +25 -1
  130. package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +1 -1
  131. package/dist-library/types/local/rendering/document/use-author-script.d.ts +3 -0
  132. package/dist-library/types/local/rendering/document/view-render-context.d.ts +11 -1
  133. package/dist-library/types/local/runtime/author-script-protocol.d.ts +59 -0
  134. package/dist-library/types/local/transport/worker.d.ts +79 -5
  135. package/dist-library/types/local/types.d.ts +60 -16
  136. package/dist-library/types/observability.d.ts +7 -0
  137. package/dist-library/types/react/component-api.d.ts +10 -1
  138. package/dist-library/types/react/component-utils.d.ts +9 -1
  139. package/dist-library/types/react/sdk-core.d.ts +4 -1
  140. package/dist-library/types/shareable.d.ts +5 -4
  141. package/dist-library/types/standalone/prepare.d.ts +1 -1
  142. package/dist-library/types/standalone/session-core.d.ts +3 -2
  143. package/dist-library/{types-BFC5rzC4.js → types-Ib5kSScP.js} +1 -1
  144. package/dist-library/types-daDo2c_w.js +3 -0
  145. package/dist-library/{validation-BlDL2uD9.js → validation-B3RI0xOk.js} +218 -200
  146. package/dist-library/version-DAxuGOG2.js +147 -0
  147. package/dist-library/{visual-frame-G8PHoj1e.js → visual-frame-_rcd5HUv.js} +6 -5
  148. package/dist-library/{visuals-BkYRmYGO.js → visuals-DkDhNdEZ.js} +24191 -24190
  149. package/dist-standalone/reactive-md-standalone.js +124 -117
  150. package/docs/README-ch.md +101 -94
  151. package/docs/README.md +101 -94
  152. package/docs/compatibility/api-stability-ch.md +25 -0
  153. package/docs/compatibility/api-stability-en.md +25 -0
  154. package/docs/compatibility/compatibility-ch.md +146 -129
  155. package/docs/compatibility/compatibility-en.md +146 -129
  156. package/docs/compatibility/compatibility-manifest.schema.json +161 -0
  157. package/docs/compatibility/deprecation-ch.md +21 -0
  158. package/docs/compatibility/deprecation-en.md +21 -0
  159. package/docs/compatibility/source-versioning-ch.md +162 -162
  160. package/docs/compatibility/source-versioning-en.md +162 -162
  161. package/docs/compatibility/support-matrix-ch.md +108 -0
  162. package/docs/compatibility/support-matrix-en.md +108 -0
  163. package/docs/development/component-development-ch.md +66 -66
  164. package/docs/development/component-development-en.md +66 -66
  165. package/docs/development/component-development-reference-ch.md +253 -253
  166. package/docs/development/component-development-reference-en.md +238 -238
  167. package/docs/development/component-protocol-ch.md +748 -748
  168. package/docs/development/component-protocol-en.md +750 -750
  169. package/docs/development/extension-tutorial-ch.md +308 -308
  170. package/docs/development/extension-tutorial-en.md +308 -308
  171. package/docs/development/performance-overview-ch.md +422 -422
  172. package/docs/development/performance-overview-en.md +422 -422
  173. package/docs/guides/local-guide-ch.md +532 -532
  174. package/docs/guides/local-guide-en.md +532 -532
  175. package/docs/integration/author-tools-ch.md +64 -64
  176. package/docs/integration/author-tools-en.md +64 -64
  177. package/docs/integration/compiler-ch.md +49 -47
  178. package/docs/integration/compiler-en.md +36 -34
  179. package/docs/integration/directory-discovery-en.md +1 -1
  180. package/docs/integration/editor-ch.md +295 -295
  181. package/docs/integration/editor-en.md +303 -303
  182. package/docs/integration/extension-sdk-ch.md +394 -394
  183. package/docs/integration/extension-sdk-en.md +379 -379
  184. package/docs/integration/local-integration-ch.md +646 -524
  185. package/docs/integration/local-integration-en.md +662 -540
  186. package/docs/integration/shareable-export-ch.md +307 -305
  187. package/docs/integration/shareable-export-en.md +309 -307
  188. package/docs/reference/diagnostics-counting-ch.md +104 -104
  189. package/docs/reference/diagnostics-counting-en.md +104 -104
  190. package/docs/reference/html-compatibility-ch.md +93 -140
  191. package/docs/reference/html-compatibility-en.md +95 -140
  192. package/docs/reference/local-interaction-syntax-ch.md +724 -724
  193. package/docs/reference/local-interaction-syntax-en.md +722 -722
  194. package/docs/reference/public-api-ch.md +39 -7
  195. package/docs/reference/public-api-en.md +39 -7
  196. package/docs/reference/theme-protocol-ch.md +198 -198
  197. package/docs/reference/theme-protocol-en.md +217 -217
  198. package/docs/releases/release-0.4.0-ch.md +91 -91
  199. package/docs/releases/release-0.4.0-en.md +91 -91
  200. package/docs/releases/release-0.4.1-ch.md +25 -25
  201. package/docs/releases/release-0.4.1-en.md +25 -25
  202. package/docs/releases/release-0.5.0-ch.md +43 -43
  203. package/docs/releases/release-0.5.0-en.md +43 -43
  204. package/docs/releases/release-0.5.1-ch.md +41 -41
  205. package/docs/releases/release-0.5.1-en.md +41 -41
  206. package/docs/releases/release-0.5.2-ch.md +37 -37
  207. package/docs/releases/release-0.5.2-en.md +37 -37
  208. package/docs/releases/release-0.5.3-ch.md +26 -26
  209. package/docs/releases/release-0.5.3-en.md +26 -26
  210. package/docs/releases/release-0.6.0-ch.md +59 -59
  211. package/docs/releases/release-0.6.0-en.md +59 -59
  212. package/docs/releases/release-0.6.1-ch.md +29 -29
  213. package/docs/releases/release-0.6.1-en.md +29 -29
  214. package/docs/releases/release-0.7.0-ch.md +86 -86
  215. package/docs/releases/release-0.7.0-en.md +86 -86
  216. package/docs/releases/release-0.9.1-ch.md +29 -0
  217. package/docs/releases/release-0.9.1-en.md +29 -0
  218. package/docs/releases/release-0.9.2-ch.md +33 -0
  219. package/docs/releases/release-0.9.2-en.md +33 -0
  220. package/examples/component-package/README-ch.md +101 -101
  221. package/examples/component-package/README.md +133 -133
  222. package/examples/conformance/README-ch.md +55 -55
  223. package/examples/conformance/README.md +55 -55
  224. package/examples/conformance/component-protocol-1.json +482 -482
  225. package/examples/conformance/component-protocol-1.schema.json +76 -76
  226. package/examples/conformance/local-draft-1.json +50 -50
  227. package/examples/conformance/local-draft-2.json +212 -212
  228. package/examples/game-2048-package/LICENSE +21 -21
  229. package/examples/game-2048-package/NOTICES.md +11 -11
  230. package/examples/game-2048-package/README-ch.md +91 -91
  231. package/examples/game-2048-package/README.md +98 -98
  232. package/examples/game-2048-package/package.json +35 -35
  233. package/examples/game-2048-package/sample/document.reactive.md +17 -17
  234. package/examples/game-2048-package/scripts/build-export.mjs +44 -44
  235. package/examples/game-2048-package/scripts/build.mjs +130 -130
  236. package/examples/game-2048-package/scripts/verify.mjs +180 -180
  237. package/examples/game-2048-package/src/component.css +161 -161
  238. package/examples/game-2048-package/src/components.tsx +326 -326
  239. package/examples/game-2048-package/src/game-engine.ts +228 -228
  240. package/examples/game-2048-package/src/harness.tsx +34 -34
  241. package/examples/game-2048-package/src/manifest.ts +85 -85
  242. package/examples/game-2048-package/src/node-entry.ts +30 -30
  243. package/examples/game-2048-package/src/sample.ts +4 -4
  244. package/examples/game-2048-package/tsconfig.json +15 -15
  245. package/examples/integration/README-ch.md +82 -63
  246. package/examples/integration/README.md +82 -63
  247. package/examples/integration/core/index.mjs +32 -32
  248. package/examples/integration/extension-sdk/README-ch.md +24 -24
  249. package/examples/integration/extension-sdk/README.md +24 -24
  250. package/examples/integration/streaming/index.html +48 -0
  251. package/examples/integration/streaming/main.js +175 -0
  252. package/examples/integration/streaming/package.json +13 -0
  253. package/examples/integration/streaming/worker.js +3 -0
  254. package/examples/integration/worker/index.html +19 -19
  255. package/examples/integration/worker/main.js +61 -61
  256. package/examples/integration/worker/package.json +13 -13
  257. package/examples/integration/worker/worker.js +3 -3
  258. package/examples/local/README-ch.md +76 -76
  259. package/examples/local/README.md +76 -76
  260. package/examples/local/charts.reactive.md +73 -73
  261. package/examples/local/recipes/invoice-zh.reactive.md +36 -36
  262. package/examples/local/recipes/invoice.reactive.md +36 -36
  263. package/examples/local/recipes/workshop-zh.reactive.md +33 -33
  264. package/examples/local/recipes/workshop.reactive.md +33 -33
  265. package/examples/local/showcase/README-ch.md +22 -22
  266. package/examples/local/showcase/README.md +31 -31
  267. package/examples/local/showcase/explore.reactive.md +102 -102
  268. package/examples/local/showcase/flow.reactive.md +86 -86
  269. package/examples/local/showcase/forms.reactive.md +126 -126
  270. package/examples/local/showcase/functions.reactive.md +119 -119
  271. package/examples/local/showcase/layout.reactive.md +100 -100
  272. package/examples/local/showcase/statistics.reactive.md +108 -108
  273. package/examples/local/showcase/tasks.reactive.md +89 -89
  274. package/examples/local/showcase/zh/explore.reactive.md +102 -102
  275. package/examples/local/showcase/zh/flow.reactive.md +86 -86
  276. package/examples/local/showcase/zh/forms.reactive.md +126 -126
  277. package/examples/local/showcase/zh/functions.reactive.md +119 -119
  278. package/examples/local/showcase/zh/layout.reactive.md +100 -100
  279. package/examples/local/showcase/zh/statistics.reactive.md +108 -108
  280. package/examples/local/showcase/zh/tasks.reactive.md +89 -89
  281. package/examples/minimal-extension/README-ch.md +78 -78
  282. package/examples/minimal-extension/README.md +78 -78
  283. package/examples/minimal-extension/index.html +15 -15
  284. package/examples/minimal-extension/package.json +26 -26
  285. package/examples/minimal-extension/sample/document.reactive.md +10 -10
  286. package/examples/minimal-extension/scripts/build.mjs +32 -32
  287. package/examples/minimal-extension/scripts/export.mjs +72 -72
  288. package/examples/minimal-extension/scripts/test-node.mjs +75 -75
  289. package/examples/minimal-extension/src/extension.tsx +90 -90
  290. package/examples/minimal-extension/src/preview.tsx +12 -12
  291. package/examples/minimal-extension/src/source.ts +4 -4
  292. package/examples/minimal-extension/tsconfig.json +14 -14
  293. package/examples/sci-fi-theme/README-ch.md +133 -133
  294. package/examples/sci-fi-theme/README.md +148 -148
  295. package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -454
  296. package/examples/sci-fi-theme/demo/demo.css +638 -638
  297. package/examples/sci-fi-theme/demo/document.reactive.md +206 -206
  298. package/examples/sci-fi-theme/demo/index.html +13 -13
  299. package/examples/sci-fi-theme/demo/main.tsx +215 -215
  300. package/examples/sci-fi-theme/docs/design-system-ch.md +245 -245
  301. package/examples/sci-fi-theme/docs/design-system.md +474 -474
  302. package/examples/sci-fi-theme/package.json +28 -28
  303. package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -98
  304. package/examples/sci-fi-theme/src/components.css +2370 -2370
  305. package/examples/sci-fi-theme/src/index.ts +6 -6
  306. package/examples/sci-fi-theme/src/notch.css +142 -142
  307. package/examples/sci-fi-theme/src/sci-fi.css +7 -7
  308. package/examples/sci-fi-theme/src/theme.ts +39 -39
  309. package/examples/sci-fi-theme/tsconfig.json +20 -20
  310. package/examples/sci-fi-theme/vite.config.ts +24 -24
  311. package/examples/tetris-package/LICENSE +21 -21
  312. package/examples/tetris-package/NOTICES.md +11 -11
  313. package/examples/tetris-package/README-ch.md +91 -91
  314. package/examples/tetris-package/README.md +95 -95
  315. package/examples/tetris-package/package.json +35 -35
  316. package/examples/tetris-package/sample/document.reactive.md +16 -16
  317. package/examples/tetris-package/scripts/build-export.mjs +44 -44
  318. package/examples/tetris-package/scripts/build.mjs +130 -130
  319. package/examples/tetris-package/scripts/verify.mjs +173 -173
  320. package/examples/tetris-package/src/component.css +145 -145
  321. package/examples/tetris-package/src/components.tsx +334 -334
  322. package/examples/tetris-package/src/harness.tsx +34 -34
  323. package/examples/tetris-package/src/manifests.ts +93 -93
  324. package/examples/tetris-package/src/node-entry.ts +16 -16
  325. package/examples/tetris-package/src/sample.ts +4 -4
  326. package/examples/tetris-package/src/tetris-engine.ts +325 -325
  327. package/examples/tetris-package/tsconfig.json +15 -15
  328. package/package.json +12 -1
  329. package/dist-library/LocalDocumentViewCore-BLG4hMuO.js +0 -9535
  330. package/dist-library/LocalReactiveDocumentCore-DVQ6WA9G.js +0 -259
  331. package/dist-library/compiler-DfGbQhyD.js +0 -62
  332. package/dist-library/component-state-BoLCGee4.js +0 -801
  333. package/dist-library/component-utils-BvHL8VGt.js +0 -298
  334. package/dist-library/export-C7IDW9ul.js +0 -311
  335. package/dist-library/layout-C22VjZh0.js +0 -542
  336. package/dist-library/options-CdSKOi7p.js +0 -116
  337. package/dist-library/preset-core-CKc5YXSM.js +0 -1443
  338. package/dist-library/react-LY5qsVeP.js +0 -7
@@ -1,11 +1,13 @@
1
- import { dt as e } from "./preset-core-CKc5YXSM.js";
2
- import { B as t, H as n, P as r, j as i } from "./config-validation-C5kJYk-J.js";
3
- import { a, c as o, r as s, s as c, t as l } from "./compile-LhpTKqCR.js";
4
- import { a as u, b as d, c as f, h as p, i as m, l as h, n as g, o as _, p as v, r as ee, t as y, u as b, x } from "./validation-BlDL2uD9.js";
5
- import { i as S } from "./registry-core-Bbad9Bm2.js";
6
- import { t as C } from "./registry-05JiqmEp.js";
7
- import { A as te, C as ne, b as w } from "./component-state-BoLCGee4.js";
8
- import { n as T } from "./runtime-B2fxeveq.js";
1
+ import { j as e } from "./version-DAxuGOG2.js";
2
+ import { _ as t, l as n, o as r, y as i } from "./document-theme-C8J6UyNO.js";
3
+ import { a, c as o, r as s, s as c, t as l } from "./compile-Dx6Uw3D9.js";
4
+ import { a as u, c as d, h as f, i as p, l as ee, n as m, o as h, p as g, r as _, t as v, u as y } from "./validation-B3RI0xOk.js";
5
+ import { n as b, t as x } from "./types-daDo2c_w.js";
6
+ import { i as S } from "./registry-core-C9xOunaw.js";
7
+ import { t as C } from "./registry-D6OGkOcX.js";
8
+ import { x as te } from "./component-state-CwKX_SN5.js";
9
+ import { i as ne, t as w } from "./identity-BUx0Q_-d.js";
10
+ import { n as T } from "./runtime-BDnnimPA.js";
9
11
  // src/local/runtime/runtime-values.ts
10
12
  function E(e, t) {
11
13
  return e.attrs?.[t];
@@ -27,7 +29,7 @@ function k(e) {
27
29
  function A(e, t) {
28
30
  return {
29
31
  ok: !1,
30
- detail: r(e, t)
32
+ detail: n(e, t)
31
33
  };
32
34
  }
33
35
  function j(e, t) {
@@ -65,17 +67,17 @@ function F(e) {
65
67
  if (!e.name) return I;
66
68
  let t = P.get(e.name);
67
69
  if (t !== void 0) return t ?? I;
68
- let n = C(e.name), r = n ? p(n) : I;
70
+ let n = C(e.name), r = n ? f(n) : I;
69
71
  return P.set(e.name, n ? r : null), r;
70
72
  }
71
73
  var I = Object.freeze([]);
72
- function L(e, t, n, r, a, s = !1) {
74
+ function L(e, t, n, i, a, s = !1) {
73
75
  switch (e.type) {
74
76
  case "number": {
75
77
  if (typeof n != "number" || !Number.isFinite(n)) return A("local.runtime.value.finite-number", { name: e.name });
76
- let i = e.step ?? 1, a = e.min ?? 0;
77
- for (let i of t) {
78
- let t = r(i, "min");
78
+ let r = e.step ?? 1, a = e.min ?? 0;
79
+ for (let r of t) {
80
+ let t = i(r, "min");
79
81
  if (t.present && !t.ok) return A("local.runtime.value.constraint", {
80
82
  name: e.name,
81
83
  attribute: "min"
@@ -90,7 +92,7 @@ function L(e, t, n, r, a, s = !1) {
90
92
  min: t.value
91
93
  });
92
94
  }
93
- let o = r(i, "max");
95
+ let o = i(r, "max");
94
96
  if (o.present && !o.ok) return A("local.runtime.value.constraint", {
95
97
  name: e.name,
96
98
  attribute: "max"
@@ -113,9 +115,9 @@ function L(e, t, n, r, a, s = !1) {
113
115
  }) : e.max !== void 0 && n > e.max ? A("local.runtime.value.max", {
114
116
  name: e.name,
115
117
  max: e.max
116
- }) : i > 0 && !B(n, a, i) ? A("local.runtime.value.step", {
118
+ }) : r > 0 && !V(n, a, r) ? A("local.runtime.value.step", {
117
119
  name: e.name,
118
- step: i,
120
+ step: r,
119
121
  base: a
120
122
  }) : {
121
123
  ok: !0,
@@ -131,19 +133,19 @@ function L(e, t, n, r, a, s = !1) {
131
133
  let c = o(n);
132
134
  if (c) return A("local.runtime.value.budget", {
133
135
  name: e.name,
134
- detail: i(c),
136
+ detail: r(c),
135
137
  detailKey: c.key,
136
138
  ...c.params
137
139
  });
138
- for (let i of t) {
139
- let t = a?.get(i.id) ?? (s ? F(i) : I);
140
+ for (let r of t) {
141
+ let t = a?.get(r.id) ?? (s ? F(r) : I);
140
142
  if (!t.length) continue;
141
143
  let o = {};
142
144
  for (let n of t) {
143
145
  if (n.kind === "date") {
144
146
  for (let t of ["min", "max"]) {
145
147
  if (n[t] === void 0) continue;
146
- let a = r(i, t);
148
+ let a = i(r, t);
147
149
  if (a.present) {
148
150
  if (!a.ok || typeof a.value != "string" || !S(a.value)) return A("local.runtime.value.constraint-date", {
149
151
  name: e.name,
@@ -152,11 +154,11 @@ function L(e, t, n, r, a, s = !1) {
152
154
  o[t] = a.value;
153
155
  }
154
156
  }
155
- let t = o.min ?? j(i, n.min), a = o.max ?? j(i, n.max);
157
+ let t = o.min ?? j(r, n.min), a = o.max ?? j(r, n.max);
156
158
  if (t && a && S(t) && S(a) && t > a) return A("local.runtime.value.constraint-range", { name: e.name });
157
159
  }
158
160
  if ((n.kind === "date" || n.kind === "required" ? n.required : void 0) !== void 0) {
159
- let t = r(i, "required");
161
+ let t = i(r, "required");
160
162
  if (t.present) {
161
163
  if (!t.ok || typeof t.value != "boolean") return A("local.runtime.value.constraint", {
162
164
  name: e.name,
@@ -166,7 +168,7 @@ function L(e, t, n, r, a, s = !1) {
166
168
  }
167
169
  }
168
170
  }
169
- let c = N(i, n, t, o);
171
+ let c = N(r, n, t, o);
170
172
  if (!c.ok) return c;
171
173
  }
172
174
  return e.options?.length && !e.options.includes(n) ? A("local.runtime.value.option", {
@@ -182,7 +184,7 @@ function L(e, t, n, r, a, s = !1) {
182
184
  let t = o(n);
183
185
  if (t) return A("local.runtime.value.budget", {
184
186
  name: e.name,
185
- detail: i(t),
187
+ detail: r(t),
186
188
  detailKey: t.key,
187
189
  ...t.params
188
190
  });
@@ -194,12 +196,12 @@ function L(e, t, n, r, a, s = !1) {
194
196
  ok: !0,
195
197
  value: n.slice()
196
198
  };
197
- let r = /* @__PURE__ */ new Set();
199
+ let i = /* @__PURE__ */ new Set();
198
200
  for (let t of n) {
199
201
  if (e.options && !e.options.includes(t)) return A("local.runtime.value.checklist-option", { value: t });
200
- r.add(t);
202
+ i.add(t);
201
203
  }
202
- let a = e.options ? e.options.filter((e) => r.has(e)) : [...r];
204
+ let a = e.options ? e.options.filter((e) => i.has(e)) : [...i];
203
205
  return e.maxItems !== void 0 && a.length > e.maxItems ? A("local.runtime.value.max-items", {
204
206
  name: e.name,
205
207
  max: e.maxItems
@@ -213,7 +215,7 @@ function L(e, t, n, r, a, s = !1) {
213
215
  let t = o(n);
214
216
  if (t) return A("local.runtime.value.budget", {
215
217
  name: e.name,
216
- detail: i(t),
218
+ detail: r(t),
217
219
  detailKey: t.key,
218
220
  ...t.params
219
221
  });
@@ -233,10 +235,10 @@ function L(e, t, n, r, a, s = !1) {
233
235
  }
234
236
  return A("local.runtime.value.unsupported-type", { name: e.name });
235
237
  }
236
- function re(e) {
238
+ function R(e) {
237
239
  return e instanceof a ? e : new a("expression-eval", e instanceof Error ? e.message : String(e), 0);
238
240
  }
239
- function ie(e, t) {
241
+ function re(e, t) {
240
242
  switch (e) {
241
243
  case "string": {
242
244
  if (typeof t != "string") return {
@@ -328,19 +330,19 @@ function ie(e, t) {
328
330
  };
329
331
  }
330
332
  }
331
- var R = 1e-9;
332
- function z(e) {
333
+ var z = 1e-9;
334
+ function B(e) {
333
335
  return Array.isArray(e) ? e.slice() : e;
334
336
  }
335
- function B(e, t, n) {
337
+ function V(e, t, n) {
336
338
  let r = (e - t) / n;
337
- return Math.abs(r - Math.round(r)) <= R * Math.max(1, Math.abs(r));
339
+ return Math.abs(r - Math.round(r)) <= z * Math.max(1, Math.abs(r));
338
340
  }
339
- function V(e, t, n, r) {
341
+ function H(e, t, n, i) {
340
342
  let a = Math.max(0, Math.min(e.source.length, t.range.start)), o = e.source.slice(0, a).split("\n");
341
343
  return {
342
344
  code: n,
343
- message: i(r),
345
+ message: r(i),
344
346
  severity: "error",
345
347
  range: {
346
348
  start: a,
@@ -348,11 +350,13 @@ function V(e, t, n, r) {
348
350
  },
349
351
  line: o.length,
350
352
  column: (o.at(-1) ?? "").length + 1,
351
- messageKey: r.key,
352
- ...r.params ? { params: r.params } : {}
353
+ messageKey: i.key,
354
+ phase: "runtime",
355
+ recoverable: !0,
356
+ ...i.params ? { params: i.params } : {}
353
357
  };
354
358
  }
355
- function H(e, t, n) {
359
+ function U(e, t, n) {
356
360
  return {
357
361
  code: e,
358
362
  message: t,
@@ -363,6 +367,8 @@ function H(e, t, n) {
363
367
  },
364
368
  line: 1,
365
369
  column: 1,
370
+ phase: "runtime",
371
+ recoverable: !0,
366
372
  ...n ? {
367
373
  messageKey: n.key,
368
374
  ...n.params ? { params: n.params } : {}
@@ -370,7 +376,7 @@ function H(e, t, n) {
370
376
  };
371
377
  }
372
378
  // src/local/runtime/runtime-document.ts
373
- function U(e, t) {
379
+ function W(e, t) {
374
380
  let n = e.document.bindings[t];
375
381
  if (!n) return;
376
382
  let { nodeIds: r, owner: i, ...a } = n, o = (e.controls.get(t) ?? []).map((t) => {
@@ -391,7 +397,7 @@ function U(e, t) {
391
397
  controls: o
392
398
  });
393
399
  }
394
- function ae(e, t) {
400
+ function ie(e, t) {
395
401
  let n = t.get(e);
396
402
  if (n) return {
397
403
  expression: n,
@@ -410,59 +416,59 @@ function ae(e, t) {
410
416
  } catch (e) {
411
417
  return {
412
418
  expression: null,
413
- error: re(e)
419
+ error: R(e)
414
420
  };
415
421
  }
416
422
  }
417
- function oe(e, t) {
418
- let r = /* @__PURE__ */ new Map();
419
- for (let t of n(e.nodes)) r.set(t.id, t);
423
+ function ae(e, t) {
424
+ let n = /* @__PURE__ */ new Map();
425
+ for (let t of i(e.nodes)) n.set(t.id, t);
420
426
  let s = {}, l = /* @__PURE__ */ new Map();
421
- for (let [t, n] of Object.entries(e.bindings)) {
422
- let e = o(n.initial);
423
- if (e) throw new a("expression-budget", `Parameter "${t}": ${i(e)}`, 0);
424
- s[t] = z(n.initial);
427
+ for (let [t, i] of Object.entries(e.bindings)) {
428
+ let e = o(i.initial);
429
+ if (e) throw new a("expression-budget", `Parameter "${t}": ${r(e)}`, 0);
430
+ s[t] = B(i.initial);
425
431
  let c = [];
426
- for (let e of n.nodeIds) {
427
- let t = r.get(e);
432
+ for (let e of i.nodeIds) {
433
+ let t = n.get(e);
428
434
  t && c.push(t);
429
435
  }
430
436
  l.set(t, c);
431
437
  }
432
438
  let d = /* @__PURE__ */ new Map();
433
439
  for (let [t, n] of Object.entries(e.bindingSlots ?? {})) d.set(t, { ...n });
434
- let f = v(e), p = new Map(Object.entries(f?.valueRules ?? {})), m = f === void 0, h = /* @__PURE__ */ new Map();
440
+ let f = g(e), p = new Map(Object.entries(f?.valueRules ?? {})), ee = f === void 0, m = /* @__PURE__ */ new Map();
435
441
  if (f) for (let e of f.slotRelations) {
436
442
  let t = d.get(e.nodeId), n = t?.[e.lower], r = t?.[e.upper];
437
443
  if (!n || !r) continue;
438
- let i = h.get(e.nodeId) ?? [];
444
+ let i = m.get(e.nodeId) ?? [];
439
445
  i.push({
440
446
  lower: n,
441
447
  upper: r
442
- }), h.set(e.nodeId, i);
448
+ }), m.set(e.nodeId, i);
443
449
  }
444
- else for (let [e, t] of d) t.start && t.end && h.set(e, [{
450
+ else for (let [e, t] of d) t.start && t.end && m.set(e, [{
445
451
  lower: t.start,
446
452
  upper: t.end
447
453
  }]);
448
- let g = /* @__PURE__ */ new Map();
454
+ let _ = /* @__PURE__ */ new Map();
449
455
  for (let [t, n] of Object.entries(e.bindings)) for (let e of n.nodeIds) {
450
456
  if (d.has(e)) continue;
451
- let n = g.get(e);
452
- (n === void 0 || n.startsWith("@") && !t.startsWith("@")) && g.set(e, t);
457
+ let n = _.get(e);
458
+ (n === void 0 || n.startsWith("@") && !t.startsWith("@")) && _.set(e, t);
453
459
  }
454
- let ee = Object.freeze(Object.keys(e.bindings).filter((e) => !e.startsWith("@")).sort()), y = /* @__PURE__ */ new Map();
460
+ let v = Object.freeze(Object.keys(e.bindings).filter((e) => !e.startsWith("@")).sort()), b = /* @__PURE__ */ new Map();
455
461
  for (let [e, t] of d) for (let n of Object.values(t)) {
456
462
  if (n.startsWith("@")) continue;
457
- let t = y.get(n) ?? /* @__PURE__ */ new Set();
458
- t.add(e), y.set(n, t);
463
+ let t = b.get(n) ?? /* @__PURE__ */ new Set();
464
+ t.add(e), b.set(n, t);
459
465
  }
460
466
  let x = e.computations ?? {}, S = Object.keys(x), C = /* @__PURE__ */ new Map();
461
467
  for (let [e, n] of Object.entries(x)) {
462
- let r = ae(n.source, t);
468
+ let r = ie(n.source, t);
463
469
  r.expression && C.set(e, r.expression);
464
470
  }
465
- let { order: te, cyclic: ne } = b(x), w = {}, T = /* @__PURE__ */ new Map();
471
+ let { order: te, cyclic: ne } = y(x), w = {}, T = /* @__PURE__ */ new Map();
466
472
  for (let e of te) {
467
473
  let t = x[e];
468
474
  if (!t || t.kind !== "const") continue;
@@ -472,7 +478,7 @@ function oe(e, t) {
472
478
  T.set(e, new a("expression-budget", `Constant "${e}": ${r}`, 0));
473
479
  continue;
474
480
  }
475
- w[e] = z(n);
481
+ w[e] = B(n);
476
482
  continue;
477
483
  }
478
484
  let n = C.get(e);
@@ -483,9 +489,9 @@ function oe(e, t) {
483
489
  T.set(e, new a("expression-budget", `Constant "${e}": ${r}`, 0));
484
490
  continue;
485
491
  }
486
- w[e] = z(t);
492
+ w[e] = B(t);
487
493
  } catch (t) {
488
- T.set(e, re(t));
494
+ T.set(e, R(t));
489
495
  }
490
496
  }
491
497
  let E = /* @__PURE__ */ new Map();
@@ -493,7 +499,7 @@ function oe(e, t) {
493
499
  let D = [];
494
500
  if (Array.isArray(e.validations)) for (let n of e.validations) {
495
501
  if (!u(n)) continue;
496
- let e = ae(n.expression, t);
502
+ let e = ie(n.expression, t);
497
503
  D.push({
498
504
  rule: n,
499
505
  expression: e.expression,
@@ -502,16 +508,16 @@ function oe(e, t) {
502
508
  }
503
509
  return {
504
510
  document: e,
505
- nodeIndex: r,
511
+ nodeIndex: n,
506
512
  controls: l,
507
513
  slotKeys: d,
508
- publicNames: ee,
509
- publicSlotOwners: y,
514
+ publicNames: v,
515
+ publicSlotOwners: b,
510
516
  initial: s,
511
517
  valueRules: p,
512
- legacyValueRules: m,
513
- slotRelations: h,
514
- bindingByNode: g,
518
+ legacyValueRules: ee,
519
+ slotRelations: m,
520
+ bindingByNode: _,
515
521
  computationMetadata: x,
516
522
  computationNames: S,
517
523
  computationOrder: te,
@@ -521,49 +527,49 @@ function oe(e, t) {
521
527
  constErrors: T,
522
528
  cycleErrors: E,
523
529
  validationRules: D,
524
- validationLineStarts: _(typeof e.source == "string" ? e.source : "")
530
+ validationLineStarts: h(typeof e.source == "string" ? e.source : "")
525
531
  };
526
532
  }
527
- function se(e) {
528
- return !e || e.syntax !== "local" ? "createLocalRuntime requires a local interaction document." : e.syntaxVersion !== void 0 && e.syntaxVersion !== "local-draft-3" || e.versionDeclaration && e.versionDeclaration.version !== "local-draft-3" ? `createLocalRuntime requires ${d}; migrate the source before constructing a runtime.` : null;
533
+ function oe(e) {
534
+ return !e || e.syntax !== "local" ? "createLocalRuntime requires a local interaction document." : e.syntaxVersion !== void 0 && e.syntaxVersion !== "local-draft-3" || e.versionDeclaration && e.versionDeclaration.version !== "local-draft-3" ? `createLocalRuntime requires ${x}; migrate the source before constructing a runtime.` : null;
529
535
  }
530
- function W(e, t) {
536
+ function G(e, t) {
531
537
  return (e.controls.get(t.name) ?? [])[0] ?? (t.owner ? e.nodeIndex.get(t.owner) : void 0) ?? (t.nodeIds[0] ? e.nodeIndex.get(t.nodeIds[0]) : void 0);
532
538
  }
533
- function ce(e, t, n) {
534
- let r = W(e, t);
535
- return r ? V(e.document, r, "local.runtime.value", n) : H("local.runtime.value", i(n));
539
+ function se(e, t, n) {
540
+ let i = G(e, t);
541
+ return i ? H(e.document, i, "local.runtime.value", n) : U("local.runtime.value", r(n));
536
542
  }
537
- function G(e, t, n) {
543
+ function K(e, t, n) {
538
544
  let r = e.slotRelations.get(t);
539
545
  return r?.length ? r.some(({ lower: e, upper: t }) => {
540
546
  let r = n[e], i = n[t];
541
547
  return typeof r == "number" && typeof i == "number" && r > i;
542
548
  }) : !1;
543
549
  }
544
- function le(e, t) {
545
- let n = e.nodeIndex.get(t);
546
- return n ? V(e.document, n, "local.runtime.value", r("local.runtime.value.range-order")) : H("local.runtime.value", i(r("local.runtime.value.range-order")));
550
+ function ce(e, t) {
551
+ let i = e.nodeIndex.get(t);
552
+ return i ? H(e.document, i, "local.runtime.value", n("local.runtime.value.range-order")) : U("local.runtime.value", r(n("local.runtime.value.range-order")));
547
553
  }
548
554
  // src/local/runtime/retention.ts
549
- function K(e) {
555
+ function q(e) {
550
556
  let t = /* @__PURE__ */ new Map();
551
- for (let r of n(e.nodes)) t.set(r.id, r);
557
+ for (let n of i(e.nodes)) t.set(n.id, n);
552
558
  return t;
553
559
  }
554
- function ue(e, t, n) {
560
+ function le(e, t, n) {
555
561
  let r = e.bindingSlots?.[t.id];
556
562
  return r !== void 0 && Object.values(r).includes(n);
557
563
  }
558
- function q(e, t, n) {
564
+ function J(e, t, n) {
559
565
  let r = t.name ? C(t.name) : void 0;
560
566
  if (r?.bindings) {
561
567
  let i = e.bindingSlots?.[t.id];
562
568
  for (let [e, a] of Object.entries(r.bindings)) if (t.attrs?.[a.bind] === n || e !== "value" && i?.[e] === n) return a.retain === !1 ? void 0 : a.initial;
563
- } else if (t.attrs?.bind === n || ue(e, t, n)) return "initial";
569
+ } else if (t.attrs?.bind === n || le(e, t, n)) return "initial";
564
570
  }
565
- function J(e) {
566
- let t = K(e), n = v(e), r = new Set(n?.retentionExclusions ?? []), i = /* @__PURE__ */ new Map();
571
+ function Y(e) {
572
+ let t = q(e), n = g(e), r = new Set(n?.retentionExclusions ?? []), i = /* @__PURE__ */ new Map();
567
573
  for (let [a, o] of Object.entries(e.bindings)) {
568
574
  let s = o.nodeIds.flatMap((e) => {
569
575
  let n = t.get(e);
@@ -572,7 +578,7 @@ function J(e) {
572
578
  if (!s.length || a.startsWith("@") || r.has(a)) continue;
573
579
  let c;
574
580
  if (n === void 0) {
575
- let t = s.map((t) => q(e, t, a));
581
+ let t = s.map((t) => J(e, t, a));
576
582
  if (t.some((e) => e === void 0)) continue;
577
583
  c = t;
578
584
  } else {
@@ -587,34 +593,34 @@ function J(e) {
587
593
  }
588
594
  return i;
589
595
  }
590
- function Y(e, t) {
596
+ function X(e, t) {
591
597
  return Object.freeze({
592
598
  name: e,
593
599
  reason: t
594
600
  });
595
601
  }
596
- function X(e) {
597
- let t = J(e.previous), n = J(e.next), r = {}, i = [], a = [];
602
+ function Z(e) {
603
+ let t = Y(e.previous), n = Y(e.next), r = {}, i = [], a = [];
598
604
  for (let o of Object.keys(e.state).sort()) {
599
605
  if (o.startsWith("@")) {
600
- a.push(Y(o, "internal"));
606
+ a.push(X(o, "internal"));
601
607
  continue;
602
608
  }
603
609
  if (!Object.hasOwn(e.previous.bindings, o) || !Object.hasOwn(e.next.bindings, o)) {
604
- a.push(Y(o, "unknown"));
610
+ a.push(X(o, "unknown"));
605
611
  continue;
606
612
  }
607
613
  let s = t.get(o), c = n.get(o);
608
614
  if (!s || !c) {
609
- a.push(Y(o, "unretainable"));
615
+ a.push(X(o, "unretainable"));
610
616
  continue;
611
617
  }
612
618
  if (s.type !== c.type) {
613
- a.push(Y(o, "type"));
619
+ a.push(X(o, "type"));
614
620
  continue;
615
621
  }
616
622
  if (s.initialDefinition !== c.initialDefinition) {
617
- a.push(Y(o, "initial"));
623
+ a.push(X(o, "initial"));
618
624
  continue;
619
625
  }
620
626
  let l = e.state[o];
@@ -626,7 +632,7 @@ function X(e) {
626
632
  dropped: Object.freeze(a)
627
633
  });
628
634
  }
629
- function Z(e, t, n) {
635
+ function ue(e, t, n) {
630
636
  return Object.freeze({
631
637
  retained: Object.freeze([...e]),
632
638
  dropped: Object.freeze(t.map((e) => Object.freeze({ ...e }))),
@@ -635,7 +641,7 @@ function Z(e, t, n) {
635
641
  }
636
642
  function Q(e, t) {
637
643
  let n = Object.keys(t.values).sort();
638
- if (!e.setParameters(t.values).length) return Z(n, t.dropped, []);
644
+ if (!e.setParameters(t.values).length) return ue(n, t.dropped, []);
639
645
  let r = [], i = n, a = [];
640
646
  for (; i.length;) {
641
647
  let n = [];
@@ -648,98 +654,98 @@ function Q(e, t) {
648
654
  i = n;
649
655
  }
650
656
  r.sort();
651
- let o = [...t.dropped, ...i.map((e) => Y(e, "invalid"))];
652
- return o.sort((e, t) => e.name < t.name ? -1 : +(e.name > t.name)), Z(r, o, a);
657
+ let o = [...t.dropped, ...i.map((e) => X(e, "invalid"))];
658
+ return o.sort((e, t) => e.name < t.name ? -1 : +(e.name > t.name)), ue(r, o, a);
653
659
  }
654
660
  // src/local/runtime/runtime-migration.ts
655
661
  function de(e, t, n, r, i) {
656
- let a = X({
662
+ let a = Z({
657
663
  previous: e.document,
658
664
  state: t,
659
665
  next: n
660
666
  }), o = {};
661
- for (let [e, t] of Object.entries(n.bindings)) o[e] = z(t.initial);
667
+ for (let [e, t] of Object.entries(n.bindings)) o[e] = B(t.initial);
662
668
  let s = /* @__PURE__ */ new Map();
663
669
  for (let e of a.dropped) s.set(e.name, Object.freeze({ ...e }));
664
670
  let c = [], l = {}, u = [], d = /* @__PURE__ */ new Set(), f, p = (n) => {
665
671
  let o = e.document.bindings[n], s = e.controls.get(n) ?? [];
666
- return !o || !s.some((t) => e.document.dynamicConstraints?.[t.id]) || (f ??= i({}, e, t), L(o, s, a.values[n], f, e.valueRules, e.legacyValueRules).ok) ? !1 : U(e, n) === U(r, n);
672
+ return !o || !s.some((t) => e.document.dynamicConstraints?.[t.id]) || (f ??= i({}, e, t), L(o, s, a.values[n], f, e.valueRules, e.legacyValueRules).ok) ? !1 : W(e, n) === W(r, n);
667
673
  };
668
674
  for (let e of a.retained) {
669
675
  let t = n.bindings[e];
670
676
  if (!t) continue;
671
677
  if (p(e)) {
672
- d.add(e), l[e] = z(a.values[e]), u.push(e);
678
+ d.add(e), l[e] = B(a.values[e]), u.push(e);
673
679
  continue;
674
680
  }
675
681
  let f = L(t, r.controls.get(e) ?? [], a.values[e], i(a.values, r, o), r.valueRules, r.legacyValueRules);
676
- f.ok ? (l[e] = z(f.value), u.push(e)) : (c.push(ce(r, t, f.detail)), s.set(e, Object.freeze({
682
+ f.ok ? (l[e] = B(f.value), u.push(e)) : (c.push(se(r, t, f.detail)), s.set(e, Object.freeze({
677
683
  name: e,
678
684
  reason: "invalid"
679
685
  })));
680
686
  }
681
- let m = {
687
+ let ee = {
682
688
  ...o,
683
689
  ...l
684
- }, h = /* @__PURE__ */ new Set();
685
- for (let e of u) for (let t of r.publicSlotOwners.get(e) ?? []) h.add(t);
686
- let g = !1;
687
- for (let e of [...h].sort()) if (G(r, e, m)) {
688
- g = !0;
690
+ }, m = /* @__PURE__ */ new Set();
691
+ for (let e of u) for (let t of r.publicSlotOwners.get(e) ?? []) m.add(t);
692
+ let h = !1;
693
+ for (let e of [...m].sort()) if (K(r, e, ee)) {
694
+ h = !0;
689
695
  break;
690
696
  }
691
- let _;
692
- if (!g) Object.assign(o, l), _ = u;
697
+ let g;
698
+ if (!h) Object.assign(o, l), g = u;
693
699
  else {
694
- _ = [];
700
+ g = [];
695
701
  for (let e of u) {
696
702
  let t = o[e];
697
703
  o[e] = l[e];
698
704
  let n = !1;
699
- for (let t of [...r.publicSlotOwners.get(e) ?? []].sort()) G(r, t, o) && (c.push(le(r, t)), n = !0);
705
+ for (let t of [...r.publicSlotOwners.get(e) ?? []].sort()) K(r, t, o) && (c.push(ce(r, t)), n = !0);
700
706
  n ? (o[e] = t, s.set(e, Object.freeze({
701
707
  name: e,
702
708
  reason: "invalid"
703
- }))) : _.push(e);
709
+ }))) : g.push(e);
704
710
  }
705
711
  }
706
- for (let [e, t] of r.slotRelations) if (G(r, e, o)) {
712
+ for (let [e, t] of r.slotRelations) if (K(r, e, o)) {
707
713
  for (let e of t) for (let t of [e.lower, e.upper]) {
708
714
  let e = n.bindings[t];
709
715
  if (!e) continue;
710
- o[t] = z(e.initial);
711
- let r = _.indexOf(t);
712
- r >= 0 && _.splice(r, 1), s.set(t, Object.freeze({
716
+ o[t] = B(e.initial);
717
+ let r = g.indexOf(t);
718
+ r >= 0 && g.splice(r, 1), s.set(t, Object.freeze({
713
719
  name: t,
714
720
  reason: "invalid"
715
721
  }));
716
722
  }
717
- if (c.push(le(r, e)), G(r, e, o)) return {
723
+ if (c.push(ce(r, e)), K(r, e, o)) return {
718
724
  values: {},
719
725
  retained: [],
720
726
  dropped: [],
721
727
  diagnostics: []
722
728
  };
723
729
  }
724
- let v = !0;
725
- for (; v;) {
730
+ let _ = !0;
731
+ for (; _;) {
726
732
  let e = i({}, r, o), t = [];
727
- for (let i of _) {
733
+ for (let i of g) {
728
734
  if (d.has(i)) continue;
729
735
  let a = n.bindings[i], s = L(a, r.controls.get(i) ?? [], o[i], e, r.valueRules, r.legacyValueRules);
730
- s.ok || (c.push(ce(r, a, s.detail)), t.push(i));
736
+ s.ok || (c.push(se(r, a, s.detail)), t.push(i));
731
737
  }
732
- for (let e of t) o[e] = z(n.bindings[e].initial), _.splice(_.indexOf(e), 1), s.set(e, Object.freeze({
738
+ for (let e of t) o[e] = B(n.bindings[e].initial), g.splice(g.indexOf(e), 1), s.set(e, Object.freeze({
733
739
  name: e,
734
740
  reason: "invalid"
735
741
  }));
736
- v = t.length > 0;
742
+ _ = t.length > 0;
737
743
  }
738
- let ee = [...s.values()].sort((e, t) => e.name < t.name ? -1 : +(e.name > t.name));
739
- return _.sort(), {
744
+ let v = [...s.values()].sort((e, t) => e.name < t.name ? -1 : +(e.name > t.name));
745
+ return g.sort(), {
740
746
  values: o,
741
- retained: _,
742
- dropped: ee,
747
+ retained: g,
748
+ dropped: v,
743
749
  diagnostics: c
744
750
  };
745
751
  }
@@ -780,20 +786,20 @@ function ve(e, t, n) {
780
786
  return he.get(e)?.bindNetworkExternals(t, n) ?? (() => {});
781
787
  }
782
788
  function ye(e, t) {
783
- let c = se(e);
789
+ let c = oe(e);
784
790
  if (c) throw Error(c);
785
- let u = t?.services === void 0, d = te(t?.network), p = /* @__PURE__ */ new Map(), _ = ne(e.source), v = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), S = oe(e, b), C = () => S, E = () => {
791
+ let u = t?.services === void 0, f = te(t?.network), h = /* @__PURE__ */ new Map(), g = ne(e.source), y = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), S = ae(e, x), C = () => S, E = () => {
786
792
  let e = /* @__PURE__ */ new Set();
787
- for (let r of n(S.document.nodes)) r.name !== void 0 && e.add(w({
793
+ for (let n of i(S.document.nodes)) n.name !== void 0 && e.add(w({
788
794
  documentId: t?.documentId,
789
- sourceDigest: _,
790
- nodeId: r.id,
791
- stateKey: r.attrs?.["state-key"]
795
+ sourceDigest: g,
796
+ nodeId: n.id,
797
+ stateKey: n.attrs?.["state-key"]
792
798
  }));
793
799
  return e;
794
800
  }, D = t?.services ?? T({
795
801
  documentId: t?.documentId,
796
- sourceDigest: _,
802
+ sourceDigest: g,
797
803
  randomSeed: t?.randomSeed,
798
804
  componentState: t?.componentState,
799
805
  ...t?.componentStateStorage === void 0 ? {} : { componentStateStorage: t.componentStateStorage },
@@ -805,14 +811,14 @@ function ye(e, t) {
805
811
  for (let [n, r] of Object.entries(e.externals ?? {})) {
806
812
  let e = t?.externalValues?.[n];
807
813
  if (e === void 0) continue;
808
- let i = ie(r.type, e);
814
+ let i = re(r.type, e);
809
815
  i.ok && (O[n] = i.value);
810
816
  }
811
817
  let A = (e, t) => {
812
818
  let n = {};
813
819
  for (let [r, i] of Object.entries(e.document.externals ?? {})) {
814
820
  if (!Object.hasOwn(t, r)) continue;
815
- let e = ie(i.type, t[r]);
821
+ let e = re(i.type, t[r]);
816
822
  e.ok && (n[r] = e.value);
817
823
  }
818
824
  return n;
@@ -823,7 +829,7 @@ function ye(e, t) {
823
829
  }, M = (e, t, n, r = C()) => {
824
830
  let i = r.document.dynamicConstraints?.[e.id]?.[t];
825
831
  if (!i) return { present: !1 };
826
- let a = ae(i.source, b);
832
+ let a = ie(i.source, x);
827
833
  if (!a.expression) return {
828
834
  present: !0,
829
835
  ok: !1
@@ -844,21 +850,21 @@ function ye(e, t) {
844
850
  ok: !1
845
851
  };
846
852
  }
847
- }, N = S.initial, P = 0, F = {}, I = {}, re = {
853
+ }, N = S.initial, P = 0, F = {}, I = {}, R = {
848
854
  revision: 0,
849
855
  state: me({})
850
- }, R = !1, B = null, U = /* @__PURE__ */ new Set(), W = /* @__PURE__ */ new Map(), K = () => {
851
- if (R) throw Error("The local interaction runtime has been disposed.");
856
+ }, z = !1, V = null, W = /* @__PURE__ */ new Set(), G = /* @__PURE__ */ new Map(), q = () => {
857
+ if (z) throw Error("The local interaction runtime has been disposed.");
852
858
  };
853
- function ue(e, t) {
859
+ function le(e, t) {
854
860
  if (!t.startsWith("@") && Object.hasOwn(e.document.bindings, t)) return Object.hasOwn(N, t) ? N[t] : void 0;
855
861
  }
856
- let q = (e, t) => {
862
+ let J = (e, t) => {
857
863
  let n = j(e), r = /* @__PURE__ */ new Map();
858
864
  for (let t of Object.keys(e.document.externals ?? {})) Object.hasOwn(n, t) || r.set(t, new a("external-missing", "External data \"" + t + "\" is not available.", 0));
859
865
  let i = {}, o = /* @__PURE__ */ new Map();
860
866
  if (e.computationNames.length > 0) {
861
- let a = h(e.computationMetadata, e.computationOrder, e.computationExpressions, {
867
+ let a = ee(e.computationMetadata, e.computationOrder, e.computationExpressions, {
862
868
  ...t,
863
869
  ...n
864
870
  }, e.constValues, r);
@@ -885,79 +891,79 @@ function ye(e, t) {
885
891
  environment: s,
886
892
  snapshotState: c
887
893
  };
888
- }, J = () => {
889
- let e = q(C(), N);
894
+ }, Y = () => {
895
+ let e = J(C(), N);
890
896
  F = e.environment, I = e.snapshotState;
891
- }, Y = (e, t = C(), n = N) => {
897
+ }, X = (e, t = C(), n = N) => {
892
898
  let r;
893
- return (i, a) => t.document.dynamicConstraints?.[i.id]?.[a] ? (r ??= q(t, {
899
+ return (i, a) => t.document.dynamicConstraints?.[i.id]?.[a] ? (r ??= J(t, {
894
900
  ...n,
895
901
  ...e
896
902
  }).environment, M(i, a, r, t)) : { present: !1 };
897
- }, X = () => {
898
- re = {
903
+ }, Z = () => {
904
+ R = {
899
905
  revision: P,
900
906
  state: me(I)
901
907
  };
902
- }, Z = () => {
903
- for (let e of U) e();
908
+ }, ue = () => {
909
+ for (let e of W) e();
904
910
  }, Q = (e) => {
905
- N = e, P += 1, J(), X(), Z();
911
+ N = e, P += 1, Y(), Z(), ue();
906
912
  }, ge = () => {
907
- P += 1, J(), X(), Z();
913
+ P += 1, Y(), Z(), ue();
908
914
  }, _e = (e, t = O) => {
909
- if (K(), typeof e != "object" || !e || Array.isArray(e)) throw TypeError("setExternalValues requires an object of external values.");
910
- let n = [], a = {}, o = Object.keys(e).sort();
915
+ if (q(), typeof e != "object" || !e || Array.isArray(e)) throw TypeError("setExternalValues requires an object of external values.");
916
+ let i = [], a = {}, o = Object.keys(e).sort();
911
917
  for (let t of o) {
912
918
  if (t === "__proto__") {
913
- n.push(H("local.runtime.external", "External names cannot be \"__proto__\"."));
919
+ i.push(U("local.runtime.external", "External names cannot be \"__proto__\"."));
914
920
  continue;
915
921
  }
916
922
  let o = C().document.externals ?? {}, s = Object.hasOwn(o, t) ? o[t] : void 0;
917
923
  if (!s) {
918
- let e = r("local.runtime.external", { name: t });
919
- n.push(H("local.runtime.external", i(e), e));
924
+ let e = n("local.runtime.external", { name: t });
925
+ i.push(U("local.runtime.external", r(e), e));
920
926
  continue;
921
927
  }
922
- let c = ie(s.type, e[t]);
928
+ let c = re(s.type, e[t]);
923
929
  if (c.ok) a[t] = c.value;
924
930
  else {
925
- let e = r(c.key, {
931
+ let e = n(c.key, {
926
932
  name: t,
927
933
  ...c.params ?? {}
928
934
  });
929
- n.push(H("local.runtime.external", i(e), e));
935
+ i.push(U("local.runtime.external", r(e), e));
930
936
  }
931
937
  }
932
- return n.length ? n : (o.some((e) => !pe(t[e], a[e])) && (Object.assign(t, a), ge()), []);
938
+ return i.length ? i : (o.some((e) => !pe(t[e], a[e])) && (Object.assign(t, a), ge()), []);
933
939
  }, ve = (e, t) => {
934
- if (R) return () => {};
940
+ if (z) return () => {};
935
941
  let n = {}, r = e.bindExternalValues((e) => {
936
- if (R || !k.has(n)) return;
942
+ if (z || !k.has(n)) return;
937
943
  let r = _e(e, n);
938
944
  r.length && t?.(r);
939
945
  });
940
946
  return r ? (k.set(n, r), () => {
941
- k.delete(n) && (r(), !R && Object.keys(n).length && ge());
947
+ k.delete(n) && (r(), !z && Object.keys(n).length && ge());
942
948
  }) : () => {};
943
949
  }, ye = (e) => {
944
- K();
945
- let t = C(), n = [], r = {}, i = Object.keys(e).sort(), a = Y(e);
950
+ q();
951
+ let t = C(), n = [], r = {}, i = Object.keys(e).sort(), a = X(e);
946
952
  for (let o of i) {
947
953
  if (o === "__proto__") {
948
- n.push(H("local.runtime.parameter", "Parameter names cannot be \"__proto__\"."));
954
+ n.push(U("local.runtime.parameter", "Parameter names cannot be \"__proto__\"."));
949
955
  continue;
950
956
  }
951
957
  if (o.startsWith("@")) {
952
- n.push(H("local.runtime.parameter", `Internal parameter "${o}" cannot be written by name.`));
958
+ n.push(U("local.runtime.parameter", `Internal parameter "${o}" cannot be written by name.`));
953
959
  continue;
954
960
  }
955
961
  if (!Object.hasOwn(t.document.bindings, o)) {
956
- n.push(H("local.runtime.parameter", `Unknown parameter "${o}".`));
962
+ n.push(U("local.runtime.parameter", `Unknown parameter "${o}".`));
957
963
  continue;
958
964
  }
959
965
  let i = t.document.bindings[o], s = L(i, t.controls.get(o) ?? [], e[o], a, t.valueRules, t.legacyValueRules);
960
- s.ok ? r[o] = z(s.value) : n.push(ce(t, i, s.detail));
966
+ s.ok ? r[o] = B(s.value) : n.push(se(t, i, s.detail));
961
967
  }
962
968
  if (n.length) return n;
963
969
  if (!i.some((e) => !pe(N[e], r[e]))) return [];
@@ -966,23 +972,23 @@ function ye(e, t) {
966
972
  ...r
967
973
  }, s = /* @__PURE__ */ new Set();
968
974
  for (let e of i) for (let n of t.publicSlotOwners.get(e) ?? []) s.add(n);
969
- for (let e of [...s].sort()) G(t, e, o) && n.push(le(t, e));
975
+ for (let e of [...s].sort()) K(t, e, o) && n.push(ce(t, e));
970
976
  return n.length ? n : (Q(o), []);
971
977
  }, be = (e) => {
972
- let t = v.get(e);
978
+ let t = y.get(e);
973
979
  if (!t) {
974
- if (t = l(e), v.size >= 200) {
975
- let e = v.keys().next().value;
976
- e !== void 0 && v.delete(e);
980
+ if (t = l(e), y.size >= 200) {
981
+ let e = y.keys().next().value;
982
+ e !== void 0 && y.delete(e);
977
983
  }
978
- v.set(e, t);
984
+ y.set(e, t);
979
985
  }
980
986
  return t;
981
987
  }, xe = () => {
982
988
  let e = C(), t = [], n = typeof e.document.source == "string" ? e.document.source : "";
983
989
  for (let r of e.validationRules) {
984
990
  if (r.error) {
985
- t.push(f(n, e.validationLineStarts, r.rule.range, y, m(`Validation expression is invalid: ${r.error.message}`)));
991
+ t.push(d(n, e.validationLineStarts, r.rule.range, v, p(`Validation expression is invalid: ${r.error.message}`)));
986
992
  continue;
987
993
  }
988
994
  if (!r.expression) continue;
@@ -990,10 +996,10 @@ function ye(e, t) {
990
996
  try {
991
997
  i = r.expression.evaluate(F);
992
998
  } catch (i) {
993
- t.push(f(n, e.validationLineStarts, r.rule.range, y, m(`Validation expression failed: ${i instanceof Error ? i.message : String(i)}`)));
999
+ t.push(d(n, e.validationLineStarts, r.rule.range, v, p(`Validation expression failed: ${i instanceof Error ? i.message : String(i)}`)));
994
1000
  continue;
995
1001
  }
996
- typeof i == "boolean" ? i || t.push(f(n, e.validationLineStarts, r.rule.range, g, Se(r.rule.message))) : t.push(f(n, e.validationLineStarts, r.rule.range, y, "Validation expression must evaluate to a boolean."));
1002
+ typeof i == "boolean" ? i || t.push(d(n, e.validationLineStarts, r.rule.range, m, Se(r.rule.message))) : t.push(d(n, e.validationLineStarts, r.rule.range, v, "Validation expression must evaluate to a boolean."));
997
1003
  }
998
1004
  return t;
999
1005
  }, Se = (e) => {
@@ -1001,11 +1007,11 @@ function ye(e, t) {
1001
1007
  try {
1002
1008
  t = s(e, F);
1003
1009
  } catch {
1004
- t = ee;
1010
+ t = _;
1005
1011
  }
1006
- return m(t);
1012
+ return p(t);
1007
1013
  }, Ce = (e, t) => {
1008
- if (K(), e === S.document) return $({
1014
+ if (q(), e === S.document) return $({
1009
1015
  ok: !0,
1010
1016
  changed: !1,
1011
1017
  revision: P,
@@ -1013,7 +1019,7 @@ function ye(e, t) {
1013
1019
  dropped: [],
1014
1020
  diagnostics: []
1015
1021
  });
1016
- if (se(e)) return $({
1022
+ if (oe(e)) return $({
1017
1023
  ok: !1,
1018
1024
  changed: !1,
1019
1025
  revision: P,
@@ -1023,7 +1029,7 @@ function ye(e, t) {
1023
1029
  });
1024
1030
  let n;
1025
1031
  try {
1026
- n = oe(e, b);
1032
+ n = ae(e, x);
1027
1033
  } catch {
1028
1034
  return $({
1029
1035
  ok: !1,
@@ -1034,7 +1040,7 @@ function ye(e, t) {
1034
1040
  diagnostics: []
1035
1041
  });
1036
1042
  }
1037
- let r = de(S, N, e, n, Y);
1043
+ let r = de(S, N, e, n, X);
1038
1044
  if (Object.keys(r.values).length === 0 && Object.keys(e.bindings).length > 0) return $({
1039
1045
  ok: !1,
1040
1046
  changed: !1,
@@ -1045,7 +1051,7 @@ function ye(e, t) {
1045
1051
  });
1046
1052
  let i;
1047
1053
  try {
1048
- i = q(n, r.values);
1054
+ i = J(n, r.values);
1049
1055
  } catch {
1050
1056
  return $({
1051
1057
  ok: !1,
@@ -1061,7 +1067,7 @@ function ye(e, t) {
1061
1067
  for (let t of Object.keys(e)) delete e[t];
1062
1068
  Object.assign(e, t);
1063
1069
  }
1064
- if (S = n, N = r.values, F = i.environment, I = i.snapshotState, B = null, P += 1, X(), t) for (let e of U) e();
1070
+ if (S = n, N = r.values, F = i.environment, I = i.snapshotState, V = null, P += 1, Z(), t) for (let e of W) e();
1065
1071
  return $({
1066
1072
  ok: !0,
1067
1073
  changed: !0,
@@ -1072,76 +1078,76 @@ function ye(e, t) {
1072
1078
  });
1073
1079
  }, we = (e) => {
1074
1080
  let t = /* @__PURE__ */ new Set();
1075
- for (let r of n([e])) t.add(r.id);
1081
+ for (let n of i([e])) t.add(n.id);
1076
1082
  return t;
1077
1083
  }, Te = {
1078
- network: d.network,
1084
+ network: f.network,
1079
1085
  get document() {
1080
1086
  return S.document;
1081
1087
  },
1082
1088
  services: D,
1083
1089
  snapshot() {
1084
- return K(), re;
1090
+ return q(), R;
1085
1091
  },
1086
1092
  get(e, t) {
1087
- K();
1093
+ q();
1088
1094
  let n = C(), r = n.nodeIndex.get(e.id);
1089
1095
  if (!r) return null;
1090
- let i = t === void 0 ? n.slotKeys.get(r.id)?.value ?? n.bindingByNode.get(r.id) ?? x(r) : n.slotKeys.get(r.id)?.[t];
1091
- return i && Object.hasOwn(N, i) ? z(N[i]) : null;
1096
+ let i = t === void 0 ? n.slotKeys.get(r.id)?.value ?? n.bindingByNode.get(r.id) ?? b(r) : n.slotKeys.get(r.id)?.[t];
1097
+ return i && Object.hasOwn(N, i) ? B(N[i]) : null;
1092
1098
  },
1093
- set(e, t, n) {
1094
- K();
1099
+ set(e, t, r) {
1100
+ q();
1095
1101
  let i = C(), a = i.nodeIndex.get(e.id);
1096
- if (!a) return [V(i.document, e, "local.runtime.binding", r("local.runtime.binding.no-writable"))];
1102
+ if (!a) return [H(i.document, e, "local.runtime.binding", n("local.runtime.binding.no-writable"))];
1097
1103
  let o = i.slotKeys.get(a.id), s;
1098
- if (n === void 0) {
1099
- if (o && !o.value) return [V(i.document, a, "local.runtime.binding", r("local.runtime.binding.needs-slot"))];
1100
- s = o?.value ?? i.bindingByNode.get(a.id) ?? x(a);
1101
- } else if (s = o?.[n], !s) return [V(i.document, a, "local.runtime.binding", r("local.runtime.binding.unknown-slot", { slot: n }))];
1104
+ if (r === void 0) {
1105
+ if (o && !o.value) return [H(i.document, a, "local.runtime.binding", n("local.runtime.binding.needs-slot"))];
1106
+ s = o?.value ?? i.bindingByNode.get(a.id) ?? b(a);
1107
+ } else if (s = o?.[r], !s) return [H(i.document, a, "local.runtime.binding", n("local.runtime.binding.unknown-slot", { slot: r }))];
1102
1108
  let c = Object.hasOwn(i.document.bindings, s) ? i.document.bindings[s] : void 0;
1103
- if (!c) return [V(i.document, a, "local.runtime.binding", r("local.runtime.binding.no-writable"))];
1104
- let l = L(c, i.controls.get(s) ?? [], t, Y({ [s]: t }), i.valueRules, i.legacyValueRules);
1105
- if (!l.ok) return [V(i.document, a, "local.runtime.value", l.detail)];
1106
- let u = z(l.value);
1109
+ if (!c) return [H(i.document, a, "local.runtime.binding", n("local.runtime.binding.no-writable"))];
1110
+ let l = L(c, i.controls.get(s) ?? [], t, X({ [s]: t }), i.valueRules, i.legacyValueRules);
1111
+ if (!l.ok) return [H(i.document, a, "local.runtime.value", l.detail)];
1112
+ let u = B(l.value);
1107
1113
  if (pe(N[s], u)) return [];
1108
1114
  let d = {
1109
1115
  ...N,
1110
1116
  [s]: u
1111
1117
  };
1112
- return G(i, a.id, d) ? [V(i.document, a, "local.runtime.value", r("local.runtime.value.range-order"))] : (Q(d), []);
1118
+ return K(i, a.id, d) ? [H(i.document, a, "local.runtime.value", n("local.runtime.value.range-order"))] : (Q(d), []);
1113
1119
  },
1114
1120
  setMany(e, t) {
1115
- K();
1116
- let n = C(), i = n.nodeIndex.get(e.id);
1117
- if (!i) return [V(n.document, e, "local.runtime.binding", r("local.runtime.binding.no-writable"))];
1118
- let a = n.slotKeys.get(i.id);
1119
- if (!a) return [V(n.document, i, "local.runtime.binding", r("local.runtime.binding.no-multi-slot"))];
1121
+ q();
1122
+ let r = C(), i = r.nodeIndex.get(e.id);
1123
+ if (!i) return [H(r.document, e, "local.runtime.binding", n("local.runtime.binding.no-writable"))];
1124
+ let a = r.slotKeys.get(i.id);
1125
+ if (!a) return [H(r.document, i, "local.runtime.binding", n("local.runtime.binding.no-multi-slot"))];
1120
1126
  let o = Object.entries(t);
1121
1127
  if (!o.length) return [];
1122
- let s = { ...N }, c = q(n, {
1128
+ let s = { ...N }, c = J(r, {
1123
1129
  ...N,
1124
1130
  ...Object.fromEntries(o.map(([e, t]) => [a[e], t]))
1125
1131
  }).environment;
1126
1132
  for (let [e, t] of o) {
1127
1133
  let o = a[e];
1128
- if (!o || !Object.hasOwn(n.document.bindings, o)) return [V(n.document, i, "local.runtime.binding", r("local.runtime.binding.unknown-slot", { slot: e }))];
1129
- let l = L(n.document.bindings[o], n.controls.get(o) ?? [], t, (e, t) => M(e, t, c), n.valueRules, n.legacyValueRules);
1130
- if (!l.ok) return [V(n.document, i, "local.runtime.value", l.detail)];
1131
- s[o] = z(l.value);
1134
+ if (!o || !Object.hasOwn(r.document.bindings, o)) return [H(r.document, i, "local.runtime.binding", n("local.runtime.binding.unknown-slot", { slot: e }))];
1135
+ let l = L(r.document.bindings[o], r.controls.get(o) ?? [], t, (e, t) => M(e, t, c), r.valueRules, r.legacyValueRules);
1136
+ if (!l.ok) return [H(r.document, i, "local.runtime.value", l.detail)];
1137
+ s[o] = B(l.value);
1132
1138
  }
1133
- return G(n, i.id, s) ? [V(n.document, i, "local.runtime.value", r("local.runtime.value.range-order"))] : (o.every(([e, t]) => pe(N[a[e]], t)) || Q(s), []);
1139
+ return K(r, i.id, s) ? [H(r.document, i, "local.runtime.value", n("local.runtime.value.range-order"))] : (o.every(([e, t]) => pe(N[a[e]], t)) || Q(s), []);
1134
1140
  },
1135
1141
  parameterNames() {
1136
- return K(), C().publicNames;
1142
+ return q(), C().publicNames;
1137
1143
  },
1138
1144
  getParameter(e) {
1139
- K();
1140
- let t = ue(C(), e);
1141
- return t === void 0 ? void 0 : z(t);
1145
+ q();
1146
+ let t = le(C(), e);
1147
+ return t === void 0 ? void 0 : B(t);
1142
1148
  },
1143
1149
  getParameters() {
1144
- K();
1150
+ q();
1145
1151
  let e = C(), t = {};
1146
1152
  for (let n of e.publicNames) {
1147
1153
  let e = N[n];
@@ -1150,7 +1156,7 @@ function ye(e, t) {
1150
1156
  return Object.freeze(t);
1151
1157
  },
1152
1158
  readSubmissionFields(e) {
1153
- K();
1159
+ q();
1154
1160
  let t = C(), n = /* @__PURE__ */ new Map(), r = (e, n) => M(e, n, F, t);
1155
1161
  if (e.length === 0) return {
1156
1162
  ok: !1,
@@ -1158,7 +1164,7 @@ function ye(e, t) {
1158
1164
  reason: "unavailable"
1159
1165
  };
1160
1166
  for (let i of e) {
1161
- let e = ue(t, i);
1167
+ let e = le(t, i);
1162
1168
  if (e === void 0 || n.has(i)) return {
1163
1169
  ok: !1,
1164
1170
  field: i,
@@ -1177,9 +1183,9 @@ function ye(e, t) {
1177
1183
  }
1178
1184
  let i = Object.create(null);
1179
1185
  for (let [e, r] of n) {
1180
- for (let [n, i] of p.get(e) ?? []) {
1186
+ for (let [n, i] of h.get(e) ?? []) {
1181
1187
  if (!t.controls.get(e)?.some((e) => e.id === i)) continue;
1182
- let a = n(z(r));
1188
+ let a = n(B(r));
1183
1189
  if (a) return {
1184
1190
  ok: !1,
1185
1191
  field: e,
@@ -1194,28 +1200,28 @@ function ye(e, t) {
1194
1200
  };
1195
1201
  },
1196
1202
  registerSubmissionField(e, t) {
1197
- if (R) return () => {};
1203
+ if (z) return () => {};
1198
1204
  let n = C(), r = n.slotKeys.get(e.id)?.value ?? n.bindingByNode.get(e.id);
1199
1205
  if (!r || r.startsWith("@")) return () => {};
1200
- let i = p.get(r);
1201
- return i || p.set(r, i = /* @__PURE__ */ new Map()), i.set(t, e.id), () => {
1202
- i.delete(t), i.size === 0 && p.get(r) === i && p.delete(r);
1206
+ let i = h.get(r);
1207
+ return i || h.set(r, i = /* @__PURE__ */ new Map()), i.set(t, e.id), () => {
1208
+ i.delete(t), i.size === 0 && h.get(r) === i && h.delete(r);
1203
1209
  };
1204
1210
  },
1205
1211
  setParameter(e, t) {
1206
- K();
1212
+ q();
1207
1213
  let n = Object.create(null);
1208
1214
  return n[e] = t, ye(n);
1209
1215
  },
1210
1216
  setParameters(e) {
1211
- if (K(), typeof e != "object" || !e || Array.isArray(e)) throw TypeError("setParameters requires an object of parameter values.");
1217
+ if (q(), typeof e != "object" || !e || Array.isArray(e)) throw TypeError("setParameters requires an object of parameter values.");
1212
1218
  return ye(e);
1213
1219
  },
1214
1220
  getExternal(e) {
1215
- if (K(), Object.hasOwn(C().document.externals ?? {}, e) && Object.hasOwn(I, e)) return z(I[e]);
1221
+ if (q(), Object.hasOwn(C().document.externals ?? {}, e) && Object.hasOwn(I, e)) return B(I[e]);
1216
1222
  },
1217
1223
  getExternalValues() {
1218
- K();
1224
+ q();
1219
1225
  let e = {};
1220
1226
  for (let [t, n] of Object.entries(j(C()))) e[t] = Array.isArray(n) ? Object.freeze([...n]) : n;
1221
1227
  return Object.freeze(e);
@@ -1224,50 +1230,50 @@ function ye(e, t) {
1224
1230
  return _e(e);
1225
1231
  },
1226
1232
  evaluate(e) {
1227
- K();
1233
+ q();
1228
1234
  let t = be(e).evaluate(F);
1229
1235
  return Array.isArray(t) ? t.slice() : t;
1230
1236
  },
1231
1237
  validate() {
1232
- if (K(), B && B.revision === P) return B.diagnostics.map(fe);
1238
+ if (q(), V && V.revision === P) return V.diagnostics.map(fe);
1233
1239
  let e = xe();
1234
- return B = {
1240
+ return V = {
1235
1241
  revision: P,
1236
1242
  diagnostics: e
1237
1243
  }, e.map(fe);
1238
1244
  },
1239
1245
  text(e) {
1240
- return K(), s(e, F);
1246
+ return q(), s(e, F);
1241
1247
  },
1242
1248
  reset(e) {
1243
- K();
1249
+ q();
1244
1250
  let t = C(), n = t.nodeIndex.get(e.id);
1245
1251
  if (!n) return;
1246
- let r = we(n), s = { ...N };
1252
+ let i = we(n), s = { ...N };
1247
1253
  for (let [e, n] of Object.entries(t.document.bindings)) {
1248
- if (!(t.controls.get(e) ?? []).some((e) => r.has(e.id))) continue;
1254
+ if (!(t.controls.get(e) ?? []).some((e) => i.has(e.id))) continue;
1249
1255
  let c = o(n.initial);
1250
- if (c) throw new a("expression-budget", `Parameter "${e}": ${i(c)}`, 0);
1251
- s[e] = z(n.initial);
1256
+ if (c) throw new a("expression-budget", `Parameter "${e}": ${r(c)}`, 0);
1257
+ s[e] = B(n.initial);
1252
1258
  }
1253
- for (let e of r) W.set(e, (W.get(e) ?? 0) + 1);
1259
+ for (let e of i) G.set(e, (G.get(e) ?? 0) + 1);
1254
1260
  Q(s);
1255
1261
  },
1256
1262
  resetToken(e) {
1257
- K();
1263
+ q();
1258
1264
  let t = C().nodeIndex.get(e.id);
1259
- return t ? W.get(t.id) ?? 0 : 0;
1265
+ return t ? G.get(t.id) ?? 0 : 0;
1260
1266
  },
1261
1267
  subscribe(e) {
1262
- return K(), U.add(e), () => {
1263
- U.delete(e);
1268
+ return q(), W.add(e), () => {
1269
+ W.delete(e);
1264
1270
  };
1265
1271
  },
1266
1272
  dispose() {
1267
- if (!R) {
1268
- R = !0, d.dispose();
1273
+ if (!z) {
1274
+ z = !0, f.dispose();
1269
1275
  for (let e of k.values()) e();
1270
- k.clear(), p.clear(), D.state.flush(), u && D.scheduler.dispose(), U.clear(), v.clear(), b.clear(), S.computationExpressions.clear(), S.constErrors.clear(), S.cycleErrors.clear(), S.validationRules.length = 0, W.clear();
1276
+ k.clear(), h.clear(), D.state.flush(), u && D.scheduler.dispose(), W.clear(), y.clear(), x.clear(), S.computationExpressions.clear(), S.constErrors.clear(), S.cycleErrors.clear(), S.validationRules.length = 0, G.clear();
1271
1277
  }
1272
1278
  }
1273
1279
  };
@@ -1275,8 +1281,8 @@ function ye(e, t) {
1275
1281
  update: Ce,
1276
1282
  bindNetworkExternals: ve,
1277
1283
  notify() {
1278
- if (!R) for (let e of U) e();
1284
+ if (!z) for (let e of W) e();
1279
1285
  }
1280
- }), J(), X(), ve(d), Te;
1286
+ }), Y(), Z(), ve(f), Te;
1281
1287
  }
1282
- export { Q as a, ge as i, ye as n, X as o, _e as r, ve as t };
1288
+ export { Q as a, ge as i, ye as n, Z as o, _e as r, ve as t };