@ecopages/radiant 0.3.0-alpha.4 → 0.3.0-alpha.6

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 (453) hide show
  1. package/README.md +71 -59
  2. package/dist/LICENSE +21 -0
  3. package/dist/client/hydrator.d.ts +1 -1
  4. package/dist/client/hydrator.js +2 -2
  5. package/dist/client/hydrator.js.map +5 -3
  6. package/dist/client/install-hydrator.js +2 -2
  7. package/dist/client/install-hydrator.js.map +5 -3
  8. package/dist/context/context-consumer-bootstrap.d.ts +7 -6
  9. package/dist/context/context-consumer-bootstrap.js +2 -2
  10. package/dist/context/context-consumer-bootstrap.js.map +8 -3
  11. package/dist/context/context-consumer-runtime.d.ts +21 -8
  12. package/dist/context/context-consumer-runtime.js +2 -2
  13. package/dist/context/context-consumer-runtime.js.map +6 -3
  14. package/dist/context/context-host.d.ts +25 -0
  15. package/dist/context/context-host.js +3 -0
  16. package/dist/context/context-host.js.map +10 -0
  17. package/dist/context/context-provider.d.ts +10 -6
  18. package/dist/context/context-provider.js +2 -2
  19. package/dist/context/context-provider.js.map +9 -3
  20. package/dist/context/context-ssr-bridge.js +2 -2
  21. package/dist/context/context-ssr-bridge.js.map +4 -3
  22. package/dist/context/create-context.js +2 -2
  23. package/dist/context/create-context.js.map +4 -3
  24. package/dist/context/decorators/consume-context.d.ts +5 -2
  25. package/dist/context/decorators/consume-context.js +2 -2
  26. package/dist/context/decorators/consume-context.js.map +13 -3
  27. package/dist/context/decorators/context-selection-delivery.d.ts +1 -1
  28. package/dist/context/decorators/context-selection-delivery.js +2 -2
  29. package/dist/context/decorators/context-selection-delivery.js.map +5 -3
  30. package/dist/context/decorators/context-selector.d.ts +6 -6
  31. package/dist/context/decorators/context-selector.js +2 -2
  32. package/dist/context/decorators/context-selector.js.map +15 -3
  33. package/dist/context/decorators/legacy/consume-context.d.ts +2 -2
  34. package/dist/context/decorators/legacy/consume-context.js +2 -2
  35. package/dist/context/decorators/legacy/consume-context.js.map +10 -3
  36. package/dist/context/decorators/legacy/context-selector-field.d.ts +2 -2
  37. package/dist/context/decorators/legacy/context-selector-field.js +2 -2
  38. package/dist/context/decorators/legacy/context-selector-field.js.map +11 -3
  39. package/dist/context/decorators/legacy/context-selector.d.ts +2 -2
  40. package/dist/context/decorators/legacy/context-selector.js +2 -2
  41. package/dist/context/decorators/legacy/context-selector.js.map +11 -3
  42. package/dist/context/decorators/legacy/provide-context.d.ts +2 -2
  43. package/dist/context/decorators/legacy/provide-context.js +2 -2
  44. package/dist/context/decorators/legacy/provide-context.js.map +11 -3
  45. package/dist/context/decorators/on-context-update.d.ts +5 -5
  46. package/dist/context/decorators/on-context-update.js +2 -2
  47. package/dist/context/decorators/on-context-update.js.map +14 -3
  48. package/dist/context/decorators/provide-context.d.ts +5 -2
  49. package/dist/context/decorators/provide-context.js +2 -2
  50. package/dist/context/decorators/provide-context.js.map +14 -3
  51. package/dist/context/decorators/standard/consume-context.d.ts +2 -2
  52. package/dist/context/decorators/standard/consume-context.js +2 -2
  53. package/dist/context/decorators/standard/consume-context.js.map +9 -3
  54. package/dist/context/decorators/standard/context-selector-field.d.ts +2 -2
  55. package/dist/context/decorators/standard/context-selector-field.js +2 -2
  56. package/dist/context/decorators/standard/context-selector-field.js.map +10 -3
  57. package/dist/context/decorators/standard/context-selector.d.ts +2 -3
  58. package/dist/context/decorators/standard/context-selector.js +2 -2
  59. package/dist/context/decorators/standard/context-selector.js.map +10 -3
  60. package/dist/context/decorators/standard/provide-context.d.ts +2 -2
  61. package/dist/context/decorators/standard/provide-context.js +2 -2
  62. package/dist/context/decorators/standard/provide-context.js.map +10 -3
  63. package/dist/context/events.d.ts +18 -11
  64. package/dist/context/events.js +2 -2
  65. package/dist/context/events.js.map +4 -3
  66. package/dist/context/hydration-script.js +2 -2
  67. package/dist/context/hydration-script.js.map +6 -3
  68. package/dist/context/index.d.ts +8 -0
  69. package/dist/context/index.js +3 -0
  70. package/dist/context/index.js.map +35 -0
  71. package/dist/controller-registry.d.ts +28 -0
  72. package/dist/controller-registry.js +3 -0
  73. package/dist/controller-registry.js.map +11 -0
  74. package/dist/core/controller-metadata.d.ts +3 -0
  75. package/dist/core/controller-metadata.js +3 -0
  76. package/dist/core/controller-metadata.js.map +10 -0
  77. package/dist/core/custom-element-metadata.d.ts +11 -0
  78. package/dist/core/custom-element-metadata.js +2 -2
  79. package/dist/core/custom-element-metadata.js.map +4 -3
  80. package/dist/core/hydration-codec.d.ts +8 -1
  81. package/dist/core/hydration-codec.js +2 -2
  82. package/dist/core/hydration-codec.js.map +5 -3
  83. package/dist/core/radiant-component-ssr-registry.d.ts +13 -13
  84. package/dist/core/radiant-component-ssr-registry.js +2 -2
  85. package/dist/core/radiant-component-ssr-registry.js.map +4 -3
  86. package/dist/core/radiant-component-ssr.d.ts +3 -3
  87. package/dist/core/radiant-component-ssr.js +2 -2
  88. package/dist/core/radiant-component-ssr.js.map +8 -3
  89. package/dist/core/radiant-controller.d.ts +127 -0
  90. package/dist/core/radiant-controller.js +3 -0
  91. package/dist/core/radiant-controller.js.map +13 -0
  92. package/dist/core/radiant-element.d.ts +43 -41
  93. package/dist/core/radiant-element.js +2 -2
  94. package/dist/core/radiant-element.js.map +13 -3
  95. package/dist/core/radiant-hydrator-state.d.ts +1 -1
  96. package/dist/core/radiant-hydrator-state.js +2 -2
  97. package/dist/core/radiant-hydrator-state.js.map +4 -3
  98. package/dist/core/reactive-host.d.ts +137 -0
  99. package/dist/core/reactive-host.js +3 -0
  100. package/dist/core/reactive-host.js.map +10 -0
  101. package/dist/core/reactive-jsx-value.js +2 -2
  102. package/dist/core/reactive-jsx-value.js.map +4 -3
  103. package/dist/core/reactive-prop-metadata.js +2 -2
  104. package/dist/core/reactive-prop-metadata.js.map +4 -3
  105. package/dist/core/slot-projection-runtime.js +2 -2
  106. package/dist/core/slot-projection-runtime.js.map +6 -3
  107. package/dist/core/ssr-preparation.js +2 -2
  108. package/dist/core/ssr-preparation.js.map +4 -3
  109. package/dist/decorators/attr.d.ts +6 -0
  110. package/dist/decorators/attr.js +3 -0
  111. package/dist/decorators/attr.js.map +16 -0
  112. package/dist/decorators/bound.d.ts +4 -2
  113. package/dist/decorators/bound.js +2 -2
  114. package/dist/decorators/bound.js.map +7 -3
  115. package/dist/decorators/bridge.d.ts +11 -7
  116. package/dist/decorators/bridge.js +2 -2
  117. package/dist/decorators/bridge.js.map +4 -3
  118. package/dist/decorators/controller.d.ts +2 -0
  119. package/dist/decorators/controller.js +3 -0
  120. package/dist/decorators/controller.js.map +12 -0
  121. package/dist/decorators/custom-element.d.ts +4 -2
  122. package/dist/decorators/custom-element.js +2 -2
  123. package/dist/decorators/custom-element.js.map +7 -3
  124. package/dist/decorators/debounce.d.ts +5 -2
  125. package/dist/decorators/debounce.js +2 -2
  126. package/dist/decorators/debounce.js.map +8 -3
  127. package/dist/decorators/event.d.ts +5 -2
  128. package/dist/decorators/event.js +2 -2
  129. package/dist/decorators/event.js.map +10 -3
  130. package/dist/decorators/legacy/attr.d.ts +2 -0
  131. package/dist/decorators/legacy/attr.js +3 -0
  132. package/dist/decorators/legacy/attr.js.map +13 -0
  133. package/dist/decorators/legacy/bound.js +2 -2
  134. package/dist/decorators/legacy/bound.js.map +4 -3
  135. package/dist/decorators/legacy/custom-element.js +2 -2
  136. package/dist/decorators/legacy/custom-element.js.map +5 -3
  137. package/dist/decorators/legacy/debounce.js +2 -2
  138. package/dist/decorators/legacy/debounce.js.map +5 -3
  139. package/dist/decorators/legacy/event.js +2 -2
  140. package/dist/decorators/legacy/event.js.map +7 -3
  141. package/dist/decorators/legacy/instance-initializers.d.ts +3 -4
  142. package/dist/decorators/legacy/instance-initializers.js +2 -2
  143. package/dist/decorators/legacy/instance-initializers.js.map +4 -3
  144. package/dist/decorators/legacy/on-event.d.ts +2 -2
  145. package/dist/decorators/legacy/on-event.js +2 -2
  146. package/dist/decorators/legacy/on-event.js.map +6 -3
  147. package/dist/decorators/legacy/on-updated.d.ts +7 -2
  148. package/dist/decorators/legacy/on-updated.js +2 -2
  149. package/dist/decorators/legacy/on-updated.js.map +5 -3
  150. package/dist/decorators/legacy/query-slot.js +2 -2
  151. package/dist/decorators/legacy/query-slot.js.map +7 -3
  152. package/dist/decorators/legacy/query.d.ts +7 -2
  153. package/dist/decorators/legacy/query.js +2 -2
  154. package/dist/decorators/legacy/query.js.map +6 -3
  155. package/dist/decorators/legacy/reactive-field.d.ts +2 -2
  156. package/dist/decorators/legacy/reactive-field.js +2 -2
  157. package/dist/decorators/legacy/reactive-field.js.map +5 -3
  158. package/dist/decorators/legacy/reactive-prop.d.ts +10 -16
  159. package/dist/decorators/legacy/reactive-prop.js +2 -2
  160. package/dist/decorators/legacy/reactive-prop.js.map +7 -3
  161. package/dist/decorators/legacy/signal.d.ts +4 -3
  162. package/dist/decorators/legacy/signal.js +2 -2
  163. package/dist/decorators/legacy/signal.js.map +9 -3
  164. package/dist/decorators/on-event.d.ts +6 -3
  165. package/dist/decorators/on-event.js +2 -2
  166. package/dist/decorators/on-event.js.map +9 -3
  167. package/dist/decorators/on-updated.d.ts +12 -2
  168. package/dist/decorators/on-updated.js +2 -2
  169. package/dist/decorators/on-updated.js.map +8 -3
  170. package/dist/decorators/prop.d.ts +19 -7
  171. package/dist/decorators/prop.js +2 -2
  172. package/dist/decorators/prop.js.map +10 -3
  173. package/dist/decorators/query-slot.d.ts +11 -3
  174. package/dist/decorators/query-slot.js +2 -2
  175. package/dist/decorators/query-slot.js.map +10 -3
  176. package/dist/decorators/query.d.ts +9 -2
  177. package/dist/decorators/query.js +2 -2
  178. package/dist/decorators/query.js.map +9 -3
  179. package/dist/decorators/shared/reactive-attr.d.ts +25 -0
  180. package/dist/decorators/shared/reactive-attr.js +3 -0
  181. package/dist/decorators/shared/reactive-attr.js.map +11 -0
  182. package/dist/decorators/signal.d.ts +10 -4
  183. package/dist/decorators/signal.js +2 -2
  184. package/dist/decorators/signal.js.map +11 -3
  185. package/dist/decorators/standard/attr.d.ts +2 -0
  186. package/dist/decorators/standard/attr.js +3 -0
  187. package/dist/decorators/standard/attr.js.map +12 -0
  188. package/dist/decorators/standard/bound.js +2 -2
  189. package/dist/decorators/standard/bound.js.map +4 -3
  190. package/dist/decorators/standard/custom-element.js +2 -2
  191. package/dist/decorators/standard/custom-element.js.map +5 -3
  192. package/dist/decorators/standard/debounce.js +2 -2
  193. package/dist/decorators/standard/debounce.js.map +5 -3
  194. package/dist/decorators/standard/event.js +2 -2
  195. package/dist/decorators/standard/event.js.map +6 -3
  196. package/dist/decorators/standard/on-event.d.ts +2 -1
  197. package/dist/decorators/standard/on-event.js +2 -2
  198. package/dist/decorators/standard/on-event.js.map +5 -3
  199. package/dist/decorators/standard/on-updated.d.ts +5 -1
  200. package/dist/decorators/standard/on-updated.js +2 -2
  201. package/dist/decorators/standard/on-updated.js.map +4 -3
  202. package/dist/decorators/standard/query-slot.d.ts +1 -1
  203. package/dist/decorators/standard/query-slot.js +2 -2
  204. package/dist/decorators/standard/query-slot.js.map +5 -3
  205. package/dist/decorators/standard/query.d.ts +2 -1
  206. package/dist/decorators/standard/query.js +2 -2
  207. package/dist/decorators/standard/query.js.map +5 -3
  208. package/dist/decorators/standard/reactive-field.d.ts +2 -2
  209. package/dist/decorators/standard/reactive-field.js +2 -2
  210. package/dist/decorators/standard/reactive-field.js.map +4 -3
  211. package/dist/decorators/standard/reactive-prop.d.ts +13 -2
  212. package/dist/decorators/standard/reactive-prop.js +2 -2
  213. package/dist/decorators/standard/reactive-prop.js.map +6 -3
  214. package/dist/decorators/standard/signal.d.ts +4 -3
  215. package/dist/decorators/standard/signal.js +2 -2
  216. package/dist/decorators/standard/signal.js.map +8 -3
  217. package/dist/decorators/state.d.ts +6 -5
  218. package/dist/decorators/state.js +2 -2
  219. package/dist/decorators/state.js.map +8 -3
  220. package/dist/helpers/create-event-listener.d.ts +11 -2
  221. package/dist/helpers/create-event-listener.js +2 -2
  222. package/dist/helpers/create-event-listener.js.map +4 -3
  223. package/dist/helpers/create-event.js +2 -2
  224. package/dist/helpers/create-event.js.map +5 -3
  225. package/dist/helpers/create-query-slot.js +2 -2
  226. package/dist/helpers/create-query-slot.js.map +4 -3
  227. package/dist/helpers/create-query.d.ts +14 -3
  228. package/dist/helpers/create-query.js +2 -2
  229. package/dist/helpers/create-query.js.map +4 -3
  230. package/dist/helpers/debounce.js +2 -2
  231. package/dist/helpers/debounce.js.map +4 -3
  232. package/dist/helpers/index.js +2 -2
  233. package/dist/helpers/index.js.map +9 -3
  234. package/dist/index.d.ts +4 -14
  235. package/dist/index.js +2 -2
  236. package/dist/index.js.map +60 -3
  237. package/dist/server/context-ssr.js +2 -2
  238. package/dist/server/context-ssr.js.map +5 -3
  239. package/dist/server/html-parser.js +2 -2
  240. package/dist/server/html-parser.js.map +4 -3
  241. package/dist/server/install-light-dom-shim.js +2 -2
  242. package/dist/server/install-light-dom-shim.js.map +5 -3
  243. package/dist/server/light-dom-shim.js +2 -2
  244. package/dist/server/light-dom-shim.js.map +5 -3
  245. package/dist/server/project-root.js +2 -2
  246. package/dist/server/project-root.js.map +2 -2
  247. package/dist/server/radiant-component-ssr-runtime.d.ts +2 -2
  248. package/dist/server/radiant-component-ssr-runtime.js +2 -2
  249. package/dist/server/radiant-component-ssr-runtime.js.map +11 -3
  250. package/dist/server/render-component.d.ts +3 -13
  251. package/dist/server/render-component.js +2 -2
  252. package/dist/server/render-component.js.map +14 -4
  253. package/dist/server/render-controller.d.ts +57 -0
  254. package/dist/server/render-controller.js +3 -0
  255. package/dist/server/render-controller.js.map +23 -0
  256. package/dist/server/slot-projection-html.js +2 -2
  257. package/dist/server/slot-projection-html.js.map +7 -3
  258. package/dist/signals/host-resource.js +2 -2
  259. package/dist/signals/host-resource.js.map +2 -2
  260. package/dist/signals/host-signal.d.ts +4 -2
  261. package/dist/signals/host-signal.js +2 -2
  262. package/dist/signals/host-signal.js.map +7 -3
  263. package/dist/signals/hydration-script.js +2 -2
  264. package/dist/signals/hydration-script.js.map +6 -3
  265. package/dist/tools/escape-script-json.js +2 -2
  266. package/dist/tools/escape-script-json.js.map +4 -3
  267. package/dist/tools/event-emitter.js +2 -2
  268. package/dist/tools/event-emitter.js.map +4 -3
  269. package/dist/tools/index.js +2 -2
  270. package/dist/tools/index.js.map +7 -3
  271. package/dist/tools/render-jsx-template.js +2 -2
  272. package/dist/tools/render-jsx-template.js.map +4 -3
  273. package/dist/tools/stringify-typed.js +2 -2
  274. package/dist/tools/stringify-typed.js.map +4 -3
  275. package/dist/types.js +2 -2
  276. package/dist/types.js.map +2 -2
  277. package/dist/utils/attribute-utils.js +2 -2
  278. package/dist/utils/attribute-utils.js.map +4 -3
  279. package/dist/utils/index.js +2 -2
  280. package/dist/utils/index.js.map +4 -3
  281. package/package.json +26 -5
  282. package/size-budget.json +11 -2
  283. package/dist/chunk-0bswvy25.js +0 -4
  284. package/dist/chunk-0bswvy25.js.map +0 -10
  285. package/dist/chunk-0btkzzyc.js +0 -4
  286. package/dist/chunk-0btkzzyc.js.map +0 -10
  287. package/dist/chunk-0g0j9re6.js +0 -4
  288. package/dist/chunk-0g0j9re6.js.map +0 -10
  289. package/dist/chunk-1x26p09c.js +0 -4
  290. package/dist/chunk-1x26p09c.js.map +0 -10
  291. package/dist/chunk-21a7jask.js +0 -4
  292. package/dist/chunk-21a7jask.js.map +0 -10
  293. package/dist/chunk-21acj2eq.js +0 -4
  294. package/dist/chunk-21acj2eq.js.map +0 -10
  295. package/dist/chunk-25zjh0kg.js +0 -4
  296. package/dist/chunk-25zjh0kg.js.map +0 -10
  297. package/dist/chunk-30x4hggg.js +0 -4
  298. package/dist/chunk-30x4hggg.js.map +0 -10
  299. package/dist/chunk-3ynk7e1e.js +0 -4
  300. package/dist/chunk-3ynk7e1e.js.map +0 -10
  301. package/dist/chunk-5b1en9vz.js +0 -4
  302. package/dist/chunk-5b1en9vz.js.map +0 -10
  303. package/dist/chunk-5bkat72n.js +0 -4
  304. package/dist/chunk-5bkat72n.js.map +0 -10
  305. package/dist/chunk-5qeaq3tj.js +0 -4
  306. package/dist/chunk-5qeaq3tj.js.map +0 -10
  307. package/dist/chunk-66e6s792.js +0 -4
  308. package/dist/chunk-66e6s792.js.map +0 -10
  309. package/dist/chunk-79jg8q67.js +0 -4
  310. package/dist/chunk-79jg8q67.js.map +0 -10
  311. package/dist/chunk-8d5ddvvf.js +0 -4
  312. package/dist/chunk-8d5ddvvf.js.map +0 -10
  313. package/dist/chunk-8e9fgtbn.js +0 -4
  314. package/dist/chunk-8e9fgtbn.js.map +0 -10
  315. package/dist/chunk-9mqtp3js.js +0 -4
  316. package/dist/chunk-9mqtp3js.js.map +0 -10
  317. package/dist/chunk-9rj2rwes.js +0 -4
  318. package/dist/chunk-9rj2rwes.js.map +0 -10
  319. package/dist/chunk-atms6yrh.js +0 -4
  320. package/dist/chunk-atms6yrh.js.map +0 -10
  321. package/dist/chunk-bk2nbmcd.js +0 -4
  322. package/dist/chunk-bk2nbmcd.js.map +0 -10
  323. package/dist/chunk-bk6qkvfp.js +0 -4
  324. package/dist/chunk-bk6qkvfp.js.map +0 -10
  325. package/dist/chunk-c0qyz98c.js +0 -4
  326. package/dist/chunk-c0qyz98c.js.map +0 -10
  327. package/dist/chunk-c52qhh0j.js +0 -4
  328. package/dist/chunk-c52qhh0j.js.map +0 -10
  329. package/dist/chunk-cnyxrh9r.js +0 -4
  330. package/dist/chunk-cnyxrh9r.js.map +0 -10
  331. package/dist/chunk-cvz9mrxa.js +0 -4
  332. package/dist/chunk-cvz9mrxa.js.map +0 -10
  333. package/dist/chunk-dabagjk6.js +0 -4
  334. package/dist/chunk-dabagjk6.js.map +0 -10
  335. package/dist/chunk-e0r6ca2g.js +0 -4
  336. package/dist/chunk-e0r6ca2g.js.map +0 -10
  337. package/dist/chunk-e5jd9h6t.js +0 -4
  338. package/dist/chunk-e5jd9h6t.js.map +0 -10
  339. package/dist/chunk-eevw1j2q.js +0 -4
  340. package/dist/chunk-eevw1j2q.js.map +0 -10
  341. package/dist/chunk-ek664x1c.js +0 -4
  342. package/dist/chunk-ek664x1c.js.map +0 -10
  343. package/dist/chunk-eyw14d6y.js +0 -4
  344. package/dist/chunk-eyw14d6y.js.map +0 -10
  345. package/dist/chunk-fs4j94bk.js +0 -4
  346. package/dist/chunk-fs4j94bk.js.map +0 -10
  347. package/dist/chunk-g2z3mm6b.js +0 -4
  348. package/dist/chunk-g2z3mm6b.js.map +0 -10
  349. package/dist/chunk-g5n3m11h.js +0 -4
  350. package/dist/chunk-g5n3m11h.js.map +0 -10
  351. package/dist/chunk-gdkte2vd.js +0 -4
  352. package/dist/chunk-gdkte2vd.js.map +0 -10
  353. package/dist/chunk-gg74gdpv.js +0 -4
  354. package/dist/chunk-gg74gdpv.js.map +0 -10
  355. package/dist/chunk-gpv1n74a.js +0 -4
  356. package/dist/chunk-gpv1n74a.js.map +0 -10
  357. package/dist/chunk-h9k7crjc.js +0 -4
  358. package/dist/chunk-h9k7crjc.js.map +0 -10
  359. package/dist/chunk-hpzgnxgq.js +0 -4
  360. package/dist/chunk-hpzgnxgq.js.map +0 -10
  361. package/dist/chunk-hrjc8b1y.js +0 -4
  362. package/dist/chunk-hrjc8b1y.js.map +0 -10
  363. package/dist/chunk-hvy4zvcc.js +0 -4
  364. package/dist/chunk-hvy4zvcc.js.map +0 -10
  365. package/dist/chunk-hztr86b4.js +0 -4
  366. package/dist/chunk-hztr86b4.js.map +0 -10
  367. package/dist/chunk-j3v7rca5.js +0 -4
  368. package/dist/chunk-j3v7rca5.js.map +0 -10
  369. package/dist/chunk-j864sv4w.js +0 -4
  370. package/dist/chunk-j864sv4w.js.map +0 -10
  371. package/dist/chunk-jkb2y7c8.js +0 -4
  372. package/dist/chunk-jkb2y7c8.js.map +0 -10
  373. package/dist/chunk-kakpjgzf.js +0 -4
  374. package/dist/chunk-kakpjgzf.js.map +0 -10
  375. package/dist/chunk-kmebacvv.js +0 -4
  376. package/dist/chunk-kmebacvv.js.map +0 -10
  377. package/dist/chunk-knqsm6v3.js +0 -4
  378. package/dist/chunk-knqsm6v3.js.map +0 -10
  379. package/dist/chunk-mp2vtrkg.js +0 -4
  380. package/dist/chunk-mp2vtrkg.js.map +0 -10
  381. package/dist/chunk-mpsj3cjs.js +0 -4
  382. package/dist/chunk-mpsj3cjs.js.map +0 -10
  383. package/dist/chunk-n4p2542b.js +0 -4
  384. package/dist/chunk-n4p2542b.js.map +0 -10
  385. package/dist/chunk-nctznxyz.js +0 -4
  386. package/dist/chunk-nctznxyz.js.map +0 -10
  387. package/dist/chunk-ndw3hc3v.js +0 -4
  388. package/dist/chunk-ndw3hc3v.js.map +0 -10
  389. package/dist/chunk-nnnb6pac.js +0 -4
  390. package/dist/chunk-nnnb6pac.js.map +0 -10
  391. package/dist/chunk-nssj2x13.js +0 -4
  392. package/dist/chunk-nssj2x13.js.map +0 -10
  393. package/dist/chunk-nvr37vma.js +0 -4
  394. package/dist/chunk-nvr37vma.js.map +0 -10
  395. package/dist/chunk-p8k4g99a.js +0 -4
  396. package/dist/chunk-p8k4g99a.js.map +0 -10
  397. package/dist/chunk-pkszgjqf.js +0 -4
  398. package/dist/chunk-pkszgjqf.js.map +0 -10
  399. package/dist/chunk-q9z6tnzw.js +0 -4
  400. package/dist/chunk-q9z6tnzw.js.map +0 -10
  401. package/dist/chunk-qdz5sncz.js +0 -4
  402. package/dist/chunk-qdz5sncz.js.map +0 -10
  403. package/dist/chunk-qe0eww1n.js +0 -4
  404. package/dist/chunk-qe0eww1n.js.map +0 -10
  405. package/dist/chunk-r33zvvda.js +0 -4
  406. package/dist/chunk-r33zvvda.js.map +0 -10
  407. package/dist/chunk-rkh1vkb9.js +0 -4
  408. package/dist/chunk-rkh1vkb9.js.map +0 -10
  409. package/dist/chunk-rrg759ht.js +0 -4
  410. package/dist/chunk-rrg759ht.js.map +0 -10
  411. package/dist/chunk-s09s5ayx.js +0 -4
  412. package/dist/chunk-s09s5ayx.js.map +0 -10
  413. package/dist/chunk-sf4a2gy5.js +0 -4
  414. package/dist/chunk-sf4a2gy5.js.map +0 -10
  415. package/dist/chunk-ssnnxzrj.js +0 -4
  416. package/dist/chunk-ssnnxzrj.js.map +0 -10
  417. package/dist/chunk-t8xtvgyg.js +0 -4
  418. package/dist/chunk-t8xtvgyg.js.map +0 -10
  419. package/dist/chunk-v3ta7hnv.js +0 -4
  420. package/dist/chunk-v3ta7hnv.js.map +0 -10
  421. package/dist/chunk-v92hp9g0.js +0 -4
  422. package/dist/chunk-v92hp9g0.js.map +0 -10
  423. package/dist/chunk-vgtggzb6.js +0 -4
  424. package/dist/chunk-vgtggzb6.js.map +0 -9
  425. package/dist/chunk-vk48hgm4.js +0 -4
  426. package/dist/chunk-vk48hgm4.js.map +0 -10
  427. package/dist/chunk-w8s5fnsq.js +0 -4
  428. package/dist/chunk-w8s5fnsq.js.map +0 -10
  429. package/dist/chunk-wd23rn4q.js +0 -4
  430. package/dist/chunk-wd23rn4q.js.map +0 -10
  431. package/dist/chunk-wds4href.js +0 -4
  432. package/dist/chunk-wds4href.js.map +0 -10
  433. package/dist/chunk-wvd1ffe4.js +0 -4
  434. package/dist/chunk-wvd1ffe4.js.map +0 -10
  435. package/dist/chunk-wwbjz9k4.js +0 -4
  436. package/dist/chunk-wwbjz9k4.js.map +0 -10
  437. package/dist/chunk-x2k0ngpz.js +0 -4
  438. package/dist/chunk-x2k0ngpz.js.map +0 -10
  439. package/dist/chunk-x457d0ap.js +0 -4
  440. package/dist/chunk-x457d0ap.js.map +0 -10
  441. package/dist/chunk-xbhtzkre.js +0 -4
  442. package/dist/chunk-xbhtzkre.js.map +0 -10
  443. package/dist/chunk-y139ycfm.js +0 -4
  444. package/dist/chunk-y139ycfm.js.map +0 -10
  445. package/dist/chunk-z9kxfckm.js +0 -4
  446. package/dist/chunk-z9kxfckm.js.map +0 -10
  447. package/dist/chunk-zx5txex8.js +0 -4
  448. package/dist/chunk-zx5txex8.js.map +0 -10
  449. package/dist/chunk-zygdebw8.js +0 -4
  450. package/dist/chunk-zygdebw8.js.map +0 -10
  451. package/dist/core/radiant-component.d.ts +0 -113
  452. package/dist/core/radiant-component.js +0 -3
  453. package/dist/core/radiant-component.js.map +0 -9
package/dist/index.js.map CHANGED
@@ -1,9 +1,66 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
3
+ "sources": ["../src/decorators/legacy/instance-initializers.ts", "../src/core/reactive-host.ts", "../src/core/ssr-preparation.ts", "../src/tools/escape-script-json.ts", "../src/core/hydration-codec.ts", "../src/core/slot-projection-runtime.ts", "../src/core/radiant-hydrator-state.ts", "../src/core/radiant-component-ssr-registry.ts", "../src/utils/attribute-utils.ts", "../src/core/radiant-element.ts", "../src/core/radiant-controller.ts", "../src/core/controller-metadata.ts", "../src/controller-registry.ts", "../src/decorators/bridge.ts", "../src/decorators/shared/reactive-attr.ts", "../src/decorators/legacy/attr.ts", "../src/decorators/standard/attr.ts", "../src/decorators/attr.ts", "../src/decorators/legacy/bound.ts", "../src/decorators/standard/bound.ts", "../src/decorators/bound.ts", "../src/decorators/controller.ts", "../src/core/custom-element-metadata.ts", "../src/decorators/legacy/custom-element.ts", "../src/decorators/standard/custom-element.ts", "../src/decorators/custom-element.ts", "../src/helpers/debounce.ts", "../src/decorators/legacy/debounce.ts", "../src/decorators/standard/debounce.ts", "../src/decorators/debounce.ts", "../src/tools/event-emitter.ts", "../src/helpers/create-event.ts", "../src/decorators/legacy/event.ts", "../src/decorators/standard/event.ts", "../src/decorators/event.ts", "../src/helpers/create-event-listener.ts", "../src/decorators/legacy/on-event.ts", "../src/decorators/standard/on-event.ts", "../src/decorators/on-event.ts", "../src/decorators/legacy/on-updated.ts", "../src/decorators/standard/on-updated.ts", "../src/decorators/on-updated.ts", "../src/core/reactive-prop-metadata.ts", "../src/decorators/legacy/reactive-prop.ts", "../src/decorators/standard/reactive-prop.ts", "../src/decorators/prop.ts", "../src/helpers/create-query.ts", "../src/decorators/legacy/query.ts", "../src/decorators/standard/query.ts", "../src/decorators/query.ts", "../src/helpers/create-query-slot.ts", "../src/decorators/legacy/query-slot.ts", "../src/decorators/standard/query-slot.ts", "../src/decorators/query-slot.ts", "../src/decorators/legacy/reactive-field.ts", "../src/decorators/standard/reactive-field.ts", "../src/decorators/state.ts"],
4
4
  "sourcesContent": [
5
+ "type LegacyInstanceInitializer<T extends object = object> = (instance: T) => void;\n\nconst LEGACY_INSTANCE_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-instance-initializers');\n\n/**\n * Registers per-instance initialization work for a legacy decorator.\n *\n * Legacy decorators execute against the prototype, so any initialization that\n * needs the concrete element instance must be deferred until construction time.\n */\nexport function registerLegacyInstanceInitializer<T extends object>(\n\tproto: T,\n\tinitializer: LegacyInstanceInitializer<T>,\n): void {\n\tconst target = proto as Record<PropertyKey, unknown>;\n\tconst ownInitializers = target[LEGACY_INSTANCE_INITIALIZERS];\n\n\tif (Array.isArray(ownInitializers)) {\n\t\townInitializers.push(initializer);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(proto, LEGACY_INSTANCE_INITIALIZERS, {\n\t\tvalue: [initializer],\n\t\tconfigurable: true,\n\t});\n}\n\n/**\n * Runs all legacy decorator initializers for a newly constructed element.\n *\n * Initializers are collected from the prototype chain and executed from base to\n * derived class so inherited setup remains stable.\n */\nexport function runLegacyInstanceInitializers<T extends object>(instance: T): void {\n\tconst prototypes: object[] = [];\n\tlet currentPrototype = Object.getPrototypeOf(instance);\n\n\twhile (currentPrototype && currentPrototype !== Object.prototype) {\n\t\tprototypes.push(currentPrototype);\n\t\tcurrentPrototype = Object.getPrototypeOf(currentPrototype);\n\t}\n\n\tfor (let index = prototypes.length - 1; index >= 0; index -= 1) {\n\t\tconst initializers = (prototypes[index] as Record<PropertyKey, unknown>)[LEGACY_INSTANCE_INITIALIZERS] as\n\t\t\t| LegacyInstanceInitializer<T>[]\n\t\t\t| undefined;\n\n\t\tif (!Array.isArray(initializers)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const initializer of initializers) {\n\t\t\tinitializer(instance);\n\t\t}\n\t}\n}\n",
6
+ "import { createSubscribableJsxValue, type SubscribableJsxValue } from '@ecopages/jsx';\nimport { trackDependency, type DependencyNode, type SignalSubscriber } from '@ecopages/signals';\nimport type {\n\tReactiveBindingOption,\n\tReactiveBindingValue,\n\tReactiveBindings,\n\tReactiveFieldOptions,\n} from './radiant-element';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\n\ntype StringPropertyKey<Value> = Extract<keyof Value, string>;\ntype ReactiveDependencyReader = () => unknown;\n\ntype ReactiveHostAccess<Host extends object> = {\n\tdefineProperty(target: object, property: string, descriptor: PropertyDescriptor): void;\n\tgetBindingTarget?(host: Host): object;\n\thasProperty(host: Host, property: string): boolean;\n\treadProperty(host: Host, property: string): unknown;\n};\n\ntype ReactiveField<T = unknown> = {\n\tname: string;\n\tvalue: T;\n\tinitialValue: T;\n};\n\ntype ReactiveAccessorOptions<T> = {\n\tbind?: ReactiveBindingOption;\n\tgetValue: () => T | undefined;\n\tsetValue: (value: T) => void;\n\tnotifyInitialValue?: T;\n};\n\n/**\n * Shared reactive-host contract consumed by decorators and host adapters.\n *\n * `RadiantElement` and `RadiantController` both implement this surface so the\n * decorator layer can define fields, bindings, context reactions, and tracked\n * reads without depending on a specific host class.\n */\nexport interface ReactiveHostLike<Bindings extends object = {}> {\n\treadonly bindings: ReactiveBindings<Bindings>;\n\treadonly $: ReactiveBindings<Bindings>;\n\tbind<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n\tgetReactiveBinding<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n\tcreateReactiveField<T>(propertyName: string, initialValue: T, options?: ReactiveFieldOptions): void;\n\tdefineReactiveBinding(property: string, bind?: ReactiveBindingOption): void;\n\tnotifyUpdate(changedProperty: string, oldValue: unknown, value: unknown): void;\n\tregisterCleanupCallback(callback: () => void): void;\n\tregisterConnectedCallback(callback: () => void): void;\n\tregisterHydrationBinding(name: string, binding: SsrSerializableHydrationBinding): void;\n\tregisterReactiveDependencyReader(property: string, read: () => unknown): void;\n\ttrackReactiveRead(property: string): void;\n}\n\n/**\n * Internal dependency node that bridges Radiant host members into the signals\n * tracking graph.\n */\nclass ReactiveHostDependency implements DependencyNode {\n\tprivate readonly subscribers = new Set<SignalSubscriber<unknown>>();\n\tprivate readonly watcherListeners = new Set<() => void>();\n\tprivate version = 0;\n\n\tconstructor(private readonly read: ReactiveDependencyReader) {}\n\n\tpublic get(): unknown {\n\t\ttrackDependency(this);\n\t\treturn this.read();\n\t}\n\n\tpublic subscribe(notify: SignalSubscriber<unknown>): () => void {\n\t\tthis.subscribers.add(notify);\n\n\t\treturn () => {\n\t\t\tthis.subscribers.delete(notify);\n\t\t};\n\t}\n\n\tpublic addWatcher(notify: () => void): () => void {\n\t\tthis.watcherListeners.add(notify);\n\n\t\treturn () => {\n\t\t\tthis.watcherListeners.delete(notify);\n\t\t};\n\t}\n\n\tpublic getVersion(): number {\n\t\treturn this.version;\n\t}\n\n\tpublic notify(nextValue: unknown): void {\n\t\tthis.version += 1;\n\t\tlet watcherError: unknown;\n\n\t\ttry {\n\t\t\tthis.notifyWatchers();\n\t\t} catch (error) {\n\t\t\twatcherError = error;\n\t\t}\n\n\t\tthis.publish(nextValue);\n\n\t\tif (watcherError) {\n\t\t\tthrow watcherError;\n\t\t}\n\t}\n\n\tprivate publish(nextValue: unknown): void {\n\t\tfor (const subscriber of this.subscribers) {\n\t\t\tsubscriber(nextValue);\n\t\t}\n\t}\n\n\tprivate notifyWatchers(): void {\n\t\tconst errors: unknown[] = [];\n\n\t\tfor (const listener of this.watcherListeners) {\n\t\t\ttry {\n\t\t\t\tlistener();\n\t\t\t} catch (error) {\n\t\t\t\terrors.push(error);\n\t\t\t}\n\t\t}\n\n\t\tif (errors.length === 1) {\n\t\t\tthrow errors[0];\n\t\t}\n\n\t\tif (errors.length > 1) {\n\t\t\tthrow new AggregateError(errors, 'Multiple reactive dependency notifications failed.');\n\t\t}\n\t}\n}\n\nfunction isSignalLikeBindingValue(value: unknown): value is { get(): unknown } {\n\treturn typeof value === 'object' && value !== null && typeof (value as { get?: unknown }).get === 'function';\n}\n\n/**\n * Shared reactivity engine used by both `RadiantElement` and\n * `RadiantController`.\n *\n * This class owns three pieces of shared behavior:\n *\n * - defining reactive accessors on the host object\n * - exposing cached JSX bindings such as `bindings.count` and `$count`\n * - publishing tracked updates into the signals graph and update callbacks\n *\n * Host-specific concerns such as attribute reflection, render lifecycles, and\n * custom-element APIs stay in the outer host classes.\n */\nexport class ReactiveHost<Host extends object, Bindings extends object = {}> implements ReactiveHostLike<Bindings> {\n\tpublic readonly bindings: ReactiveBindings<Bindings>;\n\tpublic readonly $: ReactiveBindings<Bindings>;\n\n\tprivate reactiveFields = new Map<string, ReactiveField>();\n\tprivate reactiveDependencies = new Map<string, ReactiveHostDependency>();\n\tprivate reactiveDependencyReaders = new Map<string, ReactiveDependencyReader>();\n\tprivate reactiveBindings = new Map<string, SubscribableJsxValue>();\n\tprivate updateCallbacks = new Map<string, Set<(...rest: any[]) => any>>();\n\tprivate onConnectedCallbacks: (() => void)[] = [];\n\tprivate onDisconnectedCallback: (() => void)[] = [];\n\n\tconstructor(\n\t\tprivate readonly host: Host,\n\t\tprivate readonly access: ReactiveHostAccess<Host>,\n\t\tprivate readonly shouldAutoBind: () => boolean,\n\t) {\n\t\tconst bindingNamespace = this.createReactiveBindingNamespace();\n\t\tthis.bindings = bindingNamespace;\n\t\tthis.$ = bindingNamespace;\n\t}\n\n\t/**\n\t * Runs all connection callbacks registered by decorators or host adapters.\n\t */\n\tpublic connectHost(): void {\n\t\tfor (const callback of this.onConnectedCallbacks) {\n\t\t\tcallback();\n\t\t}\n\t}\n\n\t/**\n\t * Runs all cleanup callbacks registered for host disconnect.\n\t */\n\tpublic disconnectHost(): void {\n\t\tfor (const cleanup of this.onDisconnectedCallback) {\n\t\t\tcleanup();\n\t\t}\n\t}\n\n\t/**\n\t * Publishes a reactive member change to tracked dependencies and explicit\n\t * update callbacks.\n\t */\n\tpublic notifyUpdate(changedProperty: string, oldValue: unknown, value: unknown): void {\n\t\tif (oldValue === value) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.reactiveDependencies.get(changedProperty)?.notify(value);\n\t\tconst updates = this.updateCallbacks.get(changedProperty);\n\n\t\tif (updates) {\n\t\t\tfor (const update of updates) {\n\t\t\t\tupdate();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Registers a callback that should run when the outer host disconnects.\n\t */\n\tpublic registerCleanupCallback(callback: () => void): void {\n\t\tthis.onDisconnectedCallback.push(callback);\n\t}\n\n\t/**\n\t * Registers a callback that should run whenever the outer host connects.\n\t */\n\tpublic registerConnectedCallback(callback: () => void): void {\n\t\tthis.onConnectedCallbacks.push(callback);\n\t}\n\n\t/**\n\t * Placeholder hydration hook so shared decorators can target both host types.\n\t *\n\t * `ReactiveHost` itself does not persist hydration bindings; concrete hosts\n\t * such as `RadiantElement` can override this behavior at the outer layer.\n\t */\n\tpublic registerHydrationBinding(_name: string, _binding: SsrSerializableHydrationBinding): void {}\n\n\t/**\n\t * Registers a raw reader for a reactive member so tracked dependency reads do\n\t * not need to go back through the public accessor.\n\t */\n\tpublic registerReactiveDependencyReader(property: string, read: ReactiveDependencyReader): void {\n\t\tthis.reactiveDependencyReaders.set(property, read);\n\t}\n\n\t/**\n\t * Registers a callback that runs whenever a named reactive member changes.\n\t *\n\t * Returns a disposer that removes the callback.\n\t */\n\tpublic registerUpdateCallback(property: string, update: (...rest: any[]) => any): () => void {\n\t\tif (!this.updateCallbacks.has(property)) {\n\t\t\tthis.updateCallbacks.set(property, new Set());\n\t\t}\n\n\t\tconst callbacks = this.updateCallbacks.get(property)!;\n\t\tcallbacks.add(update);\n\n\t\treturn () => {\n\t\t\tcallbacks.delete(update);\n\n\t\t\tif (callbacks.size === 0) {\n\t\t\t\tthis.updateCallbacks.delete(property);\n\t\t\t}\n\t\t};\n\t}\n\n\t/**\n\t * Returns the cached JSX binding object for a named reactive member.\n\t */\n\tpublic getReactiveBinding<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>> {\n\t\tconst cachedBinding = this.reactiveBindings.get(property);\n\n\t\tif (cachedBinding) {\n\t\t\treturn cachedBinding as SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n\t\t}\n\n\t\tconst binding = createSubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>({\n\t\t\tgetValue: () => this.readReactiveBindingValue(property) as ReactiveBindingValue<Bindings, Property>,\n\t\t\tsubscribe: (notify) =>\n\t\t\t\tthis.registerUpdateCallback(property, () => {\n\t\t\t\t\tnotify(this.readReactiveBindingValue(property) as ReactiveBindingValue<Bindings, Property>);\n\t\t\t\t}),\n\t\t});\n\n\t\tthis.reactiveBindings.set(property, binding);\n\t\treturn binding;\n\t}\n\n\t/**\n\t * Short alias for `getReactiveBinding(...)`.\n\t */\n\tpublic bind<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>> {\n\t\treturn this.getReactiveBinding(property) as SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n\t}\n\n\t/**\n\t * Defines a stable binding companion property such as `$count` on the host or\n\t * its chosen binding target.\n\t */\n\tpublic defineReactiveBinding(property: string, bind: ReactiveBindingOption = true): void {\n\t\tconst bindingPropertyName = typeof bind === 'string' ? bind : bind ? `$${property}` : undefined;\n\t\tconst bindingTarget = this.access.getBindingTarget?.(this.host) ?? this.host;\n\n\t\tif (!bindingPropertyName || this.access.hasProperty(this.host, bindingPropertyName)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.access.defineProperty(bindingTarget, bindingPropertyName, {\n\t\t\tget: () => this.getReactiveBinding(property as StringPropertyKey<Bindings>),\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true,\n\t\t});\n\t}\n\n\t/**\n\t * Records a dependency read for the named reactive member.\n\t */\n\tpublic trackReactiveRead(property: string): void {\n\t\ttrackDependency(this.getReactiveDependency(property));\n\t}\n\n\t/**\n\t * Defines a reactive getter/setter pair on the host and wires it into\n\t * bindings, dependency tracking, and update notifications.\n\t */\n\tpublic defineReactiveAccessor<T>(propertyName: string, options: ReactiveAccessorOptions<T>): void {\n\t\tconst bind = options.bind ?? this.shouldAutoBind();\n\n\t\tthis.defineReactiveBinding(propertyName, bind);\n\t\tthis.registerReactiveDependencyReader(propertyName, options.getValue);\n\n\t\tthis.access.defineProperty(this.host, propertyName, {\n\t\t\tget: () => {\n\t\t\t\tthis.trackReactiveRead(propertyName);\n\t\t\t\treturn options.getValue();\n\t\t\t},\n\t\t\tset: (newValue: T) => {\n\t\t\t\tconst oldValue = options.getValue();\n\n\t\t\t\tif (oldValue === newValue) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\toptions.setValue(newValue);\n\t\t\t\tthis.notifyUpdate(propertyName, oldValue, newValue);\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\n\t\tif (options.notifyInitialValue !== undefined) {\n\t\t\tthis.notifyUpdate(propertyName, undefined, options.notifyInitialValue);\n\t\t}\n\t}\n\n\t/**\n\t * Defines a controller- or element-local reactive field with optional JSX\n\t * binding exposure.\n\t */\n\tpublic createReactiveField<T>(propertyName: string, initialValue: T, options: ReactiveFieldOptions = {}): void {\n\t\tconst reactiveField: ReactiveField<T> = {\n\t\t\tname: propertyName,\n\t\t\tvalue: initialValue,\n\t\t\tinitialValue,\n\t\t};\n\n\t\tthis.reactiveFields.set(propertyName, reactiveField);\n\n\t\tthis.defineReactiveAccessor(propertyName, {\n\t\t\tbind: options.bind,\n\t\t\tgetValue: () => this.reactiveFields.get(propertyName)?.value as T | undefined,\n\t\t\tsetValue: (newValue: T) => {\n\t\t\t\tthis.reactiveFields.set(propertyName, { ...reactiveField, value: newValue });\n\t\t\t},\n\t\t\tnotifyInitialValue: initialValue,\n\t\t});\n\t}\n\n\tprivate createReactiveBindingNamespace(): ReactiveBindings<Bindings> {\n\t\treturn new Proxy(Object.create(null) as ReactiveBindings<Bindings>, {\n\t\t\tget: (_target, property) => {\n\t\t\t\tif (typeof property !== 'string') {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn this.getReactiveBinding(property as StringPropertyKey<Bindings>);\n\t\t\t},\n\t\t}) as ReactiveBindings<Bindings>;\n\t}\n\n\tprivate getReactiveDependency(property: string): ReactiveHostDependency {\n\t\tconst cachedDependency = this.reactiveDependencies.get(property);\n\n\t\tif (cachedDependency) {\n\t\t\treturn cachedDependency;\n\t\t}\n\n\t\tconst dependency = new ReactiveHostDependency(() => this.readReactiveDependencyValue(property));\n\t\tthis.reactiveDependencies.set(property, dependency);\n\t\treturn dependency;\n\t}\n\n\tprivate readReactiveDependencyValue(property: string): unknown {\n\t\tconst reader = this.reactiveDependencyReaders.get(property);\n\n\t\tif (reader) {\n\t\t\treturn reader();\n\t\t}\n\n\t\treturn this.readReactiveBindingValue(property as StringPropertyKey<Bindings>);\n\t}\n\n\tprivate readReactiveBindingValue<Property extends StringPropertyKey<Bindings>>(property: Property): unknown {\n\t\tconst value = this.access.readProperty(this.host, property);\n\n\t\tif (isSignalLikeBindingValue(value)) {\n\t\t\treturn value.get();\n\t\t}\n\n\t\treturn value;\n\t}\n}\n",
7
+ "type SsrPreparationCallback = () => void;\n\nconst SSR_PREPARATION_CALLBACKS = Symbol.for('@ecopages/radiant.ssr-preparation-callbacks');\nexport const SSR_PREPARATION_RUNNING = Symbol.for('@ecopages/radiant.ssr-preparation-running');\n\n/**\n * Registers instance-local SSR preparation work that should run immediately\n * before a Radiant host serializes its first server render.\n *\n * Decorators use this to defer SSR-only setup until after class fields,\n * reactive props, and authored host content have all been applied.\n */\nexport function registerSsrPreparationCallback(host: object, callback: SsrPreparationCallback): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst existingCallbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (Array.isArray(existingCallbacks)) {\n\t\texistingCallbacks.push(callback);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(host, SSR_PREPARATION_CALLBACKS, {\n\t\tvalue: [callback],\n\t\tconfigurable: true,\n\t});\n}\n\n/**\n * Runs all registered SSR preparation callbacks for the provided host.\n *\n * The callbacks are intentionally retained so repeated SSR serializations stay\n * deterministic after later host mutations.\n */\nexport function runSsrPreparationCallbacks(host: object): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst callbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (!Array.isArray(callbacks)) {\n\t\treturn;\n\t}\n\n\ttarget[SSR_PREPARATION_RUNNING] = true;\n\n\ttry {\n\t\tfor (const callback of callbacks as SsrPreparationCallback[]) {\n\t\t\tcallback();\n\t\t}\n\t} finally {\n\t\tdelete target[SSR_PREPARATION_RUNNING];\n\t}\n}\n",
8
+ "/**\n * Escapes serialized JSON so it remains safe when embedded inside an HTML\n * `<script>` tag.\n */\nexport function escapeScriptJson(value: string): string {\n\treturn value\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n",
9
+ "import { escapeScriptJson } from '../tools/escape-script-json';\n\n/** Attribute marker used to identify hydration payloads inside a host. */\nexport const HYDRATION_ATTRIBUTE = 'data-hydration';\n/** Discriminator that scopes a hydration payload to a specific feature. */\nexport const HYDRATION_TYPE_ATTRIBUTE = 'data-hydration-type';\n/** Optional key that scopes a hydration payload to a specific decorated field. */\nexport const HYDRATION_KEY_ATTRIBUTE = 'data-hydration-key';\n\nexport type HydrationPayloadType = 'signal' | 'context';\n\ntype HydrationScriptHost = {\n\tchildren?: ArrayLike<Element> | undefined;\n\tchildNodes?: ArrayLike<{ nodeType: number }> | undefined;\n};\n\n/** Creates a `<script type=\"application/json\">` tag for a hydration payload. */\nexport function createHydrationScriptTag(options: {\n\ttype: HydrationPayloadType;\n\thydrationKey?: string;\n\tserializedValue: string;\n}): string {\n\tconst keyAttribute = options.hydrationKey\n\t\t? ` ${HYDRATION_KEY_ATTRIBUTE}=\"${escapeHtmlAttribute(options.hydrationKey)}\"`\n\t\t: '';\n\n\treturn `<script type=\"application/json\" ${HYDRATION_ATTRIBUTE} ${HYDRATION_TYPE_ATTRIBUTE}=\"${options.type}\"${keyAttribute}>${options.serializedValue}</script>`;\n}\n\n/** Escapes serialized JSON so it remains safe inside an HTML script tag. */\nexport function escapeHydrationJson(value: string): string {\n\treturn escapeScriptJson(value);\n}\n\n/** Parses JSON from a hydration script element, returning the fallback on failure. */\nexport function parseHydrationPayload<T>(element: Element, fallback: T): T {\n\tconst textContent = element.textContent;\n\n\tif (!textContent) {\n\t\treturn fallback;\n\t}\n\n\ttry {\n\t\treturn JSON.parse(textContent) as T;\n\t} catch {\n\t\tif (typeof console !== 'undefined') {\n\t\t\tconsole.warn(\n\t\t\t\t`[@ecopages/radiant] Failed to parse hydration payload from <script ${HYDRATION_ATTRIBUTE}>:`,\n\t\t\t\ttextContent.slice(0, 120),\n\t\t\t);\n\t\t}\n\t\treturn fallback;\n\t}\n}\n\n/**\n * Finds a hydration script element inside a host by type and optional key.\n *\n * When a key is provided, looks for an exact `data-hydration-key` match.\n * Otherwise, returns the first unkeyed script matching the type.\n */\nexport function findHydrationScript(\n\thost: HydrationScriptHost,\n\ttype: HydrationPayloadType,\n\thydrationKey?: string,\n): Element | null {\n\tconst children = host.children;\n\n\tif (!children || children.length === 0) {\n\t\tconst childNodes = (host as Partial<{ childNodes: ArrayLike<{ nodeType: number }> }>).childNodes;\n\n\t\tif (!childNodes || childNodes.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (let i = 0; i < childNodes.length; i += 1) {\n\t\t\tconst node = childNodes[i]!;\n\n\t\t\tif (node.nodeType !== 1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst element = node as unknown as Element;\n\n\t\t\tif (matchesHydrationScript(element, type, hydrationKey)) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tfor (let i = 0; i < children.length; i += 1) {\n\t\tif (matchesHydrationScript(children[i]!, type, hydrationKey)) {\n\t\t\treturn children[i]!;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nfunction matchesHydrationScript(element: Element, type: HydrationPayloadType, hydrationKey?: string): boolean {\n\tif (\n\t\telement.tagName !== 'SCRIPT' ||\n\t\t!element.hasAttribute(HYDRATION_ATTRIBUTE) ||\n\t\telement.getAttribute(HYDRATION_TYPE_ATTRIBUTE) !== type\n\t) {\n\t\treturn false;\n\t}\n\n\tif (hydrationKey !== undefined) {\n\t\treturn element.getAttribute(HYDRATION_KEY_ATTRIBUTE) === hydrationKey;\n\t}\n\n\treturn !element.hasAttribute(HYDRATION_KEY_ATTRIBUTE);\n}\n\nfunction escapeHtmlAttribute(value: string): string {\n\treturn value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n",
10
+ "import {\n\tcreateMarkupNodeLike,\n\tisKeyedJsxValue,\n\tisSlotJsxValue,\n\ttype JsxRenderable,\n\ttype KeyedJsxValue,\n\ttype SlotJsxValue,\n\ttype TemplateResultLike,\n} from '@ecopages/jsx';\n\nimport { HYDRATION_ATTRIBUTE } from './hydration-codec';\n\nexport const DEFAULT_SLOT_NAME = '';\nexport const SLOT_PROJECTION_SCRIPT_ATTRIBUTE = 'data-radiant-slot-projection';\n\ntype ResolvedSlotProjection = {\n\tcontainsSlots: boolean;\n\tvalue: JsxRenderable;\n};\n\nexport function captureProjectedSlotRenderables(host: HTMLElement): Map<string, JsxRenderable[]> {\n\tconst projectedContent = new Map<string, JsxRenderable[]>();\n\n\tfor (const node of Array.from(host.childNodes)) {\n\t\tif (isIgnoredProjectedNode(node)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tappendProjectedRenderable(projectedContent, getNodeSlotName(node), node);\n\t}\n\n\treturn projectedContent;\n}\n\nexport function deserializeProjectedSlotRenderables(payload: string): Map<string, JsxRenderable[]> {\n\tlet parsedPayload: Record<string, string[]>;\n\n\ttry {\n\t\tparsedPayload = JSON.parse(payload) as Record<string, string[]>;\n\t} catch {\n\t\tif (typeof console !== 'undefined') {\n\t\t\tconsole.warn('[@ecopages/radiant] Failed to parse slot projection payload:', payload.slice(0, 120));\n\t\t}\n\t\treturn new Map();\n\t}\n\n\tconst projectedContent = new Map<string, JsxRenderable[]>();\n\n\tfor (const [slotName, fragments] of Object.entries(parsedPayload)) {\n\t\tif (!Array.isArray(fragments) || fragments.length === 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tprojectedContent.set(\n\t\t\tnormalizeSlotName(slotName),\n\t\t\tfragments.map((fragment) => createMarkupNodeLike(fragment)),\n\t\t);\n\t}\n\n\treturn projectedContent;\n}\n\nexport function collectAuthoredHydrationScriptMarkup(host: HTMLElement): string | undefined {\n\tconst fragments = Array.from(host.childNodes)\n\t\t.filter((node): node is HTMLScriptElement => isHydrationScriptNode(node))\n\t\t.map((node) => renderableToHtmlFragment(node) ?? '')\n\t\t.filter((fragment) => fragment !== '');\n\n\treturn fragments.length > 0 ? fragments.join('') : undefined;\n}\n\nexport function serializeProjectedSlotRenderables(\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n): string | undefined {\n\tconst payload: Record<string, string[]> = {};\n\n\tfor (const [slotName, renderables] of projectedContent.entries()) {\n\t\tconst fragments = renderables\n\t\t\t.map((renderable) => renderableToHtmlFragment(renderable))\n\t\t\t.filter((fragment): fragment is string => fragment !== undefined && fragment !== '');\n\n\t\tif (fragments.length > 0) {\n\t\t\tpayload[slotName] = fragments;\n\t\t}\n\t}\n\n\treturn Object.keys(payload).length > 0 ? JSON.stringify(payload) : undefined;\n}\n\nexport function resolveSlotProjection(\n\tvalue: JsxRenderable,\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n): ResolvedSlotProjection {\n\tlet containsSlots = false;\n\n\tconst resolveValue = (currentValue: JsxRenderable): JsxRenderable => {\n\t\tif (isSlotJsxValue(currentValue)) {\n\t\t\tcontainsSlots = true;\n\t\t\treturn resolveSlotValue(currentValue, projectedContent, resolveValue);\n\t\t}\n\n\t\tif (isKeyedJsxValue(currentValue)) {\n\t\t\treturn cloneKeyedJsxValue(currentValue, resolveValue(currentValue.value));\n\t\t}\n\n\t\tif (isTemplateResultLike(currentValue)) {\n\t\t\treturn {\n\t\t\t\t_$rType$: 1,\n\t\t\t\trootLocalName: currentValue.rootLocalName,\n\t\t\t\tstrings: currentValue.strings,\n\t\t\t\tvalues: currentValue.values.map((entry) => resolveValue(entry as JsxRenderable)),\n\t\t\t} satisfies TemplateResultLike;\n\t\t}\n\n\t\tif (isIterableRenderable(currentValue)) {\n\t\t\treturn Array.from(currentValue, (entry) => resolveValue(entry as JsxRenderable));\n\t\t}\n\n\t\treturn currentValue;\n\t};\n\n\tconst resolvedValue = resolveValue(value);\n\n\treturn {\n\t\tcontainsSlots,\n\t\tvalue: resolvedValue,\n\t};\n}\n\nexport function takeSlotProjectionScriptPayload(host: HTMLElement): string | undefined {\n\tfor (const node of Array.from(host.childNodes)) {\n\t\tif (!isSlotProjectionScriptNode(node)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst payload = node.textContent ?? undefined;\n\t\tnode.parentNode?.removeChild(node);\n\t\treturn payload;\n\t}\n\n\treturn undefined;\n}\n\nfunction appendProjectedRenderable(\n\tprojectedContent: Map<string, JsxRenderable[]>,\n\tslotName: string,\n\trenderable: JsxRenderable,\n): void {\n\tconst existingRenderables = projectedContent.get(slotName);\n\n\tif (existingRenderables) {\n\t\texistingRenderables.push(renderable);\n\t\treturn;\n\t}\n\n\tprojectedContent.set(slotName, [renderable]);\n}\n\nfunction cloneKeyedJsxValue(value: KeyedJsxValue, nextValue: JsxRenderable): KeyedJsxValue {\n\treturn {\n\t\t...value,\n\t\tvalue: nextValue,\n\t};\n}\n\nfunction getNodeSlotName(node: Node): string {\n\tif (node instanceof Element) {\n\t\treturn normalizeSlotName(node.getAttribute('slot'));\n\t}\n\n\treturn DEFAULT_SLOT_NAME;\n}\n\nfunction isIterableRenderable(value: JsxRenderable): value is Iterable<JsxRenderable> {\n\treturn typeof value !== 'string' && typeof value === 'object' && value !== null && Symbol.iterator in value;\n}\n\nfunction isSlotProjectionScriptNode(node: Node): node is HTMLScriptElement {\n\treturn node instanceof HTMLScriptElement && node.hasAttribute(SLOT_PROJECTION_SCRIPT_ATTRIBUTE);\n}\n\nfunction isHydrationScriptNode(node: Node): node is HTMLScriptElement {\n\treturn node instanceof HTMLScriptElement && node.hasAttribute(HYDRATION_ATTRIBUTE);\n}\n\nfunction isIgnoredProjectedNode(node: Node): boolean {\n\treturn isSlotProjectionScriptNode(node) || isHydrationScriptNode(node);\n}\n\nfunction isTemplateResultLike(value: JsxRenderable): value is TemplateResultLike {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t(value as Partial<TemplateResultLike>)['_$rType$'] === 1 &&\n\t\tArray.isArray((value as Partial<TemplateResultLike>).strings) &&\n\t\tArray.isArray((value as Partial<TemplateResultLike>).values)\n\t);\n}\n\nfunction normalizeSlotName(name: string | undefined | null): string {\n\treturn name ?? DEFAULT_SLOT_NAME;\n}\n\nfunction renderableToHtmlFragment(renderable: JsxRenderable): string | undefined {\n\tif (renderable === undefined || renderable === null || renderable === false || renderable === true) {\n\t\treturn undefined;\n\t}\n\n\tif (typeof Node !== 'undefined' && renderable instanceof Node) {\n\t\tif (renderable.nodeType === Node.TEXT_NODE) {\n\t\t\treturn renderable.textContent ?? '';\n\t\t}\n\n\t\treturn (renderable as Element).outerHTML ?? renderable.textContent ?? undefined;\n\t}\n\n\tif (isKeyedJsxValue(renderable)) {\n\t\treturn renderableToHtmlFragment(renderable.value);\n\t}\n\n\tif (typeof renderable === 'string' || typeof renderable === 'number' || typeof renderable === 'bigint') {\n\t\treturn String(renderable);\n\t}\n\n\tif (typeof renderable === 'object' && renderable !== null && 'outerHTML' in renderable) {\n\t\treturn typeof renderable.outerHTML === 'string' ? renderable.outerHTML : (renderable.textContent ?? undefined);\n\t}\n\n\tif (isIterableRenderable(renderable)) {\n\t\treturn Array.from(renderable, (entry) => renderableToHtmlFragment(entry as JsxRenderable) ?? '').join('');\n\t}\n\n\treturn undefined;\n}\n\nfunction resolveSlotValue(\n\tvalue: SlotJsxValue,\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n\tresolveValue: (value: JsxRenderable) => JsxRenderable,\n): JsxRenderable {\n\tconst assignedContent = projectedContent.get(normalizeSlotName(value.name));\n\n\tif (assignedContent && assignedContent.length > 0) {\n\t\treturn assignedContent.length === 1 ? assignedContent[0] : (assignedContent as JsxRenderable);\n\t}\n\n\tif (value.fallback === undefined) {\n\t\treturn '';\n\t}\n\n\treturn resolveValue(value.fallback);\n}\n",
11
+ "const RADIANT_HYDRATOR_INSTALLED_SYMBOL = Symbol.for('@ecopages/radiant.hydrator-installed');\n\ntype GlobalHydratorState = typeof globalThis & Record<PropertyKey, unknown>;\n\n/**\n * Marks the current JavaScript environment as hydration-enabled for first\n * custom-element connect.\n *\n * `RadiantElement` reads this flag before deciding whether SSR markup should\n * hydrate in place or be replaced by a fresh client render.\n */\nexport function installRadiantHydratorState(): void {\n\t(globalThis as GlobalHydratorState)[RADIANT_HYDRATOR_INSTALLED_SYMBOL] = true;\n}\n\n/**\n * Clears the explicit hydration-enabled flag from `globalThis`.\n *\n * This is mainly used by tests so they can assert both hydrated and non-\n * hydrated first-connect behavior deterministically.\n */\nexport function uninstallRadiantHydratorState(): void {\n\tdelete (globalThis as GlobalHydratorState)[RADIANT_HYDRATOR_INSTALLED_SYMBOL];\n}\n\n/**\n * Returns whether first-connect hydration is currently enabled for this\n * JavaScript environment.\n */\nexport function isRadiantHydratorInstalled(): boolean {\n\treturn (globalThis as GlobalHydratorState)[RADIANT_HYDRATOR_INSTALLED_SYMBOL] === true;\n}\n",
12
+ "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\n\n/**\n * Optional SSR hooks exposed by `RadiantElement` instances to the shared\n * server runtime.\n *\n * The bridge lets the runtime detect whether a component is still using the\n * inherited host SSR implementation or has taken ownership of host rendering\n * through explicit overrides.\n */\nexport type RadiantElementRenderBridge = {\n\trenderHost?: () => JsxRenderable;\n\trenderHostToString?: (options?: RenderToStringOptions) => string;\n};\n\n/**\n * Runtime shape required by the shared Radiant SSR helpers.\n *\n * This is intentionally narrower than `RadiantElement` itself so the server\n * runtime can stay decoupled from the full client base-class implementation.\n */\nexport type RadiantElementSsrCapable = HTMLElement & {\n\tresolveSsrRenderBridge?: () => RadiantElementRenderBridge;\n\tgetHostSsrAttributes?: () => Record<string, string>;\n\trenderToString(options?: RenderToStringOptions): string;\n\trenderHost?(): JsxRenderable;\n\trenderHostToString(options?: RenderToStringOptions): string;\n};\n\n/**\n * Shared SSR runtime contract registered on `globalThis`.\n *\n * Server entrypoints install one implementation that both direct component SSR\n * and nested JSX custom-element SSR can reuse without importing client-only\n * internals into every call site.\n */\nexport type RadiantElementSsrRuntime = {\n\tgetHostAttributes(component: RadiantElementSsrCapable): Record<string, string>;\n\trenderHost(component: RadiantElementSsrCapable): JsxRenderable;\n\trenderHostToString(component: RadiantElementSsrCapable, options?: RenderToStringOptions): string;\n\tresolveRenderBridge(component: RadiantElementSsrCapable): RadiantElementRenderBridge | undefined;\n\trenderView(component: RadiantElementSsrCapable, options?: RenderToStringOptions): string;\n};\n\nconst RADIANT_COMPONENT_SSR_RUNTIME_SYMBOL = Symbol.for('@ecopages/radiant.component-ssr-runtime');\n\ntype GlobalSsrRuntimeState = typeof globalThis & {\n\t[RADIANT_COMPONENT_SSR_RUNTIME_SYMBOL]?: RadiantElementSsrRuntime;\n};\n\n/**\n * Reads the currently registered Radiant SSR runtime from `globalThis`.\n *\n * Returns `undefined` when no server entrypoint has installed the runtime yet.\n */\nexport function getRadiantElementSsrRuntime(): RadiantElementSsrRuntime | undefined {\n\treturn (globalThis as GlobalSsrRuntimeState)[RADIANT_COMPONENT_SSR_RUNTIME_SYMBOL];\n}\n\n/**\n * Registers the shared Radiant SSR runtime on `globalThis`.\n *\n * The latest registration wins, which keeps server adapters free to install\n * the runtime eagerly from their own explicit entrypoint.\n */\nexport function registerRadiantElementSsrRuntime(runtime: RadiantElementSsrRuntime): void {\n\t(globalThis as GlobalSsrRuntimeState)[RADIANT_COMPONENT_SSR_RUNTIME_SYMBOL] = runtime;\n}\n",
13
+ "import type { RadiantElement } from '../core/radiant-element';\n\nexport type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n\tswitch (constant) {\n\t\tcase Array:\n\t\t\treturn 'array';\n\t\tcase Boolean:\n\t\t\treturn 'boolean';\n\t\tcase Number:\n\t\t\treturn 'number';\n\t\tcase Object:\n\t\t\treturn 'object';\n\t\tcase String:\n\t\t\treturn 'string';\n\t}\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n\tswitch (typeof defaultValue) {\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t}\n\n\tif (Array.isArray(defaultValue)) return 'array';\n\tif (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n\tswitch (type) {\n\t\tcase Number:\n\t\t\treturn 0;\n\t\tcase String:\n\t\t\treturn '';\n\t\tcase Boolean:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\tthrow new TypeError('Invalid JSON string');\n\t}\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n\tarray(value: string): unknown[] {\n\t\tconst array = parseJSON<unknown[]>(value);\n\t\tif (!Array.isArray(array)) {\n\t\t\tthrow new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n\t\t}\n\t\treturn array;\n\t},\n\n\tboolean(value: string): boolean {\n\t\treturn !(value === '0' || String(value).toLowerCase() === 'false');\n\t},\n\n\tnumber(value: string): number {\n\t\tconst number = Number(value.replace(/_/g, ''));\n\t\treturn number;\n\t},\n\n\tobject(value: string): object {\n\t\tconst object = JSON.parse(value);\n\t\tif (object === null || typeof object !== 'object' || Array.isArray(object)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n\t\t\t\t\tobject,\n\t\t\t\t)}\"`,\n\t\t\t);\n\t\t}\n\t\treturn object;\n\t},\n\n\tstring(value: string): string {\n\t\treturn value;\n\t},\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n\tdefault: writeString,\n\tarray: writeJSON,\n\tobject: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n\treturn JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n\treturn `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n\tconst readerType = parseAttributeTypeConstant(type);\n\tif (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\treturn readers[readerType]!(value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n\tconst writerType = parseAttributeTypeConstant(type);\n\tif (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\tconst writer: Writer = writers[writerType] ?? writers.default ?? writeString;\n\treturn writer(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n\treturn typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n\tswitch (type) {\n\t\tcase Boolean:\n\t\t\treturn isBoolean(defaultValue);\n\t\tcase Number:\n\t\t\treturn isNumber(defaultValue);\n\t\tcase String:\n\t\t\treturn isString(defaultValue);\n\t\tcase Array:\n\t\t\treturn isArray(defaultValue);\n\t\tcase Object:\n\t\t\treturn isObject(defaultValue);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const getInitialValue = (\n\ttarget: RadiantElement,\n\ttype: AttributeTypeConstant,\n\tattributeKey: string,\n\tdefaultValue: unknown,\n) => {\n\tif (type === Boolean) {\n\t\tconst attributeValue = target.getAttribute(attributeKey);\n\t\tif (attributeValue === null) {\n\t\t\treturn defaultValue;\n\t\t}\n\n\t\treturn attributeValue === '' ? true : readAttributeValue(attributeValue, type);\n\t}\n\n\tconst attributeValue = target.getAttribute(attributeKey);\n\treturn attributeValue !== null\n\t\t? readAttributeValue(attributeValue, type)\n\t\t: (defaultValue ?? (defaultValueForType(type) as typeof defaultValue));\n};\n",
14
+ "import type { EventEmitter } from '../tools';\nimport {\n\thasHydrationMarkers,\n\thydrate as hydrateJsx,\n\tjsx,\n\trender as renderJsx,\n\ttype JsxRenderable,\n\ttype SubscribableJsxValue,\n} from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport { Computed, subtle } from '@ecopages/signals';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport type { UnknownContext } from '../context/types';\nimport { runLegacyInstanceInitializers } from '../decorators/legacy/instance-initializers';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\nimport { ReactiveHost } from './reactive-host';\nimport { runSsrPreparationCallbacks } from './ssr-preparation';\nimport {\n\tDEFAULT_SLOT_NAME,\n\tSLOT_PROJECTION_SCRIPT_ATTRIBUTE,\n\tcollectAuthoredHydrationScriptMarkup,\n\tcaptureProjectedSlotRenderables,\n\tdeserializeProjectedSlotRenderables,\n\tresolveSlotProjection,\n\tserializeProjectedSlotRenderables,\n\ttakeSlotProjectionScriptPayload,\n} from './slot-projection-runtime';\nimport { HYDRATION_ATTRIBUTE } from './hydration-codec';\nimport { isRadiantHydratorInstalled } from './radiant-hydrator-state';\nimport {\n\tgetRadiantElementSsrRuntime,\n\ttype RadiantElementRenderBridge,\n\ttype RadiantElementSsrCapable,\n} from './radiant-component-ssr-registry';\nimport {\n\ttype AttributeTypeConstant,\n\ttype ReadAttributeValueReturnType,\n\ttype WriteAttributeValueReturnType,\n\tgetInitialValue,\n\tisValueOfType,\n\treadAttributeValue,\n\twriteAttributeValue,\n} from '../utils/attribute-utils';\n\nconst RadiantElementBase = resolveRadiantElementBase();\n\nfunction resolveRadiantElementBase(): typeof HTMLElement {\n\tif (typeof HTMLElement !== 'undefined') {\n\t\treturn HTMLElement;\n\t}\n\n\tthrow new Error(\n\t\t\"RadiantElement requires HTMLElement. Install '@ecopages/radiant/server/light-dom-shim' before importing Radiant components in SSR.\",\n\t);\n}\n\n/**\n * Possible positions to insert a rendered template.\n */\nexport type RenderInsertPosition = 'replace' | 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';\n\n/**\n * Represents a Radiant element event listener.\n */\nexport type RadiantElementEventListener = {\n\tselector: string;\n\ttype: string;\n\tlistener: EventListener;\n\toptions?: AddEventListenerOptions;\n};\n\n/**\n * Represents a property metadata object.\n */\nexport interface ReactiveProperty<T = unknown> {\n\ttype: AttributeTypeConstant;\n\tvalue?: T;\n\tinitialValue?: T;\n\tname: string;\n\tattribute: string;\n\tconverter: {\n\t\tfromAttribute: (value: string) => ReadAttributeValueReturnType;\n\t\ttoAttribute: (value: any) => WriteAttributeValueReturnType;\n\t};\n}\n\n/**\n * Represents the options for a reactive property.\n */\nexport type ReactivePropertyOptions<T> = {\n\ttype: AttributeTypeConstant;\n\treflect?: boolean;\n\tattribute?: string;\n\tdefaultValue?: T;\n\t/**\n\t * Exposes a JSX binding companion for the reactive property.\n\t *\n\t * - `true` creates a `$propertyName` accessor.\n\t * - a string creates a custom accessor with that name.\n\t * - `undefined` defers to the host default.\n\t *\n\t * The generated accessor returns a subscribable JSX child value so JSX can\n\t * patch only the affected child part when the property changes.\n\t */\n\tbind?: boolean | string;\n};\n\nexport type ReactiveBindingOption = boolean | string;\n\nexport type ReactiveFieldOptions = {\n\t/**\n\t * Exposes a JSX binding companion for the reactive field.\n\t *\n\t * - `true` creates a `$fieldName` accessor.\n\t * - a string creates a custom accessor with that name.\n\t * - `undefined` defers to the host default.\n\t */\n\tbind?: ReactiveBindingOption;\n};\n\nexport type ReactiveField<T = unknown> = {\n\tname: string;\n\tvalue: T;\n\tinitialValue: T;\n};\n\ntype StringPropertyKey<Value> = Extract<keyof Value, string>;\n\n/**\n * Value type produced by a JSX binding for a selected reactive member.\n *\n * Bindings preserve the original property type when it is already renderable by\n * the Ecopages JSX runtime. For non-renderable values, the binding falls back\n * to the broader `JsxRenderable` contract consumed by the renderer.\n */\nexport type ReactiveBindingValue<\n\tHost extends object,\n\tProperty extends StringPropertyKey<Host>,\n> = Host[Property] extends JsxRenderable ? Host[Property] : JsxRenderable;\n\n/**\n * Namespace of cached JSX bindings keyed by the explicit bindable shape.\n *\n * Radiant exposes this namespace twice on every host:\n *\n * - `host.bindings.key` for the explicit form\n * - `host.$.key` for the short form\n *\n * Both aliases resolve through the same cached binding objects as\n * `host.bind('key')`.\n */\nexport type ReactiveBindings<Bindings extends object> = {\n\treadonly [Property in StringPropertyKey<Bindings>]: SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n};\n\n/**\n * Represents an interface for a Radiant element.\n * @typeParam Bindings - Explicit internal bindable shape used to type `bind()` and `getReactiveBinding()`.\n *\n * This shape describes which reactive members are exposed through `bindings`,\n * `$`, and `bind(...)`. It does not automatically define the public JSX\n * attribute contract for the custom element.\n */\nexport interface IRadiantElement<Bindings extends object = {}> {\n\t/**\n\t * Namespace of cached JSX bindings keyed by the explicit bindable shape.\n\t */\n\treadonly bindings: ReactiveBindings<Bindings>;\n\n\t/**\n\t * Short alias for {@link bindings}.\n\t */\n\treadonly $: ReactiveBindings<Bindings>;\n\n\t/**\n\t * Called when a property of the element is updated.\n\t * @param changedProperty - The name of the changed property.\n\t * @param oldValue - The old value of the property.\n\t * @param newValue - The new value of the property.\n\t */\n\tnotifyUpdate(changedProperty: string, oldValue: unknown, newValue: unknown): void;\n\n\t/**\n\t * Subscribes to a Radiant element event.\n\t * @param event - The event listener to subscribe to.\n\t */\n\tsubscribeEvent(event: RadiantElementEventListener): void;\n\n\t/**\n\t * Registers a callback to be invoked when a reactive property or field changes.\n\t *\n\t * @returns A cleanup function that unregisters the callback.\n\t */\n\tregisterUpdateCallback(property: string, update: (...rest: any[]) => any): () => void;\n\n\t/**\n\t * Returns a subscribable JSX child binding for a reactive property or field.\n\t *\n\t * Prefer `this.bindings.key` or `this.$.key` in JSX render code when you want\n\t * property access syntax without string literals.\n\t */\n\tbind<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n\n\t/**\n\t * Returns a subscribable JSX child binding for a reactive property or field.\n\t *\n\t * This is the primitive lookup used by `bind()`, `bindings.key`, and `$.key`.\n\t */\n\tgetReactiveBinding<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n\n\t/**\n\t * Defines a stable JSX binding companion accessor for a reactive member.\n\t *\n\t * Companion bindings create properties such as `$count` directly on the host.\n\t * Prefer the `bindings` or `$` namespace for new code when you want typed,\n\t * explicit access to the configured bindable shape.\n\t */\n\tdefineReactiveBinding(property: string, bind?: ReactiveBindingOption): void;\n\n\t/**\n\t * Subscribes to multiple Radiant element events.\n\t * @param events - The array of event listeners to subscribe to.\n\t */\n\tsubscribeEvents(events: RadiantElementEventListener[]): void;\n\n\t/**\n\t * It adds a callback to be executed when the Radiant element is disconnected from the DOM.\n\t */\n\tregisterCleanupCallback(callback: () => void): void;\n\n\t/**\n\t * Registers a callback to run on each future host connection.\n\t *\n\t * The callback is only invoked from `connectedCallback()`. Registering it\n\t * after the host is already connected does not invoke it immediately.\n\t */\n\tregisterConnectedCallback(callback: () => void): void;\n\n\t/**\n\t * Registers a raw value reader for a reactive member so that tracked render\n\t * dependencies can read the underlying value without triggering the public\n\t * getter's dependency tracking.\n\t */\n\tregisterReactiveDependencyReader(property: string, read: () => unknown): void;\n\n\t/**\n\t * Records a tracked read of a reactive member during a component render,\n\t * allowing the signals runtime to re-render only the affected parts.\n\t */\n\ttrackReactiveRead(property: string): void;\n\n\t/**\n\t * Renders a trusted HTML template string into the specified target element.\n\t *\n\t * **Security:** The `template` string is written to the DOM via `innerHTML`\n\t * or `insertAdjacentHTML` without built-in sanitization. Callers are\n\t * responsible for ensuring the input is trusted. Supply a `sanitize`\n\t * function to transform the template before insertion.\n\t *\n\t * @param options - The rendering options.\n\t * @param options.target - The target element to render the template into.\n\t * @param options.template - The template string to render.\n\t * @param options.insert - The position to insert the rendered template. (optional)\n\t * @param options.sanitize - An optional function that transforms the template string before insertion.\n\t */\n\trenderTemplate(options: {\n\t\ttarget: HTMLElement;\n\t\ttemplate: string;\n\t\tinsert?: RenderInsertPosition;\n\t\tsanitize?: (html: string) => string;\n\t}): void;\n\n\t/**\n\t * Called when the Radiant element is connected to a context.\n\t * @param context - The connected context.\n\t */\n\tconnectedContextCallback(context: UnknownContext): void;\n\n\t/**\n\t * Gets a reference to a child element by its data-ref attribute.\n\t * @param ref - The data-ref attribute value of the element to get.\n\t * @param all - Whether to get all elements with the specified data-ref attribute value.\n\t * @returns The element with the specified data-ref attribute value, an array of elements or null if no element was found.\n\t */\n\tgetRef<T extends Element = Element>(ref: string, all: true): T[];\n\tgetRef<T extends Element = Element>(ref: string, all?: false): T | null;\n}\n\n/**\n * A base class for creating custom elements with reactive properties and event subscriptions.\n * @typeParam Bindings - Explicit internal bindable shape. Include only the\n * prop/state keys that JSX bindings should accept.\n *\n * Prefer a separate public props type for custom-element JSX declarations when\n * the external attribute contract differs from the component's internal\n * reactive state. Reuse the same type only when the public props and bindable\n * members are intentionally identical.\n * @extends HTMLElement\n * @implements IRadiantElement<Bindings>\n */\nexport class RadiantElement<Bindings extends object = {}>\n\textends RadiantElementBase\n\timplements IRadiantElement<Bindings>\n{\n\tpublic readonly bindings: ReactiveBindings<Bindings>;\n\tpublic readonly $: ReactiveBindings<Bindings>;\n\tprivate readonly reactiveHost: ReactiveHost<this, Bindings>;\n\n\t/**\n\t * A map of property metadata objects, it contains useful information about the properties configured via decorators.\n\t */\n\tprivate reactiveProperties = new Map<string, ReactiveProperty>();\n\n\t/**\n\t * Registered context providers keyed by decorated property name.\n\t */\n\tprivate contextProviders = new Map<string, SsrSerializableContextProvider>();\n\n\t/**\n\t * Registered keyed hydration payload producers appended to SSR host output.\n\t */\n\tprivate hydrationBindings = new Map<string, SsrSerializableHydrationBinding>();\n\n\t/**\n\t * A map of event subscriptions used to manage event listeners on the Radiant element.\n\t */\n\tprivate eventSubscriptions = new Map<string, RadiantElementEventListener>();\n\n\t/**\n\t * A map for event emitters\n\t */\n\tprivate eventEmitters = new Map<string, EventEmitter>();\n\n\t/**\n\t * A flag indicating whether the element has been connected to the DOM.\n\t */\n\tprivate elementReady = false;\n\tprivate isRendering = false;\n\tprivate isFirstConnectPending = false;\n\tprivate isRenderScheduled = false;\n\tprivate needsRender = false;\n\tprivate projectedSlotContent = new Map<string, JsxRenderable[]>();\n\tprivate renderSignal?: Computed<{ containsSlots: boolean; value: JsxRenderable }>;\n\tprivate readonly renderWatcher = new subtle.Watcher(() => {\n\t\tthis.requestUpdate();\n\t});\n\tprivate slotProjectionObserver?: MutationObserver;\n\tprivate slotProjectionVersion = 0;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.reactiveHost = new ReactiveHost<this, Bindings>(\n\t\t\tthis,\n\t\t\t{\n\t\t\t\tdefineProperty: (target, property, descriptor) => Object.defineProperty(target, property, descriptor),\n\t\t\t\tgetBindingTarget: (target) => Object.getPrototypeOf(target) ?? target,\n\t\t\t\thasProperty: (target, property) => property in target,\n\t\t\t\treadProperty: (target, property) => (target as Record<string, unknown>)[property],\n\t\t\t},\n\t\t\t() => this.shouldAutoBindReactiveMembers(),\n\t\t);\n\t\tthis.bindings = this.reactiveHost.bindings;\n\t\tthis.$ = this.reactiveHost.$;\n\t\trunLegacyInstanceInitializers(this);\n\t}\n\n\tconnectedCallback() {\n\t\tconst isReconnectDuringPendingFirstConnect = this.isFirstConnectPending;\n\n\t\tthis.elementReady = true;\n\n\t\tthis.reactiveHost.connectHost();\n\n\t\tif (isReconnectDuringPendingFirstConnect) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isFirstConnectPending = true;\n\n\t\tqueueMicrotask(() => {\n\t\t\tthis.isFirstConnectPending = false;\n\n\t\t\tif (!this.isConnected) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this.shouldRunRenderLifecycle()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.ensureSlotProjectionState();\n\t\t\tthis.observeSlotProjection();\n\n\t\t\tif (shouldHydrateOnConnect(this)) {\n\t\t\t\tthis.needsRender = false;\n\t\t\t\tthis.hydrate();\n\n\t\t\t\tif (this.needsRender) {\n\t\t\t\t\tthis.update();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.update();\n\t\t});\n\t}\n\n\tconnectedContextCallback(_contextName: UnknownContext): void {}\n\n\tdisconnectedCallback() {\n\t\tthis.disconnectSlotProjectionObserver();\n\t\tthis.disconnectRenderWatcher();\n\t\tthis.removeAllSubscribedEvents();\n\t\tthis.reactiveHost.disconnectHost();\n\t}\n\n\tpublic notifyUpdate(changedProperty: string, oldValue: unknown, value: unknown) {\n\t\tthis.reactiveHost.notifyUpdate(changedProperty, oldValue, value);\n\t}\n\n\tprivate transformAttributeValue(value: string | null, config: any): unknown {\n\t\treturn value !== null ? config?.converter.fromAttribute(value) : value;\n\t}\n\n\tattributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n\t\tif (oldValue === newValue || !this.elementReady) return;\n\n\t\tif (this.reactiveProperties.has(name)) {\n\t\t\tconst config = this.reactiveProperties.get(name);\n\n\t\t\tconst transformedValue = this.transformAttributeValue(newValue, config);\n\t\t\tconst transformedOldValue = this.transformAttributeValue(oldValue, config);\n\n\t\t\tconst key = config ? config.attribute : name;\n\t\t\t(this as any)[key] = transformedValue;\n\t\t\tthis.notifyUpdate(name, transformedOldValue, transformedValue);\n\t\t}\n\t}\n\n\t/**\n\t * Renders a trusted HTML template string into the specified target element.\n\t *\n\t * **Security:** The `template` string is written to the DOM via `innerHTML`\n\t * or `insertAdjacentHTML` without built-in sanitization. Callers are\n\t * responsible for ensuring the input is trusted. Supply a `sanitize`\n\t * function to transform the template before insertion.\n\t */\n\tpublic renderTemplate({\n\t\ttarget = this,\n\t\ttemplate,\n\t\tinsert = 'replace',\n\t\tsanitize,\n\t}: {\n\t\ttarget: HTMLElement;\n\t\ttemplate: string;\n\t\tinsert?: RenderInsertPosition;\n\t\tsanitize?: (html: string) => string;\n\t}) {\n\t\tconst html = sanitize ? sanitize(template) : template;\n\t\tswitch (insert) {\n\t\t\tcase 'replace':\n\t\t\t\ttarget.innerHTML = html;\n\t\t\t\tbreak;\n\t\t\tcase 'beforeend':\n\t\t\t\ttarget.insertAdjacentHTML('beforeend', html);\n\t\t\t\tbreak;\n\t\t\tcase 'afterbegin':\n\t\t\t\ttarget.insertAdjacentHTML('afterbegin', html);\n\t\t\t\tbreak;\n\t\t\tcase 'beforebegin':\n\t\t\t\ttarget.insertAdjacentHTML('beforebegin', html);\n\t\t\t\tbreak;\n\t\t\tcase 'afterend':\n\t\t\t\ttarget.insertAdjacentHTML('afterend', html);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tpublic render(): JsxRenderable {\n\t\treturn jsx('slot', {});\n\t}\n\n\tpublic renderToString(options: RenderToStringOptions = {}): string {\n\t\tif (!this.shouldRunRenderLifecycle()) {\n\t\t\treturn this.innerHTML;\n\t\t}\n\n\t\tthis.prepareForSsr();\n\n\t\treturn requireRadiantElementSsrRuntime().renderView(this as unknown as RadiantElementSsrCapable, options);\n\t}\n\n\tpublic renderHost(): JsxRenderable {\n\t\treturn requireRadiantElementSsrRuntime().renderHost(this as unknown as RadiantElementSsrCapable);\n\t}\n\n\tpublic renderHostToString(options: RenderToStringOptions = {}): string {\n\t\treturn requireRadiantElementSsrRuntime().renderHostToString(\n\t\t\tthis as unknown as RadiantElementSsrCapable,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tpublic hydrate(): void {\n\t\tif (!this.shouldRunRenderLifecycle() || !this.isConnected || this.isRendering) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isRendering = true;\n\t\tthis.disconnectSlotProjectionObserver();\n\n\t\ttry {\n\t\t\thydrateJsx(this.resolveTrackedRenderOutput().value, this);\n\t\t} finally {\n\t\t\tthis.isRendering = false;\n\t\t\tthis.observeSlotProjection();\n\t\t}\n\t}\n\n\tpublic requestUpdate(): void {\n\t\tif (!this.shouldRunRenderLifecycle()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.needsRender = true;\n\n\t\tif (this.isRenderScheduled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isRenderScheduled = true;\n\n\t\tqueueMicrotask(() => {\n\t\t\tthis.isRenderScheduled = false;\n\n\t\t\tif (!this.needsRender) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.update();\n\t\t});\n\t}\n\n\tpublic update(): void {\n\t\tif (!this.shouldRunRenderLifecycle()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.needsRender = true;\n\n\t\tif (!this.isConnected || this.isRendering) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isFirstConnectPending && shouldHydrateOnConnect(this)) {\n\t\t\treturn;\n\t\t}\n\n\t\twhile (this.needsRender && this.isConnected) {\n\t\t\tthis.needsRender = false;\n\t\t\tthis.isRendering = true;\n\t\t\tthis.disconnectSlotProjectionObserver();\n\n\t\t\ttry {\n\t\t\t\trenderJsx(this.resolveTrackedRenderOutput().value, this);\n\t\t\t} finally {\n\t\t\t\tthis.isRendering = false;\n\t\t\t\tthis.observeSlotProjection();\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic registerReactiveProperty(config: ReactiveProperty) {\n\t\tthis.reactiveProperties.set(config.name, config);\n\t}\n\n\tprotected getReactiveProperties(): ReactiveProperty[] {\n\t\treturn Array.from(this.reactiveProperties.values());\n\t}\n\n\tpublic registerReactiveDependencyReader(property: string, read: () => unknown): void {\n\t\tthis.reactiveHost.registerReactiveDependencyReader(property, read);\n\t}\n\n\tpublic registerContextProvider(name: string, provider: SsrSerializableContextProvider): void {\n\t\tthis.contextProviders.set(name, provider);\n\t\tthis.registerHydrationBinding(name, provider);\n\t}\n\n\tpublic registerHydrationBinding(name: string, binding: SsrSerializableHydrationBinding): void {\n\t\tthis.hydrationBindings.set(name, binding);\n\t}\n\n\tprotected getContextProviders(): SsrSerializableContextProvider[] {\n\t\treturn Array.from(this.contextProviders.values());\n\t}\n\n\tprotected getHydrationBindings(): SsrSerializableHydrationBinding[] {\n\t\treturn Array.from(this.hydrationBindings.values());\n\t}\n\n\t/**\n\t * Flushes any deferred SSR-only preparation work before the host is\n\t * serialized.\n\t *\n\t * Radiant uses this to reapply SSR consumer state after construction so the\n\t * first server render sees finalized fields, props, and authored content.\n\t */\n\tprotected prepareForSsr(): void {\n\t\trunSsrPreparationCallbacks(this);\n\t}\n\n\t/**\n\t * Returns the default JSX binding policy for reactive members on this host.\n\t *\n\t * `RadiantElement` hosts default to automatic bindings for reactive members\n\t * when no explicit `bind` option is supplied.\n\t *\n\t * Lower-level hosts can override this hook to opt out when they want binding\n\t * creation to stay fully explicit across `@prop`, `@state`, and direct\n\t * `createReactiveProp`/`createReactiveField` calls.\n\t */\n\tprotected shouldAutoBindReactiveMembers(): boolean {\n\t\treturn true;\n\t}\n\n\tprotected shouldRunRenderLifecycle(): boolean {\n\t\treturn this.render !== RadiantElement.prototype.render;\n\t}\n\n\tprotected getHostSsrAttributes(): Record<string, string> {\n\t\treturn requireRadiantElementSsrRuntime().getHostAttributes(this as unknown as RadiantElementSsrCapable);\n\t}\n\n\tprotected resolveSsrRenderBridge(): RadiantElementRenderBridge {\n\t\tconst bridge: RadiantElementRenderBridge = {};\n\n\t\tif (this.renderHostToString === RadiantElement.prototype.renderHostToString) {\n\t\t\tbridge.renderHostToString = (options: RenderToStringOptions | undefined) =>\n\t\t\t\tthis.renderHostToString(options);\n\t\t}\n\n\t\tif (this.renderHost === RadiantElement.prototype.renderHost) {\n\t\t\tbridge.renderHost = () => this.renderHost();\n\t\t}\n\n\t\treturn bridge;\n\t}\n\n\tpublic registerUpdateCallback(property: string, update: (...rest: any[]) => any): () => void {\n\t\treturn this.reactiveHost.registerUpdateCallback(property, update);\n\t}\n\n\tpublic getReactiveBinding<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>> {\n\t\treturn this.reactiveHost.getReactiveBinding(property);\n\t}\n\n\tpublic bind<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>> {\n\t\treturn this.reactiveHost.bind(property);\n\t}\n\n\tpublic defineReactiveBinding(property: string, bind: ReactiveBindingOption = true): void {\n\t\tthis.reactiveHost.defineReactiveBinding(property, bind);\n\t}\n\n\tpublic trackReactiveRead(property: string): void {\n\t\tthis.reactiveHost.trackReactiveRead(property);\n\t}\n\n\tpublic subscribeEvents(events: RadiantElementEventListener[]): Array<() => void> {\n\t\tconst unsubscribers: Array<() => void> = [];\n\t\tfor (const event of events) {\n\t\t\tunsubscribers.push(this.subscribeEvent(event));\n\t\t}\n\t\treturn unsubscribers;\n\t}\n\n\tpublic subscribeEvent(eventConfig: RadiantElementEventListener): () => void {\n\t\tconst delegatedListener = (delegatedEvent: Event) => {\n\t\t\tif (delegatedEvent.target && (delegatedEvent.target as Element).matches(eventConfig.selector)) {\n\t\t\t\teventConfig.listener.call(this, delegatedEvent);\n\t\t\t}\n\t\t};\n\t\tconst subscriptionId = `${eventConfig.type}:${eventConfig.selector}`;\n\t\tthis.addEventListener(eventConfig.type, delegatedListener, eventConfig.options);\n\t\tthis.eventSubscriptions.set(subscriptionId, {\n\t\t\t...eventConfig,\n\t\t\tlistener: delegatedListener,\n\t\t});\n\n\t\treturn this.unsubscribeEvent.bind(this, subscriptionId);\n\t}\n\n\tprivate unsubscribeEvent(id: string): void {\n\t\tconst eventSubscription = this.eventSubscriptions.get(id);\n\t\tif (eventSubscription) {\n\t\t\tthis.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);\n\t\t\tthis.eventSubscriptions.delete(id);\n\t\t}\n\t}\n\n\tprivate removeAllSubscribedEvents(): void {\n\t\tfor (const eventSubscription of this.eventSubscriptions.values()) {\n\t\t\tthis.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);\n\t\t}\n\t\tthis.eventSubscriptions.clear();\n\t}\n\n\t/**\n\t * Registers a callback that runs on every future disconnect.\n\t */\n\tpublic registerCleanupCallback(callback: () => void): void {\n\t\tthis.reactiveHost.registerCleanupCallback(callback);\n\t}\n\n\t/**\n\t * Registers a callback that runs from `connectedCallback()` on future host\n\t * connections.\n\t *\n\t * Registering after the host is already connected does not invoke the\n\t * callback immediately.\n\t */\n\tpublic registerConnectedCallback(callback: () => void): void {\n\t\tthis.reactiveHost.registerConnectedCallback(callback);\n\t}\n\n\tpublic registerEventEmitter(name: string, emitter: EventEmitter) {\n\t\tthis.eventEmitters.set(name, emitter);\n\t}\n\n\tpublic getRef<T extends Element = Element>(ref: string, all: true): T[];\n\tpublic getRef<T extends Element = Element>(ref: string, all?: false): T | null;\n\tpublic getRef<T extends Element = Element>(ref: string, all = false): T | T[] | null {\n\t\tconst selector = `[data-ref=\"${ref}\"]`;\n\t\tif (all) {\n\t\t\treturn Array.from(this.querySelectorAll(selector)) as T[];\n\t\t}\n\t\treturn (this.querySelector(selector) as T) ?? null;\n\t}\n\n\tpublic getSlotElement<T extends Element = Element>(name?: string): T | null {\n\t\treturn (this.getSlotElements<T>(name)[0] ?? null) as T | null;\n\t}\n\n\tpublic getSlotElements<T extends Element = Element>(name?: string): T[] {\n\t\tthis.ensureSlotProjectionState();\n\n\t\treturn (this.projectedSlotContent.get(name ?? DEFAULT_SLOT_NAME) ?? []).filter(\n\t\t\t(renderable): renderable is T => typeof Node !== 'undefined' && renderable instanceof Element,\n\t\t);\n\t}\n\n\tpublic createReactiveField<T>(propertyName: string, initialValue: T, options: ReactiveFieldOptions = {}): void {\n\t\tthis.reactiveHost.createReactiveField(propertyName, initialValue, options);\n\t}\n\n\tpublic createReactiveProp<T = unknown>(propertyName: string, options: ReactivePropertyOptions<T>): void {\n\t\tconst { type, attribute, reflect, defaultValue } = options;\n\t\tconst attributeKey = attribute ?? propertyName;\n\n\t\tif (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n\t\t\tthrow new Error(`defaultValue does not match the expected type for ${type.name}`);\n\t\t}\n\n\t\tconst initialValue: T | undefined = getInitialValue(this, type, attributeKey, defaultValue) as T;\n\n\t\tif (this.hasAttribute(attributeKey) && (!reflect || initialValue == null || initialValue === '')) {\n\t\t\tthis.removeAttribute(attributeKey);\n\t\t}\n\n\t\tconst propertyMapping: ReactiveProperty<T> = {\n\t\t\ttype,\n\t\t\tname: propertyName,\n\t\t\tvalue: initialValue,\n\t\t\tinitialValue,\n\t\t\tattribute: attributeKey,\n\t\t\tconverter: {\n\t\t\t\tfromAttribute: (value) => readAttributeValue(value, type),\n\t\t\t\ttoAttribute: (value) => writeAttributeValue(value, type),\n\t\t\t},\n\t\t};\n\n\t\tthis.registerReactiveProperty(propertyMapping);\n\n\t\tconst handleReflectRequest = (value: T) => {\n\t\t\tif (reflect) {\n\t\t\t\tif (value == null || value === '' || value === false) {\n\t\t\t\t\tthis.removeAttribute(attributeKey);\n\t\t\t\t} else {\n\t\t\t\t\tconst attributeValue = propertyMapping.converter.toAttribute(value);\n\t\t\t\t\tthis.setAttribute(attributeKey, attributeValue);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.reactiveHost.defineReactiveAccessor(propertyName, {\n\t\t\tbind: options.bind,\n\t\t\tgetValue: () => this.reactiveProperties.get(propertyName)?.value as T | undefined,\n\t\t\tsetValue: (newValue: T) => {\n\t\t\t\tthis.reactiveProperties.set(propertyName, { ...propertyMapping, value: newValue });\n\t\t\t\thandleReflectRequest(newValue);\n\t\t\t},\n\t\t});\n\n\t\tif (initialValue !== undefined) {\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tconst currentValue = this.reactiveProperties.get(propertyName)?.value as T | undefined;\n\t\t\t\tif (currentValue === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\thandleReflectRequest(currentValue);\n\t\t\t\tthis.notifyUpdate(propertyName, undefined, currentValue);\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate ensureSlotProjectionState(): void {\n\t\tif (this.projectedSlotContent.size > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst scriptPayload = this.isConnected ? takeSlotProjectionScriptPayload(this) : undefined;\n\n\t\tif (typeof scriptPayload === 'string' && scriptPayload !== '') {\n\t\t\tthis.projectedSlotContent = deserializeProjectedSlotRenderables(scriptPayload);\n\t\t\tthis.slotProjectionVersion += 1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.getHostChildNodeCount() > 0) {\n\t\t\tthis.projectedSlotContent = captureProjectedSlotRenderables(this);\n\t\t\tthis.slotProjectionVersion += 1;\n\t\t}\n\t}\n\n\tprivate getHostChildNodeCount(): number {\n\t\treturn 'childNodes' in this && this.childNodes ? this.childNodes.length : 0;\n\t}\n\n\tprivate getSlotProjectionScriptTag(): string | undefined {\n\t\tthis.ensureSlotProjectionState();\n\t\tconst payload = serializeProjectedSlotRenderables(this.projectedSlotContent);\n\n\t\tif (!payload) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn `<script type=\"application/json\" ${SLOT_PROJECTION_SCRIPT_ATTRIBUTE}>${escapeScriptText(payload)}</script>`;\n\t}\n\n\tprivate getAuthoredHydrationScriptMarkup(): string | undefined {\n\t\tconst authoredHydrationMarkup = collectAuthoredHydrationScriptMarkup(this);\n\n\t\tif (authoredHydrationMarkup) {\n\t\t\treturn authoredHydrationMarkup;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate handleSlotProjectionMutations(records: MutationRecord[]): void {\n\t\tlet hasProjectionChanges = false;\n\n\t\tfor (const record of records) {\n\t\t\tfor (const removedNode of Array.from(record.removedNodes)) {\n\t\t\t\tif (this.removeProjectedSlotNode(removedNode)) {\n\t\t\t\t\thasProjectionChanges = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const addedNode of Array.from(record.addedNodes)) {\n\t\t\t\tif (addedNode.parentNode !== this) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (this.addProjectedSlotNode(addedNode)) {\n\t\t\t\t\thasProjectionChanges = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasProjectionChanges) {\n\t\t\tthis.slotProjectionVersion += 1;\n\t\t\tthis.update();\n\t\t}\n\t}\n\n\tprivate addProjectedSlotNode(node: Node): boolean {\n\t\tif (\n\t\t\tnode instanceof HTMLScriptElement &&\n\t\t\t(node.hasAttribute(SLOT_PROJECTION_SCRIPT_ATTRIBUTE) || node.hasAttribute(HYDRATION_ATTRIBUTE))\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst slotName = node instanceof Element ? (node.getAttribute('slot') ?? DEFAULT_SLOT_NAME) : DEFAULT_SLOT_NAME;\n\t\tconst bucket = this.projectedSlotContent.get(slotName);\n\n\t\tif (bucket) {\n\t\t\tif (bucket.includes(node)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbucket.push(node);\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.projectedSlotContent.set(slotName, [node]);\n\t\treturn true;\n\t}\n\n\tprivate removeProjectedSlotNode(node: Node): boolean {\n\t\tfor (const [slotName, bucket] of this.projectedSlotContent.entries()) {\n\t\t\tconst nodeIndex = bucket.indexOf(node);\n\n\t\t\tif (nodeIndex === -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tbucket.splice(nodeIndex, 1);\n\n\t\t\tif (bucket.length === 0) {\n\t\t\t\tthis.projectedSlotContent.delete(slotName);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate observeSlotProjection(): void {\n\t\tif (typeof MutationObserver === 'undefined' || this.slotProjectionObserver || !this.isConnected) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.slotProjectionObserver = new MutationObserver((records) => this.handleSlotProjectionMutations(records));\n\t\tthis.slotProjectionObserver.observe(this, { childList: true });\n\t}\n\n\tprivate disconnectSlotProjectionObserver(): void {\n\t\tthis.slotProjectionObserver?.disconnect();\n\t\tthis.slotProjectionObserver = undefined;\n\t}\n\n\tprivate disconnectRenderWatcher(): void {\n\t\tif (!this.renderSignal) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.renderWatcher.unwatch(this.renderSignal);\n\t\tthis.renderSignal = undefined;\n\t}\n\n\tprivate resolveTrackedRenderOutput(): { containsSlots: boolean; value: JsxRenderable } {\n\t\tconst nextRenderSignal = new Computed(() => this.resolveRenderOutput());\n\t\tconst output = nextRenderSignal.get();\n\n\t\tif (!this.isConnected) {\n\t\t\treturn output;\n\t\t}\n\n\t\tif (this.renderSignal) {\n\t\t\tthis.renderWatcher.unwatch(this.renderSignal);\n\t\t}\n\n\t\tthis.renderSignal = nextRenderSignal;\n\t\tthis.renderWatcher.watch(nextRenderSignal);\n\t\treturn output;\n\t}\n\n\tprivate resolveRenderOutput(): { containsSlots: boolean; value: JsxRenderable } {\n\t\tthis.ensureSlotProjectionState();\n\t\treturn resolveSlotProjection(this.render(), this.projectedSlotContent);\n\t}\n}\n\nfunction requireRadiantElementSsrRuntime() {\n\tconst runtime = getRadiantElementSsrRuntime();\n\n\tif (!runtime) {\n\t\tthrow new Error(\n\t\t\t'Radiant SSR runtime is unavailable. Import `@ecopages/radiant/server/render-component` before using instance SSR methods.',\n\t\t);\n\t}\n\n\treturn runtime;\n}\n\nfunction shouldHydrateOnConnect(component: HTMLElement): boolean {\n\treturn isRadiantHydratorInstalled() && hasHydrationMarkers(component);\n}\n\nfunction escapeScriptText(value: string): string {\n\treturn value.replace(/</g, '\\\\u003c');\n}\n",
15
+ "import { render as renderJsx, type JsxRenderable, type SubscribableJsxValue } from '@ecopages/jsx';\nimport { Computed, subtle } from '@ecopages/signals';\nimport type { UnknownContext } from '../context/types';\nimport { runLegacyInstanceInitializers } from '../decorators/legacy/instance-initializers';\nimport { ReactiveHost, type ReactiveHostLike } from './reactive-host';\nimport type {\n\tReactivePropertyOptions,\n\tReactiveBindingValue,\n\tReactiveBindings,\n\tReactiveFieldOptions,\n} from './radiant-element';\nimport type { ReactiveBindingOption } from './radiant-element';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\nimport { defaultValueForType, isValueOfType } from '../utils/attribute-utils';\n\ntype StringPropertyKey<Value> = Extract<keyof Value, string>;\n\n/**\n * Attaches Radiant reactivity to an existing DOM element without defining a\n * custom element.\n *\n * `RadiantController` is the controller-host counterpart to `RadiantElement`.\n * It can enhance authored DOM, or it can take over the host's inner DOM by\n * overriding `render()`.\n *\n * When used with the controller registry, the attached host is typically an\n * element carrying `data-controller=\"...\"`.\n *\n * @typeParam Bindings - Explicit internal bindable shape. Include only the\n * reactive keys that JSX bindings should accept.\n */\nexport class RadiantController<Bindings extends object = {}> implements ReactiveHostLike<Bindings> {\n\tpublic readonly host: Element;\n\tpublic readonly element: Element;\n\tpublic readonly bindings: ReactiveBindings<Bindings>;\n\tpublic readonly $: ReactiveBindings<Bindings>;\n\n\tprivate readonly reactiveHost: ReactiveHost<this, Bindings>;\n\tprivate connected = false;\n\tprivate isRendering = false;\n\tprivate isRenderScheduled = false;\n\tprivate needsRender = false;\n\tprivate renderSignal?: Computed<JsxRenderable>;\n\tprivate readonly renderWatcher = new subtle.Watcher(() => {\n\t\tthis.requestUpdate();\n\t});\n\n\tconstructor(host: Element) {\n\t\tthis.host = host;\n\t\tthis.element = host;\n\t\tthis.reactiveHost = new ReactiveHost<this, Bindings>(\n\t\t\tthis,\n\t\t\t{\n\t\t\t\tdefineProperty: (target, property, descriptor) => Object.defineProperty(target, property, descriptor),\n\t\t\t\thasProperty: (target, property) => property in target,\n\t\t\t\treadProperty: (target, property) => (target as Record<string, unknown>)[property],\n\t\t\t},\n\t\t\t() => this.shouldAutoBindReactiveMembers(),\n\t\t);\n\t\tthis.bindings = this.reactiveHost.bindings;\n\t\tthis.$ = this.reactiveHost.$;\n\t\trunLegacyInstanceInitializers(this);\n\t}\n\n\t/**\n\t * Connects the controller to its host and starts reactive subscriptions.\n\t *\n\t * If the controller owns a render lifecycle by overriding `render()`, the\n\t * first update runs immediately after connection.\n\t */\n\tpublic connect(): void {\n\t\tthis.connected = true;\n\t\tthis.reactiveHost.connectHost();\n\n\t\tif (this.shouldRunRenderLifecycle()) {\n\t\t\tthis.update();\n\t\t}\n\t}\n\n\t/**\n\t * Connects the controller for server-side rendering without running the\n\t * browser render/update lifecycle.\n\t */\n\tpublic connectForSsrRender(): void {\n\t\tthis.connected = true;\n\t\tthis.reactiveHost.connectHost();\n\t}\n\n\t/**\n\t * Disconnects the controller from its host and tears down reactive work.\n\t */\n\tpublic disconnect(): void {\n\t\tthis.connected = false;\n\t\tthis.disconnectRenderWatcher();\n\t\tthis.reactiveHost.disconnectHost();\n\t}\n\n\t/**\n\t * Disconnects a controller that was attached through the SSR-only lifecycle.\n\t */\n\tpublic disconnectForSsrRender(): void {\n\t\tthis.disconnectRenderWatcher();\n\t\tthis.reactiveHost.disconnectHost();\n\t\tthis.connected = false;\n\t}\n\n\tpublic get isConnected(): boolean {\n\t\treturn this.connected;\n\t}\n\n\t/**\n\t * Returns the JSX tree rendered into the attached host.\n\t *\n\t * The base implementation renders nothing. Override this method when the\n\t * controller should own the host's inner DOM instead of only enhancing\n\t * authored markup.\n\t */\n\tpublic render(): JsxRenderable {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Schedules a render pass for render-owning controllers.\n\t *\n\t * Multiple calls in the same microtask are coalesced into a single update.\n\t */\n\tpublic requestUpdate(): void {\n\t\tif (!this.shouldRunRenderLifecycle()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.needsRender = true;\n\n\t\tif (this.isRenderScheduled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isRenderScheduled = true;\n\n\t\tqueueMicrotask(() => {\n\t\t\tthis.isRenderScheduled = false;\n\n\t\t\tif (!this.needsRender) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.update();\n\t\t});\n\t}\n\n\t/**\n\t * Flushes the current render output into the attached host element.\n\t *\n\t * This is a no-op unless the controller overrides `render()`.\n\t */\n\tpublic update(): void {\n\t\tif (!this.shouldRunRenderLifecycle()) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderTarget = this.getRenderTarget();\n\n\t\tif (!renderTarget) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.needsRender = true;\n\n\t\tif (!this.connected || this.isRendering) {\n\t\t\treturn;\n\t\t}\n\n\t\twhile (this.needsRender) {\n\t\t\tthis.needsRender = false;\n\t\t\tthis.isRendering = true;\n\n\t\t\ttry {\n\t\t\t\trenderJsx(this.resolveTrackedRenderOutput(), renderTarget);\n\t\t\t} finally {\n\t\t\t\tthis.isRendering = false;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns a subscribable JSX binding for a selected reactive member.\n\t */\n\tpublic bind<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>> {\n\t\treturn this.reactiveHost.bind(property);\n\t}\n\n\t/**\n\t * Returns the cached binding object for a selected reactive member.\n\t */\n\tpublic getReactiveBinding<Property extends StringPropertyKey<Bindings>>(\n\t\tproperty: Property,\n\t): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>> {\n\t\treturn this.reactiveHost.getReactiveBinding(property);\n\t}\n\n\t/**\n\t * Defines a reactive field directly on the controller instance.\n\t */\n\tpublic createReactiveField<T>(propertyName: string, initialValue: T, options: ReactiveFieldOptions = {}): void {\n\t\tthis.reactiveHost.createReactiveField(propertyName, initialValue, options);\n\t}\n\n\t/**\n\t * Defines a controller prop backed by the attached host element's property\n\t * channel instead of attribute serialization.\n\t *\n\t * This gives controller-based integrations the same reactive field surface as\n\t * `@prop(...)` on `RadiantElement`, while allowing external code to assign\n\t * structured values such as arrays or objects directly on `controller.host`.\n\t */\n\tpublic createReactiveProp<T = unknown>(propertyName: string, options: ReactivePropertyOptions<T>): void {\n\t\tconst { type, defaultValue, bind } = options;\n\n\t\tif (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n\t\t\tthrow new Error(`defaultValue does not match the expected type for ${type.name}`);\n\t\t}\n\n\t\tconst ownDescriptor = Object.getOwnPropertyDescriptor(this.host, propertyName);\n\t\tconst hostRecord = this.host as unknown as Record<PropertyKey, unknown>;\n\t\tconst initialHostValue = hostRecord[propertyName] as T | undefined;\n\t\tlet currentValue = (initialHostValue ?? defaultValue ?? defaultValueForType(type)) as T;\n\n\t\tthis.reactiveHost.defineReactiveAccessor(propertyName, {\n\t\t\tbind,\n\t\t\tgetValue: () => currentValue,\n\t\t\tsetValue: (newValue: T) => {\n\t\t\t\tcurrentValue = newValue;\n\t\t\t},\n\t\t\tnotifyInitialValue: currentValue,\n\t\t});\n\n\t\tObject.defineProperty(this.host, propertyName, {\n\t\t\tget: () => (this as Record<PropertyKey, unknown>)[propertyName],\n\t\t\tset: (newValue: T) => {\n\t\t\t\t(this as Record<PropertyKey, unknown>)[propertyName] = newValue;\n\t\t\t},\n\t\t\tenumerable: ownDescriptor?.enumerable ?? true,\n\t\t\tconfigurable: true,\n\t\t});\n\n\t\tthis.registerCleanupCallback(() => {\n\t\t\tconst finalValue = (this as Record<PropertyKey, unknown>)[propertyName];\n\n\t\t\tif (ownDescriptor) {\n\t\t\t\tObject.defineProperty(this.host, propertyName, ownDescriptor);\n\n\t\t\t\tif ('value' in ownDescriptor && ownDescriptor.writable) {\n\t\t\t\t\thostRecord[propertyName] = finalValue;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdelete hostRecord[propertyName];\n\n\t\t\ttry {\n\t\t\t\thostRecord[propertyName] = finalValue;\n\t\t\t} catch {\n\t\t\t\tObject.defineProperty(this.host, propertyName, {\n\t\t\t\t\tvalue: finalValue,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Defines a JSX binding companion such as `$count` for a reactive member.\n\t */\n\tpublic defineReactiveBinding(property: string, bind: ReactiveBindingOption = true): void {\n\t\tthis.reactiveHost.defineReactiveBinding(property, bind);\n\t}\n\n\tpublic notifyUpdate(changedProperty: string, oldValue: unknown, value: unknown): void {\n\t\tthis.reactiveHost.notifyUpdate(changedProperty, oldValue, value);\n\t}\n\n\tpublic registerUpdateCallback(property: string, update: (...rest: any[]) => any): () => void {\n\t\treturn this.reactiveHost.registerUpdateCallback(property, update);\n\t}\n\n\tpublic connectedContextCallback(_contextName: UnknownContext): void {}\n\n\tpublic registerContextProvider(_name: string, _provider: unknown): void {\n\t\t// Controller context support is currently client-only.\n\t}\n\n\tpublic registerHydrationBinding(_name: string, _binding: SsrSerializableHydrationBinding): void {}\n\n\tpublic registerCleanupCallback(callback: () => void): void {\n\t\tthis.reactiveHost.registerCleanupCallback(callback);\n\t}\n\n\tpublic registerConnectedCallback(callback: () => void): void {\n\t\tthis.reactiveHost.registerConnectedCallback(callback);\n\t}\n\n\tpublic registerReactiveDependencyReader(property: string, read: () => unknown): void {\n\t\tthis.reactiveHost.registerReactiveDependencyReader(property, read);\n\t}\n\n\tpublic trackReactiveRead(property: string): void {\n\t\tthis.reactiveHost.trackReactiveRead(property);\n\t}\n\n\tpublic addEventListener(\n\t\ttype: string,\n\t\tlistener: EventListenerOrEventListenerObject,\n\t\toptions?: boolean | AddEventListenerOptions,\n\t): void {\n\t\tthis.host.addEventListener(type, listener, options);\n\t}\n\n\tpublic removeEventListener(\n\t\ttype: string,\n\t\tlistener: EventListenerOrEventListenerObject,\n\t\toptions?: boolean | EventListenerOptions,\n\t): void {\n\t\tthis.host.removeEventListener(type, listener, options);\n\t}\n\n\tpublic dispatchEvent(event: Event): boolean {\n\t\treturn this.host.dispatchEvent(event);\n\t}\n\n\t/**\n\t * Finds one or more elements inside the attached host by `data-ref`.\n\t *\n\t * Prefer `@query(...)` for stable, decorator-backed refs and use `getRef(...)`\n\t * for one-off lookups.\n\t */\n\tpublic getRef<T extends Element = Element>(ref: string, all: true): T[];\n\tpublic getRef<T extends Element = Element>(ref: string, all?: false): T | null;\n\tpublic getRef<T extends Element = Element>(ref: string, all = false): T | T[] | null {\n\t\tconst selector = `[data-ref=\"${ref}\"]`;\n\n\t\tif (all) {\n\t\t\treturn Array.from(this.host.querySelectorAll(selector)) as T[];\n\t\t}\n\n\t\treturn (this.host.querySelector(selector) as T) ?? null;\n\t}\n\n\tprotected shouldAutoBindReactiveMembers(): boolean {\n\t\treturn true;\n\t}\n\n\tprotected shouldRunRenderLifecycle(): boolean {\n\t\treturn this.render !== RadiantController.prototype.render;\n\t}\n\n\tprivate getRenderTarget(): HTMLElement | null {\n\t\treturn this.host instanceof HTMLElement ? this.host : null;\n\t}\n\n\tprivate disconnectRenderWatcher(): void {\n\t\tif (!this.renderSignal) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.renderWatcher.unwatch(this.renderSignal);\n\t\tthis.renderSignal = undefined;\n\t}\n\n\tprivate resolveTrackedRenderOutput(): JsxRenderable {\n\t\tconst nextRenderSignal = new Computed(() => this.render());\n\t\tconst output = nextRenderSignal.get();\n\n\t\tif (!this.connected) {\n\t\t\treturn output;\n\t\t}\n\n\t\tif (this.renderSignal) {\n\t\t\tthis.renderWatcher.unwatch(this.renderSignal);\n\t\t}\n\n\t\tthis.renderSignal = nextRenderSignal;\n\t\tthis.renderWatcher.watch(nextRenderSignal);\n\t\treturn output;\n\t}\n}\n",
16
+ "export const CONTROLLER_IDENTIFIER = Symbol.for('@ecopages/radiant.controllerIdentifier');\n\ntype ControllerConstructorWithMetadata = CustomElementConstructor & {\n\t[CONTROLLER_IDENTIFIER]?: string;\n};\n\nexport function setControllerIdentifier(target: CustomElementConstructor, identifier: string): void {\n\t(target as ControllerConstructorWithMetadata)[CONTROLLER_IDENTIFIER] = identifier;\n}\n\nexport function getControllerIdentifier(target: CustomElementConstructor): string | undefined {\n\treturn (target as ControllerConstructorWithMetadata)[CONTROLLER_IDENTIFIER];\n}\n",
17
+ "import type { RadiantController } from './core/radiant-controller';\nimport { setControllerIdentifier } from './core/controller-metadata';\n\nexport const CONTROLLER_ATTRIBUTE = 'data-controller';\n\nexport type ControllerConstructor<TController extends RadiantController = RadiantController> = new (\n\thost: Element,\n) => TController;\n\nexport type ControllerRegistrationStrategy = 'keep-current' | 'replace';\n\ntype ControllerRegistryGlobalState = {\n\tactiveRuntimes: Set<ControllerRegistryRuntime>;\n\tcontrollerRegistrationStrategy: ControllerRegistrationStrategy;\n\tcontrollerRegistry: Map<string, ControllerConstructor>;\n};\n\nconst CONTROLLER_REGISTRY_STATE_KEY = Symbol.for('@ecopages/radiant.controller-registry-state');\n\nfunction getControllerRegistryGlobalState(): ControllerRegistryGlobalState {\n\tconst globalScope = globalThis as typeof globalThis & Record<PropertyKey, unknown>;\n\tconst existingState = globalScope[CONTROLLER_REGISTRY_STATE_KEY];\n\n\tif (existingState) {\n\t\treturn existingState as ControllerRegistryGlobalState;\n\t}\n\n\tconst nextState: ControllerRegistryGlobalState = {\n\t\tactiveRuntimes: new Set<ControllerRegistryRuntime>(),\n\t\tcontrollerRegistrationStrategy: 'keep-current',\n\t\tcontrollerRegistry: new Map<string, ControllerConstructor>(),\n\t};\n\n\tglobalScope[CONTROLLER_REGISTRY_STATE_KEY] = nextState;\n\n\treturn nextState;\n}\n\nconst controllerRegistryState = getControllerRegistryGlobalState();\nconst controllerRegistry = controllerRegistryState.controllerRegistry;\nconst activeRuntimes = controllerRegistryState.activeRuntimes;\n\nfunction parseControllerIdentifiers(element: Element): string[] {\n\tconst value = element.getAttribute(CONTROLLER_ATTRIBUTE);\n\n\tif (!value) {\n\t\treturn [];\n\t}\n\n\treturn value\n\t\t.split(/\\s+/)\n\t\t.map((identifier) => identifier.trim())\n\t\t.filter((identifier) => identifier.length > 0);\n}\n\nfunction visitControllerElements(root: ParentNode, visit: (element: Element) => void): void {\n\tif (root instanceof Element && root.hasAttribute(CONTROLLER_ATTRIBUTE)) {\n\t\tvisit(root);\n\t}\n\n\tfor (const element of Array.from(root.querySelectorAll(`[${CONTROLLER_ATTRIBUTE}]`))) {\n\t\tvisit(element);\n\t}\n}\n\nexport class ControllerRegistryRuntime {\n\tprivate readonly controllersByElement = new Map<Element, Map<string, RadiantController>>();\n\tprivate observer?: MutationObserver;\n\tprivate stopped = false;\n\n\tconstructor(private readonly root: ParentNode = document) {\n\t\tthis.start();\n\t}\n\n\tpublic stop(): void {\n\t\tif (this.stopped) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.stopped = true;\n\t\tthis.observer?.disconnect();\n\t\tthis.observer = undefined;\n\n\t\tfor (const [element, controllers] of this.controllersByElement) {\n\t\t\tfor (const [identifier] of controllers) {\n\t\t\t\tthis.disconnectController(element, identifier);\n\t\t\t}\n\t\t}\n\n\t\tactiveRuntimes.delete(this);\n\t}\n\n\tpublic reconcileRegisteredController(identifier: string): void {\n\t\tvisitControllerElements(this.root, (element) => {\n\t\t\tif (!parseControllerIdentifiers(element).includes(identifier)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.connectController(element, identifier);\n\t\t});\n\t}\n\n\tpublic replaceRegisteredController(identifier: string): void {\n\t\tfor (const [element, controllers] of Array.from(this.controllersByElement.entries())) {\n\t\t\tif (!controllers.has(identifier)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.disconnectController(element, identifier);\n\t\t}\n\n\t\tthis.reconcileRegisteredController(identifier);\n\t}\n\n\tprivate start(): void {\n\t\tvisitControllerElements(this.root, (element) => {\n\t\t\tthis.reconcileElement(element);\n\t\t});\n\n\t\tif (typeof MutationObserver === 'undefined') {\n\t\t\tactiveRuntimes.add(this);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.observer = new MutationObserver((records) => {\n\t\t\tfor (const record of records) {\n\t\t\t\tif (record.type === 'attributes' && record.target instanceof Element) {\n\t\t\t\t\tthis.reconcileElement(record.target);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (const removedNode of Array.from(record.removedNodes)) {\n\t\t\t\t\tif (!(removedNode instanceof Element)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvisitControllerElements(removedNode, (element) => {\n\t\t\t\t\t\tthis.disconnectElementControllers(element);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tfor (const addedNode of Array.from(record.addedNodes)) {\n\t\t\t\t\tif (!(addedNode instanceof Element)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvisitControllerElements(addedNode, (element) => {\n\t\t\t\t\t\tthis.reconcileElement(element);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tconst observerRoot = this.root instanceof Document ? this.root.documentElement : this.root;\n\n\t\tthis.observer.observe(observerRoot, {\n\t\t\tattributeFilter: [CONTROLLER_ATTRIBUTE],\n\t\t\tattributes: true,\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t});\n\n\t\tactiveRuntimes.add(this);\n\t}\n\n\tprivate reconcileElement(element: Element): void {\n\t\tconst nextIdentifiers = new Set(parseControllerIdentifiers(element));\n\t\tconst currentControllers = this.controllersByElement.get(element);\n\n\t\tif (currentControllers) {\n\t\t\tfor (const identifier of currentControllers.keys()) {\n\t\t\t\tif (!nextIdentifiers.has(identifier)) {\n\t\t\t\t\tthis.disconnectController(element, identifier);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const identifier of nextIdentifiers) {\n\t\t\tthis.connectController(element, identifier);\n\t\t}\n\t}\n\n\tprivate connectController(element: Element, identifier: string): void {\n\t\tconst controllerConstructor = controllerRegistry.get(identifier);\n\n\t\tif (!controllerConstructor) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet controllers = this.controllersByElement.get(element);\n\n\t\tif (!controllers) {\n\t\t\tcontrollers = new Map();\n\t\t\tthis.controllersByElement.set(element, controllers);\n\t\t}\n\n\t\tif (controllers.has(identifier)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst controller = new controllerConstructor(element);\n\t\tcontrollers.set(identifier, controller);\n\t\tcontroller.connect();\n\t}\n\n\tprivate disconnectController(element: Element, identifier: string): void {\n\t\tconst controllers = this.controllersByElement.get(element);\n\n\t\tif (!controllers) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst controller = controllers.get(identifier);\n\n\t\tif (!controller) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontroller.disconnect();\n\t\tcontrollers.delete(identifier);\n\n\t\tif (controllers.size === 0) {\n\t\t\tthis.controllersByElement.delete(element);\n\t\t}\n\t}\n\n\tprivate disconnectElementControllers(element: Element): void {\n\t\tconst controllers = this.controllersByElement.get(element);\n\n\t\tif (!controllers) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const identifier of Array.from(controllers.keys())) {\n\t\t\tthis.disconnectController(element, identifier);\n\t\t}\n\t}\n}\n\nexport function registerController<\n\tTController extends RadiantController,\n\tTConstructor extends ControllerConstructor<TController>,\n>(identifier: string, controller: TConstructor): TConstructor {\n\tconst existingController = controllerRegistry.get(identifier);\n\n\tif (existingController) {\n\t\treturn existingController as TConstructor;\n\t}\n\n\tsetControllerIdentifier(controller as unknown as CustomElementConstructor, identifier);\n\tcontrollerRegistry.set(identifier, controller);\n\n\tfor (const runtime of Array.from(activeRuntimes)) {\n\t\truntime.reconcileRegisteredController(identifier);\n\t}\n\n\treturn controller;\n}\n\nexport function hasRegisteredController(identifier: string): boolean {\n\treturn controllerRegistry.has(identifier);\n}\n\nexport function replaceController<\n\tTController extends RadiantController,\n\tTConstructor extends ControllerConstructor<TController>,\n>(identifier: string, controller: TConstructor): TConstructor {\n\tconst existingController = controllerRegistry.get(identifier);\n\n\tif (existingController === controller) {\n\t\treturn controller;\n\t}\n\n\tsetControllerIdentifier(controller as unknown as CustomElementConstructor, identifier);\n\tcontrollerRegistry.set(identifier, controller);\n\n\tfor (const runtime of Array.from(activeRuntimes)) {\n\t\truntime.replaceRegisteredController(identifier);\n\t}\n\n\treturn controller;\n}\n\nexport function setControllerRegistrationStrategy(strategy: ControllerRegistrationStrategy): void {\n\tcontrollerRegistryState.controllerRegistrationStrategy = strategy;\n}\n\nexport function enableControllerReplacementForHmr(): void {\n\tsetControllerRegistrationStrategy('replace');\n}\n\nexport function disableControllerReplacementForHmr(): void {\n\tsetControllerRegistrationStrategy('keep-current');\n}\n\nexport function registerControllerWithConfiguredStrategy<\n\tTController extends RadiantController,\n\tTConstructor extends ControllerConstructor<TController>,\n>(identifier: string, controller: TConstructor): TConstructor {\n\tif (controllerRegistryState.controllerRegistrationStrategy === 'replace') {\n\t\treturn replaceController(identifier, controller);\n\t}\n\n\treturn registerController(identifier, controller);\n}\n\nexport function startControllers(root: ParentNode = document): ControllerRegistryRuntime {\n\treturn new ControllerRegistryRuntime(root);\n}\n\nexport function stopControllers(): void {\n\tfor (const runtime of Array.from(activeRuntimes)) {\n\t\truntime.stop();\n\t}\n}\n",
18
+ "import type { Method } from '../types';\n\ntype StandardFieldFn<Host extends object, Value, Result> = (\n\ttarget: undefined,\n\tcontext: ClassFieldDecoratorContext<Host, Value>,\n) => Result;\n\ntype LegacyFieldFn<Proto, Result> = (proto: Proto, name: string) => Result;\n\ntype StandardMethodFn<Host extends object, TMethod extends Method, Result> = (\n\ttarget: TMethod,\n\tcontext: ClassMethodDecoratorContext<Host, TMethod>,\n) => Result;\n\ntype LegacyMethodFn<Proto, Result> = (proto: Proto, name: string, descriptor: PropertyDescriptor) => Result;\n\nfunction isMethod(value: unknown): value is Method {\n\treturn typeof value === 'function';\n}\n\nexport function fieldDecoratorBridge<Host extends object, Value, Result, Proto>(\n\tstandard: StandardFieldFn<Host, Value, Result>,\n\tlegacy: LegacyFieldFn<Proto, void>,\n\tprotoOrTarget: undefined,\n\tnameOrContext: ClassFieldDecoratorContext<Host, Value>,\n): Result;\nexport function fieldDecoratorBridge<Host extends object, Value, Proto, Result>(\n\tstandard: StandardFieldFn<Host, Value, void>,\n\tlegacy: LegacyFieldFn<Proto, Result>,\n\tprotoOrTarget: Proto,\n\tnameOrContext: string,\n): Result;\nexport function fieldDecoratorBridge<Host extends object, Value, StandardResult, Proto, LegacyResult>(\n\tstandard: StandardFieldFn<Host, Value, StandardResult>,\n\tlegacy: LegacyFieldFn<Proto, LegacyResult>,\n\tprotoOrTarget: Proto | undefined,\n\tnameOrContext: string | ClassFieldDecoratorContext<Host, Value>,\n): StandardResult | LegacyResult;\n\nexport function fieldDecoratorBridge(\n\tstandard: StandardFieldFn<object, unknown, unknown>,\n\tlegacy: LegacyFieldFn<unknown, unknown>,\n\tprotoOrTarget: unknown,\n\tnameOrContext: string | ClassFieldDecoratorContext<object, unknown>,\n): unknown {\n\tif (typeof nameOrContext === 'object') {\n\t\treturn standard(undefined, nameOrContext);\n\t}\n\n\treturn legacy(protoOrTarget, nameOrContext);\n}\n\nexport function methodDecoratorBridge<Host extends object, TMethod extends Method, Result, Proto>(\n\tstandard: StandardMethodFn<Host, TMethod, Result>,\n\tlegacy: LegacyMethodFn<Proto, void>,\n\tprotoOrTarget: TMethod,\n\tnameOrContext: ClassMethodDecoratorContext<Host, TMethod>,\n\tdescriptor?: undefined,\n): Result;\nexport function methodDecoratorBridge<Host extends object, TMethod extends Method, Proto, Result>(\n\tstandard: StandardMethodFn<Host, TMethod, void>,\n\tlegacy: LegacyMethodFn<Proto, Result>,\n\tprotoOrTarget: Proto,\n\tnameOrContext: string,\n\tdescriptor: PropertyDescriptor,\n): Result;\nexport function methodDecoratorBridge<Host extends object, TMethod extends Method, StandardResult, Proto, LegacyResult>(\n\tstandard: StandardMethodFn<Host, TMethod, StandardResult>,\n\tlegacy: LegacyMethodFn<Proto, LegacyResult>,\n\tprotoOrTarget: Proto | TMethod,\n\tnameOrContext: string | ClassMethodDecoratorContext<Host, TMethod>,\n\tdescriptor?: PropertyDescriptor,\n): StandardResult | LegacyResult;\n\nexport function methodDecoratorBridge(\n\tstandard: StandardMethodFn<object, Method, unknown>,\n\tlegacy: LegacyMethodFn<unknown, unknown>,\n\tprotoOrTarget: unknown,\n\tnameOrContext: string | ClassMethodDecoratorContext<object, Method>,\n\tdescriptor?: PropertyDescriptor,\n): unknown {\n\tif (typeof nameOrContext === 'object') {\n\t\tif (!isMethod(protoOrTarget)) {\n\t\t\tthrow new TypeError('Standard method decorators require a method target');\n\t\t}\n\n\t\treturn standard(protoOrTarget, nameOrContext);\n\t}\n\n\tif (!descriptor) {\n\t\tthrow new TypeError('Legacy method decorators require a property descriptor');\n\t}\n\n\treturn legacy(protoOrTarget, nameOrContext, descriptor);\n}\n",
19
+ "import type { ReactiveHostLike } from '../../core/reactive-host';\nimport type { ReactiveBindingOption } from '../../core/radiant-element';\nimport {\n\tdefaultValueForType,\n\tisValueOfType,\n\treadAttributeValue,\n\ttype AttributeTypeConstant,\n\twriteAttributeValue,\n} from '../../utils/attribute-utils';\n\nexport type AttrConverter<T> = {\n\tfromAttribute?: (value: string | null) => T;\n\ttoAttribute?: (value: T) => string | null;\n};\n\nexport type AttrOptions<T = string | undefined> = {\n\tsource?: string;\n\ttype?: AttributeTypeConstant;\n\tbind?: ReactiveBindingOption;\n\tdefaultValue?: T;\n\tconverter?: AttrConverter<T>;\n};\n\ntype ReactiveAttributeHostApi<Bindings extends object = {}> = ReactiveHostLike<Bindings> & {\n\tregisterCleanupCallback(callback: () => void): void;\n\tregisterConnectedCallback(callback: () => void): void;\n};\n\nexport type ReactiveAttributeHostLike<Bindings extends object = {}> =\n\t| (ReactiveAttributeHostApi<Bindings> & Element)\n\t| (ReactiveAttributeHostApi<Bindings> & { host: Element })\n\t| (ReactiveAttributeHostApi<Bindings> & { element: Element });\n\nfunction resolveAttributeTarget(host: ReactiveAttributeHostLike): Element {\n\tif (host instanceof Element) {\n\t\treturn host;\n\t}\n\n\tif ('host' in host) {\n\t\treturn host.host;\n\t}\n\n\treturn host.element;\n}\n\nfunction toAttributeName(propertyName: string): string {\n\treturn propertyName\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n\t\t.replace(/_/g, '-')\n\t\t.toLowerCase();\n}\n\nfunction resolveAttributeValue<T>(rawValue: string | null, options: AttrOptions<T>): T {\n\tif (options.converter?.fromAttribute) {\n\t\tconst convertedValue = options.converter.fromAttribute(rawValue);\n\n\t\tif (rawValue === null && convertedValue === undefined && 'defaultValue' in options) {\n\t\t\treturn options.defaultValue as T;\n\t\t}\n\n\t\treturn convertedValue;\n\t}\n\n\tif (options.type) {\n\t\tif (rawValue === null) {\n\t\t\treturn (options.defaultValue ?? defaultValueForType(options.type)) as T;\n\t\t}\n\n\t\tif (options.type === Boolean && rawValue === '') {\n\t\t\treturn true as T;\n\t\t}\n\n\t\treturn readAttributeValue(rawValue, options.type) as T;\n\t}\n\n\tif (rawValue === null) {\n\t\treturn options.defaultValue as T;\n\t}\n\n\treturn rawValue as T;\n}\n\nfunction readReactiveAttributeValue<T>(\n\thost: ReactiveAttributeHostLike,\n\tattributeName: string,\n\toptions: AttrOptions<T>,\n): T {\n\treturn resolveAttributeValue(resolveAttributeTarget(host).getAttribute(attributeName), options);\n}\n\nfunction writeReactiveAttributeValue<T>(\n\ttarget: Element,\n\tattributeName: string,\n\tvalue: T,\n\toptions: AttrOptions<T>,\n): void {\n\tconst attributeValue = options.converter?.toAttribute\n\t\t? options.converter.toAttribute(value)\n\t\t: options.type\n\t\t\t? writeAttributeValue(value, options.type)\n\t\t\t: value == null\n\t\t\t\t? null\n\t\t\t\t: String(value);\n\n\tif (attributeValue === null) {\n\t\ttarget.removeAttribute(attributeName);\n\t\treturn;\n\t}\n\n\ttarget.setAttribute(attributeName, attributeValue);\n}\n\nexport function installReactiveAttribute<TBindings extends object, TValue>(\n\thost: ReactiveAttributeHostLike<TBindings>,\n\tpropertyName: string,\n\toptions: AttrOptions<TValue> = {},\n): void {\n\tif (options.type && options.defaultValue !== undefined && !isValueOfType(options.type, options.defaultValue)) {\n\t\tthrow new Error(`defaultValue does not match the expected type for ${options.type.name}`);\n\t}\n\n\tconst hostRecord = host as unknown as Record<PropertyKey, unknown>;\n\tconst attributeName = options.source ?? toAttributeName(propertyName);\n\tconst observerKey = Symbol(`@ecopages/radiant/attr:${propertyName}:observer`);\n\tconst lastValueKey = Symbol(`@ecopages/radiant/attr:${propertyName}:last-value`);\n\tconst bind =\n\t\toptions.bind ??\n\t\t(host as unknown as { shouldAutoBindReactiveMembers?: () => boolean }).shouldAutoBindReactiveMembers?.() ??\n\t\tfalse;\n\n\thost.defineReactiveBinding(propertyName, bind);\n\thost.registerReactiveDependencyReader(propertyName, () => readReactiveAttributeValue(host, attributeName, options));\n\thostRecord[lastValueKey] = readReactiveAttributeValue(host, attributeName, options);\n\n\tObject.defineProperty(host, propertyName, {\n\t\tget() {\n\t\t\thost.trackReactiveRead(propertyName);\n\t\t\treturn readReactiveAttributeValue(this as ReactiveAttributeHostLike, attributeName, options);\n\t\t},\n\t\tset(newValue: TValue) {\n\t\t\tconst target = resolveAttributeTarget(this as ReactiveAttributeHostLike);\n\t\t\tconst oldValue = readReactiveAttributeValue(this as ReactiveAttributeHostLike, attributeName, options);\n\t\t\twriteReactiveAttributeValue(target, attributeName, newValue, options);\n\t\t\tconst nextValue = readReactiveAttributeValue(this as ReactiveAttributeHostLike, attributeName, options);\n\n\t\t\tif (Object.is(oldValue, nextValue)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t(this as Record<PropertyKey, unknown>)[lastValueKey] = nextValue;\n\t\t\thost.notifyUpdate(propertyName, oldValue, nextValue);\n\t\t},\n\t\tenumerable: true,\n\t\tconfigurable: true,\n\t});\n\n\tconst disconnectObserver = () => {\n\t\tconst observer = hostRecord[observerKey] as MutationObserver | undefined;\n\t\tobserver?.disconnect();\n\t};\n\n\tconst syncAndObserve = () => {\n\t\tconst nextValue = readReactiveAttributeValue(host, attributeName, options);\n\t\tconst previousValue = hostRecord[lastValueKey];\n\n\t\tif (!Object.is(previousValue, nextValue)) {\n\t\t\thostRecord[lastValueKey] = nextValue;\n\t\t\thost.notifyUpdate(propertyName, previousValue, nextValue);\n\t\t}\n\n\t\tif (typeof MutationObserver === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst target = resolveAttributeTarget(host);\n\n\t\tdisconnectObserver();\n\n\t\tconst observer = new MutationObserver(() => {\n\t\t\tconst currentValue = readReactiveAttributeValue(host, attributeName, options);\n\t\t\tconst lastValue = hostRecord[lastValueKey];\n\n\t\t\tif (Object.is(lastValue, currentValue)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\thostRecord[lastValueKey] = currentValue;\n\t\t\thost.notifyUpdate(propertyName, lastValue, currentValue);\n\t\t});\n\n\t\tobserver.observe(target, {\n\t\t\tattributeFilter: [attributeName],\n\t\t\tattributes: true,\n\t\t});\n\n\t\thostRecord[observerKey] = observer;\n\t};\n\n\tsyncAndObserve();\n\thost.registerConnectedCallback(syncAndObserve);\n\thost.registerCleanupCallback(disconnectObserver);\n}\n",
20
+ "import { installReactiveAttribute, type AttrOptions, type ReactiveAttributeHostLike } from '../shared/reactive-attr';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\nexport function reactiveAttr<TValue = string | undefined>(options: AttrOptions<TValue> = {}) {\n\treturn (target: ReactiveAttributeHostLike, propertyName: string) => {\n\t\tconst installedKey = Symbol(`@ecopages/radiant/attr:${propertyName}:installed`);\n\n\t\tregisterLegacyInstanceInitializer(target, (host) => {\n\t\t\t(host as ReactiveAttributeHostLike).registerConnectedCallback(() => {\n\t\t\t\tif ((host as unknown as Record<PropertyKey, unknown>)[installedKey]) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst initializerValue = (host as unknown as Record<PropertyKey, TValue | undefined>)[propertyName];\n\t\t\t\tconst defaultValue = (options.defaultValue === undefined ? initializerValue : options.defaultValue) as\n\t\t\t\t\t| TValue\n\t\t\t\t\t| undefined;\n\n\t\t\t\tinstallReactiveAttribute(host as ReactiveAttributeHostLike, propertyName, {\n\t\t\t\t\t...options,\n\t\t\t\t\tdefaultValue,\n\t\t\t\t});\n\n\t\t\t\t(host as unknown as Record<PropertyKey, unknown>)[installedKey] = true;\n\t\t\t});\n\t\t});\n\t};\n}\n",
21
+ "import { installReactiveAttribute, type AttrOptions, type ReactiveAttributeHostLike } from '../shared/reactive-attr';\n\nexport function reactiveAttr<TValue = string | undefined>(options: AttrOptions<TValue> = {}) {\n\treturn function <THost extends ReactiveAttributeHostLike>(\n\t\ttarget: undefined,\n\t\tcontext: ClassFieldDecoratorContext<THost, TValue>,\n\t) {\n\t\tvoid target;\n\t\tconst propertyName = String(context.name);\n\t\tconst initializerValueKey = Symbol(`@ecopages/radiant/attr:${propertyName}:initializer`);\n\n\t\tcontext.addInitializer(function (this: THost) {\n\t\t\tconst initializerValue = (this as Record<PropertyKey, TValue | undefined>)[initializerValueKey];\n\t\t\tconst defaultValue = (options.defaultValue === undefined ? initializerValue : options.defaultValue) as\n\t\t\t\t| TValue\n\t\t\t\t| undefined;\n\n\t\t\tinstallReactiveAttribute(this, propertyName, {\n\t\t\t\t...options,\n\t\t\t\tdefaultValue,\n\t\t\t});\n\t\t});\n\n\t\treturn function (this: THost, value: TValue) {\n\t\t\t(this as Record<PropertyKey, TValue | undefined>)[initializerValueKey] = value;\n\t\t\treturn value;\n\t\t};\n\t};\n}\n",
22
+ "import { fieldDecoratorBridge } from './bridge';\nimport { reactiveAttr as legacyReactiveAttr } from './legacy/attr';\nimport { reactiveAttr as standardReactiveAttr } from './standard/attr';\nimport type { ReactiveAttributeHostLike } from './shared/reactive-attr';\nexport type { AttrConverter, AttrOptions } from './shared/reactive-attr';\n\nexport function attr<TValue = string | undefined>(options: import('./shared/reactive-attr').AttrOptions<TValue> = {}) {\n\tfunction decorator<THost extends ReactiveAttributeHostLike>(\n\t\tprotoOrTarget: undefined,\n\t\tnameOrContext: ClassFieldDecoratorContext<THost, TValue>,\n\t): (this: THost, value: TValue) => TValue;\n\tfunction decorator(protoOrTarget: ReactiveAttributeHostLike, nameOrContext: string): void;\n\tfunction decorator(\n\t\tprotoOrTarget: ReactiveAttributeHostLike | undefined,\n\t\tnameOrContext: string | ClassFieldDecoratorContext<ReactiveAttributeHostLike, TValue>,\n\t): ((this: ReactiveAttributeHostLike, value: TValue) => TValue) | void {\n\t\treturn fieldDecoratorBridge(\n\t\t\tstandardReactiveAttr(options),\n\t\t\tlegacyReactiveAttr(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n",
23
+ "import type { RadiantElement } from '../../core/radiant-element';\n\n/**\n * A decorator to bind a method to the instance.\n * @param target {@link RadiantElement}\n * @param propertyKey string\n * @param descriptor {@link PropertyDescriptor}\n * @returns\n */\nexport function bound(target: RadiantElement, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n\tconst originalMethod = descriptor.value;\n\n\treturn {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\tif (this === (target as any).prototype || Object.prototype.hasOwnProperty.call(this, propertyKey)) {\n\t\t\t\treturn originalMethod;\n\t\t\t}\n\n\t\t\tconst boundMethod = originalMethod.bind(this);\n\t\t\tObject.defineProperty(this, propertyKey, {\n\t\t\t\tvalue: boundMethod,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t});\n\t\t\treturn boundMethod;\n\t\t},\n\t};\n}\n",
24
+ "import type { Method } from '../../types';\n\nexport function bound<T extends Method>(_: T, context: ClassMethodDecoratorContext) {\n\tconst methodName = String(context.name);\n\tif (context.private) {\n\t\tthrow new Error(`'bound' cannot decorate private properties like ${methodName as string}.`);\n\t}\n\tcontext.addInitializer(function (this: any) {\n\t\tthis[methodName] = this[methodName].bind(this);\n\t});\n}\n",
25
+ "import type { Method } from '../types';\nimport type { RadiantElement } from '../core/radiant-element';\nimport { bound as legacyBound } from './legacy/bound';\nimport { bound as standardBound } from './standard/bound';\nimport { methodDecoratorBridge } from './bridge';\n\n/**\n * A decorator to bind a method to the instance.\n */\nexport function bound<Host extends object, TMethod extends Method>(\n\tprotoOrTarget: TMethod,\n\tnameOrContext: ClassMethodDecoratorContext<Host, TMethod>,\n): void;\nexport function bound(\n\tprotoOrTarget: RadiantElement,\n\tnameOrContext: string,\n\tdescriptor: TypedPropertyDescriptor<Method>,\n): TypedPropertyDescriptor<Method> | void;\nexport function bound(\n\tprotoOrTarget: RadiantElement | Method,\n\tnameOrContext: string | ClassMethodDecoratorContext<RadiantElement, Method>,\n\tdescriptor?: TypedPropertyDescriptor<Method>,\n): TypedPropertyDescriptor<Method> | void {\n\treturn methodDecoratorBridge(standardBound, legacyBound, protoOrTarget, nameOrContext, descriptor);\n}\n",
26
+ "import { registerControllerWithConfiguredStrategy, type ControllerConstructor } from '../controller-registry';\n\nexport function controller(identifier: string) {\n\treturn function <T extends ControllerConstructor>(target: T): T {\n\t\treturn registerControllerWithConfiguredStrategy(identifier, target);\n\t};\n}\n",
27
+ "export const CUSTOM_ELEMENT_TAG_NAME = Symbol.for('@ecopages/radiant.customElementTagName');\n\ntype CustomElementConstructorWithMetadata = CustomElementConstructor & {\n\t[CUSTOM_ELEMENT_TAG_NAME]?: string;\n};\n\n/**\n * Sets the custom element tag name for a given constructor.\n * This is used internally to associate a class with its custom element tag, which is necessary for features like hydration and SSR support.\n * @param target The constructor of the custom element.\n * @param tagName The tag name to associate with the custom element.\n */\nexport function setCustomElementTagName(target: CustomElementConstructor, tagName: string): void {\n\t(target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME] = tagName;\n}\n\n/**\n * Retrieves the custom element tag name associated with a given constructor.\n * @param target The constructor of the custom element.\n * @returns The tag name associated with the custom element, or `undefined` if not set.\n */\nexport function getCustomElementTagName(target: CustomElementConstructor): string | undefined {\n\treturn (target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME];\n}\n",
28
+ "import { setCustomElementTagName } from '../../core/custom-element-metadata';\n\n/**\n * Registers a web component with the given name on the global `window.customElements` registry.\n * @param name selector name.\n * @param options {@link ElementDefinitionOptions}\n */\nexport function customElement(name: string, options?: ElementDefinitionOptions) {\n\treturn (target: CustomElementConstructor) => {\n\t\tsetCustomElementTagName(target, name);\n\n\t\tif (typeof customElements !== 'undefined' && !customElements.get(name)) {\n\t\t\tcustomElements.define(name, target, options);\n\t\t}\n\t};\n}\n",
29
+ "import { setCustomElementTagName } from '../../core/custom-element-metadata';\n\nexport function customElement(name: string, options?: ElementDefinitionOptions) {\n\treturn function <T extends CustomElementConstructor>(_: T, context: ClassDecoratorContext<T>) {\n\t\tcontext.addInitializer(function () {\n\t\t\tsetCustomElementTagName(this, name);\n\n\t\t\tif (typeof customElements !== 'undefined' && !customElements.get(name)) {\n\t\t\t\tcustomElements.define(name, this, options);\n\t\t\t}\n\t\t});\n\t};\n}\n",
30
+ "import { customElement as legacyCustomElement } from './legacy/custom-element';\nimport { customElement as standardCustomElement } from './standard/custom-element';\n\n/**\n * Registers a web component with the given name on the global `window.customElements` registry.\n * @param name selector name.\n * @param options {@link ElementDefinitionOptions}\n */\nexport function customElement(name: string, options?: ElementDefinitionOptions) {\n\tfunction decorator<T extends CustomElementConstructor>(\n\t\tprotoOrTarget: T,\n\t\tnameOrContext: ClassDecoratorContext<T>,\n\t): void;\n\tfunction decorator(protoOrTarget: CustomElementConstructor): void;\n\tfunction decorator(\n\t\tprotoOrTarget: CustomElementConstructor,\n\t\tnameOrContext?: ClassDecoratorContext<CustomElementConstructor>,\n\t): void {\n\t\tif (typeof nameOrContext !== 'undefined') {\n\t\t\treturn standardCustomElement(name, options)(protoOrTarget, nameOrContext);\n\t\t}\n\n\t\treturn legacyCustomElement(name, options)(protoOrTarget);\n\t}\n\n\treturn decorator;\n}\n",
31
+ "import type { Method } from '../types';\n\n/**\n * A debounced function with imperative helpers for controlling pending work.\n *\n * @typeParam T The wrapped callback type.\n */\nexport interface DebouncedFunction<T extends Method> {\n\t(...args: Parameters<T>): void;\n\n\t/**\n\t * Cancels the pending callback invocation, if one exists.\n\t */\n\tcancel(): void;\n\n\t/**\n\t * Immediately invokes the latest pending callback invocation.\n\t *\n\t * @returns The callback result when a call is pending, or the last completed\n\t * result when no call is pending.\n\t */\n\tflush(): ReturnType<T> | undefined;\n\n\t/**\n\t * Reports whether the callback currently has a scheduled invocation.\n\t *\n\t * @returns True when a call is pending.\n\t */\n\tpending(): boolean;\n}\n\n/**\n * Creates a debounced wrapper around a function.\n *\n * The returned function delays invocation until the configured timeout has\n * elapsed since the latest call. It also exposes helpers to cancel, flush,\n * and inspect pending work.\n *\n * @typeParam T The wrapped callback type.\n * @param callback The callback to debounce.\n * @param timeout The debounce timeout in milliseconds.\n * @returns A debounced wrapper around the callback.\n */\nexport function debounce<T extends Method>(callback: T, timeout: number): DebouncedFunction<T> {\n\tlet timeoutRef: ReturnType<typeof setTimeout> | null = null;\n\tlet pendingInvocation: (() => ReturnType<T>) | null = null;\n\tlet lastResult: ReturnType<T> | undefined;\n\n\tconst clearPendingCall = () => {\n\t\tif (timeoutRef !== null) {\n\t\t\tclearTimeout(timeoutRef);\n\t\t\ttimeoutRef = null;\n\t\t}\n\t};\n\n\tconst invoke = (): ReturnType<T> | undefined => {\n\t\tif (pendingInvocation === null) {\n\t\t\treturn lastResult;\n\t\t}\n\n\t\tconst invocation = pendingInvocation;\n\t\tpendingInvocation = null;\n\t\tclearPendingCall();\n\t\tlastResult = invocation();\n\n\t\treturn lastResult;\n\t};\n\n\tconst debounced = function (this: ThisParameterType<T>, ...args: Parameters<T>) {\n\t\tpendingInvocation = () => callback.apply(this, args) as ReturnType<T>;\n\t\tclearPendingCall();\n\t\ttimeoutRef = setTimeout(() => {\n\t\t\tinvoke();\n\t\t}, timeout);\n\t} as DebouncedFunction<T>;\n\n\tdebounced.cancel = () => {\n\t\tclearPendingCall();\n\t\tpendingInvocation = null;\n\t};\n\n\tdebounced.flush = () => {\n\t\tif (pendingInvocation === null) {\n\t\t\treturn lastResult;\n\t\t}\n\n\t\treturn invoke();\n\t};\n\n\tdebounced.pending = () => pendingInvocation !== null;\n\n\treturn debounced;\n}\n",
32
+ "import type { RadiantElement } from '../../core/radiant-element';\nimport { debounce as debounceFunction } from '../../helpers/debounce';\n\nexport function debounce(\n\ttimeout: number,\n): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor {\n\treturn (_target: RadiantElement, _propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor => {\n\t\tconst originalMethod = descriptor.value;\n\t\tconst debouncedByInstance = new WeakMap<object, ReturnType<typeof debounceFunction<typeof originalMethod>>>();\n\n\t\tdescriptor.value = function debounce(this: object, ...args: Parameters<typeof originalMethod>) {\n\t\t\tlet debounced = debouncedByInstance.get(this);\n\n\t\t\tif (!debounced) {\n\t\t\t\tdebounced = debounceFunction((...innerArgs: Parameters<typeof originalMethod>) => {\n\t\t\t\t\treturn originalMethod.apply(this, innerArgs);\n\t\t\t\t}, timeout);\n\t\t\t\tdebouncedByInstance.set(this, debounced);\n\t\t\t}\n\n\t\t\tdebounced(...args);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n",
33
+ "import { debounce as debounceFunction } from '../../helpers/debounce';\nimport type { Method } from '../../types';\n\nexport function debounce(timeout: number): Method {\n\treturn <T extends Method>(originalMethod: T): Method => {\n\t\tconst debouncedByInstance = new WeakMap<object, ReturnType<typeof debounceFunction<T>>>();\n\n\t\treturn function (this: object, ...args: Parameters<T>): void {\n\t\t\tlet debounced = debouncedByInstance.get(this);\n\n\t\t\tif (!debounced) {\n\t\t\t\tdebounced = debounceFunction((...innerArgs: Parameters<T>) => {\n\t\t\t\t\treturn originalMethod.apply(this, innerArgs);\n\t\t\t\t}, timeout);\n\t\t\t\tdebouncedByInstance.set(this, debounced);\n\t\t\t}\n\n\t\t\tdebounced(...args);\n\t\t};\n\t};\n}\n",
34
+ "import type { Method } from '../types';\nimport { debounce as legacyDebounce } from './legacy/debounce';\nimport { debounce as standardDebounce } from './standard/debounce';\nimport { methodDecoratorBridge } from './bridge';\n\n/**\n * A decorator to debounce a method.\n * @param timeout The debounce timeout in milliseconds.\n */\nexport function debounce(timeout: number) {\n\tfunction decorator<Host extends object, TMethod extends Method>(\n\t\tprotoOrTarget: TMethod,\n\t\tnameOrContext: ClassMethodDecoratorContext<Host, TMethod>,\n\t): Method;\n\tfunction decorator(\n\t\tprotoOrTarget: object,\n\t\tnameOrContext: string,\n\t\tdescriptor: TypedPropertyDescriptor<Method>,\n\t): TypedPropertyDescriptor<Method> | void;\n\tfunction decorator(\n\t\tprotoOrTarget: object | Method,\n\t\tnameOrContext: string | ClassMethodDecoratorContext<object, Method>,\n\t\tdescriptor?: TypedPropertyDescriptor<Method>,\n\t): Method | TypedPropertyDescriptor<Method> | void {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardDebounce(timeout),\n\t\t\tlegacyDebounce(timeout),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n",
35
+ "import type { RadiantElement } from '../core/radiant-element';\n\nexport interface EventEmitterConfig {\n\tname: string;\n\tbubbles?: boolean;\n\tcancelable?: boolean;\n\tcomposed?: boolean;\n}\n\n/**\n * A generic event emitter class that allows emitting custom events.\n *\n * @template T - The type of the event detail.\n */\nexport class EventEmitter<T = unknown> {\n\tprivate host: RadiantElement;\n\tprivate eventConfig: EventEmitterConfig;\n\n\t/**\n\t * Constructs a new instance of the EventEmitter class.\n\t *\n\t * @param host - The host element on which the events will be dispatched.\n\t * @param eventConfig - The configuration for the event.\n\t */\n\tconstructor(host: RadiantElement, eventConfig: EventEmitterConfig) {\n\t\tthis.host = host;\n\t\tthis.eventConfig = eventConfig;\n\t}\n\n\t/**\n\t * Emits a custom event with the specified detail.\n\t *\n\t * @param detail - The detail object to be passed along with the event.\n\t */\n\temit(detail?: T) {\n\t\tconst event = new CustomEvent(this.eventConfig.name, {\n\t\t\tdetail: detail,\n\t\t\tbubbles: this.eventConfig.bubbles,\n\t\t\tcancelable: this.eventConfig.cancelable,\n\t\t\tcomposed: this.eventConfig.composed,\n\t\t});\n\t\tthis.host.dispatchEvent(event);\n\t}\n}\n",
36
+ "import type { RadiantElement } from '../core/radiant-element';\nimport { EventEmitter, type EventEmitterConfig } from '../tools/event-emitter';\n\n/**\n * Creates an EventEmitter bound to a host element and registers it on the host.\n * Functional equivalent of the `@event` decorator for vanilla JS usage.\n * @param host The host element that will dispatch the events.\n * @param config {@link EventEmitterConfig} The event emitter configuration.\n */\nexport function createEvent<T = unknown>(host: RadiantElement, config: EventEmitterConfig): EventEmitter<T> {\n\tconst emitter = new EventEmitter<T>(host, config);\n\thost.registerEventEmitter(config.name, emitter);\n\treturn emitter;\n}\n",
37
+ "import type { RadiantElement } from '../../core/radiant-element';\nimport { createEvent } from '../../helpers/create-event';\nimport type { EventEmitterConfig } from '../../tools/event-emitter';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\n/**\n * Decorator that attaches an EventEmitter to the class field property.\n * The EventEmitter can be used to dispatch custom events from the target element.\n * @param eventConfig Configuration for the event emitter.\n * @see {@link EventEmitter} for more details about how the EventEmitter works.\n */\nexport function event(eventConfig: EventEmitterConfig) {\n\treturn (proto: RadiantElement, propertyKey: string) => {\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tconst emitter = createEvent(element, eventConfig);\n\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tObject.defineProperty(element, propertyKey, {\n\t\t\t\t\tget() {\n\t\t\t\t\t\treturn emitter;\n\t\t\t\t\t},\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n}\n",
38
+ "import type { RadiantElement } from '../../core/radiant-element';\nimport { createEvent } from '../../helpers/create-event';\nimport type { EventEmitterConfig } from '../../tools/event-emitter';\n\n/**\n * Decorator that attaches an EventEmitter to the class field property.\n * The EventEmitter can be used to dispatch custom events from the target element.\n * @param eventConfig Configuration for the event emitter.\n * @see {@link EventEmitter} for more details about how the EventEmitter works.\n */\nexport function event(eventConfig: EventEmitterConfig) {\n\treturn function <T extends RadiantElement, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst emitter = createEvent(this, eventConfig);\n\n\t\t\tObject.defineProperty(this, context.name, {\n\t\t\t\tget() {\n\t\t\t\t\treturn emitter;\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t});\n\t};\n}\n",
39
+ "import { type EventEmitterConfig } from '../tools/event-emitter';\nimport type { RadiantElement } from '../core/radiant-element';\nimport { event as legacyEvent } from './legacy/event';\nimport { event as standardEvent } from './standard/event';\nimport { fieldDecoratorBridge } from './bridge';\n\n/**\n * Decorator that attaches an EventEmitter to the class field property.\n * The EventEmitter can be used to dispatch custom events from the target element.\n * @param eventConfig {@link EventEmitterConfig} Configuration for the event emitter.\n * @see {@link EventEmitter} for more details about how the EventEmitter works.\n */\nexport function event(eventConfig: EventEmitterConfig) {\n\tfunction decorator<THost extends RadiantElement, TValue>(\n\t\tprotoOrTarget: undefined,\n\t\tnameOrContext: ClassFieldDecoratorContext<THost, TValue>,\n\t): void;\n\tfunction decorator(protoOrTarget: RadiantElement, nameOrContext: string): void;\n\tfunction decorator(\n\t\tprotoOrTarget: RadiantElement | undefined,\n\t\tnameOrContext: string | ClassFieldDecoratorContext<RadiantElement, unknown>,\n\t): void {\n\t\treturn fieldDecoratorBridge(standardEvent(eventConfig), legacyEvent(eventConfig), protoOrTarget, nameOrContext);\n\t}\n\n\treturn decorator;\n}\n",
40
+ "import type { RadiantElementEventListener } from '../core/radiant-element';\n\n/**\n * Selects which DOM tree delegated event listeners should observe.\n */\nexport type OnEventScope = 'light' | 'shadow' | 'both';\n\ntype BaseOnEventConfig = Pick<RadiantElementEventListener, 'type' | 'options'> & {\n\tscope?: OnEventScope;\n};\n\nexport type OnEventConfig = BaseOnEventConfig &\n\t(\n\t\t| {\n\t\t\t\tselector: string;\n\t\t }\n\t\t| {\n\t\t\t\tref: string;\n\t\t }\n\t\t| {\n\t\t\t\twindow: true;\n\t\t }\n\t\t| {\n\t\t\t\tdocument: true;\n\t\t }\n\t);\n\ntype DelegatedEventRoot = Element | ShadowRoot;\n\ntype EventListenerLifecycleHost = {\n\tregisterConnectedCallback(callback: () => void): void;\n\tregisterCleanupCallback(callback: () => void): void;\n\tisConnected: boolean;\n};\n\nexport type EventListenerHost =\n\t| (EventListenerLifecycleHost & Element)\n\t| (EventListenerLifecycleHost & { host: Element })\n\t| (EventListenerLifecycleHost & { element: Element });\n\nconst shadowRootListenerHooksKey = Symbol('radiant.shadowRootListenerHooks');\nconst patchedAttachShadowKey = Symbol('radiant.patchedAttachShadow');\n\ntype ShadowRootHookHost = Element & {\n\t[patchedAttachShadowKey]?: true;\n\t[shadowRootListenerHooksKey]?: Set<() => void>;\n};\n\nfunction resolveEventListenerHostElement(host: EventListenerHost): Element {\n\tif (host instanceof Element) {\n\t\treturn host;\n\t}\n\n\tif ('host' in host) {\n\t\treturn host.host;\n\t}\n\n\treturn host.element;\n}\n\nfunction isControllerEventHost(host: EventListenerHost): host is EventListenerLifecycleHost & { host: Element } {\n\treturn !(host instanceof Element);\n}\n\nfunction addDelegatedListener(\n\troot: DelegatedEventRoot,\n\tconfig: Pick<OnEventConfig, 'type' | 'options'>,\n\tselector: string,\n\tlistener: EventListener,\n): () => void {\n\tconst delegatedListener = (event: Event) => {\n\t\tif (event.target instanceof Element && event.target.matches(selector)) {\n\t\t\tlistener(event);\n\t\t}\n\t};\n\n\troot.addEventListener(config.type, delegatedListener, config.options);\n\n\treturn () => {\n\t\troot.removeEventListener(config.type, delegatedListener, config.options);\n\t};\n}\n\nfunction registerShadowRootHook(host: EventListenerHost, hook: () => void): void {\n\tconst shadowAwareHost = resolveEventListenerHostElement(host) as ShadowRootHookHost;\n\n\tif (!shadowAwareHost[shadowRootListenerHooksKey]) {\n\t\tshadowAwareHost[shadowRootListenerHooksKey] = new Set();\n\t}\n\n\tshadowAwareHost[shadowRootListenerHooksKey].add(hook);\n\n\tif (shadowAwareHost[patchedAttachShadowKey]) {\n\t\treturn;\n\t}\n\n\tconst originalAttachShadow = shadowAwareHost.attachShadow;\n\n\tshadowAwareHost.attachShadow = function patchedAttachShadow(init: ShadowRootInit): ShadowRoot {\n\t\tconst shadowRoot = originalAttachShadow.call(this, init);\n\t\tfor (const shadowRootHook of shadowAwareHost[shadowRootListenerHooksKey] ?? []) {\n\t\t\tshadowRootHook();\n\t\t}\n\t\treturn shadowRoot;\n\t};\n\n\tshadowAwareHost[patchedAttachShadowKey] = true;\n}\n\n/**\n * Subscribes to a DOM event with delegation, window, or document targeting.\n * Functional equivalent of the `@onEvent` decorator for vanilla JS usage.\n * Returns a cleanup function to remove the listener.\n * @param host The host RadiantElement.\n * @param config The event listener configuration.\n * @param callback The event handler function.\n */\nexport function createEventListener(\n\thost: EventListenerHost,\n\tconfig: OnEventConfig,\n\tcallback: (event: Event) => void,\n): () => void {\n\tif (isControllerEventHost(host) && 'scope' in config && config.scope && config.scope !== 'light') {\n\t\tthrow new Error('RadiantController event listeners only support light DOM scope.');\n\t}\n\n\tconst hostElement = resolveEventListenerHostElement(host);\n\tconst boundCallback = callback.bind(host);\n\tlet windowCleanup: (() => void) | null = null;\n\tlet documentCleanup: (() => void) | null = null;\n\tlet lightCleanup: (() => void) | null = null;\n\tlet shadowCleanup: (() => void) | null = null;\n\tlet disposed = false;\n\n\tconst detachListeners = () => {\n\t\twindowCleanup?.();\n\t\tdocumentCleanup?.();\n\t\tlightCleanup?.();\n\t\tshadowCleanup?.();\n\n\t\twindowCleanup = null;\n\t\tdocumentCleanup = null;\n\t\tlightCleanup = null;\n\t\tshadowCleanup = null;\n\t};\n\n\tconst attachListeners = () => {\n\t\tif (disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ('window' in config && !windowCleanup) {\n\t\t\twindow.addEventListener(config.type, boundCallback, config.options);\n\t\t\twindowCleanup = () => {\n\t\t\t\twindow.removeEventListener(config.type, boundCallback, config.options);\n\t\t\t};\n\t\t}\n\n\t\tif ('document' in config && !documentCleanup) {\n\t\t\tdocument.addEventListener(config.type, boundCallback, config.options);\n\t\t\tdocumentCleanup = () => {\n\t\t\t\tdocument.removeEventListener(config.type, boundCallback, config.options);\n\t\t\t};\n\t\t}\n\n\t\tif ('selector' in config || 'ref' in config) {\n\t\t\tconst selector = 'selector' in config ? config.selector : `[data-ref='${CSS.escape(config.ref)}']`;\n\n\t\t\tif (config.scope !== 'shadow' && !lightCleanup) {\n\t\t\t\tlightCleanup = addDelegatedListener(hostElement, config, selector, boundCallback);\n\t\t\t}\n\n\t\t\tif (config.scope !== 'light' && hostElement.shadowRoot && !shadowCleanup) {\n\t\t\t\tshadowCleanup = addDelegatedListener(hostElement.shadowRoot, config, selector, boundCallback);\n\t\t\t}\n\t\t}\n\t};\n\n\tif ('selector' in config || 'ref' in config) {\n\t\tif (config.scope !== 'light') {\n\t\t\tregisterShadowRootHook(host, () => {\n\t\t\t\tif (host.isConnected) {\n\t\t\t\t\tattachListeners();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\thost.registerConnectedCallback(attachListeners);\n\thost.registerCleanupCallback(detachListeners);\n\n\tif (host.isConnected) {\n\t\tattachListeners();\n\t}\n\n\treturn () => {\n\t\tdisposed = true;\n\t\tdetachListeners();\n\t};\n}\n",
41
+ "import { createEventListener, type EventListenerHost } from '../../helpers/create-event-listener';\nimport type { OnEventConfig } from '../on-event';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n *\n * @param eventConfig The event configuration.\n * @param eventConfig.selectors The CSS selector(s) of the target element(s).\n * @param eventConfig.ref The data-ref attribute of the target element.\n * @param eventConfig.type The type of the event to listen for.\n * @param eventConfig.options Optional. An options object that specifies characteristics about the event listener.\n */\nexport function onEvent(eventConfig: OnEventConfig) {\n\treturn (proto: EventListenerHost, _: string, descriptor: PropertyDescriptor) => {\n\t\tconst originalMethod = descriptor.value;\n\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tcreateEventListener(element, eventConfig, originalMethod.bind(element));\n\t\t});\n\n\t\treturn descriptor;\n\t};\n}\n",
42
+ "import { createEventListener, type EventListenerHost } from '../../helpers/create-event-listener';\nimport type { OnEventConfig } from '../on-event';\nimport type { Method } from '../../types';\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n *\n * @param eventConfig The event configuration.\n * @param eventConfig.selectors The CSS selector(s) of the target element(s).\n * @param eventConfig.ref The data-ref attribute of the target element.\n * @param eventConfig.type The type of the event to listen for.\n * @param eventConfig.options Optional. An options object that specifies characteristics about the event listener.\n */\nexport function onEvent(eventConfig: OnEventConfig) {\n\treturn function <Host extends EventListenerHost, T extends Method>(\n\t\toriginalMethod: T,\n\t\tcontext: ClassMethodDecoratorContext<Host, T>,\n\t): void {\n\t\tcontext.addInitializer(function (this: Host) {\n\t\t\tcreateEventListener(this, eventConfig, originalMethod.bind(this));\n\t\t});\n\t};\n}\n",
43
+ "import type { Method } from '../types';\nimport type { EventListenerHost, OnEventConfig, OnEventScope } from '../helpers/create-event-listener';\nimport { onEvent as legacyOnEvent } from './legacy/on-event';\nimport { onEvent as standardOnEvent } from './standard/on-event';\nimport { methodDecoratorBridge } from './bridge';\n\nexport type { OnEventConfig, OnEventScope };\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n * Delegated listeners observe the host light DOM by default, and can optionally observe the shadow root or both trees.\n *\n * @param options {@link OnEventConfig} The event configuration.\n */\nexport function onEvent(options: OnEventConfig) {\n\tfunction decorator<Host extends EventListenerHost, TMethod extends Method>(\n\t\tprotoOrTarget: TMethod,\n\t\tnameOrContext: ClassMethodDecoratorContext<Host, TMethod>,\n\t): void;\n\tfunction decorator(\n\t\tprotoOrTarget: EventListenerHost,\n\t\tnameOrContext: string,\n\t\tdescriptor: TypedPropertyDescriptor<Method>,\n\t): TypedPropertyDescriptor<Method> | void;\n\tfunction decorator(\n\t\tprotoOrTarget: EventListenerHost | Method,\n\t\tnameOrContext: string | ClassMethodDecoratorContext<EventListenerHost, Method>,\n\t\tdescriptor?: TypedPropertyDescriptor<Method>,\n\t): TypedPropertyDescriptor<Method> | void {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnEvent(options),\n\t\t\tlegacyOnEvent(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n",
44
+ "type LegacyUpdatedHost = {\n\tregisterCleanupCallback(callback: () => void): void;\n\tregisterConnectedCallback(callback: () => void): void;\n\tregisterUpdateCallback(key: string, update: (...rest: any[]) => any): () => void;\n};\n\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\n/**\n * A decorator to subscribe to an updated callback when a reactive field or property changes.\n * @param eventConfig The event configuration.\n */\nexport function onUpdated(keyOrKeys: string | string[]) {\n\treturn (target: LegacyUpdatedHost, methodName: string) => {\n\t\tconst cleanupKey = Symbol(`@ecopages/radiant/on-updated:${methodName}:cleanup`);\n\n\t\tregisterLegacyInstanceInitializer(target, (element) => {\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tconst boundedMethod = (element as any)[methodName].bind(element);\n\t\t\t\tconst cleanups: Array<() => void> = [];\n\n\t\t\t\tif (Array.isArray(keyOrKeys)) {\n\t\t\t\t\tfor (const key of keyOrKeys) {\n\t\t\t\t\t\tcleanups.push(element.registerUpdateCallback(key, boundedMethod));\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof keyOrKeys === 'string') {\n\t\t\t\t\tcleanups.push(element.registerUpdateCallback(keyOrKeys, boundedMethod));\n\t\t\t\t}\n\n\t\t\t\t(element as unknown as Record<PropertyKey, unknown>)[cleanupKey] = () => {\n\t\t\t\t\tfor (const cleanup of cleanups) {\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t});\n\n\t\t\telement.registerCleanupCallback(() => {\n\t\t\t\tconst cleanup = (element as unknown as Record<PropertyKey, unknown>)[cleanupKey];\n\n\t\t\t\tif (typeof cleanup === 'function') {\n\t\t\t\t\tcleanup();\n\t\t\t\t\tdelete (element as unknown as Record<PropertyKey, unknown>)[cleanupKey];\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t};\n}\n",
45
+ "import type { Method } from '../../types';\n\ntype UpdatedHost = {\n\tregisterUpdateCallback(key: string, update: (...args: unknown[]) => unknown): () => void;\n};\n\nexport function onUpdated(keyOrKeys: string | string[]) {\n\treturn function <THost extends UpdatedHost, T extends Method>(\n\t\toriginalMethod: T,\n\t\tcontext: ClassMethodDecoratorContext<THost, T>,\n\t): void {\n\t\tcontext.addInitializer(function (this: THost) {\n\t\t\tconst boundMethod = originalMethod.bind(this);\n\n\t\t\tObject.defineProperty(this, context.name, {\n\t\t\t\tvalue: boundMethod,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t});\n\n\t\t\tif (Array.isArray(keyOrKeys)) {\n\t\t\t\tfor (const key of keyOrKeys) {\n\t\t\t\t\tthis.registerUpdateCallback(key, boundMethod);\n\t\t\t\t}\n\t\t\t} else if (typeof keyOrKeys === 'string') {\n\t\t\t\tthis.registerUpdateCallback(keyOrKeys, boundMethod);\n\t\t\t}\n\t\t});\n\t};\n}\n",
46
+ "import type { Method } from '../types';\nimport { onUpdated as legacyOnUpdated } from './legacy/on-updated';\nimport { onUpdated as standardOnUpdated } from './standard/on-updated';\nimport { methodDecoratorBridge } from './bridge';\n\ntype UpdateCallback = (...args: unknown[]) => unknown;\n\ntype UpdatedHost = {\n\tregisterCleanupCallback(callback: () => void): void;\n\tregisterConnectedCallback(callback: () => void): void;\n\tregisterUpdateCallback(key: string, update: UpdateCallback): () => void;\n};\n\n/**\n * A decorator to bind a method to the instance.\n */\nexport function onUpdated(keyOrKeys: string | string[]) {\n\tfunction decorator<THost extends UpdatedHost, TMethod extends Method>(\n\t\tprotoOrTarget: TMethod,\n\t\tnameOrContext: ClassMethodDecoratorContext<THost, TMethod>,\n\t): void;\n\tfunction decorator(\n\t\tprotoOrTarget: UpdatedHost,\n\t\tnameOrContext: string,\n\t\tdescriptor: TypedPropertyDescriptor<Method>,\n\t): TypedPropertyDescriptor<Method> | void;\n\tfunction decorator(\n\t\tprotoOrTarget: UpdatedHost | Method,\n\t\tnameOrContext: string | ClassMethodDecoratorContext<UpdatedHost, Method>,\n\t\tdescriptor?: TypedPropertyDescriptor<Method>,\n\t): TypedPropertyDescriptor<Method> | void {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnUpdated(keyOrKeys),\n\t\t\tlegacyOnUpdated(keyOrKeys),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n",
47
+ "import type { ReactivePropertyOptions } from './radiant-element';\n\nconst REACTIVE_PROP_DEFINITIONS = Symbol.for('@ecopages/radiant.reactivePropDefinitions');\n\nexport type ReactivePropDefinition = {\n\tname: string;\n\toptions: ReactivePropertyOptions<unknown>;\n};\n\ntype RadiantConstructorWithReactiveProps = CustomElementConstructor & {\n\t[REACTIVE_PROP_DEFINITIONS]?: ReactivePropDefinition[];\n};\n\nexport function registerReactivePropDefinition(\n\ttarget: object,\n\tpropertyName: string,\n\toptions: ReactivePropertyOptions<unknown>,\n): void {\n\tconst constructor = target.constructor as RadiantConstructorWithReactiveProps;\n\tconst definitions = constructor[REACTIVE_PROP_DEFINITIONS] ?? [];\n\n\tif (definitions.some((definition) => definition.name === propertyName)) {\n\t\treturn;\n\t}\n\n\tdefinitions.push({ name: propertyName, options });\n\tconstructor[REACTIVE_PROP_DEFINITIONS] = definitions;\n}\n\nexport function getReactivePropDefinitions(target: object): ReactivePropDefinition[] {\n\treturn ((target.constructor as RadiantConstructorWithReactiveProps)[REACTIVE_PROP_DEFINITIONS] ?? []).slice();\n}\n",
48
+ "import type { ReactivePropertyOptions } from '../../core/radiant-element';\nimport { registerReactivePropDefinition } from '../../core/reactive-prop-metadata';\nimport { isValueOfType } from '../../utils/attribute-utils';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\ntype ReactivePropHost<T> = {\n\tcreateReactiveProp(propertyName: string, options: ReactivePropertyOptions<T>): void;\n\tregisterConnectedCallback(callback: () => void): void;\n};\n\n/**\n * Legacy-decorator implementation for `@prop(...)`.\n *\n * The decorated host is expected to expose `createReactiveProp(...)`, which\n * lets both `RadiantElement` and `RadiantController` share the same public\n * decorator while keeping their runtime channels different.\n */\nexport function reactiveProp<T = unknown>({\n\ttype,\n\tattribute,\n\treflect,\n\tdefaultValue,\n\tbind,\n}: ReactivePropertyOptions<T>) {\n\tif (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n\t\tthrow new Error(`defaultValue does not match the expected type for ${type.name}`);\n\t}\n\n\treturn (target: ReactivePropHost<T>, propertyName: string) => {\n\t\tconst attributeKey = attribute ?? propertyName;\n\t\tregisterReactivePropDefinition(target, propertyName, {\n\t\t\ttype,\n\t\t\treflect,\n\t\t\tattribute: attributeKey,\n\t\t\tdefaultValue,\n\t\t\tbind,\n\t\t});\n\n\t\tconst ssrStoreKey = Symbol.for(`@ecopages/radiant.ssr-prop:${propertyName}`);\n\n\t\tObject.defineProperty(target, propertyName, {\n\t\t\tget(this: ReactivePropHost<T> & Record<PropertyKey, unknown>) {\n\t\t\t\treturn this[ssrStoreKey] ?? defaultValue;\n\t\t\t},\n\t\t\tset(this: ReactivePropHost<T> & Record<PropertyKey, unknown>, value: T) {\n\t\t\t\tthis[ssrStoreKey] = value;\n\t\t\t},\n\t\t\tconfigurable: true,\n\t\t\tenumerable: true,\n\t\t});\n\n\t\tregisterLegacyInstanceInitializer(target, (element) => {\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tconst initializerValue = element[propertyName as keyof typeof element] as T | undefined;\n\t\t\t\tconst resolvedDefaultValue = defaultValue === undefined ? initializerValue : defaultValue;\n\n\t\t\t\telement.createReactiveProp(propertyName, {\n\t\t\t\t\ttype,\n\t\t\t\t\treflect,\n\t\t\t\t\tattribute: attributeKey,\n\t\t\t\t\tdefaultValue: resolvedDefaultValue,\n\t\t\t\t\tbind,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n}\n",
49
+ "import type { ReactivePropertyOptions } from '../../core/radiant-element.js';\nimport { registerReactivePropDefinition } from '../../core/reactive-prop-metadata';\nimport { isValueOfType } from '../../utils/attribute-utils';\n\ntype ReactivePropHost<P> = {\n\tcreateReactiveProp(propertyName: string, options: ReactivePropertyOptions<P>): void;\n};\n\n/**\n * Standard-decorator implementation for `@prop(...)`.\n *\n * The decorated host is expected to expose `createReactiveProp(...)`, which\n * lets both `RadiantElement` and `RadiantController` share the same public\n * decorator while keeping their runtime channels different.\n */\nexport function reactiveProp<P = unknown>({\n\ttype,\n\tattribute,\n\treflect,\n\tdefaultValue,\n\tbind,\n}: ReactivePropertyOptions<P>) {\n\tif (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n\t\tthrow new Error(`defaultValue does not match the expected type for ${type.name}`);\n\t}\n\treturn function <T extends ReactivePropHost<P>, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\t\tconst propertyName = String(context.name);\n\t\tconst attributeKey = attribute ?? propertyName;\n\t\tconst initializerValueKey = Symbol(`@ecopages/radiant/reactive-prop:${propertyName}:initializer`);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst initializerValue = (this as T & Record<PropertyKey, V | undefined>)[initializerValueKey];\n\t\t\tconst resolvedDefaultValue = (defaultValue === undefined ? initializerValue : defaultValue) as\n\t\t\t\t| P\n\t\t\t\t| undefined;\n\n\t\t\tregisterReactivePropDefinition(this, propertyName, {\n\t\t\t\ttype,\n\t\t\t\treflect,\n\t\t\t\tattribute: attributeKey,\n\t\t\t\tdefaultValue,\n\t\t\t\tbind,\n\t\t\t});\n\t\t\tthis.createReactiveProp(propertyName, {\n\t\t\t\ttype,\n\t\t\t\treflect,\n\t\t\t\tattribute: attributeKey,\n\t\t\t\tdefaultValue: resolvedDefaultValue,\n\t\t\t\tbind,\n\t\t\t});\n\t\t});\n\n\t\treturn function (this: T, value: V) {\n\t\t\t(this as Record<PropertyKey, V | undefined>)[initializerValueKey] = value;\n\t\t\treturn value;\n\t\t};\n\t};\n}\n",
50
+ "import type { ReactivePropertyOptions } from '../core/radiant-element';\nimport { reactiveProp as legacyReactiveProp } from './legacy/reactive-prop';\nimport { reactiveProp as standardReactiveProp } from './standard/reactive-prop';\nimport { fieldDecoratorBridge } from './bridge';\n\ntype StandardReactivePropHost<T> = {\n\tcreateReactiveProp(propertyName: string, options: ReactivePropertyOptions<T>): void;\n};\n\ntype LegacyReactivePropHost<T> = StandardReactivePropHost<T> & {\n\tregisterConnectedCallback(callback: () => void): void;\n};\n\n/**\n * Declares a reactive property on a Radiant host.\n *\n * On `RadiantElement`, the property stays aligned with the element attribute\n * channel and can optionally reflect back to markup. On `RadiantController`,\n * the property is exposed through the attached host element as a real JS\n * property so callers can pass objects, arrays, and other non-string values\n * without serializing them into attributes.\n *\n * Every write triggers `notifyUpdate` so update callbacks, bindings, and\n * render lifecycles stay in sync.\n *\n * @param options {@link ReactivePropertyOptions} The options for the reactive property.\n */\nexport function prop<T = unknown>(options: ReactivePropertyOptions<T>) {\n\tfunction decorator<THost extends StandardReactivePropHost<T>, TValue>(\n\t\tprotoOrTarget: undefined,\n\t\tnameOrContext: ClassFieldDecoratorContext<THost, TValue>,\n\t): ((this: THost, value: TValue) => TValue) | void;\n\tfunction decorator(protoOrTarget: LegacyReactivePropHost<T>, nameOrContext: string): void;\n\tfunction decorator(\n\t\tprotoOrTarget: LegacyReactivePropHost<T> | undefined,\n\t\tnameOrContext: string | ClassFieldDecoratorContext<StandardReactivePropHost<T>, unknown>,\n\t): ((this: StandardReactivePropHost<T>, value: unknown) => unknown) | void {\n\t\treturn fieldDecoratorBridge(\n\t\t\tstandardReactiveProp(options),\n\t\t\tlegacyReactiveProp(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n",
51
+ "type BaseQueryConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tscope?: QueryScope;\n};\n\ntype QueryBySelector = { selector: string };\n\ntype QueryByRef = { ref: string };\n\nexport type QueryHostTarget = Element | { host: Element };\n\n/**\n * Selects which DOM tree a query should read from.\n */\nexport type QueryScope = 'light' | 'shadow' | 'both';\n\nexport type QueryConfig = BaseQueryConfig & (QueryBySelector | QueryByRef);\n\ntype QueryRoot = Element | ShadowRoot;\n\ntype QueryResult<T extends Element | Element[]> = {\n\tget value(): T | null;\n};\n\nfunction isControllerQueryTarget(target: QueryHostTarget): target is { host: Element } {\n\treturn !(target instanceof Element);\n}\n\nfunction resolveShadowRoot(host: Element): ShadowRoot | null {\n\treturn 'shadowRoot' in host ? ((host as Element & { shadowRoot?: ShadowRoot | null }).shadowRoot ?? null) : null;\n}\n\n/**\n * Resolves the DOM element that should serve as the query root.\n *\n * `@query(...)` can run on both element hosts and controller instances. This\n * helper normalizes those call sites to the underlying element that actually\n * owns the DOM subtree.\n */\nexport function resolveQueryHost(target: QueryHostTarget): Element {\n\treturn target instanceof Element ? target : target.host;\n}\n\nfunction getQueryRoots(host: Element, scope: QueryScope = 'light'): QueryRoot[] {\n\tconst shadowRoot = resolveShadowRoot(host);\n\n\tif (scope === 'shadow') {\n\t\treturn shadowRoot ? [shadowRoot] : [];\n\t}\n\n\tif (scope === 'both') {\n\t\treturn shadowRoot ? [host, shadowRoot] : [host];\n\t}\n\n\treturn [host];\n}\n\n/**\n * Creates a lazy DOM query accessor bound to an element host or controller.\n * Functional equivalent of the `@query` decorator for vanilla JS usage.\n * @param target The element host or controller to query within.\n * @param options {@link QueryConfig} The query configuration.\n */\nexport function createQuery<T extends Element | Element[] = Element>(\n\ttarget: QueryHostTarget,\n\toptions: QueryConfig,\n): QueryResult<T> {\n\tif (isControllerQueryTarget(target) && options.scope && options.scope !== 'light') {\n\t\tthrow new Error('RadiantController queries only support light DOM scope.');\n\t}\n\n\tconst host = resolveQueryHost(target);\n\tconst selector = 'selector' in options ? options.selector : `[data-ref=\"${options.ref}\"]`;\n\tlet cached: T | null = null;\n\n\tconst executeQuery = (): T | null => {\n\t\tconst roots = getQueryRoots(host, options.scope);\n\n\t\tif (options.all) {\n\t\t\treturn roots.flatMap((root) => Array.from(root.querySelectorAll(selector))) as T;\n\t\t}\n\n\t\tfor (const root of roots) {\n\t\t\tconst match = root.querySelector(selector);\n\t\t\tif (match) {\n\t\t\t\treturn match as T;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache) {\n\t\t\t\tif (cached === null || (options.all && Array.isArray(cached) && !cached.length)) {\n\t\t\t\t\tcached = executeQuery();\n\t\t\t\t}\n\t\t\t\treturn cached;\n\t\t\t}\n\t\t\treturn executeQuery();\n\t\t},\n\t};\n}\n",
52
+ "import { createQuery } from '../../helpers/create-query';\nimport type { QueryConfig } from '../query';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\ntype QueryDecoratorInstance = (Element | { host: Element }) & {\n\tregisterConnectedCallback(callback: () => void): void;\n};\n\n/**\n * A decorator to query by CSS selector or data-ref attribute.\n * By default it queries for the first element that matches the selector, but it can be configured to query for all elements.\n *\n * @param {QueryConfig} options - The configuration object for the query.\n * @param {boolean} [options.all] - A flag to query for all elements that match the selector. Defaults to `false`.\n * @param {boolean} [options.cache] - A flag to cache the query result. Defaults to `true`.\n * @param {string} [options.selector] - A CSS selector to match elements against. This property is mutually exclusive with `options.ref`.\n * @param {string} [options.ref] - A reference to an element. This property is mutually exclusive with `options.selector`.\n *\n * @returns {Function} A decorator function that, when applied to a class property, will replace it with a getter. The getter will return the result of the query when accessed.\n *\n * @example\n * class MyElement extends HTMLElement {\n * @query({ selector: '.my-class' })\n * myElement;\n * }\n *\n * // Now, `myElement` will return the first element in the light DOM of `MyElement` that matches the selector '.my-class'.\n */\nexport function query<T extends Element | Element[]>({\n\tcache: shouldBeCached = true,\n\t...options\n}: QueryConfig): (proto: QueryDecoratorInstance, propertyName: string | symbol) => void {\n\treturn (proto: QueryDecoratorInstance, propertyKey: string | symbol) => {\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tconst accessor = createQuery<T>(element, {\n\t\t\t\t\tcache: shouldBeCached,\n\t\t\t\t\t...options,\n\t\t\t\t});\n\n\t\t\t\tObject.defineProperty(element, propertyKey, {\n\t\t\t\t\tget() {\n\t\t\t\t\t\treturn accessor.value;\n\t\t\t\t\t},\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n}\n",
53
+ "import { createQuery, type QueryHostTarget } from '../../helpers/create-query';\nimport type { QueryConfig } from '../query';\n\nexport function query(options: QueryConfig) {\n\treturn function <T extends QueryHostTarget, V extends Element | Element[]>(\n\t\ttarget: undefined,\n\t\tcontext: ClassFieldDecoratorContext<T, V>,\n\t) {\n\t\tvoid target;\n\t\tconst propertyName = String(context.name);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst accessor = createQuery<V>(this, options);\n\n\t\t\tObject.defineProperty(this, propertyName, {\n\t\t\t\tget() {\n\t\t\t\t\treturn accessor.value;\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t});\n\t};\n}\n",
54
+ "import type { QueryConfig, QueryScope } from '../helpers/create-query';\nimport { query as legacyQuery } from './legacy/query';\nimport { query as standardQuery } from './standard/query';\nimport { fieldDecoratorBridge } from './bridge';\n\nexport type { QueryConfig, QueryScope };\n\ntype QueryDecoratorHost = (Element | { host: Element }) & {\n\tregisterConnectedCallback(callback: () => void): void;\n};\n\n/**\n * A decorator to query by CSS selector or data-ref attribute.\n * By default it queries for the first element that matches the selector, but it can be configured to query for all elements.\n * It caches the result only when `cache` is enabled.\n * Queries run against the host light DOM by default, but can be directed to the shadow root or both trees.\n * @param options {@link QueryConfig} The options for the reactive property.\n */\nexport function query<T extends Element | Element[]>(options: QueryConfig) {\n\tfunction decorator<Host extends QueryDecoratorHost>(\n\t\tprotoOrTarget: undefined,\n\t\tnameOrContext: ClassFieldDecoratorContext<Host, T>,\n\t): void;\n\tfunction decorator(protoOrTarget: QueryDecoratorHost, nameOrContext: string): void;\n\tfunction decorator(\n\t\tprotoOrTarget: QueryDecoratorHost | undefined,\n\t\tnameOrContext: string | ClassFieldDecoratorContext<QueryDecoratorHost, T>,\n\t): void {\n\t\treturn fieldDecoratorBridge(standardQuery(options), legacyQuery<T>(options), protoOrTarget, nameOrContext);\n\t}\n\n\treturn decorator;\n}\n",
55
+ "export type QuerySlotConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tname?: string;\n};\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElement<T extends Element = Element>(name?: string): T | null;\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n};\n\ntype QuerySlotResult<T extends Element | Element[]> = {\n\tget value(): T | null;\n};\n\n/**\n * Creates a lazy slot query accessor bound to a host element.\n * Functional equivalent of the `@querySlot` decorator for vanilla JS usage.\n * @param host The host element to query slots within.\n * @param options {@link QuerySlotConfig} The slot query configuration.\n */\nexport function createQuerySlot<T extends Element | Element[] = Element>(\n\thost: SlotQueryHost,\n\toptions: QuerySlotConfig = {},\n): QuerySlotResult<T> {\n\tlet cached: T | null = null;\n\tlet cachedVersion: number | undefined;\n\n\tconst executeQuery = (): T | null => {\n\t\tif (options.all) {\n\t\t\treturn (typeof host.getSlotElements === 'function' ? host.getSlotElements(options.name) : []) as T;\n\t\t}\n\t\treturn (typeof host.getSlotElement === 'function' ? host.getSlotElement(options.name) : null) as T | null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache === false) {\n\t\t\t\treturn executeQuery();\n\t\t\t}\n\n\t\t\tconst currentVersion = (host as unknown as Record<string, number | undefined>).slotProjectionVersion ?? 0;\n\n\t\t\tif (cachedVersion !== currentVersion) {\n\t\t\t\tcached = executeQuery();\n\t\t\t\tcachedVersion = currentVersion;\n\t\t\t}\n\n\t\t\treturn cached;\n\t\t},\n\t};\n}\n",
56
+ "import type { RadiantElement } from '../../core/radiant-element';\nimport { createQuerySlot } from '../../helpers/create-query-slot';\nimport { registerSsrPreparationCallback } from '../../core/ssr-preparation';\nimport type { QuerySlotConfig } from '../query-slot';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\ntype SlotQueryHost = RadiantElement & {\n\tgetSlotElement<T extends Element = Element>(name?: string): T | null;\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n\tslotProjectionVersion?: number;\n};\n\nexport function querySlot<T extends Element | Element[]>(\n\toptions: QuerySlotConfig = {},\n): (proto: RadiantElement, propertyName: string | symbol) => void {\n\treturn (proto: RadiantElement, propertyKey: string | symbol) => {\n\t\tconst hasDefinedInstanceQuery = (instance: SlotQueryHost) => {\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(instance, propertyKey);\n\t\t\treturn typeof descriptor?.get === 'function';\n\t\t};\n\n\t\tconst defineSlotQueryProperty = (instance: SlotQueryHost) => {\n\t\t\tif (hasDefinedInstanceQuery(instance)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst accessor = createQuerySlot<T>(instance, options);\n\n\t\t\tObject.defineProperty(instance, propertyKey, {\n\t\t\t\tget() {\n\t\t\t\t\treturn accessor.value;\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t};\n\n\t\tconst protoAccessorCache = new WeakMap<SlotQueryHost, ReturnType<typeof createQuerySlot<T>>>();\n\n\t\tObject.defineProperty(proto, propertyKey, {\n\t\t\tget(this: SlotQueryHost) {\n\t\t\t\tlet accessor = protoAccessorCache.get(this);\n\t\t\t\tif (!accessor) {\n\t\t\t\t\taccessor = createQuerySlot<T>(this, options);\n\t\t\t\t\tprotoAccessorCache.set(this, accessor);\n\t\t\t\t}\n\t\t\t\treturn accessor.value;\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tregisterSsrPreparationCallback(element, () => {\n\t\t\t\tdefineSlotQueryProperty(element as SlotQueryHost);\n\t\t\t});\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tdefineSlotQueryProperty(element as SlotQueryHost);\n\t\t\t});\n\t\t});\n\t};\n}\n",
57
+ "import { createQuerySlot } from '../../helpers/create-query-slot';\nimport type { QuerySlotConfig } from '../query-slot';\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElement<T extends Element = Element>(name?: string): T | null;\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n\tslotProjectionVersion?: number;\n};\n\nexport function querySlot(options: QuerySlotConfig = {}) {\n\treturn function <T extends SlotQueryHost, V extends Element | Element[]>(\n\t\ttarget: undefined,\n\t\tcontext: ClassFieldDecoratorContext<T, V>,\n\t) {\n\t\tvoid target;\n\t\tconst propertyName = String(context.name);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst accessor = createQuerySlot<V>(this, options);\n\n\t\t\tObject.defineProperty(this, propertyName, {\n\t\t\t\tget() {\n\t\t\t\t\treturn accessor.value;\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t});\n\t};\n}\n",
58
+ "import type { QuerySlotConfig } from '../helpers/create-query-slot';\nimport type { RadiantElement } from '../core/radiant-element';\nimport { querySlot as legacyQuerySlot } from './legacy/query-slot';\nimport { querySlot as standardQuerySlot } from './standard/query-slot';\nimport { fieldDecoratorBridge } from './bridge';\n\nexport type { QuerySlotConfig };\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElement<T extends Element = Element>(name?: string): T | null;\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n\tslotProjectionVersion?: number;\n};\n\n/**\n * Queries projected light-DOM content assigned to a RadiantElement slot.\n *\n * The decorator returns assigned elements from the default slot when `name` is\n * omitted, or from the named slot when `name` is provided. Results are cached\n * by default and automatically invalidated when slot projection changes.\n *\n * @param options Slot query options.\n */\nexport function querySlot<T extends Element | Element[]>(options: QuerySlotConfig = {}) {\n\tfunction decorator<THost extends SlotQueryHost>(\n\t\tprotoOrTarget: undefined,\n\t\tnameOrContext: ClassFieldDecoratorContext<THost, T>,\n\t): void;\n\tfunction decorator(protoOrTarget: RadiantElement, nameOrContext: string): void;\n\tfunction decorator(\n\t\tprotoOrTarget: RadiantElement | undefined,\n\t\tnameOrContext: string | ClassFieldDecoratorContext<SlotQueryHost, T>,\n\t): void {\n\t\treturn fieldDecoratorBridge(\n\t\t\tstandardQuerySlot(options),\n\t\t\tlegacyQuerySlot<T>(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n",
59
+ "import type { ReactiveHostLike } from '../../core/reactive-host';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\n/**\n * A decorator to define a reactive field.\n * Every time the property changes, the `updated` method will be called.\n * Due the fact the value is always undefined before the first update,\n * we are adding a `isDefined` WeakSet to track if the property has been defined.\n * @param target The target element.\n * @param propertyKey The property key.\n */\nexport function reactiveField(target: ReactiveHostLike, propertyKey: string) {\n\tregisterLegacyInstanceInitializer(target, (element) => {\n\t\telement.registerConnectedCallback(() => {\n\t\t\telement.createReactiveField(propertyKey, element[propertyKey as keyof typeof element], {\n\t\t\t\tbind:\n\t\t\t\t\t(\n\t\t\t\t\t\telement as unknown as { shouldAutoBindReactiveMembers?: () => boolean }\n\t\t\t\t\t).shouldAutoBindReactiveMembers?.() ?? false,\n\t\t\t});\n\t\t});\n\t});\n}\n",
60
+ "import type { ReactiveHostLike } from '../../core/reactive-host';\n\nexport function reactiveField<T extends ReactiveHostLike, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\tconst privatePropertyKey = Symbol(`__${String(context.name)}__value`);\n\n\tconst contextName = String(context.name);\n\n\tcontext.addInitializer(function (this: T) {\n\t\tthis.defineReactiveBinding(\n\t\t\tcontextName,\n\t\t\t(this as unknown as { shouldAutoBindReactiveMembers?: () => boolean }).shouldAutoBindReactiveMembers?.() ??\n\t\t\t\tfalse,\n\t\t);\n\t\tthis.registerReactiveDependencyReader(\n\t\t\tcontextName,\n\t\t\t() => (this as unknown as Record<PropertyKey, unknown>)[privatePropertyKey],\n\t\t);\n\n\t\tObject.defineProperty(this, context.name, {\n\t\t\tget() {\n\t\t\t\t(this as ReactiveHostLike).trackReactiveRead(contextName);\n\t\t\t\treturn (this as unknown as Record<PropertyKey, unknown>)[privatePropertyKey];\n\t\t\t},\n\t\t\tset(newValue: unknown) {\n\t\t\t\tconst oldValue = (this as unknown as Record<PropertyKey, unknown>)[privatePropertyKey];\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\t(this as unknown as Record<PropertyKey, unknown>)[privatePropertyKey] = newValue;\n\t\t\t\t\t(this as ReactiveHostLike).notifyUpdate(contextName, oldValue, newValue);\n\t\t\t\t}\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t});\n\n\treturn function (this: T, value: V) {\n\t\t(this as any)[privatePropertyKey] = value;\n\t\treturn value;\n\t};\n}\n",
61
+ "import type { ReactiveHostLike } from '../core/reactive-host';\nimport { reactiveField as legacyReactiveField } from './legacy/reactive-field';\nimport { reactiveField as standardReactiveField } from './standard/reactive-field';\nimport { fieldDecoratorBridge } from './bridge';\n\n/**\n * Declares internal mutable component state.\n *\n * Each write triggers `notifyUpdate` so update callbacks, bindings, and\n * `RadiantElement` renders stay in sync. When no explicit binding option\n * is supplied, `RadiantElement` hosts expose a JSX companion binding\n * accessor automatically while plain imperative hosts keep binding\n * opt-in.\n */\nexport function state<THost extends ReactiveHostLike, TValue>(\n\tprotoOrTarget: undefined,\n\tnameOrContext: ClassFieldDecoratorContext<THost, TValue>,\n): (this: THost, value: TValue) => TValue;\nexport function state(protoOrTarget: ReactiveHostLike, nameOrContext: string): void;\nexport function state(\n\tprotoOrTarget: ReactiveHostLike | undefined,\n\tnameOrContext: string | ClassFieldDecoratorContext<ReactiveHostLike, unknown>,\n): ((this: ReactiveHostLike, value: unknown) => unknown) | void {\n\treturn fieldDecoratorBridge(standardReactiveField, legacyReactiveField, protoOrTarget, nameOrContext);\n}\n"
5
62
  ],
6
- "mappings": "",
7
- "debugId": "9514635D470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tvgyg.js";import"../chunk-vgtggzb6.js";export{a as withSsrContextProviders,c as resolveSsrContextValue,b as resolveSsrContextProvider};
1
+ var b=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(q,u)=>(typeof require<"u"?require:q)[u]}):j)(function(j){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+j+'" is not supported')});var H=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function J(){return globalThis}function Q(j){J()[H]=j}function F(j){return J()[H]?.(j)}var z;function W(){if(z!==void 0)return z;try{let{AsyncLocalStorage:j}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return z=new j,z}catch{return z=null,null}}var U=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function Z(){let j=globalThis;return j[U]??=[],j[U]}function P(j){if(j.length===0)return()=>{return};let q=new Map;for(let w of j)q.set(w.getContextKey(),w);let u=W();if(u){let w=u.getStore()??[],h=[...w,q];return u.enterWith(h),()=>{u.enterWith(w)}}let y=Z();return y.push(q),()=>{let w=y.lastIndexOf(q);if(w>=0)y.splice(w,1)}}function $(j){let q=W()?.getStore()??Z();for(let u=q.length-1;u>=0;u-=1){let y=q[u]?.get(j);if(y)return y}return}function f(j){let q=$(j);if(!q)return;return q.getContext()}Q((j)=>$(j));export{P as withSsrContextProviders,f as resolveSsrContextValue,$ as resolveSsrContextProvider};
2
2
 
3
- //# debugId=49B5D2198851329C64756E2164756E21
3
+ //# debugId=01F111903D4A071B64756E2164756E21