@schema-engine/forms 0.0.0-stage → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (609) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +69 -2
  3. package/dist/actions/index.d.ts +3 -0
  4. package/dist/actions/index.js +50 -0
  5. package/dist/actions/index.js.map +7 -0
  6. package/dist/actions/plugins/auto-save.plugin.d.ts +39 -0
  7. package/dist/actions/plugins/auto-save.plugin.js +10 -0
  8. package/dist/actions/plugins/auto-save.plugin.js.map +7 -0
  9. package/dist/actions/plugins/form-reset.plugin.d.ts +23 -0
  10. package/dist/actions/plugins/form-reset.plugin.js +9 -0
  11. package/dist/actions/plugins/form-reset.plugin.js.map +7 -0
  12. package/dist/actions/plugins/form-submit.plugin.d.ts +31 -0
  13. package/dist/actions/plugins/form-submit.plugin.js +9 -0
  14. package/dist/actions/plugins/form-submit.plugin.js.map +7 -0
  15. package/dist/actions/plugins/form-submit.registration.d.ts +22 -0
  16. package/dist/actions/plugins/form-submit.registration.js +8 -0
  17. package/dist/actions/plugins/form-submit.registration.js.map +7 -0
  18. package/dist/actions/plugins/gtm.plugin.d.ts +30 -0
  19. package/dist/actions/plugins/gtm.plugin.js +8 -0
  20. package/dist/actions/plugins/gtm.plugin.js.map +7 -0
  21. package/dist/actions/plugins/index.d.ts +16 -0
  22. package/dist/actions/plugins/index.js +45 -0
  23. package/dist/actions/plugins/index.js.map +7 -0
  24. package/dist/actions/plugins/notification.plugin.d.ts +32 -0
  25. package/dist/actions/plugins/notification.plugin.js +9 -0
  26. package/dist/actions/plugins/notification.plugin.js.map +7 -0
  27. package/dist/actions/plugins/notification.registration.d.ts +22 -0
  28. package/dist/actions/plugins/notification.registration.js +8 -0
  29. package/dist/actions/plugins/notification.registration.js.map +7 -0
  30. package/dist/actions/plugins/registrations.d.ts +17 -0
  31. package/dist/actions/plugins/registrations.js +14 -0
  32. package/dist/actions/plugins/registrations.js.map +7 -0
  33. package/dist/actions/triggers.d.ts +42 -0
  34. package/dist/actions/triggers.js +6 -0
  35. package/dist/actions/triggers.js.map +7 -0
  36. package/dist/actions/types.d.ts +16 -0
  37. package/dist/actions/types.js +1 -0
  38. package/dist/actions/types.js.map +7 -0
  39. package/dist/agent-tool/index.d.ts +54 -0
  40. package/dist/agent-tool/index.js +128 -0
  41. package/dist/agent-tool/index.js.map +7 -0
  42. package/dist/browser/action-registrations.d.ts +46 -0
  43. package/dist/browser/action-registrations.js +19 -0
  44. package/dist/browser/action-registrations.js.map +7 -0
  45. package/dist/browser/index.d.ts +4 -0
  46. package/dist/browser/index.js +36 -0
  47. package/dist/browser/index.js.map +7 -0
  48. package/dist/browser/tools/auto-save-storage.d.ts +20 -0
  49. package/dist/browser/tools/auto-save-storage.js +12 -0
  50. package/dist/browser/tools/auto-save-storage.js.map +7 -0
  51. package/dist/browser/tools/gdpr-consent.d.ts +32 -0
  52. package/dist/browser/tools/gdpr-consent.js +11 -0
  53. package/dist/browser/tools/gdpr-consent.js.map +7 -0
  54. package/dist/browser/tools/gtm-tracker.d.ts +7 -0
  55. package/dist/browser/tools/gtm-tracker.js +7 -0
  56. package/dist/browser/tools/gtm-tracker.js.map +7 -0
  57. package/dist/builder/form-authoring.d.ts +159 -0
  58. package/dist/builder/form-authoring.js +1 -0
  59. package/dist/builder/form-authoring.js.map +7 -0
  60. package/dist/builder/form-values.d.ts +158 -0
  61. package/dist/builder/form-values.js +0 -0
  62. package/dist/builder/form-values.js.map +7 -0
  63. package/dist/builder/index.d.ts +5 -0
  64. package/dist/builder/index.js +2 -0
  65. package/dist/builder/index.js.map +7 -0
  66. package/dist/builder/types.utils.d.ts +137 -0
  67. package/dist/builder/types.utils.js +1 -0
  68. package/dist/builder/types.utils.js.map +7 -0
  69. package/dist/chunk-237BHPDH.js +88 -0
  70. package/dist/chunk-237BHPDH.js.map +7 -0
  71. package/dist/chunk-25PLQDKN.js +45 -0
  72. package/dist/chunk-25PLQDKN.js.map +7 -0
  73. package/dist/chunk-2PTM54FQ.js +51 -0
  74. package/dist/chunk-2PTM54FQ.js.map +7 -0
  75. package/dist/chunk-2VKEOE2L.js +907 -0
  76. package/dist/chunk-2VKEOE2L.js.map +7 -0
  77. package/dist/chunk-2XWISGGM.js +8 -0
  78. package/dist/chunk-2XWISGGM.js.map +7 -0
  79. package/dist/chunk-2YKQAVI2.js +8 -0
  80. package/dist/chunk-2YKQAVI2.js.map +7 -0
  81. package/dist/chunk-3B7CJOF6.js +18 -0
  82. package/dist/chunk-3B7CJOF6.js.map +7 -0
  83. package/dist/chunk-3YLRJVVN.js +17 -0
  84. package/dist/chunk-3YLRJVVN.js.map +7 -0
  85. package/dist/chunk-4CUGHU36.js +58 -0
  86. package/dist/chunk-4CUGHU36.js.map +7 -0
  87. package/dist/chunk-4FELFUCD.js +0 -0
  88. package/dist/chunk-4FELFUCD.js.map +7 -0
  89. package/dist/chunk-4XPLSYTK.js +82 -0
  90. package/dist/chunk-4XPLSYTK.js.map +7 -0
  91. package/dist/chunk-56CJ2UZ7.js +55 -0
  92. package/dist/chunk-56CJ2UZ7.js.map +7 -0
  93. package/dist/chunk-5QXT7YAJ.js +87 -0
  94. package/dist/chunk-5QXT7YAJ.js.map +7 -0
  95. package/dist/chunk-5Y6U3MR3.js +54 -0
  96. package/dist/chunk-5Y6U3MR3.js.map +7 -0
  97. package/dist/chunk-6BAJHAGL.js +29 -0
  98. package/dist/chunk-6BAJHAGL.js.map +7 -0
  99. package/dist/chunk-6FUGK5HQ.js +26 -0
  100. package/dist/chunk-6FUGK5HQ.js.map +7 -0
  101. package/dist/chunk-6IZYNHZ3.js +118 -0
  102. package/dist/chunk-6IZYNHZ3.js.map +7 -0
  103. package/dist/chunk-6NV2JDGI.js +8 -0
  104. package/dist/chunk-6NV2JDGI.js.map +7 -0
  105. package/dist/chunk-6R2MBQPL.js +19 -0
  106. package/dist/chunk-6R2MBQPL.js.map +7 -0
  107. package/dist/chunk-7EQJUI5N.js +40 -0
  108. package/dist/chunk-7EQJUI5N.js.map +7 -0
  109. package/dist/chunk-AUZ45XPE.js +27 -0
  110. package/dist/chunk-AUZ45XPE.js.map +7 -0
  111. package/dist/chunk-BIHEIJG3.js +0 -0
  112. package/dist/chunk-BIHEIJG3.js.map +7 -0
  113. package/dist/chunk-BKNWW4PK.js +0 -0
  114. package/dist/chunk-BKNWW4PK.js.map +7 -0
  115. package/dist/chunk-BLFLCSG3.js +71 -0
  116. package/dist/chunk-BLFLCSG3.js.map +7 -0
  117. package/dist/chunk-BYYGAGNH.js +0 -0
  118. package/dist/chunk-BYYGAGNH.js.map +7 -0
  119. package/dist/chunk-CAZPWBQ4.js +18 -0
  120. package/dist/chunk-CAZPWBQ4.js.map +7 -0
  121. package/dist/chunk-CMPOBBRV.js +10 -0
  122. package/dist/chunk-CMPOBBRV.js.map +7 -0
  123. package/dist/chunk-CRQWKC67.js +118 -0
  124. package/dist/chunk-CRQWKC67.js.map +7 -0
  125. package/dist/chunk-CRVXBWSY.js +70 -0
  126. package/dist/chunk-CRVXBWSY.js.map +7 -0
  127. package/dist/chunk-D6ZHV6AT.js +0 -0
  128. package/dist/chunk-D6ZHV6AT.js.map +7 -0
  129. package/dist/chunk-DVDKPY2A.js +12 -0
  130. package/dist/chunk-DVDKPY2A.js.map +7 -0
  131. package/dist/chunk-E4VONSLO.js +15 -0
  132. package/dist/chunk-E4VONSLO.js.map +7 -0
  133. package/dist/chunk-EEYGPPLU.js +185 -0
  134. package/dist/chunk-EEYGPPLU.js.map +7 -0
  135. package/dist/chunk-EI5TMJDC.js +56 -0
  136. package/dist/chunk-EI5TMJDC.js.map +7 -0
  137. package/dist/chunk-EQ5AIF3T.js +117 -0
  138. package/dist/chunk-EQ5AIF3T.js.map +7 -0
  139. package/dist/chunk-EZZHO6DQ.js +26 -0
  140. package/dist/chunk-EZZHO6DQ.js.map +7 -0
  141. package/dist/chunk-FUHLRG3M.js +130 -0
  142. package/dist/chunk-FUHLRG3M.js.map +7 -0
  143. package/dist/chunk-FVOL3ZOJ.js +101 -0
  144. package/dist/chunk-FVOL3ZOJ.js.map +7 -0
  145. package/dist/chunk-G33EUV7N.js +288 -0
  146. package/dist/chunk-G33EUV7N.js.map +7 -0
  147. package/dist/chunk-GH34XFCC.js +56 -0
  148. package/dist/chunk-GH34XFCC.js.map +7 -0
  149. package/dist/chunk-GKWRJ6H4.js +27 -0
  150. package/dist/chunk-GKWRJ6H4.js.map +7 -0
  151. package/dist/chunk-GRZU6F7Q.js +80 -0
  152. package/dist/chunk-GRZU6F7Q.js.map +7 -0
  153. package/dist/chunk-GT2LARKT.js +107 -0
  154. package/dist/chunk-GT2LARKT.js.map +7 -0
  155. package/dist/chunk-GY657L56.js +206 -0
  156. package/dist/chunk-GY657L56.js.map +7 -0
  157. package/dist/chunk-H4ABGAAG.js +60 -0
  158. package/dist/chunk-H4ABGAAG.js.map +7 -0
  159. package/dist/chunk-H63UHX42.js +93 -0
  160. package/dist/chunk-H63UHX42.js.map +7 -0
  161. package/dist/chunk-HEAKWS27.js +2730 -0
  162. package/dist/chunk-HEAKWS27.js.map +7 -0
  163. package/dist/chunk-HIS4MGIR.js +8 -0
  164. package/dist/chunk-HIS4MGIR.js.map +7 -0
  165. package/dist/chunk-HPPFSWIV.js +213 -0
  166. package/dist/chunk-HPPFSWIV.js.map +7 -0
  167. package/dist/chunk-J2FC5K4B.js +87 -0
  168. package/dist/chunk-J2FC5K4B.js.map +7 -0
  169. package/dist/chunk-J5BSFDVK.js +123 -0
  170. package/dist/chunk-J5BSFDVK.js.map +7 -0
  171. package/dist/chunk-J7GSNWXT.js +151 -0
  172. package/dist/chunk-J7GSNWXT.js.map +7 -0
  173. package/dist/chunk-K22S7IZR.js +12 -0
  174. package/dist/chunk-K22S7IZR.js.map +7 -0
  175. package/dist/chunk-K5TMXCMY.js +139 -0
  176. package/dist/chunk-K5TMXCMY.js.map +7 -0
  177. package/dist/chunk-KE53GN4Q.js +246 -0
  178. package/dist/chunk-KE53GN4Q.js.map +7 -0
  179. package/dist/chunk-KFQEDSYI.js +24 -0
  180. package/dist/chunk-KFQEDSYI.js.map +7 -0
  181. package/dist/chunk-KLATKWUA.js +116 -0
  182. package/dist/chunk-KLATKWUA.js.map +7 -0
  183. package/dist/chunk-KSKWSUOB.js +17 -0
  184. package/dist/chunk-KSKWSUOB.js.map +7 -0
  185. package/dist/chunk-LFWEJXWE.js +68 -0
  186. package/dist/chunk-LFWEJXWE.js.map +7 -0
  187. package/dist/chunk-LMWJAD3B.js +24 -0
  188. package/dist/chunk-LMWJAD3B.js.map +7 -0
  189. package/dist/chunk-MD23VADH.js +92 -0
  190. package/dist/chunk-MD23VADH.js.map +7 -0
  191. package/dist/chunk-MKMJT3XR.js +0 -0
  192. package/dist/chunk-MKMJT3XR.js.map +7 -0
  193. package/dist/chunk-NJTLBSTR.js +82 -0
  194. package/dist/chunk-NJTLBSTR.js.map +7 -0
  195. package/dist/chunk-NJXKMF67.js +182 -0
  196. package/dist/chunk-NJXKMF67.js.map +7 -0
  197. package/dist/chunk-OBQBIOGN.js +16 -0
  198. package/dist/chunk-OBQBIOGN.js.map +7 -0
  199. package/dist/chunk-OLYHNFKC.js +82 -0
  200. package/dist/chunk-OLYHNFKC.js.map +7 -0
  201. package/dist/chunk-OR2L7EKO.js +33 -0
  202. package/dist/chunk-OR2L7EKO.js.map +7 -0
  203. package/dist/chunk-OUF57UZ7.js +28 -0
  204. package/dist/chunk-OUF57UZ7.js.map +7 -0
  205. package/dist/chunk-PBMM2N77.js +56 -0
  206. package/dist/chunk-PBMM2N77.js.map +7 -0
  207. package/dist/chunk-PH3LWLYN.js +49 -0
  208. package/dist/chunk-PH3LWLYN.js.map +7 -0
  209. package/dist/chunk-PHNMDWSK.js +9 -0
  210. package/dist/chunk-PHNMDWSK.js.map +7 -0
  211. package/dist/chunk-PN5EH6DM.js +36 -0
  212. package/dist/chunk-PN5EH6DM.js.map +7 -0
  213. package/dist/chunk-POCAINUE.js +42 -0
  214. package/dist/chunk-POCAINUE.js.map +7 -0
  215. package/dist/chunk-PXWVKJGF.js +6 -0
  216. package/dist/chunk-PXWVKJGF.js.map +7 -0
  217. package/dist/chunk-Q5LEK7CI.js +64 -0
  218. package/dist/chunk-Q5LEK7CI.js.map +7 -0
  219. package/dist/chunk-QH7VW7IY.js +0 -0
  220. package/dist/chunk-QH7VW7IY.js.map +7 -0
  221. package/dist/chunk-QLGM2AZW.js +173 -0
  222. package/dist/chunk-QLGM2AZW.js.map +7 -0
  223. package/dist/chunk-QT3EYUL5.js +85 -0
  224. package/dist/chunk-QT3EYUL5.js.map +7 -0
  225. package/dist/chunk-QYHOFLRX.js +43 -0
  226. package/dist/chunk-QYHOFLRX.js.map +7 -0
  227. package/dist/chunk-R3MBVWVI.js +127 -0
  228. package/dist/chunk-R3MBVWVI.js.map +7 -0
  229. package/dist/chunk-R6V3LH7F.js +67 -0
  230. package/dist/chunk-R6V3LH7F.js.map +7 -0
  231. package/dist/chunk-RB22U6HI.js +64 -0
  232. package/dist/chunk-RB22U6HI.js.map +7 -0
  233. package/dist/chunk-RQRQYYTB.js +34 -0
  234. package/dist/chunk-RQRQYYTB.js.map +7 -0
  235. package/dist/chunk-S5D2QE4G.js +53 -0
  236. package/dist/chunk-S5D2QE4G.js.map +7 -0
  237. package/dist/chunk-S7I76ISM.js +245 -0
  238. package/dist/chunk-S7I76ISM.js.map +7 -0
  239. package/dist/chunk-TBDZOQ2C.js +66 -0
  240. package/dist/chunk-TBDZOQ2C.js.map +7 -0
  241. package/dist/chunk-U2X3IYSD.js +23 -0
  242. package/dist/chunk-U2X3IYSD.js.map +7 -0
  243. package/dist/chunk-UGL3KNOT.js +42 -0
  244. package/dist/chunk-UGL3KNOT.js.map +7 -0
  245. package/dist/chunk-UN3DARLG.js +35 -0
  246. package/dist/chunk-UN3DARLG.js.map +7 -0
  247. package/dist/chunk-VGGERKV2.js +7 -0
  248. package/dist/chunk-VGGERKV2.js.map +7 -0
  249. package/dist/chunk-VVFXYY65.js +0 -0
  250. package/dist/chunk-VVFXYY65.js.map +7 -0
  251. package/dist/chunk-WLDCYUN6.js +161 -0
  252. package/dist/chunk-WLDCYUN6.js.map +7 -0
  253. package/dist/chunk-WMDTQS36.js +0 -0
  254. package/dist/chunk-WMDTQS36.js.map +7 -0
  255. package/dist/chunk-WS7SLVXL.js +550 -0
  256. package/dist/chunk-WS7SLVXL.js.map +7 -0
  257. package/dist/chunk-WUTGZYP4.js +290 -0
  258. package/dist/chunk-WUTGZYP4.js.map +7 -0
  259. package/dist/chunk-XKN3WWK3.js +0 -0
  260. package/dist/chunk-XKN3WWK3.js.map +7 -0
  261. package/dist/chunk-XPQRHO5E.js +587 -0
  262. package/dist/chunk-XPQRHO5E.js.map +7 -0
  263. package/dist/chunk-XQ5VJ4QO.js +62 -0
  264. package/dist/chunk-XQ5VJ4QO.js.map +7 -0
  265. package/dist/chunk-XQVKX47O.js +174 -0
  266. package/dist/chunk-XQVKX47O.js.map +7 -0
  267. package/dist/chunk-Y5CNB57V.js +22 -0
  268. package/dist/chunk-Y5CNB57V.js.map +7 -0
  269. package/dist/chunk-YDGH7DTL.js +18 -0
  270. package/dist/chunk-YDGH7DTL.js.map +7 -0
  271. package/dist/chunk-YIFUBPJ3.js +0 -0
  272. package/dist/chunk-YIFUBPJ3.js.map +7 -0
  273. package/dist/chunk-YUUDXRBW.js +212 -0
  274. package/dist/chunk-YUUDXRBW.js.map +7 -0
  275. package/dist/chunk-Z6DQLJS2.js +23 -0
  276. package/dist/chunk-Z6DQLJS2.js.map +7 -0
  277. package/dist/chunk-ZDEZ2FOC.js +81 -0
  278. package/dist/chunk-ZDEZ2FOC.js.map +7 -0
  279. package/dist/chunk-ZUYSGCEH.js +65 -0
  280. package/dist/chunk-ZUYSGCEH.js.map +7 -0
  281. package/dist/chunk-ZYP3MIH3.js +115 -0
  282. package/dist/chunk-ZYP3MIH3.js.map +7 -0
  283. package/dist/constraints/constraint-evaluator.d.ts +57 -0
  284. package/dist/constraints/constraint-evaluator.js +17 -0
  285. package/dist/constraints/constraint-evaluator.js.map +7 -0
  286. package/dist/constraints/index.d.ts +1 -0
  287. package/dist/constraints/index.js +17 -0
  288. package/dist/constraints/index.js.map +7 -0
  289. package/dist/csrf/index.d.ts +43 -0
  290. package/dist/csrf/index.js +43 -0
  291. package/dist/csrf/index.js.map +7 -0
  292. package/dist/engine/build-form-engine.d.ts +27 -0
  293. package/dist/engine/build-form-engine.js +58 -0
  294. package/dist/engine/build-form-engine.js.map +7 -0
  295. package/dist/engine/component-type.d.ts +19 -0
  296. package/dist/engine/component-type.js +6 -0
  297. package/dist/engine/component-type.js.map +7 -0
  298. package/dist/engine/create-form-engine.d.ts +100 -0
  299. package/dist/engine/create-form-engine.js +59 -0
  300. package/dist/engine/create-form-engine.js.map +7 -0
  301. package/dist/engine/form-action-context.d.ts +70 -0
  302. package/dist/engine/form-action-context.js +10 -0
  303. package/dist/engine/form-action-context.js.map +7 -0
  304. package/dist/engine/form-engine.d.ts +236 -0
  305. package/dist/engine/form-engine.js +61 -0
  306. package/dist/engine/form-engine.js.map +7 -0
  307. package/dist/engine/index.d.ts +12 -0
  308. package/dist/engine/index.js +124 -0
  309. package/dist/engine/index.js.map +7 -0
  310. package/dist/engine/schema-artifacts.d.ts +87 -0
  311. package/dist/engine/schema-artifacts.js +14 -0
  312. package/dist/engine/schema-artifacts.js.map +7 -0
  313. package/dist/engine/schema-metadata-catalog.d.ts +41 -0
  314. package/dist/engine/schema-metadata-catalog.js +6 -0
  315. package/dist/engine/schema-metadata-catalog.js.map +7 -0
  316. package/dist/engine/step-machine.d.ts +59 -0
  317. package/dist/engine/step-machine.js +32 -0
  318. package/dist/engine/step-machine.js.map +7 -0
  319. package/dist/engine/submission-schema.d.ts +53 -0
  320. package/dist/engine/submission-schema.js +22 -0
  321. package/dist/engine/submission-schema.js.map +7 -0
  322. package/dist/engine/value-validation.d.ts +237 -0
  323. package/dist/engine/value-validation.js +39 -0
  324. package/dist/engine/value-validation.js.map +7 -0
  325. package/dist/index.d.ts +76 -0
  326. package/dist/index.js +283 -0
  327. package/dist/index.js.map +7 -0
  328. package/dist/lib/authoring-catalog.d.ts +5 -0
  329. package/dist/lib/authoring-catalog.js +11 -0
  330. package/dist/lib/authoring-catalog.js.map +7 -0
  331. package/dist/lib/container-kind-of.d.ts +5 -0
  332. package/dist/lib/container-kind-of.js +6 -0
  333. package/dist/lib/container-kind-of.js.map +7 -0
  334. package/dist/lib/debounce.d.ts +19 -0
  335. package/dist/lib/debounce.js +6 -0
  336. package/dist/lib/debounce.js.map +7 -0
  337. package/dist/lib/deep-readonly.d.ts +12 -0
  338. package/dist/lib/deep-readonly.js +0 -0
  339. package/dist/lib/deep-readonly.js.map +7 -0
  340. package/dist/lib/element-children.d.ts +35 -0
  341. package/dist/lib/element-children.js +16 -0
  342. package/dist/lib/element-children.js.map +7 -0
  343. package/dist/lib/exported-action-envelope.d.ts +11 -0
  344. package/dist/lib/exported-action-envelope.js +7 -0
  345. package/dist/lib/exported-action-envelope.js.map +7 -0
  346. package/dist/lib/exported-rules.d.ts +14 -0
  347. package/dist/lib/exported-rules.js +6 -0
  348. package/dist/lib/exported-rules.js.map +7 -0
  349. package/dist/lib/field-ref.d.ts +13 -0
  350. package/dist/lib/field-ref.js +6 -0
  351. package/dist/lib/field-ref.js.map +7 -0
  352. package/dist/lib/field-scope.d.ts +121 -0
  353. package/dist/lib/field-scope.js +41 -0
  354. package/dist/lib/field-scope.js.map +7 -0
  355. package/dist/lib/form-fetch.d.ts +36 -0
  356. package/dist/lib/form-fetch.js +10 -0
  357. package/dist/lib/form-fetch.js.map +7 -0
  358. package/dist/lib/form-view.d.ts +33 -0
  359. package/dist/lib/form-view.js +12 -0
  360. package/dist/lib/form-view.js.map +7 -0
  361. package/dist/lib/frozen-copy.d.ts +9 -0
  362. package/dist/lib/frozen-copy.js +7 -0
  363. package/dist/lib/frozen-copy.js.map +7 -0
  364. package/dist/lib/is-plain-object.d.ts +2 -0
  365. package/dist/lib/is-plain-object.js +6 -0
  366. package/dist/lib/is-plain-object.js.map +7 -0
  367. package/dist/lib/logger.d.ts +2 -0
  368. package/dist/lib/logger.js +6 -0
  369. package/dist/lib/logger.js.map +7 -0
  370. package/dist/lib/normalized-form-config.d.ts +106 -0
  371. package/dist/lib/normalized-form-config.js +19 -0
  372. package/dist/lib/normalized-form-config.js.map +7 -0
  373. package/dist/lib/omit-paths.d.ts +11 -0
  374. package/dist/lib/omit-paths.js +7 -0
  375. package/dist/lib/omit-paths.js.map +7 -0
  376. package/dist/lib/path-values.d.ts +47 -0
  377. package/dist/lib/path-values.js +22 -0
  378. package/dist/lib/path-values.js.map +7 -0
  379. package/dist/lib/renderer-data-attributes.d.ts +10 -0
  380. package/dist/lib/renderer-data-attributes.js +6 -0
  381. package/dist/lib/renderer-data-attributes.js.map +7 -0
  382. package/dist/lib/reserved-path-keys.d.ts +10 -0
  383. package/dist/lib/reserved-path-keys.js +10 -0
  384. package/dist/lib/reserved-path-keys.js.map +7 -0
  385. package/dist/lib/resolve-appearance.d.ts +48 -0
  386. package/dist/lib/resolve-appearance.js +10 -0
  387. package/dist/lib/resolve-appearance.js.map +7 -0
  388. package/dist/lib/standard-json-schema.d.ts +27 -0
  389. package/dist/lib/standard-json-schema.js +8 -0
  390. package/dist/lib/standard-json-schema.js.map +7 -0
  391. package/dist/lib/standard-schema.d.ts +19 -0
  392. package/dist/lib/standard-schema.js +8 -0
  393. package/dist/lib/standard-schema.js.map +7 -0
  394. package/dist/lib/submission-shape.d.ts +60 -0
  395. package/dist/lib/submission-shape.js +14 -0
  396. package/dist/lib/submission-shape.js.map +7 -0
  397. package/dist/lib/validate-form/grid-checks.d.ts +57 -0
  398. package/dist/lib/validate-form/grid-checks.js +16 -0
  399. package/dist/lib/validate-form/grid-checks.js.map +7 -0
  400. package/dist/lib/validate-form/issues.d.ts +43 -0
  401. package/dist/lib/validate-form/issues.js +13 -0
  402. package/dist/lib/validate-form/issues.js.map +7 -0
  403. package/dist/lib/validate-form/options.d.ts +22 -0
  404. package/dist/lib/validate-form/options.js +0 -0
  405. package/dist/lib/validate-form/options.js.map +7 -0
  406. package/dist/lib/validate-form/parse-elements.d.ts +23 -0
  407. package/dist/lib/validate-form/parse-elements.js +21 -0
  408. package/dist/lib/validate-form/parse-elements.js.map +7 -0
  409. package/dist/lib/validate-form/parse-owner-actions.d.ts +14 -0
  410. package/dist/lib/validate-form/parse-owner-actions.js +10 -0
  411. package/dist/lib/validate-form/parse-owner-actions.js.map +7 -0
  412. package/dist/lib/validate-form/parse-view.d.ts +11 -0
  413. package/dist/lib/validate-form/parse-view.js +11 -0
  414. package/dist/lib/validate-form/parse-view.js.map +7 -0
  415. package/dist/lib/validate-form/schema-issues.d.ts +16 -0
  416. package/dist/lib/validate-form/schema-issues.js +8 -0
  417. package/dist/lib/validate-form/schema-issues.js.map +7 -0
  418. package/dist/lib/validate-form/step-checks.d.ts +18 -0
  419. package/dist/lib/validate-form/step-checks.js +15 -0
  420. package/dist/lib/validate-form/step-checks.js.map +7 -0
  421. package/dist/lib/validate-form/validation-error.d.ts +26 -0
  422. package/dist/lib/validate-form/validation-error.js +8 -0
  423. package/dist/lib/validate-form/validation-error.js.map +7 -0
  424. package/dist/lib/validate-form.d.ts +34 -0
  425. package/dist/lib/validate-form.js +62 -0
  426. package/dist/lib/validate-form.js.map +7 -0
  427. package/dist/lib/zod-json-schema.d.ts +33 -0
  428. package/dist/lib/zod-json-schema.js +10 -0
  429. package/dist/lib/zod-json-schema.js.map +7 -0
  430. package/dist/recipes/built-in-specs.d.ts +1832 -0
  431. package/dist/recipes/built-in-specs.js +28 -0
  432. package/dist/recipes/built-in-specs.js.map +7 -0
  433. package/dist/recipes/built-in.d.ts +2 -0
  434. package/dist/recipes/built-in.js +49 -0
  435. package/dist/recipes/built-in.js.map +7 -0
  436. package/dist/recipes/define-form-recipe.d.ts +10 -0
  437. package/dist/recipes/define-form-recipe.js +6 -0
  438. package/dist/recipes/define-form-recipe.js.map +7 -0
  439. package/dist/recipes/define-recipe-spec.d.ts +13 -0
  440. package/dist/recipes/define-recipe-spec.js +8 -0
  441. package/dist/recipes/define-recipe-spec.js.map +7 -0
  442. package/dist/recipes/index.d.ts +6 -0
  443. package/dist/recipes/index.js +43 -0
  444. package/dist/recipes/index.js.map +7 -0
  445. package/dist/recipes/protocol.d.ts +24 -0
  446. package/dist/recipes/protocol.js +11 -0
  447. package/dist/recipes/protocol.js.map +7 -0
  448. package/dist/recipes/slot-schemas.d.ts +128 -0
  449. package/dist/recipes/slot-schemas.js +24 -0
  450. package/dist/recipes/slot-schemas.js.map +7 -0
  451. package/dist/recipes/types.d.ts +55 -0
  452. package/dist/recipes/types.js +1 -0
  453. package/dist/recipes/types.js.map +7 -0
  454. package/dist/recipes/view-model.d.ts +93 -0
  455. package/dist/recipes/view-model.js +29 -0
  456. package/dist/recipes/view-model.js.map +7 -0
  457. package/dist/registries/index.d.ts +8 -0
  458. package/dist/registries/index.js +0 -0
  459. package/dist/registries/index.js.map +7 -0
  460. package/dist/runtime/create-form-runtime.d.ts +43 -0
  461. package/dist/runtime/create-form-runtime.js +41 -0
  462. package/dist/runtime/create-form-runtime.js.map +7 -0
  463. package/dist/runtime/index.d.ts +3 -0
  464. package/dist/runtime/index.js +44 -0
  465. package/dist/runtime/index.js.map +7 -0
  466. package/dist/runtime/submission-lifecycle.d.ts +65 -0
  467. package/dist/runtime/submission-lifecycle.js +6 -0
  468. package/dist/runtime/submission-lifecycle.js.map +7 -0
  469. package/dist/runtime/types.d.ts +172 -0
  470. package/dist/runtime/types.js +6 -0
  471. package/dist/runtime/types.js.map +7 -0
  472. package/dist/schemas/base-field.d.ts +450 -0
  473. package/dist/schemas/base-field.js +36 -0
  474. package/dist/schemas/base-field.js.map +7 -0
  475. package/dist/schemas/field-config.d.ts +36 -0
  476. package/dist/schemas/field-config.js +1 -0
  477. package/dist/schemas/field-config.js.map +7 -0
  478. package/dist/schemas/form-config-shape.d.ts +763 -0
  479. package/dist/schemas/form-config-shape.js +35 -0
  480. package/dist/schemas/form-config-shape.js.map +7 -0
  481. package/dist/schemas/form-config.d.ts +1288 -0
  482. package/dist/schemas/form-config.js +41 -0
  483. package/dist/schemas/form-config.js.map +7 -0
  484. package/dist/schemas/html-attributes.d.ts +12 -0
  485. package/dist/schemas/html-attributes.js +12 -0
  486. package/dist/schemas/html-attributes.js.map +7 -0
  487. package/dist/schemas/index.d.ts +5 -0
  488. package/dist/schemas/index.js +165 -0
  489. package/dist/schemas/index.js.map +7 -0
  490. package/dist/schemas/validation/async/cache.d.ts +39 -0
  491. package/dist/schemas/validation/async/cache.js +6 -0
  492. package/dist/schemas/validation/async/cache.js.map +7 -0
  493. package/dist/schemas/validation/async/handler.d.ts +21 -0
  494. package/dist/schemas/validation/async/handler.js +11 -0
  495. package/dist/schemas/validation/async/handler.js.map +7 -0
  496. package/dist/schemas/validation/async/index.d.ts +8 -0
  497. package/dist/schemas/validation/async/index.js +14 -0
  498. package/dist/schemas/validation/async/index.js.map +7 -0
  499. package/dist/schemas/validation/defaults.d.ts +6 -0
  500. package/dist/schemas/validation/defaults.js +12 -0
  501. package/dist/schemas/validation/defaults.js.map +7 -0
  502. package/dist/schemas/validation/dependencies.d.ts +52 -0
  503. package/dist/schemas/validation/dependencies.js +17 -0
  504. package/dist/schemas/validation/dependencies.js.map +7 -0
  505. package/dist/schemas/validation/empty.d.ts +1 -0
  506. package/dist/schemas/validation/empty.js +6 -0
  507. package/dist/schemas/validation/empty.js.map +7 -0
  508. package/dist/schemas/validation/errors.d.ts +44 -0
  509. package/dist/schemas/validation/errors.js +12 -0
  510. package/dist/schemas/validation/errors.js.map +7 -0
  511. package/dist/schemas/validation/index.d.ts +9 -0
  512. package/dist/schemas/validation/index.js +130 -0
  513. package/dist/schemas/validation/index.js.map +7 -0
  514. package/dist/schemas/validation/presets.d.ts +66 -0
  515. package/dist/schemas/validation/presets.js +6 -0
  516. package/dist/schemas/validation/presets.js.map +7 -0
  517. package/dist/schemas/validation/relations.d.ts +12 -0
  518. package/dist/schemas/validation/relations.js +8 -0
  519. package/dist/schemas/validation/relations.js.map +7 -0
  520. package/dist/schemas/validation/types.d.ts +817 -0
  521. package/dist/schemas/validation/types.js +64 -0
  522. package/dist/schemas/validation/types.js.map +7 -0
  523. package/dist/schemas/validation/utils.d.ts +76 -0
  524. package/dist/schemas/validation/utils.js +24 -0
  525. package/dist/schemas/validation/utils.js.map +7 -0
  526. package/dist/schemas/validation/validation-registry.d.ts +124 -0
  527. package/dist/schemas/validation/validation-registry.js +27 -0
  528. package/dist/schemas/validation/validation-registry.js.map +7 -0
  529. package/dist/server-errors/from-json-api-errors.d.ts +13 -0
  530. package/dist/server-errors/from-json-api-errors.js +10 -0
  531. package/dist/server-errors/from-json-api-errors.js.map +7 -0
  532. package/dist/server-errors/from-problem-details.d.ts +15 -0
  533. package/dist/server-errors/from-problem-details.js +10 -0
  534. package/dist/server-errors/from-problem-details.js.map +7 -0
  535. package/dist/server-errors/index.d.ts +8 -0
  536. package/dist/server-errors/index.js +17 -0
  537. package/dist/server-errors/index.js.map +7 -0
  538. package/dist/server-errors/shared.d.ts +34 -0
  539. package/dist/server-errors/shared.js +23 -0
  540. package/dist/server-errors/shared.js.map +7 -0
  541. package/dist/state-container/create-form-state-container.d.ts +17 -0
  542. package/dist/state-container/create-form-state-container.js +31 -0
  543. package/dist/state-container/create-form-state-container.js.map +7 -0
  544. package/dist/state-container/dirty.d.ts +11 -0
  545. package/dist/state-container/dirty.js +9 -0
  546. package/dist/state-container/dirty.js.map +7 -0
  547. package/dist/state-container/field-array.d.ts +41 -0
  548. package/dist/state-container/field-array.js +8 -0
  549. package/dist/state-container/field-array.js.map +7 -0
  550. package/dist/state-container/hydration.d.ts +21 -0
  551. package/dist/state-container/hydration.js +11 -0
  552. package/dist/state-container/hydration.js.map +7 -0
  553. package/dist/state-container/index.d.ts +16 -0
  554. package/dist/state-container/index.js +51 -0
  555. package/dist/state-container/index.js.map +7 -0
  556. package/dist/state-container/issue-text.d.ts +11 -0
  557. package/dist/state-container/issue-text.js +6 -0
  558. package/dist/state-container/issue-text.js.map +7 -0
  559. package/dist/state-container/row-ids.d.ts +34 -0
  560. package/dist/state-container/row-ids.js +19 -0
  561. package/dist/state-container/row-ids.js.map +7 -0
  562. package/dist/state-container/selectors.d.ts +33 -0
  563. package/dist/state-container/selectors.js +22 -0
  564. package/dist/state-container/selectors.js.map +7 -0
  565. package/dist/state-container/stale-results.d.ts +28 -0
  566. package/dist/state-container/stale-results.js +9 -0
  567. package/dist/state-container/stale-results.js.map +7 -0
  568. package/dist/state-container/state-tree.d.ts +56 -0
  569. package/dist/state-container/state-tree.js +33 -0
  570. package/dist/state-container/state-tree.js.map +7 -0
  571. package/dist/state-container/submission.d.ts +45 -0
  572. package/dist/state-container/submission.js +26 -0
  573. package/dist/state-container/submission.js.map +7 -0
  574. package/dist/state-container/types.d.ts +404 -0
  575. package/dist/state-container/types.js +6 -0
  576. package/dist/state-container/types.js.map +7 -0
  577. package/dist/state-container/value-tree.d.ts +56 -0
  578. package/dist/state-container/value-tree.js +34 -0
  579. package/dist/state-container/value-tree.js.map +7 -0
  580. package/dist/testing/form-state-container-conformance.d.ts +51 -0
  581. package/dist/testing/form-state-container-conformance.js +43 -0
  582. package/dist/testing/form-state-container-conformance.js.map +7 -0
  583. package/dist/testing/index.d.ts +7 -0
  584. package/dist/testing/index.js +35 -0
  585. package/dist/testing/index.js.map +7 -0
  586. package/dist/types/actions.d.ts +75 -0
  587. package/dist/types/actions.js +1 -0
  588. package/dist/types/actions.js.map +7 -0
  589. package/dist/types/categories.d.ts +21 -0
  590. package/dist/types/categories.js +8 -0
  591. package/dist/types/categories.js.map +7 -0
  592. package/dist/types/define-element.d.ts +73 -0
  593. package/dist/types/define-element.js +8 -0
  594. package/dist/types/define-element.js.map +7 -0
  595. package/dist/types/index.d.ts +10 -0
  596. package/dist/types/index.js +17 -0
  597. package/dist/types/index.js.map +7 -0
  598. package/dist/types/metadata.d.ts +14 -0
  599. package/dist/types/metadata.js +1 -0
  600. package/dist/types/metadata.js.map +7 -0
  601. package/dist/types/registration.d.ts +142 -0
  602. package/dist/types/registration.js +1 -0
  603. package/dist/types/registration.js.map +7 -0
  604. package/package.json +119 -3
  605. package/skill/SKILL.md +79 -0
  606. package/skill/reference/forms-actions.md +51 -0
  607. package/skill/reference/forms-submission.md +44 -0
  608. package/skill/reference/forms-validation.md +91 -0
  609. package/skill/reference/forms.md +179 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lib/validate-form/validation-error.ts"],
4
+ "sourcesContent": ["import type { FormValidationIssue, Path } from './issues';\n\nfunction childOf(node: unknown, key: PropertyKey): unknown {\n\treturn typeof node === 'object' && node !== null ? Reflect.get(node, key) : undefined;\n}\n\n/**\n * A path as it reads in an error message: object keys joined by dots, array indexes in brackets,\n * for example `steps[0].elements[2].grid.width`. The empty path is the empty string.\n *\n * @param source The config the path points into. With it, an array item that has a string `id` is\n * followed by the id in parentheses, `steps[0] (main).elements[2] (email).grid.width`, so a log of a\n * config with many fields names the one it means.\n */\nexport function formatIssuePath(path: Path, source?: unknown): string {\n\tlet node = source;\n\tlet text = '';\n\tfor (const key of path) {\n\t\tnode = childOf(node, key);\n\t\tif (typeof key === 'number') {\n\t\t\tconst id = childOf(node, 'id');\n\t\t\ttext += typeof id === 'string' && id ? `[${key}] (${id})` : `[${key}]`;\n\t\t} else {\n\t\t\ttext += text ? `.${String(key)}` : String(key);\n\t\t}\n\t}\n\treturn text;\n}\n\n/**\n * Thrown by {@link validateFormConfig} when a form does not validate.\n *\n * @param issues Every problem the checks found, each with the config path it is about.\n * @param source The authored config the paths point into. It only decorates `message` with the ids\n * of the elements and actions a path passes; `issues` stay as they are.\n *\n * @remarks\n * `message` lists the issues one per line as `<path>: <message>`, so a log reads without parsing\n * `issues`. Use `safeValidateForm` on the engine to get the same issues as a result instead of an\n * exception.\n */\nexport class FormValidationError extends Error {\n\treadonly issues: readonly FormValidationIssue[];\n\n\tconstructor(issues: readonly FormValidationIssue[], source?: unknown) {\n\t\tsuper(\n\t\t\tissues.length > 0\n\t\t\t\t? issues\n\t\t\t\t\t\t.map((issue) => {\n\t\t\t\t\t\t\tconst path = formatIssuePath(issue.path, source);\n\t\t\t\t\t\t\treturn path ? `${path}: ${issue.message}` : issue.message;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.join('\\n')\n\t\t\t\t: 'Invalid form configuration',\n\t\t);\n\t\tthis.name = 'FormValidationError';\n\t\tthis.issues = issues;\n\t}\n}\n"],
5
+ "mappings": ";AAEA,SAAS,QAAQ,MAAe,KAA2B;AAC1D,SAAO,OAAO,SAAS,YAAY,SAAS,OAAO,QAAQ,IAAI,MAAM,GAAG,IAAI;AAC7E;AAUO,SAAS,gBAAgB,MAAY,QAA0B;AACrE,MAAI,OAAO;AACX,MAAI,OAAO;AACX,aAAW,OAAO,MAAM;AACvB,WAAO,QAAQ,MAAM,GAAG;AACxB,QAAI,OAAO,QAAQ,UAAU;AAC5B,YAAM,KAAK,QAAQ,MAAM,IAAI;AAC7B,cAAQ,OAAO,OAAO,YAAY,KAAK,IAAI,GAAG,MAAM,EAAE,MAAM,IAAI,GAAG;AAAA,IACpE,OAAO;AACN,cAAQ,OAAO,IAAI,OAAO,GAAG,CAAC,KAAK,OAAO,GAAG;AAAA,IAC9C;AAAA,EACD;AACA,SAAO;AACR;AAcO,IAAM,sBAAN,cAAkC,MAAM;AAAA,EACrC;AAAA,EAET,YAAY,QAAwC,QAAkB;AACrE;AAAA,MACC,OAAO,SAAS,IACb,OACC,IAAI,CAAC,UAAU;AACf,cAAM,OAAO,gBAAgB,MAAM,MAAM,MAAM;AAC/C,eAAO,OAAO,GAAG,IAAI,KAAK,MAAM,OAAO,KAAK,MAAM;AAAA,MACnD,CAAC,EACA,KAAK,IAAI,IACV;AAAA,IACJ;AACA,SAAK,OAAO;AACZ,SAAK,SAAS;AAAA,EACf;AACD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,42 @@
1
+ // src/lib/standard-json-schema.ts
2
+ function createStandardJSONSchema(vendor, generateInputSchema, generateOutputSchema = generateInputSchema) {
3
+ return {
4
+ "~standard": {
5
+ version: 1,
6
+ vendor,
7
+ jsonSchema: {
8
+ input: generateInputSchema,
9
+ output: generateOutputSchema
10
+ }
11
+ }
12
+ };
13
+ }
14
+ function createStandardJSONSchemaRecord(ids, vendor, generateInputSchema, generateOutputSchema = generateInputSchema) {
15
+ return Object.fromEntries(
16
+ ids.map((id) => [
17
+ id,
18
+ createStandardJSONSchema(
19
+ vendor,
20
+ (options) => {
21
+ const schema = generateInputSchema(id, options);
22
+ if (!schema) {
23
+ throw new Error(`Schema "${id}" is not registered`);
24
+ }
25
+ return schema;
26
+ },
27
+ (options) => {
28
+ const schema = generateOutputSchema(id, options);
29
+ if (!schema) {
30
+ throw new Error(`Schema "${id}" is not registered`);
31
+ }
32
+ return schema;
33
+ }
34
+ )
35
+ ])
36
+ );
37
+ }
38
+
39
+ export {
40
+ createStandardJSONSchema,
41
+ createStandardJSONSchemaRecord
42
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lib/standard-json-schema.ts"],
4
+ "sourcesContent": ["import type { StandardJSONSchemaV1 } from '@standard-schema/spec';\nexport type { StandardJSONSchemaV1 } from '@standard-schema/spec';\n\n/**\n * Loosely typed JSON Schema object used at the package boundary.\n * The serializer layer intentionally stays permissive so callers can inspect\n * emitted schemas without depending on a full JSON Schema AST type model.\n * @remarks Values are existential JSON Schema nodes; callers inspecting nested\n * vendor-specific keywords retain the permissive boundary used by the engine.\n */\nexport type JSONSchemaObject = Record<string, any>;\n\n/**\n * JSON Schema targets supported by the current serializer layer.\n * This mirrors the Standard JSON Schema target model and keeps room for\n * future target strings without another breaking type change.\n */\nexport type JSONSchemaTarget = StandardJSONSchemaV1.Target;\n\n/**\n * Create a Standard JSON Schema wrapper for a schema generator.\n * This keeps Standard JSON Schema plumbing separate from form-specific code.\n */\nexport function createStandardJSONSchema(\n\tvendor: string,\n\tgenerateInputSchema: (options: StandardJSONSchemaV1.Options) => JSONSchemaObject,\n\tgenerateOutputSchema: (options: StandardJSONSchemaV1.Options) => JSONSchemaObject = generateInputSchema,\n): StandardJSONSchemaV1 {\n\treturn {\n\t\t'~standard': {\n\t\t\tversion: 1,\n\t\t\tvendor,\n\t\t\tjsonSchema: {\n\t\t\t\tinput: generateInputSchema,\n\t\t\t\toutput: generateOutputSchema,\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * Create a record of Standard JSON Schema wrappers from stable schema ids.\n * This is used when a package wants to expose many related schemas through the\n * same vendor-specific serializer without duplicating wrapper logic.\n */\nexport function createStandardJSONSchemaRecord(\n\tids: string[],\n\tvendor: string,\n\tgenerateInputSchema: (id: string, options: StandardJSONSchemaV1.Options) => JSONSchemaObject | undefined,\n\tgenerateOutputSchema: (\n\t\tid: string,\n\t\toptions: StandardJSONSchemaV1.Options,\n\t) => JSONSchemaObject | undefined = generateInputSchema,\n): Record<string, StandardJSONSchemaV1> {\n\treturn Object.fromEntries(\n\t\tids.map((id) => [\n\t\t\tid,\n\t\t\tcreateStandardJSONSchema(\n\t\t\t\tvendor,\n\t\t\t\t(options) => {\n\t\t\t\t\tconst schema = generateInputSchema(id, options);\n\t\t\t\t\tif (!schema) {\n\t\t\t\t\t\tthrow new Error(`Schema \"${id}\" is not registered`);\n\t\t\t\t\t}\n\t\t\t\t\treturn schema;\n\t\t\t\t},\n\t\t\t\t(options) => {\n\t\t\t\t\tconst schema = generateOutputSchema(id, options);\n\t\t\t\t\tif (!schema) {\n\t\t\t\t\t\tthrow new Error(`Schema \"${id}\" is not registered`);\n\t\t\t\t\t}\n\t\t\t\t\treturn schema;\n\t\t\t\t},\n\t\t\t),\n\t\t]),\n\t) as Record<string, StandardJSONSchemaV1>;\n}\n"],
5
+ "mappings": ";AAuBO,SAAS,yBACf,QACA,qBACA,uBAAoF,qBAC7D;AACvB,SAAO;AAAA,IACN,aAAa;AAAA,MACZ,SAAS;AAAA,MACT;AAAA,MACA,YAAY;AAAA,QACX,OAAO;AAAA,QACP,QAAQ;AAAA,MACT;AAAA,IACD;AAAA,EACD;AACD;AAOO,SAAS,+BACf,KACA,QACA,qBACA,uBAGoC,qBACG;AACvC,SAAO,OAAO;AAAA,IACb,IAAI,IAAI,CAAC,OAAO;AAAA,MACf;AAAA,MACA;AAAA,QACC;AAAA,QACA,CAAC,YAAY;AACZ,gBAAM,SAAS,oBAAoB,IAAI,OAAO;AAC9C,cAAI,CAAC,QAAQ;AACZ,kBAAM,IAAI,MAAM,WAAW,EAAE,qBAAqB;AAAA,UACnD;AACA,iBAAO;AAAA,QACR;AAAA,QACA,CAAC,YAAY;AACZ,gBAAM,SAAS,qBAAqB,IAAI,OAAO;AAC/C,cAAI,CAAC,QAAQ;AACZ,kBAAM,IAAI,MAAM,WAAW,EAAE,qBAAqB;AAAA,UACnD;AACA,iBAAO;AAAA,QACR;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ // src/state-container/types.ts
2
+ var FORM_ROOT = "__root__";
3
+
4
+ export {
5
+ FORM_ROOT
6
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/state-container/types.ts"],
4
+ "sourcesContent": ["import type { FieldParticipation, ValidationStep } from '@/engine/value-validation';\nimport type { ValidationRegistry } from '@/schemas/validation/validation-registry';\nimport type { FieldArrayCommands } from './field-array';\n\n/**\n * The internal form state contract: what a form's state container owns, and what it leaves to others.\n *\n * @remarks\n * The container owns the nested value tree, field state (errors, touched, dirty), field-array row ids and\n * the atomic updates that keep them consistent. A path is a plain dotted path with the row index in it\n * (`contacts.1.email`) wherever the API takes one, and {@link FORM_ROOT} names the form itself. It holds\n * no submission state (`isSubmitting`, `submitCount`, a submit guard): the runtime owns those. Focus,\n * native controls and native submit belong to the host, and there is no control registration: a host\n * bridges a control into the container with {@link FormStateContainer.setValue} and\n * {@link FormStateContainer.blur}, reports the control's native validity with\n * {@link FormStateContainer.reportNative}, and submits with {@link FormStateContainer.submit}, whose result\n * carries the way to hand back the server's answer.\n *\n * The container is named for what it holds, not `FormStore`, which is a class of Radiant UI. The contract is\n * public through `@schema-engine/forms/state-container`, with `@schema-engine/forms/csrf` and\n * `@schema-engine/forms/server-errors` beside it. Its conformance suite is `formStateContainerConformance` from\n * `@schema-engine/forms/testing`.\n */\n\n/**\n * The key of an error about the form itself rather than a field, in `snapshot.errors` and in `setServerErrors`.\n *\n * @remarks Path segments that start with `__` are reserved, so no field can have this name.\n */\nexport const FORM_ROOT = '__root__';\n\n/**\n * When a field validates before a check of it has failed: on `change`, on `blur`, on both (`all`), on the\n * first `blur` and on every change after it (`onTouched`, as React Hook Form's mode of that name) or only on\n * an explicit {@link FormStateContainer.validate}.\n */\nexport type FormValidationMode = 'onSubmit' | 'onChange' | 'onBlur' | 'onTouched' | 'all';\n\n/** When a field validates once a {@link FormStateContainer.validate} over it has failed. */\nexport type FormReValidateMode = 'onSubmit' | 'onChange' | 'onBlur';\n\n/** Who reported an issue. */\nexport type FormStateSource = 'server' | 'validation' | 'native';\n\n/**\n * One thing wrong with a path, who said so, and what a translation needs to say it.\n *\n * @remarks\n * `type` names the problem for a program: the rule's type (`'minLength'`), the `ValidityState` flag of a\n * native control (`'typeMismatch'`) or the server's code. `ruleId` is the author's stable name for the\n * rule, so two `pattern` rules stay distinguishable. `params` are the numbers and names the text is\n * built from, serializable (`{ minLength: 8 }` for a rule, `{ minLength: 8 }` for a native control).\n * `message` is only the text the author wrote on the rule, or the server or control sent, for a host with no\n * translation of the issue, and may be absent. Text the schema library would make up is never used.\n */\nexport interface FormStateIssue {\n\treadonly type: string;\n\treadonly source: FormStateSource;\n\treadonly ruleId?: string;\n\treadonly params?: Readonly<Record<string, unknown>>;\n\treadonly message?: string;\n}\n\n/**\n * The error of a path: the issue to show, and every issue the path has.\n *\n * @remarks\n * The fields of the issue are those of `all[0]`, so the error reads like a single issue, and `all` is\n * never empty. `all` lists, in this order, what the server said, then each rule the value fails in\n * authored order (never the order the checks finished in), then what the platform's own control reports.\n * The same error object comes back while none of that changes.\n */\nexport interface FormStateError extends FormStateIssue {\n\treadonly all: readonly FormStateIssue[];\n}\n\n/**\n * Advice about a path: shaped and timed exactly like an error, and never blocking.\n *\n * @remarks\n * It comes from rules declared with `severity: 'warning'`, so its issues have the source `'validation'`.\n * It never affects `isValid`, `validate` or `checkValidity`. A server cannot send warnings yet.\n */\nexport type FormStateWarning = FormStateError;\n\n/**\n * Why a submission as a whole failed, in the shape of an issue, so a host words it with the one formatter.\n *\n * @remarks\n * It is not a {@link FormStateIssue}: a submission failure (the action that threw, the callback that\n * rejected, the service that was down) concerns no field and the snapshot never holds one. `type` names the\n * failure for a program, `params` fill the text, and `message` is only the text the failure itself carried.\n */\nexport interface FormSubmissionIssue {\n\treadonly type: string;\n\treadonly source: 'submission';\n\treadonly params?: Readonly<Record<string, unknown>>;\n\treadonly message?: string;\n}\n\n/**\n * Turns an issue into the text to show, for the field at `field.path`.\n *\n * @remarks\n * The one seam between the engine, which reports what is wrong (`type`, `ruleId`, `params`), and the text\n * of the application's language, which the engine does not own. A binding takes one from its host and\n * calls it for the issue to show (an error or warning is itself an issue) and for each of `all` it lists,\n * falling back to `issue.message` when the host gives none or the formatter returns nothing worth showing.\n * `ruleId` picks a text of one rule, `type` a text of a kind of rule, and `params` fill its numbers. The\n * action context and the bindings use this same issue type, so one formatter serves them all. A\n * {@link FormSubmissionIssue} goes through it too, with the path of the form ({@link FORM_ROOT}).\n */\nexport type FormIssueFormatter = (\n\tissue: FormStateIssue | FormSubmissionIssue,\n\tfield: { readonly path: string },\n) => string;\n\n/**\n * An issue as a caller of `setServerErrors` may give it.\n *\n * @remarks\n * Every part is optional, as a server response may carry only a code or only a message. A missing `type`\n * is kept as `'server'`. An issue with nothing but a type still counts as an error: it blocks\n * {@link FormStateContainer.validate}.\n */\nexport interface FormStateErrorInput {\n\treadonly type?: string;\n\treadonly params?: Readonly<Record<string, unknown>>;\n\treadonly message?: string;\n}\n\n/** What `setServerErrors` takes: one issue or a list of them for each path. */\nexport type FormStateErrorsInput = Readonly<Record<string, FormStateErrorInput | readonly FormStateErrorInput[]>>;\n\n/**\n * What a platform control reports about its value.\n *\n * @remarks\n * `type` is the `ValidityState` flag (`'valueMissing'`, `'typeMismatch'`, `'tooShort'`), `params` the\n * constraint behind it that a text needs (`{ minLength: 8 }`, `{ pattern: '[0-9]+' }`), `message` the\n * control's own text, a fallback only.\n */\nexport interface NativeValidity {\n\treadonly type: string;\n\treadonly params?: Readonly<Record<string, unknown>>;\n\treadonly message?: string;\n}\n\n/**\n * How a check of the form ended, and what the host may do next.\n *\n * @remarks\n * `'passed'`: the scope was current and no error from any source remains at the paths that take part.\n * `'invalid'`: the scope was current and an error blocks. `'overtaken'`: an edit, a row move or a reset outran the\n * check, and the retry over the same rows was outrun too or the rows are gone, so there is no verdict and nothing\n * stale was written: ask again, and do not show errors the user did not cause. A {@link FormSubmitResult} is built on\n * it, so the outcomes are listed here only.\n */\nexport type FormValidateResult =\n\t{ readonly outcome: 'passed' } | { readonly outcome: 'invalid' } | { readonly outcome: 'overtaken' };\n\n/**\n * How a submission ended, and what the host may do next.\n *\n * @remarks\n * `'passed'`: the scope was current and nothing blocks; `values` are exactly the values that passed, frozen,\n * nested like `snapshot.values`, without the paths that took no part and with the config's `payload`. An\n * edit during the check followed by a retry that passes leaves the edit in them. `setServerErrors` hands back\n * the server's answer to that submission. `'invalid'`: the scope was current and an error blocks, so show the\n * errors and focus. `'overtaken'`: an edit, a row move, a reset, a later submission or a superseded check outran\n * it, so there is no verdict on anything: ask again, and do not show errors the user did not cause.\n */\nexport type FormSubmitResult =\n\t| Exclude<FormValidateResult, { readonly outcome: 'passed' }>\n\t| {\n\t\t\treadonly outcome: 'passed';\n\t\t\treadonly values: Readonly<Record<string, unknown>>;\n\t\t\t/**\n\t\t\t * Shows the server's answer to this submission, replacing the answer shown so far.\n\t\t\t *\n\t\t\t * @remarks\n\t\t\t * Each path takes one issue or a list, and {@link FORM_ROOT} stands for the form. Throws for a path with\n\t\t\t * a reserved `__` segment other than `FORM_ROOT`, and for a path that names a row the submitted values\n\t\t\t * did not have. Paths are as they are in `values`: an index counts only the rows that took part, and the container maps it to the form's row (so with the middle one of three rows left out, `rows.1` is the third row). An error for `contacts.0.email` lands\n\t\t\t * on that row wherever it is now, and is dropped when the row is gone. A path no field declares cannot be\n\t\t\t * shown at a field, so its issues move to `FORM_ROOT`, keeping their type, params and message. An error is applied only when its\n\t\t\t * target, and every value its rules read, are unchanged since the submission, and only while this is the\n\t\t\t * latest submission and no reset came between: otherwise the call does nothing. An error is cleared\n\t\t\t * when its path, or a path its rules read, is edited.\n\t\t\t */\n\t\t\treadonly setServerErrors: (errors: FormStateErrorsInput) => void;\n\t };\n\n/**\n * The immutable state a subscriber reads.\n *\n * @remarks\n * Stable: {@link FormStateContainer.getSnapshot} returns the same object until something changes, and a\n * branch that did not change keeps its reference, in `values` and in every map. Maps are plain records,\n * frozen, keyed by dotted path. An opaque value, such as an array holding `File` objects, is kept and\n * compared by reference: it is never copied, frozen or diffed.\n *\n * Paths that take no part in validation (hidden or disabled fields, and what is inside them) are absent\n * from `errors`, `warnings` and `validating`.\n */\nexport interface FormStateSnapshot {\n\t/** The nested value tree. */\n\treadonly values: Readonly<Record<string, unknown>>;\n\t/**\n\t * The error of each path, with every issue it has in `all`.\n\t *\n\t * @remarks\n\t * Never inherited: an error on `contacts` is not an error on `contacts.0.email`, and both can be present.\n\t * An error about the form itself is at {@link FORM_ROOT}.\n\t */\n\treadonly errors: Readonly<Record<string, FormStateError>>;\n\t/** The advice of each path, shaped like `errors` and never blocking. */\n\treadonly warnings: Readonly<Record<string, FormStateWarning>>;\n\t/** The paths the user has blurred; a mark on a container covers the fields below it. Moves with its row. */\n\treadonly touched: Readonly<Record<string, true>>;\n\t/**\n\t * The paths whose value differs from the defaults.\n\t *\n\t * @remarks An array's own mark means its row count changed; its rows are compared by index, so appending a row does not make the existing rows dirty.\n\t */\n\treadonly dirty: Readonly<Record<string, true>>;\n\t/** The ids of an array's rows, by array path, in row order. */\n\treadonly rowIds: Readonly<Record<string, readonly string[]>>;\n\t/**\n\t * The paths a check the container started is still running for.\n\t *\n\t * @remarks\n\t * A path is listed while the latest check that asked for it is running: a check overtaken by a later one\n\t * for the same path does not keep it pending. Pending is state, never an issue. It moves with its row.\n\t */\n\treadonly validating: Readonly<Record<string, true>>;\n\t/** Whether no error from any source is recorded for a path that takes part. Cheap, and not a fresh check. */\n\treadonly isValid: boolean;\n\t/**\n\t * How many times the form was reset: it goes up by one on every {@link FormStateContainer.reset} and on nothing else.\n\t *\n\t * @remarks\n\t * It lets what lives around the container, such as a runtime's submission and step state, notice a reset\n\t * that no one told it about, since `reset` is the only way back and any caller may use it.\n\t */\n\treadonly generation: number;\n\t/**\n\t * What the form's constraints say, resolved in order against the values with whatever took no part absent.\n\t *\n\t * @remarks\n\t * `skippedSteps` lists the ids of the steps its constraints hide. `fields` has an entry for each rendered path that has a constraint,\n\t * is disabled by authoring or is held by a skipped step; `selectFieldState` folds the ancestors in. The same object comes back\n\t * while nothing in it changes, however much else does.\n\t */\n\treadonly participation: {\n\t\treadonly skippedSteps: readonly string[];\n\t\treadonly fields: Readonly<Record<string, FieldParticipation>>;\n\t};\n}\n\n/**\n * The commands over a form's state, and the stable reads a binding builds on.\n *\n * @remarks\n * Every command is one atomic update: subscribers are notified once, and never see an array's values\n * and its row state out of step. No member depends on how it is called, so a binding may pass any of\n * them as a callback. Read state with `getSnapshot` and the selectors of `selectors.ts`.\n */\nexport interface FormStateContainer {\n\t/** Registers a listener for every snapshot change; returns the function that removes it. */\n\tsubscribe(listener: () => void): () => void;\n\tgetSnapshot(): FormStateSnapshot;\n\t/** The snapshot to render on the server and during hydration: the initial state, never replaced. */\n\tgetServerSnapshot(): FormStateSnapshot;\n\n\t/** The value at a dotted path, from the current state. */\n\tgetValue(path: string): unknown;\n\t/**\n\t * Replaces the whole branch at `path`.\n\t *\n\t * @remarks\n\t * Throws for a path with a reserved segment (one that starts with `__`, or `constructor`, `prototype`, `__proto__`) and for a path that names a row its array does not\n\t * have: rows are made with `fieldArray`, so a write cannot leave holes or rows without an id. It is a change: it validates when the mode says so, re-validates dependents, and drops what describes\n\t * a value that is gone: the errors a server answered with at the path and below, and on the paths around it, the form included,\n\t * and the native facts of the value. The state of rows and objects the branch no longer holds is dropped with\n\t * them. A write that leaves the value as it is changes nothing.\n\t */\n\tsetValue(path: string, value: unknown): void;\n\t/**\n\t * Marks `path` touched, and validates it when the mode says so.\n\t *\n\t * @remarks\n\t * The path is checked as in `setValue`. A control whose value the host has not written yet is written with\n\t * `setValue` first: the two are separate commands, and the end state is the one a single command would\n\t * leave.\n\t */\n\tblur(path: string): void;\n\t/**\n\t * Reports what the platform's controls say about the values the container holds, with no input from the user.\n\t *\n\t * @remarks\n\t * The one channel for native validity, for a host that owns controls: a path with its fact, `null` for a\n\t * control that reports itself valid or goes away, which withdraws the fact. A host reports a fact on a\n\t * change, a blur, a reset, or when a control's constraints change, and withdraws it when its control\n\t * disconnects. A fact is bound to the value held now and is dropped when that value changes, and it moves with\n\t * its row. A fact that is already held is a no-op. Reporting is no change: nothing becomes dirty or touched,\n\t * and one call is one commit that re-validates, in a single run, only the changed paths that were validated\n\t * before, are in a failed scope, or have a check in flight, never to start validating a pristine one. A path no field\n\t * of the config expands to for the values held (a name no field has, a removed row, anything below a scalar) is\n\t * ignored. A reserved path throws, for the whole\n\t * call and before anything is written. A fact is not part of the snapshot, so reporting alone notifies nobody.\n\t */\n\treportNative(facts: Readonly<Record<string, NativeValidity | null>>): void;\n\t/**\n\t * Replaces the defaults with `values` when given, then restores the values to the defaults and clears\n\t * every error, native fact, touched and dirty mark and the failed-check state.\n\t *\n\t * @remarks Validation still running when this is called is dropped and not run again, and so are the submissions begun before it; every row gets a new id.\n\t */\n\treset(values?: Record<string, unknown>): void;\n\t/**\n\t * Validates `paths` (the whole form when omitted, nothing when empty), records the findings and says how that ended.\n\t *\n\t * @remarks\n\t * Every check records the scope it covered: the values it read, the values its rules depend on, the\n\t * native facts, the reset generation and the rows by id. It is `'passed'` only when no error from any\n\t * source remains at the paths that take part and that scope was still current when it finished. A check\n\t * overtaken by an edit, a row move or a reset runs once more over the same rows, wherever they are now,\n\t * and one that is overtaken again, or whose rows are gone, is `'overtaken'` without writing anything stale:\n\t * it is not `'invalid'`, so the host must not read it as a failed field.\n\t * It rejects with a `FormValidationFailure` naming the path and rule when a rule could not run. A failure\n\t * of its own validation starts the failed-check state for those paths, so they re-validate by\n\t * `reValidateMode` from then on. It does not mark anything submitted or touched.\n\t */\n\tvalidate(paths?: readonly string[]): Promise<FormValidateResult>;\n\t/**\n\t * Whether the form is valid for the state at the moment of the call, by the same count as `validate`, without its writes.\n\t *\n\t * @remarks\n\t * It answers for the values, native facts, server errors and participation current when it was called,\n\t * and for no later state: it is never retried and never mixes those with errors set afterwards, so the\n\t * answer may already be out of date when it resolves. It writes no error and\n\t * changes no state. Errors recorded earlier do not count, as the check validates afresh. It rejects with\n\t * a `FormValidationFailure`, which keeps the `reason` and the `cause`, when a rule could not run.\n\t */\n\tcheckValidity(): Promise<boolean>;\n\t/**\n\t * Submits the form: clears the server's answer to the last submission, validates the whole form and says how that ended.\n\t *\n\t * @remarks\n\t * It validates as `validate()` does, with the same freshness and the one retry over the same rows, and\n\t * captures the submission the result speaks for: a later `submit` or a `reset` supersedes it, and the\n\t * earlier one ends `'overtaken'` or has its `setServerErrors` ignored. Like `validate`, it rejects with a\n\t * `FormValidationFailure` when a rule could not run, and a rejected call is no outcome.\n\t */\n\tsubmit(): Promise<FormSubmitResult>;\n\t/**\n\t * The commands of the array at `path`, the same object each time.\n\t *\n\t * @remarks\n\t * Cached per path, and a path names a position: `contacts.0.phones` is whatever row is at index 0 now,\n\t * not the row that was there when the commands were first asked for. Rows are read from\n\t * `snapshot.rowIds[path]`; `toFieldArrayValue` combines the two for a widget.\n\t */\n\tfieldArray(path: string): FieldArrayCommands;\n}\n\n/** What {@link createFormStateContainer} reads from a normalized form config. */\nexport interface FormStateContainerConfig {\n\t/**\n\t * The steps whose elements make up the form: fields, rules and constraints.\n\t *\n\t * @remarks A step's own `constraints` decide whether it is skipped; a skipped step's fields take no part, as hidden fields do not.\n\t */\n\treadonly steps: readonly ValidationStep[];\n\t/** When a field validates before a check of it has failed; the config schema always fills it. */\n\treadonly validationMode: FormValidationMode;\n\t/** When a field validates once a check of it has run; the config schema always fills it. */\n\treadonly reValidateMode: FormReValidateMode;\n\t/**\n\t * Data that travels with every submission.\n\t *\n\t * @remarks It is merged into the `values` of a passed submission and is never a value of the form: not in the snapshot, not dirty, not validated. Its keys cannot name fields, which the config validation checks.\n\t */\n\treadonly payload?: Readonly<Record<string, unknown>>;\n}\n\n/**\n * The part of a snapshot that a server hands to a client so the client starts from the same state.\n *\n * @remarks\n * The `values` and `rowIds` of a snapshot are plain, frozen and serializable (but for opaque values such as\n * files), so `JSON.stringify(toHydration(container.getServerSnapshot()))` is the payload, and a snapshot is itself\n * accepted. The rest of a snapshot is derived from what the server's container did, not state to restore.\n */\nexport interface FormStateHydration {\n\treadonly values: Readonly<Record<string, unknown>>;\n\treadonly rowIds: Readonly<Record<string, readonly string[]>>;\n}\n\n/** What {@link FormStateContainerFactory} builds a container from. */\nexport interface FormStateContainerOptions {\n\t/** The normalized form config: the elements, the validation timing and the payload all come from it, so no renderer can differ. */\n\treadonly config: FormStateContainerConfig;\n\treadonly registry: ValidationRegistry;\n\treadonly defaults?: Record<string, unknown>;\n\t/**\n\t * The snapshot of a container that rendered the form elsewhere, to start from: its values and its row ids.\n\t *\n\t * @remarks\n\t * Without it the container starts from `defaults` and mints deterministic row ids (walk order, one counter per\n\t * container). With it the container starts from the values of the snapshot and adopts its row ids, so a client\n\t * keeps the identity a server rendered, whatever rows the user had added there. Values and ids come from the same\n\t * object, so there is nothing to compare; one whose ids do not match its own values cannot come from a real\n\t * snapshot and throws. `defaults` still say what the form started from, and what\n\t * `reset` restores, so pass the same ones the server used: the fields that differ from them are dirty.\n\t */\n\treadonly snapshot?: FormStateHydration;\n}\n\n/** What `formStateContainerConformance` builds the container under test with. */\nexport type FormStateContainerFactory = (options: FormStateContainerOptions) => FormStateContainer;\n"],
5
+ "mappings": ";AA6BO,IAAM,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,64 @@
1
+ import {
2
+ containerKindOf
3
+ } from "./chunk-2YKQAVI2.js";
4
+ import {
5
+ issueAt
6
+ } from "./chunk-LMWJAD3B.js";
7
+ import {
8
+ resolveFieldRef
9
+ } from "./chunk-YDGH7DTL.js";
10
+ import {
11
+ getElementName
12
+ } from "./chunk-S7I76ISM.js";
13
+ import {
14
+ getElementChildren
15
+ } from "./chunk-ZUYSGCEH.js";
16
+
17
+ // src/lib/validate-form/step-checks.ts
18
+ var isObject = (value) => typeof value === "object" && value !== null;
19
+ function readablePaths(elements, getElement, base = "") {
20
+ return elements.flatMap((element) => {
21
+ const name = getElementName(element);
22
+ if (!name) return [];
23
+ const path = base ? `${base}.${name}` : name;
24
+ const children = getElementChildren(element);
25
+ const kind = "$type" in element && typeof element.$type === "string" ? containerKindOf(getElement(element.$type)) : void 0;
26
+ return kind === "array" || !children ? [path] : [path, ...readablePaths(children.filter(isObject), getElement, path)];
27
+ });
28
+ }
29
+ function stepStructureIssues(steps, getElement) {
30
+ const issues = [];
31
+ const seen = /* @__PURE__ */ new Set();
32
+ const earlier = /* @__PURE__ */ new Set();
33
+ steps.forEach((step, index) => {
34
+ if (seen.has(step.id)) {
35
+ issues.push(
36
+ issueAt(["steps", index, "id"], `Step id '${step.id}' is a duplicate: step ids must be unique.`)
37
+ );
38
+ }
39
+ seen.add(step.id);
40
+ if (index === 0 && step.constraints?.length) {
41
+ issues.push(
42
+ issueAt(["steps", 0, "constraints"], "The first step cannot have constraints: it is always active.")
43
+ );
44
+ } else {
45
+ step.constraints?.forEach((constraint, at) => {
46
+ const path = resolveFieldRef(constraint.field);
47
+ if (!earlier.has(path)) {
48
+ issues.push(
49
+ issueAt(
50
+ ["steps", index, "constraints", at, "field"],
51
+ `Step '${step.id}' reads '${constraint.field}', which is not a field of an earlier step outside an array row: a step constraint may read only those.`
52
+ )
53
+ );
54
+ }
55
+ });
56
+ }
57
+ for (const path of readablePaths(step.elements, getElement)) earlier.add(path);
58
+ });
59
+ return issues;
60
+ }
61
+
62
+ export {
63
+ stepStructureIssues
64
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lib/validate-form/step-checks.ts"],
4
+ "sourcesContent": ["import { containerKindOf } from '@/lib/container-kind-of';\nimport { getElementChildren } from '@/lib/element-children';\nimport { getElementName } from '@/lib/field-scope';\nimport { resolveFieldRef } from '@/lib/field-ref';\nimport { issueAt, type FormValidationIssue } from './issues';\nimport type { ValidateFormOptions } from './options';\n\nconst isObject = (value: unknown): value is object => typeof value === 'object' && value !== null;\n\ninterface CheckedStep {\n\treadonly id: string;\n\treadonly elements: readonly object[];\n\treadonly constraints?: ReadonlyArray<{ readonly field: string }>;\n}\n\n/**\n * The paths of the named fields outside array rows: what a step constraint may read.\n *\n * @remarks An array itself is such a field, since its value is read as a whole; what is inside its rows is not.\n */\nfunction readablePaths(\n\telements: readonly object[],\n\tgetElement: ValidateFormOptions['getElement'],\n\tbase = '',\n): string[] {\n\treturn elements.flatMap((element) => {\n\t\tconst name = getElementName(element);\n\t\tif (!name) return [];\n\t\tconst path = base ? `${base}.${name}` : name;\n\t\tconst children = getElementChildren(element);\n\t\tconst kind =\n\t\t\t'$type' in element && typeof element.$type === 'string'\n\t\t\t\t? containerKindOf(getElement(element.$type))\n\t\t\t\t: undefined;\n\t\treturn kind === 'array' || !children\n\t\t\t? [path]\n\t\t\t: [path, ...readablePaths(children.filter(isObject), getElement, path)];\n\t});\n}\n\n/**\n * The problems of a form's step structure: duplicate ids, and constraints that are not on a step that can be skipped.\n *\n * @remarks\n * A step constraint may read only non-row fields of earlier steps, so the first step has none, the start\n * is deterministic, at least one step is active and the constraints cannot form a cycle.\n */\nexport function stepStructureIssues(\n\tsteps: readonly CheckedStep[],\n\tgetElement: ValidateFormOptions['getElement'],\n): FormValidationIssue[] {\n\tconst issues: FormValidationIssue[] = [];\n\tconst seen = new Set<string>();\n\tconst earlier = new Set<string>();\n\tsteps.forEach((step, index) => {\n\t\tif (seen.has(step.id)) {\n\t\t\tissues.push(\n\t\t\t\tissueAt(['steps', index, 'id'], `Step id '${step.id}' is a duplicate: step ids must be unique.`),\n\t\t\t);\n\t\t}\n\t\tseen.add(step.id);\n\t\tif (index === 0 && step.constraints?.length) {\n\t\t\tissues.push(\n\t\t\t\tissueAt(['steps', 0, 'constraints'], 'The first step cannot have constraints: it is always active.'),\n\t\t\t);\n\t\t} else {\n\t\t\tstep.constraints?.forEach((constraint, at) => {\n\t\t\t\tconst path = resolveFieldRef(constraint.field);\n\t\t\t\tif (!earlier.has(path)) {\n\t\t\t\t\tissues.push(\n\t\t\t\t\t\tissueAt(\n\t\t\t\t\t\t\t['steps', index, 'constraints', at, 'field'],\n\t\t\t\t\t\t\t`Step '${step.id}' reads '${constraint.field}', which is not a field of an earlier step outside an array row: a step constraint may read only those.`,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tfor (const path of readablePaths(step.elements, getElement)) earlier.add(path);\n\t});\n\treturn issues;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAOA,IAAM,WAAW,CAAC,UAAoC,OAAO,UAAU,YAAY,UAAU;AAa7F,SAAS,cACR,UACA,YACA,OAAO,IACI;AACX,SAAO,SAAS,QAAQ,CAAC,YAAY;AACpC,UAAM,OAAO,eAAe,OAAO;AACnC,QAAI,CAAC,KAAM,QAAO,CAAC;AACnB,UAAM,OAAO,OAAO,GAAG,IAAI,IAAI,IAAI,KAAK;AACxC,UAAM,WAAW,mBAAmB,OAAO;AAC3C,UAAM,OACL,WAAW,WAAW,OAAO,QAAQ,UAAU,WAC5C,gBAAgB,WAAW,QAAQ,KAAK,CAAC,IACzC;AACJ,WAAO,SAAS,WAAW,CAAC,WACzB,CAAC,IAAI,IACL,CAAC,MAAM,GAAG,cAAc,SAAS,OAAO,QAAQ,GAAG,YAAY,IAAI,CAAC;AAAA,EACxE,CAAC;AACF;AASO,SAAS,oBACf,OACA,YACwB;AACxB,QAAM,SAAgC,CAAC;AACvC,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,UAAU,oBAAI,IAAY;AAChC,QAAM,QAAQ,CAAC,MAAM,UAAU;AAC9B,QAAI,KAAK,IAAI,KAAK,EAAE,GAAG;AACtB,aAAO;AAAA,QACN,QAAQ,CAAC,SAAS,OAAO,IAAI,GAAG,YAAY,KAAK,EAAE,4CAA4C;AAAA,MAChG;AAAA,IACD;AACA,SAAK,IAAI,KAAK,EAAE;AAChB,QAAI,UAAU,KAAK,KAAK,aAAa,QAAQ;AAC5C,aAAO;AAAA,QACN,QAAQ,CAAC,SAAS,GAAG,aAAa,GAAG,8DAA8D;AAAA,MACpG;AAAA,IACD,OAAO;AACN,WAAK,aAAa,QAAQ,CAAC,YAAY,OAAO;AAC7C,cAAM,OAAO,gBAAgB,WAAW,KAAK;AAC7C,YAAI,CAAC,QAAQ,IAAI,IAAI,GAAG;AACvB,iBAAO;AAAA,YACN;AAAA,cACC,CAAC,SAAS,OAAO,eAAe,IAAI,OAAO;AAAA,cAC3C,SAAS,KAAK,EAAE,YAAY,WAAW,KAAK;AAAA,YAC7C;AAAA,UACD;AAAA,QACD;AAAA,MACD,CAAC;AAAA,IACF;AACA,eAAW,QAAQ,cAAc,KAAK,UAAU,UAAU,EAAG,SAAQ,IAAI,IAAI;AAAA,EAC9E,CAAC;AACD,SAAO;AACR;",
6
+ "names": []
7
+ }
File without changes
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,173 @@
1
+ import {
2
+ assertWritablePathKey,
3
+ isReservedPathKey
4
+ } from "./chunk-3YLRJVVN.js";
5
+ import {
6
+ isPlainObject
7
+ } from "./chunk-CMPOBBRV.js";
8
+
9
+ // src/lib/path-values.ts
10
+ function createValueObject() {
11
+ return /* @__PURE__ */ Object.create(null);
12
+ }
13
+ function getValueAtPath(input, path) {
14
+ if (!path) {
15
+ return input;
16
+ }
17
+ return path.split(".").reduce((current, segment) => {
18
+ if (current === null || current === void 0 || isReservedPathKey(segment)) {
19
+ return void 0;
20
+ }
21
+ return Object.hasOwn(current, segment) ? current[segment] : void 0;
22
+ }, input);
23
+ }
24
+ function setValueAtPath(target, path, value) {
25
+ if (!path) {
26
+ return target;
27
+ }
28
+ const segments = path.split(".");
29
+ let current = target;
30
+ for (let index = 0; index < segments.length; index += 1) {
31
+ const segment = segments[index];
32
+ assertWritablePathKey(segment);
33
+ const isLeaf = index === segments.length - 1;
34
+ if (isLeaf) {
35
+ current[segment] = value;
36
+ break;
37
+ }
38
+ const nextSegment = segments[index + 1];
39
+ const nextIsIndex = /^\d+$/.test(nextSegment);
40
+ const existing = current[segment];
41
+ if (Array.isArray(existing)) {
42
+ current = existing;
43
+ continue;
44
+ }
45
+ if (existing && typeof existing === "object") {
46
+ current = existing;
47
+ continue;
48
+ }
49
+ const container = nextIsIndex ? [] : createValueObject();
50
+ current[segment] = container;
51
+ current = container;
52
+ }
53
+ return target;
54
+ }
55
+ function withoutValueAt(values, path) {
56
+ const [head, ...rest] = path.split(".");
57
+ if (head === void 0 || values === null || typeof values !== "object" || !Object.hasOwn(values, head)) {
58
+ return values;
59
+ }
60
+ const current = Reflect.get(values, head);
61
+ const next = rest.length === 0 ? void 0 : withoutValueAt(current, rest.join("."));
62
+ if (Object.is(next, current)) return values;
63
+ const copy = Array.isArray(values) ? [...values] : { ...values };
64
+ if (typeof copy === "object" && copy !== null) Reflect.set(copy, head, next);
65
+ return copy;
66
+ }
67
+ function mergePathValues(fields, userDefaults = {}) {
68
+ const fieldDefaults = fields.reduce((accumulator, field) => {
69
+ if (field.defaultValue !== void 0) {
70
+ setValueAtPath(accumulator, field.name, clonePlainValue(field.defaultValue));
71
+ }
72
+ return accumulator;
73
+ }, {});
74
+ return deepMerge(fieldDefaults, clonePlainValue(userDefaults));
75
+ }
76
+ function expandFieldTemplatePaths(values, fieldTemplatePath) {
77
+ return expandTemplatePaths(values, fieldTemplatePath, false);
78
+ }
79
+ function expandContainerParentPaths(values, fieldTemplatePath) {
80
+ return expandTemplatePaths(values, fieldTemplatePath, true);
81
+ }
82
+ function expandTemplatePaths(values, fieldTemplatePath, expandTerminalArrays) {
83
+ const parts = fieldTemplatePath.split(".");
84
+ const paths = [];
85
+ let expandedArray = false;
86
+ function traverse(obj, currentParts, remainingParts) {
87
+ if (remainingParts.length === 0) {
88
+ paths.push(currentParts.join("."));
89
+ return;
90
+ }
91
+ const [nextPart, ...rest] = remainingParts;
92
+ if (isReservedPathKey(nextPart)) {
93
+ return;
94
+ }
95
+ if (obj === null || obj === void 0 || typeof obj !== "object" || !Object.hasOwn(obj, nextPart)) {
96
+ paths.push([...currentParts, ...remainingParts].join("."));
97
+ return;
98
+ }
99
+ const nextValue = obj[nextPart];
100
+ if (Array.isArray(nextValue)) {
101
+ if (rest.length === 0 && !expandTerminalArrays) {
102
+ paths.push([...currentParts, nextPart].join("."));
103
+ return;
104
+ }
105
+ expandedArray = true;
106
+ for (let index = 0; index < nextValue.length; index += 1) {
107
+ traverse(nextValue[index], [...currentParts, nextPart, String(index)], rest);
108
+ }
109
+ return;
110
+ }
111
+ if (nextValue !== void 0) {
112
+ traverse(nextValue, [...currentParts, nextPart], rest);
113
+ } else {
114
+ paths.push([...currentParts, nextPart, ...rest].join("."));
115
+ }
116
+ }
117
+ traverse(values, [], parts);
118
+ return paths.length > 0 ? paths : expandedArray ? [] : [fieldTemplatePath];
119
+ }
120
+ function clonePlainValue(value) {
121
+ if (Array.isArray(value)) {
122
+ return value.map(clonePlainValue);
123
+ }
124
+ if (value && typeof value === "object") {
125
+ const proto = Object.getPrototypeOf(value);
126
+ if (proto === Object.prototype || proto === null) {
127
+ const copy = createValueObject();
128
+ for (const [key, child] of Object.entries(value)) {
129
+ if (isReservedPathKey(key)) {
130
+ continue;
131
+ }
132
+ copy[key] = clonePlainValue(child);
133
+ }
134
+ return copy;
135
+ }
136
+ }
137
+ return value;
138
+ }
139
+ function deepMerge(base, override) {
140
+ if (Array.isArray(base) && Array.isArray(override)) {
141
+ return override.map((value, index) => deepMerge(base[index], value));
142
+ }
143
+ if (isPlainObject(base) && isPlainObject(override)) {
144
+ const result = createValueObject();
145
+ for (const [key, value] of Object.entries(base)) {
146
+ if (!isReservedPathKey(key)) {
147
+ result[key] = value;
148
+ }
149
+ }
150
+ for (const [key, value] of Object.entries(override)) {
151
+ if (isReservedPathKey(key)) {
152
+ continue;
153
+ }
154
+ result[key] = Object.hasOwn(result, key) ? deepMerge(result[key], value) : value;
155
+ }
156
+ return result;
157
+ }
158
+ return override === void 0 ? base : override;
159
+ }
160
+ function templatePath(path) {
161
+ return path.split(".").filter((segment) => !/^\d+$/.test(segment)).join(".");
162
+ }
163
+
164
+ export {
165
+ getValueAtPath,
166
+ setValueAtPath,
167
+ withoutValueAt,
168
+ mergePathValues,
169
+ expandFieldTemplatePaths,
170
+ expandContainerParentPaths,
171
+ clonePlainValue,
172
+ templatePath
173
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lib/path-values.ts"],
4
+ "sourcesContent": ["import { isPlainObject } from './is-plain-object.js';\nimport { assertWritablePathKey, isReservedPathKey } from './reserved-path-keys.js';\n/**\n * Nested value-tree helpers shared by React and Radiant adapters.\n * Field *names* are composed in {@link ./field-scope.ts}; this module reads and writes values.\n */\n\nfunction createValueObject(): Record<string, unknown> {\n\treturn Object.create(null) as Record<string, unknown>;\n}\n\nexport function getValueAtPath<TValue = unknown>(input: unknown, path: string): TValue | undefined {\n\tif (!path) {\n\t\treturn input as TValue;\n\t}\n\n\treturn path.split('.').reduce<unknown>((current, segment) => {\n\t\tif (current === null || current === undefined || isReservedPathKey(segment)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn Object.hasOwn(current as object, segment) ? (current as Record<string, unknown>)[segment] : undefined;\n\t}, input) as TValue | undefined;\n}\n\n/**\n * Materialize a dotted path into an object or array-backed structure.\n * Intermediate containers are created on demand using the next path segment to\n * decide whether the shape should be an object or an array.\n */\nexport function setValueAtPath(target: Record<string, unknown>, path: string, value: unknown): Record<string, unknown> {\n\tif (!path) {\n\t\treturn target;\n\t}\n\n\tconst segments = path.split('.');\n\tlet current: Record<string, unknown> = target;\n\n\tfor (let index = 0; index < segments.length; index += 1) {\n\t\tconst segment = segments[index];\n\t\tassertWritablePathKey(segment);\n\t\tconst isLeaf = index === segments.length - 1;\n\n\t\tif (isLeaf) {\n\t\t\tcurrent[segment] = value;\n\t\t\tbreak;\n\t\t}\n\n\t\tconst nextSegment = segments[index + 1];\n\t\tconst nextIsIndex = /^\\d+$/.test(nextSegment);\n\t\tconst existing = current[segment];\n\n\t\tif (Array.isArray(existing)) {\n\t\t\tcurrent = existing as unknown as Record<string, unknown>;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (existing && typeof existing === 'object') {\n\t\t\tcurrent = existing as Record<string, unknown>;\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst container: Record<string, unknown> | unknown[] = nextIsIndex ? [] : createValueObject();\n\t\tcurrent[segment] = container;\n\t\tcurrent = container as Record<string, unknown>;\n\t}\n\n\treturn target;\n}\n\n/**\n * A copy of `values` with the value at `path` absent, sharing every branch it does not touch.\n *\n * @remarks Returns `values` itself when nothing is at the path. Arrays stay arrays, so the rows around the one cleared keep their indexes.\n */\nexport function withoutValueAt(values: unknown, path: string): unknown {\n\tconst [head, ...rest] = path.split('.');\n\tif (head === undefined || values === null || typeof values !== 'object' || !Object.hasOwn(values, head)) {\n\t\treturn values;\n\t}\n\tconst current: unknown = Reflect.get(values, head);\n\tconst next = rest.length === 0 ? undefined : withoutValueAt(current, rest.join('.'));\n\tif (Object.is(next, current)) return values;\n\tconst copy: unknown = Array.isArray(values) ? [...values] : { ...values };\n\tif (typeof copy === 'object' && copy !== null) Reflect.set(copy, head, next);\n\treturn copy;\n}\n\n/**\n * Build adapter default values from field-level defaults and merge them with\n * consumer-provided defaults using nested path semantics.\n *\n * @remarks\n * Config snapshots are frozen. Defaults are cloned into a mutable value tree\n * before nested writes so parent objects are never mutated in place.\n */\nexport function mergePathValues(\n\tfields: readonly { name: string; defaultValue?: unknown }[],\n\tuserDefaults: Record<string, unknown> = {},\n): Record<string, unknown> {\n\tconst fieldDefaults = fields.reduce<Record<string, unknown>>((accumulator, field) => {\n\t\tif (field.defaultValue !== undefined) {\n\t\t\tsetValueAtPath(accumulator, field.name, clonePlainValue(field.defaultValue));\n\t\t}\n\t\treturn accumulator;\n\t}, {});\n\n\treturn deepMerge(fieldDefaults, clonePlainValue(userDefaults)) as Record<string, unknown>;\n}\n\n/**\n * Resolve a field path through live array rows while keeping an array at the field itself intact.\n *\n * @remarks\n * An empty parent array produces no child paths; a field whose value is an empty array still returns its own path.\n */\nexport function expandFieldTemplatePaths(values: Record<string, unknown>, fieldTemplatePath: string): string[] {\n\treturn expandTemplatePaths(values, fieldTemplatePath, false);\n}\n\n/**\n * Expand a container's parent path through each live array row, including an array at the path's end.\n */\nexport function expandContainerParentPaths(values: Record<string, unknown>, fieldTemplatePath: string): string[] {\n\treturn expandTemplatePaths(values, fieldTemplatePath, true);\n}\n\nfunction expandTemplatePaths(\n\tvalues: Record<string, unknown>,\n\tfieldTemplatePath: string,\n\texpandTerminalArrays: boolean,\n): string[] {\n\tconst parts = fieldTemplatePath.split('.');\n\tconst paths: string[] = [];\n\tlet expandedArray = false;\n\n\tfunction traverse(obj: unknown, currentParts: string[], remainingParts: string[]): void {\n\t\tif (remainingParts.length === 0) {\n\t\t\tpaths.push(currentParts.join('.'));\n\t\t\treturn;\n\t\t}\n\n\t\tconst [nextPart, ...rest] = remainingParts;\n\t\tif (isReservedPathKey(nextPart)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (obj === null || obj === undefined || typeof obj !== 'object' || !Object.hasOwn(obj, nextPart)) {\n\t\t\tpaths.push([...currentParts, ...remainingParts].join('.'));\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextValue = (obj as Record<string, unknown>)[nextPart];\n\n\t\tif (Array.isArray(nextValue)) {\n\t\t\tif (rest.length === 0 && !expandTerminalArrays) {\n\t\t\t\tpaths.push([...currentParts, nextPart].join('.'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\texpandedArray = true;\n\t\t\tfor (let index = 0; index < nextValue.length; index += 1) {\n\t\t\t\ttraverse(nextValue[index], [...currentParts, nextPart, String(index)], rest);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (nextValue !== undefined) {\n\t\t\ttraverse(nextValue, [...currentParts, nextPart], rest);\n\t\t} else {\n\t\t\tpaths.push([...currentParts, nextPart, ...rest].join('.'));\n\t\t}\n\t}\n\n\ttraverse(values, [], parts);\n\treturn paths.length > 0 ? paths : expandedArray ? [] : [fieldTemplatePath];\n}\n\n/** Deep copy of plain objects and arrays into null-prototype value maps, skipping reserved path keys. */\nexport function clonePlainValue(value: unknown): unknown {\n\tif (Array.isArray(value)) {\n\t\treturn value.map(clonePlainValue);\n\t}\n\n\tif (value && typeof value === 'object') {\n\t\tconst proto = Object.getPrototypeOf(value);\n\t\tif (proto === Object.prototype || proto === null) {\n\t\t\tconst copy = createValueObject();\n\t\t\tfor (const [key, child] of Object.entries(value)) {\n\t\t\t\tif (isReservedPathKey(key)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tcopy[key] = clonePlainValue(child);\n\t\t\t}\n\t\t\treturn copy;\n\t\t}\n\t}\n\n\treturn value;\n}\n\nfunction deepMerge(base: unknown, override: unknown): unknown {\n\tif (Array.isArray(base) && Array.isArray(override)) {\n\t\treturn override.map((value, index) => deepMerge(base[index], value));\n\t}\n\n\tif (isPlainObject(base) && isPlainObject(override)) {\n\t\tconst result = createValueObject();\n\t\tfor (const [key, value] of Object.entries(base)) {\n\t\t\tif (!isReservedPathKey(key)) {\n\t\t\t\tresult[key] = value;\n\t\t\t}\n\t\t}\n\t\tfor (const [key, value] of Object.entries(override)) {\n\t\t\tif (isReservedPathKey(key)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tresult[key] = Object.hasOwn(result, key) ? deepMerge(result[key], value) : value;\n\t\t}\n\t\treturn result;\n\t}\n\n\treturn override === undefined ? base : override;\n}\n\n/**\n * Drops array indices from a rendered field path.\n *\n * @remarks\n * Constraint metadata collection walks the config, where array length is\n * unknown, so it records the authored template (`contacts.email`). The renderer\n * emits the composed path (`contacts.0.email`).\n */\nexport function templatePath(path: string): string {\n\treturn path\n\t\t.split('.')\n\t\t.filter((segment) => !/^\\d+$/.test(segment))\n\t\t.join('.');\n}\n"],
5
+ "mappings": ";;;;;;;;;AAOA,SAAS,oBAA6C;AACrD,SAAO,uBAAO,OAAO,IAAI;AAC1B;AAEO,SAAS,eAAiC,OAAgB,MAAkC;AAClG,MAAI,CAAC,MAAM;AACV,WAAO;AAAA,EACR;AAEA,SAAO,KAAK,MAAM,GAAG,EAAE,OAAgB,CAAC,SAAS,YAAY;AAC5D,QAAI,YAAY,QAAQ,YAAY,UAAa,kBAAkB,OAAO,GAAG;AAC5E,aAAO;AAAA,IACR;AAEA,WAAO,OAAO,OAAO,SAAmB,OAAO,IAAK,QAAoC,OAAO,IAAI;AAAA,EACpG,GAAG,KAAK;AACT;AAOO,SAAS,eAAe,QAAiC,MAAc,OAAyC;AACtH,MAAI,CAAC,MAAM;AACV,WAAO;AAAA,EACR;AAEA,QAAM,WAAW,KAAK,MAAM,GAAG;AAC/B,MAAI,UAAmC;AAEvC,WAAS,QAAQ,GAAG,QAAQ,SAAS,QAAQ,SAAS,GAAG;AACxD,UAAM,UAAU,SAAS,KAAK;AAC9B,0BAAsB,OAAO;AAC7B,UAAM,SAAS,UAAU,SAAS,SAAS;AAE3C,QAAI,QAAQ;AACX,cAAQ,OAAO,IAAI;AACnB;AAAA,IACD;AAEA,UAAM,cAAc,SAAS,QAAQ,CAAC;AACtC,UAAM,cAAc,QAAQ,KAAK,WAAW;AAC5C,UAAM,WAAW,QAAQ,OAAO;AAEhC,QAAI,MAAM,QAAQ,QAAQ,GAAG;AAC5B,gBAAU;AACV;AAAA,IACD;AAEA,QAAI,YAAY,OAAO,aAAa,UAAU;AAC7C,gBAAU;AACV;AAAA,IACD;AAEA,UAAM,YAAiD,cAAc,CAAC,IAAI,kBAAkB;AAC5F,YAAQ,OAAO,IAAI;AACnB,cAAU;AAAA,EACX;AAEA,SAAO;AACR;AAOO,SAAS,eAAe,QAAiB,MAAuB;AACtE,QAAM,CAAC,MAAM,GAAG,IAAI,IAAI,KAAK,MAAM,GAAG;AACtC,MAAI,SAAS,UAAa,WAAW,QAAQ,OAAO,WAAW,YAAY,CAAC,OAAO,OAAO,QAAQ,IAAI,GAAG;AACxG,WAAO;AAAA,EACR;AACA,QAAM,UAAmB,QAAQ,IAAI,QAAQ,IAAI;AACjD,QAAM,OAAO,KAAK,WAAW,IAAI,SAAY,eAAe,SAAS,KAAK,KAAK,GAAG,CAAC;AACnF,MAAI,OAAO,GAAG,MAAM,OAAO,EAAG,QAAO;AACrC,QAAM,OAAgB,MAAM,QAAQ,MAAM,IAAI,CAAC,GAAG,MAAM,IAAI,EAAE,GAAG,OAAO;AACxE,MAAI,OAAO,SAAS,YAAY,SAAS,KAAM,SAAQ,IAAI,MAAM,MAAM,IAAI;AAC3E,SAAO;AACR;AAUO,SAAS,gBACf,QACA,eAAwC,CAAC,GACf;AAC1B,QAAM,gBAAgB,OAAO,OAAgC,CAAC,aAAa,UAAU;AACpF,QAAI,MAAM,iBAAiB,QAAW;AACrC,qBAAe,aAAa,MAAM,MAAM,gBAAgB,MAAM,YAAY,CAAC;AAAA,IAC5E;AACA,WAAO;AAAA,EACR,GAAG,CAAC,CAAC;AAEL,SAAO,UAAU,eAAe,gBAAgB,YAAY,CAAC;AAC9D;AAQO,SAAS,yBAAyB,QAAiC,mBAAqC;AAC9G,SAAO,oBAAoB,QAAQ,mBAAmB,KAAK;AAC5D;AAKO,SAAS,2BAA2B,QAAiC,mBAAqC;AAChH,SAAO,oBAAoB,QAAQ,mBAAmB,IAAI;AAC3D;AAEA,SAAS,oBACR,QACA,mBACA,sBACW;AACX,QAAM,QAAQ,kBAAkB,MAAM,GAAG;AACzC,QAAM,QAAkB,CAAC;AACzB,MAAI,gBAAgB;AAEpB,WAAS,SAAS,KAAc,cAAwB,gBAAgC;AACvF,QAAI,eAAe,WAAW,GAAG;AAChC,YAAM,KAAK,aAAa,KAAK,GAAG,CAAC;AACjC;AAAA,IACD;AAEA,UAAM,CAAC,UAAU,GAAG,IAAI,IAAI;AAC5B,QAAI,kBAAkB,QAAQ,GAAG;AAChC;AAAA,IACD;AAEA,QAAI,QAAQ,QAAQ,QAAQ,UAAa,OAAO,QAAQ,YAAY,CAAC,OAAO,OAAO,KAAK,QAAQ,GAAG;AAClG,YAAM,KAAK,CAAC,GAAG,cAAc,GAAG,cAAc,EAAE,KAAK,GAAG,CAAC;AACzD;AAAA,IACD;AAEA,UAAM,YAAa,IAAgC,QAAQ;AAE3D,QAAI,MAAM,QAAQ,SAAS,GAAG;AAC7B,UAAI,KAAK,WAAW,KAAK,CAAC,sBAAsB;AAC/C,cAAM,KAAK,CAAC,GAAG,cAAc,QAAQ,EAAE,KAAK,GAAG,CAAC;AAChD;AAAA,MACD;AAEA,sBAAgB;AAChB,eAAS,QAAQ,GAAG,QAAQ,UAAU,QAAQ,SAAS,GAAG;AACzD,iBAAS,UAAU,KAAK,GAAG,CAAC,GAAG,cAAc,UAAU,OAAO,KAAK,CAAC,GAAG,IAAI;AAAA,MAC5E;AACA;AAAA,IACD;AAEA,QAAI,cAAc,QAAW;AAC5B,eAAS,WAAW,CAAC,GAAG,cAAc,QAAQ,GAAG,IAAI;AAAA,IACtD,OAAO;AACN,YAAM,KAAK,CAAC,GAAG,cAAc,UAAU,GAAG,IAAI,EAAE,KAAK,GAAG,CAAC;AAAA,IAC1D;AAAA,EACD;AAEA,WAAS,QAAQ,CAAC,GAAG,KAAK;AAC1B,SAAO,MAAM,SAAS,IAAI,QAAQ,gBAAgB,CAAC,IAAI,CAAC,iBAAiB;AAC1E;AAGO,SAAS,gBAAgB,OAAyB;AACxD,MAAI,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAO,MAAM,IAAI,eAAe;AAAA,EACjC;AAEA,MAAI,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,QAAQ,OAAO,eAAe,KAAK;AACzC,QAAI,UAAU,OAAO,aAAa,UAAU,MAAM;AACjD,YAAM,OAAO,kBAAkB;AAC/B,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AACjD,YAAI,kBAAkB,GAAG,GAAG;AAC3B;AAAA,QACD;AACA,aAAK,GAAG,IAAI,gBAAgB,KAAK;AAAA,MAClC;AACA,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;AAEA,SAAS,UAAU,MAAe,UAA4B;AAC7D,MAAI,MAAM,QAAQ,IAAI,KAAK,MAAM,QAAQ,QAAQ,GAAG;AACnD,WAAO,SAAS,IAAI,CAAC,OAAO,UAAU,UAAU,KAAK,KAAK,GAAG,KAAK,CAAC;AAAA,EACpE;AAEA,MAAI,cAAc,IAAI,KAAK,cAAc,QAAQ,GAAG;AACnD,UAAM,SAAS,kBAAkB;AACjC,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAAG;AAChD,UAAI,CAAC,kBAAkB,GAAG,GAAG;AAC5B,eAAO,GAAG,IAAI;AAAA,MACf;AAAA,IACD;AACA,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,QAAQ,GAAG;AACpD,UAAI,kBAAkB,GAAG,GAAG;AAC3B;AAAA,MACD;AACA,aAAO,GAAG,IAAI,OAAO,OAAO,QAAQ,GAAG,IAAI,UAAU,OAAO,GAAG,GAAG,KAAK,IAAI;AAAA,IAC5E;AACA,WAAO;AAAA,EACR;AAEA,SAAO,aAAa,SAAY,OAAO;AACxC;AAUO,SAAS,aAAa,MAAsB;AAClD,SAAO,KACL,MAAM,GAAG,EACT,OAAO,CAAC,YAAY,CAAC,QAAQ,KAAK,OAAO,CAAC,EAC1C,KAAK,GAAG;AACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,85 @@
1
+ import {
2
+ logger
3
+ } from "./chunk-VGGERKV2.js";
4
+
5
+ // src/actions/plugins/notification.plugin.ts
6
+ import * as z from "zod/mini";
7
+ var NotificationActionSchema = z.object({
8
+ /** Optional description for documentation and debugging purposes */
9
+ description: z.optional(z.string()),
10
+ /** Message to display in the notification */
11
+ message: z.string().check(z.minLength(1, "Message cannot be empty")),
12
+ /** Visual style of the notification */
13
+ variant: z._default(z.enum(["success", "error", "warning", "info"]), "info"),
14
+ /** Duration in milliseconds to show the notification (0 = permanent) */
15
+ duration: z.optional(z._default(z.number().check(z.gte(0)), 3e3))
16
+ });
17
+ function notificationPlugin(config = {}) {
18
+ const handler = async (context) => {
19
+ const action = context.config;
20
+ try {
21
+ const { message, variant } = action;
22
+ if (config.onNotification) {
23
+ await config.onNotification(message, variant, context);
24
+ } else {
25
+ switch (variant) {
26
+ case "success":
27
+ if (config.onSuccess) {
28
+ await config.onSuccess(message, context);
29
+ } else {
30
+ logger.info("success", { formId: context.formId, message });
31
+ }
32
+ break;
33
+ case "error":
34
+ if (config.onError) {
35
+ await config.onError(message, context);
36
+ } else {
37
+ logger.error("error", { formId: context.formId, message });
38
+ }
39
+ break;
40
+ case "warning":
41
+ if (config.onWarning) {
42
+ await config.onWarning(message, context);
43
+ } else {
44
+ logger.warn("warning", { formId: context.formId, message });
45
+ }
46
+ break;
47
+ case "info":
48
+ if (config.onInfo) {
49
+ await config.onInfo(message, context);
50
+ } else {
51
+ logger.info("info", { formId: context.formId, message });
52
+ }
53
+ break;
54
+ }
55
+ }
56
+ return {
57
+ success: true,
58
+ message: `Notification '${message}' shown`,
59
+ shouldContinue: true
60
+ };
61
+ } catch (error) {
62
+ return {
63
+ success: false,
64
+ error: error instanceof Error ? error.message : "Failed to show notification",
65
+ shouldContinue: true
66
+ };
67
+ }
68
+ };
69
+ return {
70
+ $type: "show_notification",
71
+ schema: NotificationActionSchema,
72
+ metadata: {
73
+ name: "Show Notification",
74
+ description: "Display notifications to users with different variants",
75
+ icon: "bell",
76
+ defaultTriggers: ["form_submit_success", "form_submit_error"]
77
+ },
78
+ execute: handler
79
+ };
80
+ }
81
+
82
+ export {
83
+ NotificationActionSchema,
84
+ notificationPlugin
85
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/actions/plugins/notification.plugin.ts"],
4
+ "sourcesContent": ["import * as z from 'zod/mini';\nimport type { BuilderActionRuntimeContext, BuilderActionRegistration, BuilderActionConfig } from '@/types';\nimport { logger } from '@/lib/logger';\n\n/**\n * Notification Plugin Configuration\n */\nexport interface NotificationPluginConfig {\n\t/** Custom success handler */\n\tonSuccess?: (message: string, context: BuilderActionRuntimeContext<NotificationAction>) => void | Promise<void>;\n\t/** Custom error handler */\n\tonError?: (message: string, context: BuilderActionRuntimeContext<NotificationAction>) => void | Promise<void>;\n\t/** Custom warning handler */\n\tonWarning?: (message: string, context: BuilderActionRuntimeContext<NotificationAction>) => void | Promise<void>;\n\t/** Custom info handler */\n\tonInfo?: (message: string, context: BuilderActionRuntimeContext<NotificationAction>) => void | Promise<void>;\n\t/** Global handler for all notification types */\n\tonNotification?: (\n\t\tmessage: string,\n\t\tvariant: NotificationAction['variant'],\n\t\tcontext: BuilderActionRuntimeContext<NotificationAction>,\n\t) => void | Promise<void>;\n}\n\n/** Schema for the `show_notification` action configuration. */\nexport const NotificationActionSchema = z.object({\n\t/** Optional description for documentation and debugging purposes */\n\tdescription: z.optional(z.string()),\n\t/** Message to display in the notification */\n\tmessage: z.string().check(z.minLength(1, 'Message cannot be empty')),\n\t/** Visual style of the notification */\n\tvariant: z._default(z.enum(['success', 'error', 'warning', 'info']), 'info'),\n\t/** Duration in milliseconds to show the notification (0 = permanent) */\n\tduration: z.optional(z._default(z.number().check(z.gte(0)), 3000)),\n});\n\nexport type NotificationAction = BuilderActionConfig<'show_notification', typeof NotificationActionSchema>;\n\n/** Creates a configured `show_notification` action registration. */\nexport function notificationPlugin(\n\tconfig: NotificationPluginConfig = {},\n): BuilderActionRegistration<'show_notification', typeof NotificationActionSchema> {\n\tconst handler = async (context: BuilderActionRuntimeContext<NotificationAction>) => {\n\t\tconst action = context.config;\n\n\t\ttry {\n\t\t\tconst { message, variant } = action;\n\n\t\t\tif (config.onNotification) {\n\t\t\t\tawait config.onNotification(message, variant, context);\n\t\t\t} else {\n\t\t\t\tswitch (variant) {\n\t\t\t\t\tcase 'success':\n\t\t\t\t\t\tif (config.onSuccess) {\n\t\t\t\t\t\t\tawait config.onSuccess(message, context);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.info('success', { formId: context.formId, message });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\tif (config.onError) {\n\t\t\t\t\t\t\tawait config.onError(message, context);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.error('error', { formId: context.formId, message });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'warning':\n\t\t\t\t\t\tif (config.onWarning) {\n\t\t\t\t\t\t\tawait config.onWarning(message, context);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.warn('warning', { formId: context.formId, message });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'info':\n\t\t\t\t\t\tif (config.onInfo) {\n\t\t\t\t\t\t\tawait config.onInfo(message, context);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.info('info', { formId: context.formId, message });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tmessage: `Notification '${message}' shown`,\n\t\t\t\tshouldContinue: true,\n\t\t\t};\n\t\t} catch (error) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: error instanceof Error ? error.message : 'Failed to show notification',\n\t\t\t\tshouldContinue: true,\n\t\t\t};\n\t\t}\n\t};\n\n\treturn {\n\t\t$type: 'show_notification',\n\t\tschema: NotificationActionSchema,\n\t\tmetadata: {\n\t\t\tname: 'Show Notification',\n\t\t\tdescription: 'Display notifications to users with different variants',\n\t\t\ticon: 'bell',\n\t\t\tdefaultTriggers: ['form_submit_success', 'form_submit_error'],\n\t\t},\n\t\texecute: handler,\n\t};\n}\n"],
5
+ "mappings": ";;;;;AAAA,YAAY,OAAO;AAyBZ,IAAM,2BAA6B,SAAO;AAAA;AAAA,EAEhD,aAAe,WAAW,SAAO,CAAC;AAAA;AAAA,EAElC,SAAW,SAAO,EAAE,MAAQ,YAAU,GAAG,yBAAyB,CAAC;AAAA;AAAA,EAEnE,SAAW,WAAW,OAAK,CAAC,WAAW,SAAS,WAAW,MAAM,CAAC,GAAG,MAAM;AAAA;AAAA,EAE3E,UAAY,WAAW,WAAW,SAAO,EAAE,MAAQ,MAAI,CAAC,CAAC,GAAG,GAAI,CAAC;AAClE,CAAC;AAKM,SAAS,mBACf,SAAmC,CAAC,GAC8C;AAClF,QAAM,UAAU,OAAO,YAA6D;AACnF,UAAM,SAAS,QAAQ;AAEvB,QAAI;AACH,YAAM,EAAE,SAAS,QAAQ,IAAI;AAE7B,UAAI,OAAO,gBAAgB;AAC1B,cAAM,OAAO,eAAe,SAAS,SAAS,OAAO;AAAA,MACtD,OAAO;AACN,gBAAQ,SAAS;AAAA,UAChB,KAAK;AACJ,gBAAI,OAAO,WAAW;AACrB,oBAAM,OAAO,UAAU,SAAS,OAAO;AAAA,YACxC,OAAO;AACN,qBAAO,KAAK,WAAW,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,CAAC;AAAA,YAC3D;AACA;AAAA,UACD,KAAK;AACJ,gBAAI,OAAO,SAAS;AACnB,oBAAM,OAAO,QAAQ,SAAS,OAAO;AAAA,YACtC,OAAO;AACN,qBAAO,MAAM,SAAS,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,CAAC;AAAA,YAC1D;AACA;AAAA,UACD,KAAK;AACJ,gBAAI,OAAO,WAAW;AACrB,oBAAM,OAAO,UAAU,SAAS,OAAO;AAAA,YACxC,OAAO;AACN,qBAAO,KAAK,WAAW,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,CAAC;AAAA,YAC3D;AACA;AAAA,UACD,KAAK;AACJ,gBAAI,OAAO,QAAQ;AAClB,oBAAM,OAAO,OAAO,SAAS,OAAO;AAAA,YACrC,OAAO;AACN,qBAAO,KAAK,QAAQ,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,CAAC;AAAA,YACxD;AACA;AAAA,QACF;AAAA,MACD;AAEA,aAAO;AAAA,QACN,SAAS;AAAA,QACT,SAAS,iBAAiB,OAAO;AAAA,QACjC,gBAAgB;AAAA,MACjB;AAAA,IACD,SAAS,OAAO;AACf,aAAO;AAAA,QACN,SAAS;AAAA,QACT,OAAO,iBAAiB,QAAQ,MAAM,UAAU;AAAA,QAChD,gBAAgB;AAAA,MACjB;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,MACT,MAAM;AAAA,MACN,aAAa;AAAA,MACb,MAAM;AAAA,MACN,iBAAiB,CAAC,uBAAuB,mBAAmB;AAAA,IAC7D;AAAA,IACA,SAAS;AAAA,EACV;AACD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,43 @@
1
+ import {
2
+ isWithin
3
+ } from "./chunk-K5TMXCMY.js";
4
+
5
+ // src/state-container/stale-results.ts
6
+ function createRunTracker() {
7
+ let seq = 0;
8
+ let epoch = 0;
9
+ const pending = /* @__PURE__ */ new Set();
10
+ let requests = [];
11
+ return {
12
+ start(scope, exact) {
13
+ const run = { seq: ++seq, epoch };
14
+ pending.add(run);
15
+ requests.push({ seq: run.seq, scope, exact });
16
+ return run;
17
+ },
18
+ reset() {
19
+ epoch += 1;
20
+ },
21
+ epoch: () => epoch,
22
+ outdated: (run) => run.epoch !== epoch,
23
+ finish(run) {
24
+ pending.delete(run);
25
+ if (pending.size === 0) requests = [];
26
+ },
27
+ superseded(run, path, resolve) {
28
+ if (run.epoch !== epoch) return true;
29
+ return requests.some((request) => {
30
+ if (request.seq <= run.seq) return false;
31
+ if (!request.scope) return true;
32
+ return request.scope.some((anchor) => {
33
+ const asked = resolve(anchor);
34
+ return asked !== void 0 && (request.exact ? asked === path : isWithin(path, asked));
35
+ });
36
+ });
37
+ }
38
+ };
39
+ }
40
+
41
+ export {
42
+ createRunTracker
43
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/state-container/stale-results.ts"],
4
+ "sourcesContent": ["import type { RowAnchor } from './row-ids';\nimport { isWithin } from './value-tree';\n\n/** One recorded validation, as the tracker sees it. */\nexport interface ValidationRun {\n\treadonly seq: number;\n\treadonly epoch: number;\n}\n\n/**\n * Decides whether a recorded validation result is overtaken by something that is not a value change.\n *\n * @remarks\n * A result is superseded for a path when a validation that started later asked for that path, which is\n * \"the latest requester wins\", or when the form was reset after the run started. What a validation asked\n * for is kept as row anchors, and resolved against the rows as they are when the question is asked, so\n * the answer follows rows that moved. Values, dependencies and rows are the container's to check.\n */\nexport interface RunTracker {\n\t/** `scope` is what the run asked for, as anchors; `undefined` is the whole form. */\n\tstart(scope: readonly RowAnchor[] | undefined, exact: boolean): ValidationRun;\n\treset(): void;\n\t/** How many resets there have been: a number a submission keeps to tell whether the form was reset after it began. */\n\tepoch(): number;\n\t/** Whether the form was reset after `run` started: everything the run found is then moot. */\n\toutdated(run: ValidationRun): boolean;\n\tfinish(run: ValidationRun): void;\n\t/** `resolve` finds the path an anchor has now, or `undefined` when its rows are gone. */\n\tsuperseded(run: ValidationRun, path: string, resolve: (anchor: RowAnchor) => string | undefined): boolean;\n}\n\ninterface Request {\n\treadonly seq: number;\n\treadonly scope: readonly RowAnchor[] | undefined;\n\treadonly exact: boolean;\n}\n\nexport function createRunTracker(): RunTracker {\n\tlet seq = 0;\n\tlet epoch = 0;\n\tconst pending = new Set<ValidationRun>();\n\tlet requests: Request[] = [];\n\n\treturn {\n\t\tstart(scope, exact) {\n\t\t\tconst run = { seq: ++seq, epoch };\n\t\t\tpending.add(run);\n\t\t\trequests.push({ seq: run.seq, scope, exact });\n\t\t\treturn run;\n\t\t},\n\t\treset() {\n\t\t\tepoch += 1;\n\t\t},\n\t\tepoch: () => epoch,\n\t\toutdated: (run) => run.epoch !== epoch,\n\t\tfinish(run) {\n\t\t\tpending.delete(run);\n\t\t\tif (pending.size === 0) requests = [];\n\t\t},\n\t\tsuperseded(run, path, resolve) {\n\t\t\tif (run.epoch !== epoch) return true;\n\t\t\treturn requests.some((request) => {\n\t\t\t\tif (request.seq <= run.seq) return false;\n\t\t\t\tif (!request.scope) return true;\n\t\t\t\treturn request.scope.some((anchor) => {\n\t\t\t\t\tconst asked = resolve(anchor);\n\t\t\t\t\treturn asked !== undefined && (request.exact ? asked === path : isWithin(path, asked));\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t};\n}\n"],
5
+ "mappings": ";;;;;AAqCO,SAAS,mBAA+B;AAC9C,MAAI,MAAM;AACV,MAAI,QAAQ;AACZ,QAAM,UAAU,oBAAI,IAAmB;AACvC,MAAI,WAAsB,CAAC;AAE3B,SAAO;AAAA,IACN,MAAM,OAAO,OAAO;AACnB,YAAM,MAAM,EAAE,KAAK,EAAE,KAAK,MAAM;AAChC,cAAQ,IAAI,GAAG;AACf,eAAS,KAAK,EAAE,KAAK,IAAI,KAAK,OAAO,MAAM,CAAC;AAC5C,aAAO;AAAA,IACR;AAAA,IACA,QAAQ;AACP,eAAS;AAAA,IACV;AAAA,IACA,OAAO,MAAM;AAAA,IACb,UAAU,CAAC,QAAQ,IAAI,UAAU;AAAA,IACjC,OAAO,KAAK;AACX,cAAQ,OAAO,GAAG;AAClB,UAAI,QAAQ,SAAS,EAAG,YAAW,CAAC;AAAA,IACrC;AAAA,IACA,WAAW,KAAK,MAAM,SAAS;AAC9B,UAAI,IAAI,UAAU,MAAO,QAAO;AAChC,aAAO,SAAS,KAAK,CAAC,YAAY;AACjC,YAAI,QAAQ,OAAO,IAAI,IAAK,QAAO;AACnC,YAAI,CAAC,QAAQ,MAAO,QAAO;AAC3B,eAAO,QAAQ,MAAM,KAAK,CAAC,WAAW;AACrC,gBAAM,QAAQ,QAAQ,MAAM;AAC5B,iBAAO,UAAU,WAAc,QAAQ,QAAQ,UAAU,OAAO,SAAS,MAAM,KAAK;AAAA,QACrF,CAAC;AAAA,MACF,CAAC;AAAA,IACF;AAAA,EACD;AACD;",
6
+ "names": []
7
+ }