@nanoforge-dev/editor 0.0.2-beta.8c768e4 → 0.0.2-beta.d1c5eea

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 (317) hide show
  1. package/dist/client/_app/immutable/assets/0.Chsihp2s.css +1 -0
  2. package/dist/client/_app/immutable/assets/0.Chsihp2s.css.br +0 -0
  3. package/dist/client/_app/immutable/assets/0.Chsihp2s.css.gz +0 -0
  4. package/dist/client/_app/immutable/chunks/BAmaB5-w.js +6 -0
  5. package/dist/client/_app/immutable/chunks/BAmaB5-w.js.br +0 -0
  6. package/dist/client/_app/immutable/chunks/BAmaB5-w.js.gz +0 -0
  7. package/dist/client/_app/immutable/chunks/{BpsTeBMk2.js → BFWbalF82.js} +1 -1
  8. package/dist/client/_app/immutable/chunks/BFWbalF82.js.br +0 -0
  9. package/dist/client/_app/immutable/chunks/BFWbalF82.js.gz +0 -0
  10. package/dist/client/_app/immutable/chunks/BJ5-01Xz.js +1 -0
  11. package/dist/client/_app/immutable/chunks/BJ5-01Xz.js.br +0 -0
  12. package/dist/client/_app/immutable/chunks/BJ5-01Xz.js.gz +0 -0
  13. package/dist/client/_app/immutable/chunks/{D8HnIxQ42.js → BLf9jss52.js} +1 -1
  14. package/dist/client/_app/immutable/chunks/BLf9jss52.js.br +0 -0
  15. package/dist/client/_app/immutable/chunks/BLf9jss52.js.gz +0 -0
  16. package/dist/client/_app/immutable/chunks/{BNmi28p2.js → BQ4F9eo1.js} +1 -1
  17. package/dist/client/_app/immutable/chunks/BQ4F9eo1.js.br +2 -0
  18. package/dist/client/_app/immutable/chunks/BQ4F9eo1.js.gz +0 -0
  19. package/dist/client/_app/immutable/chunks/BQs6hrRa.js +293 -0
  20. package/dist/client/_app/immutable/chunks/BQs6hrRa.js.br +0 -0
  21. package/dist/client/_app/immutable/chunks/BQs6hrRa.js.gz +0 -0
  22. package/dist/client/_app/immutable/chunks/{Wjj5hwVF2.js → BSNB_Uck2.js} +2 -2
  23. package/dist/client/_app/immutable/chunks/BSNB_Uck2.js.br +0 -0
  24. package/dist/client/_app/immutable/chunks/BSNB_Uck2.js.gz +0 -0
  25. package/dist/client/_app/immutable/chunks/{56adh18U.js → BWNegMLP.js} +1 -1
  26. package/dist/client/_app/immutable/chunks/BWNegMLP.js.br +0 -0
  27. package/dist/client/_app/immutable/chunks/BWNegMLP.js.gz +0 -0
  28. package/dist/client/_app/immutable/chunks/{DJq0R92X.js → BesjqVrk.js} +1 -1
  29. package/dist/client/_app/immutable/chunks/BesjqVrk.js.br +0 -0
  30. package/dist/client/_app/immutable/chunks/BesjqVrk.js.gz +0 -0
  31. package/dist/client/_app/immutable/chunks/{NRUHq-_72.js → Bhafduqk2.js} +1 -1
  32. package/dist/client/_app/immutable/chunks/Bhafduqk2.js.br +0 -0
  33. package/dist/client/_app/immutable/chunks/Bhafduqk2.js.gz +0 -0
  34. package/dist/client/_app/immutable/chunks/{Drjp27p72.js → CJxKUjL-2.js} +1 -1
  35. package/dist/client/_app/immutable/chunks/CJxKUjL-2.js.br +0 -0
  36. package/dist/client/_app/immutable/chunks/CJxKUjL-2.js.gz +0 -0
  37. package/dist/client/_app/immutable/chunks/{VTYQK3v_2.js → CVQMNY_q2.js} +2 -2
  38. package/dist/client/_app/immutable/chunks/CVQMNY_q2.js.br +0 -0
  39. package/dist/client/_app/immutable/chunks/CVQMNY_q2.js.gz +0 -0
  40. package/dist/client/_app/immutable/chunks/{CwcsJxhS2.js → CbW3yNTi.js} +1 -1
  41. package/dist/client/_app/immutable/chunks/CbW3yNTi.js.br +0 -0
  42. package/dist/client/_app/immutable/chunks/CbW3yNTi.js.gz +0 -0
  43. package/dist/client/_app/immutable/chunks/CvkNa2t_.js +3 -0
  44. package/dist/client/_app/immutable/chunks/CvkNa2t_.js.br +0 -0
  45. package/dist/client/_app/immutable/chunks/CvkNa2t_.js.gz +0 -0
  46. package/dist/client/_app/immutable/chunks/D2HMiRG4.js +1 -0
  47. package/dist/client/_app/immutable/chunks/D2HMiRG4.js.br +0 -0
  48. package/dist/client/_app/immutable/chunks/D2HMiRG4.js.gz +0 -0
  49. package/dist/client/_app/immutable/chunks/{CuyfOZTk2.js → D2PipAw82.js} +1 -1
  50. package/dist/client/_app/immutable/chunks/D2PipAw82.js.br +0 -0
  51. package/dist/client/_app/immutable/chunks/D2PipAw82.js.gz +0 -0
  52. package/dist/client/_app/immutable/chunks/{CHHvlOt72.js → D6-zOYYZ2.js} +1 -1
  53. package/dist/client/_app/immutable/chunks/D6-zOYYZ2.js.br +0 -0
  54. package/dist/client/_app/immutable/chunks/D6-zOYYZ2.js.gz +0 -0
  55. package/dist/client/_app/immutable/chunks/{B5BlQANa2.js → DGDm8Q4w2.js} +1 -1
  56. package/dist/client/_app/immutable/chunks/DGDm8Q4w2.js.br +0 -0
  57. package/dist/client/_app/immutable/chunks/DGDm8Q4w2.js.gz +0 -0
  58. package/dist/client/_app/immutable/chunks/{Bfd-bGrZ2.js → DRQF0pcw2.js} +1 -1
  59. package/dist/client/_app/immutable/chunks/DRQF0pcw2.js.br +0 -0
  60. package/dist/client/_app/immutable/chunks/DRQF0pcw2.js.gz +0 -0
  61. package/dist/client/_app/immutable/chunks/{B41NCdmk2.js → DYPPS7OK2.js} +1 -1
  62. package/dist/client/_app/immutable/chunks/DYPPS7OK2.js.br +0 -0
  63. package/dist/client/_app/immutable/chunks/DYPPS7OK2.js.gz +0 -0
  64. package/dist/client/_app/immutable/chunks/{YpKUr6uE2.js → DaisyxdZ2.js} +1 -1
  65. package/dist/client/_app/immutable/chunks/DaisyxdZ2.js.br +0 -0
  66. package/dist/client/_app/immutable/chunks/DaisyxdZ2.js.gz +0 -0
  67. package/dist/client/_app/immutable/chunks/{D8Kk1mwW.js → DtcTX-YU.js} +1 -1
  68. package/dist/client/_app/immutable/chunks/DtcTX-YU.js.br +0 -0
  69. package/dist/client/_app/immutable/chunks/DtcTX-YU.js.gz +0 -0
  70. package/dist/client/_app/immutable/chunks/{DbZ0P7x6.js → DuZNgOMp.js} +1 -1
  71. package/dist/client/_app/immutable/chunks/DuZNgOMp.js.br +0 -0
  72. package/dist/client/_app/immutable/chunks/DuZNgOMp.js.gz +0 -0
  73. package/dist/client/_app/immutable/chunks/{CNh34b3X2.js → M5EMNuDS2.js} +1 -1
  74. package/dist/client/_app/immutable/chunks/M5EMNuDS2.js.br +0 -0
  75. package/dist/client/_app/immutable/chunks/M5EMNuDS2.js.gz +0 -0
  76. package/dist/client/_app/immutable/chunks/{Cx3ix-dL2.js → SmrQhi1p2.js} +1 -1
  77. package/dist/client/_app/immutable/chunks/SmrQhi1p2.js.br +0 -0
  78. package/dist/client/_app/immutable/chunks/SmrQhi1p2.js.gz +0 -0
  79. package/dist/client/_app/immutable/chunks/{D5kSEVHd2.js → TFu7Wn2c2.js} +1 -1
  80. package/dist/client/_app/immutable/chunks/TFu7Wn2c2.js.br +0 -0
  81. package/dist/client/_app/immutable/chunks/TFu7Wn2c2.js.gz +0 -0
  82. package/dist/client/_app/immutable/chunks/{DRG11iPc2.js → mESnenQM2.js} +1 -1
  83. package/dist/client/_app/immutable/chunks/mESnenQM2.js.br +0 -0
  84. package/dist/client/_app/immutable/chunks/mESnenQM2.js.gz +0 -0
  85. package/dist/client/_app/immutable/chunks/nE3VUeYj.js +0 -0
  86. package/dist/client/_app/immutable/chunks/nE3VUeYj.js.br +1 -0
  87. package/dist/client/_app/immutable/chunks/nE3VUeYj.js.gz +0 -0
  88. package/dist/client/_app/immutable/chunks/{CN98h0cI2.js → uIj7mV9x2.js} +1 -1
  89. package/dist/client/_app/immutable/chunks/uIj7mV9x2.js.br +0 -0
  90. package/dist/client/_app/immutable/chunks/uIj7mV9x2.js.gz +0 -0
  91. package/dist/client/_app/immutable/entry/{app.CiLM39cw.js → app.CmKp5Z74.js} +2 -2
  92. package/dist/client/_app/immutable/entry/app.CmKp5Z74.js.br +0 -0
  93. package/dist/client/_app/immutable/entry/app.CmKp5Z74.js.gz +0 -0
  94. package/dist/client/_app/immutable/entry/start.D78MUtxi.js +1 -0
  95. package/dist/client/_app/immutable/entry/start.D78MUtxi.js.br +0 -0
  96. package/dist/client/_app/immutable/entry/start.D78MUtxi.js.gz +0 -0
  97. package/dist/client/_app/immutable/nodes/{0.CEpgzEwS.js → 0.DG-EQJuO.js} +1 -1
  98. package/dist/client/_app/immutable/nodes/0.DG-EQJuO.js.br +0 -0
  99. package/dist/client/_app/immutable/nodes/0.DG-EQJuO.js.gz +0 -0
  100. package/dist/client/_app/immutable/nodes/{1.Sm4J_hJ5.js → 1.3zpJchco.js} +1 -1
  101. package/dist/client/_app/immutable/nodes/1.3zpJchco.js.br +0 -0
  102. package/dist/client/_app/immutable/nodes/1.3zpJchco.js.gz +0 -0
  103. package/dist/client/_app/immutable/nodes/{9.C7P5VSNI.js → 11.B2wyJh5I.js} +1 -1
  104. package/dist/client/_app/immutable/nodes/11.B2wyJh5I.js.br +0 -0
  105. package/dist/client/_app/immutable/nodes/11.B2wyJh5I.js.gz +0 -0
  106. package/dist/client/_app/immutable/nodes/2.CW0zjRC8.js +1 -0
  107. package/dist/client/_app/immutable/nodes/2.CW0zjRC8.js.br +0 -0
  108. package/dist/client/_app/immutable/nodes/2.CW0zjRC8.js.gz +0 -0
  109. package/dist/client/_app/immutable/nodes/3.gzy1bOy3.js +6 -0
  110. package/dist/client/_app/immutable/nodes/3.gzy1bOy3.js.br +0 -0
  111. package/dist/client/_app/immutable/nodes/3.gzy1bOy3.js.gz +0 -0
  112. package/dist/client/_app/version.json +1 -1
  113. package/dist/client/_app/version.json.br +0 -0
  114. package/dist/client/_app/version.json.gz +0 -0
  115. package/dist/server/chunks/{0-BgMtbrE9.js → 0-CdkGZW74.js} +6 -6
  116. package/dist/server/chunks/{0-BgMtbrE9.js.map → 0-CdkGZW74.js.map} +1 -1
  117. package/dist/server/chunks/{1-JuWV7qB2.js → 1-Bu7UAZ5T.js} +6 -6
  118. package/dist/server/chunks/{1-JuWV7qB2.js.map → 1-Bu7UAZ5T.js.map} +1 -1
  119. package/dist/server/chunks/{5-DVrv6Zto.js → 10-_cwipoJm.js} +13 -5
  120. package/dist/server/chunks/10-_cwipoJm.js.map +1 -0
  121. package/dist/server/chunks/11-Dx5w0MJO.js +22 -0
  122. package/dist/server/chunks/11-Dx5w0MJO.js.map +1 -0
  123. package/dist/server/chunks/{2-Dkn4MH5F.js → 2-5F9qcDLt.js} +10 -10
  124. package/dist/server/chunks/{2-Dkn4MH5F.js.map → 2-5F9qcDLt.js.map} +1 -1
  125. package/dist/server/chunks/3-Cql-Dmp2.js +22 -0
  126. package/dist/server/chunks/3-Cql-Dmp2.js.map +1 -0
  127. package/dist/server/chunks/{3-CcIZ_M60.js → 4-B2tSZCU9.js} +117 -6
  128. package/dist/server/chunks/4-B2tSZCU9.js.map +1 -0
  129. package/dist/server/chunks/{8-CRPOubhA.js → 5-D3-J9iUP.js} +13 -5
  130. package/dist/server/chunks/5-D3-J9iUP.js.map +1 -0
  131. package/dist/server/chunks/{4-DyArZX6h.js → 6-DDoqG8iB.js} +13 -5
  132. package/dist/server/chunks/6-DDoqG8iB.js.map +1 -0
  133. package/dist/server/chunks/7-CjZUt-gt.js +18 -0
  134. package/dist/server/chunks/7-CjZUt-gt.js.map +1 -0
  135. package/dist/server/chunks/8-ZgtdnItY.js +91 -0
  136. package/dist/server/chunks/8-ZgtdnItY.js.map +1 -0
  137. package/dist/server/chunks/{7-CuJ7XfzT.js → 9-6rlPfdHX.js} +5 -5
  138. package/dist/server/chunks/{7-CuJ7XfzT.js.map → 9-6rlPfdHX.js.map} +1 -1
  139. package/dist/server/chunks/{_layout.svelte-CP4jFwsK.js → _layout.svelte-By6MJeec.js} +6 -6
  140. package/dist/server/chunks/_layout.svelte-By6MJeec.js.map +1 -0
  141. package/dist/server/chunks/{_page.svelte-7KJNFri5.js → _page.svelte-COg8WlkX.js} +6 -6
  142. package/dist/server/chunks/_page.svelte-COg8WlkX.js.map +1 -0
  143. package/dist/server/chunks/{_page.svelte-B3Zfq6_t.js → _page.svelte-Dne41AAE.js} +433 -126
  144. package/dist/server/chunks/_page.svelte-Dne41AAE.js.map +1 -0
  145. package/dist/server/chunks/{_page.svelte-BQLzgYrr.js → _page.svelte-E1XZx_gJ.js} +7 -7
  146. package/dist/server/chunks/_page.svelte-E1XZx_gJ.js.map +1 -0
  147. package/dist/server/chunks/{_server.ts-BYvWhjnh.js → _server.ts-BwyH-SDr.js} +2 -2
  148. package/dist/server/chunks/{_server.ts-BYvWhjnh.js.map → _server.ts-BwyH-SDr.js.map} +1 -1
  149. package/dist/server/chunks/_server.ts-DJwl8--i.js +47 -0
  150. package/dist/server/chunks/_server.ts-DJwl8--i.js.map +1 -0
  151. package/dist/server/chunks/_server.ts-kFT5a-9I.js +13 -0
  152. package/dist/server/chunks/_server.ts-kFT5a-9I.js.map +1 -0
  153. package/dist/server/chunks/app-DUeJj5RD.js.map +1 -1
  154. package/dist/server/chunks/chunk-ByNZkrT6.js.map +1 -1
  155. package/dist/server/chunks/{client-BvtIF74Y.js → client-jrv3ueos.js} +4 -4
  156. package/dist/server/chunks/client-jrv3ueos.js.map +1 -0
  157. package/dist/server/chunks/decorate-CQ_JIwqD.js +11 -0
  158. package/dist/server/chunks/decorate-CQ_JIwqD.js.map +1 -0
  159. package/dist/server/chunks/{error-D23CGeyL.js → error-Cu-XIb00.js} +406 -191
  160. package/dist/server/chunks/error-Cu-XIb00.js.map +1 -0
  161. package/dist/server/chunks/{error.svelte-DZuW0iDP.js → error.svelte-BB7sWwXo.js} +3 -3
  162. package/dist/server/chunks/error.svelte-BB7sWwXo.js.map +1 -0
  163. package/dist/server/chunks/{exports-8wSs4fiF.js → exports-D0uQzbjy.js} +4 -4
  164. package/dist/server/chunks/{exports-8wSs4fiF.js.map → exports-D0uQzbjy.js.map} +1 -1
  165. package/dist/server/chunks/format-DGOlJxF5.js.map +1 -1
  166. package/dist/server/chunks/{hooks.server-Dox7llar.js → hooks.server-BTZM3Han.js} +6 -6
  167. package/dist/server/chunks/hooks.server-BTZM3Han.js.map +1 -0
  168. package/dist/server/chunks/{hooks.universal-DhGFdBkK.js → hooks.universal-bt2XJEN9.js} +2 -2
  169. package/dist/server/chunks/{hooks.universal-DhGFdBkK.js.map → hooks.universal-bt2XJEN9.js.map} +1 -1
  170. package/dist/server/chunks/{events-DeYJGjCt.js → index-server-BthNUqCR.js} +2640 -2635
  171. package/dist/server/chunks/index-server-BthNUqCR.js.map +1 -0
  172. package/dist/server/chunks/{internal-eM0YTBgj.js → internal-vr3mPczx.js} +2 -2
  173. package/dist/server/chunks/{internal-eM0YTBgj.js.map → internal-vr3mPczx.js.map} +1 -1
  174. package/dist/server/chunks/{internal-B77zebhK.js → internal2-BiukHRFA.js} +24 -17
  175. package/dist/server/chunks/internal2-BiukHRFA.js.map +1 -0
  176. package/dist/server/chunks/{loader-circle-zqx69BdD.js → loader-circle-C4T0os4K.js} +5 -5
  177. package/dist/server/chunks/loader-circle-C4T0os4K.js.map +1 -0
  178. package/dist/server/chunks/{logo-BfI7zmyL.js → logo-dxZl1N-5.js} +4 -4
  179. package/dist/server/chunks/logo-dxZl1N-5.js.map +1 -0
  180. package/dist/server/chunks/{project-loader-BkV0zjlj.js → project-loader-D46R4y2F.js} +4 -4
  181. package/dist/server/chunks/project-loader-D46R4y2F.js.map +1 -0
  182. package/dist/server/chunks/{request-handler-D-qbwxhh.js → request-handler-DTxrh7_f.js} +191 -117
  183. package/dist/server/chunks/request-handler-DTxrh7_f.js.map +1 -0
  184. package/dist/server/chunks/{runtime-CDHWD9vo.js → runtime-26c7QsEi.js} +9 -9
  185. package/dist/server/chunks/runtime-26c7QsEi.js.map +1 -0
  186. package/dist/server/chunks/{schemas-ENQuLVBq.js → schemas-nwfCECau.js} +490 -405
  187. package/dist/server/chunks/schemas-nwfCECau.js.map +1 -0
  188. package/dist/server/chunks/{session-CmQRz9-0.js → session-By0bbFhg.js} +2 -2
  189. package/dist/server/chunks/{session-CmQRz9-0.js.map → session-By0bbFhg.js.map} +1 -1
  190. package/dist/server/chunks/shared-server-Cha0Qlv9.js.map +1 -1
  191. package/dist/server/chunks/{state-q9lwVQK2.js → state-CviNrLh6.js} +3 -3
  192. package/dist/server/chunks/state-CviNrLh6.js.map +1 -0
  193. package/dist/server/index.js +374 -357
  194. package/dist/server/index.js.map +1 -1
  195. package/dist/server/manifest.js +55 -31
  196. package/dist/server/manifest.js.map +1 -1
  197. package/package.json +22 -18
  198. package/dist/client/_app/immutable/assets/0.CI0wrjoW.css +0 -1
  199. package/dist/client/_app/immutable/assets/0.CI0wrjoW.css.br +0 -0
  200. package/dist/client/_app/immutable/assets/0.CI0wrjoW.css.gz +0 -0
  201. package/dist/client/_app/immutable/chunks/56adh18U.js.br +0 -0
  202. package/dist/client/_app/immutable/chunks/56adh18U.js.gz +0 -0
  203. package/dist/client/_app/immutable/chunks/9tBtThMc.js +0 -1
  204. package/dist/client/_app/immutable/chunks/9tBtThMc.js.br +0 -0
  205. package/dist/client/_app/immutable/chunks/9tBtThMc.js.gz +0 -0
  206. package/dist/client/_app/immutable/chunks/B41NCdmk2.js.br +0 -0
  207. package/dist/client/_app/immutable/chunks/B41NCdmk2.js.gz +0 -0
  208. package/dist/client/_app/immutable/chunks/B5BlQANa2.js.br +0 -0
  209. package/dist/client/_app/immutable/chunks/B5BlQANa2.js.gz +0 -0
  210. package/dist/client/_app/immutable/chunks/BNmi28p2.js.br +0 -0
  211. package/dist/client/_app/immutable/chunks/BNmi28p2.js.gz +0 -0
  212. package/dist/client/_app/immutable/chunks/Bfd-bGrZ2.js.br +0 -0
  213. package/dist/client/_app/immutable/chunks/Bfd-bGrZ2.js.gz +0 -0
  214. package/dist/client/_app/immutable/chunks/BpsTeBMk2.js.br +0 -0
  215. package/dist/client/_app/immutable/chunks/BpsTeBMk2.js.gz +0 -0
  216. package/dist/client/_app/immutable/chunks/CHHvlOt72.js.br +0 -0
  217. package/dist/client/_app/immutable/chunks/CHHvlOt72.js.gz +0 -0
  218. package/dist/client/_app/immutable/chunks/CN98h0cI2.js.br +0 -0
  219. package/dist/client/_app/immutable/chunks/CN98h0cI2.js.gz +0 -0
  220. package/dist/client/_app/immutable/chunks/CNh34b3X2.js.br +0 -0
  221. package/dist/client/_app/immutable/chunks/CNh34b3X2.js.gz +0 -0
  222. package/dist/client/_app/immutable/chunks/CsVJKLJK.js +0 -1
  223. package/dist/client/_app/immutable/chunks/CsVJKLJK.js.br +0 -0
  224. package/dist/client/_app/immutable/chunks/CsVJKLJK.js.gz +0 -0
  225. package/dist/client/_app/immutable/chunks/CuyfOZTk2.js.br +0 -0
  226. package/dist/client/_app/immutable/chunks/CuyfOZTk2.js.gz +0 -0
  227. package/dist/client/_app/immutable/chunks/CwcsJxhS2.js.br +0 -0
  228. package/dist/client/_app/immutable/chunks/CwcsJxhS2.js.gz +0 -0
  229. package/dist/client/_app/immutable/chunks/Cx3ix-dL2.js.br +0 -0
  230. package/dist/client/_app/immutable/chunks/Cx3ix-dL2.js.gz +0 -0
  231. package/dist/client/_app/immutable/chunks/D5kSEVHd2.js.br +0 -0
  232. package/dist/client/_app/immutable/chunks/D5kSEVHd2.js.gz +0 -0
  233. package/dist/client/_app/immutable/chunks/D8HnIxQ42.js.br +0 -0
  234. package/dist/client/_app/immutable/chunks/D8HnIxQ42.js.gz +0 -0
  235. package/dist/client/_app/immutable/chunks/D8Kk1mwW.js.br +0 -0
  236. package/dist/client/_app/immutable/chunks/D8Kk1mwW.js.gz +0 -0
  237. package/dist/client/_app/immutable/chunks/DJq0R92X.js.br +0 -0
  238. package/dist/client/_app/immutable/chunks/DJq0R92X.js.gz +0 -0
  239. package/dist/client/_app/immutable/chunks/DRG11iPc2.js.br +0 -0
  240. package/dist/client/_app/immutable/chunks/DRG11iPc2.js.gz +0 -0
  241. package/dist/client/_app/immutable/chunks/DbZ0P7x6.js.br +0 -0
  242. package/dist/client/_app/immutable/chunks/DbZ0P7x6.js.gz +0 -0
  243. package/dist/client/_app/immutable/chunks/Drjp27p72.js.br +0 -0
  244. package/dist/client/_app/immutable/chunks/Drjp27p72.js.gz +0 -0
  245. package/dist/client/_app/immutable/chunks/DuEGqPrO.js +0 -6
  246. package/dist/client/_app/immutable/chunks/DuEGqPrO.js.br +0 -0
  247. package/dist/client/_app/immutable/chunks/DuEGqPrO.js.gz +0 -0
  248. package/dist/client/_app/immutable/chunks/H2okCofJ.js +0 -3
  249. package/dist/client/_app/immutable/chunks/H2okCofJ.js.br +0 -0
  250. package/dist/client/_app/immutable/chunks/H2okCofJ.js.gz +0 -0
  251. package/dist/client/_app/immutable/chunks/NRUHq-_72.js.br +0 -0
  252. package/dist/client/_app/immutable/chunks/NRUHq-_72.js.gz +0 -0
  253. package/dist/client/_app/immutable/chunks/UeNcXxK4.js +0 -293
  254. package/dist/client/_app/immutable/chunks/UeNcXxK4.js.br +0 -0
  255. package/dist/client/_app/immutable/chunks/UeNcXxK4.js.gz +0 -0
  256. package/dist/client/_app/immutable/chunks/VTYQK3v_2.js.br +0 -0
  257. package/dist/client/_app/immutable/chunks/VTYQK3v_2.js.gz +0 -0
  258. package/dist/client/_app/immutable/chunks/Wjj5hwVF2.js.br +0 -0
  259. package/dist/client/_app/immutable/chunks/Wjj5hwVF2.js.gz +0 -0
  260. package/dist/client/_app/immutable/chunks/YpKUr6uE2.js.br +0 -0
  261. package/dist/client/_app/immutable/chunks/YpKUr6uE2.js.gz +0 -0
  262. package/dist/client/_app/immutable/entry/app.CiLM39cw.js.br +0 -0
  263. package/dist/client/_app/immutable/entry/app.CiLM39cw.js.gz +0 -0
  264. package/dist/client/_app/immutable/entry/start.CIrA5P2h.js +0 -1
  265. package/dist/client/_app/immutable/entry/start.CIrA5P2h.js.br +0 -0
  266. package/dist/client/_app/immutable/entry/start.CIrA5P2h.js.gz +0 -0
  267. package/dist/client/_app/immutable/nodes/0.CEpgzEwS.js.br +0 -0
  268. package/dist/client/_app/immutable/nodes/0.CEpgzEwS.js.gz +0 -0
  269. package/dist/client/_app/immutable/nodes/1.Sm4J_hJ5.js.br +0 -0
  270. package/dist/client/_app/immutable/nodes/1.Sm4J_hJ5.js.gz +0 -0
  271. package/dist/client/_app/immutable/nodes/10.BcE-uamz.js +0 -6
  272. package/dist/client/_app/immutable/nodes/10.BcE-uamz.js.br +0 -0
  273. package/dist/client/_app/immutable/nodes/10.BcE-uamz.js.gz +0 -0
  274. package/dist/client/_app/immutable/nodes/2.BGBkNPlf.js +0 -1
  275. package/dist/client/_app/immutable/nodes/2.BGBkNPlf.js.br +0 -0
  276. package/dist/client/_app/immutable/nodes/2.BGBkNPlf.js.gz +0 -0
  277. package/dist/client/_app/immutable/nodes/9.C7P5VSNI.js.br +0 -0
  278. package/dist/client/_app/immutable/nodes/9.C7P5VSNI.js.gz +0 -0
  279. package/dist/server/chunks/10-x0FGzJF7.js +0 -22
  280. package/dist/server/chunks/10-x0FGzJF7.js.map +0 -1
  281. package/dist/server/chunks/3-CcIZ_M60.js.map +0 -1
  282. package/dist/server/chunks/4-DyArZX6h.js.map +0 -1
  283. package/dist/server/chunks/5-DVrv6Zto.js.map +0 -1
  284. package/dist/server/chunks/6-AD0Ee23-.js +0 -65
  285. package/dist/server/chunks/6-AD0Ee23-.js.map +0 -1
  286. package/dist/server/chunks/8-CRPOubhA.js.map +0 -1
  287. package/dist/server/chunks/9-BhWG76gi.js +0 -22
  288. package/dist/server/chunks/9-BhWG76gi.js.map +0 -1
  289. package/dist/server/chunks/_layout.svelte-CP4jFwsK.js.map +0 -1
  290. package/dist/server/chunks/_page.svelte-7KJNFri5.js.map +0 -1
  291. package/dist/server/chunks/_page.svelte-B3Zfq6_t.js.map +0 -1
  292. package/dist/server/chunks/_page.svelte-BQLzgYrr.js.map +0 -1
  293. package/dist/server/chunks/_server.ts-B1t_0LJV.js +0 -19
  294. package/dist/server/chunks/_server.ts-B1t_0LJV.js.map +0 -1
  295. package/dist/server/chunks/client-BvtIF74Y.js.map +0 -1
  296. package/dist/server/chunks/error-D23CGeyL.js.map +0 -1
  297. package/dist/server/chunks/error.svelte-DZuW0iDP.js.map +0 -1
  298. package/dist/server/chunks/events-DeYJGjCt.js.map +0 -1
  299. package/dist/server/chunks/hooks.server-Dox7llar.js.map +0 -1
  300. package/dist/server/chunks/internal-B77zebhK.js.map +0 -1
  301. package/dist/server/chunks/loader-circle-zqx69BdD.js.map +0 -1
  302. package/dist/server/chunks/logo-BfI7zmyL.js.map +0 -1
  303. package/dist/server/chunks/project-loader-BkV0zjlj.js.map +0 -1
  304. package/dist/server/chunks/request-handler-D-qbwxhh.js.map +0 -1
  305. package/dist/server/chunks/runtime-CDHWD9vo.js.map +0 -1
  306. package/dist/server/chunks/schemas-ENQuLVBq.js.map +0 -1
  307. package/dist/server/chunks/state-q9lwVQK2.js.map +0 -1
  308. /package/dist/client/_app/immutable/assets/{10.BP_hUVIU.css → 3.BP_hUVIU.css} +0 -0
  309. /package/dist/client/_app/immutable/assets/{10.BP_hUVIU.css.br → 3.BP_hUVIU.css.br} +0 -0
  310. /package/dist/client/_app/immutable/assets/{10.BP_hUVIU.css.gz → 3.BP_hUVIU.css.gz} +0 -0
  311. /package/dist/client/_app/immutable/chunks/{CVaqCwHa.js → CVaqCwHa2.js} +0 -0
  312. /package/dist/client/_app/immutable/chunks/{CVaqCwHa.js.br → CVaqCwHa2.js.br} +0 -0
  313. /package/dist/client/_app/immutable/chunks/{CVaqCwHa.js.gz → CVaqCwHa2.js.gz} +0 -0
  314. /package/dist/client/_app/immutable/chunks/{De2hgUGE.js → De2hgUGE2.js} +0 -0
  315. /package/dist/client/_app/immutable/chunks/{De2hgUGE.js.br → De2hgUGE2.js.br} +0 -0
  316. /package/dist/client/_app/immutable/chunks/{De2hgUGE.js.gz → De2hgUGE2.js.gz} +0 -0
  317. /package/dist/server/chunks/{chunk-D7D4PA-g.js → rolldown-runtime-D7D4PA-g.js} +0 -0
@@ -1,9 +1,9 @@
1
1
  import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./chunk-ByNZkrT6.js";
2
- import { $ as onDestroy, Ct as clsx, D as ensure_array_like, M as get$1, P as getContext, St as writable, T as derived$1, bt as unsubscribe_stores, ct as setContext, dt as spread_props, ft as store_get, g as bind_props, gt as tick, h as attributes, it as readonly$1, k as escape_html, p as attr_class, tt as props_id, w as derived, y as clsx$1 } from "./events-DeYJGjCt.js";
3
- import { Q as stringify$1, f as fromStore } from "./internal-B77zebhK.js";
4
- import "./exports-8wSs4fiF.js";
5
- import { i as invalidateAll, n as applyAction, t as afterNavigate } from "./client-BvtIF74Y.js";
6
- import { $ as createId, B as Spinner, F as Select, G as attachRef, H as Switch$1, I as Select_content, L as Select_item, Q as createBitsAttrs, R as Select_trigger, U as Switch_thumb, V as StyleToObject, Y as boxWith$1, Z as cn, n as Button, nt as enhance, tt as deserialize, ut as mergeProps$1 } from "./error-D23CGeyL.js";
2
+ import { C as escape_html, K as props_id, O as getContext, S as ensure_array_like, T as get, W as onDestroy, Y as readonly$1, b as derived$1, c as attr_class, d as bind_props, dt as clsx, et as setContext, it as store_get, lt as unsubscribe_stores, m as clsx$1, ot as tick, rt as spread_props, u as attributes, ut as writable, y as derived } from "./index-server-BthNUqCR.js";
3
+ import { Q as stringify$1, f as fromStore } from "./internal2-BiukHRFA.js";
4
+ import "./exports-D0uQzbjy.js";
5
+ import { i as invalidateAll, n as applyAction, t as afterNavigate } from "./client-jrv3ueos.js";
6
+ import { $ as createBitsAttrs, H as StyleToObject, I as Select, K as attachRef, L as Select_content, Q as cn, R as Select_item, U as Switch$1, W as Switch_thumb, X as boxWith$1, dt as mergeProps$1, et as createId, nt as deserialize, rt as enhance, z as Select_trigger } from "./error-Cu-XIb00.js";
7
7
  //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
8
8
  var _a$1;
9
9
  function $constructor(name, initializer, params) {
@@ -434,7 +434,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
434
434
  }, ctx);
435
435
  if (result instanceof Promise) throw new $ZodAsyncError();
436
436
  if (result.issues.length) {
437
- const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
437
+ const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
438
438
  captureStackTrace(e, _params?.callee);
439
439
  throw e;
440
440
  }
@@ -451,7 +451,7 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
451
451
  }, ctx);
452
452
  if (result instanceof Promise) result = await result;
453
453
  if (result.issues.length) {
454
- const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
454
+ const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
455
455
  captureStackTrace(e, params?.callee);
456
456
  throw e;
457
457
  }
@@ -3169,7 +3169,7 @@ function toJSONSchema(input, params) {
3169
3169
  return finalize(ctx, input);
3170
3170
  }
3171
3171
  //#endregion
3172
- //#region .svelte-kit/adapter-bun/chunks/loading-button.js
3172
+ //#region .svelte-kit/adapter-bun/chunks/form.svelte.js
3173
3173
  var labelAttrs = createBitsAttrs({
3174
3174
  component: "label",
3175
3175
  parts: ["root"]
@@ -5289,7 +5289,7 @@ function superForm(form, formOptions) {
5289
5289
  };
5290
5290
  form = form;
5291
5291
  const _initialFormId = form.id = options.id ?? form.id;
5292
- const _currentPage = get$1(page) ?? (STORYBOOK_MODE ? {} : void 0);
5292
+ const _currentPage = get(page) ?? (STORYBOOK_MODE ? {} : void 0);
5293
5293
  /**
5294
5294
  * Need to clone the form data, in case it's used to populate multiple forms
5295
5295
  * and in components that are mounted and destroyed multiple times.
@@ -5428,7 +5428,7 @@ function superForm(form, formOptions) {
5428
5428
  fieldProxy({ form: Form$2 }, path, options).set(value);
5429
5429
  },
5430
5430
  get(path) {
5431
- return get$1(fieldProxy(Form$2, path));
5431
+ return get(fieldProxy(Form$2, path));
5432
5432
  }
5433
5433
  };
5434
5434
  else changeEvent = {
@@ -5438,7 +5438,7 @@ function superForm(form, formOptions) {
5438
5438
  fieldProxy({ form: Form$2 }, path, options).set(value);
5439
5439
  },
5440
5440
  get(path) {
5441
- return get$1(fieldProxy(Form$2, path));
5441
+ return get(fieldProxy(Form$2, path));
5442
5442
  }
5443
5443
  };
5444
5444
  options.onChange(changeEvent);
@@ -5520,7 +5520,7 @@ function superForm(form, formOptions) {
5520
5520
  if (isEventError && options.validationMethod == "oninput") return addError();
5521
5521
  if (immediate && !multiple && isEventError) return addError();
5522
5522
  if (multiple) {
5523
- const errorPath = pathExists(get$1(Errors), error.path.slice(0, -1));
5523
+ const errorPath = pathExists(get(Errors), error.path.slice(0, -1));
5524
5524
  if (errorPath?.value && typeof errorPath?.value == "object") {
5525
5525
  for (const errors of Object.values(errorPath.value)) if (Array.isArray(errors)) return addError();
5526
5526
  }
@@ -5784,7 +5784,7 @@ function superForm(form, formOptions) {
5784
5784
  __data.valid = form.valid;
5785
5785
  if (options.flashMessage && shouldSyncFlash(options)) {
5786
5786
  const flash = options.flashMessage.module.getFlash(page);
5787
- if (message && get$1(flash) === void 0) flash.set(message);
5787
+ if (message && get(flash) === void 0) flash.set(message);
5788
5788
  }
5789
5789
  }
5790
5790
  const formEvents = {
@@ -6688,7 +6688,7 @@ function IsUnsafePropertyKey(key) {
6688
6688
  function HasPropertyKey(value, key) {
6689
6689
  return IsUnsafePropertyKey(key) ? Object.prototype.hasOwnProperty.call(value, key) : key in value;
6690
6690
  }
6691
- /** Returns property keys for this object via `Object.getOwnPropertyKeys({ ... })` */
6691
+ /** Returns property keys for this object via `Object.getOwnPropertyNames({ ... })` */
6692
6692
  function Keys(value) {
6693
6693
  return Object.getOwnPropertyNames(value);
6694
6694
  }
@@ -6814,41 +6814,10 @@ function IsKind(value, kind) {
6814
6814
  function IsSchema(value) {
6815
6815
  return IsObject$1(value);
6816
6816
  }
6817
- /** Creates an OptionalAddAction. */
6818
- function OptionalAddAction(type) {
6819
- return Create({ ["~kind"]: "OptionalAddAction" }, { type }, {});
6820
- }
6821
- /** Returns true if this value is a OptionalAddAction. */
6822
- function IsOptionalAddAction(value) {
6823
- return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "OptionalAddAction") && IsSchema(value.type);
6824
- }
6825
- /** Creates a OptionalRemoveAction. */
6826
- function OptionalRemoveAction(type) {
6827
- return Create({ ["~kind"]: "OptionalRemoveAction" }, { type }, {});
6828
- }
6829
- /** Returns true if this value is a OptionalRemoveAction. */
6830
- function IsOptionalRemoveAction(value) {
6831
- return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "OptionalRemoveAction") && IsSchema(value.type);
6832
- }
6833
- /** Creates a ReadonlyAddAction. */
6834
- function ReadonlyAddAction(type) {
6835
- return Create({ ["~kind"]: "ReadonlyAddAction" }, { type }, {});
6836
- }
6837
- /** Returns true if this value is a ReadonlyAddAction. */
6838
- function IsReadonlyAddAction(value) {
6839
- return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "ReadonlyAddAction") && IsSchema(value.type);
6840
- }
6841
- /** Creates a ReadonlyRemoveAction. */
6842
- function ReadonlyRemoveAction(type) {
6843
- return Create({ ["~kind"]: "ReadonlyRemoveAction" }, { type }, {});
6844
- }
6845
- /** Returns true if this value is a ReadonlyRemoveAction. */
6846
- function IsReadonlyRemoveAction(value) {
6847
- return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "ReadonlyRemoveAction") && IsSchema(value.type);
6848
- }
6849
6817
  /** Creates a Deferred action. */
6850
6818
  function Deferred(action, parameters, options) {
6851
6819
  return Create({ "~kind": "Deferred" }, {
6820
+ type: "deferred",
6852
6821
  action,
6853
6822
  parameters,
6854
6823
  options
@@ -6858,73 +6827,6 @@ function Deferred(action, parameters, options) {
6858
6827
  function IsDeferred(value) {
6859
6828
  return IsKind(value, "Deferred");
6860
6829
  }
6861
- /**
6862
- * Creates a Promise type.
6863
- *
6864
- * @deprecated This type is being removed in the next version of TypeBox. A fallback will be provided under examples.
6865
- */
6866
- function _Promise_(item, options) {
6867
- return Create({ ["~kind"]: "Promise" }, {
6868
- type: "promise",
6869
- item
6870
- }, options);
6871
- }
6872
- /** Returns true if the given type is TPromise. */
6873
- function IsPromise(value) {
6874
- return IsKind(value, "Promise");
6875
- }
6876
- /** Extracts options from a TPromise. */
6877
- function PromiseOptions(type) {
6878
- return Discard(type, [
6879
- "~kind",
6880
- "type",
6881
- "item"
6882
- ]);
6883
- }
6884
- /** Adds Immutable to the given type. */
6885
- function ImmutableAdd(type) {
6886
- return Update(type, { "~immutable": true }, {});
6887
- }
6888
- /** Applies an Immutable modifier to the given type. */
6889
- function Immutable(type) {
6890
- return ImmutableAdd(type);
6891
- }
6892
- /** Returns true if the given value is a TImmutable */
6893
- function IsImmutable(value) {
6894
- return IsSchema(value) && HasPropertyKey(value, "~immutable");
6895
- }
6896
- /** Removes Optional from the given type. */
6897
- function OptionalRemove(type) {
6898
- return Discard(type, ["~optional"]);
6899
- }
6900
- /** Adds Optional to the given type. */
6901
- function OptionalAdd(type) {
6902
- return Update(type, { "~optional": true }, {});
6903
- }
6904
- /** Applies an Optional modifier to the given type. */
6905
- function Optional$2(type) {
6906
- return OptionalAdd(type);
6907
- }
6908
- /** Returns true if the given value is TOptional */
6909
- function IsOptional(value) {
6910
- return IsSchema(value) && HasPropertyKey(value, "~optional");
6911
- }
6912
- /** Removes a Readonly property modifier from the given type. */
6913
- function ReadonlyRemove(type) {
6914
- return Discard(type, ["~readonly"]);
6915
- }
6916
- /** Adds a Readonly property modifier to the given type. */
6917
- function ReadonlyAdd(type) {
6918
- return Update(type, { "~readonly": true }, {});
6919
- }
6920
- /** Applies an Readonly property modifier to the given type. */
6921
- function Readonly$1(type) {
6922
- return ReadonlyAdd(type);
6923
- }
6924
- /** Returns true if the given value is a TReadonly */
6925
- function IsReadonly(value) {
6926
- return IsSchema(value) && HasPropertyKey(value, "~readonly");
6927
- }
6928
6830
  function BaseProperty(value) {
6929
6831
  return {
6930
6832
  enumerable: Get().enumerableKind,
@@ -7043,7 +6945,7 @@ function AsyncIteratorOptions(type) {
7043
6945
  ]);
7044
6946
  }
7045
6947
  /** Creates a Constructor type. */
7046
- function Constructor$1(parameters, instanceType, options = {}) {
6948
+ function Constructor(parameters, instanceType, options = {}) {
7047
6949
  return Create({ "~kind": "Constructor" }, {
7048
6950
  type: "constructor",
7049
6951
  parameters,
@@ -7121,6 +7023,31 @@ function Never(options) {
7121
7023
  function IsNever(value) {
7122
7024
  return IsKind(value, "Never");
7123
7025
  }
7026
+ function AddOptionalOperation(type) {
7027
+ return Update(type, { "~optional": true }, {});
7028
+ }
7029
+ function AddOptionalAction(type, options) {
7030
+ return Update(AddOptionalOperation(type), {}, options);
7031
+ }
7032
+ function AddOptionalInstantiate(context, state, type, options) {
7033
+ return AddOptionalAction(InstantiateType(context, state, type), options);
7034
+ }
7035
+ /** Creates a deferred AddOptional action. */
7036
+ function AddOptionalDeferred(type, options = {}) {
7037
+ return Deferred("AddOptional", [type], options);
7038
+ }
7039
+ /** Applies an AddOptional action to a type. */
7040
+ function AddOptional(type, options = {}) {
7041
+ return AddOptionalAction(type, options);
7042
+ }
7043
+ /** Applies an Optional modifier to the given type. */
7044
+ function Optional$2(type) {
7045
+ return AddOptional(type);
7046
+ }
7047
+ /** Returns true if the given value is TOptional */
7048
+ function IsOptional(value) {
7049
+ return IsSchema(value) && HasPropertyKey(value, "~optional");
7050
+ }
7124
7051
  /** Creates a RequiredArray derived from the given TProperties value. */
7125
7052
  function RequiredArray(properties) {
7126
7053
  return Keys(properties).filter((key) => !IsOptional(properties[key]));
@@ -7233,6 +7160,27 @@ function Infer(...args) {
7233
7160
  function IsInfer(value) {
7234
7161
  return IsKind(value, "Infer");
7235
7162
  }
7163
+ /** Creates a Dependent type */
7164
+ function Dependent$1(if_, then_, else_, options = {}) {
7165
+ return Create({ "~kind": "Dependent" }, {
7166
+ if: if_,
7167
+ then: then_,
7168
+ else: else_
7169
+ }, options);
7170
+ }
7171
+ /** Returns true if the given value is TDependent. */
7172
+ function IsDependent(value) {
7173
+ return IsKind(value, "Dependent");
7174
+ }
7175
+ /** Extracts options from a IsDependent. */
7176
+ function DependentOptions(type) {
7177
+ return Discard(type, [
7178
+ "~kind",
7179
+ "if",
7180
+ "then",
7181
+ "else"
7182
+ ]);
7183
+ }
7236
7184
  function IsTypeScriptEnumLike(value) {
7237
7185
  return IsObjectNotArray(value);
7238
7186
  }
@@ -7326,6 +7274,39 @@ function Encode(type, callback) {
7326
7274
  function IsCodec(value) {
7327
7275
  return IsSchema(value) && HasPropertyKey(value, "~codec") && IsObject$1(value["~codec"]) && HasPropertyKey(value["~codec"], "encode") && HasPropertyKey(value["~codec"], "decode");
7328
7276
  }
7277
+ /** Applies an Immutable modifier to the given type. */
7278
+ function Immutable(type) {
7279
+ return AddImmutable(type);
7280
+ }
7281
+ /** Returns true if the given value is a TImmutable */
7282
+ function IsImmutable(value) {
7283
+ return IsSchema(value) && HasPropertyKey(value, "~immutable");
7284
+ }
7285
+ function AddReadonlyOperation(type) {
7286
+ return Update(type, { "~readonly": true }, {});
7287
+ }
7288
+ function AddReadonlyAction(type, options) {
7289
+ return Update(AddReadonlyOperation(type), {}, options);
7290
+ }
7291
+ function AddReadonlyInstantiate(context, state, type, options) {
7292
+ return AddReadonlyAction(InstantiateType(context, state, type), options);
7293
+ }
7294
+ /** Creates a deferred AddReadonly action. */
7295
+ function AddReadonlyDeferred(type, options = {}) {
7296
+ return Deferred("AddReadonly", [type], options);
7297
+ }
7298
+ /** Applies an AddReadonly action to a type. */
7299
+ function AddReadonly(type, options = {}) {
7300
+ return AddReadonlyAction(type, options);
7301
+ }
7302
+ /** Applies an Readonly property modifier to the given type. */
7303
+ function Readonly$1(type) {
7304
+ return AddReadonly(type);
7305
+ }
7306
+ /** Returns true if the given value is a TReadonly */
7307
+ function IsReadonly(value) {
7308
+ return IsSchema(value) && HasPropertyKey(value, "~readonly");
7309
+ }
7329
7310
  /** Applies a Refine check to the given type. */
7330
7311
  function RefineAdd(type, refinement) {
7331
7312
  return Update(type, { "~refine": IsRefine(type) ? [...type["~refine"], refinement] : [refinement] }, {});
@@ -7431,7 +7412,7 @@ function LiteralTypeName(value) {
7431
7412
  })();
7432
7413
  }
7433
7414
  /** Creates a Literal type. */
7434
- function Literal$1(value, options) {
7415
+ function Literal(value, options) {
7435
7416
  return Create({ "~kind": "Literal" }, {
7436
7417
  type: LiteralTypeName(value),
7437
7418
  const: value
@@ -7461,7 +7442,7 @@ function Null(options) {
7461
7442
  function IsNull(value) {
7462
7443
  return IsKind(value, "Null");
7463
7444
  }
7464
- var NumberPattern = "-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?";
7445
+ var NumberPattern = "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";
7465
7446
  /** Creates a Number type. */
7466
7447
  function Number$2(options) {
7467
7448
  return Create({ "~kind": "Number" }, { type: "number" }, options);
@@ -7507,6 +7488,29 @@ function Parameter$1(...args) {
7507
7488
  function IsParameter(value) {
7508
7489
  return IsKind(value, "Parameter");
7509
7490
  }
7491
+ /**
7492
+ * Creates a Promise type.
7493
+ *
7494
+ * @deprecated This type is being removed in the next version of TypeBox. A fallback will be provided under examples.
7495
+ */
7496
+ function _Promise_(item, options) {
7497
+ return Create({ ["~kind"]: "Promise" }, {
7498
+ type: "promise",
7499
+ item
7500
+ }, options);
7501
+ }
7502
+ /** Returns true if the given type is TPromise. */
7503
+ function IsPromise(value) {
7504
+ return IsKind(value, "Promise");
7505
+ }
7506
+ /** Extracts options from a TPromise. */
7507
+ function PromiseOptions(type) {
7508
+ return Discard(type, [
7509
+ "~kind",
7510
+ "type",
7511
+ "item"
7512
+ ]);
7513
+ }
7510
7514
  /** Creates a String type. */
7511
7515
  function String$2(options) {
7512
7516
  return Create({ "~kind": "String" }, { type: "string" }, options);
@@ -7558,7 +7562,7 @@ function DecodeFromSpan(variants, types) {
7558
7562
  return TakeLeft(types, (left, right) => DecodeFromSpan(FromType$16(variants, left), right), () => variants);
7559
7563
  }
7560
7564
  function VariantsToLiterals(variants) {
7561
- return variants.map((variant) => Literal$1(variant));
7565
+ return variants.map((variant) => Literal(variant));
7562
7566
  }
7563
7567
  function DecodeTypesAsUnion(types) {
7564
7568
  return Union(VariantsToLiterals(DecodeFromSpan([], types)));
@@ -7598,26 +7602,8 @@ function FromBooleanKey(value) {
7598
7602
  false: value
7599
7603
  });
7600
7604
  }
7601
- function FromEnumValue(value) {
7602
- return IsString$1(value) || IsNumber$1(value) ? Literal$1(value) : IsNull$1(value) ? Null() : Never();
7603
- }
7604
- function EnumValuesToVariants(values) {
7605
- return values.map((value) => FromEnumValue(value));
7606
- }
7607
- function EnumValuesToUnion(values) {
7608
- return Union(EnumValuesToVariants(values));
7609
- }
7610
- function EnumToUnion(type) {
7611
- return EnumValuesToUnion(type.enum);
7612
- }
7613
- function FromEnumKey(values, value) {
7614
- return FromKey(EnumValuesToUnion(values), value);
7615
- }
7616
- function FromIntegerKey(_key, value) {
7617
- return CreateRecord(IntegerKey, value);
7618
- }
7619
7605
  /** Creates a Tuple type. */
7620
- function Tuple$1(types, options = {}) {
7606
+ function Tuple(types, options = {}) {
7621
7607
  const [items, minItems, additionalItems] = [
7622
7608
  types,
7623
7609
  types.length,
@@ -7644,6 +7630,40 @@ function TupleOptions(type) {
7644
7630
  "additionalItems"
7645
7631
  ]);
7646
7632
  }
7633
+ function RemoveReadonlyOperation(type) {
7634
+ return Discard(type, ["~readonly"]);
7635
+ }
7636
+ function RemoveReadonlyAction(type, options) {
7637
+ return Update(RemoveReadonlyOperation(type), {}, options);
7638
+ }
7639
+ function RemoveReadonlyInstantiate(context, state, type, options) {
7640
+ return RemoveReadonlyAction(InstantiateType(context, state, type), options);
7641
+ }
7642
+ /** Creates a deferred RemoveReadonly action. */
7643
+ function RemoveReadonlyDeferred(type, options = {}) {
7644
+ return Deferred("RemoveReadonly", [type], options);
7645
+ }
7646
+ /** Applies an RemoveReadonly action to a type. */
7647
+ function RemoveReadonly(type, options = {}) {
7648
+ return RemoveReadonlyAction(type, options);
7649
+ }
7650
+ function RemoveOptionalOperation(type) {
7651
+ return Discard(type, ["~optional"]);
7652
+ }
7653
+ function RemoveOptionalAction(type, options) {
7654
+ return Update(RemoveOptionalOperation(type), {}, options);
7655
+ }
7656
+ function RemoveOptionalInstantiate(context, state, type, options) {
7657
+ return RemoveOptionalAction(InstantiateType(context, state, type), options);
7658
+ }
7659
+ /** Creates a deferred RemoveOptional action. */
7660
+ function RemoveOptionalDeferred(type, options = {}) {
7661
+ return Deferred("RemoveOptional", [type], options);
7662
+ }
7663
+ /** Applies an RemoveOptional action to a type. */
7664
+ function RemoveOptional(type, options = {}) {
7665
+ return RemoveOptionalAction(type, options);
7666
+ }
7647
7667
  function TupleElementsToProperties(types) {
7648
7668
  return types.reduceRight((result, right, index) => {
7649
7669
  return {
@@ -7664,8 +7684,8 @@ function IsOptionalProperty(left, right) {
7664
7684
  function CompositeProperty(left, right) {
7665
7685
  const isReadonly = IsReadonlyProperty(left, right);
7666
7686
  const isOptional = IsOptionalProperty(left, right);
7667
- const property = ReadonlyRemove(OptionalRemove(EvaluateIntersect([left, right])));
7668
- return isReadonly && isOptional ? ReadonlyAdd(OptionalAdd(property)) : isReadonly && !isOptional ? ReadonlyAdd(property) : !isReadonly && isOptional ? OptionalAdd(property) : property;
7687
+ const property = RemoveReadonly(RemoveOptional(EvaluateIntersect([left, right])));
7688
+ return isReadonly && isOptional ? AddReadonly(AddOptional(property)) : isReadonly && !isOptional ? AddReadonly(property) : !isReadonly && isOptional ? AddOptional(property) : property;
7669
7689
  }
7670
7690
  function CompositePropertyKey(left, right, key) {
7671
7691
  return key in left ? key in right ? CompositeProperty(left[key], right[key]) : left[key] : key in right ? right[key] : Never();
@@ -7713,18 +7733,45 @@ function DistributeUnion(types, distribution, result = []) {
7713
7733
  function Distribute$1(types, result = []) {
7714
7734
  return TakeLeft(types, (left, right) => IsUnion(left) ? Distribute$1(right, DistributeUnion(left.anyOf, result)) : Distribute$1(right, DistributeType(left, result)), () => result);
7715
7735
  }
7736
+ function ExcludeType(left, right) {
7737
+ return IsExtendsTrueLike(Extends({}, left, right)) ? [] : [left];
7738
+ }
7739
+ function ExcludeUnion(types, right) {
7740
+ return types.reduce((result, head) => {
7741
+ return [...result, ...ExcludeType(head, right)];
7742
+ }, []);
7743
+ }
7744
+ function ExcludeOperation(left, right) {
7745
+ const evaluated = EvaluateType(left);
7746
+ return EvaluateUnion(ExcludeUnion(IsUnion(evaluated) ? evaluated.anyOf : [evaluated], right));
7747
+ }
7748
+ function EvaluateDependent(if_, then_, else_) {
7749
+ return EvaluateUnion([Intersect([if_, then_]), ExcludeOperation(else_, if_)]);
7750
+ }
7751
+ function EvaluateEnum(values) {
7752
+ return EvaluateUnion(values.map((value) => Literal(value)));
7753
+ }
7716
7754
  function EvaluateIntersect(types) {
7717
7755
  return Broaden(Distribute$1(types));
7718
7756
  }
7757
+ function EvaluateTemplateLiteral(pattern) {
7758
+ return EvaluateType(TemplateLiteralDecode(pattern));
7759
+ }
7719
7760
  function EvaluateUnion(types) {
7720
7761
  return Broaden(types);
7721
7762
  }
7722
7763
  function EvaluateType(type) {
7723
- return IsIntersect(type) ? EvaluateIntersect(type.allOf) : IsUnion(type) ? EvaluateUnion(type.anyOf) : type;
7764
+ return IsDependent(type) ? EvaluateDependent(type.if, type.then, type.else) : IsEnum(type) ? EvaluateEnum(type.enum) : IsIntersect(type) ? EvaluateIntersect(type.allOf) : IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) : IsUnion(type) ? EvaluateUnion(type.anyOf) : type;
7724
7765
  }
7725
7766
  function EvaluateUnionFast(types) {
7726
7767
  return IsEqual(types.length, 1) ? types[0] : IsEqual(types.length, 0) ? Never() : Union(types);
7727
7768
  }
7769
+ function FromEnumKey(values, value) {
7770
+ return FromKey(EvaluateEnum(values), value);
7771
+ }
7772
+ function FromIntegerKey(_key, value) {
7773
+ return CreateRecord(IntegerKey, value);
7774
+ }
7728
7775
  function FromIntersectKey(types, value) {
7729
7776
  return FromKey(EvaluateIntersect(types), value);
7730
7777
  }
@@ -7738,7 +7785,7 @@ function FromStringKey(key, value) {
7738
7785
  return HasPropertyKey(key, "pattern") && (IsString$1(key.pattern) || key.pattern instanceof RegExp) ? CreateRecord(key.pattern.toString(), value) : CreateRecord(StringKey, value);
7739
7786
  }
7740
7787
  function FromTemplateKey(pattern, value) {
7741
- return IsTemplateLiteralFinite(ParsePatternIntoTypes(pattern)) ? FromKey(TemplateLiteralDecode(pattern), value) : CreateRecord(pattern, value);
7788
+ return IsTemplateLiteralFinite(ParsePatternIntoTypes(pattern)) ? FromKey(EvaluateTemplateLiteral(pattern), value) : CreateRecord(pattern, value);
7742
7789
  }
7743
7790
  function FlattenType(type) {
7744
7791
  return IsUnion(type) ? Flatten(type.anyOf) : [type];
@@ -7845,7 +7892,7 @@ function IsVoid(value) {
7845
7892
  return IsKind(value, "Void");
7846
7893
  }
7847
7894
  function IntrinsicOrCall(ref, parameters) {
7848
- return IsEqual(ref, "Array") ? _Array_(parameters[0]) : IsEqual(ref, "AsyncIterator") ? AsyncIterator(parameters[0]) : IsEqual(ref, "Iterator") ? Iterator(parameters[0]) : IsEqual(ref, "Promise") ? _Promise_(parameters[0]) : IsEqual(ref, "Awaited") ? AwaitedDeferred(parameters[0]) : IsEqual(ref, "Capitalize") ? CapitalizeDeferred(parameters[0]) : IsEqual(ref, "ConstructorParameters") ? ConstructorParametersDeferred(parameters[0]) : IsEqual(ref, "Evaluate") ? EvaluateDeferred(parameters[0]) : IsEqual(ref, "Exclude") ? ExcludeDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Extract") ? ExtractDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Index") ? IndexDeferred(parameters[0], parameters[1]) : IsEqual(ref, "InstanceType") ? InstanceTypeDeferred(parameters[0]) : IsEqual(ref, "Lowercase") ? LowercaseDeferred(parameters[0]) : IsEqual(ref, "NonNullable") ? NonNullableDeferred(parameters[0]) : IsEqual(ref, "Omit") ? OmitDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Options") ? OptionsDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Parameters") ? ParametersDeferred(parameters[0]) : IsEqual(ref, "Partial") ? PartialDeferred(parameters[0]) : IsEqual(ref, "Pick") ? PickDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Readonly") ? ReadonlyObjectDeferred(parameters[0]) : IsEqual(ref, "KeyOf") ? KeyOfDeferred(parameters[0]) : IsEqual(ref, "Record") ? RecordDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Required") ? RequiredDeferred(parameters[0]) : IsEqual(ref, "ReturnType") ? ReturnTypeDeferred(parameters[0]) : IsEqual(ref, "Uncapitalize") ? UncapitalizeDeferred(parameters[0]) : IsEqual(ref, "Uppercase") ? UppercaseDeferred(parameters[0]) : CallConstruct(Ref(ref), parameters);
7895
+ return IsEqual(ref, "Array") ? _Array_(parameters[0]) : IsEqual(ref, "AsyncIterator") ? AsyncIterator(parameters[0]) : IsEqual(ref, "Iterator") ? Iterator(parameters[0]) : IsEqual(ref, "Promise") ? _Promise_(parameters[0]) : IsEqual(ref, "Awaited") ? AwaitedDeferred(parameters[0]) : IsEqual(ref, "Capitalize") ? CapitalizeDeferred(parameters[0]) : IsEqual(ref, "ConstructorParameters") ? ConstructorParametersDeferred(parameters[0]) : IsEqual(ref, "Evaluate") ? EvaluateDeferred(parameters[0]) : IsEqual(ref, "Exclude") ? ExcludeDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Extract") ? ExtractDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Index") ? IndexDeferred(parameters[0], parameters[1]) : IsEqual(ref, "InstanceType") ? InstanceTypeDeferred(parameters[0]) : IsEqual(ref, "Lowercase") ? LowercaseDeferred(parameters[0]) : IsEqual(ref, "NonNullable") ? NonNullableDeferred(parameters[0]) : IsEqual(ref, "Omit") ? OmitDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Parameters") ? ParametersDeferred(parameters[0]) : IsEqual(ref, "Partial") ? PartialDeferred(parameters[0]) : IsEqual(ref, "Pick") ? PickDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Readonly") ? ReadonlyObjectDeferred(parameters[0]) : IsEqual(ref, "KeyOf") ? KeyOfDeferred(parameters[0]) : IsEqual(ref, "Record") ? RecordDeferred(parameters[0], parameters[1]) : IsEqual(ref, "Required") ? RequiredDeferred(parameters[0]) : IsEqual(ref, "ReturnType") ? ReturnTypeDeferred(parameters[0]) : IsEqual(ref, "Uncapitalize") ? UncapitalizeDeferred(parameters[0]) : IsEqual(ref, "Uppercase") ? UppercaseDeferred(parameters[0]) : CallConstruct(Ref(ref), parameters);
7849
7896
  }
7850
7897
  function Unreachable() {
7851
7898
  throw Error("Unreachable");
@@ -7934,14 +7981,23 @@ function KeywordVoidMapping(input) {
7934
7981
  function KeywordThisMapping(input) {
7935
7982
  return This();
7936
7983
  }
7937
- function KeywordMapping(input) {
7938
- return input;
7984
+ function LiteralBigIntMapping(input) {
7985
+ return Literal(BigInt(input));
7986
+ }
7987
+ function LiteralBooleanMapping(input) {
7988
+ return Literal(IsEqual(input, "true"));
7989
+ }
7990
+ function LiteralNumberMapping(input) {
7991
+ return Literal(parseFloat(input));
7992
+ }
7993
+ function LiteralStringMapping(input) {
7994
+ return Literal(input);
7939
7995
  }
7940
7996
  function TemplateInterpolateMapping(input) {
7941
7997
  return input[1];
7942
7998
  }
7943
7999
  function TemplateSpanMapping(input) {
7944
- return Literal$1(input);
8000
+ return Literal(input);
7945
8001
  }
7946
8002
  function TemplateBodyMapping(input) {
7947
8003
  return IsEqual(input.length, 3) ? [
@@ -7956,20 +8012,8 @@ function TemplateLiteralTypesMapping(input) {
7956
8012
  function TemplateLiteralMapping(input) {
7957
8013
  return TemplateLiteralDeferred(input);
7958
8014
  }
7959
- function LiteralBigIntMapping(input) {
7960
- return Literal$1(BigInt(input));
7961
- }
7962
- function LiteralBooleanMapping(input) {
7963
- return Literal$1(IsEqual(input, "true"));
7964
- }
7965
- function LiteralNumberMapping(input) {
7966
- return Literal$1(parseFloat(input));
7967
- }
7968
- function LiteralStringMapping(input) {
7969
- return Literal$1(input);
7970
- }
7971
- function LiteralMapping(input) {
7972
- return input;
8015
+ function DependentMapping(input) {
8016
+ return IsEqual(input.length, 6) ? Dependent$1(input[1], input[3], input[5]) : Dependent$1(input[1], input[3], Unknown());
7973
8017
  }
7974
8018
  function KeyOfMapping(input) {
7975
8019
  return input.length > 0;
@@ -8002,7 +8046,7 @@ function FactorExtends(type, extend) {
8002
8046
  return IsEqual(extend.length, 3) ? ConditionalDeferred(type, extend[0], extend[1], extend[2]) : type;
8003
8047
  }
8004
8048
  function FactorWith(type, withClause) {
8005
- return IsArray$1(withClause) && IsEqual(withClause.length, 0) ? type : OptionsDeferred(type, withClause);
8049
+ return IsArray$1(withClause) && IsEqual(withClause.length, 0) ? type : WithDeferred(type, withClause);
8006
8050
  }
8007
8051
  function FactorMapping(input) {
8008
8052
  const [keyOf, type, indexArray, extend, withClause] = input;
@@ -8032,7 +8076,7 @@ function ExprMapping(input) {
8032
8076
  return ExprBinaryMapping(left, rest);
8033
8077
  }
8034
8078
  function ExprReadonlyMapping(input) {
8035
- return ImmutableAdd(input[1]);
8079
+ return AddImmutableDeferred(input[1]);
8036
8080
  }
8037
8081
  function ExprPipeMapping(input) {
8038
8082
  return input[1];
@@ -8069,7 +8113,7 @@ function OptionalMapping(input) {
8069
8113
  }
8070
8114
  function PropertyMapping(input) {
8071
8115
  const [isReadonly, key, isOptional, _colon, type] = input;
8072
- return { [key]: isReadonly && isOptional ? ReadonlyAdd(OptionalAdd(type)) : isReadonly && !isOptional ? ReadonlyAdd(type) : !isReadonly && isOptional ? OptionalAdd(type) : type };
8116
+ return { [key]: isReadonly && isOptional ? AddReadonlyDeferred(AddOptionalDeferred(type)) : isReadonly && !isOptional ? AddReadonlyDeferred(type) : !isReadonly && isOptional ? AddOptionalDeferred(type) : type };
8073
8117
  }
8074
8118
  function PropertyDelimiterMapping(input) {
8075
8119
  return input;
@@ -8090,16 +8134,16 @@ function _Object_Mapping(input) {
8090
8134
  return _Object_$1(properties, IsEqual(Keys(patternProperties).length, 0) ? {} : { patternProperties });
8091
8135
  }
8092
8136
  function ElementNamedMapping(input) {
8093
- return IsEqual(input.length, 5) ? ReadonlyAdd(OptionalAdd(input[4])) : IsEqual(input.length, 3) ? input[2] : IsEqual(input.length, 4) ? IsEqual(input[2], "readonly") ? ReadonlyAdd(input[3]) : OptionalAdd(input[3]) : Unreachable();
8137
+ return IsEqual(input.length, 5) ? AddReadonlyDeferred(AddOptionalDeferred(input[4])) : IsEqual(input.length, 3) ? input[2] : IsEqual(input.length, 4) ? IsEqual(input[2], "readonly") ? AddReadonlyDeferred(input[3]) : AddOptionalDeferred(input[3]) : Unreachable();
8094
8138
  }
8095
8139
  function ElementReadonlyOptionalMapping(input) {
8096
- return ReadonlyAdd(OptionalAdd(input[1]));
8140
+ return AddReadonlyDeferred(AddOptionalDeferred(input[1]));
8097
8141
  }
8098
8142
  function ElementReadonlyMapping(input) {
8099
- return ReadonlyAdd(input[1]);
8143
+ return AddReadonlyDeferred(input[1]);
8100
8144
  }
8101
8145
  function ElementOptionalMapping(input) {
8102
- return OptionalAdd(input[0]);
8146
+ return AddOptionalDeferred(input[0]);
8103
8147
  }
8104
8148
  function ElementBaseMapping(input) {
8105
8149
  return input;
@@ -8110,17 +8154,17 @@ function ElementMapping(input) {
8110
8154
  function ElementListMapping(input) {
8111
8155
  return Delimited(input);
8112
8156
  }
8113
- function TupleMapping(input) {
8114
- return Tuple$1(input[1]);
8157
+ function _Tuple_Mapping(input) {
8158
+ return Tuple(input[1]);
8115
8159
  }
8116
8160
  function ParameterReadonlyOptionalMapping(input) {
8117
- return ReadonlyAdd(OptionalAdd(input[4]));
8161
+ return AddReadonlyDeferred(AddOptionalDeferred(input[4]));
8118
8162
  }
8119
8163
  function ParameterReadonlyMapping(input) {
8120
- return ReadonlyAdd(input[3]);
8164
+ return AddReadonlyDeferred(input[3]);
8121
8165
  }
8122
8166
  function ParameterOptionalMapping(input) {
8123
- return OptionalAdd(input[3]);
8167
+ return AddOptionalDeferred(input[3]);
8124
8168
  }
8125
8169
  function ParameterTypeMapping(input) {
8126
8170
  return input[2];
@@ -8137,17 +8181,17 @@ function ParameterListMapping(input) {
8137
8181
  function _Function_Mapping(input) {
8138
8182
  return _Function_$1(input[1], input[4]);
8139
8183
  }
8140
- function ConstructorMapping(input) {
8141
- return Constructor$1(input[2], input[5]);
8184
+ function _Constructor_Mapping(input) {
8185
+ return Constructor(input[2], input[5]);
8142
8186
  }
8143
- function ApplyReadonly$1(state, type) {
8144
- return IsEqual(state, "remove") ? ReadonlyRemoveAction(type) : IsEqual(state, "add") ? ReadonlyAddAction(type) : type;
8187
+ function ApplyReadonly(state, type) {
8188
+ return IsEqual(state, "remove") ? RemoveReadonlyDeferred(type) : IsEqual(state, "add") ? AddReadonlyDeferred(type) : type;
8145
8189
  }
8146
8190
  function MappedReadonlyMapping(input) {
8147
8191
  return IsEqual(input.length, 2) && IsEqual(input[0], "-") ? "remove" : IsEqual(input.length, 2) && IsEqual(input[0], "+") ? "add" : IsEqual(input.length, 1) ? "add" : "none";
8148
8192
  }
8149
- function ApplyOptional$1(state, type) {
8150
- return IsEqual(state, "remove") ? OptionalRemoveAction(type) : IsEqual(state, "add") ? OptionalAddAction(type) : type;
8193
+ function ApplyOptional(state, type) {
8194
+ return IsEqual(state, "remove") ? RemoveOptionalDeferred(type) : IsEqual(state, "add") ? AddOptionalDeferred(type) : type;
8151
8195
  }
8152
8196
  function MappedOptionalMapping(input) {
8153
8197
  return IsEqual(input.length, 2) && IsEqual(input[0], "-") ? "remove" : IsEqual(input.length, 2) && IsEqual(input[0], "+") ? "add" : IsEqual(input.length, 1) ? "add" : "none";
@@ -8155,48 +8199,48 @@ function MappedOptionalMapping(input) {
8155
8199
  function MappedAsMapping(input) {
8156
8200
  return IsEqual(input.length, 2) ? [input[1]] : [];
8157
8201
  }
8158
- function MappedMapping(input) {
8159
- return IsArray$1(input[6]) && IsEqual(input[6].length, 1) ? MappedDeferred(Identifier(input[3]), input[5], input[6][0], ApplyReadonly$1(input[1], ApplyOptional$1(input[8], input[10]))) : MappedDeferred(Identifier(input[3]), input[5], Ref(input[3]), ApplyReadonly$1(input[1], ApplyOptional$1(input[8], input[10])));
8202
+ function _Mapped_Mapping(input) {
8203
+ return IsArray$1(input[6]) && IsEqual(input[6].length, 1) ? MappedDeferred(Identifier(input[3]), input[5], input[6][0], ApplyReadonly(input[1], ApplyOptional(input[8], input[10]))) : MappedDeferred(Identifier(input[3]), input[5], Ref(input[3]), ApplyReadonly(input[1], ApplyOptional(input[8], input[10])));
8160
8204
  }
8161
8205
  function ReferenceMapping(input) {
8162
8206
  return Ref(input);
8163
8207
  }
8164
- function OptionsMapping(input) {
8165
- return OptionsDeferred(input[2], input[4]);
8208
+ function WithBigIntMapping(input) {
8209
+ return BigInt(input);
8166
8210
  }
8167
- function JsonNumberMapping(input) {
8211
+ function WithNumberMapping(input) {
8168
8212
  return parseFloat(input);
8169
8213
  }
8170
- function JsonBooleanMapping(input) {
8214
+ function WithBooleanMapping(input) {
8171
8215
  return IsEqual(input, "true");
8172
8216
  }
8173
- function JsonStringMapping(input) {
8217
+ function WithStringMapping(input) {
8174
8218
  return input;
8175
8219
  }
8176
- function JsonNullMapping(input) {
8220
+ function WithNullMapping(input) {
8177
8221
  return null;
8178
8222
  }
8179
- function JsonPropertyMapping(input) {
8223
+ function WithPropertyMapping(input) {
8180
8224
  return { [input[0]]: input[2] };
8181
8225
  }
8182
- function JsonPropertyListMapping(input) {
8226
+ function WithPropertyListMapping(input) {
8183
8227
  return Delimited(input);
8184
8228
  }
8185
- function JsonObjectMappingReduce(propertyList) {
8229
+ function WithObjectMappingReduce(propertyList) {
8186
8230
  return propertyList.reduce((result, left) => {
8187
8231
  return Assign(result, left);
8188
8232
  }, {});
8189
8233
  }
8190
- function JsonObjectMapping(input) {
8191
- return JsonObjectMappingReduce(input[1]);
8234
+ function WithObjectMapping(input) {
8235
+ return WithObjectMappingReduce(input[1]);
8192
8236
  }
8193
- function JsonElementListMapping(input) {
8237
+ function WithElementListMapping(input) {
8194
8238
  return Delimited(input);
8195
8239
  }
8196
- function JsonArrayMapping(input) {
8240
+ function WithArrayMapping(input) {
8197
8241
  return input[1];
8198
8242
  }
8199
- function JsonMapping(input) {
8243
+ function WithValueMapping(input) {
8200
8244
  return input;
8201
8245
  }
8202
8246
  function PatternBigIntMapping(input) {
@@ -8215,7 +8259,7 @@ function PatternNeverMapping(input) {
8215
8259
  return Never();
8216
8260
  }
8217
8261
  function PatternTextMapping(input) {
8218
- return Literal$1(input);
8262
+ return Literal(input);
8219
8263
  }
8220
8264
  function PatternBaseMapping(input) {
8221
8265
  return input;
@@ -8512,7 +8556,6 @@ var KeywordNever = (input) => If(Const("never", input), ([_0, input]) => [Keywor
8512
8556
  var KeywordSymbol = (input) => If(Const("symbol", input), ([_0, input]) => [KeywordSymbolMapping(_0), input]);
8513
8557
  var KeywordVoid = (input) => If(Const("void", input), ([_0, input]) => [KeywordVoidMapping(_0), input]);
8514
8558
  var KeywordThis = (input) => If(Const("this", input), ([_0, input]) => [KeywordThisMapping(_0), input]);
8515
- var Keyword = (input) => If(If(KeywordString(input), ([_0, input]) => [_0, input], () => If(KeywordNumber(input), ([_0, input]) => [_0, input], () => If(KeywordBoolean(input), ([_0, input]) => [_0, input], () => If(KeywordUndefined(input), ([_0, input]) => [_0, input], () => If(KeywordNull(input), ([_0, input]) => [_0, input], () => If(KeywordInteger(input), ([_0, input]) => [_0, input], () => If(KeywordBigInt(input), ([_0, input]) => [_0, input], () => If(KeywordUnknown(input), ([_0, input]) => [_0, input], () => If(KeywordAny(input), ([_0, input]) => [_0, input], () => If(KeywordObject(input), ([_0, input]) => [_0, input], () => If(KeywordNever(input), ([_0, input]) => [_0, input], () => If(KeywordSymbol(input), ([_0, input]) => [_0, input], () => If(KeywordVoid(input), ([_0, input]) => [_0, input], () => If(KeywordThis(input), ([_0, input]) => [_0, input], () => [])))))))))))))), ([_0, input]) => [KeywordMapping(_0), input]);
8516
8559
  var TemplateInterpolate = (input) => If(If(Const("${", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("}", input), ([_2, input]) => [[
8517
8560
  _0,
8518
8561
  _1,
@@ -8530,11 +8573,23 @@ var TemplateLiteralTypes = (input) => If(If(Const("`", input), ([_0, input]) =>
8530
8573
  _2
8531
8574
  ], input]))), ([_0, input]) => [TemplateLiteralTypesMapping(_0), input]);
8532
8575
  var TemplateLiteral$1 = (input) => If(TemplateLiteralTypes(input), ([_0, input]) => [TemplateLiteralMapping(_0), input]);
8576
+ var Dependent = (input) => If(If(If(Const("if", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("then", input), ([_2, input]) => If(Type(input), ([_3, input]) => If(Const("else", input), ([_4, input]) => If(Type(input), ([_5, input]) => [[
8577
+ _0,
8578
+ _1,
8579
+ _2,
8580
+ _3,
8581
+ _4,
8582
+ _5
8583
+ ], input])))))), ([_0, input]) => [_0, input], () => If(If(Const("if", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("then", input), ([_2, input]) => If(Type(input), ([_3, input]) => [[
8584
+ _0,
8585
+ _1,
8586
+ _2,
8587
+ _3
8588
+ ], input])))), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [DependentMapping(_0), input]);
8533
8589
  var LiteralBigInt = (input) => If(BigInt$1(input), ([_0, input]) => [LiteralBigIntMapping(_0), input]);
8534
8590
  var LiteralBoolean = (input) => If(If(Const("true", input), ([_0, input]) => [_0, input], () => If(Const("false", input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [LiteralBooleanMapping(_0), input]);
8535
8591
  var LiteralNumber = (input) => If(Number$1(input), ([_0, input]) => [LiteralNumberMapping(_0), input]);
8536
8592
  var LiteralString = (input) => If(String$1(["'", "\""], input), ([_0, input]) => [LiteralStringMapping(_0), input]);
8537
- var Literal = (input) => If(If(LiteralBigInt(input), ([_0, input]) => [_0, input], () => If(LiteralBoolean(input), ([_0, input]) => [_0, input], () => If(LiteralNumber(input), ([_0, input]) => [_0, input], () => If(LiteralString(input), ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [LiteralMapping(_0), input]);
8538
8593
  var KeyOf$1 = (input) => If(If(If(Const("keyof", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [KeyOfMapping(_0), input]);
8539
8594
  var IndexArray_0 = (input, result = []) => If(If(If(Const("[", input), ([_0, input]) => If(Type(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
8540
8595
  _0,
@@ -8554,9 +8609,9 @@ var Base = (input) => If(If(If(Const("(", input), ([_0, input]) => If(Type(input
8554
8609
  _0,
8555
8610
  _1,
8556
8611
  _2
8557
- ], input]))), ([_0, input]) => [_0, input], () => If(Keyword(input), ([_0, input]) => [_0, input], () => If(_Object_(input), ([_0, input]) => [_0, input], () => If(Tuple(input), ([_0, input]) => [_0, input], () => If(TemplateLiteral$1(input), ([_0, input]) => [_0, input], () => If(Literal(input), ([_0, input]) => [_0, input], () => If(Constructor(input), ([_0, input]) => [_0, input], () => If(_Function_(input), ([_0, input]) => [_0, input], () => If(Mapped$1(input), ([_0, input]) => [_0, input], () => If(Options$1(input), ([_0, input]) => [_0, input], () => If(GenericCall(input), ([_0, input]) => [_0, input], () => If(Reference(input), ([_0, input]) => [_0, input], () => [])))))))))))), ([_0, input]) => [BaseMapping(_0), input]);
8558
- var With = (input) => If(If(If(Const("with", input), ([_0, input]) => If(JsonObject(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithMapping(_0), input]);
8559
- var Factor = (input) => If(If(KeyOf$1(input), ([_0, input]) => If(Base(input), ([_1, input]) => If(IndexArray(input), ([_2, input]) => If(Extends$1(input), ([_3, input]) => If(With(input), ([_4, input]) => [[
8612
+ ], input]))), ([_0, input]) => [_0, input], () => If(KeywordString(input), ([_0, input]) => [_0, input], () => If(KeywordNumber(input), ([_0, input]) => [_0, input], () => If(KeywordBoolean(input), ([_0, input]) => [_0, input], () => If(KeywordUndefined(input), ([_0, input]) => [_0, input], () => If(KeywordNull(input), ([_0, input]) => [_0, input], () => If(KeywordInteger(input), ([_0, input]) => [_0, input], () => If(KeywordBigInt(input), ([_0, input]) => [_0, input], () => If(KeywordUnknown(input), ([_0, input]) => [_0, input], () => If(KeywordAny(input), ([_0, input]) => [_0, input], () => If(KeywordObject(input), ([_0, input]) => [_0, input], () => If(KeywordNever(input), ([_0, input]) => [_0, input], () => If(KeywordSymbol(input), ([_0, input]) => [_0, input], () => If(KeywordVoid(input), ([_0, input]) => [_0, input], () => If(KeywordThis(input), ([_0, input]) => [_0, input], () => If(LiteralBigInt(input), ([_0, input]) => [_0, input], () => If(LiteralBoolean(input), ([_0, input]) => [_0, input], () => If(LiteralNumber(input), ([_0, input]) => [_0, input], () => If(LiteralString(input), ([_0, input]) => [_0, input], () => If(TemplateLiteral$1(input), ([_0, input]) => [_0, input], () => If(Dependent(input), ([_0, input]) => [_0, input], () => If(_Object_(input), ([_0, input]) => [_0, input], () => If(_Tuple_(input), ([_0, input]) => [_0, input], () => If(_Constructor_(input), ([_0, input]) => [_0, input], () => If(_Function_(input), ([_0, input]) => [_0, input], () => If(_Mapped_(input), ([_0, input]) => [_0, input], () => If(GenericCall(input), ([_0, input]) => [_0, input], () => If(Reference(input), ([_0, input]) => [_0, input], () => [])))))))))))))))))))))))))))), ([_0, input]) => [BaseMapping(_0), input]);
8613
+ var With$1 = (input) => If(If(If(Const("with", input), ([_0, input]) => If(WithObject(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithMapping(_0), input]);
8614
+ var Factor = (input) => If(If(KeyOf$1(input), ([_0, input]) => If(Base(input), ([_1, input]) => If(IndexArray(input), ([_2, input]) => If(Extends$1(input), ([_3, input]) => If(With$1(input), ([_4, input]) => [[
8560
8615
  _0,
8561
8616
  _1,
8562
8617
  _2,
@@ -8650,11 +8705,11 @@ var ElementBase = (input) => If(If(ElementNamed(input), ([_0, input]) => [_0, in
8650
8705
  var Element$1 = (input) => If(If(If(Const("...", input), ([_0, input]) => If(ElementBase(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(ElementBase(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [ElementMapping(_0), input]);
8651
8706
  var ElementList_0 = (input, result = []) => If(If(Element$1(input), ([_0, input]) => If(Const(",", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ElementList_0(input, [...result, _0]), () => [result, input]);
8652
8707
  var ElementList = (input) => If(If(ElementList_0(input), ([_0, input]) => If(If(If(Element$1(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [ElementListMapping(_0), input]);
8653
- var Tuple = (input) => If(If(Const("[", input), ([_0, input]) => If(ElementList(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
8708
+ var _Tuple_ = (input) => If(If(Const("[", input), ([_0, input]) => If(ElementList(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
8654
8709
  _0,
8655
8710
  _1,
8656
8711
  _2
8657
- ], input]))), ([_0, input]) => [TupleMapping(_0), input]);
8712
+ ], input]))), ([_0, input]) => [_Tuple_Mapping(_0), input]);
8658
8713
  var ParameterReadonlyOptional = (input) => If(If(Ident(input), ([_0, input]) => If(Const("?", input), ([_1, input]) => If(Const(":", input), ([_2, input]) => If(Const("readonly", input), ([_3, input]) => If(Type(input), ([_4, input]) => [[
8659
8714
  _0,
8660
8715
  _1,
@@ -8690,18 +8745,18 @@ var _Function_ = (input) => If(If(Const("(", input), ([_0, input]) => If(Paramet
8690
8745
  _3,
8691
8746
  _4
8692
8747
  ], input]))))), ([_0, input]) => [_Function_Mapping(_0), input]);
8693
- var Constructor = (input) => If(If(Const("new", input), ([_0, input]) => If(Const("(", input), ([_1, input]) => If(ParameterList(input), ([_2, input]) => If(Const(")", input), ([_3, input]) => If(Const("=>", input), ([_4, input]) => If(Type(input), ([_5, input]) => [[
8748
+ var _Constructor_ = (input) => If(If(Const("new", input), ([_0, input]) => If(Const("(", input), ([_1, input]) => If(ParameterList(input), ([_2, input]) => If(Const(")", input), ([_3, input]) => If(Const("=>", input), ([_4, input]) => If(Type(input), ([_5, input]) => [[
8694
8749
  _0,
8695
8750
  _1,
8696
8751
  _2,
8697
8752
  _3,
8698
8753
  _4,
8699
8754
  _5
8700
- ], input])))))), ([_0, input]) => [ConstructorMapping(_0), input]);
8755
+ ], input])))))), ([_0, input]) => [_Constructor_Mapping(_0), input]);
8701
8756
  var MappedReadonly = (input) => If(If(If(Const("+", input), ([_0, input]) => If(Const("readonly", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("-", input), ([_0, input]) => If(Const("readonly", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("readonly", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [MappedReadonlyMapping(_0), input]);
8702
8757
  var MappedOptional = (input) => If(If(If(Const("+", input), ([_0, input]) => If(Const("?", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("-", input), ([_0, input]) => If(Const("?", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Const("?", input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [MappedOptionalMapping(_0), input]);
8703
8758
  var MappedAs = (input) => If(If(If(Const("as", input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [MappedAsMapping(_0), input]);
8704
- var Mapped$1 = (input) => If(If(Const("{", input), ([_0, input]) => If(MappedReadonly(input), ([_1, input]) => If(Const("[", input), ([_2, input]) => If(Ident(input), ([_3, input]) => If(Const("in", input), ([_4, input]) => If(Type(input), ([_5, input]) => If(MappedAs(input), ([_6, input]) => If(Const("]", input), ([_7, input]) => If(MappedOptional(input), ([_8, input]) => If(Const(":", input), ([_9, input]) => If(Type(input), ([_10, input]) => If(OptionalSemiColon(input), ([_11, input]) => If(Const("}", input), ([_12, input]) => [[
8759
+ var _Mapped_ = (input) => If(If(Const("{", input), ([_0, input]) => If(MappedReadonly(input), ([_1, input]) => If(Const("[", input), ([_2, input]) => If(Ident(input), ([_3, input]) => If(Const("in", input), ([_4, input]) => If(Type(input), ([_5, input]) => If(MappedAs(input), ([_6, input]) => If(Const("]", input), ([_7, input]) => If(MappedOptional(input), ([_8, input]) => If(Const(":", input), ([_9, input]) => If(Type(input), ([_10, input]) => If(OptionalSemiColon(input), ([_11, input]) => If(Const("}", input), ([_12, input]) => [[
8705
8760
  _0,
8706
8761
  _1,
8707
8762
  _2,
@@ -8715,49 +8770,43 @@ var Mapped$1 = (input) => If(If(Const("{", input), ([_0, input]) => If(MappedRea
8715
8770
  _10,
8716
8771
  _11,
8717
8772
  _12
8718
- ], input]))))))))))))), ([_0, input]) => [MappedMapping(_0), input]);
8773
+ ], input]))))))))))))), ([_0, input]) => [_Mapped_Mapping(_0), input]);
8719
8774
  var Reference = (input) => If(Ident(input), ([_0, input]) => [ReferenceMapping(_0), input]);
8720
- var Options$1 = (input) => If(If(Const("Options", input), ([_0, input]) => If(Const("<", input), ([_1, input]) => If(Type(input), ([_2, input]) => If(Const(",", input), ([_3, input]) => If(JsonObject(input), ([_4, input]) => If(Const(">", input), ([_5, input]) => [[
8721
- _0,
8722
- _1,
8723
- _2,
8724
- _3,
8725
- _4,
8726
- _5
8727
- ], input])))))), ([_0, input]) => [OptionsMapping(_0), input]);
8728
- var JsonNumber = (input) => If(Number$1(input), ([_0, input]) => [JsonNumberMapping(_0), input]);
8729
- var JsonBoolean = (input) => If(If(Const("true", input), ([_0, input]) => [_0, input], () => If(Const("false", input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [JsonBooleanMapping(_0), input]);
8730
- var JsonString = (input) => If(String$1(["\"", "'"], input), ([_0, input]) => [JsonStringMapping(_0), input]);
8731
- var JsonNull = (input) => If(Const("null", input), ([_0, input]) => [JsonNullMapping(_0), input]);
8732
- var JsonProperty = (input) => If(If(PropertyKey(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(Json(input), ([_2, input]) => [[
8775
+ var WithBigInt = (input) => If(BigInt$1(input), ([_0, input]) => [WithBigIntMapping(_0), input]);
8776
+ var WithNumber = (input) => If(Number$1(input), ([_0, input]) => [WithNumberMapping(_0), input]);
8777
+ var WithBoolean = (input) => If(If(Const("true", input), ([_0, input]) => [_0, input], () => If(Const("false", input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [WithBooleanMapping(_0), input]);
8778
+ var WithString = (input) => If(String$1(["\"", "'"], input), ([_0, input]) => [WithStringMapping(_0), input]);
8779
+ var WithNull = (input) => If(Const("null", input), ([_0, input]) => [WithNullMapping(_0), input]);
8780
+ var WithUndefined = (input) => If(Const("undefined", input), ([_0, input]) => [void 0, input]);
8781
+ var WithProperty = (input) => If(If(PropertyKey(input), ([_0, input]) => If(Const(":", input), ([_1, input]) => If(WithValue(input), ([_2, input]) => [[
8733
8782
  _0,
8734
8783
  _1,
8735
8784
  _2
8736
- ], input]))), ([_0, input]) => [JsonPropertyMapping(_0), input]);
8737
- var JsonPropertyList_0 = (input, result = []) => If(If(JsonProperty(input), ([_0, input]) => If(PropertyDelimiter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => JsonPropertyList_0(input, [...result, _0]), () => [result, input]);
8738
- var JsonPropertyList = (input) => If(If(JsonPropertyList_0(input), ([_0, input]) => If(If(If(JsonProperty(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [JsonPropertyListMapping(_0), input]);
8739
- var JsonObject = (input) => If(If(Const("{", input), ([_0, input]) => If(JsonPropertyList(input), ([_1, input]) => If(Const("}", input), ([_2, input]) => [[
8785
+ ], input]))), ([_0, input]) => [WithPropertyMapping(_0), input]);
8786
+ var WithPropertyList_0 = (input, result = []) => If(If(WithProperty(input), ([_0, input]) => If(PropertyDelimiter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithPropertyList_0(input, [...result, _0]), () => [result, input]);
8787
+ var WithPropertyList = (input) => If(If(WithPropertyList_0(input), ([_0, input]) => If(If(If(WithProperty(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [WithPropertyListMapping(_0), input]);
8788
+ var WithObject = (input) => If(If(Const("{", input), ([_0, input]) => If(WithPropertyList(input), ([_1, input]) => If(Const("}", input), ([_2, input]) => [[
8740
8789
  _0,
8741
8790
  _1,
8742
8791
  _2
8743
- ], input]))), ([_0, input]) => [JsonObjectMapping(_0), input]);
8744
- var JsonElementList_0 = (input, result = []) => If(If(Json(input), ([_0, input]) => If(Const(",", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => JsonElementList_0(input, [...result, _0]), () => [result, input]);
8745
- var JsonElementList = (input) => If(If(JsonElementList_0(input), ([_0, input]) => If(If(If(Json(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [JsonElementListMapping(_0), input]);
8746
- var JsonArray = (input) => If(If(Const("[", input), ([_0, input]) => If(JsonElementList(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
8792
+ ], input]))), ([_0, input]) => [WithObjectMapping(_0), input]);
8793
+ var WithElementList_0 = (input, result = []) => If(If(WithValue(input), ([_0, input]) => If(Const(",", input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => WithElementList_0(input, [...result, _0]), () => [result, input]);
8794
+ var WithElementList = (input) => If(If(WithElementList_0(input), ([_0, input]) => If(If(If(WithValue(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [WithElementListMapping(_0), input]);
8795
+ var WithArray = (input) => If(If(Const("[", input), ([_0, input]) => If(WithElementList(input), ([_1, input]) => If(Const("]", input), ([_2, input]) => [[
8747
8796
  _0,
8748
8797
  _1,
8749
8798
  _2
8750
- ], input]))), ([_0, input]) => [JsonArrayMapping(_0), input]);
8751
- var Json = (input) => If(If(JsonNumber(input), ([_0, input]) => [_0, input], () => If(JsonBoolean(input), ([_0, input]) => [_0, input], () => If(JsonString(input), ([_0, input]) => [_0, input], () => If(JsonNull(input), ([_0, input]) => [_0, input], () => If(JsonObject(input), ([_0, input]) => [_0, input], () => If(JsonArray(input), ([_0, input]) => [_0, input], () => [])))))), ([_0, input]) => [JsonMapping(_0), input]);
8799
+ ], input]))), ([_0, input]) => [WithArrayMapping(_0), input]);
8800
+ var WithValue = (input) => If(If(WithBigInt(input), ([_0, input]) => [_0, input], () => If(WithNumber(input), ([_0, input]) => [_0, input], () => If(WithBoolean(input), ([_0, input]) => [_0, input], () => If(WithString(input), ([_0, input]) => [_0, input], () => If(WithNull(input), ([_0, input]) => [_0, input], () => If(WithUndefined(input), ([_0, input]) => [_0, input], () => If(WithObject(input), ([_0, input]) => [_0, input], () => If(WithArray(input), ([_0, input]) => [_0, input], () => [])))))))), ([_0, input]) => [WithValueMapping(_0), input]);
8752
8801
  var PatternBigInt = (input) => If(Const("-?(?:0|[1-9][0-9]*)n", input), ([_0, input]) => [PatternBigIntMapping(_0), input]);
8753
8802
  var PatternString = (input) => If(Const(".*", input), ([_0, input]) => [PatternStringMapping(_0), input]);
8754
- var PatternNumber = (input) => If(Const("-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?", input), ([_0, input]) => [PatternNumberMapping(_0), input]);
8803
+ var PatternNumber = (input) => If(Const("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?", input), ([_0, input]) => [PatternNumberMapping(_0), input]);
8755
8804
  var PatternInteger = (input) => If(Const("-?(?:0|[1-9][0-9]*)", input), ([_0, input]) => [PatternIntegerMapping(_0), input]);
8756
8805
  var PatternNever = (input) => If(Const("(?!)", input), ([_0, input]) => [PatternNeverMapping(_0), input]);
8757
8806
  var PatternText = (input) => If(Until_1([
8758
8807
  "-?(?:0|[1-9][0-9]*)n",
8759
8808
  ".*",
8760
- "-?(?:0|[1-9][0-9]*)(?:.[0-9]+)?",
8809
+ "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",
8761
8810
  "-?(?:0|[1-9][0-9]*)",
8762
8811
  "(?!)",
8763
8812
  "(",
@@ -8847,7 +8896,7 @@ function EncodeNumber(right, pattern) {
8847
8896
  return EncodeTypes(right, `${pattern}${NumberPattern}`);
8848
8897
  }
8849
8898
  function EncodeBoolean(right, pattern) {
8850
- return EncodeType(Union([Literal$1("false"), Literal$1("true")]), right, pattern);
8899
+ return EncodeType(Union([Literal("false"), Literal("true")]), right, pattern);
8851
8900
  }
8852
8901
  function EncodeString(right, pattern) {
8853
8902
  return EncodeTypes(right, `${pattern}.*`);
@@ -8858,8 +8907,8 @@ function EncodeTemplateLiteral(templatePattern, right, pattern) {
8858
8907
  function EncodeTemplateLiteralDeferred(types, right, pattern) {
8859
8908
  return EncodeType(TemplateLiteralAction(types, {}), right, pattern);
8860
8909
  }
8861
- function EncodeEnum(types, right, pattern) {
8862
- return EncodeUnion(EnumValuesToVariants(types), right, pattern);
8910
+ function EncodeEnum(values, right, pattern) {
8911
+ return EncodeType(EvaluateEnum(values), right, pattern);
8863
8912
  }
8864
8913
  function EncodeUnion(types, right, pattern, result = []) {
8865
8914
  return TakeLeft(types, (head, tail) => EncodeUnion(tail, right, pattern, [...result, EncodeType(head, [], "")]), () => EncodeTypes(right, `${pattern}(${JoinString(result)})`));
@@ -8945,20 +8994,23 @@ function ExtendsRightInfer(inferred, name, left, right) {
8945
8994
  function ExtendsRightAny(inferred, _left) {
8946
8995
  return ExtendsTrue(inferred);
8947
8996
  }
8997
+ function ExtendsRightDependent(inferred, left, if_, then_, else_) {
8998
+ return Match(ExtendsLeft(inferred, left, if_), (inferred) => Match(ExtendsLeft(inferred, left, then_), (inferred) => ExtendsTrue(inferred), () => ExtendsFalse()), () => Match(ExtendsLeft(inferred, left, else_), (inferred) => ExtendsTrue(inferred), () => ExtendsFalse()));
8999
+ }
8948
9000
  function ExtendsRightEnum(inferred, left, right) {
8949
- return ExtendsLeft(inferred, left, EnumValuesToUnion(right));
9001
+ return ExtendsLeft(inferred, left, EvaluateEnum(right));
8950
9002
  }
8951
9003
  function ExtendsRightIntersect(inferred, left, right) {
8952
9004
  return TakeLeft(right, (head, tail) => Match(ExtendsLeft(inferred, left, head), (inferred) => ExtendsRightIntersect(inferred, left, tail), () => ExtendsFalse()), () => ExtendsTrue(inferred));
8953
9005
  }
8954
9006
  function ExtendsRightTemplateLiteral(inferred, left, right) {
8955
- return ExtendsLeft(inferred, left, TemplateLiteralDecode(right));
9007
+ return ExtendsLeft(inferred, left, EvaluateTemplateLiteral(right));
8956
9008
  }
8957
9009
  function ExtendsRightUnion(inferred, left, right) {
8958
9010
  return TakeLeft(right, (head, tail) => Match(ExtendsLeft(inferred, left, head), (inferred) => ExtendsTrue(inferred), () => ExtendsRightUnion(inferred, left, tail)), () => ExtendsFalse());
8959
9011
  }
8960
9012
  function ExtendsRight(inferred, left, right) {
8961
- return IsAny(right) ? ExtendsRightAny(inferred, left) : IsEnum(right) ? ExtendsRightEnum(inferred, left, right.enum) : IsInfer(right) ? ExtendsRightInfer(inferred, right.name, left, right.extends) : IsIntersect(right) ? ExtendsRightIntersect(inferred, left, right.allOf) : IsTemplateLiteral(right) ? ExtendsRightTemplateLiteral(inferred, left, right.pattern) : IsUnion(right) ? ExtendsRightUnion(inferred, left, right.anyOf) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
9013
+ return IsAny(right) ? ExtendsRightAny(inferred, left) : IsDependent(right) ? ExtendsRightDependent(inferred, left, right.if, right.then, right.else) : IsEnum(right) ? ExtendsRightEnum(inferred, left, right.enum) : IsInfer(right) ? ExtendsRightInfer(inferred, right.name, left, right.extends) : IsIntersect(right) ? ExtendsRightIntersect(inferred, left, right.allOf) : IsTemplateLiteral(right) ? ExtendsRightTemplateLiteral(inferred, left, right.pattern) : IsUnion(right) ? ExtendsRightUnion(inferred, left, right.anyOf) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
8962
9014
  }
8963
9015
  function ExtendsAny(inferred, left, right) {
8964
9016
  return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsUnion$1(inferred);
@@ -9002,8 +9054,11 @@ function ExtendsReturnType(inferred, left, right) {
9002
9054
  function ExtendsConstructor(inferred, parameters, returnType, right) {
9003
9055
  return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsConstructor(right) ? Match(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred) => ExtendsReturnType(inferred, returnType, right["instanceType"]), () => ExtendsFalse()) : ExtendsFalse();
9004
9056
  }
9057
+ function ExtendsDependent(inferred, if_, then_, else_, right) {
9058
+ return Match(ExtendsLeft(inferred, if_, right), () => ExtendsLeft(inferred, then_, right), () => ExtendsLeft(inferred, else_, right));
9059
+ }
9005
9060
  function ExtendsEnum(inferred, left, right) {
9006
- return ExtendsLeft(inferred, EnumToUnion(left), right);
9061
+ return ExtendsLeft(inferred, EvaluateEnum(left), right);
9007
9062
  }
9008
9063
  function ExtendsFunction(inferred, parameters, returnType, right) {
9009
9064
  return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsFunction(right) ? Match(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred) => ExtendsReturnType(inferred, returnType, right["returnType"]), () => ExtendsFalse()) : ExtendsFalse();
@@ -9021,16 +9076,16 @@ function ExtendsLiteralValue(inferred, left, right) {
9021
9076
  return left === right ? ExtendsTrue(inferred) : ExtendsFalse();
9022
9077
  }
9023
9078
  function ExtendsLiteralBigInt(inferred, left, right) {
9024
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBigInt(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal$1(left), right);
9079
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBigInt(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
9025
9080
  }
9026
9081
  function ExtendsLiteralBoolean(inferred, left, right) {
9027
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBoolean(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal$1(left), right);
9082
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBoolean(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
9028
9083
  }
9029
9084
  function ExtendsLiteralNumber(inferred, left, right) {
9030
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal$1(left), right);
9085
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
9031
9086
  }
9032
9087
  function ExtendsLiteralString(inferred, left, right) {
9033
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsString(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal$1(left), right);
9088
+ return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsString(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
9034
9089
  }
9035
9090
  function ExtendsLiteral(inferred, left, right) {
9036
9091
  return IsBigInt$1(left.const) ? ExtendsLiteralBigInt(inferred, left.const, right) : IsBoolean$1(left.const) ? ExtendsLiteralBoolean(inferred, left.const, right) : IsNumber$1(left.const) ? ExtendsLiteralNumber(inferred, left.const, right) : IsString$1(left.const) ? ExtendsLiteralString(inferred, left.const, right) : Unreachable$1();
@@ -9085,7 +9140,7 @@ function ExtendsSymbol(inferred, left, right) {
9085
9140
  return IsSymbol(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
9086
9141
  }
9087
9142
  function ExtendsTemplateLiteral(inferred, left, right) {
9088
- return ExtendsLeft(inferred, TemplateLiteralDecode(left), right);
9143
+ return ExtendsLeft(inferred, EvaluateTemplateLiteral(left), right);
9089
9144
  }
9090
9145
  function Inferrable(name, type) {
9091
9146
  return Create({ "~kind": "Inferrable" }, {
@@ -9107,7 +9162,7 @@ function TryInferResults(rest, right, result = []) {
9107
9162
  }
9108
9163
  function InferTupleResult(inferred, name, left, right) {
9109
9164
  const results = TryInferResults(left, right);
9110
- return IsArray$1(results) ? ExtendsTrue(Assign(inferred, { [name]: Tuple$1(results) })) : ExtendsFalse();
9165
+ return IsArray$1(results) ? ExtendsTrue(Assign(inferred, { [name]: Tuple(results) })) : ExtendsFalse();
9111
9166
  }
9112
9167
  function InferUnionResult(inferred, name, left, right) {
9113
9168
  const results = TryInferResults(left, right);
@@ -9137,7 +9192,7 @@ function Elements(inferred, reversed, leftRest, rightRest) {
9137
9192
  return ElementsRight(inferred, reversed, leftRest, rightRest);
9138
9193
  }
9139
9194
  function ExtendsTupleToTuple(inferred, left, right) {
9140
- const instantiatedRight = InstantiateElements(inferred, { callstack: [] }, right);
9195
+ const instantiatedRight = InstantiateElements(inferred, State([], []), right);
9141
9196
  const reversed = Reversed(instantiatedRight);
9142
9197
  return Elements(inferred, reversed, ApplyReverse(left, reversed), ApplyReverse(instantiatedRight, reversed));
9143
9198
  }
@@ -9146,8 +9201,8 @@ function ExtendsTupleToArray(inferred, left, right) {
9146
9201
  return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable["name"], left, inferrable["type"]) : TakeLeft(left, (head, tail) => Match(ExtendsLeft(inferred, head, right), (inferred) => ExtendsTupleToArray(inferred, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
9147
9202
  }
9148
9203
  function ExtendsTuple(inferred, left, right) {
9149
- const instantiatedLeft = InstantiateElements(inferred, { callstack: [] }, left);
9150
- return IsTuple(right) ? ExtendsTupleToTuple(inferred, instantiatedLeft, right.items) : IsArray(right) ? ExtendsTupleToArray(inferred, instantiatedLeft, right.items) : ExtendsRight(inferred, Tuple$1(instantiatedLeft), right);
9204
+ const instantiatedLeft = InstantiateElements(inferred, State([], []), left);
9205
+ return IsTuple(right) ? ExtendsTupleToTuple(inferred, instantiatedLeft, right.items) : IsArray(right) ? ExtendsTupleToArray(inferred, instantiatedLeft, right.items) : ExtendsRight(inferred, Tuple(instantiatedLeft), right);
9151
9206
  }
9152
9207
  function ExtendsUndefined(inferred, left, right) {
9153
9208
  return IsVoid(right) ? ExtendsTrue(inferred) : IsUndefined(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
@@ -9169,7 +9224,7 @@ function ExtendsVoid(inferred, left, right) {
9169
9224
  return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
9170
9225
  }
9171
9226
  function ExtendsLeft(inferred, left, right) {
9172
- return IsAny(left) ? ExtendsAny(inferred, left, right) : IsArray(left) ? ExtendsArray(inferred, left, left.items, right) : IsAsyncIterator(left) ? ExtendsAsyncIterator(inferred, left.iteratorItems, right) : IsBigInt(left) ? ExtendsBigInt(inferred, left, right) : IsBoolean(left) ? ExtendsBoolean(inferred, left, right) : IsConstructor(left) ? ExtendsConstructor(inferred, left.parameters, left.instanceType, right) : IsEnum(left) ? ExtendsEnum(inferred, left, right) : IsFunction(left) ? ExtendsFunction(inferred, left.parameters, left.returnType, right) : IsInteger(left) ? ExtendsInteger(inferred, left, right) : IsIntersect(left) ? ExtendsIntersect(inferred, left.allOf, right) : IsIterator(left) ? ExtendsIterator(inferred, left.iteratorItems, right) : IsLiteral(left) ? ExtendsLiteral(inferred, left, right) : IsNever(left) ? ExtendsNever(inferred, left, right) : IsNull(left) ? ExtendsNull(inferred, left, right) : IsNumber(left) ? ExtendsNumber(inferred, left, right) : IsObject(left) ? ExtendsObject(inferred, left.properties, right) : IsPromise(left) ? ExtendsPromise(inferred, left.item, right) : IsString(left) ? ExtendsString(inferred, left, right) : IsSymbol(left) ? ExtendsSymbol(inferred, left, right) : IsTemplateLiteral(left) ? ExtendsTemplateLiteral(inferred, left.pattern, right) : IsTuple(left) ? ExtendsTuple(inferred, left.items, right) : IsUndefined(left) ? ExtendsUndefined(inferred, left, right) : IsUnion(left) ? ExtendsUnion(inferred, left.anyOf, right) : IsUnknown(left) ? ExtendsUnknown(inferred, left, right) : IsVoid(left) ? ExtendsVoid(inferred, left, right) : ExtendsFalse();
9227
+ return IsAny(left) ? ExtendsAny(inferred, left, right) : IsArray(left) ? ExtendsArray(inferred, left, left.items, right) : IsAsyncIterator(left) ? ExtendsAsyncIterator(inferred, left.iteratorItems, right) : IsBigInt(left) ? ExtendsBigInt(inferred, left, right) : IsBoolean(left) ? ExtendsBoolean(inferred, left, right) : IsConstructor(left) ? ExtendsConstructor(inferred, left.parameters, left.instanceType, right) : IsDependent(left) ? ExtendsDependent(inferred, left.if, left.then, left.else, right) : IsEnum(left) ? ExtendsEnum(inferred, left.enum, right) : IsFunction(left) ? ExtendsFunction(inferred, left.parameters, left.returnType, right) : IsInteger(left) ? ExtendsInteger(inferred, left, right) : IsIntersect(left) ? ExtendsIntersect(inferred, left.allOf, right) : IsIterator(left) ? ExtendsIterator(inferred, left.iteratorItems, right) : IsLiteral(left) ? ExtendsLiteral(inferred, left, right) : IsNever(left) ? ExtendsNever(inferred, left, right) : IsNull(left) ? ExtendsNull(inferred, left, right) : IsNumber(left) ? ExtendsNumber(inferred, left, right) : IsObject(left) ? ExtendsObject(inferred, left.properties, right) : IsPromise(left) ? ExtendsPromise(inferred, left.item, right) : IsString(left) ? ExtendsString(inferred, left, right) : IsSymbol(left) ? ExtendsSymbol(inferred, left, right) : IsTemplateLiteral(left) ? ExtendsTemplateLiteral(inferred, left.pattern, right) : IsTuple(left) ? ExtendsTuple(inferred, left.items, right) : IsUndefined(left) ? ExtendsUndefined(inferred, left, right) : IsUnion(left) ? ExtendsUnion(inferred, left.anyOf, right) : IsUnknown(left) ? ExtendsUnknown(inferred, left, right) : IsVoid(left) ? ExtendsVoid(inferred, left, right) : ExtendsFalse();
9173
9228
  }
9174
9229
  function InterfaceOperation(heritage, properties) {
9175
9230
  return EvaluateIntersect([...heritage, _Object_$1(properties)]);
@@ -9252,7 +9307,7 @@ function FromTypes$1(types) {
9252
9307
  }, []);
9253
9308
  }
9254
9309
  function FromType$13(type) {
9255
- return IsRef(type) ? FromRef$1(type.$ref) : IsArray(type) ? _Array_(FromType$13(type.items), ArrayOptions(type)) : IsAsyncIterator(type) ? AsyncIterator(FromType$13(type.iteratorItems)) : IsConstructor(type) ? Constructor$1(FromTypes$1(type.parameters), FromType$13(type.instanceType)) : IsFunction(type) ? _Function_$1(FromTypes$1(type.parameters), FromType$13(type.returnType)) : IsIntersect(type) ? Intersect(FromTypes$1(type.allOf)) : IsIterator(type) ? Iterator(FromType$13(type.iteratorItems)) : IsObject(type) ? _Object_$1(FromProperties(type.properties)) : IsPromise(type) ? _Promise_(FromType$13(type.item)) : IsRecord(type) ? Record(RecordKey(type), FromType$13(RecordValue(type))) : IsUnion(type) ? Union(FromTypes$1(type.anyOf)) : IsTuple(type) ? Tuple$1(FromTypes$1(type.items)) : type;
9310
+ return IsRef(type) ? FromRef$1(type.$ref) : IsArray(type) ? _Array_(FromType$13(type.items), ArrayOptions(type)) : IsAsyncIterator(type) ? AsyncIterator(FromType$13(type.iteratorItems)) : IsConstructor(type) ? Constructor(FromTypes$1(type.parameters), FromType$13(type.instanceType)) : IsFunction(type) ? _Function_$1(FromTypes$1(type.parameters), FromType$13(type.returnType)) : IsIntersect(type) ? Intersect(FromTypes$1(type.allOf)) : IsIterator(type) ? Iterator(FromType$13(type.iteratorItems)) : IsObject(type) ? _Object_$1(FromProperties(type.properties)) : IsPromise(type) ? _Promise_(FromType$13(type.item)) : IsRecord(type) ? Record(RecordKey(type), FromType$13(RecordValue(type))) : IsUnion(type) ? Union(FromTypes$1(type.anyOf)) : IsTuple(type) ? Tuple(FromTypes$1(type.items)) : type;
9256
9311
  }
9257
9312
  function CyclicAnyFromParameters(defs, ref) {
9258
9313
  return ref in defs ? FromType$13(defs[ref]) : Unknown();
@@ -9262,8 +9317,8 @@ function CyclicExtends(type) {
9262
9317
  return CyclicAnyFromParameters(type.$defs, type.$ref);
9263
9318
  }
9264
9319
  function CyclicInterface(context, heritage, properties) {
9265
- const instantiatedHeritage = InstantiateTypes(context, { callstack: [] }, heritage);
9266
- const instantiatedProperties = InstantiateProperties({}, { callstack: [] }, properties);
9320
+ const instantiatedHeritage = InstantiateTypes(context, State([], []), heritage);
9321
+ const instantiatedProperties = InstantiateProperties({}, State([], []), properties);
9267
9322
  return EvaluateIntersect([...instantiatedHeritage, _Object_$1(instantiatedProperties)]);
9268
9323
  }
9269
9324
  function CyclicDefinitions(context, dependencies) {
@@ -9413,7 +9468,9 @@ function IsTailCall(state, name) {
9413
9468
  return IsEqual(Peek(state), name);
9414
9469
  }
9415
9470
  function CallDispatch(context, state, target, parameters, expression, arguments_) {
9416
- return InstantiateType(context, state, InstantiateType(ResolveArgumentsContext(context, state, parameters, arguments_), { callstack: [...state.callstack, target.$ref] }, expression));
9471
+ const argumentsContext = ResolveArgumentsContext(context, state, parameters, arguments_);
9472
+ const returnType = InstantiateType(argumentsContext, State([...state["callstack"], target["$ref"]], state["visited"]), expression);
9473
+ return InstantiateType(argumentsContext, State([], []), returnType);
9417
9474
  }
9418
9475
  function CallDistributed(context, state, target, parameters, expression, distributedArguments) {
9419
9476
  return distributedArguments.reduce((result, arguments_) => [...result, CallDispatch(context, state, target, parameters, expression, arguments_)], []);
@@ -9431,26 +9488,57 @@ function CallInstantiate(context, state, target, arguments_) {
9431
9488
  }
9432
9489
  function CallConstruct(target, arguments_) {
9433
9490
  return Create({ ["~kind"]: "Call" }, {
9491
+ type: "call",
9434
9492
  target,
9435
9493
  arguments: arguments_
9436
9494
  }, {});
9437
9495
  }
9438
9496
  /** Creates a Call type. */
9439
9497
  function Call(target, arguments_) {
9440
- return CallInstantiate({}, { callstack: [] }, target, arguments_);
9498
+ return CallInstantiate({}, State([], []), target, arguments_);
9441
9499
  }
9442
9500
  /** Returns true if the given type is a TCall. */
9443
9501
  function IsCall(value) {
9444
9502
  return IsKind(value, "Call");
9445
9503
  }
9504
+ function RemoveImmutableOperation(type) {
9505
+ return Discard(type, ["~immutable"]);
9506
+ }
9507
+ function RemoveImmutableAction(type, options) {
9508
+ return Update(RemoveImmutableOperation(type), {}, options);
9509
+ }
9510
+ function RemoveImmutableInstantiate(context, state, type, options) {
9511
+ return RemoveImmutableAction(InstantiateType(context, state, type), options);
9512
+ }
9513
+ /** Creates a deferred Awaited action. */
9514
+ function AwaitedDeferred(type, options = {}) {
9515
+ return Deferred("Awaited", [type], options);
9516
+ }
9517
+ /**
9518
+ * Applies an Awaited action to a type.
9519
+ *
9520
+ * @deprecated This action is being removed in the next version of TypeBox.
9521
+ */
9522
+ function Awaited(type, options = {}) {
9523
+ return AwaitedAction(type, options);
9524
+ }
9525
+ function AwaitedOperation(type) {
9526
+ return IsPromise(type) ? AwaitedOperation(type.item) : type;
9527
+ }
9528
+ function AwaitedAction(type, options) {
9529
+ return CanInstantiate([type]) ? Update(AwaitedOperation(type), {}, options) : AwaitedDeferred(type, options);
9530
+ }
9531
+ function AwaitedInstantiate(context, state, type, options) {
9532
+ return AwaitedAction(InstantiateType(context, state, type), options);
9533
+ }
9446
9534
  function ApplyMapping(mapping, value) {
9447
9535
  return mapping(value);
9448
9536
  }
9449
9537
  function FromLiteral$2(mapping, value) {
9450
- return IsString$1(value) ? Literal$1(ApplyMapping(mapping, value)) : Literal$1(value);
9538
+ return IsString$1(value) ? Literal(ApplyMapping(mapping, value)) : Literal(value);
9451
9539
  }
9452
9540
  function FromTemplateLiteral$2(mapping, pattern) {
9453
- return FromType$11(mapping, TemplateLiteralDecode(pattern));
9541
+ return FromType$11(mapping, EvaluateTemplateLiteral(pattern));
9454
9542
  }
9455
9543
  function FromUnion$6(mapping, types) {
9456
9544
  return Union(types.map((type) => FromType$11(mapping, type)));
@@ -9529,7 +9617,7 @@ function ConditionalDeferred(left, right, true_, false_, options = {}) {
9529
9617
  }
9530
9618
  /** Applies a Conditional action to the given types. */
9531
9619
  function Conditional(left, right, true_, false_, options = {}) {
9532
- return ConditionalAction({}, { callstack: [] }, left, right, true_, false_, options);
9620
+ return ConditionalAction({}, State([], []), left, right, true_, false_, options);
9533
9621
  }
9534
9622
  function ConditionalOperation(context, state, left, right, true_, false_) {
9535
9623
  const extendsResult = Extends(context, left, right);
@@ -9550,7 +9638,8 @@ function ConstructorParameters(type, options = {}) {
9550
9638
  return ConstructorParametersAction(type, options);
9551
9639
  }
9552
9640
  function ConstructorParametersOperation(type) {
9553
- return Tuple$1(InstantiateElements({}, { callstack: [] }, IsConstructor(type) ? type["parameters"] : []));
9641
+ const parameters = IsConstructor(type) ? type["parameters"] : [];
9642
+ return Tuple(InstantiateElements({}, State([], []), parameters));
9554
9643
  }
9555
9644
  function ConstructorParametersAction(type, options) {
9556
9645
  return CanInstantiate([type]) ? Update(ConstructorParametersOperation(type), {}, options) : ConstructorParametersDeferred(type, options);
@@ -9566,17 +9655,6 @@ function ExcludeDeferred(left, right, options = {}) {
9566
9655
  function Exclude(left, right, options = {}) {
9567
9656
  return ExcludeAction(left, right, options);
9568
9657
  }
9569
- function ExcludeUnionLeft(types, right) {
9570
- return types.reduce((result, head) => {
9571
- return [...result, ...ExcludeTypeLeft(head, right)];
9572
- }, []);
9573
- }
9574
- function ExcludeTypeLeft(left, right) {
9575
- return IsExtendsTrueLike(Extends({}, left, right)) ? [] : [left];
9576
- }
9577
- function ExcludeOperation(left, right) {
9578
- return EvaluateUnion(IsEnum(left) ? ExcludeUnionLeft(EnumValuesToVariants(left.enum), right) : IsUnion(left) ? ExcludeUnionLeft(Flatten(left.anyOf), right) : ExcludeTypeLeft(left, right));
9579
- }
9580
9658
  function ExcludeAction(left, right, options) {
9581
9659
  return CanInstantiate([left, right]) ? Update(ExcludeOperation(left, right), {}, options) : ExcludeDeferred(left, right, options);
9582
9660
  }
@@ -9591,16 +9669,17 @@ function ExtractDeferred(left, right, options = {}) {
9591
9669
  function Extract(left, right, options = {}) {
9592
9670
  return ExtractAction(left, right, options);
9593
9671
  }
9594
- function ExtractUnionLeft(types, right) {
9672
+ function ExtractType(left, right) {
9673
+ return IsExtendsTrueLike(Extends({}, left, right)) ? [left] : [];
9674
+ }
9675
+ function ExtractUnion(types, right) {
9595
9676
  return types.reduce((result, head) => {
9596
- return [...result, ...ExtractTypeLeft(head, right)];
9677
+ return [...result, ...ExtractType(head, right)];
9597
9678
  }, []);
9598
9679
  }
9599
- function ExtractTypeLeft(left, right) {
9600
- return IsExtendsTrueLike(Extends({}, left, right)) ? [left] : [];
9601
- }
9602
9680
  function ExtractOperation(left, right) {
9603
- return EvaluateUnion(IsEnum(left) ? ExtractUnionLeft(EnumValuesToVariants(left.enum), right) : IsUnion(left) ? ExtractUnionLeft(Flatten(left.anyOf), right) : ExtractTypeLeft(left, right));
9681
+ const evaluated = EvaluateType(left);
9682
+ return EvaluateUnion(ExtractUnion(IsUnion(evaluated) ? evaluated.anyOf : [evaluated], right));
9604
9683
  }
9605
9684
  function ExtractAction(left, right, options) {
9606
9685
  return CanInstantiate([left, right]) ? Update(ExtractOperation(left, right), {}, options) : ExtractDeferred(left, right, options);
@@ -9610,7 +9689,7 @@ function ExtractInstantiate(context, state, left, right, options) {
9610
9689
  }
9611
9690
  function KeysToLiterals(keys) {
9612
9691
  return keys.reduce((result, left) => {
9613
- return IsLiteralValue(left) ? [...result, Literal$1(left)] : result;
9692
+ return IsLiteralValue(left) ? [...result, Literal(left)] : result;
9614
9693
  }, []);
9615
9694
  }
9616
9695
  function KeysToIndexer(keys) {
@@ -9627,6 +9706,9 @@ function Index(type, indexer_or_keys, options = {}) {
9627
9706
  function FromCyclic$4(defs, ref) {
9628
9707
  return FromType$10(CyclicTarget(defs, ref));
9629
9708
  }
9709
+ function FromDependent$4(if_, then_, else_) {
9710
+ return FromType$10(EvaluateDependent(if_, then_, else_));
9711
+ }
9630
9712
  function CollapseIntersectProperties(left, right) {
9631
9713
  const leftKeys = Keys(left).filter((key) => !HasPropertyKey(right, key));
9632
9714
  const rightKeys = Keys(right).filter((key) => !HasPropertyKey(left, key));
@@ -9654,7 +9736,7 @@ function FromObject$5(properties) {
9654
9736
  return properties;
9655
9737
  }
9656
9738
  function FromTuple$3(types) {
9657
- return FromType$10(TupleToObject(Tuple$1(types)));
9739
+ return FromType$10(TupleToObject(Tuple(types)));
9658
9740
  }
9659
9741
  function CollapseUnionProperties(left, right) {
9660
9742
  return Keys(left).filter((key) => key in right).reduce((result, key) => {
@@ -9671,7 +9753,7 @@ function FromUnion$5(types) {
9671
9753
  return TakeLeft(types, (left, right) => ReduceVariants(right, FromType$10(left)), () => Unreachable$1());
9672
9754
  }
9673
9755
  function FromType$10(type) {
9674
- return IsCyclic(type) ? FromCyclic$4(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect$4(type.allOf) : IsUnion(type) ? FromUnion$5(type.anyOf) : IsTuple(type) ? FromTuple$3(type.items) : IsObject(type) ? FromObject$5(type.properties) : {};
9756
+ return IsCyclic(type) ? FromCyclic$4(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$4(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$4(type.allOf) : IsUnion(type) ? FromUnion$5(type.anyOf) : IsTuple(type) ? FromTuple$3(type.items) : IsObject(type) ? FromObject$5(type.properties) : {};
9675
9757
  }
9676
9758
  /**
9677
9759
  * Collapses a type into a TObject schema. This is a lossy fast path used to
@@ -9688,7 +9770,7 @@ function ConvertToIntegerKey(value) {
9688
9770
  return integerKeyPattern.test(normal) ? parseInt(normal) : value;
9689
9771
  }
9690
9772
  function NormalizeLiteral(value) {
9691
- return Literal$1(ConvertToIntegerKey(value));
9773
+ return Literal(ConvertToIntegerKey(value));
9692
9774
  }
9693
9775
  function NormalizeIndexerTypes(types) {
9694
9776
  return types.map((type) => NormalizeIndexer(type));
@@ -9702,13 +9784,11 @@ function FromArray$2(type, indexer) {
9702
9784
  function FromCyclic$3(defs, ref) {
9703
9785
  return FromType$9(CyclicTarget(defs, ref));
9704
9786
  }
9705
- function FromUnion$4(types) {
9706
- return types.reduce((result, left) => {
9707
- return [...result, ...FromType$9(left)];
9708
- }, []);
9787
+ function FromDependent$3(if_, then_, else_) {
9788
+ return FromType$9(EvaluateDependent(if_, then_, else_));
9709
9789
  }
9710
- function FromEnum(values) {
9711
- return FromUnion$4(EnumValuesToVariants(values));
9790
+ function FromEnum$1(values) {
9791
+ return FromType$9(EvaluateEnum(values));
9712
9792
  }
9713
9793
  function FromIntersect$3(types) {
9714
9794
  return FromType$9(EvaluateIntersect(types));
@@ -9717,10 +9797,15 @@ function FromLiteral$1(value) {
9717
9797
  return [`${value}`];
9718
9798
  }
9719
9799
  function FromTemplateLiteral$1(pattern) {
9720
- return FromType$9(TemplateLiteralDecode(pattern));
9800
+ return FromType$9(EvaluateTemplateLiteral(pattern));
9801
+ }
9802
+ function FromUnion$4(types) {
9803
+ return types.reduce((result, left) => {
9804
+ return [...result, ...FromType$9(left)];
9805
+ }, []);
9721
9806
  }
9722
9807
  function FromType$9(type) {
9723
- return IsCyclic(type) ? FromCyclic$3(type.$defs, type.$ref) : IsEnum(type) ? FromEnum(type.enum) : IsIntersect(type) ? FromIntersect$3(type.allOf) : IsLiteral(type) ? FromLiteral$1(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral$1(type.pattern) : IsUnion(type) ? FromUnion$4(type.anyOf) : [];
9808
+ return IsCyclic(type) ? FromCyclic$3(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$3(type.if, type.then, type.else) : IsEnum(type) ? FromEnum$1(type.enum) : IsIntersect(type) ? FromIntersect$3(type.allOf) : IsLiteral(type) ? FromLiteral$1(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral$1(type.pattern) : IsUnion(type) ? FromUnion$4(type.anyOf) : [];
9724
9809
  }
9725
9810
  /**
9726
9811
  * Transforms a type meant as an Indexer into string[] array which is used by Indexable types
@@ -9735,7 +9820,7 @@ function FromTypes(properties, types) {
9735
9820
  return types.map((type) => FromType$8(properties, type));
9736
9821
  }
9737
9822
  function FromType$8(properties, type) {
9738
- return IsArray(type) ? _Array_(FromType$8(properties, type.items)) : IsAsyncIterator(type) ? AsyncIterator(FromType$8(properties, type.iteratorItems)) : IsConstructor(type) ? Constructor$1(FromTypes(properties, type.parameters), FromType$8(properties, type.instanceType)) : IsFunction(type) ? _Function_$1(FromTypes(properties, type.parameters), FromType$8(properties, type.returnType)) : IsIterator(type) ? Iterator(FromType$8(properties, type.iteratorItems)) : IsPromise(type) ? _Promise_(FromType$8(properties, type.item)) : IsTuple(type) ? Tuple$1(FromTypes(properties, type.items)) : IsUnion(type) ? Union(FromTypes(properties, type.anyOf)) : IsIntersect(type) ? Intersect(FromTypes(properties, type.allOf)) : IsThis(type) ? _Object_$1(properties) : type;
9823
+ return IsArray(type) ? _Array_(FromType$8(properties, type.items)) : IsAsyncIterator(type) ? AsyncIterator(FromType$8(properties, type.iteratorItems)) : IsConstructor(type) ? Constructor(FromTypes(properties, type.parameters), FromType$8(properties, type.instanceType)) : IsFunction(type) ? _Function_$1(FromTypes(properties, type.parameters), FromType$8(properties, type.returnType)) : IsIterator(type) ? Iterator(FromType$8(properties, type.iteratorItems)) : IsPromise(type) ? _Promise_(FromType$8(properties, type.item)) : IsTuple(type) ? Tuple(FromTypes(properties, type.items)) : IsUnion(type) ? Union(FromTypes(properties, type.anyOf)) : IsIntersect(type) ? Intersect(FromTypes(properties, type.allOf)) : IsThis(type) ? _Object_$1(properties) : type;
9739
9824
  }
9740
9825
  function ExpandThis(properties, type) {
9741
9826
  return FromType$8(properties, type);
@@ -9762,7 +9847,7 @@ function FromObject$4(properties, indexer) {
9762
9847
  return IsNumber(indexer) ? FromIndexerNumber(properties) : FromIndexer(properties, indexer);
9763
9848
  }
9764
9849
  function ConvertLiteral(value) {
9765
- return Literal$1(ConvertToIntegerKey(value));
9850
+ return Literal(ConvertToIntegerKey(value));
9766
9851
  }
9767
9852
  function ArrayIndexerTypes(types) {
9768
9853
  return types.map((type) => FormatArrayIndexer(type));
@@ -9773,7 +9858,7 @@ function FormatArrayIndexer(type) {
9773
9858
  }
9774
9859
  function IndexElementsWithIndexer(types, indexer) {
9775
9860
  return types.reduceRight((result, right, index) => {
9776
- return IsExtendsTrueLike(Extends({}, Literal$1(index), indexer)) ? [right, ...result] : result;
9861
+ return IsExtendsTrueLike(Extends({}, Literal(index), indexer)) ? [right, ...result] : result;
9777
9862
  }, []);
9778
9863
  }
9779
9864
  function FromTupleWithIndexer(types, indexer) {
@@ -9783,13 +9868,13 @@ function FromTupleWithoutIndexer(types) {
9783
9868
  return EvaluateUnionFast(types);
9784
9869
  }
9785
9870
  function FromTuple$2(types, indexer) {
9786
- return IsLiteral(indexer) && IsEqual(indexer.const, "length") ? Literal$1(types.length) : IsNumber(indexer) || IsInteger(indexer) ? FromTupleWithoutIndexer(types) : FromTupleWithIndexer(types, indexer);
9871
+ return IsLiteral(indexer) && IsEqual(indexer.const, "length") ? Literal(types.length) : IsNumber(indexer) || IsInteger(indexer) ? FromTupleWithoutIndexer(types) : FromTupleWithIndexer(types, indexer);
9787
9872
  }
9788
9873
  function FromType$7(type, indexer) {
9789
9874
  return IsArray(type) ? FromArray$2(type.items, indexer) : IsObject(type) ? FromObject$4(type.properties, indexer) : IsTuple(type) ? FromTuple$2(type.items, indexer) : Never();
9790
9875
  }
9791
9876
  function NormalizeType$1(type) {
9792
- return IsCyclic(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
9877
+ return IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
9793
9878
  }
9794
9879
  function IndexAction(type, indexer, options) {
9795
9880
  return CanInstantiate([type, indexer]) ? Update(FromType$7(NormalizeType$1(type), indexer), {}, options) : IndexDeferred(type, indexer, options);
@@ -9834,7 +9919,7 @@ function FromArray$1(_type) {
9834
9919
  }
9835
9920
  function FromPropertyKeys(keys) {
9836
9921
  return keys.reduce((result, left) => {
9837
- return IsLiteralValue(left) ? [...result, Literal$1(ConvertToIntegerKey(left))] : Unreachable$1();
9922
+ return IsLiteralValue(left) ? [...result, Literal(ConvertToIntegerKey(left))] : Unreachable$1();
9838
9923
  }, []);
9839
9924
  }
9840
9925
  function FromObject$3(properties) {
@@ -9844,13 +9929,13 @@ function FromRecord(type) {
9844
9929
  return RecordKey(type);
9845
9930
  }
9846
9931
  function FromTuple$1(types) {
9847
- return EvaluateUnionFast(types.map((_, index) => Literal$1(index)));
9932
+ return EvaluateUnionFast(types.map((_, index) => Literal(index)));
9848
9933
  }
9849
9934
  function FromType$6(type) {
9850
9935
  return IsAny(type) ? FromAny() : IsArray(type) ? FromArray$1(type.items) : IsObject(type) ? FromObject$3(type.properties) : IsRecord(type) ? FromRecord(type) : IsTuple(type) ? FromTuple$1(type.items) : Never();
9851
9936
  }
9852
9937
  function NormalizeType(type) {
9853
- return IsCyclic(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
9938
+ return IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
9854
9939
  }
9855
9940
  function KeyOfAction(type, options) {
9856
9941
  return CanInstantiate([type]) ? Update(FromType$6(NormalizeType(type)), {}, options) : KeyOfDeferred(type, options);
@@ -9869,27 +9954,30 @@ function MappedDeferred(identifier, type, as, property, options = {}) {
9869
9954
  }
9870
9955
  /** Applies a Mapped action using the given types. */
9871
9956
  function Mapped(identifier, type, as, property, options = {}) {
9872
- return MappedAction({}, { callstack: [] }, identifier, type, as, property, options);
9957
+ return MappedAction({}, State([], []), identifier, type, as, property, options);
9873
9958
  }
9874
9959
  function FromTemplateLiteral(pattern) {
9875
- return FromType$5(TemplateLiteralDecode(pattern));
9960
+ return FromType$5(EvaluateTemplateLiteral(pattern));
9876
9961
  }
9877
9962
  function FromUnion$3(types) {
9878
9963
  return types.reduce((result, left) => {
9879
9964
  return [...result, ...FromType$5(left)];
9880
9965
  }, []);
9881
9966
  }
9967
+ function FromEnum(values) {
9968
+ return FromType$5(EvaluateEnum(values));
9969
+ }
9882
9970
  function FromLiteral(value) {
9883
- return IsNumber$1(value) ? [Literal$1(`${value}`)] : [Literal$1(value)];
9971
+ return IsNumber$1(value) ? [Literal(`${value}`)] : [Literal(value)];
9884
9972
  }
9885
9973
  function FromType$5(type) {
9886
- return IsEnum(type) ? FromUnion$3(EnumValuesToVariants(type.enum)) : IsLiteral(type) ? FromLiteral(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral(type.pattern) : IsUnion(type) ? FromUnion$3(type.anyOf) : [type];
9974
+ return IsEnum(type) ? FromEnum(type.enum) : IsLiteral(type) ? FromLiteral(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral(type.pattern) : IsUnion(type) ? FromUnion$3(type.anyOf) : [type];
9887
9975
  }
9888
9976
  function MappedVariants(type) {
9889
9977
  return FromType$5(type);
9890
9978
  }
9891
9979
  function CanonicalAs(instantiatedAs) {
9892
- return IsTemplateLiteral(instantiatedAs) ? TemplateLiteralDecode(instantiatedAs.pattern) : instantiatedAs;
9980
+ return IsTemplateLiteral(instantiatedAs) ? EvaluateTemplateLiteral(instantiatedAs.pattern) : instantiatedAs;
9893
9981
  }
9894
9982
  function MappedVariant(context, state, identifier, variant, as, property) {
9895
9983
  const variantContext = Assign(context, { [identifier["name"]]: variant });
@@ -9916,33 +10004,35 @@ function MappedAction(context, state, identifier, type, as, property, options) {
9916
10004
  function MappedInstantiate(context, state, identifier, type, as, property, options) {
9917
10005
  return MappedAction(context, state, identifier, InstantiateType(context, state, type), as, property, options);
9918
10006
  }
9919
- function InstantiateCyclics(context, cyclicKeys) {
9920
- return Keys(context).filter((key) => cyclicKeys.includes(key)).reduce((result, key) => {
10007
+ function InstantiateCyclics(context, declarations, cyclicKeys) {
10008
+ const declarationContext = Assign(context, declarations);
10009
+ return Keys(declarations).filter((key) => cyclicKeys.includes(key)).reduce((result, key) => {
9921
10010
  return {
9922
10011
  ...result,
9923
- [key]: InstantiateCyclic(context, key, context[key])
10012
+ [key]: InstantiateCyclic(declarationContext, key, declarations[key])
9924
10013
  };
9925
10014
  }, {});
9926
10015
  }
9927
- function InstantiateNonCyclics(context, cyclicKeys) {
9928
- return Keys(context).filter((key) => !cyclicKeys.includes(key)).reduce((result, key) => {
10016
+ function InstantiateNonCyclics(context, declarations, cyclicKeys) {
10017
+ const declarationContext = Assign(context, declarations);
10018
+ return Keys(declarations).filter((key) => !cyclicKeys.includes(key)).reduce((result, key) => {
9929
10019
  return {
9930
10020
  ...result,
9931
- [key]: InstantiateType(context, { callstack: [] }, context[key])
10021
+ [key]: InstantiateType(declarationContext, State([], []), declarations[key])
9932
10022
  };
9933
10023
  }, {});
9934
10024
  }
9935
- function InstantiateModule(context, options) {
9936
- const cyclicCandidates = CyclicCandidates(context);
9937
- const instantiatedCyclics = InstantiateCyclics(context, cyclicCandidates);
9938
- const instantiatedNonCyclics = InstantiateNonCyclics(context, cyclicCandidates);
10025
+ function InstantiateModule(context, declarations, options) {
10026
+ const cyclicCandidates = CyclicCandidates(declarations);
10027
+ const instantiatedCyclics = InstantiateCyclics(context, declarations, cyclicCandidates);
10028
+ const instantiatedNonCyclics = InstantiateNonCyclics(context, declarations, cyclicCandidates);
9939
10029
  return Update({
9940
10030
  ...instantiatedCyclics,
9941
10031
  ...instantiatedNonCyclics
9942
10032
  }, {}, options);
9943
10033
  }
9944
- function ModuleInstantiate(context, _state, properties, options) {
9945
- return InstantiateModule(Assign(context, properties), options);
10034
+ function ModuleInstantiate(context, _state, declarations, options) {
10035
+ return InstantiateModule(context, declarations, options);
9946
10036
  }
9947
10037
  /** Creates a deferred NonNullable action. */
9948
10038
  function NonNullableDeferred(type, options = {}) {
@@ -9991,20 +10081,6 @@ function OmitAction(type, indexer, options) {
9991
10081
  function OmitInstantiate(context, state, type, indexer, options) {
9992
10082
  return OmitAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
9993
10083
  }
9994
- /** Creates a deferred Options action. */
9995
- function OptionsDeferred(type, options) {
9996
- return Deferred("Options", [type, options], {});
9997
- }
9998
- /** Applies an immediate Options action to the given type. */
9999
- function Options(type, options) {
10000
- return OptionsAction(type, options);
10001
- }
10002
- function OptionsAction(type, options) {
10003
- return CanInstantiate([type]) ? Update(type, {}, options) : OptionsDeferred(type, options);
10004
- }
10005
- function OptionsInstantiate(context, state, type, options) {
10006
- return OptionsAction(InstantiateType(context, state, type), options);
10007
- }
10008
10084
  /** Creates a deferred Parameters action. */
10009
10085
  function ParametersDeferred(type, options = {}) {
10010
10086
  return Deferred("Parameters", [type], options);
@@ -10014,7 +10090,8 @@ function Parameters(type, options = {}) {
10014
10090
  return ParametersAction(type, options);
10015
10091
  }
10016
10092
  function ParametersOperation(type) {
10017
- return Tuple$1(InstantiateElements({}, { callstack: [] }, IsFunction(type) ? type["parameters"] : []));
10093
+ const parameters = IsFunction(type) ? type["parameters"] : [];
10094
+ return Tuple(InstantiateElements({}, State([], []), parameters));
10018
10095
  }
10019
10096
  function ParametersAction(type, options) {
10020
10097
  return CanInstantiate([type]) ? Update(ParametersOperation(type), {}, options) : ParametersDeferred(type, options);
@@ -10034,8 +10111,11 @@ function FromCyclic$2(defs, ref) {
10034
10111
  const partial = FromType$3(CyclicTarget(defs, ref));
10035
10112
  return Cyclic(Assign(defs, { [ref]: partial }), ref);
10036
10113
  }
10114
+ function FromDependent$2(if_, then_, else_) {
10115
+ return FromType$3(EvaluateDependent(if_, then_, else_));
10116
+ }
10037
10117
  function FromIntersect$2(types) {
10038
- return EvaluateIntersect(types.map((type) => FromType$3(type)));
10118
+ return FromType$3(EvaluateIntersect(types));
10039
10119
  }
10040
10120
  function FromUnion$2(types) {
10041
10121
  return Union(types.map((type) => FromType$3(type)));
@@ -10044,12 +10124,12 @@ function FromObject$2(properties) {
10044
10124
  return _Object_$1(Keys(properties).reduce((result, left) => {
10045
10125
  return {
10046
10126
  ...result,
10047
- [left]: Optional$2(properties[left])
10127
+ [left]: AddOptional(properties[left])
10048
10128
  };
10049
10129
  }, {}));
10050
10130
  }
10051
10131
  function FromType$3(type) {
10052
- return IsCyclic(type) ? FromCyclic$2(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect$2(type.allOf) : IsUnion(type) ? FromUnion$2(type.anyOf) : IsObject(type) ? FromObject$2(type.properties) : _Object_$1({});
10132
+ return IsCyclic(type) ? FromCyclic$2(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$2(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$2(type.allOf) : IsUnion(type) ? FromUnion$2(type.anyOf) : IsObject(type) ? FromObject$2(type.properties) : _Object_$1({});
10053
10133
  }
10054
10134
  function PartialAction(type, options) {
10055
10135
  return CanInstantiate([type]) ? Update(FromType$3(type), {}, options) : PartialDeferred(type, options);
@@ -10093,31 +10173,34 @@ function ReadonlyObject(type, options = {}) {
10093
10173
  */
10094
10174
  var ReadonlyType = ReadonlyObject;
10095
10175
  function FromArray(type) {
10096
- return Immutable(_Array_(type));
10176
+ return AddImmutable(_Array_(type));
10097
10177
  }
10098
10178
  function FromCyclic$1(defs, ref) {
10099
10179
  const partial = FromType$1(CyclicTarget(defs, ref));
10100
10180
  return Cyclic(Assign(defs, { [ref]: partial }), ref);
10101
10181
  }
10182
+ function FromDependent$1(if_, then_, else_) {
10183
+ return FromType$1(EvaluateDependent(if_, then_, else_));
10184
+ }
10102
10185
  function FromIntersect$1(types) {
10103
- return EvaluateIntersect(types.map((type) => FromType$1(type)));
10186
+ return FromType$1(EvaluateIntersect(types));
10104
10187
  }
10105
10188
  function FromObject$1(properties) {
10106
10189
  return _Object_$1(Keys(properties).reduce((result, left) => {
10107
10190
  return {
10108
10191
  ...result,
10109
- [left]: Readonly$1(properties[left])
10192
+ [left]: AddReadonly(properties[left])
10110
10193
  };
10111
10194
  }, {}));
10112
10195
  }
10113
10196
  function FromTuple(types) {
10114
- return Immutable(Tuple$1(types));
10197
+ return AddImmutable(Tuple(types));
10115
10198
  }
10116
10199
  function FromUnion$1(types) {
10117
10200
  return Union(types.map((type) => FromType$1(type)));
10118
10201
  }
10119
10202
  function FromType$1(type) {
10120
- return IsArray(type) ? FromArray(type.items) : IsCyclic(type) ? FromCyclic$1(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect$1(type.allOf) : IsObject(type) ? FromObject$1(type.properties) : IsTuple(type) ? FromTuple(type.items) : IsUnion(type) ? FromUnion$1(type.anyOf) : type;
10203
+ return IsArray(type) ? FromArray(type.items) : IsCyclic(type) ? FromCyclic$1(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$1(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$1(type.allOf) : IsObject(type) ? FromObject$1(type.properties) : IsTuple(type) ? FromTuple(type.items) : IsUnion(type) ? FromUnion$1(type.anyOf) : type;
10121
10204
  }
10122
10205
  function ReadonlyObjectAction(type, options) {
10123
10206
  return CanInstantiate([type]) ? Update(FromType$1(type), {}, options) : ReadonlyObjectDeferred(type);
@@ -10126,14 +10209,17 @@ function ReadonlyObjectInstantiate(context, state, type, options) {
10126
10209
  return ReadonlyObjectAction(InstantiateType(context, state, type), options);
10127
10210
  }
10128
10211
  function RefInstantiate(context, state, type, ref) {
10129
- return ref in context ? CyclicCheck([ref], context, context[ref]) ? type : InstantiateType(context, state, context[ref]) : type;
10212
+ return state.visited.includes(ref) ? type : ref in context ? InstantiateType(context, State(state["callstack"], [...state["visited"], ref]), context[ref]) : type;
10130
10213
  }
10131
10214
  function FromCyclic(defs, ref) {
10132
10215
  const partial = FromType(CyclicTarget(defs, ref));
10133
10216
  return Cyclic(Assign(defs, { [ref]: partial }), ref);
10134
10217
  }
10218
+ function FromDependent(if_, then_, else_) {
10219
+ return FromType(EvaluateDependent(if_, then_, else_));
10220
+ }
10135
10221
  function FromIntersect(types) {
10136
- return EvaluateIntersect(types.map((type) => FromType(type)));
10222
+ return FromType(EvaluateIntersect(types));
10137
10223
  }
10138
10224
  function FromUnion(types) {
10139
10225
  return Union(types.map((type) => FromType(type)));
@@ -10142,12 +10228,12 @@ function FromObject(properties) {
10142
10228
  return _Object_$1(Keys(properties).reduce((result, left) => {
10143
10229
  return {
10144
10230
  ...result,
10145
- [left]: OptionalRemove(properties[left])
10231
+ [left]: RemoveOptional(properties[left])
10146
10232
  };
10147
10233
  }, {}));
10148
10234
  }
10149
10235
  function FromType(type) {
10150
- return IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion(type.anyOf) : IsObject(type) ? FromObject(type.properties) : _Object_$1({});
10236
+ return IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) : IsDependent(type) ? FromDependent(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion(type.anyOf) : IsObject(type) ? FromObject(type.properties) : _Object_$1({});
10151
10237
  }
10152
10238
  /** Creates a deferred Required action. */
10153
10239
  function RequiredDeferred(type, options = {}) {
@@ -10180,6 +10266,27 @@ function ReturnTypeAction(type, options) {
10180
10266
  function ReturnTypeInstantiate(context, state, type, options = {}) {
10181
10267
  return ReturnTypeAction(InstantiateType(context, state, type), options);
10182
10268
  }
10269
+ /** Creates a deferred With action. */
10270
+ function WithDeferred(type, options) {
10271
+ return Deferred("With", [type, options], {});
10272
+ }
10273
+ /** Applies annotation options to the given type. */
10274
+ function With(type, options) {
10275
+ return WithAction(type, options);
10276
+ }
10277
+ /**
10278
+ * @deprecated Type.Options\<T\> has been renamed to Type.With\<T\>. This type will be removed in the
10279
+ * next version of TypeBox.
10280
+ */
10281
+ function Options(type, options) {
10282
+ return With(type, options);
10283
+ }
10284
+ function WithAction(type, options) {
10285
+ return CanInstantiate([type]) ? Update(type, {}, options) : WithDeferred(type, options);
10286
+ }
10287
+ function WithInstantiate(context, state, type, options) {
10288
+ return WithAction(InstantiateType(context, state, type), options);
10289
+ }
10183
10290
  function SpreadElement(type) {
10184
10291
  return IsRest(type) ? IsTuple(type.items) ? RestSpread(type.items.items) : IsInfer(type.items) ? [type] : IsRef(type.items) ? [type] : [Never()] : [type];
10185
10292
  }
@@ -10188,22 +10295,15 @@ function RestSpread(types) {
10188
10295
  return [...result, ...SpreadElement(left)];
10189
10296
  }, []);
10190
10297
  }
10298
+ function State(callstack, visited) {
10299
+ return {
10300
+ callstack,
10301
+ visited
10302
+ };
10303
+ }
10191
10304
  function CanInstantiate(types) {
10192
10305
  return TakeLeft(types, (left, right) => IsRef(left) ? false : CanInstantiate(right), () => true);
10193
10306
  }
10194
- function ModifierActions(type, readonly, optional) {
10195
- return IsReadonlyRemoveAction(type) ? ModifierActions(type.type, "remove", optional) : IsOptionalRemoveAction(type) ? ModifierActions(type.type, readonly, "remove") : IsReadonlyAddAction(type) ? ModifierActions(type.type, "add", optional) : IsOptionalAddAction(type) ? ModifierActions(type.type, readonly, "add") : [
10196
- type,
10197
- readonly,
10198
- optional
10199
- ];
10200
- }
10201
- function ApplyReadonly(action, type) {
10202
- return IsEqual(action, "remove") ? ReadonlyRemove(type) : IsEqual(action, "add") ? ReadonlyAdd(type) : type;
10203
- }
10204
- function ApplyOptional(action, type) {
10205
- return IsEqual(action, "remove") ? OptionalRemove(type) : IsEqual(action, "add") ? OptionalAdd(type) : type;
10206
- }
10207
10307
  function InstantiateProperties(context, state, properties) {
10208
10308
  return Keys(properties).reduce((result, key) => {
10209
10309
  return {
@@ -10219,40 +10319,41 @@ function InstantiateTypes(context, state, types) {
10219
10319
  return types.map((type) => InstantiateType(context, state, type));
10220
10320
  }
10221
10321
  function InstantiateDeferred(context, state, action, parameters, options) {
10222
- return IsEqual(action, "Awaited") ? AwaitedInstantiate(context, state, parameters[0], options) : IsEqual(action, "Capitalize") ? CapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Conditional") ? ConditionalInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "ConstructorParameters") ? ConstructorParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Evaluate") ? EvaluateInstantiate(context, state, parameters[0], options) : IsEqual(action, "Exclude") ? ExcludeInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Extract") ? ExtractInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Index") ? IndexInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "InstanceType") ? InstanceTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Interface") ? InterfaceInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "KeyOf") ? KeyOfInstantiate(context, state, parameters[0], options) : IsEqual(action, "Lowercase") ? LowercaseInstantiate(context, state, parameters[0], options) : IsEqual(action, "Mapped") ? MappedInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "Module") ? ModuleInstantiate(context, state, parameters[0], options) : IsEqual(action, "NonNullable") ? NonNullableInstantiate(context, state, parameters[0], options) : IsEqual(action, "Pick") ? PickInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Options") ? OptionsInstantiate(context, state, parameters[0], parameters[1]) : IsEqual(action, "Parameters") ? ParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Partial") ? PartialInstantiate(context, state, parameters[0], options) : IsEqual(action, "Omit") ? OmitInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "ReadonlyObject") ? ReadonlyObjectInstantiate(context, state, parameters[0], options) : IsEqual(action, "Record") ? RecordInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Required") ? RequiredInstantiate(context, state, parameters[0], options) : IsEqual(action, "ReturnType") ? ReturnTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "TemplateLiteral") ? TemplateLiteralInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uncapitalize") ? UncapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uppercase") ? UppercaseInstantiate(context, state, parameters[0], options) : Deferred(action, parameters, options);
10322
+ return IsEqual(action, "AddImmutable") ? AddImmutableInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveImmutable") ? RemoveImmutableInstantiate(context, state, parameters[0], options) : IsEqual(action, "AddReadonly") ? AddReadonlyInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveReadonly") ? RemoveReadonlyInstantiate(context, state, parameters[0], options) : IsEqual(action, "AddOptional") ? AddOptionalInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveOptional") ? RemoveOptionalInstantiate(context, state, parameters[0], options) : IsEqual(action, "Awaited") ? AwaitedInstantiate(context, state, parameters[0], options) : IsEqual(action, "Capitalize") ? CapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Conditional") ? ConditionalInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "ConstructorParameters") ? ConstructorParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Evaluate") ? EvaluateInstantiate(context, state, parameters[0], options) : IsEqual(action, "Exclude") ? ExcludeInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Extract") ? ExtractInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Index") ? IndexInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "InstanceType") ? InstanceTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Interface") ? InterfaceInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "KeyOf") ? KeyOfInstantiate(context, state, parameters[0], options) : IsEqual(action, "Lowercase") ? LowercaseInstantiate(context, state, parameters[0], options) : IsEqual(action, "Mapped") ? MappedInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "Module") ? ModuleInstantiate(context, state, parameters[0], options) : IsEqual(action, "NonNullable") ? NonNullableInstantiate(context, state, parameters[0], options) : IsEqual(action, "Pick") ? PickInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Parameters") ? ParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Partial") ? PartialInstantiate(context, state, parameters[0], options) : IsEqual(action, "Omit") ? OmitInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "ReadonlyObject") ? ReadonlyObjectInstantiate(context, state, parameters[0], options) : IsEqual(action, "Record") ? RecordInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Required") ? RequiredInstantiate(context, state, parameters[0], options) : IsEqual(action, "ReturnType") ? ReturnTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "TemplateLiteral") ? TemplateLiteralInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uncapitalize") ? UncapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uppercase") ? UppercaseInstantiate(context, state, parameters[0], options) : IsEqual(action, "With") ? WithInstantiate(context, state, parameters[0], parameters[1]) : Deferred(action, parameters, options);
10323
+ }
10324
+ function InstantiateImmediate(context, state, type) {
10325
+ type = IsBase(type) ? type.Clone() : type;
10326
+ return IsRef(type) ? RefInstantiate(context, state, type, type.$ref) : IsArray(type) ? _Array_(InstantiateType(context, state, type.items), ArrayOptions(type)) : IsAsyncIterator(type) ? AsyncIterator(InstantiateType(context, state, type.iteratorItems), AsyncIteratorOptions(type)) : IsCall(type) ? CallInstantiate(context, state, type.target, type.arguments) : IsConstructor(type) ? Constructor(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.instanceType), ConstructorOptions(type)) : IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) : IsFunction(type) ? _Function_$1(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) : IsDependent(type) ? Dependent$1(InstantiateType(context, state, type.if), InstantiateType(context, state, type.then), InstantiateType(context, state, type.else), DependentOptions(type)) : IsIntersect(type) ? Intersect(InstantiateTypes(context, state, type.allOf), IntersectOptions(type)) : IsIterator(type) ? Iterator(InstantiateType(context, state, type.iteratorItems), IteratorOptions(type)) : IsObject(type) ? _Object_$1(InstantiateProperties(context, state, type.properties), ObjectOptions(type)) : IsPromise(type) ? _Promise_(InstantiateType(context, state, type.item), PromiseOptions(type)) : IsRecord(type) ? RecordFromPattern(RecordPattern(type), InstantiateType(context, state, RecordValue(type))) : IsRest(type) ? Rest(InstantiateType(context, state, type.items)) : IsTuple(type) ? Tuple(InstantiateElements(context, state, type.items), TupleOptions(type)) : IsUnion(type) ? Union(InstantiateTypes(context, state, type.anyOf), UnionOptions(type)) : type;
10327
+ }
10328
+ function WithModifiers(type, instantiatedType) {
10329
+ const withImmutable = IsImmutable(type) ? Immutable(instantiatedType) : instantiatedType;
10330
+ const withReadonly = IsReadonly(type) ? Readonly$1(withImmutable) : withImmutable;
10331
+ return IsOptional(type) ? Optional$2(withReadonly) : withReadonly;
10223
10332
  }
10224
- function InstantiateType(context, state, input) {
10225
- const immutable = IsImmutable(input);
10226
- const modifiers = ModifierActions(input, IsReadonly(input) ? "add" : "none", IsOptional(input) ? "add" : "none");
10227
- const type = IsBase(modifiers[0]) ? modifiers[0].Clone() : modifiers[0];
10228
- const instantiated = IsRef(type) ? RefInstantiate(context, state, type, type.$ref) : IsArray(type) ? _Array_(InstantiateType(context, state, type.items), ArrayOptions(type)) : IsAsyncIterator(type) ? AsyncIterator(InstantiateType(context, state, type.iteratorItems), AsyncIteratorOptions(type)) : IsCall(type) ? CallInstantiate(context, state, type.target, type.arguments) : IsConstructor(type) ? Constructor$1(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.instanceType), ConstructorOptions(type)) : IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) : IsFunction(type) ? _Function_$1(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) : IsIntersect(type) ? Intersect(InstantiateTypes(context, state, type.allOf), IntersectOptions(type)) : IsIterator(type) ? Iterator(InstantiateType(context, state, type.iteratorItems), IteratorOptions(type)) : IsObject(type) ? _Object_$1(InstantiateProperties(context, state, type.properties), ObjectOptions(type)) : IsPromise(type) ? _Promise_(InstantiateType(context, state, type.item), PromiseOptions(type)) : IsRecord(type) ? RecordFromPattern(RecordPattern(type), InstantiateType(context, state, RecordValue(type))) : IsRest(type) ? Rest(InstantiateType(context, state, type.items)) : IsTuple(type) ? Tuple$1(InstantiateElements(context, state, type.items), TupleOptions(type)) : IsUnion(type) ? Union(InstantiateTypes(context, state, type.anyOf), UnionOptions(type)) : type;
10229
- const withImmutable = immutable ? Immutable(instantiated) : instantiated;
10230
- return ApplyReadonly(modifiers[1], ApplyOptional(modifiers[2], withImmutable));
10333
+ function InstantiateType(context, state, type) {
10334
+ const instantiatedType = InstantiateImmediate(context, state, type);
10335
+ return IsDeferred(type) ? instantiatedType : WithModifiers(type, instantiatedType);
10231
10336
  }
10232
10337
  /** Instantiates computed schematics using the given context and type. */
10233
10338
  function Instantiate(context, type) {
10234
- return InstantiateType(context, { callstack: [] }, type);
10339
+ return InstantiateType(context, State([], []), type);
10235
10340
  }
10236
- function AwaitedOperation(type) {
10237
- return IsPromise(type) ? AwaitedOperation(type.item) : type;
10341
+ function AddImmutableOperation(type) {
10342
+ return Update(type, { "~immutable": true }, {});
10238
10343
  }
10239
- function AwaitedAction(type, options) {
10240
- return CanInstantiate([type]) ? Update(AwaitedOperation(type), {}, options) : AwaitedDeferred(type, options);
10344
+ function AddImmutableAction(type, options) {
10345
+ return Update(AddImmutableOperation(type), {}, options);
10241
10346
  }
10242
- function AwaitedInstantiate(context, state, type, options) {
10243
- return AwaitedAction(InstantiateType(context, state, type), options);
10347
+ function AddImmutableInstantiate(context, state, type, options) {
10348
+ return AddImmutableAction(InstantiateType(context, state, type), options);
10244
10349
  }
10245
- /** Creates a deferred Awaited action. */
10246
- function AwaitedDeferred(type, options = {}) {
10247
- return Deferred("Awaited", [type], options);
10350
+ /** Creates a deferred AddImmutable action. */
10351
+ function AddImmutableDeferred(type, options = {}) {
10352
+ return Deferred("AddImmutable", [type], options);
10248
10353
  }
10249
- /**
10250
- * Applies an Awaited action to a type.
10251
- *
10252
- * @deprecated This action is being removed in the next version of TypeBox.
10253
- */
10254
- function Awaited(type, options = {}) {
10255
- return AwaitedAction(type, options);
10354
+ /** Applies an AddImmutable action to a type. */
10355
+ function AddImmutable(type, options = {}) {
10356
+ return AddImmutableAction(type, options);
10256
10357
  }
10257
10358
  /** Creates a deferred Evaluate action. */
10258
10359
  function EvaluateDeferred(type, options = {}) {
@@ -10263,12 +10364,12 @@ function Evaluate(type, options = {}) {
10263
10364
  return EvaluateAction(type, options);
10264
10365
  }
10265
10366
  /** Creates a deferred Module action. */
10266
- function ModuleDeferred(context, options = {}) {
10267
- return Deferred("Module", [context], options);
10367
+ function ModuleDeferred(declarations, options = {}) {
10368
+ return Deferred("Module", [declarations], options);
10268
10369
  }
10269
- /** Applies a Module transformation action to the embedded property types. */
10270
- function Module(context, options = {}) {
10271
- return Instantiate({}, ModuleDeferred(context, options));
10370
+ /** Creates a Module with the given declarations */
10371
+ function Module(declarations, options = {}) {
10372
+ return ModuleInstantiate({}, State([], []), declarations, options);
10272
10373
  }
10273
10374
  /** Parses a type from a TypeScript type expression */
10274
10375
  function Script(...args) {
@@ -10294,7 +10395,7 @@ function Script(...args) {
10294
10395
  ]
10295
10396
  });
10296
10397
  const result = Script$1(input);
10297
- return Update(IsArray$1(result) && IsEqual(result.length, 2) ? InstantiateType(context, { callstack: [] }, result[0]) : Never(), {}, options);
10398
+ return Update(IsArray$1(result) && IsEqual(result.length, 2) ? InstantiateType(context, State([], []), result[0]) : Never(), {}, options);
10298
10399
  }
10299
10400
  (/* @__PURE__ */ __exportAll({
10300
10401
  Any: () => Any,
@@ -10308,11 +10409,12 @@ function Script(...args) {
10308
10409
  Capitalize: () => Capitalize,
10309
10410
  Codec: () => Codec,
10310
10411
  Conditional: () => Conditional,
10311
- Constructor: () => Constructor$1,
10412
+ Constructor: () => Constructor,
10312
10413
  ConstructorParameters: () => ConstructorParameters,
10313
10414
  Cyclic: () => Cyclic,
10314
10415
  Decode: () => Decode,
10315
10416
  DecodeBuilder: () => DecodeBuilder,
10417
+ Dependent: () => Dependent$1,
10316
10418
  Encode: () => Encode,
10317
10419
  EncodeBuilder: () => EncodeBuilder,
10318
10420
  Enum: () => Enum,
@@ -10342,6 +10444,7 @@ function Script(...args) {
10342
10444
  IsCodec: () => IsCodec,
10343
10445
  IsConstructor: () => IsConstructor,
10344
10446
  IsCyclic: () => IsCyclic,
10447
+ IsDependent: () => IsDependent,
10345
10448
  IsEnum: () => IsEnum,
10346
10449
  IsFunction: () => IsFunction,
10347
10450
  IsGeneric: () => IsGeneric,
@@ -10378,7 +10481,7 @@ function Script(...args) {
10378
10481
  IsVoid: () => IsVoid,
10379
10482
  Iterator: () => Iterator,
10380
10483
  KeyOf: () => KeyOf,
10381
- Literal: () => Literal$1,
10484
+ Literal: () => Literal,
10382
10485
  Lowercase: () => Lowercase,
10383
10486
  Mapped: () => Mapped,
10384
10487
  Module: () => Module,
@@ -10412,14 +10515,15 @@ function Script(...args) {
10412
10515
  Symbol: () => Symbol$1,
10413
10516
  TemplateLiteral: () => TemplateLiteral,
10414
10517
  This: () => This,
10415
- Tuple: () => Tuple$1,
10518
+ Tuple: () => Tuple,
10416
10519
  Uncapitalize: () => Uncapitalize,
10417
10520
  Undefined: () => Undefined,
10418
10521
  Union: () => Union,
10419
10522
  Unknown: () => Unknown,
10420
10523
  Unsafe: () => Unsafe,
10421
10524
  Uppercase: () => Uppercase,
10422
- Void: () => Void
10525
+ Void: () => Void,
10526
+ With: () => With
10423
10527
  })).Base;
10424
10528
  async function validate$1(schema, data, errorMap) {
10425
10529
  const result = await schema.safeParseAsync(data, { errorMap });
@@ -10546,25 +10650,6 @@ var useForm = (config) => {
10546
10650
  }));
10547
10651
  return result;
10548
10652
  };
10549
- function Loading_button($$renderer, $$props) {
10550
- let { loading = false, disabled, children, $$slots, $$events, ...restProps } = $$props;
10551
- Button($$renderer, spread_props([
10552
- { disabled: disabled || loading },
10553
- restProps,
10554
- {
10555
- children: ($$renderer) => {
10556
- if (loading) {
10557
- $$renderer.push("<!--[0-->");
10558
- Spinner($$renderer, {});
10559
- } else $$renderer.push("<!--[-1-->");
10560
- $$renderer.push(`<!--]--> `);
10561
- children?.($$renderer);
10562
- $$renderer.push(`<!---->`);
10563
- },
10564
- $$slots: { default: true }
10565
- }
10566
- ]));
10567
- }
10568
10653
  //#endregion
10569
10654
  //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
10570
10655
  const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
@@ -11319,6 +11404,6 @@ function superRefine(fn, params) {
11319
11404
  return /* @__PURE__ */ _superRefine(fn, params);
11320
11405
  }
11321
11406
  //#endregion
11322
- export { Form$1 as a, FormFieldSwitch as c, string as i, Loading_button as l, boolean as n, FormField as o, object as r, FormFieldSelect as s, _enum as t, useForm as u };
11407
+ export { Form$1 as a, FormFieldSwitch as c, string as i, useForm as l, boolean as n, FormField as o, object as r, FormFieldSelect as s, _enum as t };
11323
11408
 
11324
- //# sourceMappingURL=schemas-ENQuLVBq.js.map
11409
+ //# sourceMappingURL=schemas-nwfCECau.js.map