@ecopages/radiant 0.3.0-alpha.9 → 0.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (564) hide show
  1. package/README.md +5 -5
  2. package/client/app-bootstrap.d.ts +19 -0
  3. package/client/app-bootstrap.js +3 -0
  4. package/client/app-bootstrap.js.map +10 -0
  5. package/client/hydrator.js +3 -0
  6. package/{dist/client → client}/hydrator.js.map +2 -2
  7. package/client/install-hydrator.js +3 -0
  8. package/{dist/client → client}/install-hydrator.js.map +2 -2
  9. package/context/context-consumer-bootstrap.js +3 -0
  10. package/{dist/context → context}/context-consumer-bootstrap.js.map +4 -4
  11. package/context/context-consumer-runtime.js +3 -0
  12. package/context/context-consumer-runtime.js.map +12 -0
  13. package/context/context-host.js +3 -0
  14. package/{dist/context → context}/context-host.js.map +2 -2
  15. package/context/context-provider.js +3 -0
  16. package/{dist/context → context}/context-provider.js.map +3 -3
  17. package/context/context-ssr-bridge.js +3 -0
  18. package/{dist/context → context}/context-ssr-bridge.js.map +2 -2
  19. package/context/create-context.js +3 -0
  20. package/{dist/context → context}/create-context.js.map +2 -2
  21. package/context/decorators/consume-context.js +3 -0
  22. package/context/decorators/consume-context.js.map +19 -0
  23. package/context/decorators/context-selection-delivery.js +3 -0
  24. package/{dist/context → context}/decorators/context-selection-delivery.js.map +2 -2
  25. package/context/decorators/context-selector.js +3 -0
  26. package/context/decorators/context-selector.js.map +22 -0
  27. package/context/decorators/legacy/consume-context.js +3 -0
  28. package/context/decorators/legacy/consume-context.js.map +16 -0
  29. package/context/decorators/legacy/context-selector-field.js +3 -0
  30. package/context/decorators/legacy/context-selector-field.js.map +17 -0
  31. package/context/decorators/legacy/context-selector.js +3 -0
  32. package/context/decorators/legacy/context-selector.js.map +17 -0
  33. package/context/decorators/legacy/provide-context.js +3 -0
  34. package/{dist/context → context}/decorators/legacy/provide-context.js.map +5 -5
  35. package/context/decorators/on-context-update.js +3 -0
  36. package/{dist/context → context}/decorators/on-context-update.js.map +6 -6
  37. package/context/decorators/provide-context.js +3 -0
  38. package/{dist/context → context}/decorators/provide-context.js.map +5 -5
  39. package/context/decorators/standard/consume-context.js +3 -0
  40. package/{dist/context → context}/decorators/standard/consume-context.js.map +4 -4
  41. package/context/decorators/standard/context-selector-field.js +3 -0
  42. package/{dist/context → context}/decorators/standard/context-selector-field.js.map +4 -4
  43. package/context/decorators/standard/context-selector.js +3 -0
  44. package/{dist/context → context}/decorators/standard/context-selector.js.map +4 -4
  45. package/context/decorators/standard/provide-context.js +3 -0
  46. package/{dist/context → context}/decorators/standard/provide-context.js.map +3 -3
  47. package/context/decorators/standard-legacy-dispatch.d.ts +6 -0
  48. package/context/decorators/standard-legacy-dispatch.js +3 -0
  49. package/context/decorators/standard-legacy-dispatch.js.map +10 -0
  50. package/context/events.js +3 -0
  51. package/context/events.js.map +10 -0
  52. package/context/hydration-script.js +3 -0
  53. package/{dist/context → context}/hydration-script.js.map +2 -2
  54. package/context/index.js +3 -0
  55. package/{dist/context → context}/index.js.map +13 -12
  56. package/controller-registry.js +3 -0
  57. package/{dist/controller-registry.js.map → controller-registry.js.map} +2 -2
  58. package/core/controller-metadata.js +3 -0
  59. package/{dist/core → core}/controller-metadata.js.map +2 -2
  60. package/core/custom-element-metadata.js +3 -0
  61. package/{dist/core → core}/custom-element-metadata.js.map +2 -2
  62. package/core/event-subscription-registry.d.ts +16 -0
  63. package/core/event-subscription-registry.js +3 -0
  64. package/core/event-subscription-registry.js.map +10 -0
  65. package/core/host-ssr-registry.d.ts +13 -0
  66. package/core/host-ssr-registry.js +3 -0
  67. package/core/host-ssr-registry.js.map +10 -0
  68. package/core/hydration-capable-host.d.ts +8 -0
  69. package/core/hydration-capable-host.js +3 -0
  70. package/core/hydration-capable-host.js.map +10 -0
  71. package/core/hydration-codec.js +3 -0
  72. package/{dist/core → core}/hydration-codec.js.map +2 -2
  73. package/{dist/core → core}/radiant-controller.d.ts +42 -20
  74. package/core/radiant-controller.js +3 -0
  75. package/core/radiant-controller.js.map +21 -0
  76. package/{dist/core/radiant-component-ssr.d.ts → core/radiant-element-ssr-host.d.ts} +16 -16
  77. package/core/radiant-element-ssr-host.js +3 -0
  78. package/core/radiant-element-ssr-host.js.map +10 -0
  79. package/core/radiant-element-ssr-registry.d.ts +20 -0
  80. package/core/radiant-element-ssr-registry.js +3 -0
  81. package/core/radiant-element-ssr-registry.js.map +10 -0
  82. package/{dist/core → core}/radiant-element.d.ts +44 -155
  83. package/core/radiant-element.js +3 -0
  84. package/core/radiant-element.js.map +31 -0
  85. package/core/radiant-hydrator-state.js +3 -0
  86. package/{dist/core → core}/radiant-hydrator-state.js.map +2 -2
  87. package/core/reactive-binding-adapter.d.ts +10 -0
  88. package/core/reactive-binding-adapter.js +3 -0
  89. package/core/reactive-binding-adapter.js.map +10 -0
  90. package/core/reactive-host.d.ts +138 -0
  91. package/core/reactive-host.js +3 -0
  92. package/core/reactive-host.js.map +13 -0
  93. package/{dist/core → core}/reactive-jsx-value.d.ts +4 -3
  94. package/core/reactive-jsx-value.js +3 -0
  95. package/core/reactive-jsx-value.js.map +10 -0
  96. package/core/reactive-prop-core.d.ts +39 -0
  97. package/core/reactive-prop-core.js +3 -0
  98. package/{dist/decorators/standard/reactive-prop.js.map → core/reactive-prop-core.js.map} +4 -5
  99. package/{dist/core → core}/reactive-prop-metadata.d.ts +1 -1
  100. package/core/reactive-prop-metadata.js +3 -0
  101. package/core/reactive-prop-metadata.js.map +10 -0
  102. package/core/reactive-property-state.d.ts +20 -0
  103. package/core/reactive-property-state.js +3 -0
  104. package/core/reactive-property-state.js.map +12 -0
  105. package/core/reactivity-adapter.d.ts +8 -0
  106. package/core/reactivity-adapter.js +3 -0
  107. package/core/reactivity-adapter.js.map +12 -0
  108. package/core/reactivity-contract.d.ts +53 -0
  109. package/core/reactivity-contract.js +2 -0
  110. package/core/reactivity-contract.js.map +9 -0
  111. package/core/reactivity-runtime.d.ts +18 -0
  112. package/core/reactivity-runtime.js +3 -0
  113. package/core/reactivity-runtime.js.map +11 -0
  114. package/core/reactivity-signals.d.ts +10 -0
  115. package/core/reactivity-signals.js +3 -0
  116. package/core/reactivity-signals.js.map +10 -0
  117. package/core/render-runtime.d.ts +28 -0
  118. package/core/render-runtime.js +3 -0
  119. package/core/render-runtime.js.map +16 -0
  120. package/core/render-scheduler.d.ts +22 -0
  121. package/core/render-scheduler.js +3 -0
  122. package/core/render-scheduler.js.map +10 -0
  123. package/core/slot-projection-runtime.js +3 -0
  124. package/core/slot-projection-runtime.js.map +12 -0
  125. package/core/ssr-preparation.js +3 -0
  126. package/{dist/core → core}/ssr-preparation.js.map +2 -2
  127. package/decorators/attr.js +3 -0
  128. package/decorators/attr.js.map +18 -0
  129. package/decorators/bound.js +3 -0
  130. package/{dist/decorators → decorators}/bound.js.map +2 -2
  131. package/decorators/bridge.js +3 -0
  132. package/{dist/decorators → decorators}/bridge.js.map +2 -2
  133. package/decorators/controller.js +3 -0
  134. package/{dist/decorators → decorators}/controller.js.map +2 -2
  135. package/decorators/custom-element.js +3 -0
  136. package/{dist/decorators → decorators}/custom-element.js.map +2 -2
  137. package/decorators/debounce.js +3 -0
  138. package/{dist/decorators → decorators}/debounce.js.map +2 -2
  139. package/decorators/event.js +3 -0
  140. package/{dist/decorators → decorators}/event.js.map +3 -3
  141. package/decorators/legacy/attr.js +3 -0
  142. package/decorators/legacy/attr.js.map +15 -0
  143. package/decorators/legacy/bound.js +3 -0
  144. package/{dist/decorators → decorators}/legacy/bound.js.map +2 -2
  145. package/decorators/legacy/custom-element.js +3 -0
  146. package/{dist/decorators → decorators}/legacy/custom-element.js.map +2 -2
  147. package/decorators/legacy/debounce.js +3 -0
  148. package/{dist/decorators → decorators}/legacy/debounce.js.map +2 -2
  149. package/decorators/legacy/event.js +3 -0
  150. package/decorators/legacy/event.js.map +13 -0
  151. package/decorators/legacy/host-readiness.d.ts +8 -0
  152. package/decorators/legacy/host-readiness.js +3 -0
  153. package/decorators/legacy/host-readiness.js.map +11 -0
  154. package/decorators/legacy/instance-initializers.d.ts +34 -0
  155. package/decorators/legacy/instance-initializers.js +3 -0
  156. package/decorators/legacy/instance-initializers.js.map +10 -0
  157. package/decorators/legacy/member-bootstrap.d.ts +10 -0
  158. package/decorators/legacy/member-bootstrap.js +3 -0
  159. package/decorators/legacy/member-bootstrap.js.map +10 -0
  160. package/decorators/legacy/on-event.js +3 -0
  161. package/decorators/legacy/on-event.js.map +13 -0
  162. package/{dist/decorators → decorators}/legacy/on-updated.d.ts +1 -1
  163. package/decorators/legacy/on-updated.js +3 -0
  164. package/decorators/legacy/on-updated.js.map +11 -0
  165. package/decorators/legacy/query-slot.js +3 -0
  166. package/decorators/legacy/query-slot.js.map +13 -0
  167. package/decorators/legacy/query.js +3 -0
  168. package/decorators/legacy/query.js.map +12 -0
  169. package/decorators/legacy/reactive-field.js +3 -0
  170. package/decorators/legacy/reactive-field.js.map +13 -0
  171. package/{dist/decorators → decorators}/legacy/reactive-prop.d.ts +1 -2
  172. package/decorators/legacy/reactive-prop.js +3 -0
  173. package/decorators/legacy/reactive-prop.js.map +15 -0
  174. package/{dist/decorators → decorators}/legacy/signal.d.ts +1 -1
  175. package/decorators/legacy/signal.js +3 -0
  176. package/decorators/legacy/signal.js.map +17 -0
  177. package/decorators/on-event.js +3 -0
  178. package/{dist/decorators → decorators}/on-event.js.map +4 -4
  179. package/decorators/on-updated.js +3 -0
  180. package/decorators/on-updated.js.map +14 -0
  181. package/{dist/decorators → decorators}/prop.d.ts +5 -6
  182. package/decorators/prop.js +3 -0
  183. package/decorators/prop.js.map +18 -0
  184. package/decorators/query-slot.js +3 -0
  185. package/decorators/query-slot.js.map +16 -0
  186. package/decorators/query.js +3 -0
  187. package/{dist/decorators → decorators}/query.js.map +3 -3
  188. package/decorators/shared/auto-bind.d.ts +7 -0
  189. package/decorators/shared/auto-bind.js +3 -0
  190. package/decorators/shared/auto-bind.js.map +10 -0
  191. package/{dist/decorators → decorators}/shared/reactive-attr.d.ts +1 -1
  192. package/decorators/shared/reactive-attr.js +3 -0
  193. package/decorators/shared/reactive-attr.js.map +13 -0
  194. package/decorators/signal.js +3 -0
  195. package/decorators/signal.js.map +19 -0
  196. package/decorators/standard/attr.js +3 -0
  197. package/decorators/standard/attr.js.map +14 -0
  198. package/decorators/standard/bound.js +3 -0
  199. package/{dist/decorators → decorators}/standard/bound.js.map +2 -2
  200. package/decorators/standard/custom-element.js +3 -0
  201. package/{dist/decorators → decorators}/standard/custom-element.js.map +2 -2
  202. package/decorators/standard/debounce.js +3 -0
  203. package/{dist/decorators → decorators}/standard/debounce.js.map +2 -2
  204. package/decorators/standard/event.js +3 -0
  205. package/{dist/decorators → decorators}/standard/event.js.map +2 -2
  206. package/decorators/standard/on-event.js +3 -0
  207. package/{dist/decorators → decorators}/standard/on-event.js.map +3 -3
  208. package/decorators/standard/on-updated.js +3 -0
  209. package/{dist/decorators → decorators}/standard/on-updated.js.map +2 -2
  210. package/{dist/decorators → decorators}/standard/query-slot.d.ts +0 -1
  211. package/decorators/standard/query-slot.js +3 -0
  212. package/decorators/standard/query-slot.js.map +11 -0
  213. package/decorators/standard/query.js +3 -0
  214. package/{dist/decorators → decorators}/standard/query.js.map +2 -2
  215. package/decorators/standard/reactive-field.js +3 -0
  216. package/decorators/standard/reactive-field.js.map +11 -0
  217. package/{dist/decorators → decorators}/standard/reactive-prop.d.ts +1 -1
  218. package/decorators/standard/reactive-prop.js +3 -0
  219. package/decorators/standard/reactive-prop.js.map +13 -0
  220. package/{dist/decorators → decorators}/standard/signal.d.ts +1 -1
  221. package/decorators/standard/signal.js +3 -0
  222. package/decorators/standard/signal.js.map +16 -0
  223. package/{dist/decorators → decorators}/state.d.ts +3 -2
  224. package/decorators/state.js +3 -0
  225. package/decorators/state.js.map +16 -0
  226. package/helpers/create-event-listener.js +3 -0
  227. package/{dist/helpers → helpers}/create-event-listener.js.map +3 -3
  228. package/helpers/create-event.js +3 -0
  229. package/{dist/helpers → helpers}/create-event.js.map +2 -2
  230. package/{dist/helpers → helpers}/create-query-slot.d.ts +0 -1
  231. package/helpers/create-query-slot.js +3 -0
  232. package/helpers/create-query-slot.js.map +10 -0
  233. package/helpers/create-query.js +3 -0
  234. package/{dist/helpers → helpers}/create-query.js.map +2 -2
  235. package/helpers/debounce.js +3 -0
  236. package/{dist/helpers → helpers}/debounce.js.map +2 -2
  237. package/helpers/index.js +3 -0
  238. package/{dist/helpers → helpers}/index.js.map +4 -4
  239. package/index.js +3 -0
  240. package/index.js.map +86 -0
  241. package/package.json +102 -125
  242. package/server/context-ssr.js +3 -0
  243. package/{dist/server → server}/context-ssr.js.map +2 -2
  244. package/server/host-attribute-serialization.d.ts +46 -0
  245. package/server/host-attribute-serialization.js +3 -0
  246. package/server/host-attribute-serialization.js.map +12 -0
  247. package/server/host-script-composition.d.ts +42 -0
  248. package/server/host-script-composition.js +3 -0
  249. package/server/host-script-composition.js.map +10 -0
  250. package/server/html-parser.js +3 -0
  251. package/{dist/server → server}/html-parser.js.map +2 -2
  252. package/server/install-light-dom-shim.js +3 -0
  253. package/server/install-light-dom-shim.js.map +17 -0
  254. package/server/internal-radiant-host.d.ts +2 -0
  255. package/server/internal-radiant-host.js +3 -0
  256. package/server/internal-radiant-host.js.map +9 -0
  257. package/server/light-dom-shim.d.ts +2 -0
  258. package/server/light-dom-shim.js +3 -0
  259. package/server/light-dom-shim.js.map +16 -0
  260. package/server/minimal-dom/document.d.ts +17 -0
  261. package/server/minimal-dom/document.js +3 -0
  262. package/server/minimal-dom/document.js.map +14 -0
  263. package/server/minimal-dom/html.d.ts +7 -0
  264. package/server/minimal-dom/html.js +3 -0
  265. package/server/minimal-dom/html.js.map +13 -0
  266. package/{dist/server/light-dom-shim.d.ts → server/minimal-dom/install.d.ts} +1 -4
  267. package/server/minimal-dom/install.js +3 -0
  268. package/server/minimal-dom/install.js.map +16 -0
  269. package/server/minimal-dom/nodes.d.ts +78 -0
  270. package/server/project-root.js +3 -0
  271. package/{dist/server → server}/project-root.js.map +2 -2
  272. package/server/radiant-element-ssr-bridge.d.ts +21 -0
  273. package/server/radiant-element-ssr-bridge.js +3 -0
  274. package/server/radiant-element-ssr-bridge.js.map +24 -0
  275. package/server/radiant-element-ssr-extractor.d.ts +2 -0
  276. package/server/radiant-element-ssr-extractor.js +3 -0
  277. package/server/radiant-element-ssr-extractor.js.map +12 -0
  278. package/server/radiant-element-ssr-service.d.ts +13 -0
  279. package/server/radiant-element-ssr-service.js +3 -0
  280. package/server/radiant-element-ssr-service.js.map +22 -0
  281. package/server/radiant-element-ssr.d.ts +1 -0
  282. package/server/radiant-element-ssr.js +3 -0
  283. package/server/radiant-element-ssr.js.map +24 -0
  284. package/{dist/server → server}/render-component.d.ts +3 -9
  285. package/server/render-component.js +3 -0
  286. package/server/render-component.js.map +32 -0
  287. package/server/render-controller.js +3 -0
  288. package/server/render-controller.js.map +35 -0
  289. package/server/render-fragment.d.ts +7 -0
  290. package/server/render-fragment.js +3 -0
  291. package/server/render-fragment.js.map +10 -0
  292. package/server/slot-projection-html.js +3 -0
  293. package/{dist/server → server}/slot-projection-html.js.map +5 -5
  294. package/signals/host-resource.js +3 -0
  295. package/{dist/signals → signals}/host-resource.js.map +2 -2
  296. package/{dist/signals → signals}/host-signal.d.ts +2 -1
  297. package/signals/host-signal.js +3 -0
  298. package/signals/host-signal.js.map +13 -0
  299. package/signals/hydration-script.js +3 -0
  300. package/{dist/signals → signals}/hydration-script.js.map +2 -2
  301. package/tools/escape-css-identifier.js +3 -0
  302. package/tools/escape-css-identifier.js.map +10 -0
  303. package/tools/escape-script-json.js +3 -0
  304. package/{dist/tools → tools}/escape-script-json.js.map +2 -2
  305. package/tools/event-emitter.js +3 -0
  306. package/{dist/tools → tools}/event-emitter.js.map +2 -2
  307. package/tools/index.js +3 -0
  308. package/{dist/tools → tools}/index.js.map +3 -3
  309. package/tools/render-jsx-template.js +3 -0
  310. package/{dist/tools → tools}/render-jsx-template.js.map +2 -2
  311. package/types.js +3 -0
  312. package/{dist/types.js.map → types.js.map} +2 -2
  313. package/utils/attribute-utils.js +3 -0
  314. package/{dist/utils → utils}/attribute-utils.js.map +2 -2
  315. package/utils/escape-html-attribute.d.ts +2 -0
  316. package/utils/escape-html-attribute.js +3 -0
  317. package/utils/escape-html-attribute.js.map +10 -0
  318. package/utils/index.js +3 -0
  319. package/{dist/utils → utils}/index.js.map +2 -2
  320. package/dist/LICENSE +0 -21
  321. package/dist/client/hydrator.js +0 -3
  322. package/dist/client/install-hydrator.js +0 -3
  323. package/dist/context/context-consumer-bootstrap.js +0 -3
  324. package/dist/context/context-consumer-runtime.js +0 -3
  325. package/dist/context/context-consumer-runtime.js.map +0 -12
  326. package/dist/context/context-host.js +0 -3
  327. package/dist/context/context-provider.js +0 -3
  328. package/dist/context/context-ssr-bridge.js +0 -3
  329. package/dist/context/create-context.js +0 -3
  330. package/dist/context/decorators/consume-context.js +0 -3
  331. package/dist/context/decorators/consume-context.js.map +0 -19
  332. package/dist/context/decorators/context-selection-delivery.js +0 -3
  333. package/dist/context/decorators/context-selector.js +0 -3
  334. package/dist/context/decorators/context-selector.js.map +0 -21
  335. package/dist/context/decorators/legacy/consume-context.js +0 -3
  336. package/dist/context/decorators/legacy/consume-context.js.map +0 -16
  337. package/dist/context/decorators/legacy/context-selector-field.js +0 -3
  338. package/dist/context/decorators/legacy/context-selector-field.js.map +0 -17
  339. package/dist/context/decorators/legacy/context-selector.js +0 -3
  340. package/dist/context/decorators/legacy/context-selector.js.map +0 -17
  341. package/dist/context/decorators/legacy/provide-context.js +0 -3
  342. package/dist/context/decorators/on-context-update.js +0 -3
  343. package/dist/context/decorators/provide-context.js +0 -3
  344. package/dist/context/decorators/standard/consume-context.js +0 -3
  345. package/dist/context/decorators/standard/context-selector-field.js +0 -3
  346. package/dist/context/decorators/standard/context-selector.js +0 -3
  347. package/dist/context/decorators/standard/provide-context.js +0 -3
  348. package/dist/context/events.js +0 -3
  349. package/dist/context/events.js.map +0 -10
  350. package/dist/context/hydration-script.js +0 -3
  351. package/dist/context/index.js +0 -3
  352. package/dist/controller-registry.js +0 -3
  353. package/dist/core/controller-metadata.js +0 -3
  354. package/dist/core/custom-element-metadata.js +0 -3
  355. package/dist/core/hydration-codec.js +0 -3
  356. package/dist/core/radiant-component-ssr-registry.d.ts +0 -54
  357. package/dist/core/radiant-component-ssr-registry.js +0 -3
  358. package/dist/core/radiant-component-ssr-registry.js.map +0 -10
  359. package/dist/core/radiant-component-ssr.js +0 -3
  360. package/dist/core/radiant-component-ssr.js.map +0 -14
  361. package/dist/core/radiant-controller.js +0 -3
  362. package/dist/core/radiant-controller.js.map +0 -13
  363. package/dist/core/radiant-element.js +0 -3
  364. package/dist/core/radiant-element.js.map +0 -19
  365. package/dist/core/radiant-hydrator-state.js +0 -3
  366. package/dist/core/reactive-host.d.ts +0 -137
  367. package/dist/core/reactive-host.js +0 -3
  368. package/dist/core/reactive-host.js.map +0 -10
  369. package/dist/core/reactive-jsx-value.js +0 -3
  370. package/dist/core/reactive-jsx-value.js.map +0 -10
  371. package/dist/core/reactive-prop-metadata.js +0 -3
  372. package/dist/core/reactive-prop-metadata.js.map +0 -10
  373. package/dist/core/slot-projection-runtime.js +0 -3
  374. package/dist/core/slot-projection-runtime.js.map +0 -12
  375. package/dist/core/ssr-preparation.js +0 -3
  376. package/dist/decorators/attr.js +0 -3
  377. package/dist/decorators/attr.js.map +0 -16
  378. package/dist/decorators/bound.js +0 -3
  379. package/dist/decorators/bridge.js +0 -3
  380. package/dist/decorators/controller.js +0 -3
  381. package/dist/decorators/custom-element.js +0 -3
  382. package/dist/decorators/debounce.js +0 -3
  383. package/dist/decorators/event.js +0 -3
  384. package/dist/decorators/legacy/attr.js +0 -3
  385. package/dist/decorators/legacy/attr.js.map +0 -13
  386. package/dist/decorators/legacy/bound.js +0 -3
  387. package/dist/decorators/legacy/custom-element.js +0 -3
  388. package/dist/decorators/legacy/debounce.js +0 -3
  389. package/dist/decorators/legacy/event.js +0 -3
  390. package/dist/decorators/legacy/event.js.map +0 -13
  391. package/dist/decorators/legacy/instance-initializers.d.ts +0 -16
  392. package/dist/decorators/legacy/instance-initializers.js +0 -3
  393. package/dist/decorators/legacy/instance-initializers.js.map +0 -10
  394. package/dist/decorators/legacy/on-event.js +0 -3
  395. package/dist/decorators/legacy/on-event.js.map +0 -13
  396. package/dist/decorators/legacy/on-updated.js +0 -3
  397. package/dist/decorators/legacy/on-updated.js.map +0 -11
  398. package/dist/decorators/legacy/query-slot.js +0 -3
  399. package/dist/decorators/legacy/query-slot.js.map +0 -13
  400. package/dist/decorators/legacy/query.js +0 -3
  401. package/dist/decorators/legacy/query.js.map +0 -12
  402. package/dist/decorators/legacy/reactive-field.js +0 -3
  403. package/dist/decorators/legacy/reactive-field.js.map +0 -11
  404. package/dist/decorators/legacy/reactive-prop.js +0 -3
  405. package/dist/decorators/legacy/reactive-prop.js.map +0 -13
  406. package/dist/decorators/legacy/signal.js +0 -3
  407. package/dist/decorators/legacy/signal.js.map +0 -15
  408. package/dist/decorators/on-event.js +0 -3
  409. package/dist/decorators/on-updated.js +0 -3
  410. package/dist/decorators/on-updated.js.map +0 -14
  411. package/dist/decorators/prop.js +0 -3
  412. package/dist/decorators/prop.js.map +0 -16
  413. package/dist/decorators/query-slot.js +0 -3
  414. package/dist/decorators/query-slot.js.map +0 -16
  415. package/dist/decorators/query.js +0 -3
  416. package/dist/decorators/shared/reactive-attr.js +0 -3
  417. package/dist/decorators/shared/reactive-attr.js.map +0 -11
  418. package/dist/decorators/signal.js +0 -3
  419. package/dist/decorators/signal.js.map +0 -17
  420. package/dist/decorators/standard/attr.js +0 -3
  421. package/dist/decorators/standard/attr.js.map +0 -12
  422. package/dist/decorators/standard/bound.js +0 -3
  423. package/dist/decorators/standard/custom-element.js +0 -3
  424. package/dist/decorators/standard/debounce.js +0 -3
  425. package/dist/decorators/standard/event.js +0 -3
  426. package/dist/decorators/standard/on-event.js +0 -3
  427. package/dist/decorators/standard/on-updated.js +0 -3
  428. package/dist/decorators/standard/query-slot.js +0 -3
  429. package/dist/decorators/standard/query-slot.js.map +0 -11
  430. package/dist/decorators/standard/query.js +0 -3
  431. package/dist/decorators/standard/reactive-field.js +0 -3
  432. package/dist/decorators/standard/reactive-field.js.map +0 -10
  433. package/dist/decorators/standard/reactive-prop.js +0 -3
  434. package/dist/decorators/standard/signal.js +0 -3
  435. package/dist/decorators/standard/signal.js.map +0 -14
  436. package/dist/decorators/state.js +0 -3
  437. package/dist/decorators/state.js.map +0 -14
  438. package/dist/helpers/create-event-listener.js +0 -3
  439. package/dist/helpers/create-event.js +0 -3
  440. package/dist/helpers/create-query-slot.js +0 -3
  441. package/dist/helpers/create-query-slot.js.map +0 -10
  442. package/dist/helpers/create-query.js +0 -3
  443. package/dist/helpers/debounce.js +0 -3
  444. package/dist/helpers/index.js +0 -3
  445. package/dist/index.js +0 -3
  446. package/dist/index.js.map +0 -72
  447. package/dist/server/context-ssr.js +0 -3
  448. package/dist/server/html-parser.js +0 -3
  449. package/dist/server/install-light-dom-shim.js +0 -3
  450. package/dist/server/install-light-dom-shim.js.map +0 -12
  451. package/dist/server/light-dom-shim.js +0 -3
  452. package/dist/server/light-dom-shim.js.map +0 -11
  453. package/dist/server/project-root.js +0 -3
  454. package/dist/server/radiant-component-ssr-runtime.d.ts +0 -9
  455. package/dist/server/radiant-component-ssr-runtime.js +0 -3
  456. package/dist/server/radiant-component-ssr-runtime.js.map +0 -17
  457. package/dist/server/render-component.js +0 -3
  458. package/dist/server/render-component.js.map +0 -20
  459. package/dist/server/render-controller.js +0 -3
  460. package/dist/server/render-controller.js.map +0 -23
  461. package/dist/server/slot-projection-html.js +0 -3
  462. package/dist/signals/host-resource.js +0 -3
  463. package/dist/signals/host-signal.js +0 -3
  464. package/dist/signals/host-signal.js.map +0 -13
  465. package/dist/signals/hydration-script.js +0 -3
  466. package/dist/tools/escape-css-identifier.js +0 -3
  467. package/dist/tools/escape-css-identifier.js.map +0 -10
  468. package/dist/tools/escape-script-json.js +0 -3
  469. package/dist/tools/event-emitter.js +0 -3
  470. package/dist/tools/index.js +0 -3
  471. package/dist/tools/render-jsx-template.js +0 -3
  472. package/dist/types.js +0 -3
  473. package/dist/utils/attribute-utils.js +0 -3
  474. package/dist/utils/index.js +0 -3
  475. package/size-budget.json +0 -25
  476. /package/{dist/client → client}/hydrator.d.ts +0 -0
  477. /package/{dist/client → client}/install-hydrator.d.ts +0 -0
  478. /package/{dist/context → context}/context-consumer-bootstrap.d.ts +0 -0
  479. /package/{dist/context → context}/context-consumer-runtime.d.ts +0 -0
  480. /package/{dist/context → context}/context-host.d.ts +0 -0
  481. /package/{dist/context → context}/context-provider.d.ts +0 -0
  482. /package/{dist/context → context}/context-ssr-bridge.d.ts +0 -0
  483. /package/{dist/context → context}/create-context.d.ts +0 -0
  484. /package/{dist/context → context}/decorators/consume-context.d.ts +0 -0
  485. /package/{dist/context → context}/decorators/context-selection-delivery.d.ts +0 -0
  486. /package/{dist/context → context}/decorators/context-selector.d.ts +0 -0
  487. /package/{dist/context → context}/decorators/legacy/consume-context.d.ts +0 -0
  488. /package/{dist/context → context}/decorators/legacy/context-selector-field.d.ts +0 -0
  489. /package/{dist/context → context}/decorators/legacy/context-selector.d.ts +0 -0
  490. /package/{dist/context → context}/decorators/legacy/provide-context.d.ts +0 -0
  491. /package/{dist/context → context}/decorators/on-context-update.d.ts +0 -0
  492. /package/{dist/context → context}/decorators/provide-context.d.ts +0 -0
  493. /package/{dist/context → context}/decorators/standard/consume-context.d.ts +0 -0
  494. /package/{dist/context → context}/decorators/standard/context-selector-field.d.ts +0 -0
  495. /package/{dist/context → context}/decorators/standard/context-selector.d.ts +0 -0
  496. /package/{dist/context → context}/decorators/standard/provide-context.d.ts +0 -0
  497. /package/{dist/context → context}/events.d.ts +0 -0
  498. /package/{dist/context → context}/hydration-script.d.ts +0 -0
  499. /package/{dist/context → context}/index.d.ts +0 -0
  500. /package/{dist/context → context}/types.d.ts +0 -0
  501. /package/{dist/context → context}/types.js +0 -0
  502. /package/{dist/context → context}/types.js.map +0 -0
  503. /package/{dist/controller-registry.d.ts → controller-registry.d.ts} +0 -0
  504. /package/{dist/core → core}/controller-metadata.d.ts +0 -0
  505. /package/{dist/core → core}/custom-element-metadata.d.ts +0 -0
  506. /package/{dist/core → core}/hydration-codec.d.ts +0 -0
  507. /package/{dist/core → core}/radiant-hydrator-state.d.ts +0 -0
  508. /package/{dist/core → core}/slot-projection-runtime.d.ts +0 -0
  509. /package/{dist/core → core}/ssr-hydration-binding.d.ts +0 -0
  510. /package/{dist/core → core}/ssr-hydration-binding.js +0 -0
  511. /package/{dist/core → core}/ssr-hydration-binding.js.map +0 -0
  512. /package/{dist/core → core}/ssr-preparation.d.ts +0 -0
  513. /package/{dist/decorators → decorators}/attr.d.ts +0 -0
  514. /package/{dist/decorators → decorators}/bound.d.ts +0 -0
  515. /package/{dist/decorators → decorators}/bridge.d.ts +0 -0
  516. /package/{dist/decorators → decorators}/controller.d.ts +0 -0
  517. /package/{dist/decorators → decorators}/custom-element.d.ts +0 -0
  518. /package/{dist/decorators → decorators}/debounce.d.ts +0 -0
  519. /package/{dist/decorators → decorators}/event.d.ts +0 -0
  520. /package/{dist/decorators → decorators}/legacy/attr.d.ts +0 -0
  521. /package/{dist/decorators → decorators}/legacy/bound.d.ts +0 -0
  522. /package/{dist/decorators → decorators}/legacy/custom-element.d.ts +0 -0
  523. /package/{dist/decorators → decorators}/legacy/debounce.d.ts +0 -0
  524. /package/{dist/decorators → decorators}/legacy/event.d.ts +0 -0
  525. /package/{dist/decorators → decorators}/legacy/on-event.d.ts +0 -0
  526. /package/{dist/decorators → decorators}/legacy/query-slot.d.ts +0 -0
  527. /package/{dist/decorators → decorators}/legacy/query.d.ts +0 -0
  528. /package/{dist/decorators → decorators}/legacy/reactive-field.d.ts +0 -0
  529. /package/{dist/decorators → decorators}/on-event.d.ts +0 -0
  530. /package/{dist/decorators → decorators}/on-updated.d.ts +0 -0
  531. /package/{dist/decorators → decorators}/query-slot.d.ts +0 -0
  532. /package/{dist/decorators → decorators}/query.d.ts +0 -0
  533. /package/{dist/decorators → decorators}/signal.d.ts +0 -0
  534. /package/{dist/decorators → decorators}/standard/attr.d.ts +0 -0
  535. /package/{dist/decorators → decorators}/standard/bound.d.ts +0 -0
  536. /package/{dist/decorators → decorators}/standard/custom-element.d.ts +0 -0
  537. /package/{dist/decorators → decorators}/standard/debounce.d.ts +0 -0
  538. /package/{dist/decorators → decorators}/standard/event.d.ts +0 -0
  539. /package/{dist/decorators → decorators}/standard/on-event.d.ts +0 -0
  540. /package/{dist/decorators → decorators}/standard/on-updated.d.ts +0 -0
  541. /package/{dist/decorators → decorators}/standard/query.d.ts +0 -0
  542. /package/{dist/decorators → decorators}/standard/reactive-field.d.ts +0 -0
  543. /package/{dist/helpers → helpers}/create-event-listener.d.ts +0 -0
  544. /package/{dist/helpers → helpers}/create-event.d.ts +0 -0
  545. /package/{dist/helpers → helpers}/create-query.d.ts +0 -0
  546. /package/{dist/helpers → helpers}/debounce.d.ts +0 -0
  547. /package/{dist/helpers → helpers}/index.d.ts +0 -0
  548. /package/{dist/index.d.ts → index.d.ts} +0 -0
  549. /package/{dist/server → server}/context-ssr.d.ts +0 -0
  550. /package/{dist/server → server}/html-parser.d.ts +0 -0
  551. /package/{dist/server → server}/install-light-dom-shim.d.ts +0 -0
  552. /package/{dist/server → server}/project-root.d.ts +0 -0
  553. /package/{dist/server → server}/render-controller.d.ts +0 -0
  554. /package/{dist/server → server}/slot-projection-html.d.ts +0 -0
  555. /package/{dist/signals → signals}/host-resource.d.ts +0 -0
  556. /package/{dist/signals → signals}/hydration-script.d.ts +0 -0
  557. /package/{dist/tools → tools}/escape-css-identifier.d.ts +0 -0
  558. /package/{dist/tools → tools}/escape-script-json.d.ts +0 -0
  559. /package/{dist/tools → tools}/event-emitter.d.ts +0 -0
  560. /package/{dist/tools → tools}/index.d.ts +0 -0
  561. /package/{dist/tools → tools}/render-jsx-template.d.ts +0 -0
  562. /package/{dist/types.d.ts → types.d.ts} +0 -0
  563. /package/{dist/utils → utils}/attribute-utils.d.ts +0 -0
  564. /package/{dist/utils → utils}/index.d.ts +0 -0
@@ -1,17 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/decorators/legacy/instance-initializers.ts", "../src/core/ssr-preparation.ts", "../src/context/context-ssr-bridge.ts", "../src/context/events.ts", "../src/context/context-consumer-runtime.ts", "../src/context/context-consumer-bootstrap.ts", "../src/context/decorators/context-selection-delivery.ts", "../src/context/decorators/legacy/context-selector.ts"],
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
- "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",
7
- "import type { SsrSerializableContextProvider } from './context-provider';\nimport type { UnknownContext } from './types';\n\ntype SsrContextProviderResolver = (context: UnknownContext) => SsrSerializableContextProvider | undefined;\n\nconst SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-provider-resolver');\n\ntype GlobalResolverScope = typeof globalThis & {\n\t[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?: SsrContextProviderResolver;\n};\n\nfunction getGlobalResolverScope(): GlobalResolverScope {\n\treturn globalThis as GlobalResolverScope;\n}\n\n/**\n * Installs the ambient SSR provider resolver used by shared context runtime helpers.\n *\n * Server-side rendering infrastructure owns the actual provider stack storage and\n * publishes a lookup function here so client/runtime code does not need to import\n * server-oriented modules.\n */\nexport function installSsrContextProviderResolver(resolver: SsrContextProviderResolver): void {\n\tgetGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL] = resolver;\n}\n\n/**\n * Resolves an ambient SSR provider when a server render has published one.\n */\nexport function resolveAmbientSsrContextProvider(context: UnknownContext): SsrSerializableContextProvider | undefined {\n\treturn getGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?.(context);\n}\n",
8
- "import type { Context, ContextCallback, ContextType, UnknownContext } from './types';\n\n/**\n * List of events which can be emitted by a context provider or requester.\n */\nexport enum ContextEventsTypes {\n\tSUBSCRIPTION_REQUEST = 'context-subscription-request',\n\tCONTEXT_REQUEST = 'context-request',\n\tON_MOUNT = 'context-on-mount',\n\tMOUNTED = 'context-mounted',\n}\n\n/**\n * An event fired by a context requester to signal it desires a named context.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * function to the callback which requesters can invoke to indicate they no longer wish to receive these updates.\n */\nexport class ContextRequestEvent<T extends UnknownContext> extends Event {\n\tpublic handled = false;\n\n\tpublic constructor(\n\t\tpublic readonly context: T,\n\t\tpublic readonly callback: ContextCallback<ContextType<T>>,\n\t\tpublic readonly subscribe?: boolean,\n\t) {\n\t\tsuper(ContextEventsTypes.CONTEXT_REQUEST, { bubbles: true, composed: true });\n\t}\n\n\tpublic markHandled(): void {\n\t\tthis.handled = true;\n\t}\n}\n\n/**\n * A type which represents a subscription to a context value.\n */\ntype DirectContextSubscription<T extends UnknownContext> = {\n\tselect?: undefined;\n\tcallback: ContextCallback<ContextType<T>>;\n};\n\ntype SelectedContextSubscription<T extends UnknownContext, Selected> = {\n\tselect: (context: ContextType<T>) => Selected;\n\tcallback: ContextCallback<Selected>;\n};\n\nexport type ContextSubscription<T extends UnknownContext, Selected = ContextType<T>> =\n\t| DirectContextSubscription<T>\n\t| SelectedContextSubscription<T, Selected>;\n\n/**\n * An event fired by a context provider to signal that a context value has been mounted and is available for consumption.\n */\nexport class ContextOnMountEvent extends CustomEvent<{ context: UnknownContext }> {\n\tpublic constructor(context: UnknownContext) {\n\t\tsuper(ContextEventsTypes.ON_MOUNT, {\n\t\t\tdetail: { context },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t});\n\t}\n}\n\n/**\n * An event fired by a context requester to signal it desires a named context.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * function to the callback which requesters can invoke to indicate they no longer wish to receive these updates.\n *\n * It accepts a `selector` property which can be used to request a specific property of the context value.\n */\nexport class ContextSubscriptionRequestEvent<T extends UnknownContext, Selected = ContextType<T>> extends Event {\n\tpublic handled = false;\n\n\tpublic constructor(\n\t\tpublic readonly context: T,\n\t\tpublic readonly callback: ContextCallback<Selected>,\n\t\tpublic readonly select?: (context: ContextType<T>) => Selected,\n\t\tpublic readonly subscribe?: boolean,\n\t\tpublic readonly onSubscribe?: (unsubscribe: () => void) => void,\n\t) {\n\t\tsuper(ContextEventsTypes.SUBSCRIPTION_REQUEST, {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t});\n\t}\n\n\tpublic markHandled(): void {\n\t\tthis.handled = true;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\t/**\n\t\t * A 'context-request-subscription' event can be emitted by any element which desires\n\t\t * a context value to be injected by an external provider.\n\t\t */\n\t\t[ContextEventsTypes.SUBSCRIPTION_REQUEST]: ContextSubscriptionRequestEvent<UnknownContext>;\n\t\t/**\n\t\t * A context-request-provider event can be emitted by a context requester to signal\n\t\t * that it desires a context value to be provided by a context provider.\n\t\t */\n\t\t[ContextEventsTypes.CONTEXT_REQUEST]: ContextRequestEvent<Context<unknown, unknown>>;\n\t\t/**\n\t\t * A 'context-mount' event can be emitted by a context provider to signal\n\t\t * that a context value has been mounted and is available for consumption.\n\t\t */\n\t\t[ContextEventsTypes.ON_MOUNT]: ContextOnMountEvent;\n\t}\n}\n",
9
- "import type { ContextHostLike } from './context-host';\nimport { resolveAmbientSsrContextProvider } from './context-ssr-bridge';\nimport { ContextEventsTypes, ContextRequestEvent, ContextSubscriptionRequestEvent } from './events';\nimport type { ContextCallback, ContextType, UnknownContext } from './types';\n\ntype ConsumedContextAssignment = (provider: unknown) => void;\n\ntype DirectContextSelectionRequest<TContext extends UnknownContext> = {\n\tcallback: (value: ContextType<TContext>) => void;\n\tselect?: undefined;\n};\n\ntype SelectedContextSelectionRequest<TContext extends UnknownContext, Selected> = {\n\tcallback: (value: Selected) => void;\n\tselect: (context: ContextType<TContext>) => Selected;\n};\n\ntype ContextSelectionRequest<TContext extends UnknownContext, Selected = ContextType<TContext>> =\n\t| DirectContextSelectionRequest<TContext>\n\t| SelectedContextSelectionRequest<TContext, Selected>;\n\n/**\n * Resolves a consumed context from the active SSR provider stack when one is available.\n *\n * This keeps SSR-specific lookup outside decorator implementations while preserving\n * the same consumer initialization contract for both standard and legacy decorators.\n *\n * @returns `true` when the context was resolved synchronously from SSR state.\n */\nexport function initializeConsumedContext(\n\thost: ContextHostLike,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\tconst provider = resolveAmbientSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn false;\n\t}\n\n\tassign(provider);\n\thost.connectedContextCallback(context);\n\n\tif (options.emitMounted) {\n\t\thost.dispatchEvent(new CustomEvent(ContextEventsTypes.MOUNTED, { detail: provider }));\n\t}\n\n\treturn true;\n}\n\n/**\n * Requests a context provider through the DOM event channel when SSR state is not active.\n */\nexport function requestConsumedContext(\n\thost: ContextHostLike,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\tconst event = new ContextRequestEvent(context, (provider) => {\n\t\tassign(provider);\n\t\thost.connectedContextCallback(context);\n\n\t\tif (options.emitMounted) {\n\t\t\thost.dispatchEvent(new CustomEvent(ContextEventsTypes.MOUNTED, { detail: provider }));\n\t\t}\n\t});\n\n\thost.dispatchEvent(event);\n\treturn event.handled;\n}\n\n/**\n * Resolves a selected context value from the active SSR provider stack when available.\n *\n * @returns `true` when the selection callback was satisfied synchronously from SSR state.\n */\nexport function initializeContextSelection<TContext extends UnknownContext>(\n\tcontext: TContext,\n\trequest: DirectContextSelectionRequest<TContext>,\n): boolean;\nexport function initializeContextSelection<TContext extends UnknownContext, Selected>(\n\tcontext: TContext,\n\trequest: SelectedContextSelectionRequest<TContext, Selected>,\n): boolean;\nexport function initializeContextSelection<TContext extends UnknownContext, Selected = ContextType<TContext>>(\n\tcontext: TContext,\n\trequest: ContextSelectionRequest<TContext, Selected>,\n): boolean {\n\tconst provider = resolveAmbientSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn false;\n\t}\n\n\tconst resolvedContext = provider.getContext() as ContextType<TContext>;\n\n\tif (request.select) {\n\t\trequest.callback(request.select(resolvedContext));\n\t\treturn true;\n\t}\n\n\trequest.callback(resolvedContext);\n\treturn true;\n}\n\n/**\n * Requests a selected context value through the DOM event channel.\n */\nexport function requestContextSelection<TContext extends UnknownContext>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\trequest: DirectContextSelectionRequest<TContext>,\n\toptions: {\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t},\n): boolean;\nexport function requestContextSelection<TContext extends UnknownContext, Selected>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\trequest: SelectedContextSelectionRequest<TContext, Selected>,\n\toptions: {\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t},\n): boolean;\nexport function requestContextSelection<TContext extends UnknownContext, Selected = ContextType<TContext>>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\trequest: ContextSelectionRequest<TContext, Selected>,\n\toptions: {\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t},\n): boolean {\n\tconst event = new ContextSubscriptionRequestEvent(\n\t\tcontext,\n\t\trequest.callback as ContextCallback<Selected>,\n\t\trequest.select,\n\t\toptions.subscribe,\n\t\toptions.onSubscribe,\n\t);\n\n\thost.dispatchEvent(event);\n\treturn event.handled;\n}\n",
10
- "import type { ContextHostLike } from './context-host';\nimport { registerSsrPreparationCallback } from '../core/ssr-preparation';\nimport {\n\tinitializeConsumedContext,\n\tinitializeContextSelection,\n\trequestConsumedContext,\n\trequestContextSelection,\n} from './context-consumer-runtime';\nimport type { ContextType, UnknownContext } from './types';\n\ntype ConsumedContextAssignment = (provider: unknown) => void;\n\n/**\n * Resolves a consumed context immediately and registers the same resolution to\n * run again during the later SSR preparation phase.\n *\n * This keeps constructor-time state and pre-serialization state aligned after\n * instance fields, props, or authored host content change during SSR setup.\n */\nexport function bootstrapSsrConsumedContext(\n\thost: ContextHostLike,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\treturn registerAndResolveConsumerBootstrap(host, () => initializeConsumedContext(host, context, assign, options));\n}\n\n/**\n * Resolves a selected context value immediately and registers the same\n * selection for the later SSR preparation phase.\n *\n * This lets nested SSR renders recompute selector-backed state after the host\n * has finished construction and any server-side configuration hooks have run.\n */\nexport function bootstrapSsrContextSelection<TContext extends UnknownContext, Selected = ContextType<TContext>>(\n\thost: object,\n\tcontext: TContext,\n\tcallback: (value: Selected) => void,\n\tselect?: (context: ContextType<TContext>) => Selected,\n): boolean {\n\treturn registerAndResolveConsumerBootstrap(host, () => {\n\t\tif (select) {\n\t\t\treturn initializeContextSelection(context, { callback, select });\n\t\t}\n\n\t\treturn initializeContextSelection(context, {\n\t\t\tcallback: callback as (value: ContextType<TContext>) => void,\n\t\t});\n\t});\n}\n\n/**\n * Resolves a consumed context from SSR when available, otherwise requests it\n * through the DOM event channel for the current client-side lifecycle pass.\n *\n * @returns `true` when the value was satisfied synchronously from SSR state.\n */\nexport function connectConsumedContext(\n\thost: ContextHostLike,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\tif (initializeConsumedContext(host, context, assign, options)) {\n\t\treturn true;\n\t}\n\n\treturn requestConsumedContext(host, context, assign, options);\n}\n\n/**\n * Resolves a selected context value from SSR when available, otherwise requests\n * it through the DOM event channel for the current client-side lifecycle pass.\n *\n * @returns `true` when the value was satisfied synchronously from SSR state.\n */\nexport function connectContextSelection<TContext extends UnknownContext, Selected = ContextType<TContext>>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\tcallback: (value: Selected) => void,\n\toptions: {\n\t\tselect?: (context: ContextType<TContext>) => Selected;\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t} = {},\n): boolean {\n\tif (options.select) {\n\t\tconst request = { callback, select: options.select };\n\n\t\tif (initializeContextSelection(context, request)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn requestContextSelection(host, context, request, {\n\t\t\tsubscribe: options.subscribe,\n\t\t\tonSubscribe: options.onSubscribe,\n\t\t});\n\t}\n\n\tconst request = {\n\t\tcallback: callback as (value: ContextType<TContext>) => void,\n\t};\n\n\tif (initializeContextSelection(context, request)) {\n\t\treturn true;\n\t}\n\n\treturn requestContextSelection(host, context, request, {\n\t\tsubscribe: options.subscribe,\n\t\tonSubscribe: options.onSubscribe,\n\t});\n}\n\nfunction registerAndResolveConsumerBootstrap<TResult>(host: object, resolve: () => TResult): TResult {\n\tregisterSsrPreparationCallback(host, resolve);\n\treturn resolve();\n}\n",
11
- "import { SSR_PREPARATION_RUNNING } from '../../core/ssr-preparation';\n\ntype RequestUpdateCapable = {\n\trequestUpdate(): void;\n};\n\nexport function createContextSelectionDelivery<Value>(\n\thost: object,\n\tapply: (value: Value) => void,\n\trequestUpdate: boolean,\n) {\n\tlet hasDeliveredValue = false;\n\tlet previousValue: Value;\n\tconst target = host as Record<PropertyKey, unknown>;\n\n\treturn (value: Value) => {\n\t\tif (target[SSR_PREPARATION_RUNNING] !== true && hasDeliveredValue && Object.is(previousValue, value)) {\n\t\t\treturn;\n\t\t}\n\n\t\thasDeliveredValue = true;\n\t\tpreviousValue = value;\n\t\tapply(value);\n\n\t\tif (requestUpdate && typeof target.requestUpdate === 'function') {\n\t\t\t(target as RequestUpdateCapable).requestUpdate();\n\t\t}\n\t};\n}\n",
12
- "import type { ContextHostLike } from '../../context-host';\nimport { registerLegacyInstanceInitializer } from '../../../decorators/legacy/instance-initializers';\nimport { bootstrapSsrContextSelection, connectContextSelection } from '../../context-consumer-bootstrap';\nimport type { Context, ContextType } from '../../types';\nimport type { OnContextUpdateOptions } from '../on-context-update';\nimport { createContextSelectionDelivery } from '../context-selection-delivery';\n\nexport function contextSelector<T extends Context<unknown, unknown>, Selected = ContextType<T>>({\n\tcontext,\n\tselect,\n\tsubscribe = true,\n\trequestUpdate = true,\n}: OnContextUpdateOptions<T, Selected>) {\n\treturn (proto: ContextHostLike, _: string, descriptor: PropertyDescriptor) => {\n\t\tconst originalMethod = descriptor.value;\n\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tlet activeUnsubscribe: (() => void) | undefined;\n\t\t\tconst applySelectedContext = createContextSelectionDelivery(\n\t\t\t\telement,\n\t\t\t\t(value) => {\n\t\t\t\t\toriginalMethod.call(element, value);\n\t\t\t\t},\n\t\t\t\trequestUpdate,\n\t\t\t);\n\n\t\t\tbootstrapSsrContextSelection<T, Selected>(element, context, applySelectedContext, select);\n\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tif (\n\t\t\t\t\tconnectContextSelection<T, Selected>(element, context, applySelectedContext, {\n\t\t\t\t\t\tonSubscribe: (unsubscribe) => {\n\t\t\t\t\t\t\tactiveUnsubscribe = unsubscribe;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tsubscribe,\n\t\t\t\t\t})\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tconnectContextSelection<T, Selected>(element, context, applySelectedContext, {\n\t\t\t\t\t\tonSubscribe: (unsubscribe) => {\n\t\t\t\t\t\t\tactiveUnsubscribe = unsubscribe;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tsubscribe,\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\tactiveUnsubscribe?.();\n\t\t\t\tactiveUnsubscribe = undefined;\n\t\t\t});\n\t\t});\n\n\t\treturn descriptor;\n\t};\n}\n"
13
- ],
14
- "mappings": "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",
15
- "debugId": "93D09DE3C1180B2764756E2164756E21",
16
- "names": []
17
- }
@@ -1,3 +0,0 @@
1
- var N=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(L,g)=>(typeof require<"u"?require:L)[g]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});var X=Symbol.for("@ecopages/radiant.legacy-instance-initializers");function O(f,L){let j=f[X];if(Array.isArray(j)){j.push(L);return}Object.defineProperty(f,X,{value:[L],configurable:!0})}function v(f){let L=[],g=Object.getPrototypeOf(f);while(g&&g!==Object.prototype)L.push(g),g=Object.getPrototypeOf(g);for(let j=L.length-1;j>=0;j-=1){let q=L[j][X];if(!Array.isArray(q))continue;for(let Q of q)Q(f)}}function U(f){return f.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var Z="data-hydration",B="data-hydration-type",G="data-hydration-key";function D(f){let L=f.hydrationKey?` ${G}="${K(f.hydrationKey)}"`:"";return`<script type="application/json" ${Z} ${B}="${f.type}"${L}>${f.serializedValue}</script>`}function H(f){return U(f)}function P(f,L){let g=f.textContent;if(!g)return L;try{return JSON.parse(g)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${Z}>:`,g.slice(0,120));return L}}function k(f,L,g){let j=f.children;if(!j||j.length===0){let q=f.childNodes;if(!q||q.length===0)return null;for(let Q=0;Q<q.length;Q+=1){let F=q[Q];if(F.nodeType!==1)continue;let $=F;if(w($,L,g))return $}return null}for(let q=0;q<j.length;q+=1)if(w(j[q],L,g))return j[q];return null}function w(f,L,g){if(f.tagName!=="SCRIPT"||!f.hasAttribute(Z)||f.getAttribute(B)!==L)return!1;if(g!==void 0)return f.getAttribute(G)===g;return!f.hasAttribute(G)}function K(f){return f.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function T(f){if(f instanceof Element)return f;if("host"in f)return f.host;if("element"in f)return f.element;return null}function C(f){if(f instanceof Element)return f;if("host"in f)return f.host;if("element"in f)return f.element;return f}function E(f){return D({type:"context",...f})}function V(f){return H(f)}var Y;((q)=>{q.SUBSCRIPTION_REQUEST="context-subscription-request";q.CONTEXT_REQUEST="context-request";q.ON_MOUNT="context-on-mount";q.MOUNTED="context-mounted"})(Y||={});class _ extends Event{context;callback;subscribe;handled=!1;constructor(f,L,g){super("context-request",{bubbles:!0,composed:!0});this.context=f;this.callback=L;this.subscribe=g}markHandled(){this.handled=!0}}class W extends CustomEvent{constructor(f){super("context-on-mount",{detail:{context:f},bubbles:!0,composed:!0})}}class z extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(f,L,g,j,q){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=f;this.callback=L;this.select=g;this.subscribe=j;this.onSubscribe=q}markHandled(){this.handled=!0}}import{createMarkupNodeLike as A}from"@ecopages/jsx";class J{host;context;hydrationKey;hydrate;serialize;pendingHostHydration;value;subscriptions=[];constructor(f,L){this.host=f,this.context=L.context,this.hydrationKey=L.hydrationKey,this.hydrate=L.hydrate,this.serialize=L.serialize,this.pendingHostHydration=Boolean(L.hydrate),this.value=L.initialValue,this.tryHydrateFromHost(),this.registerEvents(),this.host.dispatchEvent(new W(this.context))}setContext=(f,L)=>{if(this.tryHydrateFromHost(),this.pendingHostHydration=!1,typeof this.value>"u"&&this.isObject(f)){let g=this.value;if(this.value={...f},L)L(this.value);this.notifySubscribers(this.value,g);return}if(this.isObject(this.value)&&this.isObject(f)){let g={...this.value};if(this.value={...this.value,...f},L)L(this.value);this.notifySubscribers(this.value,g)}};getContext=()=>{return this.tryHydrateFromHost(),this.value};getContextKey=()=>{return this.context};serializeHydrationValue=()=>{if(this.tryHydrateFromHost(),!this.hydrate||typeof this.value>"u")return;let f=this.serialize?this.serialize(this.value):this.value;if(typeof f>"u")return;let L=JSON.stringify(f);if(typeof L!=="string")return;return V(L)};renderHydrationScriptTag=()=>{let f=this.serializeHydrationValue();if(!f)return;return E({hydrationKey:this.hydrationKey,serializedValue:f})};renderHydrationScript=()=>{let f=this.renderHydrationScriptTag();if(!f)return;return A(f)};subscribe=(f)=>{let L={hasChanged:(g,j)=>{if(typeof j>"u"||!f.select)return!0;return f.select(g)!==f.select(j)},notify:(g)=>{if(f.select){f.callback(f.select(g),L.unsubscribe);return}f.callback(g,L.unsubscribe)},unsubscribe:()=>{let g=this.subscriptions.indexOf(L);if(g!==-1)this.subscriptions.splice(g,1)}};return this.subscriptions.push(L),L.unsubscribe};tryHydrateFromHost(){if(!this.pendingHostHydration)return;let f=this.findHydrationScriptElement();if(!f)return;this.value=this.mergeHydrationValue(P(f,this.value)),this.pendingHostHydration=!1}mergeHydrationValue(f){if(this.hydrate===Object&&this.isObject(f)&&(this.isObject(this.value)||typeof this.value>"u"))return{...this.value??{},...f};return f}isObject(f){return typeof f==="object"&&!Array.isArray(f)&&f!==null}findHydrationScriptElement(){return k(C(this.host),"context",this.hydrationKey)}notifySubscribers=(f,L)=>{for(let g of this.subscriptions)if(g.hasChanged(f,L))g.notify(f)};handleSubscriptionRequest=(f,{subscribe:L,onSubscribe:g})=>{this.tryHydrateFromHost();let j=L?this.subscribe(f):void 0;if(j)g?.(j);if(typeof this.value>"u")return;if(f.select)f.callback(f.select(this.value),j);else f.callback(this.value,j)};onSubscriptionRequest=(f)=>{let{context:L,callback:g,subscribe:j,select:q,target:Q,onSubscribe:F}=f;if(L!==this.context)return;if(f.markHandled(),f.stopPropagation(),Q instanceof EventTarget)Q.dispatchEvent(new W(this.context));if(q){this.handleSubscriptionRequest({select:q,callback:g},{subscribe:j,onSubscribe:F});return}this.handleSubscriptionRequest({callback:g},{subscribe:j,onSubscribe:F})};onContextRequest=(f)=>{let{context:L,callback:g}=f;if(L!==this.context)return;f.markHandled(),f.stopPropagation(),g(this)};registerEvents=()=>{this.host.addEventListener("context-subscription-request",this.onSubscriptionRequest),this.host.addEventListener("context-request",this.onContextRequest)}}function o({context:f,initialValue:L,hydrate:g,serialize:j}){return(q,Q)=>{let F=($)=>{if($[Q])return;let M=new J($,{context:f,hydrationKey:Q,initialValue:L,hydrate:g,serialize:j});$[Q]=M,$.registerContextProvider(Q,M),$.connectedContextCallback(f)};O(q,($)=>{F($),$.registerConnectedCallback(()=>{F($)})})}}export{o as provideContext};
2
-
3
- //# debugId=050FBCC01908F65964756E2164756E21
@@ -1,3 +0,0 @@
1
- var A=((d)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(d,{get:(F,f)=>(typeof require<"u"?require:F)[f]}):d)(function(d){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+d+'" is not supported')});var W=Symbol.for("@ecopages/radiant.legacy-instance-initializers");function G(d,F){let M=d[W];if(Array.isArray(M)){M.push(F);return}Object.defineProperty(d,W,{value:[F],configurable:!0})}function r(d){let F=[],f=Object.getPrototypeOf(d);while(f&&f!==Object.prototype)F.push(f),f=Object.getPrototypeOf(f);for(let M=F.length-1;M>=0;M-=1){let H=F[M][W];if(!Array.isArray(H))continue;for(let D of H)D(d)}}var $=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),B=Symbol.for("@ecopages/radiant.ssr-preparation-running");function T(d,F){let M=d[$];if(Array.isArray(M)){M.push(F);return}Object.defineProperty(d,$,{value:[F],configurable:!0})}function S(d){let F=d,f=F[$];if(!Array.isArray(f))return;F[B]=!0;try{for(let M of f)M()}finally{delete F[B]}}function m(d){return typeof d==="function"}function v(d,F,f,M){if(typeof M==="object")return d(void 0,M);return F(f,M)}function k(d,F,f,M,H){if(typeof M==="object"){if(!m(f))throw TypeError("Standard method decorators require a method target");return d(f,M)}if(!H)throw TypeError("Legacy method decorators require a property descriptor");return F(f,M,H)}var U=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function O(){return globalThis}function b(d){O()[U]=d}function K(d){return O()[U]?.(d)}var h;((H)=>{H.SUBSCRIPTION_REQUEST="context-subscription-request";H.CONTEXT_REQUEST="context-request";H.ON_MOUNT="context-on-mount";H.MOUNTED="context-mounted"})(h||={});class R extends Event{context;callback;subscribe;handled=!1;constructor(d,F,f){super("context-request",{bubbles:!0,composed:!0});this.context=d;this.callback=F;this.subscribe=f}markHandled(){this.handled=!0}}class I extends CustomEvent{constructor(d){super("context-on-mount",{detail:{context:d},bubbles:!0,composed:!0})}}class X extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(d,F,f,M,H){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=d;this.callback=F;this.select=f;this.subscribe=M;this.onSubscribe=H}markHandled(){this.handled=!0}}function Z(d,F,f,M={}){let H=K(F);if(!H)return!1;if(f(H),d.connectedContextCallback(F),M.emitMounted)d.dispatchEvent(new CustomEvent("context-mounted",{detail:H}));return!0}function z(d,F,f,M={}){let H=new R(F,(D)=>{if(f(D),d.connectedContextCallback(F),M.emitMounted)d.dispatchEvent(new CustomEvent("context-mounted",{detail:D}))});return d.dispatchEvent(H),H.handled}function u(d,F){let f=K(d);if(!f)return!1;let M=f.getContext();if(F.select)return F.callback(F.select(M)),!0;return F.callback(M),!0}function Y(d,F,f,M){let H=new X(F,f.callback,f.select,M.subscribe,M.onSubscribe);return d.dispatchEvent(H),H.handled}function t(d,F,f,M={}){return N(d,()=>Z(d,F,f,M))}function J(d,F,f,M){return N(d,()=>{if(M)return u(F,{callback:f,select:M});return u(F,{callback:f})})}function e(d,F,f,M={}){if(Z(d,F,f,M))return!0;return z(d,F,f,M)}function g(d,F,f,M={}){if(M.select){let D={callback:f,select:M.select};if(u(F,D))return!0;return Y(d,F,D,{subscribe:M.subscribe,onSubscribe:M.onSubscribe})}let H={callback:f};if(u(F,H))return!0;return Y(d,F,H,{subscribe:M.subscribe,onSubscribe:M.onSubscribe})}function N(d,F){return T(d,F),F()}function L(d,F,f){let M=!1,H,D=d;return(j)=>{if(D[B]!==!0&&M&&Object.is(H,j))return;if(M=!0,H=j,F(j),f&&typeof D.requestUpdate==="function")D.requestUpdate()}}function q({context:d,select:F,subscribe:f=!0,requestUpdate:M=!0}){return(H,D,j)=>{let P=j.value;return G(H,(w)=>{let V,Q=L(w,(y)=>{P.call(w,y)},M);J(w,d,Q,F),w.registerConnectedCallback(()=>{if(g(w,d,Q,{onSubscribe:(y)=>{V=y},select:F,subscribe:f}))return;queueMicrotask(()=>{g(w,d,Q,{onSubscribe:(y)=>{V=y},select:F,subscribe:f})})}),w.registerCleanupCallback(()=>{V?.(),V=void 0})}),j}}function _({context:d,select:F,subscribe:f=!0,requestUpdate:M=!0}){return function(H,D){D.addInitializer(function(){let j,P=L(this,(V)=>{H.call(this,V)},M);if(J(this,d,P,F))return;let w=()=>{return g(this,d,P,{onSubscribe:(V)=>{j=V},select:F,subscribe:f})};this.registerCleanupCallback(()=>{j?.(),j=void 0}),this.registerConnectedCallback(()=>{if(w())return;queueMicrotask(()=>{w()})})})}}function Bd(d){function F(f,M,H){return k(_(d),q(d),f,M,H)}return F}export{Bd as onContextUpdate};
2
-
3
- //# debugId=553E18275DC7DBCE64756E2164756E21
@@ -1,3 +0,0 @@
1
- var E=((d)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(d,{get:(o,g)=>(typeof require<"u"?require:o)[g]}):d)(function(d){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+d+'" is not supported')});var j=Symbol.for("@ecopages/radiant.legacy-instance-initializers");function R(d,o){let f=d[j];if(Array.isArray(f)){f.push(o);return}Object.defineProperty(d,j,{value:[o],configurable:!0})}function Y(d){let o=[],g=Object.getPrototypeOf(d);while(g&&g!==Object.prototype)o.push(g),g=Object.getPrototypeOf(g);for(let f=o.length-1;f>=0;f-=1){let r=o[f][j];if(!Array.isArray(r))continue;for(let F of r)F(d)}}function D(d){return d.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var H="data-hydration",x="data-hydration-type",w="data-hydration-key";function k(d){let o=d.hydrationKey?` ${w}="${Z(d.hydrationKey)}"`:"";return`<script type="application/json" ${H} ${x}="${d.type}"${o}>${d.serializedValue}</script>`}function q(d){return D(d)}function u(d,o){let g=d.textContent;if(!g)return o;try{return JSON.parse(g)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${H}>:`,g.slice(0,120));return o}}function Q(d,o,g){let f=d.children;if(!f||f.length===0){let r=d.childNodes;if(!r||r.length===0)return null;for(let F=0;F<r.length;F+=1){let M=r[F];if(M.nodeType!==1)continue;let t=M;if(n(t,o,g))return t}return null}for(let r=0;r<f.length;r+=1)if(n(f[r],o,g))return f[r];return null}function n(d,o,g){if(d.tagName!=="SCRIPT"||!d.hasAttribute(H)||d.getAttribute(x)!==o)return!1;if(g!==void 0)return d.getAttribute(w)===g;return!d.hasAttribute(w)}function Z(d){return d.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function J(d){return typeof d==="function"}function $(d,o,g,f){if(typeof f==="object")return d(void 0,f);return o(g,f)}function A(d,o,g,f,r){if(typeof f==="object"){if(!J(g))throw TypeError("Standard method decorators require a method target");return d(g,f)}if(!r)throw TypeError("Legacy method decorators require a property descriptor");return o(g,f,r)}function l(d){if(d instanceof Element)return d;if("host"in d)return d.host;if("element"in d)return d.element;return null}function B(d){if(d instanceof Element)return d;if("host"in d)return d.host;if("element"in d)return d.element;return d}function V(d){return k({type:"context",...d})}function W(d){return q(d)}var X;((r)=>{r.SUBSCRIPTION_REQUEST="context-subscription-request";r.CONTEXT_REQUEST="context-request";r.ON_MOUNT="context-on-mount";r.MOUNTED="context-mounted"})(X||={});class U extends Event{context;callback;subscribe;handled=!1;constructor(d,o,g){super("context-request",{bubbles:!0,composed:!0});this.context=d;this.callback=o;this.subscribe=g}markHandled(){this.handled=!0}}class P extends CustomEvent{constructor(d){super("context-on-mount",{detail:{context:d},bubbles:!0,composed:!0})}}class h extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(d,o,g,f,r){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=d;this.callback=o;this.select=g;this.subscribe=f;this.onSubscribe=r}markHandled(){this.handled=!0}}import{createMarkupNodeLike as m}from"@ecopages/jsx";class C{host;context;hydrationKey;hydrate;serialize;pendingHostHydration;value;subscriptions=[];constructor(d,o){this.host=d,this.context=o.context,this.hydrationKey=o.hydrationKey,this.hydrate=o.hydrate,this.serialize=o.serialize,this.pendingHostHydration=Boolean(o.hydrate),this.value=o.initialValue,this.tryHydrateFromHost(),this.registerEvents(),this.host.dispatchEvent(new P(this.context))}setContext=(d,o)=>{if(this.tryHydrateFromHost(),this.pendingHostHydration=!1,typeof this.value>"u"&&this.isObject(d)){let g=this.value;if(this.value={...d},o)o(this.value);this.notifySubscribers(this.value,g);return}if(this.isObject(this.value)&&this.isObject(d)){let g={...this.value};if(this.value={...this.value,...d},o)o(this.value);this.notifySubscribers(this.value,g)}};getContext=()=>{return this.tryHydrateFromHost(),this.value};getContextKey=()=>{return this.context};serializeHydrationValue=()=>{if(this.tryHydrateFromHost(),!this.hydrate||typeof this.value>"u")return;let d=this.serialize?this.serialize(this.value):this.value;if(typeof d>"u")return;let o=JSON.stringify(d);if(typeof o!=="string")return;return W(o)};renderHydrationScriptTag=()=>{let d=this.serializeHydrationValue();if(!d)return;return V({hydrationKey:this.hydrationKey,serializedValue:d})};renderHydrationScript=()=>{let d=this.renderHydrationScriptTag();if(!d)return;return m(d)};subscribe=(d)=>{let o={hasChanged:(g,f)=>{if(typeof f>"u"||!d.select)return!0;return d.select(g)!==d.select(f)},notify:(g)=>{if(d.select){d.callback(d.select(g),o.unsubscribe);return}d.callback(g,o.unsubscribe)},unsubscribe:()=>{let g=this.subscriptions.indexOf(o);if(g!==-1)this.subscriptions.splice(g,1)}};return this.subscriptions.push(o),o.unsubscribe};tryHydrateFromHost(){if(!this.pendingHostHydration)return;let d=this.findHydrationScriptElement();if(!d)return;this.value=this.mergeHydrationValue(u(d,this.value)),this.pendingHostHydration=!1}mergeHydrationValue(d){if(this.hydrate===Object&&this.isObject(d)&&(this.isObject(this.value)||typeof this.value>"u"))return{...this.value??{},...d};return d}isObject(d){return typeof d==="object"&&!Array.isArray(d)&&d!==null}findHydrationScriptElement(){return Q(B(this.host),"context",this.hydrationKey)}notifySubscribers=(d,o)=>{for(let g of this.subscriptions)if(g.hasChanged(d,o))g.notify(d)};handleSubscriptionRequest=(d,{subscribe:o,onSubscribe:g})=>{this.tryHydrateFromHost();let f=o?this.subscribe(d):void 0;if(f)g?.(f);if(typeof this.value>"u")return;if(d.select)d.callback(d.select(this.value),f);else d.callback(this.value,f)};onSubscriptionRequest=(d)=>{let{context:o,callback:g,subscribe:f,select:r,target:F,onSubscribe:M}=d;if(o!==this.context)return;if(d.markHandled(),d.stopPropagation(),F instanceof EventTarget)F.dispatchEvent(new P(this.context));if(r){this.handleSubscriptionRequest({select:r,callback:g},{subscribe:f,onSubscribe:M});return}this.handleSubscriptionRequest({callback:g},{subscribe:f,onSubscribe:M})};onContextRequest=(d)=>{let{context:o,callback:g}=d;if(o!==this.context)return;d.markHandled(),d.stopPropagation(),g(this)};registerEvents=()=>{this.host.addEventListener("context-subscription-request",this.onSubscriptionRequest),this.host.addEventListener("context-request",this.onContextRequest)}}function G({context:d,initialValue:o,hydrate:g,serialize:f}){return(r,F)=>{let M=(t)=>{if(t[F])return;let L=new C(t,{context:d,hydrationKey:F,initialValue:o,hydrate:g,serialize:f});t[F]=L,t.registerContextProvider(F,L),t.connectedContextCallback(d)};R(r,(t)=>{M(t),t.registerConnectedCallback(()=>{M(t)})})}}function O({context:d,initialValue:o,hydrate:g,serialize:f}){return(r,F)=>{let M=String(F.name);F.addInitializer(function(){let t=this,L=new C(this,{context:d,hydrationKey:M,initialValue:o,hydrate:g,serialize:f});t[M]=L,this.registerContextProvider(M,L),this.connectedContextCallback(d)})}}function Ld(d){function o(g,f){return $(O(d),G(d),g,f)}return o}export{Ld as provideContext};
2
-
3
- //# debugId=2C0D8C7A36BE1A0964756E2164756E21
@@ -1,3 +0,0 @@
1
- var T=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(w,Q)=>(typeof require<"u"?require:w)[Q]}):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-preparation-callbacks"),G=Symbol.for("@ecopages/radiant.ssr-preparation-running");function V(j,w){let J=j[H];if(Array.isArray(J)){J.push(w);return}Object.defineProperty(j,H,{value:[w],configurable:!0})}function k(j){let w=j,Q=w[H];if(!Array.isArray(Q))return;w[G]=!0;try{for(let J of Q)J()}finally{delete w[G]}}var z=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function B(){return globalThis}function A(j){B()[z]=j}function M(j){return B()[z]?.(j)}var I;((W)=>{W.SUBSCRIPTION_REQUEST="context-subscription-request";W.CONTEXT_REQUEST="context-request";W.ON_MOUNT="context-on-mount";W.MOUNTED="context-mounted"})(I||={});class U extends Event{context;callback;subscribe;handled=!1;constructor(j,w,Q){super("context-request",{bubbles:!0,composed:!0});this.context=j;this.callback=w;this.subscribe=Q}markHandled(){this.handled=!0}}class P extends CustomEvent{constructor(j){super("context-on-mount",{detail:{context:j},bubbles:!0,composed:!0})}}class X extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(j,w,Q,J,W){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=j;this.callback=w;this.select=Q;this.subscribe=J;this.onSubscribe=W}markHandled(){this.handled=!0}}function Y(j,w,Q,J={}){let W=M(w);if(!W)return!1;if(Q(W),j.connectedContextCallback(w),J.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:W}));return!0}function y(j,w,Q,J={}){let W=new U(w,(Z)=>{if(Q(Z),j.connectedContextCallback(w),J.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:Z}))});return j.dispatchEvent(W),W.handled}function D(j,w){let Q=M(j);if(!Q)return!1;let J=Q.getContext();if(w.select)return w.callback(w.select(J)),!0;return w.callback(J),!0}function f(j,w,Q,J){let W=new X(w,Q.callback,Q.select,J.subscribe,J.onSubscribe);return j.dispatchEvent(W),W.handled}function L(j,w,Q,J={}){return O(j,()=>Y(j,w,Q,J))}function C(j,w,Q,J){return O(j,()=>{if(J)return D(w,{callback:Q,select:J});return D(w,{callback:Q})})}function N(j,w,Q,J={}){if(Y(j,w,Q,J))return!0;return y(j,w,Q,J)}function h(j,w,Q,J={}){if(J.select){let Z={callback:Q,select:J.select};if(D(w,Z))return!0;return f(j,w,Z,{subscribe:J.subscribe,onSubscribe:J.onSubscribe})}let W={callback:Q};if(D(w,W))return!0;return f(j,w,W,{subscribe:J.subscribe,onSubscribe:J.onSubscribe})}function O(j,w){return V(j,w),w()}function p(j){return(w,Q)=>{let J=String(Q.name),W=($,F)=>{let K=$;K[J]=F},Z=($,F={})=>{if($[J])return!0;return N($,j,(m)=>{W($,m)},F)};Q.addInitializer(function(){if(L(this,j,($)=>{W(this,$)},{emitMounted:!0}))return;this.registerConnectedCallback(()=>{if(Z(this,{emitMounted:!0}))return;queueMicrotask(()=>{Z(this,{emitMounted:!0})})})})}}export{p as consumeContext};
2
-
3
- //# debugId=12804971D0DCAD3F64756E2164756E21
@@ -1,3 +0,0 @@
1
- var k=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(w,f)=>(typeof require<"u"?require:w)[f]}):j)(function(j){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+j+'" is not supported')});var D=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),Z=Symbol.for("@ecopages/radiant.ssr-preparation-running");function B(j,w){let U=j[D];if(Array.isArray(U)){U.push(w);return}Object.defineProperty(j,D,{value:[w],configurable:!0})}function E(j){let w=j,f=w[D];if(!Array.isArray(f))return;w[Z]=!0;try{for(let U of f)U()}finally{delete w[Z]}}var I=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function y(){return globalThis}function d(j){y()[I]=j}function K(j){return y()[I]?.(j)}var L;((F)=>{F.SUBSCRIPTION_REQUEST="context-subscription-request";F.CONTEXT_REQUEST="context-request";F.ON_MOUNT="context-on-mount";F.MOUNTED="context-mounted"})(L||={});class M extends Event{context;callback;subscribe;handled=!1;constructor(j,w,f){super("context-request",{bubbles:!0,composed:!0});this.context=j;this.callback=w;this.subscribe=f}markHandled(){this.handled=!0}}class _ extends CustomEvent{constructor(j){super("context-on-mount",{detail:{context:j},bubbles:!0,composed:!0})}}class V extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(j,w,f,U,F){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=j;this.callback=w;this.select=f;this.subscribe=U;this.onSubscribe=F}markHandled(){this.handled=!0}}function X(j,w,f,U={}){let F=K(w);if(!F)return!1;if(f(F),j.connectedContextCallback(w),U.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:F}));return!0}function N(j,w,f,U={}){let F=new M(w,(H)=>{if(f(H),j.connectedContextCallback(w),U.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:H}))});return j.dispatchEvent(F),F.handled}function W(j,w){let f=K(j);if(!f)return!1;let U=f.getContext();if(w.select)return w.callback(w.select(U)),!0;return w.callback(U),!0}function Y(j,w,f,U){let F=new V(w,f.callback,f.select,U.subscribe,U.onSubscribe);return j.dispatchEvent(F),F.handled}function p(j,w,f,U={}){return m(j,()=>X(j,w,f,U))}function O(j,w,f,U){return m(j,()=>{if(U)return W(w,{callback:f,select:U});return W(w,{callback:f})})}function x(j,w,f,U={}){if(X(j,w,f,U))return!0;return N(j,w,f,U)}function P(j,w,f,U={}){if(U.select){let H={callback:f,select:U.select};if(W(w,H))return!0;return Y(j,w,H,{subscribe:U.subscribe,onSubscribe:U.onSubscribe})}let F={callback:f};if(W(w,F))return!0;return Y(j,w,F,{subscribe:U.subscribe,onSubscribe:U.onSubscribe})}function m(j,w){return B(j,w),w()}function q(j,w,f){let U=!1,F,H=j;return(J)=>{if(H[Z]!==!0&&U&&Object.is(F,J))return;if(U=!0,F=J,w(J),f&&typeof H.requestUpdate==="function")H.requestUpdate()}}function n(j){let{context:w,select:f,subscribe:U=!0}=j;return function(F,H){let J=String(H.name);return H.addInitializer(function(){let Q,z=q(this,($)=>{let T=this;T[J]=$},!0);if(O(this,w,z,f))return;let G=()=>{return P(this,w,z,{onSubscribe:($)=>{Q=$},select:f,subscribe:U})};this.registerCleanupCallback(()=>{Q?.(),Q=void 0}),this.registerConnectedCallback(()=>{if(G())return;queueMicrotask(()=>{G()})})}),function(Q){return Q}}}export{n as contextSelectorField};
2
-
3
- //# debugId=1757817A9B629F7064756E2164756E21
@@ -1,3 +0,0 @@
1
- var _=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(j,w)=>(typeof require<"u"?require:j)[w]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});var $=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),W=Symbol.for("@ecopages/radiant.ssr-preparation-running");function M(f,j){let V=f[$];if(Array.isArray(V)){V.push(j);return}Object.defineProperty(f,$,{value:[j],configurable:!0})}function k(f){let j=f,w=j[$];if(!Array.isArray(w))return;j[W]=!0;try{for(let V of w)V()}finally{delete j[W]}}var B=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function I(){return globalThis}function E(f){I()[B]=f}function D(f){return I()[B]?.(f)}var y;((F)=>{F.SUBSCRIPTION_REQUEST="context-subscription-request";F.CONTEXT_REQUEST="context-request";F.ON_MOUNT="context-on-mount";F.MOUNTED="context-mounted"})(y||={});class U extends Event{context;callback;subscribe;handled=!1;constructor(f,j,w){super("context-request",{bubbles:!0,composed:!0});this.context=f;this.callback=j;this.subscribe=w}markHandled(){this.handled=!0}}class T extends CustomEvent{constructor(f){super("context-on-mount",{detail:{context:f},bubbles:!0,composed:!0})}}class K extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(f,j,w,V,F){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=f;this.callback=j;this.select=w;this.subscribe=V;this.onSubscribe=F}markHandled(){this.handled=!0}}function X(f,j,w,V={}){let F=D(j);if(!F)return!1;if(w(F),f.connectedContextCallback(j),V.emitMounted)f.dispatchEvent(new CustomEvent("context-mounted",{detail:F}));return!0}function N(f,j,w,V={}){let F=new U(j,(H)=>{if(w(H),f.connectedContextCallback(j),V.emitMounted)f.dispatchEvent(new CustomEvent("context-mounted",{detail:H}))});return f.dispatchEvent(F),F.handled}function Q(f,j){let w=D(f);if(!w)return!1;let V=w.getContext();if(j.select)return j.callback(j.select(V)),!0;return j.callback(V),!0}function Y(f,j,w,V){let F=new K(j,w.callback,w.select,V.subscribe,V.onSubscribe);return f.dispatchEvent(F),F.handled}function h(f,j,w,V={}){return m(f,()=>X(f,j,w,V))}function L(f,j,w,V){return m(f,()=>{if(V)return Q(j,{callback:w,select:V});return Q(j,{callback:w})})}function v(f,j,w,V={}){if(X(f,j,w,V))return!0;return N(f,j,w,V)}function O(f,j,w,V={}){if(V.select){let H={callback:w,select:V.select};if(Q(j,H))return!0;return Y(f,j,H,{subscribe:V.subscribe,onSubscribe:V.onSubscribe})}let F={callback:w};if(Q(j,F))return!0;return Y(f,j,F,{subscribe:V.subscribe,onSubscribe:V.onSubscribe})}function m(f,j){return M(f,j),j()}function P(f,j,w){let V=!1,F,H=f;return(J)=>{if(H[W]!==!0&&V&&Object.is(F,J))return;if(V=!0,F=J,j(J),w&&typeof H.requestUpdate==="function")H.requestUpdate()}}function i({context:f,select:j,subscribe:w=!0,requestUpdate:V=!0}){return function(F,H){H.addInitializer(function(){let J,z=P(this,(Z)=>{F.call(this,Z)},V);if(L(this,f,z,j))return;let G=()=>{return O(this,f,z,{onSubscribe:(Z)=>{J=Z},select:j,subscribe:w})};this.registerCleanupCallback(()=>{J?.(),J=void 0}),this.registerConnectedCallback(()=>{if(G())return;queueMicrotask(()=>{G()})})})}}export{i as contextSelector};
2
-
3
- //# debugId=31AA67FE7927819464756E2164756E21
@@ -1,3 +0,0 @@
1
- var V=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(L,C)=>(typeof require<"u"?require:L)[C]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});function w(f){return f.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var Q="data-hydration",X="data-hydration-type",G="data-hydration-key";function z(f){let L=f.hydrationKey?` ${G}="${x(f.hydrationKey)}"`:"";return`<script type="application/json" ${Q} ${X}="${f.type}"${L}>${f.serializedValue}</script>`}function J(f){return w(f)}function O(f,L){let C=f.textContent;if(!C)return L;try{return JSON.parse(C)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${Q}>:`,C.slice(0,120));return L}}function U(f,L,C){let P=f.children;if(!P||P.length===0){let g=f.childNodes;if(!g||g.length===0)return null;for(let j=0;j<g.length;j+=1){let m=g[j];if(m.nodeType!==1)continue;let q=m;if(W(q,L,C))return q}return null}for(let g=0;g<P.length;g+=1)if(W(P[g],L,C))return P[g];return null}function W(f,L,C){if(f.tagName!=="SCRIPT"||!f.hasAttribute(Q)||f.getAttribute(X)!==L)return!1;if(C!==void 0)return f.getAttribute(G)===C;return!f.hasAttribute(G)}function x(f){return f.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function I(f){if(f instanceof Element)return f;if("host"in f)return f.host;if("element"in f)return f.element;return null}function k(f){if(f instanceof Element)return f;if("host"in f)return f.host;if("element"in f)return f.element;return f}function E(f){return z({type:"context",...f})}function M(f){return J(f)}var H;((g)=>{g.SUBSCRIPTION_REQUEST="context-subscription-request";g.CONTEXT_REQUEST="context-request";g.ON_MOUNT="context-on-mount";g.MOUNTED="context-mounted"})(H||={});class B extends Event{context;callback;subscribe;handled=!1;constructor(f,L,C){super("context-request",{bubbles:!0,composed:!0});this.context=f;this.callback=L;this.subscribe=C}markHandled(){this.handled=!0}}class F extends CustomEvent{constructor(f){super("context-on-mount",{detail:{context:f},bubbles:!0,composed:!0})}}class D extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(f,L,C,P,g){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=f;this.callback=L;this.select=C;this.subscribe=P;this.onSubscribe=g}markHandled(){this.handled=!0}}import{createMarkupNodeLike as K}from"@ecopages/jsx";class Z{host;context;hydrationKey;hydrate;serialize;pendingHostHydration;value;subscriptions=[];constructor(f,L){this.host=f,this.context=L.context,this.hydrationKey=L.hydrationKey,this.hydrate=L.hydrate,this.serialize=L.serialize,this.pendingHostHydration=Boolean(L.hydrate),this.value=L.initialValue,this.tryHydrateFromHost(),this.registerEvents(),this.host.dispatchEvent(new F(this.context))}setContext=(f,L)=>{if(this.tryHydrateFromHost(),this.pendingHostHydration=!1,typeof this.value>"u"&&this.isObject(f)){let C=this.value;if(this.value={...f},L)L(this.value);this.notifySubscribers(this.value,C);return}if(this.isObject(this.value)&&this.isObject(f)){let C={...this.value};if(this.value={...this.value,...f},L)L(this.value);this.notifySubscribers(this.value,C)}};getContext=()=>{return this.tryHydrateFromHost(),this.value};getContextKey=()=>{return this.context};serializeHydrationValue=()=>{if(this.tryHydrateFromHost(),!this.hydrate||typeof this.value>"u")return;let f=this.serialize?this.serialize(this.value):this.value;if(typeof f>"u")return;let L=JSON.stringify(f);if(typeof L!=="string")return;return M(L)};renderHydrationScriptTag=()=>{let f=this.serializeHydrationValue();if(!f)return;return E({hydrationKey:this.hydrationKey,serializedValue:f})};renderHydrationScript=()=>{let f=this.renderHydrationScriptTag();if(!f)return;return K(f)};subscribe=(f)=>{let L={hasChanged:(C,P)=>{if(typeof P>"u"||!f.select)return!0;return f.select(C)!==f.select(P)},notify:(C)=>{if(f.select){f.callback(f.select(C),L.unsubscribe);return}f.callback(C,L.unsubscribe)},unsubscribe:()=>{let C=this.subscriptions.indexOf(L);if(C!==-1)this.subscriptions.splice(C,1)}};return this.subscriptions.push(L),L.unsubscribe};tryHydrateFromHost(){if(!this.pendingHostHydration)return;let f=this.findHydrationScriptElement();if(!f)return;this.value=this.mergeHydrationValue(O(f,this.value)),this.pendingHostHydration=!1}mergeHydrationValue(f){if(this.hydrate===Object&&this.isObject(f)&&(this.isObject(this.value)||typeof this.value>"u"))return{...this.value??{},...f};return f}isObject(f){return typeof f==="object"&&!Array.isArray(f)&&f!==null}findHydrationScriptElement(){return U(k(this.host),"context",this.hydrationKey)}notifySubscribers=(f,L)=>{for(let C of this.subscriptions)if(C.hasChanged(f,L))C.notify(f)};handleSubscriptionRequest=(f,{subscribe:L,onSubscribe:C})=>{this.tryHydrateFromHost();let P=L?this.subscribe(f):void 0;if(P)C?.(P);if(typeof this.value>"u")return;if(f.select)f.callback(f.select(this.value),P);else f.callback(this.value,P)};onSubscriptionRequest=(f)=>{let{context:L,callback:C,subscribe:P,select:g,target:j,onSubscribe:m}=f;if(L!==this.context)return;if(f.markHandled(),f.stopPropagation(),j instanceof EventTarget)j.dispatchEvent(new F(this.context));if(g){this.handleSubscriptionRequest({select:g,callback:C},{subscribe:P,onSubscribe:m});return}this.handleSubscriptionRequest({callback:C},{subscribe:P,onSubscribe:m})};onContextRequest=(f)=>{let{context:L,callback:C}=f;if(L!==this.context)return;f.markHandled(),f.stopPropagation(),C(this)};registerEvents=()=>{this.host.addEventListener("context-subscription-request",this.onSubscriptionRequest),this.host.addEventListener("context-request",this.onContextRequest)}}function b({context:f,initialValue:L,hydrate:C,serialize:P}){return(g,j)=>{let m=String(j.name);j.addInitializer(function(){let q=this,$=new Z(this,{context:f,hydrationKey:m,initialValue:L,hydrate:C,serialize:P});q[m]=$,this.registerContextProvider(m,$),this.connectedContextCallback(f)})}}export{b as provideContext};
2
-
3
- //# debugId=80651B718587438C64756E2164756E21
@@ -1,3 +0,0 @@
1
- var H=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(q,w)=>(typeof require<"u"?require:q)[w]}):j)(function(j){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+j+'" is not supported')});var z;((k)=>{k.SUBSCRIPTION_REQUEST="context-subscription-request";k.CONTEXT_REQUEST="context-request";k.ON_MOUNT="context-on-mount";k.MOUNTED="context-mounted"})(z||={});class B extends Event{context;callback;subscribe;handled=!1;constructor(j,q,w){super("context-request",{bubbles:!0,composed:!0});this.context=j;this.callback=q;this.subscribe=w}markHandled(){this.handled=!0}}class D extends CustomEvent{constructor(j){super("context-on-mount",{detail:{context:j},bubbles:!0,composed:!0})}}class F extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(j,q,w,G,k){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=j;this.callback=q;this.select=w;this.subscribe=G;this.onSubscribe=k}markHandled(){this.handled=!0}}export{F as ContextSubscriptionRequestEvent,B as ContextRequestEvent,D as ContextOnMountEvent,z as ContextEventsTypes};
2
-
3
- //# debugId=770F94756FFF592164756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/context/events.ts"],
4
- "sourcesContent": [
5
- "import type { Context, ContextCallback, ContextType, UnknownContext } from './types';\n\n/**\n * List of events which can be emitted by a context provider or requester.\n */\nexport enum ContextEventsTypes {\n\tSUBSCRIPTION_REQUEST = 'context-subscription-request',\n\tCONTEXT_REQUEST = 'context-request',\n\tON_MOUNT = 'context-on-mount',\n\tMOUNTED = 'context-mounted',\n}\n\n/**\n * An event fired by a context requester to signal it desires a named context.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * function to the callback which requesters can invoke to indicate they no longer wish to receive these updates.\n */\nexport class ContextRequestEvent<T extends UnknownContext> extends Event {\n\tpublic handled = false;\n\n\tpublic constructor(\n\t\tpublic readonly context: T,\n\t\tpublic readonly callback: ContextCallback<ContextType<T>>,\n\t\tpublic readonly subscribe?: boolean,\n\t) {\n\t\tsuper(ContextEventsTypes.CONTEXT_REQUEST, { bubbles: true, composed: true });\n\t}\n\n\tpublic markHandled(): void {\n\t\tthis.handled = true;\n\t}\n}\n\n/**\n * A type which represents a subscription to a context value.\n */\ntype DirectContextSubscription<T extends UnknownContext> = {\n\tselect?: undefined;\n\tcallback: ContextCallback<ContextType<T>>;\n};\n\ntype SelectedContextSubscription<T extends UnknownContext, Selected> = {\n\tselect: (context: ContextType<T>) => Selected;\n\tcallback: ContextCallback<Selected>;\n};\n\nexport type ContextSubscription<T extends UnknownContext, Selected = ContextType<T>> =\n\t| DirectContextSubscription<T>\n\t| SelectedContextSubscription<T, Selected>;\n\n/**\n * An event fired by a context provider to signal that a context value has been mounted and is available for consumption.\n */\nexport class ContextOnMountEvent extends CustomEvent<{ context: UnknownContext }> {\n\tpublic constructor(context: UnknownContext) {\n\t\tsuper(ContextEventsTypes.ON_MOUNT, {\n\t\t\tdetail: { context },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t});\n\t}\n}\n\n/**\n * An event fired by a context requester to signal it desires a named context.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * function to the callback which requesters can invoke to indicate they no longer wish to receive these updates.\n *\n * It accepts a `selector` property which can be used to request a specific property of the context value.\n */\nexport class ContextSubscriptionRequestEvent<T extends UnknownContext, Selected = ContextType<T>> extends Event {\n\tpublic handled = false;\n\n\tpublic constructor(\n\t\tpublic readonly context: T,\n\t\tpublic readonly callback: ContextCallback<Selected>,\n\t\tpublic readonly select?: (context: ContextType<T>) => Selected,\n\t\tpublic readonly subscribe?: boolean,\n\t\tpublic readonly onSubscribe?: (unsubscribe: () => void) => void,\n\t) {\n\t\tsuper(ContextEventsTypes.SUBSCRIPTION_REQUEST, {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t});\n\t}\n\n\tpublic markHandled(): void {\n\t\tthis.handled = true;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\t/**\n\t\t * A 'context-request-subscription' event can be emitted by any element which desires\n\t\t * a context value to be injected by an external provider.\n\t\t */\n\t\t[ContextEventsTypes.SUBSCRIPTION_REQUEST]: ContextSubscriptionRequestEvent<UnknownContext>;\n\t\t/**\n\t\t * A context-request-provider event can be emitted by a context requester to signal\n\t\t * that it desires a context value to be provided by a context provider.\n\t\t */\n\t\t[ContextEventsTypes.CONTEXT_REQUEST]: ContextRequestEvent<Context<unknown, unknown>>;\n\t\t/**\n\t\t * A 'context-mount' event can be emitted by a context provider to signal\n\t\t * that a context value has been mounted and is available for consumption.\n\t\t */\n\t\t[ContextEventsTypes.ON_MOUNT]: ContextOnMountEvent;\n\t}\n}\n"
6
- ],
7
- "mappings": "2PAKO,IAAK,GAAL,CAAK,IAAL,CACN,uBAAuB,+BACvB,kBAAkB,kBAClB,WAAW,mBACX,UAAU,oBAJC,QAiBL,MAAM,UAAsD,KAAM,CAIvD,QACA,SACA,UALV,QAAU,GAEV,WAAW,CACD,EACA,EACA,EACf,CACD,MAAM,kBAAoC,CAAE,QAAS,GAAM,SAAU,EAAK,CAAC,EAJ3D,eACA,gBACA,iBAKV,WAAW,EAAS,CAC1B,KAAK,QAAU,GAEjB,CAsBO,MAAM,UAA4B,WAAyC,CAC1E,WAAW,CAAC,EAAyB,CAC3C,MAAM,mBAA6B,CAClC,OAAQ,CAAE,SAAQ,EAClB,QAAS,GACT,SAAU,EACX,CAAC,EAEH,CAcO,MAAM,UAA6F,KAAM,CAI9F,QACA,SACA,OACA,UACA,YAPV,QAAU,GAEV,WAAW,CACD,EACA,EACA,EACA,EACA,EACf,CACD,MAAM,+BAAyC,CAC9C,QAAS,GACT,SAAU,EACX,CAAC,EATe,eACA,gBACA,cACA,iBACA,mBAQV,WAAW,EAAS,CAC1B,KAAK,QAAU,GAEjB",
8
- "debugId": "770F94756FFF592164756E2164756E21",
9
- "names": []
10
- }
@@ -1,3 +0,0 @@
1
- var W=((g)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(g,{get:(q,z)=>(typeof require<"u"?require:q)[z]}):g)(function(g){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+g+'" is not supported')});function $(g){return g.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var V="data-hydration",u="data-hydration-type",Q="data-hydration-key";function w(g){let q=g.hydrationKey?` ${Q}="${J(g.hydrationKey)}"`:"";return`<script type="application/json" ${V} ${u}="${g.type}"${q}>${g.serializedValue}</script>`}function F(g){return $(g)}function S(g,q){let z=g.textContent;if(!z)return q;try{return JSON.parse(z)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${V}>:`,z.slice(0,120));return q}}function f(g,q,z){let L=g.children;if(!L||L.length===0){let G=g.childNodes;if(!G||G.length===0)return null;for(let M=0;M<G.length;M+=1){let X=G[M];if(X.nodeType!==1)continue;let Z=X;if(j(Z,q,z))return Z}return null}for(let G=0;G<L.length;G+=1)if(j(L[G],q,z))return L[G];return null}function j(g,q,z){if(g.tagName!=="SCRIPT"||!g.hasAttribute(V)||g.getAttribute(u)!==q)return!1;if(z!==void 0)return g.getAttribute(Q)===z;return!g.hasAttribute(Q)}function J(g){return g.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function B(g){return w({type:"context",...g})}function D(g){return F(g)}export{D as escapeContextHydrationJson,B as createContextHydrationScriptTag};
2
-
3
- //# debugId=530D675E1503267864756E2164756E21
@@ -1,3 +0,0 @@
1
- var Hf=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(F,M)=>(typeof require<"u"?require:F)[M]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});var E=Symbol.for("@ecopages/radiant.legacy-instance-initializers");function W(f,F){let j=f[E];if(Array.isArray(j)){j.push(F);return}Object.defineProperty(f,E,{value:[F],configurable:!0})}function Pf(f){let F=[],M=Object.getPrototypeOf(f);while(M&&M!==Object.prototype)F.push(M),M=Object.getPrototypeOf(M);for(let j=F.length-1;j>=0;j-=1){let w=F[j][E];if(!Array.isArray(w))continue;for(let L of w)L(f)}}var N=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),Y=Symbol.for("@ecopages/radiant.ssr-preparation-running");function C(f,F){let j=f[N];if(Array.isArray(j)){j.push(F);return}Object.defineProperty(f,N,{value:[F],configurable:!0})}function $f(f){let F=f,M=F[N];if(!Array.isArray(M))return;F[Y]=!0;try{for(let j of M)j()}finally{delete F[Y]}}function S(f){return f.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var g="data-hydration",m="data-hydration-type",_="data-hydration-key";function u(f){let F=f.hydrationKey?` ${_}="${jf(f.hydrationKey)}"`:"";return`<script type="application/json" ${g} ${m}="${f.type}"${F}>${f.serializedValue}</script>`}function v(f){return S(f)}function x(f,F){let M=f.textContent;if(!M)return F;try{return JSON.parse(M)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${g}>:`,M.slice(0,120));return F}}function b(f,F,M){let j=f.children;if(!j||j.length===0){let w=f.childNodes;if(!w||w.length===0)return null;for(let L=0;L<w.length;L+=1){let H=w[L];if(H.nodeType!==1)continue;let D=H;if(h(D,F,M))return D}return null}for(let w=0;w<j.length;w+=1)if(h(j[w],F,M))return j[w];return null}function h(f,F,M){if(f.tagName!=="SCRIPT"||!f.hasAttribute(g)||f.getAttribute(m)!==F)return!1;if(M!==void 0)return f.getAttribute(_)===M;return!f.hasAttribute(_)}function jf(f){return f.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wf(f){return typeof f==="function"}function K(f,F,M,j){if(typeof j==="object")return f(void 0,j);return F(M,j)}function p(f,F,M,j,w){if(typeof j==="object"){if(!wf(M))throw TypeError("Standard method decorators require a method target");return f(M,j)}if(!w)throw TypeError("Legacy method decorators require a property descriptor");return F(M,j,w)}var l=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function a(){return globalThis}function Vf(f){a()[l]=f}function A(f){return a()[l]?.(f)}function Yf(f){if(f instanceof Element)return f;if("host"in f)return f.host;if("element"in f)return f.element;return null}function r(f){if(f instanceof Element)return f;if("host"in f)return f.host;if("element"in f)return f.element;return f}function c(f){return u({type:"context",...f})}function i(f){return v(f)}var I;((w)=>{w.SUBSCRIPTION_REQUEST="context-subscription-request";w.CONTEXT_REQUEST="context-request";w.ON_MOUNT="context-on-mount";w.MOUNTED="context-mounted"})(I||={});class O extends Event{context;callback;subscribe;handled=!1;constructor(f,F,M){super("context-request",{bubbles:!0,composed:!0});this.context=f;this.callback=F;this.subscribe=M}markHandled(){this.handled=!0}}class R extends CustomEvent{constructor(f){super("context-on-mount",{detail:{context:f},bubbles:!0,composed:!0})}}class d extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(f,F,M,j,w){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=f;this.callback=F;this.select=M;this.subscribe=j;this.onSubscribe=w}markHandled(){this.handled=!0}}import{createMarkupNodeLike as Lf}from"@ecopages/jsx";class V{host;context;hydrationKey;hydrate;serialize;pendingHostHydration;value;subscriptions=[];constructor(f,F){this.host=f,this.context=F.context,this.hydrationKey=F.hydrationKey,this.hydrate=F.hydrate,this.serialize=F.serialize,this.pendingHostHydration=Boolean(F.hydrate),this.value=F.initialValue,this.tryHydrateFromHost(),this.registerEvents(),this.host.dispatchEvent(new R(this.context))}setContext=(f,F)=>{if(this.tryHydrateFromHost(),this.pendingHostHydration=!1,typeof this.value>"u"&&this.isObject(f)){let M=this.value;if(this.value={...f},F)F(this.value);this.notifySubscribers(this.value,M);return}if(this.isObject(this.value)&&this.isObject(f)){let M={...this.value};if(this.value={...this.value,...f},F)F(this.value);this.notifySubscribers(this.value,M)}};getContext=()=>{return this.tryHydrateFromHost(),this.value};getContextKey=()=>{return this.context};serializeHydrationValue=()=>{if(this.tryHydrateFromHost(),!this.hydrate||typeof this.value>"u")return;let f=this.serialize?this.serialize(this.value):this.value;if(typeof f>"u")return;let F=JSON.stringify(f);if(typeof F!=="string")return;return i(F)};renderHydrationScriptTag=()=>{let f=this.serializeHydrationValue();if(!f)return;return c({hydrationKey:this.hydrationKey,serializedValue:f})};renderHydrationScript=()=>{let f=this.renderHydrationScriptTag();if(!f)return;return Lf(f)};subscribe=(f)=>{let F={hasChanged:(M,j)=>{if(typeof j>"u"||!f.select)return!0;return f.select(M)!==f.select(j)},notify:(M)=>{if(f.select){f.callback(f.select(M),F.unsubscribe);return}f.callback(M,F.unsubscribe)},unsubscribe:()=>{let M=this.subscriptions.indexOf(F);if(M!==-1)this.subscriptions.splice(M,1)}};return this.subscriptions.push(F),F.unsubscribe};tryHydrateFromHost(){if(!this.pendingHostHydration)return;let f=this.findHydrationScriptElement();if(!f)return;this.value=this.mergeHydrationValue(x(f,this.value)),this.pendingHostHydration=!1}mergeHydrationValue(f){if(this.hydrate===Object&&this.isObject(f)&&(this.isObject(this.value)||typeof this.value>"u"))return{...this.value??{},...f};return f}isObject(f){return typeof f==="object"&&!Array.isArray(f)&&f!==null}findHydrationScriptElement(){return b(r(this.host),"context",this.hydrationKey)}notifySubscribers=(f,F)=>{for(let M of this.subscriptions)if(M.hasChanged(f,F))M.notify(f)};handleSubscriptionRequest=(f,{subscribe:F,onSubscribe:M})=>{this.tryHydrateFromHost();let j=F?this.subscribe(f):void 0;if(j)M?.(j);if(typeof this.value>"u")return;if(f.select)f.callback(f.select(this.value),j);else f.callback(this.value,j)};onSubscriptionRequest=(f)=>{let{context:F,callback:M,subscribe:j,select:w,target:L,onSubscribe:H}=f;if(F!==this.context)return;if(f.markHandled(),f.stopPropagation(),L instanceof EventTarget)L.dispatchEvent(new R(this.context));if(w){this.handleSubscriptionRequest({select:w,callback:M},{subscribe:j,onSubscribe:H});return}this.handleSubscriptionRequest({callback:M},{subscribe:j,onSubscribe:H})};onContextRequest=(f)=>{let{context:F,callback:M}=f;if(F!==this.context)return;f.markHandled(),f.stopPropagation(),M(this)};registerEvents=()=>{this.host.addEventListener("context-subscription-request",this.onSubscriptionRequest),this.host.addEventListener("context-request",this.onContextRequest)}}var Af=(f)=>f;function y(f,F,M,j={}){let w=A(F);if(!w)return!1;if(M(w),f.connectedContextCallback(F),j.emitMounted)f.dispatchEvent(new CustomEvent("context-mounted",{detail:w}));return!0}function n(f,F,M,j={}){let w=new O(F,(L)=>{if(M(L),f.connectedContextCallback(F),j.emitMounted)f.dispatchEvent(new CustomEvent("context-mounted",{detail:L}))});return f.dispatchEvent(w),w.handled}function B(f,F){let M=A(f);if(!M)return!1;let j=M.getContext();if(F.select)return F.callback(F.select(j)),!0;return F.callback(j),!0}function T(f,F,M,j){let w=new d(F,M.callback,M.select,j.subscribe,j.onSubscribe);return f.dispatchEvent(w),w.handled}function U(f,F,M,j={}){return s(f,()=>y(f,F,M,j))}function Z(f,F,M,j){return s(f,()=>{if(j)return B(F,{callback:M,select:j});return B(F,{callback:M})})}function k(f,F,M,j={}){if(y(f,F,M,j))return!0;return n(f,F,M,j)}function $(f,F,M,j={}){if(j.select){let L={callback:M,select:j.select};if(B(F,L))return!0;return T(f,F,L,{subscribe:j.subscribe,onSubscribe:j.onSubscribe})}let w={callback:M};if(B(F,w))return!0;return T(f,F,w,{subscribe:j.subscribe,onSubscribe:j.onSubscribe})}function s(f,F){return C(f,F),F()}function o(f){return(F,M)=>{let j=(L,H)=>{L[M]=H},w=(L,H={})=>{if(L[M])return!0;return k(L,f,(D)=>{j(L,D)},H)};W(F,(L)=>{U(L,f,(H)=>{j(L,H)}),L.registerConnectedCallback(()=>{if(w(L,{emitMounted:!0}))return;queueMicrotask(()=>{w(L,{emitMounted:!0})})})})}}function t(f){return(F,M)=>{let j=String(M.name),w=(H,D)=>{let P=H;P[j]=D},L=(H,D={})=>{if(H[j])return!0;return k(H,f,(Q)=>{w(H,Q)},D)};M.addInitializer(function(){if(U(this,f,(H)=>{w(this,H)},{emitMounted:!0}))return;this.registerConnectedCallback(()=>{if(L(this,{emitMounted:!0}))return;queueMicrotask(()=>{L(this,{emitMounted:!0})})})})}}function af(f){function F(M,j){return K(t(f),o(f),M,j)}return F}function J(f,F,M){let j=!1,w,L=f;return(H)=>{if(L[Y]!==!0&&j&&Object.is(w,H))return;if(j=!0,w=H,F(H),M&&typeof L.requestUpdate==="function")L.requestUpdate()}}function q({context:f,select:F,subscribe:M=!0,requestUpdate:j=!0}){return(w,L,H)=>{let D=H.value;return W(w,(P)=>{let Q,X=J(P,(G)=>{D.call(P,G)},j);Z(P,f,X,F),P.registerConnectedCallback(()=>{if($(P,f,X,{onSubscribe:(G)=>{Q=G},select:F,subscribe:M}))return;queueMicrotask(()=>{$(P,f,X,{onSubscribe:(G)=>{Q=G},select:F,subscribe:M})})}),P.registerCleanupCallback(()=>{Q?.(),Q=void 0})}),H}}function z({context:f,select:F,subscribe:M=!0,requestUpdate:j=!0}){return function(w,L){L.addInitializer(function(){let H,D=J(this,(Q)=>{w.call(this,Q)},j);if(Z(this,f,D,F))return;let P=()=>{return $(this,f,D,{onSubscribe:(Q)=>{H=Q},select:F,subscribe:M})};this.registerCleanupCallback(()=>{H?.(),H=void 0}),this.registerConnectedCallback(()=>{if(P())return;queueMicrotask(()=>{P()})})})}}function e(f){let{context:F,select:M,subscribe:j=!0}=f;return(w,L)=>{W(w,(H)=>{let D,P=J(H,(Q)=>{H[L]=Q},!0);Z(H,F,P,M),H.registerConnectedCallback(()=>{if($(H,F,P,{onSubscribe:(Q)=>{D=Q},select:M,subscribe:j}))return;queueMicrotask(()=>{$(H,F,P,{onSubscribe:(Q)=>{D=Q},select:M,subscribe:j})})}),H.registerCleanupCallback(()=>{D?.(),D=void 0})})}}function ff(f){let{context:F,select:M,subscribe:j=!0}=f;return function(w,L){let H=String(L.name);return L.addInitializer(function(){let D,P=J(this,(X)=>{let G=this;G[H]=X},!0);if(Z(this,F,P,M))return;let Q=()=>{return $(this,F,P,{onSubscribe:(X)=>{D=X},select:M,subscribe:j})};this.registerCleanupCallback(()=>{D?.(),D=void 0}),this.registerConnectedCallback(()=>{if(Q())return;queueMicrotask(()=>{Q()})})}),function(D){return D}}}function XF(f){function F(M,j,w){if(typeof j==="object"){if(j.kind==="field"){if(M!==void 0)throw TypeError("@contextSelector field decorators require an undefined target");return ff(f)(void 0,j)}if(typeof M!=="function")throw TypeError("@contextSelector standard method decorators require a method target");return z(f)(M,j)}if(w){if(typeof M==="function"||M===void 0)throw TypeError("@contextSelector legacy method decorators require a host target");return q(f)(M,j,w)}if(typeof M==="function"||M===void 0)throw TypeError("@contextSelector legacy field decorators require a host target");return e(f)(M,j)}return F}function KF(f){function F(M,j,w){return p(z(f),q(f),M,j,w)}return F}function Ff({context:f,initialValue:F,hydrate:M,serialize:j}){return(w,L)=>{let H=(D)=>{if(D[L])return;let P=new V(D,{context:f,hydrationKey:L,initialValue:F,hydrate:M,serialize:j});D[L]=P,D.registerContextProvider(L,P),D.connectedContextCallback(f)};W(w,(D)=>{H(D),D.registerConnectedCallback(()=>{H(D)})})}}function Mf({context:f,initialValue:F,hydrate:M,serialize:j}){return(w,L)=>{let H=String(L.name);L.addInitializer(function(){let D=this,P=new V(this,{context:f,hydrationKey:H,initialValue:F,hydrate:M,serialize:j});D[H]=P,this.registerContextProvider(H,P),this.connectedContextCallback(f)})}}function AF(f){function F(M,j){return K(Mf(f),Ff(f),M,j)}return F}export{AF as provideContext,KF as onContextUpdate,Af as createContext,XF as contextSelector,af as consumeContext,d as ContextSubscriptionRequestEvent,O as ContextRequestEvent,V as ContextProvider,R as ContextOnMountEvent,I as ContextEventsTypes};
2
-
3
- //# debugId=FD273B4576E2740B64756E2164756E21
@@ -1,3 +0,0 @@
1
- var z=((E)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(E,{get:(C,I)=>(typeof require<"u"?require:C)[I]}):E)(function(E){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+E+'" is not supported')});var F=Symbol.for("@ecopages/radiant.controllerIdentifier");function D(E,C){E[F]=C}function B(E){return E[F]}var M="data-controller",_=Symbol.for("@ecopages/radiant.controller-registry-state");function k(){let E=globalThis,C=E[_];if(C)return C;let I={activeRuntimes:new Set,controllerRegistrationStrategy:"keep-current",controllerRegistry:new Map};return E[_]=I,I}var W=k(),O=W.controllerRegistry,h=W.activeRuntimes;function p(E){let C=E.getAttribute(M);if(!C)return[];return C.split(/\s+/).map((I)=>I.trim()).filter((I)=>I.length>0)}function u(E,C){if(E instanceof Element&&E.hasAttribute(M))C(E);for(let I of Array.from(E.querySelectorAll(`[${M}]`)))C(I)}class R{root;controllersByElement=new Map;observer;stopped=!1;constructor(E=document){this.root=E;this.start()}stop(){if(this.stopped)return;this.stopped=!0,this.observer?.disconnect(),this.observer=void 0;for(let[E,C]of this.controllersByElement)for(let[I]of C)this.disconnectController(E,I);h.delete(this)}reconcileRegisteredController(E){u(this.root,(C)=>{if(!p(C).includes(E))return;this.connectController(C,E)})}replaceRegisteredController(E){for(let[C,I]of Array.from(this.controllersByElement.entries())){if(!I.has(E))continue;this.disconnectController(C,E)}this.reconcileRegisteredController(E)}start(){if(u(this.root,(C)=>{this.reconcileElement(C)}),typeof MutationObserver>"u"){h.add(this);return}this.observer=new MutationObserver((C)=>{for(let I of C){if(I.type==="attributes"&&I.target instanceof Element){this.reconcileElement(I.target);continue}for(let L of Array.from(I.removedNodes)){if(!(L instanceof Element))continue;u(L,(T)=>{this.disconnectElementControllers(T)})}for(let L of Array.from(I.addedNodes)){if(!(L instanceof Element))continue;u(L,(T)=>{this.reconcileElement(T)})}}});let E=this.root instanceof Document?this.root.documentElement:this.root;this.observer.observe(E,{attributeFilter:[M],attributes:!0,childList:!0,subtree:!0}),h.add(this)}reconcileElement(E){let C=new Set(p(E)),I=this.controllersByElement.get(E);if(I){for(let L of I.keys())if(!C.has(L))this.disconnectController(E,L)}for(let L of C)this.connectController(E,L)}connectController(E,C){let I=O.get(C);if(!I)return;let L=this.controllersByElement.get(E);if(!L)L=new Map,this.controllersByElement.set(E,L);if(L.has(C))return;let T=new I(E);L.set(C,T),T.connect()}disconnectController(E,C){let I=this.controllersByElement.get(E);if(!I)return;let L=I.get(C);if(!L)return;if(L.disconnect(),I.delete(C),I.size===0)this.controllersByElement.delete(E)}disconnectElementControllers(E){let C=this.controllersByElement.get(E);if(!C)return;for(let I of Array.from(C.keys()))this.disconnectController(E,I)}}function q(E,C){let I=O.get(E);if(I)return I;D(C,E),O.set(E,C);for(let L of Array.from(h))L.reconcileRegisteredController(E);return C}function J(E){return O.has(E)}function K(E){return O.get(E)}function w(E,C){if(O.get(E)===C)return C;D(C,E),O.set(E,C);for(let L of Array.from(h))L.replaceRegisteredController(E);return C}function j(E){W.controllerRegistrationStrategy=E}function N(){j("replace")}function P(){j("keep-current")}function Q(E,C){if(W.controllerRegistrationStrategy==="replace")return w(E,C);return q(E,C)}function U(E=document){return new R(E)}function V(){for(let E of Array.from(h))E.stop()}export{u as visitControllerElements,V as stopControllers,U as startControllers,j as setControllerRegistrationStrategy,K as resolveRegisteredController,w as replaceController,Q as registerControllerWithConfiguredStrategy,q as registerController,p as parseControllerIdentifiers,J as hasRegisteredController,N as enableControllerReplacementForHmr,P as disableControllerReplacementForHmr,R as ControllerRegistryRuntime,_ as CONTROLLER_REGISTRY_STATE_KEY,M as CONTROLLER_ATTRIBUTE};
2
-
3
- //# debugId=4C9D7599C02AA77A64756E2164756E21
@@ -1,3 +0,0 @@
1
- var n=((t)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(o,e)=>(typeof require<"u"?require:o)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var r=Symbol.for("@ecopages/radiant.controllerIdentifier");function s(t,o){t[r]=o}function l(t){return t[r]}export{s as setControllerIdentifier,l as getControllerIdentifier,r as CONTROLLER_IDENTIFIER};
2
-
3
- //# debugId=240DEA62DF81F58264756E2164756E21
@@ -1,3 +0,0 @@
1
- var x=((b)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(b,{get:(j,q)=>(typeof require<"u"?require:j)[q]}):b)(function(b){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+b+'" is not supported')});var k=Symbol.for("@ecopages/radiant.customElementTagName");function z(b,j){b[k]=j}function B(b){return b[k]}export{z as setCustomElementTagName,B as getCustomElementTagName,k as CUSTOM_ELEMENT_TAG_NAME};
2
-
3
- //# debugId=6FF28EF8DF0051FA64756E2164756E21
@@ -1,3 +0,0 @@
1
- var j=((g)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(g,{get:(u,z)=>(typeof require<"u"?require:u)[z]}):g)(function(g){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+g+'" is not supported')});function V(g){return g.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var w="data-hydration",Z="data-hydration-type",q="data-hydration-key";function P(g){let u=g.hydrationKey?` ${q}="${$(g.hydrationKey)}"`:"";return`<script type="application/json" ${w} ${Z}="${g.type}"${u}>${g.serializedValue}</script>`}function x(g){return V(g)}function C(g,u){let z=g.textContent;if(!z)return u;try{return JSON.parse(z)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${w}>:`,z.slice(0,120));return u}}function f(g,u,z){let L=g.children;if(!L||L.length===0){let J=g.childNodes;if(!J||J.length===0)return null;for(let M=0;M<J.length;M+=1){let G=J[M];if(G.nodeType!==1)continue;let Q=G;if(X(Q,u,z))return Q}return null}for(let J=0;J<L.length;J+=1)if(X(L[J],u,z))return L[J];return null}function X(g,u,z){if(g.tagName!=="SCRIPT"||!g.hasAttribute(w)||g.getAttribute(Z)!==u)return!1;if(z!==void 0)return g.getAttribute(q)===z;return!g.hasAttribute(q)}function $(g){return g.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}export{C as parseHydrationPayload,f as findHydrationScript,x as escapeHydrationJson,P as createHydrationScriptTag,Z as HYDRATION_TYPE_ATTRIBUTE,q as HYDRATION_KEY_ATTRIBUTE,w as HYDRATION_ATTRIBUTE};
2
-
3
- //# debugId=ADF85B332FA3E82264756E2164756E21
@@ -1,54 +0,0 @@
1
- import type { JsxRenderable } from '@ecopages/jsx';
2
- import type { RenderToStringOptions } from '@ecopages/jsx/server';
3
- /**
4
- * Optional SSR hooks exposed by `RadiantElement` instances to the shared
5
- * server runtime.
6
- *
7
- * The bridge lets the runtime detect whether a component is still using the
8
- * inherited host SSR implementation or has taken ownership of host rendering
9
- * through explicit overrides.
10
- */
11
- export type RadiantElementRenderBridge = {
12
- renderHost?: () => JsxRenderable;
13
- renderHostToString?: (options?: RenderToStringOptions) => string;
14
- };
15
- /**
16
- * Runtime shape required by the shared Radiant SSR helpers.
17
- *
18
- * This is intentionally narrower than `RadiantElement` itself so the server
19
- * runtime can stay decoupled from the full client base-class implementation.
20
- */
21
- export type RadiantElementSsrCapable = HTMLElement & {
22
- resolveSsrRenderBridge?: () => RadiantElementRenderBridge;
23
- getHostSsrAttributes?: () => Record<string, string>;
24
- renderToString(options?: RenderToStringOptions): string;
25
- renderHost?(): JsxRenderable;
26
- renderHostToString(options?: RenderToStringOptions): string;
27
- };
28
- /**
29
- * Shared SSR runtime contract registered on `globalThis`.
30
- *
31
- * Server entrypoints install one implementation that both direct component SSR
32
- * and nested JSX custom-element SSR can reuse without importing client-only
33
- * internals into every call site.
34
- */
35
- export type RadiantElementSsrRuntime = {
36
- getHostAttributes(component: RadiantElementSsrCapable): Record<string, string>;
37
- renderHost(component: RadiantElementSsrCapable): JsxRenderable;
38
- renderHostToString(component: RadiantElementSsrCapable, options?: RenderToStringOptions): string;
39
- resolveRenderBridge(component: RadiantElementSsrCapable): RadiantElementRenderBridge | undefined;
40
- renderView(component: RadiantElementSsrCapable, options?: RenderToStringOptions): string;
41
- };
42
- /**
43
- * Reads the currently registered Radiant SSR runtime from `globalThis`.
44
- *
45
- * Returns `undefined` when no server entrypoint has installed the runtime yet.
46
- */
47
- export declare function getRadiantElementSsrRuntime(): RadiantElementSsrRuntime | undefined;
48
- /**
49
- * Registers the shared Radiant SSR runtime on `globalThis`.
50
- *
51
- * The latest registration wins, which keeps server adapters free to install
52
- * the runtime eagerly from their own explicit entrypoint.
53
- */
54
- export declare function registerRadiantElementSsrRuntime(runtime: RadiantElementSsrRuntime): void;
@@ -1,3 +0,0 @@
1
- var f=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(c,d)=>(typeof require<"u"?require:c)[d]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var b=Symbol.for("@ecopages/radiant.component-ssr-runtime");function h(){return globalThis[b]}function j(a){globalThis[b]=a}export{j as registerRadiantElementSsrRuntime,h as getRadiantElementSsrRuntime};
2
-
3
- //# debugId=7A43EF7E4BF0DC2964756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/core/radiant-component-ssr-registry.ts"],
4
- "sourcesContent": [
5
- "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"
6
- ],
7
- "mappings": "2PA6CA,IAAM,EAAuC,OAAO,IAAI,yCAAyC,EAW1F,SAAS,CAA2B,EAAyC,CACnF,OAAQ,WAAqC,GASvC,SAAS,CAAgC,CAAC,EAAyC,CACxF,WAAqC,GAAwC",
8
- "debugId": "7A43EF7E4BF0DC2964756E2164756E21",
9
- "names": []
10
- }
@@ -1,3 +0,0 @@
1
- var x=((t)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(n,i)=>(typeof require<"u"?require:n)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});function p(t){switch(t){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function Q(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(t))return"array";if(Object.prototype.toString.call(t)==="[object Object]")return"object"}function W(t){switch(t){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function Z(t){try{return JSON.parse(t)}catch{throw TypeError("Invalid JSON string")}}var C={array(t){let n=Z(t);if(!Array.isArray(n))throw TypeError(`Expected an array but got a value of type "${typeof n}"`);return n},boolean(t){return!(t==="0"||String(t).toLowerCase()==="false")},number(t){return Number(t.replace(/_/g,""))},object(t){let n=JSON.parse(t);if(n===null||typeof n!=="object"||Array.isArray(n))throw TypeError(`expected value of type "object" but instead got value "${t}" of type "${Q(n)}"`);return n},string(t){return t}},c={default:H,array:h,object:h};function h(t){return JSON.stringify(t)}function H(t){return`${t}`}function d(t,n){let i=p(n);if(!i)throw TypeError(`[radiant-element] Unknown type "${n}"`);return C[i](t)}function P(t,n){let i=p(n);if(!i)throw TypeError(`[radiant-element] Unknown type "${n}"`);return(c[i]??c.default??H)(t)}function J(t){return typeof t==="boolean"}function k(t){return typeof t==="number"}function I(t){return typeof t==="string"}function U(t){return Array.isArray(t)}function y(t){return typeof t==="object"&&!Array.isArray(t)&&t!==null}function G(t,n){switch(t){case Boolean:return J(n);case Number:return k(n);case String:return I(n);case Array:return U(n);case Object:return y(n);default:return!1}}var X=(t,n,i,r)=>{if(n===Boolean){let s=t.getAttribute(i);if(s===null)return r;return s===""?!0:d(s,n)}let o=t.getAttribute(i);return o!==null?d(o,n):r??W(n)};var e=Symbol.for("@ecopages/radiant.customElementTagName");function N(t,n){t[e]=n}function $(t){return t[e]}var f=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function b(){return globalThis}function z(t){b()[f]=t}function K(t){return b()[f]?.(t)}var g;function S(){if(g!==void 0)return g;try{let{AsyncLocalStorage:t}=(()=>{throw new Error("Cannot require module "+"node:async_hooks");})();return g=new t,g}catch{return g=null,null}}var R=Symbol.for("@ecopages/radiant.ssr-context-fallback-stack");function j(){let t=globalThis;return t[R]??=[],t[R]}function q(t){if(t.length===0)return()=>{return};let n=new Map;for(let o of t)n.set(o.getContextKey(),o);let i=S();if(i){let o=i.getStore()??[],s=[...o,n];return i.enterWith(s),()=>{i.enterWith(o)}}let r=j();return r.push(n),()=>{let o=r.lastIndexOf(n);if(o>=0)r.splice(o,1)}}function D(t){let n=S()?.getStore()??j();for(let i=n.length-1;i>=0;i-=1){let r=n[i]?.get(t);if(r)return r}return}function L(t){let n=D(t);if(!n)return;return n.getContext()}z((t)=>D(t));class B{host;constructor(t){this.host=t}renderHost(){return{nodeType:1,outerHTML:this.renderHostToString({mode:"hydrate"})}}renderHostToString(t={},n=this.getHostAttributes()){let i=this.getTagName(),r=q(this.host.getContextProviders());try{return`<${i}${F(n)}>${this.renderHostContent(t)}</${i}>`}finally{r()}}renderHostContent(t){let n=this.host.renderToString(t),i=this.host.getAuthoredHydrationScriptMarkup?.()??"",r=this.host.getSlotProjectionScriptTag?.()??"";if(!(t.mode==="hydrate"||t.mode===void 0&&t.hydrate===!0))return`${n}${i}${r}`;let s=this.host.getHydrationBindings().map((m)=>m.renderHydrationScriptTag()).filter((m)=>typeof m==="string").join("");return`${n}${r}${s}`}getHostAttributes(){let t={},n=new Set;for(let i of this.host.getReactiveProperties()){let r=this.host.getPropertyValue(i.name);if(r===void 0||r===null||r===!1)continue;t[i.attribute]=String(i.converter.toAttribute(r)),n.add(i.attribute)}for(let i of this.host.getReactivePropDefinitions()){let r=i.options.attribute??i.name;if(n.has(r))continue;let o=this.host.getPropertyValue(i.name);if(o===void 0||o===null||o===!1)continue;t[r]=String(P(o,i.options.type)),n.add(r)}for(let i of this.host.listAttributeNames()){let r=this.host.getAttributeValue(i);if(r!==null)t[i]=r}return t}getTagName(){let t=$(this.host.constructor);if(!t)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return t}}function F(t){return Object.entries(t).map(([n,i])=>` ${n}="${w(i)}"`).join("")}function w(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}export{B as RadiantElementSsrService};
2
-
3
- //# debugId=53C9F45CFD02739C64756E2164756E21
@@ -1,14 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/utils/attribute-utils.ts", "../src/core/custom-element-metadata.ts", "../src/context/context-ssr-bridge.ts", "../src/server/context-ssr.ts", "../src/core/radiant-component-ssr.ts"],
4
- "sourcesContent": [
5
- "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",
6
- "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",
7
- "import type { SsrSerializableContextProvider } from './context-provider';\nimport type { UnknownContext } from './types';\n\ntype SsrContextProviderResolver = (context: UnknownContext) => SsrSerializableContextProvider | undefined;\n\nconst SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-provider-resolver');\n\ntype GlobalResolverScope = typeof globalThis & {\n\t[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?: SsrContextProviderResolver;\n};\n\nfunction getGlobalResolverScope(): GlobalResolverScope {\n\treturn globalThis as GlobalResolverScope;\n}\n\n/**\n * Installs the ambient SSR provider resolver used by shared context runtime helpers.\n *\n * Server-side rendering infrastructure owns the actual provider stack storage and\n * publishes a lookup function here so client/runtime code does not need to import\n * server-oriented modules.\n */\nexport function installSsrContextProviderResolver(resolver: SsrContextProviderResolver): void {\n\tgetGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL] = resolver;\n}\n\n/**\n * Resolves an ambient SSR provider when a server render has published one.\n */\nexport function resolveAmbientSsrContextProvider(context: UnknownContext): SsrSerializableContextProvider | undefined {\n\treturn getGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?.(context);\n}\n",
8
- "import type { AsyncLocalStorage } from 'node:async_hooks';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport { installSsrContextProviderResolver } from '../context/context-ssr-bridge';\nimport type { ContextType, UnknownContext } from '../context/types';\n\ntype ProviderFrame = Map<UnknownContext, SsrSerializableContextProvider>;\ntype ProviderStack = ProviderFrame[];\n\nlet resolvedAsyncLocalStorage: AsyncLocalStorage<ProviderStack> | null | undefined;\n\n/**\n * Lazily resolves `AsyncLocalStorage` from `node:async_hooks`.\n *\n * The dynamic `require` is necessary because browser-based SSR tests import\n * this server-oriented module directly. A top-level static import would break\n * those browser bundles even though normal application SSR runs on the server.\n *\n * On the server (Node.js, Bun, Cloudflare Workers) the import always succeeds.\n * In browser test environments where SSR rendering is exercised without a real\n * server, the fallback global stack is used instead.\n */\nfunction getAsyncLocalStorage(): AsyncLocalStorage<ProviderStack> | null {\n\tif (resolvedAsyncLocalStorage !== undefined) {\n\t\treturn resolvedAsyncLocalStorage;\n\t}\n\n\ttry {\n\t\tconst { AsyncLocalStorage: ALS } = require('node:async_hooks') as typeof import('node:async_hooks');\n\t\tresolvedAsyncLocalStorage = new ALS<ProviderStack>();\n\t\treturn resolvedAsyncLocalStorage;\n\t} catch {\n\t\tresolvedAsyncLocalStorage = null;\n\t\treturn null;\n\t}\n}\n\nconst SSR_CONTEXT_FALLBACK_STACK_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-fallback-stack');\n\nfunction getFallbackStack(): ProviderStack {\n\tconst g = globalThis as typeof globalThis & { [SSR_CONTEXT_FALLBACK_STACK_SYMBOL]?: ProviderStack };\n\tg[SSR_CONTEXT_FALLBACK_STACK_SYMBOL] ??= [];\n\treturn g[SSR_CONTEXT_FALLBACK_STACK_SYMBOL];\n}\n\n/**\n * Pushes a temporary provider frame onto the SSR context stack.\n *\n * On the server, each call creates an isolated `AsyncLocalStorage` context so\n * concurrent renders cannot corrupt each other.\n *\n * In browser test environments where `AsyncLocalStorage` is unavailable, a\n * synchronous global stack is used as a fallback.\n */\nexport function withSsrContextProviders(providers: readonly SsrSerializableContextProvider[]): () => void {\n\tif (providers.length === 0) {\n\t\treturn () => undefined;\n\t}\n\n\tconst frame = new Map<UnknownContext, SsrSerializableContextProvider>();\n\n\tfor (const provider of providers) {\n\t\tframe.set(provider.getContextKey(), provider);\n\t}\n\n\tconst als = getAsyncLocalStorage();\n\n\tif (als) {\n\t\tconst parentStack = als.getStore() ?? [];\n\t\tconst childStack = [...parentStack, frame];\n\t\tals.enterWith(childStack);\n\n\t\treturn () => {\n\t\t\tals.enterWith(parentStack);\n\t\t};\n\t}\n\n\tconst stack = getFallbackStack();\n\tstack.push(frame);\n\n\treturn () => {\n\t\tconst index = stack.lastIndexOf(frame);\n\t\tif (index >= 0) stack.splice(index, 1);\n\t};\n}\n\n/**\n * Resolves the nearest SSR-visible provider for a given context token.\n *\n * Lookup walks the provider frames from innermost to outermost so nested host\n * serialization behaves the same way as runtime context resolution in the DOM.\n */\nexport function resolveSsrContextProvider<T extends UnknownContext>(\n\tcontext: T,\n): SsrSerializableContextProvider | undefined {\n\tconst store = getAsyncLocalStorage()?.getStore() ?? getFallbackStack();\n\n\tfor (let index = store.length - 1; index >= 0; index -= 1) {\n\t\tconst provider = store[index]?.get(context);\n\n\t\tif (provider) {\n\t\t\treturn provider;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Resolves the current SSR-visible value for a given context token.\n *\n * This is the ergonomic helper consumed by SSR-aware decorators and component\n * render paths when they only need the context payload instead of the full\n * provider instance.\n */\nexport function resolveSsrContextValue<T extends UnknownContext>(context: T): ContextType<T> | undefined {\n\tconst provider = resolveSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn undefined;\n\t}\n\n\treturn provider.getContext() as ContextType<T>;\n}\n\ninstallSsrContextProviderResolver((context) => resolveSsrContextProvider(context));\n",
9
- "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport { withSsrContextProviders } from '../server/context-ssr';\nimport { getCustomElementTagName } from './custom-element-metadata';\nimport type { ReactiveProperty } from './radiant-element';\nimport type { ReactivePropDefinition } from './reactive-prop-metadata';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\nimport { writeAttributeValue } from '../utils/attribute-utils';\n\ntype RadiantElementSsrHost = {\n\tconstructor: CustomElementConstructor;\n\tgetAuthoredHydrationScriptMarkup?: () => string | undefined;\n\tgetContextProviders: () => SsrSerializableContextProvider[];\n\tgetHydrationBindings: () => SsrSerializableHydrationBinding[];\n\tgetSlotProjectionScriptTag?: () => string | undefined;\n\trenderToString: (options?: RenderToStringOptions) => string;\n\tgetReactiveProperties: () => ReactiveProperty[];\n\tgetReactivePropDefinitions: () => ReactivePropDefinition[];\n\tgetPropertyValue: (name: string) => unknown;\n\tlistAttributeNames: () => string[];\n\tgetAttributeValue: (name: string) => string | null;\n};\n\nexport class RadiantElementSsrService {\n\tconstructor(private readonly host: RadiantElementSsrHost) {}\n\n\tpublic renderHost(): JsxRenderable {\n\t\treturn {\n\t\t\tnodeType: 1,\n\t\t\touterHTML: this.renderHostToString({ mode: 'hydrate' }),\n\t\t};\n\t}\n\n\tpublic renderHostToString(options: RenderToStringOptions = {}, attributes = this.getHostAttributes()): string {\n\t\tconst tagName = this.getTagName();\n\t\tconst restoreSsrContexts = withSsrContextProviders(this.host.getContextProviders());\n\n\t\ttry {\n\t\t\treturn `<${tagName}${serializeHostAttributes(attributes)}>${this.renderHostContent(options)}</${tagName}>`;\n\t\t} finally {\n\t\t\trestoreSsrContexts();\n\t\t}\n\t}\n\n\tprivate renderHostContent(options: RenderToStringOptions): string {\n\t\tconst hostContent = this.host.renderToString(options);\n\t\tconst authoredHydrationMarkup = this.host.getAuthoredHydrationScriptMarkup?.() ?? '';\n\t\tconst slotProjectionScript = this.host.getSlotProjectionScriptTag?.() ?? '';\n\t\tconst hydrate = options.mode === 'hydrate' || (options.mode === undefined && options.hydrate === true);\n\n\t\tif (!hydrate) {\n\t\t\treturn `${hostContent}${authoredHydrationMarkup}${slotProjectionScript}`;\n\t\t}\n\n\t\tconst hydrationScripts = this.host\n\t\t\t.getHydrationBindings()\n\t\t\t.map((binding) => binding.renderHydrationScriptTag())\n\t\t\t.filter((markup): markup is string => typeof markup === 'string')\n\t\t\t.join('');\n\n\t\treturn `${hostContent}${slotProjectionScript}${hydrationScripts}`;\n\t}\n\n\tpublic getHostAttributes(): Record<string, string> {\n\t\tconst attributes: Record<string, string> = {};\n\t\tconst seenAttributes = new Set<string>();\n\n\t\tfor (const property of this.host.getReactiveProperties()) {\n\t\t\tconst currentValue = this.host.getPropertyValue(property.name);\n\t\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattributes[property.attribute] = String(property.converter.toAttribute(currentValue));\n\t\t\tseenAttributes.add(property.attribute);\n\t\t}\n\n\t\tfor (const definition of this.host.getReactivePropDefinitions()) {\n\t\t\tconst attributeName = definition.options.attribute ?? definition.name;\n\n\t\t\tif (seenAttributes.has(attributeName)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst currentValue = this.host.getPropertyValue(definition.name);\n\n\t\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattributes[attributeName] = String(writeAttributeValue(currentValue, definition.options.type));\n\t\t\tseenAttributes.add(attributeName);\n\t\t}\n\n\t\tfor (const attributeName of this.host.listAttributeNames()) {\n\t\t\tconst attributeValue = this.host.getAttributeValue(attributeName);\n\t\t\tif (attributeValue !== null) {\n\t\t\t\tattributes[attributeName] = attributeValue;\n\t\t\t}\n\t\t}\n\n\t\treturn attributes;\n\t}\n\n\tprivate getTagName(): string {\n\t\tconst tagName = getCustomElementTagName(this.host.constructor);\n\n\t\tif (!tagName) {\n\t\t\tthrow new Error(`${this.host.constructor.name} is missing @customElement metadata.`);\n\t\t}\n\n\t\treturn tagName;\n\t}\n}\n\nfunction serializeHostAttributes(attributes: Record<string, string>): string {\n\treturn Object.entries(attributes)\n\t\t.map(([name, value]) => ` ${name}=\"${escapeAttribute(value)}\"`)\n\t\t.join('');\n}\n\nfunction escapeAttribute(value: string): string {\n\treturn value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n"
10
- ],
11
- "mappings": "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",
12
- "debugId": "53C9F45CFD02739C64756E2164756E21",
13
- "names": []
14
- }
@@ -1,3 +0,0 @@
1
- var m=((q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(q,{get:(M,Q)=>(typeof require<"u"?require:M)[Q]}):q)(function(q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+q+'" is not supported')});var Y=Symbol.for("@ecopages/radiant.legacy-instance-initializers");function N(q,M){let U=q[Y];if(Array.isArray(U)){U.push(M);return}Object.defineProperty(q,Y,{value:[M],configurable:!0})}function F(q){let M=[],Q=Object.getPrototypeOf(q);while(Q&&Q!==Object.prototype)M.push(Q),Q=Object.getPrototypeOf(Q);for(let U=M.length-1;U>=0;U-=1){let W=M[U][Y];if(!Array.isArray(W))continue;for(let $ of W)$(q)}}import{createSubscribableJsxValue as D}from"@ecopages/jsx";import{trackDependency as K}from"@ecopages/signals";class O{read;subscribers=new Set;watcherListeners=new Set;version=0;constructor(q){this.read=q}get(){return K(this),this.read()}subscribe(q){return this.subscribers.add(q),()=>{this.subscribers.delete(q)}}addWatcher(q){return this.watcherListeners.add(q),()=>{this.watcherListeners.delete(q)}}getVersion(){return this.version}notify(q){this.version+=1;let M;try{this.notifyWatchers()}catch(Q){M=Q}if(this.publish(q),M)throw M}publish(q){for(let M of this.subscribers)M(q)}notifyWatchers(){let q=[];for(let M of this.watcherListeners)try{M()}catch(Q){q.push(Q)}if(q.length===1)throw q[0];if(q.length>1)throw AggregateError(q,"Multiple reactive dependency notifications failed.")}}function P(q){return typeof q==="object"&&q!==null&&typeof q.get==="function"}class Z{host;access;shouldAutoBind;bindings;$;reactiveFields=new Map;reactiveDependencies=new Map;reactiveDependencyReaders=new Map;reactiveBindings=new Map;updateCallbacks=new Map;onConnectedCallbacks=[];onDisconnectedCallback=[];constructor(q,M,Q){this.host=q;this.access=M;this.shouldAutoBind=Q;let U=this.createReactiveBindingNamespace();this.bindings=U,this.$=U}connectHost(){for(let q of this.onConnectedCallbacks)q()}disconnectHost(){for(let q of this.onDisconnectedCallback)q()}notifyUpdate(q,M,Q){if(M===Q)return;this.reactiveDependencies.get(q)?.notify(Q);let U=this.updateCallbacks.get(q);if(U)for(let W of U)W()}registerCleanupCallback(q){this.onDisconnectedCallback.push(q)}registerConnectedCallback(q){this.onConnectedCallbacks.push(q)}registerHydrationBinding(q,M){}registerReactiveDependencyReader(q,M){this.reactiveDependencyReaders.set(q,M)}registerUpdateCallback(q,M){if(!this.updateCallbacks.has(q))this.updateCallbacks.set(q,new Set);let Q=this.updateCallbacks.get(q);return Q.add(M),()=>{if(Q.delete(M),Q.size===0)this.updateCallbacks.delete(q)}}getReactiveBinding(q){let M=this.reactiveBindings.get(q);if(M)return M;let Q=D({getValue:()=>this.readReactiveBindingValue(q),subscribe:(U)=>this.registerUpdateCallback(q,()=>{U(this.readReactiveBindingValue(q))})});return this.reactiveBindings.set(q,Q),Q}bind(q){return this.getReactiveBinding(q)}defineReactiveBinding(q,M=!0){let Q=typeof M==="string"?M:M?`$${q}`:void 0,U=this.access.getBindingTarget?.(this.host)??this.host;if(!Q||this.access.hasProperty(this.host,Q))return;this.access.defineProperty(U,Q,{get:()=>this.getReactiveBinding(q),enumerable:!1,configurable:!0})}trackReactiveRead(q){K(this.getReactiveDependency(q))}defineReactiveAccessor(q,M){let Q=M.bind??this.shouldAutoBind();if(this.defineReactiveBinding(q,Q),this.registerReactiveDependencyReader(q,M.getValue),this.access.defineProperty(this.host,q,{get:()=>{return this.trackReactiveRead(q),M.getValue()},set:(U)=>{let W=M.getValue();if(W===U)return;M.setValue(U),this.notifyUpdate(q,W,U)},enumerable:!0,configurable:!0}),M.notifyInitialValue!==void 0)this.notifyUpdate(q,void 0,M.notifyInitialValue)}createReactiveField(q,M,Q={}){let U={name:q,value:M,initialValue:M};this.reactiveFields.set(q,U),this.defineReactiveAccessor(q,{bind:Q.bind,getValue:()=>this.reactiveFields.get(q)?.value,setValue:(W)=>{this.reactiveFields.set(q,{...U,value:W})},notifyInitialValue:M})}createReactiveBindingNamespace(){return new Proxy(Object.create(null),{get:(q,M)=>{if(typeof M!=="string")return;return this.getReactiveBinding(M)}})}getReactiveDependency(q){let M=this.reactiveDependencies.get(q);if(M)return M;let Q=new O(()=>this.readReactiveDependencyValue(q));return this.reactiveDependencies.set(q,Q),Q}readReactiveDependencyValue(q){let M=this.reactiveDependencyReaders.get(q);if(M)return M();return this.readReactiveBindingValue(q)}readReactiveBindingValue(q){let M=this.access.readProperty(this.host,q);if(P(M))return M.get();return M}}function L(q){switch(q){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function x(q){switch(typeof q){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(q))return"array";if(Object.prototype.toString.call(q)==="[object Object]")return"object"}function B(q){switch(q){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function A(q){try{return JSON.parse(q)}catch{throw TypeError("Invalid JSON string")}}var k={array(q){let M=A(q);if(!Array.isArray(M))throw TypeError(`Expected an array but got a value of type "${typeof M}"`);return M},boolean(q){return!(q==="0"||String(q).toLowerCase()==="false")},number(q){return Number(q.replace(/_/g,""))},object(q){let M=JSON.parse(q);if(M===null||typeof M!=="object"||Array.isArray(M))throw TypeError(`expected value of type "object" but instead got value "${q}" of type "${x(M)}"`);return M},string(q){return q}},J={default:C,array:_,object:_};function _(q){return JSON.stringify(q)}function C(q){return`${q}`}function j(q,M){let Q=L(M);if(!Q)throw TypeError(`[radiant-element] Unknown type "${M}"`);return k[Q](q)}function y(q,M){let Q=L(M);if(!Q)throw TypeError(`[radiant-element] Unknown type "${M}"`);return(J[Q]??J.default??C)(q)}function R(q){return typeof q==="boolean"}function S(q){return typeof q==="number"}function T(q){return typeof q==="string"}function I(q){return Array.isArray(q)}function h(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}function E(q,M){switch(q){case Boolean:return R(M);case Number:return S(M);case String:return T(M);case Array:return I(M);case Object:return h(M);default:return!1}}var u=(q,M,Q,U)=>{if(M===Boolean){let $=q.getAttribute(Q);if($===null)return U;return $===""?!0:j($,M)}let W=q.getAttribute(Q);return W!==null?j(W,M):U??B(M)};import{render as w}from"@ecopages/jsx";import{Computed as g,subtle as f}from"@ecopages/signals";class z{host;element;bindings;$;reactiveHost;connected=!1;isRendering=!1;isRenderScheduled=!1;isSsrLifecycle=!1;needsRender=!1;renderSignal;renderWatcher=new f.Watcher(()=>{this.requestUpdate()});constructor(q){this.host=q,this.element=q,this.reactiveHost=new Z(this,{defineProperty:(M,Q,U)=>Object.defineProperty(M,Q,U),hasProperty:(M,Q)=>(Q in M),readProperty:(M,Q)=>M[Q]},()=>this.shouldAutoBindReactiveMembers()),this.bindings=this.reactiveHost.bindings,this.$=this.reactiveHost.$,F(this)}connect(){if(this.connected=!0,this.reactiveHost.connectHost(),this.shouldRunRenderLifecycle())this.update()}connectForSsrRender(){this.isSsrLifecycle=!0;try{this.connect()}finally{this.isSsrLifecycle=!1}}disconnect(){this.connected=!1,this.disconnectRenderWatcher(),this.reactiveHost.disconnectHost()}disconnectForSsrRender(){this.disconnect()}get isConnected(){return this.connected}render(){return null}requestUpdate(){if(!this.shouldRunRenderLifecycle())return;if(this.needsRender=!0,this.isRenderScheduled)return;this.isRenderScheduled=!0,queueMicrotask(()=>{if(this.isRenderScheduled=!1,!this.needsRender)return;this.update()})}update(){if(!this.shouldRunRenderLifecycle())return;let q=this.getRenderTarget();if(!q)return;if(this.needsRender=!0,!this.connected||this.isRendering)return;while(this.needsRender){this.needsRender=!1,this.isRendering=!0;try{w(this.resolveTrackedRenderOutput(),q)}finally{this.isRendering=!1}}}bind(q){return this.reactiveHost.bind(q)}getReactiveBinding(q){return this.reactiveHost.getReactiveBinding(q)}createReactiveField(q,M,Q={}){this.reactiveHost.createReactiveField(q,M,Q)}createReactiveProp(q,M){let{type:Q,defaultValue:U,bind:W}=M;if(U!==void 0&&!E(Q,U))throw Error(`defaultValue does not match the expected type for ${Q.name}`);let $=Object.getOwnPropertyDescriptor(this.host,q),G=this.host,H=G[q]??U??B(Q);this.reactiveHost.defineReactiveAccessor(q,{bind:W,getValue:()=>H,setValue:(X)=>{H=X},notifyInitialValue:H}),Object.defineProperty(this.host,q,{get:()=>this[q],set:(X)=>{this[q]=X},enumerable:$?.enumerable??!0,configurable:!0}),this.registerCleanupCallback(()=>{let X=this[q];if($){if(Object.defineProperty(this.host,q,$),"value"in $&&$.writable)G[q]=X;return}delete G[q];try{G[q]=X}catch{Object.defineProperty(this.host,q,{value:X,writable:!0,enumerable:!0,configurable:!0})}})}defineReactiveBinding(q,M=!0){this.reactiveHost.defineReactiveBinding(q,M)}notifyUpdate(q,M,Q){this.reactiveHost.notifyUpdate(q,M,Q)}registerUpdateCallback(q,M){return this.reactiveHost.registerUpdateCallback(q,M)}connectedContextCallback(q){}registerContextProvider(q,M){}registerHydrationBinding(q,M){}registerCleanupCallback(q){this.reactiveHost.registerCleanupCallback(q)}registerConnectedCallback(q){this.reactiveHost.registerConnectedCallback(q)}registerReactiveDependencyReader(q,M){this.reactiveHost.registerReactiveDependencyReader(q,M)}trackReactiveRead(q){this.reactiveHost.trackReactiveRead(q)}addEventListener(q,M,Q){this.host.addEventListener(q,M,Q)}removeEventListener(q,M,Q){this.host.removeEventListener(q,M,Q)}dispatchEvent(q){return this.host.dispatchEvent(q)}getRef(q,M=!1){let Q=`[data-ref="${q}"]`;if(M)return Array.from(this.host.querySelectorAll(Q));return this.host.querySelector(Q)??null}shouldAutoBindReactiveMembers(){return!0}shouldRunRenderLifecycle(){return!this.isSsrLifecycle&&this.render!==z.prototype.render}getRenderTarget(){return this.host instanceof HTMLElement?this.host:null}disconnectRenderWatcher(){if(!this.renderSignal)return;this.renderWatcher.unwatch(this.renderSignal),this.renderSignal=void 0}resolveTrackedRenderOutput(){let q=new g(()=>this.render()),M=q.get();if(!this.connected)return M;if(this.renderSignal)this.renderWatcher.unwatch(this.renderSignal);return this.renderSignal=q,this.renderWatcher.watch(q),M}}export{z as RadiantController};
2
-
3
- //# debugId=3254076C7E6FE49F64756E2164756E21