@baseplate-dev/plugin-auth 0.1.3 → 0.6.3

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 (1163) hide show
  1. package/CHANGELOG.md +720 -0
  2. package/LICENSE +114 -123
  3. package/README.md +3 -3
  4. package/dist/auth/core/common.d.ts +2 -5
  5. package/dist/auth/core/common.d.ts.map +1 -1
  6. package/dist/auth/core/common.js +16 -19
  7. package/dist/auth/core/common.js.map +1 -1
  8. package/dist/auth/core/components/auth-definition-editor.d.ts.map +1 -1
  9. package/dist/auth/core/components/auth-definition-editor.js +46 -28
  10. package/dist/auth/core/components/auth-definition-editor.js.map +1 -1
  11. package/dist/auth/core/components/role-editor-form/role-dialog.d.ts +12 -0
  12. package/dist/auth/core/components/role-editor-form/role-dialog.d.ts.map +1 -0
  13. package/dist/auth/core/components/role-editor-form/role-dialog.js +29 -0
  14. package/dist/auth/core/components/role-editor-form/role-dialog.js.map +1 -0
  15. package/dist/auth/core/components/role-editor-form/role-editor-form.d.ts +10 -0
  16. package/dist/auth/core/components/role-editor-form/role-editor-form.d.ts.map +1 -0
  17. package/dist/auth/core/components/role-editor-form/role-editor-form.js +52 -0
  18. package/dist/auth/core/components/role-editor-form/role-editor-form.js.map +1 -0
  19. package/dist/auth/core/node.d.ts +3 -3
  20. package/dist/auth/core/node.d.ts.map +1 -1
  21. package/dist/auth/core/node.js +14 -26
  22. package/dist/auth/core/node.js.map +1 -1
  23. package/dist/auth/core/schema/plugin-definition.d.ts +11 -69
  24. package/dist/auth/core/schema/plugin-definition.d.ts.map +1 -1
  25. package/dist/auth/core/schema/plugin-definition.js +9 -24
  26. package/dist/auth/core/schema/plugin-definition.js.map +1 -1
  27. package/dist/auth/core/schema/roles/constants.d.ts.map +1 -0
  28. package/dist/auth/core/schema/roles/constants.js.map +1 -0
  29. package/dist/auth/core/schema/roles/index.d.ts.map +1 -0
  30. package/dist/auth/core/schema/roles/index.js.map +1 -0
  31. package/dist/auth/core/schema/roles/schema.d.ts +54 -0
  32. package/dist/auth/core/schema/roles/schema.d.ts.map +1 -0
  33. package/dist/auth/core/schema/roles/schema.js +37 -0
  34. package/dist/auth/core/schema/roles/schema.js.map +1 -0
  35. package/dist/auth/core/web.d.ts +3 -3
  36. package/dist/auth/core/web.d.ts.map +1 -1
  37. package/dist/auth/core/web.js +5 -6
  38. package/dist/auth/core/web.js.map +1 -1
  39. package/dist/auth/index.d.ts +1 -1
  40. package/dist/auth/index.d.ts.map +1 -1
  41. package/dist/auth/index.js +1 -1
  42. package/dist/auth/index.js.map +1 -1
  43. package/dist/auth/plugin.json +8 -0
  44. package/dist/auth/utils/get-auth-plugin-definition.d.ts +9 -0
  45. package/dist/auth/utils/get-auth-plugin-definition.d.ts.map +1 -0
  46. package/dist/auth/utils/get-auth-plugin-definition.js +10 -0
  47. package/dist/auth/utils/get-auth-plugin-definition.js.map +1 -0
  48. package/dist/auth/utils/index.d.ts +2 -0
  49. package/dist/auth/utils/index.d.ts.map +1 -0
  50. package/dist/auth/utils/index.js +2 -0
  51. package/dist/auth/utils/index.js.map +1 -0
  52. package/dist/better-auth/constants/model-names.d.ts +8 -0
  53. package/dist/better-auth/constants/model-names.d.ts.map +1 -0
  54. package/dist/better-auth/constants/model-names.js +8 -0
  55. package/dist/better-auth/constants/model-names.js.map +1 -0
  56. package/dist/better-auth/constants/packages.d.ts +4 -0
  57. package/dist/better-auth/constants/packages.d.ts.map +1 -0
  58. package/dist/better-auth/constants/packages.js +4 -0
  59. package/dist/better-auth/constants/packages.js.map +1 -0
  60. package/dist/better-auth/core/common.d.ts +6 -0
  61. package/dist/better-auth/core/common.d.ts.map +1 -0
  62. package/dist/better-auth/core/common.js +17 -0
  63. package/dist/better-auth/core/common.js.map +1 -0
  64. package/dist/better-auth/core/components/better-auth-definition-editor.d.ts +5 -0
  65. package/dist/better-auth/core/components/better-auth-definition-editor.d.ts.map +1 -0
  66. package/dist/better-auth/core/components/better-auth-definition-editor.js +50 -0
  67. package/dist/better-auth/core/components/better-auth-definition-editor.js.map +1 -0
  68. package/dist/better-auth/core/index.d.ts +2 -0
  69. package/dist/better-auth/core/index.d.ts.map +1 -0
  70. package/dist/better-auth/core/index.js +2 -0
  71. package/dist/better-auth/core/index.js.map +1 -0
  72. package/dist/better-auth/core/node.d.ts +5 -0
  73. package/dist/better-auth/core/node.d.ts.map +1 -0
  74. package/dist/better-auth/core/node.js +47 -0
  75. package/dist/better-auth/core/node.js.map +1 -0
  76. package/dist/better-auth/core/schema/models.d.ts +3 -0
  77. package/dist/better-auth/core/schema/models.d.ts.map +1 -0
  78. package/dist/better-auth/core/schema/models.js +278 -0
  79. package/dist/better-auth/core/schema/models.js.map +1 -0
  80. package/dist/better-auth/core/schema/plugin-definition.d.ts +5 -0
  81. package/dist/better-auth/core/schema/plugin-definition.d.ts.map +1 -0
  82. package/dist/better-auth/core/schema/plugin-definition.js +4 -0
  83. package/dist/better-auth/core/schema/plugin-definition.js.map +1 -0
  84. package/dist/better-auth/core/web.d.ts +6 -0
  85. package/dist/better-auth/core/web.d.ts.map +1 -0
  86. package/dist/better-auth/core/web.js +13 -0
  87. package/dist/better-auth/core/web.js.map +1 -0
  88. package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.d.ts +85 -0
  89. package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.d.ts.map +1 -0
  90. package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.js +75 -0
  91. package/dist/better-auth/generators/fastify/better-auth-module/better-auth-module.generator.js.map +1 -0
  92. package/dist/better-auth/generators/fastify/better-auth-module/generated/index.d.ts +142 -0
  93. package/dist/better-auth/generators/fastify/better-auth-module/generated/index.d.ts.map +1 -0
  94. package/dist/better-auth/generators/fastify/better-auth-module/generated/index.js +11 -0
  95. package/dist/better-auth/generators/fastify/better-auth-module/generated/index.js.map +1 -0
  96. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.d.ts +16 -0
  97. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.d.ts.map +1 -0
  98. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.js +28 -0
  99. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-paths.js.map +1 -0
  100. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.d.ts +73 -0
  101. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.d.ts.map +1 -0
  102. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.js +84 -0
  103. package/dist/better-auth/generators/fastify/better-auth-module/generated/template-renderers.js.map +1 -0
  104. package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.d.ts +30 -0
  105. package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.d.ts.map +1 -0
  106. package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.js +37 -0
  107. package/dist/better-auth/generators/fastify/better-auth-module/generated/ts-import-providers.js.map +1 -0
  108. package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.d.ts +65 -0
  109. package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.d.ts.map +1 -0
  110. package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.js +72 -0
  111. package/dist/better-auth/generators/fastify/better-auth-module/generated/typed-templates.js.map +1 -0
  112. package/dist/better-auth/generators/fastify/better-auth-module/index.d.ts +4 -0
  113. package/dist/better-auth/generators/fastify/better-auth-module/index.d.ts.map +1 -0
  114. package/dist/better-auth/generators/fastify/better-auth-module/index.js +3 -0
  115. package/dist/better-auth/generators/fastify/better-auth-module/index.js.map +1 -0
  116. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/plugins/better-auth.plugin.ts +31 -0
  117. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/schema/user-session.queries.ts +22 -0
  118. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/services/auth.ts +62 -0
  119. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/services/user-session.service.ts +72 -0
  120. package/dist/better-auth/generators/fastify/better-auth-module/templates/module/utils/headers.utils.ts +21 -0
  121. package/dist/better-auth/generators/fastify/index.d.ts +2 -0
  122. package/dist/better-auth/generators/fastify/index.d.ts.map +1 -0
  123. package/dist/better-auth/generators/fastify/index.js +2 -0
  124. package/dist/better-auth/generators/fastify/index.js.map +1 -0
  125. package/dist/better-auth/generators/index.d.ts.map +1 -0
  126. package/dist/better-auth/generators/index.js.map +1 -0
  127. package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.d.ts +43 -0
  128. package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.d.ts.map +1 -0
  129. package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.js +37 -0
  130. package/dist/better-auth/generators/react/better-auth-hooks/better-auth-hooks.generator.js.map +1 -0
  131. package/dist/better-auth/generators/react/better-auth-hooks/generated/index.d.ts +72 -0
  132. package/dist/better-auth/generators/react/better-auth-hooks/generated/index.d.ts.map +1 -0
  133. package/dist/better-auth/generators/react/better-auth-hooks/generated/index.js +11 -0
  134. package/dist/better-auth/generators/react/better-auth-hooks/generated/index.js.map +1 -0
  135. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.d.ts +14 -0
  136. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.d.ts.map +1 -0
  137. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.js +26 -0
  138. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-paths.js.map +1 -0
  139. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.d.ts +27 -0
  140. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.d.ts.map +1 -0
  141. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.js +43 -0
  142. package/dist/better-auth/generators/react/better-auth-hooks/generated/template-renderers.js.map +1 -0
  143. package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.d.ts +18 -0
  144. package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.d.ts.map +1 -0
  145. package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.js +27 -0
  146. package/dist/better-auth/generators/react/better-auth-hooks/generated/ts-import-providers.js.map +1 -0
  147. package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.d.ts +51 -0
  148. package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.d.ts.map +1 -0
  149. package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.js +48 -0
  150. package/dist/better-auth/generators/react/better-auth-hooks/generated/typed-templates.js.map +1 -0
  151. package/dist/better-auth/generators/react/better-auth-hooks/index.d.ts +2 -0
  152. package/dist/better-auth/generators/react/better-auth-hooks/index.d.ts.map +1 -0
  153. package/dist/better-auth/generators/react/better-auth-hooks/index.js +2 -0
  154. package/dist/better-auth/generators/react/better-auth-hooks/index.js.map +1 -0
  155. package/dist/better-auth/generators/react/better-auth-hooks/templates/src/hooks/use-log-out.ts +16 -0
  156. package/dist/better-auth/generators/react/better-auth-hooks/templates/src/hooks/use-required-user-id.ts +11 -0
  157. package/dist/better-auth/generators/react/better-auth-hooks/templates/src/hooks/use-session.ts +29 -0
  158. package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.d.ts +249 -0
  159. package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.d.ts.map +1 -0
  160. package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.js +26 -0
  161. package/dist/better-auth/generators/react/better-auth-pages/better-auth-pages.generator.js.map +1 -0
  162. package/dist/better-auth/generators/react/better-auth-pages/generated/index.d.ts +724 -0
  163. package/dist/better-auth/generators/react/better-auth-pages/generated/index.d.ts.map +1 -0
  164. package/dist/better-auth/generators/react/better-auth-pages/generated/index.js +9 -0
  165. package/dist/better-auth/generators/react/better-auth-pages/generated/index.js.map +1 -0
  166. package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.d.ts +13 -0
  167. package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.d.ts.map +1 -0
  168. package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.js +25 -0
  169. package/dist/better-auth/generators/react/better-auth-pages/generated/template-paths.js.map +1 -0
  170. package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.d.ts +250 -0
  171. package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.d.ts.map +1 -0
  172. package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.js +44 -0
  173. package/dist/better-auth/generators/react/better-auth-pages/generated/template-renderers.js.map +1 -0
  174. package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.d.ts +943 -0
  175. package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.d.ts.map +1 -0
  176. package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.js +35 -0
  177. package/dist/better-auth/generators/react/better-auth-pages/generated/typed-templates.js.map +1 -0
  178. package/dist/better-auth/generators/react/better-auth-pages/index.d.ts +2 -0
  179. package/dist/better-auth/generators/react/better-auth-pages/index.d.ts.map +1 -0
  180. package/dist/better-auth/generators/react/better-auth-pages/index.js +2 -0
  181. package/dist/better-auth/generators/react/better-auth-pages/index.js.map +1 -0
  182. package/dist/better-auth/generators/react/better-auth-pages/templates/routes/login.tsx +144 -0
  183. package/dist/better-auth/generators/react/better-auth-pages/templates/routes/register.tsx +160 -0
  184. package/dist/better-auth/generators/react/index.d.ts +4 -0
  185. package/dist/better-auth/generators/react/index.d.ts.map +1 -0
  186. package/dist/better-auth/generators/react/index.js +4 -0
  187. package/dist/better-auth/generators/react/index.js.map +1 -0
  188. package/dist/better-auth/generators/react/react-better-auth/generated/index.d.ts +515 -0
  189. package/dist/better-auth/generators/react/react-better-auth/generated/index.d.ts.map +1 -0
  190. package/dist/better-auth/generators/react/react-better-auth/generated/index.js +11 -0
  191. package/dist/better-auth/generators/react/react-better-auth/generated/index.js.map +1 -0
  192. package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.d.ts +13 -0
  193. package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.d.ts.map +1 -0
  194. package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.js +25 -0
  195. package/dist/better-auth/generators/react/react-better-auth/generated/template-paths.js.map +1 -0
  196. package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.d.ts +260 -0
  197. package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.d.ts.map +1 -0
  198. package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.js +51 -0
  199. package/dist/better-auth/generators/react/react-better-auth/generated/template-renderers.js.map +1 -0
  200. package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.d.ts +21 -0
  201. package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.d.ts.map +1 -0
  202. package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.js +30 -0
  203. package/dist/better-auth/generators/react/react-better-auth/generated/ts-import-providers.js.map +1 -0
  204. package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.d.ts +247 -0
  205. package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.d.ts.map +1 -0
  206. package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.js +33 -0
  207. package/dist/better-auth/generators/react/react-better-auth/generated/typed-templates.js.map +1 -0
  208. package/dist/better-auth/generators/react/react-better-auth/index.d.ts +4 -0
  209. package/dist/better-auth/generators/react/react-better-auth/index.d.ts.map +1 -0
  210. package/dist/better-auth/generators/react/react-better-auth/index.js +3 -0
  211. package/dist/better-auth/generators/react/react-better-auth/index.js.map +1 -0
  212. package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.d.ts +280 -0
  213. package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.d.ts.map +1 -0
  214. package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.js +74 -0
  215. package/dist/better-auth/generators/react/react-better-auth/react-better-auth.generator.js.map +1 -0
  216. package/dist/better-auth/generators/react/react-better-auth/templates/src/app/auth-loaded-gate.tsx +55 -0
  217. package/dist/better-auth/generators/react/react-better-auth/templates/src/services/auth-client.ts +13 -0
  218. package/dist/better-auth/index.d.ts +3 -0
  219. package/dist/better-auth/index.d.ts.map +1 -0
  220. package/dist/better-auth/index.js +2 -0
  221. package/dist/better-auth/index.js.map +1 -0
  222. package/dist/better-auth/plugin.json +9 -0
  223. package/dist/better-auth/static/icon.svg +10 -0
  224. package/dist/common/components/auth-config-tabs.d.ts +2 -0
  225. package/dist/common/components/auth-config-tabs.d.ts.map +1 -0
  226. package/dist/common/components/auth-config-tabs.js +21 -0
  227. package/dist/common/components/auth-config-tabs.js.map +1 -0
  228. package/dist/index.d.ts +3 -1
  229. package/dist/index.js +2 -1
  230. package/dist/local-auth/admin/common.d.ts +5 -0
  231. package/dist/local-auth/admin/common.d.ts.map +1 -0
  232. package/dist/local-auth/admin/common.js +29 -0
  233. package/dist/local-auth/admin/common.js.map +1 -0
  234. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts +488 -0
  235. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.d.ts.map +1 -0
  236. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js +127 -0
  237. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/admin-crud-manage-roles-action.generator.js.map +1 -0
  238. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts +488 -0
  239. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.d.ts.map +1 -0
  240. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js +9 -0
  241. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/index.js.map +1 -0
  242. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts +12 -0
  243. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.d.ts.map +1 -0
  244. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js +24 -0
  245. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-paths.js.map +1 -0
  246. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts +249 -0
  247. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.d.ts.map +1 -0
  248. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js +41 -0
  249. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/template-renderers.js.map +1 -0
  250. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts +238 -0
  251. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.d.ts.map +1 -0
  252. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js +20 -0
  253. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/generated/typed-templates.js.map +1 -0
  254. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts +2 -0
  255. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.d.ts.map +1 -0
  256. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.js +2 -0
  257. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/index.js.map +1 -0
  258. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts +22 -0
  259. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.d.ts.map +1 -0
  260. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js +78 -0
  261. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.js.map +1 -0
  262. package/dist/local-auth/admin/generators/admin-crud-manage-roles-action/templates/routes/-components/role-manager-dialog.tsx +164 -0
  263. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts +487 -0
  264. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.d.ts.map +1 -0
  265. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js +119 -0
  266. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/admin-crud-reset-password-action.generator.js.map +1 -0
  267. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts +488 -0
  268. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.d.ts.map +1 -0
  269. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.js +9 -0
  270. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/index.js.map +1 -0
  271. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts +12 -0
  272. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.d.ts.map +1 -0
  273. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js +24 -0
  274. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-paths.js.map +1 -0
  275. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts +249 -0
  276. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.d.ts.map +1 -0
  277. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js +41 -0
  278. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/template-renderers.js.map +1 -0
  279. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts +473 -0
  280. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.d.ts.map +1 -0
  281. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js +22 -0
  282. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/generated/typed-templates.js.map +1 -0
  283. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.d.ts +2 -0
  284. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.d.ts.map +1 -0
  285. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.js +2 -0
  286. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/index.js.map +1 -0
  287. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts +22 -0
  288. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.d.ts.map +1 -0
  289. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js +89 -0
  290. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.js.map +1 -0
  291. package/dist/local-auth/admin/generators/admin-crud-reset-password-action/templates/routes/-components/password-reset-dialog.tsx +171 -0
  292. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts +233 -0
  293. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.d.ts.map +1 -0
  294. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js +54 -0
  295. package/dist/local-auth/admin/generators/admin-crud-roles-column/admin-crud-roles-column.generator.js.map +1 -0
  296. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.d.ts +2 -0
  297. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.d.ts.map +1 -0
  298. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.js +2 -0
  299. package/dist/local-auth/admin/generators/admin-crud-roles-column/index.js.map +1 -0
  300. package/dist/local-auth/admin/node.d.ts +5 -0
  301. package/dist/local-auth/admin/node.d.ts.map +1 -0
  302. package/dist/local-auth/admin/node.js +57 -0
  303. package/dist/local-auth/admin/node.js.map +1 -0
  304. package/dist/local-auth/admin/schema/manage-role-action.d.ts +12 -0
  305. package/dist/local-auth/admin/schema/manage-role-action.d.ts.map +1 -0
  306. package/dist/local-auth/admin/schema/manage-role-action.js +6 -0
  307. package/dist/local-auth/admin/schema/manage-role-action.js.map +1 -0
  308. package/dist/local-auth/admin/schema/reset-password-action.d.ts +12 -0
  309. package/dist/local-auth/admin/schema/reset-password-action.d.ts.map +1 -0
  310. package/dist/local-auth/admin/schema/reset-password-action.js +6 -0
  311. package/dist/local-auth/admin/schema/reset-password-action.js.map +1 -0
  312. package/dist/local-auth/admin/schema/roles-column.d.ts +9 -0
  313. package/dist/local-auth/admin/schema/roles-column.d.ts.map +1 -0
  314. package/dist/local-auth/admin/schema/roles-column.js +6 -0
  315. package/dist/local-auth/admin/schema/roles-column.js.map +1 -0
  316. package/dist/local-auth/admin/web.d.ts +5 -0
  317. package/dist/local-auth/admin/web.d.ts.map +1 -0
  318. package/dist/local-auth/admin/web.js +39 -0
  319. package/dist/local-auth/admin/web.js.map +1 -0
  320. package/dist/local-auth/constants/model-names.d.ts +23 -0
  321. package/dist/local-auth/constants/model-names.d.ts.map +1 -0
  322. package/dist/local-auth/constants/model-names.js +23 -0
  323. package/dist/local-auth/constants/model-names.js.map +1 -0
  324. package/dist/local-auth/core/common.d.ts +6 -0
  325. package/dist/local-auth/core/common.d.ts.map +1 -0
  326. package/dist/local-auth/core/common.js +17 -0
  327. package/dist/local-auth/core/common.js.map +1 -0
  328. package/dist/local-auth/core/components/local-auth-definition-editor.d.ts +5 -0
  329. package/dist/local-auth/core/components/local-auth-definition-editor.d.ts.map +1 -0
  330. package/dist/local-auth/core/components/local-auth-definition-editor.js +59 -0
  331. package/dist/local-auth/core/components/local-auth-definition-editor.js.map +1 -0
  332. package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.d.ts +14 -0
  333. package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.d.ts.map +1 -0
  334. package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.js +40 -0
  335. package/dist/local-auth/core/generators/auth-apollo/auth-apollo.generator.js.map +1 -0
  336. package/dist/local-auth/core/generators/auth-apollo/index.d.ts +2 -0
  337. package/dist/local-auth/core/generators/auth-apollo/index.d.ts.map +1 -0
  338. package/dist/local-auth/core/generators/auth-apollo/index.js +2 -0
  339. package/dist/local-auth/core/generators/auth-apollo/index.js.map +1 -0
  340. package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.d.ts +2 -0
  341. package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.d.ts.map +1 -0
  342. package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.js +20 -0
  343. package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.js.map +1 -0
  344. package/dist/local-auth/core/generators/auth-apollo/templates/session-error-link.ts +18 -0
  345. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts +136 -0
  346. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.d.ts.map +1 -0
  347. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js +76 -0
  348. package/dist/local-auth/core/generators/auth-email-password/auth-email-password.generator.js.map +1 -0
  349. package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts +359 -0
  350. package/dist/local-auth/core/generators/auth-email-password/generated/index.d.ts.map +1 -0
  351. package/dist/local-auth/core/generators/auth-email-password/generated/index.js +11 -0
  352. package/dist/local-auth/core/generators/auth-email-password/generated/index.js.map +1 -0
  353. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts +18 -0
  354. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.d.ts.map +1 -0
  355. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js +30 -0
  356. package/dist/local-auth/core/generators/auth-email-password/generated/template-paths.js.map +1 -0
  357. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts +110 -0
  358. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.d.ts.map +1 -0
  359. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js +93 -0
  360. package/dist/local-auth/core/generators/auth-email-password/generated/template-renderers.js.map +1 -0
  361. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts +45 -0
  362. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.d.ts.map +1 -0
  363. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js +46 -0
  364. package/dist/local-auth/core/generators/auth-email-password/generated/ts-import-providers.js.map +1 -0
  365. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts +394 -0
  366. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.d.ts.map +1 -0
  367. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js +141 -0
  368. package/dist/local-auth/core/generators/auth-email-password/generated/typed-templates.js.map +1 -0
  369. package/dist/local-auth/core/generators/auth-email-password/index.d.ts +4 -0
  370. package/dist/local-auth/core/generators/auth-email-password/index.d.ts.map +1 -0
  371. package/dist/local-auth/core/generators/auth-email-password/index.js +3 -0
  372. package/dist/local-auth/core/generators/auth-email-password/index.js.map +1 -0
  373. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts +17 -0
  374. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.d.ts.map +1 -0
  375. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js +18 -0
  376. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.js.map +1 -0
  377. package/dist/local-auth/core/generators/auth-email-password/templates/module/constants/password.constants.ts +21 -0
  378. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.d.ts +2 -0
  379. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.d.ts.map +1 -0
  380. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.js +24 -0
  381. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.js.map +1 -0
  382. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/email-verification.mutations.ts +35 -0
  383. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.d.ts +2 -0
  384. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.d.ts.map +1 -0
  385. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.js +38 -0
  386. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.js.map +1 -0
  387. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/password-reset.mutations.ts +54 -0
  388. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts +2 -0
  389. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.d.ts.map +1 -0
  390. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js +72 -0
  391. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.js.map +1 -0
  392. package/dist/local-auth/core/generators/auth-email-password/templates/module/schema/user-password.mutations.ts +91 -0
  393. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts +24 -0
  394. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.d.ts.map +1 -0
  395. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js +87 -0
  396. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.js.map +1 -0
  397. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/email-verification.service.ts +140 -0
  398. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts +37 -0
  399. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.d.ts.map +1 -0
  400. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js +161 -0
  401. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.js.map +1 -0
  402. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/password-reset.service.ts +235 -0
  403. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts +60 -0
  404. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.d.ts.map +1 -0
  405. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js +207 -0
  406. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.js.map +1 -0
  407. package/dist/local-auth/core/generators/auth-email-password/templates/module/services/user-password.service.ts +330 -0
  408. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts +43 -0
  409. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.d.ts.map +1 -0
  410. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js +48 -0
  411. package/dist/local-auth/core/generators/auth-email-templates/auth-email-templates.generator.js.map +1 -0
  412. package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts +96 -0
  413. package/dist/local-auth/core/generators/auth-email-templates/generated/index.d.ts.map +1 -0
  414. package/dist/local-auth/core/generators/auth-email-templates/generated/index.js +11 -0
  415. package/dist/local-auth/core/generators/auth-email-templates/generated/index.js.map +1 -0
  416. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts +14 -0
  417. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.d.ts.map +1 -0
  418. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js +26 -0
  419. package/dist/local-auth/core/generators/auth-email-templates/generated/template-paths.js.map +1 -0
  420. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts +41 -0
  421. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.d.ts.map +1 -0
  422. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js +59 -0
  423. package/dist/local-auth/core/generators/auth-email-templates/generated/template-renderers.js.map +1 -0
  424. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts +60 -0
  425. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.d.ts.map +1 -0
  426. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js +42 -0
  427. package/dist/local-auth/core/generators/auth-email-templates/generated/typed-templates.js.map +1 -0
  428. package/dist/local-auth/core/generators/auth-email-templates/index.d.ts +2 -0
  429. package/dist/local-auth/core/generators/auth-email-templates/index.d.ts.map +1 -0
  430. package/dist/local-auth/core/generators/auth-email-templates/index.js +2 -0
  431. package/dist/local-auth/core/generators/auth-email-templates/index.js.map +1 -0
  432. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts +3 -0
  433. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.d.ts.map +1 -0
  434. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js +14 -0
  435. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.js.map +1 -0
  436. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/account-verification.email.tsx +55 -0
  437. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts +3 -0
  438. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.d.ts.map +1 -0
  439. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js +12 -0
  440. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.js.map +1 -0
  441. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-changed.email.tsx +44 -0
  442. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts +3 -0
  443. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.d.ts.map +1 -0
  444. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js +14 -0
  445. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.js.map +1 -0
  446. package/dist/local-auth/core/generators/auth-email-templates/templates/src/emails/auth/password-reset.email.tsx +55 -0
  447. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.d.ts +57 -0
  448. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.d.ts.map +1 -0
  449. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.js +32 -0
  450. package/dist/local-auth/core/generators/auth-hooks/auth-hooks.generator.js.map +1 -0
  451. package/dist/local-auth/core/generators/auth-hooks/generated/index.d.ts +93 -0
  452. package/dist/local-auth/core/generators/auth-hooks/generated/index.d.ts.map +1 -0
  453. package/dist/local-auth/core/generators/auth-hooks/generated/index.js +11 -0
  454. package/dist/local-auth/core/generators/auth-hooks/generated/index.js.map +1 -0
  455. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.d.ts +14 -0
  456. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.d.ts.map +1 -0
  457. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.js +26 -0
  458. package/dist/local-auth/core/generators/auth-hooks/generated/template-paths.js.map +1 -0
  459. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.d.ts +35 -0
  460. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.d.ts.map +1 -0
  461. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.js +45 -0
  462. package/dist/local-auth/core/generators/auth-hooks/generated/template-renderers.js.map +1 -0
  463. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts +29 -0
  464. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.d.ts.map +1 -0
  465. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js +37 -0
  466. package/dist/local-auth/core/generators/auth-hooks/generated/ts-import-providers.js.map +1 -0
  467. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.d.ts +71 -0
  468. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.d.ts.map +1 -0
  469. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.js +50 -0
  470. package/dist/local-auth/core/generators/auth-hooks/generated/typed-templates.js.map +1 -0
  471. package/dist/local-auth/core/generators/auth-hooks/index.d.ts +4 -0
  472. package/dist/local-auth/core/generators/auth-hooks/index.d.ts.map +1 -0
  473. package/dist/local-auth/core/generators/auth-hooks/index.js +3 -0
  474. package/dist/local-auth/core/generators/auth-hooks/index.js.map +1 -0
  475. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts +3 -0
  476. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.d.ts.map +1 -0
  477. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js +30 -0
  478. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.js.map +1 -0
  479. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-log-out.ts +33 -0
  480. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts +15 -0
  481. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.d.ts.map +1 -0
  482. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js +16 -0
  483. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.js.map +1 -0
  484. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-session.ts +32 -0
  485. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts +7 -0
  486. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +1 -0
  487. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js +15 -0
  488. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +1 -0
  489. package/dist/local-auth/core/generators/auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +16 -0
  490. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts +117 -0
  491. package/dist/local-auth/core/generators/auth-module/auth-module.generator.d.ts.map +1 -0
  492. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js +103 -0
  493. package/dist/local-auth/core/generators/auth-module/auth-module.generator.js.map +1 -0
  494. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts +281 -0
  495. package/dist/local-auth/core/generators/auth-module/generated/index.d.ts.map +1 -0
  496. package/dist/local-auth/core/generators/auth-module/generated/index.js +11 -0
  497. package/dist/local-auth/core/generators/auth-module/generated/index.js.map +1 -0
  498. package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts +24 -0
  499. package/dist/local-auth/core/generators/auth-module/generated/template-paths.d.ts.map +1 -0
  500. package/dist/local-auth/core/generators/auth-module/generated/template-paths.js +36 -0
  501. package/dist/local-auth/core/generators/auth-module/generated/template-paths.js.map +1 -0
  502. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts +102 -0
  503. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.d.ts.map +1 -0
  504. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js +109 -0
  505. package/dist/local-auth/core/generators/auth-module/generated/template-renderers.js.map +1 -0
  506. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts +30 -0
  507. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.d.ts.map +1 -0
  508. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js +37 -0
  509. package/dist/local-auth/core/generators/auth-module/generated/ts-import-providers.js.map +1 -0
  510. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts +269 -0
  511. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.d.ts.map +1 -0
  512. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js +192 -0
  513. package/dist/local-auth/core/generators/auth-module/generated/typed-templates.js.map +1 -0
  514. package/dist/local-auth/core/generators/auth-module/index.d.ts +4 -0
  515. package/dist/local-auth/core/generators/auth-module/index.d.ts.map +1 -0
  516. package/dist/local-auth/core/generators/auth-module/index.js +3 -0
  517. package/dist/local-auth/core/generators/auth-module/index.js.map +1 -0
  518. package/dist/local-auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts +16 -0
  519. package/dist/local-auth/core/generators/auth-module/templates/module/constants/user-session.constants.d.ts.map +1 -0
  520. package/dist/local-auth/core/generators/auth-module/templates/module/constants/user-session.constants.js +17 -0
  521. package/dist/local-auth/core/generators/auth-module/templates/module/constants/user-session.constants.js.map +1 -0
  522. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.d.ts +6 -0
  523. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.d.ts.map +1 -0
  524. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.js +17 -0
  525. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.js.map +1 -0
  526. package/dist/local-auth/core/generators/auth-module/templates/module/queues/cleanup-auth-verification.queue.ts +21 -0
  527. package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.d.ts +8 -0
  528. package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.d.ts.map +1 -0
  529. package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.js +16 -0
  530. package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.js.map +1 -0
  531. package/dist/local-auth/core/generators/auth-module/templates/module/schema/auth-role.enum.ts +21 -0
  532. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.d.ts +2 -0
  533. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.d.ts.map +1 -0
  534. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js +23 -0
  535. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.js.map +1 -0
  536. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-roles.mutations.ts +26 -0
  537. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts +2 -0
  538. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.d.ts.map +1 -0
  539. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js +19 -0
  540. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.js.map +1 -0
  541. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session-payload.object-type.ts +25 -0
  542. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts +2 -0
  543. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.d.ts.map +1 -0
  544. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js +18 -0
  545. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.js.map +1 -0
  546. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.mutations.ts +22 -0
  547. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts +2 -0
  548. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.d.ts.map +1 -0
  549. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js +36 -0
  550. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.js.map +1 -0
  551. package/dist/local-auth/core/generators/auth-module/templates/module/schema/user-session.queries.ts +43 -0
  552. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.d.ts +40 -0
  553. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.d.ts.map +1 -0
  554. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.js +106 -0
  555. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.js.map +1 -0
  556. package/dist/local-auth/core/generators/auth-module/templates/module/services/auth-verification.service.ts +146 -0
  557. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.d.ts +15 -0
  558. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.d.ts.map +1 -0
  559. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js +35 -0
  560. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.js.map +1 -0
  561. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-roles.service.ts +47 -0
  562. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts +43 -0
  563. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.d.ts.map +1 -0
  564. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js +190 -0
  565. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.js.map +1 -0
  566. package/dist/local-auth/core/generators/auth-module/templates/module/services/user-session.service.ts +262 -0
  567. package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts +38 -0
  568. package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.d.ts.map +1 -0
  569. package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.js +71 -0
  570. package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.js.map +1 -0
  571. package/dist/local-auth/core/generators/auth-module/templates/module/utils/cookie-signer.ts +77 -0
  572. package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts +11 -0
  573. package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.d.ts.map +1 -0
  574. package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.js +38 -0
  575. package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.js.map +1 -0
  576. package/dist/local-auth/core/generators/auth-module/templates/module/utils/session-cookie.ts +42 -0
  577. package/dist/local-auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts +10 -0
  578. package/dist/local-auth/core/generators/auth-module/templates/module/utils/verify-request-origin.d.ts.map +1 -0
  579. package/dist/local-auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js +35 -0
  580. package/dist/local-auth/core/generators/auth-module/templates/module/utils/verify-request-origin.js.map +1 -0
  581. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts +263 -0
  582. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.d.ts.map +1 -0
  583. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js +32 -0
  584. package/dist/local-auth/core/generators/auth-routes/auth-routes.generator.js.map +1 -0
  585. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts +1497 -0
  586. package/dist/local-auth/core/generators/auth-routes/generated/index.d.ts.map +1 -0
  587. package/dist/local-auth/core/generators/auth-routes/generated/index.js +11 -0
  588. package/dist/local-auth/core/generators/auth-routes/generated/index.js.map +1 -0
  589. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts +18 -0
  590. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.d.ts.map +1 -0
  591. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js +28 -0
  592. package/dist/local-auth/core/generators/auth-routes/generated/template-paths.js.map +1 -0
  593. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts +264 -0
  594. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.d.ts.map +1 -0
  595. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js +62 -0
  596. package/dist/local-auth/core/generators/auth-routes/generated/template-renderers.js.map +1 -0
  597. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts +21 -0
  598. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.d.ts.map +1 -0
  599. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js +30 -0
  600. package/dist/local-auth/core/generators/auth-routes/generated/ts-import-providers.js.map +1 -0
  601. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts +2206 -0
  602. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.d.ts.map +1 -0
  603. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js +117 -0
  604. package/dist/local-auth/core/generators/auth-routes/generated/typed-templates.js.map +1 -0
  605. package/dist/local-auth/core/generators/auth-routes/index.d.ts +4 -0
  606. package/dist/local-auth/core/generators/auth-routes/index.d.ts.map +1 -0
  607. package/dist/local-auth/core/generators/auth-routes/index.js +3 -0
  608. package/dist/local-auth/core/generators/auth-routes/index.js.map +1 -0
  609. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts +10 -0
  610. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.d.ts.map +1 -0
  611. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js +11 -0
  612. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.js.map +1 -0
  613. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/-constants.ts +12 -0
  614. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts +2 -0
  615. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.d.ts.map +1 -0
  616. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js +60 -0
  617. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.js.map +1 -0
  618. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/forgot-password.tsx +127 -0
  619. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts +7 -0
  620. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.d.ts.map +1 -0
  621. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js +85 -0
  622. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.js.map +1 -0
  623. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/login.tsx +168 -0
  624. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts +7 -0
  625. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.d.ts.map +1 -0
  626. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js +82 -0
  627. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.js.map +1 -0
  628. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/register.tsx +153 -0
  629. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts +7 -0
  630. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.d.ts.map +1 -0
  631. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js +150 -0
  632. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.js.map +1 -0
  633. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/reset-password.tsx +283 -0
  634. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts +2 -0
  635. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.d.ts.map +1 -0
  636. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.js +10 -0
  637. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.js.map +1 -0
  638. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/route.tsx +17 -0
  639. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts +7 -0
  640. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.d.ts.map +1 -0
  641. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js +106 -0
  642. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.js.map +1 -0
  643. package/dist/local-auth/core/generators/auth-routes/templates/routes/auth_/verify-email.tsx +206 -0
  644. package/dist/local-auth/core/generators/index.d.ts +10 -0
  645. package/dist/local-auth/core/generators/index.d.ts.map +1 -0
  646. package/dist/local-auth/core/generators/index.js +10 -0
  647. package/dist/local-auth/core/generators/index.js.map +1 -0
  648. package/dist/local-auth/core/generators/react-auth/index.d.ts +2 -0
  649. package/dist/local-auth/core/generators/react-auth/index.d.ts.map +1 -0
  650. package/dist/local-auth/core/generators/react-auth/index.js +2 -0
  651. package/dist/local-auth/core/generators/react-auth/index.js.map +1 -0
  652. package/dist/local-auth/core/generators/react-auth/react-auth.generator.d.ts +9 -0
  653. package/dist/local-auth/core/generators/react-auth/react-auth.generator.d.ts.map +1 -0
  654. package/dist/local-auth/core/generators/react-auth/react-auth.generator.js +31 -0
  655. package/dist/local-auth/core/generators/react-auth/react-auth.generator.js.map +1 -0
  656. package/dist/local-auth/core/generators/react-session/generated/index.d.ts +546 -0
  657. package/dist/local-auth/core/generators/react-session/generated/index.d.ts.map +1 -0
  658. package/dist/local-auth/core/generators/react-session/generated/index.js +11 -0
  659. package/dist/local-auth/core/generators/react-session/generated/index.js.map +1 -0
  660. package/dist/local-auth/core/generators/react-session/generated/template-paths.d.ts +13 -0
  661. package/dist/local-auth/core/generators/react-session/generated/template-paths.d.ts.map +1 -0
  662. package/dist/local-auth/core/generators/react-session/generated/template-paths.js +25 -0
  663. package/dist/local-auth/core/generators/react-session/generated/template-paths.js.map +1 -0
  664. package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts +271 -0
  665. package/dist/local-auth/core/generators/react-session/generated/template-renderers.d.ts.map +1 -0
  666. package/dist/local-auth/core/generators/react-session/generated/template-renderers.js +51 -0
  667. package/dist/local-auth/core/generators/react-session/generated/template-renderers.js.map +1 -0
  668. package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.d.ts +21 -0
  669. package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.d.ts.map +1 -0
  670. package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.js +30 -0
  671. package/dist/local-auth/core/generators/react-session/generated/ts-import-providers.js.map +1 -0
  672. package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts +525 -0
  673. package/dist/local-auth/core/generators/react-session/generated/typed-templates.d.ts.map +1 -0
  674. package/dist/local-auth/core/generators/react-session/generated/typed-templates.js +35 -0
  675. package/dist/local-auth/core/generators/react-session/generated/typed-templates.js.map +1 -0
  676. package/dist/local-auth/core/generators/react-session/index.d.ts +4 -0
  677. package/dist/local-auth/core/generators/react-session/index.d.ts.map +1 -0
  678. package/dist/local-auth/core/generators/react-session/index.js +3 -0
  679. package/dist/local-auth/core/generators/react-session/index.js.map +1 -0
  680. package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts +290 -0
  681. package/dist/local-auth/core/generators/react-session/react-session.generator.d.ts.map +1 -0
  682. package/dist/local-auth/core/generators/react-session/react-session.generator.js +48 -0
  683. package/dist/local-auth/core/generators/react-session/react-session.generator.js.map +1 -0
  684. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts +7 -0
  685. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.d.ts.map +1 -0
  686. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js +72 -0
  687. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.js.map +1 -0
  688. package/dist/local-auth/core/generators/react-session/templates/src/app/user-session-provider.tsx +99 -0
  689. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.d.ts +58 -0
  690. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.d.ts.map +1 -0
  691. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.js +103 -0
  692. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.js.map +1 -0
  693. package/dist/local-auth/core/generators/react-session/templates/src/services/user-session-client.ts +122 -0
  694. package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts +99 -0
  695. package/dist/local-auth/core/generators/seed-initial-user/generated/index.d.ts.map +1 -0
  696. package/dist/local-auth/core/generators/seed-initial-user/generated/index.js +11 -0
  697. package/dist/local-auth/core/generators/seed-initial-user/generated/index.js.map +1 -0
  698. package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.d.ts +12 -0
  699. package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.d.ts.map +1 -0
  700. package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.js +24 -0
  701. package/dist/local-auth/core/generators/seed-initial-user/generated/template-paths.js.map +1 -0
  702. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts +50 -0
  703. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.d.ts.map +1 -0
  704. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.js +46 -0
  705. package/dist/local-auth/core/generators/seed-initial-user/generated/template-renderers.js.map +1 -0
  706. package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.d.ts +18 -0
  707. package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.d.ts.map +1 -0
  708. package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.js +26 -0
  709. package/dist/local-auth/core/generators/seed-initial-user/generated/ts-import-providers.js.map +1 -0
  710. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts +39 -0
  711. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.d.ts.map +1 -0
  712. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.js +21 -0
  713. package/dist/local-auth/core/generators/seed-initial-user/generated/typed-templates.js.map +1 -0
  714. package/dist/local-auth/core/generators/seed-initial-user/index.d.ts +4 -0
  715. package/dist/local-auth/core/generators/seed-initial-user/index.d.ts.map +1 -0
  716. package/dist/local-auth/core/generators/seed-initial-user/index.js +3 -0
  717. package/dist/local-auth/core/generators/seed-initial-user/index.js.map +1 -0
  718. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts +58 -0
  719. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.d.ts.map +1 -0
  720. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js +57 -0
  721. package/dist/local-auth/core/generators/seed-initial-user/seed-initial-user.generator.js.map +1 -0
  722. package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.d.ts +3 -0
  723. package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.d.ts.map +1 -0
  724. package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.js +32 -0
  725. package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.js.map +1 -0
  726. package/dist/local-auth/core/generators/seed-initial-user/templates/src/prisma/seed-initial-user.ts +43 -0
  727. package/dist/local-auth/core/index.d.ts +2 -0
  728. package/dist/local-auth/core/index.d.ts.map +1 -0
  729. package/dist/local-auth/core/index.js +2 -0
  730. package/dist/local-auth/core/index.js.map +1 -0
  731. package/dist/local-auth/core/node.d.ts +5 -0
  732. package/dist/local-auth/core/node.d.ts.map +1 -0
  733. package/dist/local-auth/core/node.js +69 -0
  734. package/dist/local-auth/core/node.js.map +1 -0
  735. package/dist/local-auth/core/schema/models.d.ts +3 -0
  736. package/dist/local-auth/core/schema/models.d.ts.map +1 -0
  737. package/dist/local-auth/core/schema/models.js +266 -0
  738. package/dist/local-auth/core/schema/models.js.map +1 -0
  739. package/dist/local-auth/core/schema/plugin-definition.d.ts +9 -0
  740. package/dist/local-auth/core/schema/plugin-definition.d.ts.map +1 -0
  741. package/dist/local-auth/core/schema/plugin-definition.js +13 -0
  742. package/dist/local-auth/core/schema/plugin-definition.js.map +1 -0
  743. package/dist/local-auth/core/web.d.ts +6 -0
  744. package/dist/local-auth/core/web.d.ts.map +1 -0
  745. package/dist/local-auth/core/web.js +13 -0
  746. package/dist/local-auth/core/web.js.map +1 -0
  747. package/dist/local-auth/index.d.ts +2 -0
  748. package/dist/local-auth/index.d.ts.map +1 -0
  749. package/dist/local-auth/index.js +2 -0
  750. package/dist/local-auth/index.js.map +1 -0
  751. package/dist/local-auth/plugin.json +9 -0
  752. package/dist/local-auth/static/icon.svg +1 -0
  753. package/dist/placeholder-auth/constants/model-names.d.ts +4 -0
  754. package/dist/placeholder-auth/constants/model-names.d.ts.map +1 -0
  755. package/dist/placeholder-auth/constants/model-names.js +4 -0
  756. package/dist/placeholder-auth/constants/model-names.js.map +1 -0
  757. package/dist/placeholder-auth/core/common.d.ts +5 -0
  758. package/dist/placeholder-auth/core/common.d.ts.map +1 -0
  759. package/dist/placeholder-auth/core/common.js +17 -0
  760. package/dist/placeholder-auth/core/common.js.map +1 -0
  761. package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.d.ts +5 -0
  762. package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.d.ts.map +1 -0
  763. package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js +50 -0
  764. package/dist/placeholder-auth/core/components/placeholder-auth-definition-editor.js.map +1 -0
  765. package/dist/placeholder-auth/core/generators/index.d.ts +4 -0
  766. package/dist/placeholder-auth/core/generators/index.d.ts.map +1 -0
  767. package/dist/placeholder-auth/core/generators/index.js +4 -0
  768. package/dist/placeholder-auth/core/generators/index.js.map +1 -0
  769. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts +46 -0
  770. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.d.ts.map +1 -0
  771. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.js +11 -0
  772. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/index.js.map +1 -0
  773. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts +14 -0
  774. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.d.ts.map +1 -0
  775. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js +26 -0
  776. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-paths.js.map +1 -0
  777. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts +18 -0
  778. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.d.ts.map +1 -0
  779. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js +35 -0
  780. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/template-renderers.js.map +1 -0
  781. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts +18 -0
  782. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.d.ts.map +1 -0
  783. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js +27 -0
  784. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/ts-import-providers.js.map +1 -0
  785. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts +17 -0
  786. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.d.ts.map +1 -0
  787. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js +45 -0
  788. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/generated/typed-templates.js.map +1 -0
  789. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.d.ts +2 -0
  790. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.d.ts.map +1 -0
  791. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.js +2 -0
  792. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/index.js.map +1 -0
  793. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts +37 -0
  794. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.d.ts.map +1 -0
  795. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js +32 -0
  796. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/placeholder-auth-hooks.generator.js.map +1 -0
  797. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.d.ts +5 -0
  798. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.d.ts.map +1 -0
  799. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.js +8 -0
  800. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.js.map +1 -0
  801. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-log-out.ts +8 -0
  802. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.d.ts +9 -0
  803. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.d.ts.map +1 -0
  804. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.js +8 -0
  805. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.js.map +1 -0
  806. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-session.ts +13 -0
  807. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts +5 -0
  808. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.d.ts.map +1 -0
  809. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.js +13 -0
  810. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.js.map +1 -0
  811. package/dist/placeholder-auth/core/generators/placeholder-auth-hooks/templates/src/hooks/use-user-id-or-throw.ts +14 -0
  812. package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts +47 -0
  813. package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.d.ts.map +1 -0
  814. package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.js +27 -0
  815. package/dist/placeholder-auth/core/generators/placeholder-auth-module/auth-module.generator.js.map +1 -0
  816. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts +79 -0
  817. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.d.ts.map +1 -0
  818. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.js +11 -0
  819. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/index.js.map +1 -0
  820. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.d.ts +12 -0
  821. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.d.ts.map +1 -0
  822. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.js +24 -0
  823. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-paths.js.map +1 -0
  824. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts +41 -0
  825. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.d.ts.map +1 -0
  826. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.js +41 -0
  827. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/template-renderers.js.map +1 -0
  828. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.d.ts +10 -0
  829. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.d.ts.map +1 -0
  830. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.js +23 -0
  831. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/ts-import-providers.js.map +1 -0
  832. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts +28 -0
  833. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.d.ts.map +1 -0
  834. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.js +20 -0
  835. package/dist/placeholder-auth/core/generators/placeholder-auth-module/generated/typed-templates.js.map +1 -0
  836. package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.d.ts +2 -0
  837. package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.d.ts.map +1 -0
  838. package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.js +2 -0
  839. package/dist/placeholder-auth/core/generators/placeholder-auth-module/index.js.map +1 -0
  840. package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.d.ts +23 -0
  841. package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.d.ts.map +1 -0
  842. package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.js +29 -0
  843. package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.js.map +1 -0
  844. package/dist/placeholder-auth/core/generators/placeholder-auth-module/templates/module/services/user-session.service.ts +41 -0
  845. package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.d.ts +2 -0
  846. package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.d.ts.map +1 -0
  847. package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.js +2 -0
  848. package/dist/placeholder-auth/core/generators/placeholder-react-auth/index.js.map +1 -0
  849. package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.d.ts +9 -0
  850. package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.d.ts.map +1 -0
  851. package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.js +31 -0
  852. package/dist/placeholder-auth/core/generators/placeholder-react-auth/react-auth.generator.js.map +1 -0
  853. package/dist/placeholder-auth/core/index.d.ts +2 -0
  854. package/dist/placeholder-auth/core/index.d.ts.map +1 -0
  855. package/dist/placeholder-auth/core/index.js +2 -0
  856. package/dist/placeholder-auth/core/index.js.map +1 -0
  857. package/dist/placeholder-auth/core/node.d.ts +5 -0
  858. package/dist/placeholder-auth/core/node.d.ts.map +1 -0
  859. package/dist/placeholder-auth/core/node.js +32 -0
  860. package/dist/placeholder-auth/core/node.js.map +1 -0
  861. package/dist/placeholder-auth/core/schema/models.d.ts +3 -0
  862. package/dist/placeholder-auth/core/schema/models.d.ts.map +1 -0
  863. package/dist/placeholder-auth/core/schema/models.js +38 -0
  864. package/dist/placeholder-auth/core/schema/models.js.map +1 -0
  865. package/dist/placeholder-auth/core/schema/plugin-definition.d.ts +5 -0
  866. package/dist/placeholder-auth/core/schema/plugin-definition.d.ts.map +1 -0
  867. package/dist/placeholder-auth/core/schema/plugin-definition.js +4 -0
  868. package/dist/placeholder-auth/core/schema/plugin-definition.js.map +1 -0
  869. package/dist/placeholder-auth/core/web.d.ts +6 -0
  870. package/dist/placeholder-auth/core/web.d.ts.map +1 -0
  871. package/dist/placeholder-auth/core/web.js +13 -0
  872. package/dist/placeholder-auth/core/web.js.map +1 -0
  873. package/dist/placeholder-auth/index.d.ts +2 -0
  874. package/dist/placeholder-auth/index.d.ts.map +1 -0
  875. package/dist/placeholder-auth/index.js +2 -0
  876. package/dist/placeholder-auth/index.js.map +1 -0
  877. package/dist/placeholder-auth/plugin.json +10 -0
  878. package/dist/placeholder-auth/static/icon.svg +1 -0
  879. package/dist/web/assets/__federation_expose_authCoreCommon-CnNoa4tF.js +30 -0
  880. package/dist/web/assets/__federation_expose_authCoreCommon-CnNoa4tF.js.map +1 -0
  881. package/dist/web/assets/__federation_expose_authCoreWeb-BL_U7yuj.js +433 -0
  882. package/dist/web/assets/__federation_expose_authCoreWeb-BL_U7yuj.js.map +1 -0
  883. package/dist/web/assets/__federation_expose_better-authCoreCommon-D-mTcxYO.js +20 -0
  884. package/dist/web/assets/__federation_expose_better-authCoreCommon-D-mTcxYO.js.map +1 -0
  885. package/dist/web/assets/__federation_expose_better-authCoreWeb-CXHL-Ghf.js +402 -0
  886. package/dist/web/assets/__federation_expose_better-authCoreWeb-CXHL-Ghf.js.map +1 -0
  887. package/dist/web/assets/__federation_expose_local-authAdminCommon-LIsARRNU.js +63 -0
  888. package/dist/web/assets/__federation_expose_local-authAdminCommon-LIsARRNU.js.map +1 -0
  889. package/dist/web/assets/__federation_expose_local-authAdminWeb-DyYUDLm9.js +41 -0
  890. package/dist/web/assets/__federation_expose_local-authAdminWeb-DyYUDLm9.js.map +1 -0
  891. package/dist/web/assets/__federation_expose_local-authCoreCommon-p_UbExc7.js +21 -0
  892. package/dist/web/assets/__federation_expose_local-authCoreCommon-p_UbExc7.js.map +1 -0
  893. package/dist/web/assets/__federation_expose_local-authCoreWeb-8TcUJFT6.js +432 -0
  894. package/dist/web/assets/__federation_expose_local-authCoreWeb-8TcUJFT6.js.map +1 -0
  895. package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-CtZXaDUc.js +23 -0
  896. package/dist/web/assets/__federation_expose_placeholder-authCoreCommon-CtZXaDUc.js.map +1 -0
  897. package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-CZAKokTb.js +162 -0
  898. package/dist/web/assets/__federation_expose_placeholder-authCoreWeb-CZAKokTb.js.map +1 -0
  899. package/dist/web/assets/__federation_fn_import-3DENgil8.js +421 -0
  900. package/dist/web/assets/__federation_fn_import-3DENgil8.js.map +1 -0
  901. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-B5bdbzFj.js +357 -0
  902. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-B5bdbzFj.js.map +1 -0
  903. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-DCA3vO4J.js +21478 -0
  904. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-DCA3vO4J.js.map +1 -0
  905. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BvL7RO9S.js +73599 -0
  906. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-BvL7RO9S.js.map +1 -0
  907. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-0-N5BG4T.js +1822 -0
  908. package/dist/web/assets/__federation_shared_@baseplate-dev/utils-0-N5BG4T.js.map +1 -0
  909. package/dist/web/assets/__federation_shared_@tanstack/react-router-DSniiJ6U.js +6565 -0
  910. package/dist/web/assets/__federation_shared_@tanstack/react-router-DSniiJ6U.js.map +1 -0
  911. package/dist/web/assets/__federation_shared_react-CJ2OfFKA.js +8 -0
  912. package/dist/web/assets/__federation_shared_react-CJ2OfFKA.js.map +1 -0
  913. package/dist/web/assets/__federation_shared_react-dom-B4vgf5Ln.js +251 -0
  914. package/dist/web/assets/__federation_shared_react-dom-B4vgf5Ln.js.map +1 -0
  915. package/dist/web/assets/__federation_shared_zod-Do7Aa1b5.js +13250 -0
  916. package/dist/web/assets/__federation_shared_zod-Do7Aa1b5.js.map +1 -0
  917. package/dist/web/assets/_commonjsHelpers-B85MJLTf.js +6 -0
  918. package/dist/web/assets/_commonjsHelpers-B85MJLTf.js.map +1 -0
  919. package/dist/web/assets/get-auth-plugin-definition-DHcbFujw.js +13 -0
  920. package/dist/web/assets/get-auth-plugin-definition-DHcbFujw.js.map +1 -0
  921. package/dist/web/assets/index-DQKNnI1w.js +103 -0
  922. package/dist/web/assets/index-DQKNnI1w.js.map +1 -0
  923. package/dist/web/assets/index-DUwCgkeV.js +570 -0
  924. package/dist/web/assets/index-DUwCgkeV.js.map +1 -0
  925. package/dist/web/assets/index.esm-Dpqxgpya.js +2676 -0
  926. package/dist/web/assets/index.esm-Dpqxgpya.js.map +1 -0
  927. package/dist/web/assets/isEqual-tnzoadW8.js +242 -0
  928. package/dist/web/assets/isEqual-tnzoadW8.js.map +1 -0
  929. package/dist/web/assets/jsx-runtime-XI9uIe3W.js +60 -0
  930. package/dist/web/assets/jsx-runtime-XI9uIe3W.js.map +1 -0
  931. package/dist/web/assets/mergeWith-VagwCqUi.js +76 -0
  932. package/dist/web/assets/mergeWith-VagwCqUi.js.map +1 -0
  933. package/dist/web/assets/model-names-DrcaRxt1.js +25 -0
  934. package/dist/web/assets/model-names-DrcaRxt1.js.map +1 -0
  935. package/dist/web/assets/model-utils-BFX3c3dn.js +694 -0
  936. package/dist/web/assets/model-utils-BFX3c3dn.js.map +1 -0
  937. package/dist/web/assets/plugin-definition-B86WQ7Ni.js +79 -0
  938. package/dist/web/assets/plugin-definition-B86WQ7Ni.js.map +1 -0
  939. package/dist/web/assets/plugin-definition-CEQb6mWV.js +20 -0
  940. package/dist/web/assets/plugin-definition-CEQb6mWV.js.map +1 -0
  941. package/dist/web/assets/plugin-definition-DrsKbcJc.js +31 -0
  942. package/dist/web/assets/plugin-definition-DrsKbcJc.js.map +1 -0
  943. package/dist/web/assets/plugin-definition-KEpaSB6p.js +16 -0
  944. package/dist/web/assets/plugin-definition-KEpaSB6p.js.map +1 -0
  945. package/dist/web/assets/react-hu8Hx0R4.js +47 -0
  946. package/dist/web/assets/react-hu8Hx0R4.js.map +1 -0
  947. package/dist/web/assets/registries-Tz_dluz3.js +1119 -0
  948. package/dist/web/assets/registries-Tz_dluz3.js.map +1 -0
  949. package/dist/web/assets/remoteEntry.js +30 -6
  950. package/dist/web/assets/remoteEntry.js.map +1 -1
  951. package/dist/web/assets/style-DiK_rD1L.css +120 -0
  952. package/dist/web/assets/styles-CpKtlIgU.js +69 -0
  953. package/dist/web/assets/styles-CpKtlIgU.js.map +1 -0
  954. package/dist/web/assets/with-selector-DTXBONcE.js +201 -0
  955. package/dist/web/assets/with-selector-DTXBONcE.js.map +1 -0
  956. package/dist/web/index.html +1 -1
  957. package/package.json +44 -33
  958. package/dist/auth/core/components/role-editor-form.d.ts +0 -10
  959. package/dist/auth/core/components/role-editor-form.d.ts.map +0 -1
  960. package/dist/auth/core/components/role-editor-form.js +0 -27
  961. package/dist/auth/core/components/role-editor-form.js.map +0 -1
  962. package/dist/auth/core/schema/models.d.ts +0 -9
  963. package/dist/auth/core/schema/models.d.ts.map +0 -1
  964. package/dist/auth/core/schema/models.js +0 -198
  965. package/dist/auth/core/schema/models.js.map +0 -1
  966. package/dist/auth/generators/fastify/auth-module/auth-module.generator.d.ts +0 -65
  967. package/dist/auth/generators/fastify/auth-module/auth-module.generator.d.ts.map +0 -1
  968. package/dist/auth/generators/fastify/auth-module/auth-module.generator.js +0 -62
  969. package/dist/auth/generators/fastify/auth-module/auth-module.generator.js.map +0 -1
  970. package/dist/auth/generators/fastify/auth-module/generated/ts-templates.d.ts +0 -96
  971. package/dist/auth/generators/fastify/auth-module/generated/ts-templates.d.ts.map +0 -1
  972. package/dist/auth/generators/fastify/auth-module/generated/ts-templates.js +0 -94
  973. package/dist/auth/generators/fastify/auth-module/generated/ts-templates.js.map +0 -1
  974. package/dist/auth/generators/fastify/auth-module/templates/management.ts +0 -22
  975. package/dist/auth/generators/fastify/auth-module/templates/schema/user-session-payload.object-type.ts +0 -23
  976. package/dist/auth/generators/fastify/auth-module/templates/schema/user-session.mutations.ts +0 -22
  977. package/dist/auth/generators/fastify/auth-module/templates/schema/user-session.queries.ts +0 -20
  978. package/dist/auth/generators/fastify/auth-module/templates/services/user-session.service.ts +0 -251
  979. package/dist/auth/generators/fastify/auth-module/templates/user-session.service.ts +0 -101
  980. package/dist/auth/generators/fastify/auth-module/templates/utils/cookie-signer.ts +0 -71
  981. package/dist/auth/generators/fastify/auth-module/templates/utils/session-cookie.ts +0 -42
  982. package/dist/auth/generators/fastify/index.d.ts +0 -2
  983. package/dist/auth/generators/fastify/index.d.ts.map +0 -1
  984. package/dist/auth/generators/fastify/index.js +0 -2
  985. package/dist/auth/generators/fastify/index.js.map +0 -1
  986. package/dist/auth/generators/index.d.ts +0 -2
  987. package/dist/auth/generators/index.d.ts.map +0 -1
  988. package/dist/auth/generators/index.js +0 -2
  989. package/dist/auth/generators/index.js.map +0 -1
  990. package/dist/auth/metadata.json +0 -8
  991. package/dist/auth0/constants/packages.d.ts +0 -6
  992. package/dist/auth0/constants/packages.d.ts.map +0 -1
  993. package/dist/auth0/constants/packages.js +0 -6
  994. package/dist/auth0/constants/packages.js.map +0 -1
  995. package/dist/auth0/core/common.d.ts +0 -7
  996. package/dist/auth0/core/common.d.ts.map +0 -1
  997. package/dist/auth0/core/common.js +0 -28
  998. package/dist/auth0/core/common.js.map +0 -1
  999. package/dist/auth0/core/components/auth-definition-editor.d.ts +0 -5
  1000. package/dist/auth0/core/components/auth-definition-editor.d.ts.map +0 -1
  1001. package/dist/auth0/core/components/auth-definition-editor.js +0 -57
  1002. package/dist/auth0/core/components/auth-definition-editor.js.map +0 -1
  1003. package/dist/auth0/core/components/role-dialog.d.ts +0 -14
  1004. package/dist/auth0/core/components/role-dialog.d.ts.map +0 -1
  1005. package/dist/auth0/core/components/role-dialog.js +0 -27
  1006. package/dist/auth0/core/components/role-dialog.js.map +0 -1
  1007. package/dist/auth0/core/components/role-editor-form.d.ts +0 -10
  1008. package/dist/auth0/core/components/role-editor-form.d.ts.map +0 -1
  1009. package/dist/auth0/core/components/role-editor-form.js +0 -52
  1010. package/dist/auth0/core/components/role-editor-form.js.map +0 -1
  1011. package/dist/auth0/core/node.d.ts +0 -5
  1012. package/dist/auth0/core/node.d.ts.map +0 -1
  1013. package/dist/auth0/core/node.js +0 -86
  1014. package/dist/auth0/core/node.js.map +0 -1
  1015. package/dist/auth0/core/schema/migrations.d.ts +0 -3
  1016. package/dist/auth0/core/schema/migrations.d.ts.map +0 -1
  1017. package/dist/auth0/core/schema/migrations.js +0 -17
  1018. package/dist/auth0/core/schema/migrations.js.map +0 -1
  1019. package/dist/auth0/core/schema/models.d.ts +0 -6
  1020. package/dist/auth0/core/schema/models.d.ts.map +0 -1
  1021. package/dist/auth0/core/schema/models.js +0 -39
  1022. package/dist/auth0/core/schema/models.js.map +0 -1
  1023. package/dist/auth0/core/schema/plugin-definition.d.ts +0 -73
  1024. package/dist/auth0/core/schema/plugin-definition.d.ts.map +0 -1
  1025. package/dist/auth0/core/schema/plugin-definition.js +0 -17
  1026. package/dist/auth0/core/schema/plugin-definition.js.map +0 -1
  1027. package/dist/auth0/core/web.d.ts +0 -6
  1028. package/dist/auth0/core/web.d.ts.map +0 -1
  1029. package/dist/auth0/core/web.js +0 -14
  1030. package/dist/auth0/core/web.js.map +0 -1
  1031. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts +0 -67
  1032. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.d.ts.map +0 -1
  1033. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js +0 -125
  1034. package/dist/auth0/generators/fastify/auth0-module/auth0-module.generator.js.map +0 -1
  1035. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.d.ts +0 -3
  1036. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.d.ts.map +0 -1
  1037. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.js +0 -12
  1038. package/dist/auth0/generators/fastify/auth0-module/generated/ts-import-maps.js.map +0 -1
  1039. package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.d.ts +0 -43
  1040. package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.d.ts.map +0 -1
  1041. package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.js +0 -25
  1042. package/dist/auth0/generators/fastify/auth0-module/generated/ts-templates.js.map +0 -1
  1043. package/dist/auth0/generators/fastify/auth0-module/templates/management.ts +0 -22
  1044. package/dist/auth0/generators/fastify/auth0-module/templates/user-session.service.ts +0 -101
  1045. package/dist/auth0/generators/fastify/index.d.ts +0 -2
  1046. package/dist/auth0/generators/fastify/index.d.ts.map +0 -1
  1047. package/dist/auth0/generators/fastify/index.js +0 -2
  1048. package/dist/auth0/generators/fastify/index.js.map +0 -1
  1049. package/dist/auth0/generators/index.d.ts.map +0 -1
  1050. package/dist/auth0/generators/index.js.map +0 -1
  1051. package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.d.ts +0 -10
  1052. package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.d.ts.map +0 -1
  1053. package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.js +0 -41
  1054. package/dist/auth0/generators/react/auth0-apollo/auth0-apollo.generator.js.map +0 -1
  1055. package/dist/auth0/generators/react/auth0-apollo/templates/auth-link.ts +0 -11
  1056. package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.d.ts +0 -61
  1057. package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.d.ts.map +0 -1
  1058. package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js +0 -59
  1059. package/dist/auth0/generators/react/auth0-callback/auth0-callback.generator.js.map +0 -1
  1060. package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.d.ts +0 -106
  1061. package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.d.ts.map +0 -1
  1062. package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.js +0 -28
  1063. package/dist/auth0/generators/react/auth0-callback/generated/ts-templates.js.map +0 -1
  1064. package/dist/auth0/generators/react/auth0-callback/templates/auth0-callback.page.tsx +0 -61
  1065. package/dist/auth0/generators/react/auth0-callback/templates/signup.page.tsx +0 -48
  1066. package/dist/auth0/generators/react/auth0-components/auth0-components.generator.d.ts +0 -53
  1067. package/dist/auth0/generators/react/auth0-components/auth0-components.generator.d.ts.map +0 -1
  1068. package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js +0 -44
  1069. package/dist/auth0/generators/react/auth0-components/auth0-components.generator.js.map +0 -1
  1070. package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.d.ts +0 -3
  1071. package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.d.ts.map +0 -1
  1072. package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.js +0 -12
  1073. package/dist/auth0/generators/react/auth0-components/generated/ts-import-maps.js.map +0 -1
  1074. package/dist/auth0/generators/react/auth0-components/generated/ts-templates.d.ts +0 -45
  1075. package/dist/auth0/generators/react/auth0-components/generated/ts-templates.d.ts.map +0 -1
  1076. package/dist/auth0/generators/react/auth0-components/generated/ts-templates.js +0 -13
  1077. package/dist/auth0/generators/react/auth0-components/generated/ts-templates.js.map +0 -1
  1078. package/dist/auth0/generators/react/auth0-components/templates/RequireAuth.tsx +0 -22
  1079. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts +0 -28
  1080. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.d.ts.map +0 -1
  1081. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js +0 -65
  1082. package/dist/auth0/generators/react/auth0-hooks/auth0-hooks.generator.js.map +0 -1
  1083. package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.d.ts +0 -8
  1084. package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.d.ts.map +0 -1
  1085. package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.js +0 -12
  1086. package/dist/auth0/generators/react/auth0-hooks/generated/text-templates.js.map +0 -1
  1087. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.d.ts +0 -3
  1088. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.d.ts.map +0 -1
  1089. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.js +0 -16
  1090. package/dist/auth0/generators/react/auth0-hooks/generated/ts-import-maps.js.map +0 -1
  1091. package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.d.ts +0 -33
  1092. package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.d.ts.map +0 -1
  1093. package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.js +0 -50
  1094. package/dist/auth0/generators/react/auth0-hooks/generated/ts-templates.js.map +0 -1
  1095. package/dist/auth0/generators/react/auth0-hooks/templates/useCurrentUser.gql +0 -10
  1096. package/dist/auth0/generators/react/auth0-hooks/templates/useCurrentUser.ts +0 -29
  1097. package/dist/auth0/generators/react/auth0-hooks/templates/useLogOut.ts +0 -14
  1098. package/dist/auth0/generators/react/auth0-hooks/templates/useRequiredUserId.ts +0 -11
  1099. package/dist/auth0/generators/react/auth0-hooks/templates/useSession.ts +0 -23
  1100. package/dist/auth0/generators/react/index.d.ts +0 -6
  1101. package/dist/auth0/generators/react/index.d.ts.map +0 -1
  1102. package/dist/auth0/generators/react/index.js +0 -6
  1103. package/dist/auth0/generators/react/index.js.map +0 -1
  1104. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts +0 -23
  1105. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.d.ts.map +0 -1
  1106. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js +0 -64
  1107. package/dist/auth0/generators/react/react-auth0/react-auth0.generator.js.map +0 -1
  1108. package/dist/auth0/metadata.json +0 -8
  1109. package/dist/auth0/static/icon.svg +0 -7
  1110. package/dist/index.js.map +0 -1
  1111. package/dist/roles/constants.d.ts.map +0 -1
  1112. package/dist/roles/constants.js.map +0 -1
  1113. package/dist/roles/index.d.ts.map +0 -1
  1114. package/dist/roles/index.js.map +0 -1
  1115. package/dist/roles/schema.d.ts +0 -65
  1116. package/dist/roles/schema.d.ts.map +0 -1
  1117. package/dist/roles/schema.js +0 -43
  1118. package/dist/roles/schema.js.map +0 -1
  1119. package/dist/utils/cn.d.ts +0 -2
  1120. package/dist/utils/cn.d.ts.map +0 -1
  1121. package/dist/utils/cn.js +0 -2
  1122. package/dist/utils/cn.js.map +0 -1
  1123. package/dist/web/assets/__federation_expose_auth0CoreCommon-DCwCR5dZ.js +0 -54
  1124. package/dist/web/assets/__federation_expose_auth0CoreCommon-DCwCR5dZ.js.map +0 -1
  1125. package/dist/web/assets/__federation_expose_auth0CoreWeb-BlCwYpTq.js +0 -383
  1126. package/dist/web/assets/__federation_expose_auth0CoreWeb-BlCwYpTq.js.map +0 -1
  1127. package/dist/web/assets/__federation_fn_import-dzKjrTzS.js +0 -421
  1128. package/dist/web/assets/__federation_fn_import-dzKjrTzS.js.map +0 -1
  1129. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BXHJHUXP.js +0 -341
  1130. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BXHJHUXP.js.map +0 -1
  1131. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-GtzVuDsM.js +0 -9901
  1132. package/dist/web/assets/__federation_shared_@baseplate-dev/project-builder-lib-GtzVuDsM.js.map +0 -1
  1133. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-ChoqtPkg.js +0 -12723
  1134. package/dist/web/assets/__federation_shared_@baseplate-dev/ui-components-ChoqtPkg.js.map +0 -1
  1135. package/dist/web/assets/__federation_shared_react-dom-Bwq4pLax.js +0 -250
  1136. package/dist/web/assets/__federation_shared_react-dom-Bwq4pLax.js.map +0 -1
  1137. package/dist/web/assets/__federation_shared_react-uocnGSER.js +0 -7
  1138. package/dist/web/assets/__federation_shared_react-uocnGSER.js.map +0 -1
  1139. package/dist/web/assets/__federation_shared_zod-BK7IELHt.js +0 -4380
  1140. package/dist/web/assets/__federation_shared_zod-BK7IELHt.js.map +0 -1
  1141. package/dist/web/assets/index-B1hOKVPw.js +0 -574
  1142. package/dist/web/assets/index-B1hOKVPw.js.map +0 -1
  1143. package/dist/web/assets/index-BxDOOHD-.js +0 -95
  1144. package/dist/web/assets/index-BxDOOHD-.js.map +0 -1
  1145. package/dist/web/assets/index.esm-BZEyAv4m.js +0 -2584
  1146. package/dist/web/assets/index.esm-BZEyAv4m.js.map +0 -1
  1147. package/dist/web/assets/model-merger-CdV-7CWE.js +0 -2039
  1148. package/dist/web/assets/model-merger-CdV-7CWE.js.map +0 -1
  1149. package/dist/web/assets/plugin-definition-C9Q-BrBQ.js +0 -78
  1150. package/dist/web/assets/plugin-definition-C9Q-BrBQ.js.map +0 -1
  1151. package/dist/web/assets/react-BfiX28GO.js +0 -47
  1152. package/dist/web/assets/react-BfiX28GO.js.map +0 -1
  1153. package/dist/web/assets/style-BdgwWjAf.css +0 -95
  1154. package/dist/web-export.js.map +0 -1
  1155. package/manifest.json +0 -4
  1156. /package/dist/{roles → auth/core/schema/roles}/constants.d.ts +0 -0
  1157. /package/dist/{roles → auth/core/schema/roles}/constants.js +0 -0
  1158. /package/dist/{roles → auth/core/schema/roles}/index.d.ts +0 -0
  1159. /package/dist/{roles → auth/core/schema/roles}/index.js +0 -0
  1160. /package/dist/{auth0 → better-auth}/generators/index.d.ts +0 -0
  1161. /package/dist/{auth0 → better-auth}/generators/index.js +0 -0
  1162. /package/dist/{auth/generators/fastify/auth-module/templates → local-auth/core/generators/auth-module/templates/module/constants}/user-session.constants.ts +0 -0
  1163. /package/dist/{auth/generators/fastify/auth-module/templates → local-auth/core/generators/auth-module/templates/module}/utils/verify-request-origin.ts +0 -0
@@ -0,0 +1,2676 @@
1
+ import { importShared } from './__federation_fn_import-3DENgil8.js';
2
+
3
+ const React = await importShared('react');
4
+
5
+
6
+ var isCheckBoxInput = (element) => element.type === 'checkbox';
7
+
8
+ var isDateObject = (value) => value instanceof Date;
9
+
10
+ var isNullOrUndefined = (value) => value == null;
11
+
12
+ const isObjectType = (value) => typeof value === 'object';
13
+ var isObject = (value) => !isNullOrUndefined(value) &&
14
+ !Array.isArray(value) &&
15
+ isObjectType(value) &&
16
+ !isDateObject(value);
17
+
18
+ var getEventValue = (event) => isObject(event) && event.target
19
+ ? isCheckBoxInput(event.target)
20
+ ? event.target.checked
21
+ : event.target.value
22
+ : event;
23
+
24
+ var getNodeParentName = (name) => name.substring(0, name.search(/\.\d+(\.|$)/)) || name;
25
+
26
+ var isNameInFieldArray = (names, name) => names.has(getNodeParentName(name));
27
+
28
+ var isPlainObject = (tempObject) => {
29
+ const prototypeCopy = tempObject.constructor && tempObject.constructor.prototype;
30
+ return (isObject(prototypeCopy) && prototypeCopy.hasOwnProperty('isPrototypeOf'));
31
+ };
32
+
33
+ var isWeb = typeof window !== 'undefined' &&
34
+ typeof window.HTMLElement !== 'undefined' &&
35
+ typeof document !== 'undefined';
36
+
37
+ function cloneObject(data) {
38
+ if (data instanceof Date) {
39
+ return new Date(data);
40
+ }
41
+ const isFileListInstance = typeof FileList !== 'undefined' && data instanceof FileList;
42
+ if (isWeb && (data instanceof Blob || isFileListInstance)) {
43
+ return data;
44
+ }
45
+ const isArray = Array.isArray(data);
46
+ if (!isArray && !(isObject(data) && isPlainObject(data))) {
47
+ return data;
48
+ }
49
+ const copy = isArray ? [] : Object.create(Object.getPrototypeOf(data));
50
+ for (const key in data) {
51
+ if (Object.prototype.hasOwnProperty.call(data, key)) {
52
+ copy[key] = cloneObject(data[key]);
53
+ }
54
+ }
55
+ return copy;
56
+ }
57
+
58
+ var isKey = (value) => /^\w*$/.test(value);
59
+
60
+ var isUndefined = (val) => val === undefined;
61
+
62
+ var compact = (value) => Array.isArray(value) ? value.filter(Boolean) : [];
63
+
64
+ var stringToPath = (input) => compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
65
+
66
+ var get = (object, path, defaultValue) => {
67
+ if (!path || !isObject(object)) {
68
+ return defaultValue;
69
+ }
70
+ const result = (isKey(path) ? [path] : stringToPath(path)).reduce((result, key) => isNullOrUndefined(result) ? result : result[key], object);
71
+ return isUndefined(result) || result === object
72
+ ? isUndefined(object[path])
73
+ ? defaultValue
74
+ : object[path]
75
+ : result;
76
+ };
77
+
78
+ var isBoolean = (value) => typeof value === 'boolean';
79
+
80
+ var isFunction = (value) => typeof value === 'function';
81
+
82
+ var set = (object, path, value) => {
83
+ let index = -1;
84
+ const tempPath = isKey(path) ? [path] : stringToPath(path);
85
+ const length = tempPath.length;
86
+ const lastIndex = length - 1;
87
+ while (++index < length) {
88
+ const key = tempPath[index];
89
+ let newValue = value;
90
+ if (index !== lastIndex) {
91
+ const objValue = object[key];
92
+ newValue =
93
+ isObject(objValue) || Array.isArray(objValue)
94
+ ? objValue
95
+ : !isNaN(+tempPath[index + 1])
96
+ ? []
97
+ : {};
98
+ }
99
+ if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
100
+ return;
101
+ }
102
+ object[key] = newValue;
103
+ object = object[key];
104
+ }
105
+ };
106
+
107
+ const EVENTS = {
108
+ BLUR: 'blur',
109
+ FOCUS_OUT: 'focusout',
110
+ CHANGE: 'change',
111
+ };
112
+ const VALIDATION_MODE = {
113
+ onBlur: 'onBlur',
114
+ onChange: 'onChange',
115
+ onSubmit: 'onSubmit',
116
+ onTouched: 'onTouched',
117
+ all: 'all',
118
+ };
119
+ const INPUT_VALIDATION_RULES = {
120
+ max: 'max',
121
+ min: 'min',
122
+ maxLength: 'maxLength',
123
+ minLength: 'minLength',
124
+ pattern: 'pattern',
125
+ required: 'required',
126
+ validate: 'validate',
127
+ };
128
+
129
+ /**
130
+ * Separate context for `control` to prevent unnecessary rerenders.
131
+ * Internal hooks that only need control use this instead of full form context.
132
+ */
133
+ const HookFormControlContext = React.createContext(null);
134
+ HookFormControlContext.displayName = 'HookFormControlContext';
135
+ /**
136
+ * @internal Internal hook to access only control from context.
137
+ */
138
+ const useFormControlContext = () => React.useContext(HookFormControlContext);
139
+
140
+ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true) => {
141
+ const result = {
142
+ defaultValues: control._defaultValues,
143
+ };
144
+ for (const key in formState) {
145
+ Object.defineProperty(result, key, {
146
+ get: () => {
147
+ const _key = key;
148
+ if (control._proxyFormState[_key] !== VALIDATION_MODE.all) {
149
+ control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;
150
+ }
151
+ localProxyFormState && (localProxyFormState[_key] = true);
152
+ return formState[_key];
153
+ },
154
+ });
155
+ }
156
+ return result;
157
+ };
158
+
159
+ const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
160
+
161
+ /**
162
+ * This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
163
+ *
164
+ * @remarks
165
+ * [API](https://react-hook-form.com/docs/useformstate) • [Demo](https://codesandbox.io/s/useformstate-75xly)
166
+ *
167
+ * @param props - include options on specify fields to subscribe. {@link UseFormStateReturn}
168
+ *
169
+ * @example
170
+ * ```tsx
171
+ * function App() {
172
+ * const { register, handleSubmit, control } = useForm({
173
+ * defaultValues: {
174
+ * firstName: "firstName"
175
+ * }});
176
+ * const { dirtyFields } = useFormState({
177
+ * control
178
+ * });
179
+ * const onSubmit = (data) => console.log(data);
180
+ *
181
+ * return (
182
+ * <form onSubmit={handleSubmit(onSubmit)}>
183
+ * <input {...register("firstName")} placeholder="First Name" />
184
+ * {dirtyFields.firstName && <p>Field is dirty.</p>}
185
+ * <input type="submit" />
186
+ * </form>
187
+ * );
188
+ * }
189
+ * ```
190
+ */
191
+ function useFormState(props) {
192
+ const formControl = useFormControlContext();
193
+ const { control = formControl, disabled, name, exact } = props || {};
194
+ const [formState, updateFormState] = React.useState(control._formState);
195
+ const _localProxyFormState = React.useRef({
196
+ isDirty: false,
197
+ isLoading: false,
198
+ dirtyFields: false,
199
+ touchedFields: false,
200
+ validatingFields: false,
201
+ isValidating: false,
202
+ isValid: false,
203
+ errors: false,
204
+ });
205
+ useIsomorphicLayoutEffect(() => control._subscribe({
206
+ name,
207
+ formState: _localProxyFormState.current,
208
+ exact,
209
+ callback: (formState) => {
210
+ !disabled &&
211
+ updateFormState({
212
+ ...control._formState,
213
+ ...formState,
214
+ });
215
+ },
216
+ }), [name, disabled, exact]);
217
+ React.useEffect(() => {
218
+ _localProxyFormState.current.isValid && control._setValid(true);
219
+ }, [control]);
220
+ return React.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);
221
+ }
222
+
223
+ var isString = (value) => typeof value === 'string';
224
+
225
+ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) => {
226
+ if (isString(names)) {
227
+ isGlobal && _names.watch.add(names);
228
+ return get(formValues, names, defaultValue);
229
+ }
230
+ if (Array.isArray(names)) {
231
+ return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName),
232
+ get(formValues, fieldName)));
233
+ }
234
+ isGlobal && (_names.watchAll = true);
235
+ return formValues;
236
+ };
237
+
238
+ var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
239
+
240
+ function deepEqual(object1, object2, _internal_visited = new WeakSet()) {
241
+ if (isPrimitive(object1) || isPrimitive(object2)) {
242
+ return Object.is(object1, object2);
243
+ }
244
+ if (isDateObject(object1) && isDateObject(object2)) {
245
+ return Object.is(object1.getTime(), object2.getTime());
246
+ }
247
+ const keys1 = Object.keys(object1);
248
+ const keys2 = Object.keys(object2);
249
+ if (keys1.length !== keys2.length) {
250
+ return false;
251
+ }
252
+ if (_internal_visited.has(object1) || _internal_visited.has(object2)) {
253
+ return true;
254
+ }
255
+ _internal_visited.add(object1);
256
+ _internal_visited.add(object2);
257
+ for (const key of keys1) {
258
+ const val1 = object1[key];
259
+ if (!keys2.includes(key)) {
260
+ return false;
261
+ }
262
+ if (key !== 'ref') {
263
+ const val2 = object2[key];
264
+ if ((isDateObject(val1) && isDateObject(val2)) ||
265
+ (isObject(val1) && isObject(val2)) ||
266
+ (Array.isArray(val1) && Array.isArray(val2))
267
+ ? !deepEqual(val1, val2, _internal_visited)
268
+ : !Object.is(val1, val2)) {
269
+ return false;
270
+ }
271
+ }
272
+ }
273
+ return true;
274
+ }
275
+
276
+ /**
277
+ * Custom hook to subscribe to field change and isolate re-rendering at the component level.
278
+ *
279
+ * @remarks
280
+ *
281
+ * [API](https://react-hook-form.com/docs/usewatch) • [Demo](https://codesandbox.io/s/react-hook-form-v7-ts-usewatch-h9i5e)
282
+ *
283
+ * @example
284
+ * ```tsx
285
+ * const { control } = useForm();
286
+ * const values = useWatch({
287
+ * name: "fieldName"
288
+ * control,
289
+ * })
290
+ * ```
291
+ */
292
+ function useWatch(props) {
293
+ const formControl = useFormControlContext();
294
+ const { control = formControl, name, defaultValue, disabled, exact, compute, } = props || {};
295
+ const _defaultValue = React.useRef(defaultValue);
296
+ const _compute = React.useRef(compute);
297
+ const _computeFormValues = React.useRef(undefined);
298
+ const _prevControl = React.useRef(control);
299
+ const _prevName = React.useRef(name);
300
+ _compute.current = compute;
301
+ const [value, updateValue] = React.useState(() => {
302
+ const defaultValue = control._getWatch(name, _defaultValue.current);
303
+ return _compute.current ? _compute.current(defaultValue) : defaultValue;
304
+ });
305
+ const getCurrentOutput = React.useCallback((values) => {
306
+ const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
307
+ return _compute.current ? _compute.current(formValues) : formValues;
308
+ }, [control._formValues, control._names, name]);
309
+ const refreshValue = React.useCallback((values) => {
310
+ if (!disabled) {
311
+ const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
312
+ if (_compute.current) {
313
+ const computedFormValues = _compute.current(formValues);
314
+ if (!deepEqual(computedFormValues, _computeFormValues.current)) {
315
+ updateValue(computedFormValues);
316
+ _computeFormValues.current = computedFormValues;
317
+ }
318
+ }
319
+ else {
320
+ updateValue(formValues);
321
+ }
322
+ }
323
+ }, [control._formValues, control._names, disabled, name]);
324
+ useIsomorphicLayoutEffect(() => {
325
+ if (_prevControl.current !== control ||
326
+ !deepEqual(_prevName.current, name)) {
327
+ _prevControl.current = control;
328
+ _prevName.current = name;
329
+ refreshValue();
330
+ }
331
+ return control._subscribe({
332
+ name,
333
+ formState: {
334
+ values: true,
335
+ },
336
+ exact,
337
+ callback: (formState) => {
338
+ refreshValue(formState.values);
339
+ },
340
+ });
341
+ }, [control, exact, name, refreshValue]);
342
+ React.useEffect(() => control._removeUnmounted());
343
+ // If name or control changed for this render, synchronously reflect the
344
+ // latest value so callers (like useController) see the correct value
345
+ // immediately on the same render.
346
+ // Optimize: Check control reference first before expensive deepEqual
347
+ const controlChanged = _prevControl.current !== control;
348
+ const prevName = _prevName.current;
349
+ // Cache the computed output to avoid duplicate calls within the same render
350
+ // We include shouldReturnImmediate in deps to ensure proper recomputation
351
+ const computedOutput = React.useMemo(() => {
352
+ if (disabled) {
353
+ return null;
354
+ }
355
+ const nameChanged = !controlChanged && !deepEqual(prevName, name);
356
+ const shouldReturnImmediate = controlChanged || nameChanged;
357
+ return shouldReturnImmediate ? getCurrentOutput() : null;
358
+ }, [disabled, controlChanged, name, prevName, getCurrentOutput]);
359
+ return computedOutput !== null ? computedOutput : value;
360
+ }
361
+
362
+ /**
363
+ * Custom hook to work with controlled component, this function provide you with both form and field level state. Re-render is isolated at the hook level.
364
+ *
365
+ * @remarks
366
+ * [API](https://react-hook-form.com/docs/usecontroller) • [Demo](https://codesandbox.io/s/usecontroller-0o8px)
367
+ *
368
+ * @param props - the path name to the form field value, and validation rules.
369
+ *
370
+ * @returns field properties, field and form state. {@link UseControllerReturn}
371
+ *
372
+ * @example
373
+ * ```tsx
374
+ * function Input(props) {
375
+ * const { field, fieldState, formState } = useController(props);
376
+ * return (
377
+ * <div>
378
+ * <input {...field} placeholder={props.name} />
379
+ * <p>{fieldState.isTouched && "Touched"}</p>
380
+ * <p>{formState.isSubmitted ? "submitted" : ""}</p>
381
+ * </div>
382
+ * );
383
+ * }
384
+ * ```
385
+ */
386
+ function useController(props) {
387
+ const formControl = useFormControlContext();
388
+ const { name, disabled, control = formControl, shouldUnregister, defaultValue, exact = true, } = props;
389
+ const isArrayField = isNameInFieldArray(control._names.array, name);
390
+ const defaultValueMemo = React.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
391
+ const value = useWatch({
392
+ control,
393
+ name,
394
+ defaultValue: defaultValueMemo,
395
+ exact,
396
+ });
397
+ const formState = useFormState({
398
+ control,
399
+ name,
400
+ exact,
401
+ });
402
+ const _props = React.useRef(props);
403
+ const _previousNameRef = React.useRef(undefined);
404
+ const _registerProps = React.useRef(control.register(name, {
405
+ ...props.rules,
406
+ value,
407
+ ...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),
408
+ }));
409
+ _props.current = props;
410
+ const fieldState = React.useMemo(() => Object.defineProperties({}, {
411
+ invalid: {
412
+ enumerable: true,
413
+ get: () => !!get(formState.errors, name),
414
+ },
415
+ isDirty: {
416
+ enumerable: true,
417
+ get: () => !!get(formState.dirtyFields, name),
418
+ },
419
+ isTouched: {
420
+ enumerable: true,
421
+ get: () => !!get(formState.touchedFields, name),
422
+ },
423
+ isValidating: {
424
+ enumerable: true,
425
+ get: () => !!get(formState.validatingFields, name),
426
+ },
427
+ error: {
428
+ enumerable: true,
429
+ get: () => get(formState.errors, name),
430
+ },
431
+ }), [formState, name]);
432
+ const onChange = React.useCallback((event) => _registerProps.current.onChange({
433
+ target: {
434
+ value: getEventValue(event),
435
+ name: name,
436
+ },
437
+ type: EVENTS.CHANGE,
438
+ }), [name]);
439
+ const onBlur = React.useCallback(() => _registerProps.current.onBlur({
440
+ target: {
441
+ value: get(control._formValues, name),
442
+ name: name,
443
+ },
444
+ type: EVENTS.BLUR,
445
+ }), [name, control._formValues]);
446
+ const ref = React.useCallback((elm) => {
447
+ const field = get(control._fields, name);
448
+ if (field && field._f && elm) {
449
+ field._f.ref = {
450
+ focus: () => isFunction(elm.focus) && elm.focus(),
451
+ select: () => isFunction(elm.select) && elm.select(),
452
+ setCustomValidity: (message) => isFunction(elm.setCustomValidity) && elm.setCustomValidity(message),
453
+ reportValidity: () => isFunction(elm.reportValidity) && elm.reportValidity(),
454
+ };
455
+ }
456
+ }, [control._fields, name]);
457
+ const field = React.useMemo(() => ({
458
+ name,
459
+ value,
460
+ ...(isBoolean(disabled) || formState.disabled
461
+ ? { disabled: formState.disabled || disabled }
462
+ : {}),
463
+ onChange,
464
+ onBlur,
465
+ ref,
466
+ }), [name, disabled, formState.disabled, onChange, onBlur, ref, value]);
467
+ React.useEffect(() => {
468
+ const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
469
+ const previousName = _previousNameRef.current;
470
+ if (previousName && previousName !== name && !isArrayField) {
471
+ control.unregister(previousName);
472
+ }
473
+ control.register(name, {
474
+ ..._props.current.rules,
475
+ ...(isBoolean(_props.current.disabled)
476
+ ? { disabled: _props.current.disabled }
477
+ : {}),
478
+ });
479
+ const updateMounted = (name, value) => {
480
+ const field = get(control._fields, name);
481
+ if (field && field._f) {
482
+ field._f.mount = value;
483
+ }
484
+ };
485
+ updateMounted(name, true);
486
+ if (_shouldUnregisterField) {
487
+ const value = cloneObject(get(control._options.defaultValues, name, _props.current.defaultValue));
488
+ set(control._defaultValues, name, value);
489
+ if (isUndefined(get(control._formValues, name))) {
490
+ set(control._formValues, name, value);
491
+ }
492
+ }
493
+ !isArrayField && control.register(name);
494
+ _previousNameRef.current = name;
495
+ return () => {
496
+ (isArrayField
497
+ ? _shouldUnregisterField && !control._state.action
498
+ : _shouldUnregisterField)
499
+ ? control.unregister(name)
500
+ : updateMounted(name, false);
501
+ };
502
+ }, [name, control, isArrayField, shouldUnregister]);
503
+ React.useEffect(() => {
504
+ control._setDisabledField({
505
+ disabled,
506
+ name,
507
+ });
508
+ }, [disabled, name, control]);
509
+ return React.useMemo(() => ({
510
+ field,
511
+ formState,
512
+ fieldState,
513
+ }), [field, formState, fieldState]);
514
+ }
515
+
516
+ const HookFormContext = React.createContext(null);
517
+ HookFormContext.displayName = 'HookFormContext';
518
+
519
+ var appendErrors = (name, validateAllFieldCriteria, errors, type, message) => validateAllFieldCriteria
520
+ ? {
521
+ ...errors[name],
522
+ types: {
523
+ ...(errors[name] && errors[name].types ? errors[name].types : {}),
524
+ [type]: message || true,
525
+ },
526
+ }
527
+ : {};
528
+
529
+ var convertToArrayPayload = (value) => (Array.isArray(value) ? value : [value]);
530
+
531
+ var createSubject = () => {
532
+ let _observers = [];
533
+ const next = (value) => {
534
+ for (const observer of _observers) {
535
+ observer.next && observer.next(value);
536
+ }
537
+ };
538
+ const subscribe = (observer) => {
539
+ _observers.push(observer);
540
+ return {
541
+ unsubscribe: () => {
542
+ _observers = _observers.filter((o) => o !== observer);
543
+ },
544
+ };
545
+ };
546
+ const unsubscribe = () => {
547
+ _observers = [];
548
+ };
549
+ return {
550
+ get observers() {
551
+ return _observers;
552
+ },
553
+ next,
554
+ subscribe,
555
+ unsubscribe,
556
+ };
557
+ };
558
+
559
+ function extractFormValues(fieldsState, formValues) {
560
+ const values = {};
561
+ for (const key in fieldsState) {
562
+ if (fieldsState.hasOwnProperty(key)) {
563
+ const fieldState = fieldsState[key];
564
+ const fieldValue = formValues[key];
565
+ if (fieldState && isObject(fieldState) && fieldValue) {
566
+ const nestedFieldsState = extractFormValues(fieldState, fieldValue);
567
+ if (isObject(nestedFieldsState)) {
568
+ values[key] = nestedFieldsState;
569
+ }
570
+ }
571
+ else if (fieldsState[key]) {
572
+ values[key] = fieldValue;
573
+ }
574
+ }
575
+ }
576
+ return values;
577
+ }
578
+
579
+ var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
580
+
581
+ var isFileInput = (element) => element.type === 'file';
582
+
583
+ var isHTMLElement = (value) => {
584
+ if (!isWeb) {
585
+ return false;
586
+ }
587
+ const owner = value ? value.ownerDocument : 0;
588
+ return (value instanceof
589
+ (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement));
590
+ };
591
+
592
+ var isMultipleSelect = (element) => element.type === `select-multiple`;
593
+
594
+ var isRadioInput = (element) => element.type === 'radio';
595
+
596
+ var isRadioOrCheckbox = (ref) => isRadioInput(ref) || isCheckBoxInput(ref);
597
+
598
+ var live = (ref) => isHTMLElement(ref) && ref.isConnected;
599
+
600
+ function baseGet(object, updatePath) {
601
+ const length = updatePath.slice(0, -1).length;
602
+ let index = 0;
603
+ while (index < length) {
604
+ object = isUndefined(object) ? index++ : object[updatePath[index++]];
605
+ }
606
+ return object;
607
+ }
608
+ function isEmptyArray(obj) {
609
+ for (const key in obj) {
610
+ if (obj.hasOwnProperty(key) && !isUndefined(obj[key])) {
611
+ return false;
612
+ }
613
+ }
614
+ return true;
615
+ }
616
+ function unset(object, path) {
617
+ const paths = Array.isArray(path)
618
+ ? path
619
+ : isKey(path)
620
+ ? [path]
621
+ : stringToPath(path);
622
+ const childObject = paths.length === 1 ? object : baseGet(object, paths);
623
+ const index = paths.length - 1;
624
+ const key = paths[index];
625
+ if (childObject) {
626
+ delete childObject[key];
627
+ }
628
+ if (index !== 0 &&
629
+ ((isObject(childObject) && isEmptyObject(childObject)) ||
630
+ (Array.isArray(childObject) && isEmptyArray(childObject)))) {
631
+ unset(object, paths.slice(0, -1));
632
+ }
633
+ return object;
634
+ }
635
+
636
+ var objectHasFunction = (data) => {
637
+ for (const key in data) {
638
+ if (isFunction(data[key])) {
639
+ return true;
640
+ }
641
+ }
642
+ return false;
643
+ };
644
+
645
+ function isTraversable(value) {
646
+ return Array.isArray(value) || (isObject(value) && !objectHasFunction(value));
647
+ }
648
+ function markFieldsDirty(data, fields = {}) {
649
+ for (const key in data) {
650
+ const value = data[key];
651
+ if (isTraversable(value)) {
652
+ fields[key] = Array.isArray(value) ? [] : {};
653
+ markFieldsDirty(value, fields[key]);
654
+ }
655
+ else if (!isUndefined(value)) {
656
+ fields[key] = true;
657
+ }
658
+ }
659
+ return fields;
660
+ }
661
+ function getDirtyFields(data, formValues, dirtyFieldsFromValues) {
662
+ if (!dirtyFieldsFromValues) {
663
+ dirtyFieldsFromValues = markFieldsDirty(formValues);
664
+ }
665
+ for (const key in data) {
666
+ const value = data[key];
667
+ if (isTraversable(value)) {
668
+ if (isUndefined(formValues) || isPrimitive(dirtyFieldsFromValues[key])) {
669
+ dirtyFieldsFromValues[key] = markFieldsDirty(value, Array.isArray(value) ? [] : {});
670
+ }
671
+ else {
672
+ getDirtyFields(value, isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);
673
+ }
674
+ }
675
+ else {
676
+ const formValue = formValues[key];
677
+ dirtyFieldsFromValues[key] = !deepEqual(value, formValue);
678
+ }
679
+ }
680
+ return dirtyFieldsFromValues;
681
+ }
682
+
683
+ const defaultResult = {
684
+ value: false,
685
+ isValid: false,
686
+ };
687
+ const validResult = { value: true, isValid: true };
688
+ var getCheckboxValue = (options) => {
689
+ if (Array.isArray(options)) {
690
+ if (options.length > 1) {
691
+ const values = options
692
+ .filter((option) => option && option.checked && !option.disabled)
693
+ .map((option) => option.value);
694
+ return { value: values, isValid: !!values.length };
695
+ }
696
+ return options[0].checked && !options[0].disabled
697
+ ? // @ts-expect-error expected to work in the browser
698
+ options[0].attributes && !isUndefined(options[0].attributes.value)
699
+ ? isUndefined(options[0].value) || options[0].value === ''
700
+ ? validResult
701
+ : { value: options[0].value, isValid: true }
702
+ : validResult
703
+ : defaultResult;
704
+ }
705
+ return defaultResult;
706
+ };
707
+
708
+ var getFieldValueAs = (value, { valueAsNumber, valueAsDate, setValueAs }) => isUndefined(value)
709
+ ? value
710
+ : valueAsNumber
711
+ ? value === ''
712
+ ? NaN
713
+ : value
714
+ ? +value
715
+ : value
716
+ : valueAsDate && isString(value)
717
+ ? new Date(value)
718
+ : setValueAs
719
+ ? setValueAs(value)
720
+ : value;
721
+
722
+ const defaultReturn = {
723
+ isValid: false,
724
+ value: null,
725
+ };
726
+ var getRadioValue = (options) => Array.isArray(options)
727
+ ? options.reduce((previous, option) => option && option.checked && !option.disabled
728
+ ? {
729
+ isValid: true,
730
+ value: option.value,
731
+ }
732
+ : previous, defaultReturn)
733
+ : defaultReturn;
734
+
735
+ function getFieldValue(_f) {
736
+ const ref = _f.ref;
737
+ if (isFileInput(ref)) {
738
+ return ref.files;
739
+ }
740
+ if (isRadioInput(ref)) {
741
+ return getRadioValue(_f.refs).value;
742
+ }
743
+ if (isMultipleSelect(ref)) {
744
+ return [...ref.selectedOptions].map(({ value }) => value);
745
+ }
746
+ if (isCheckBoxInput(ref)) {
747
+ return getCheckboxValue(_f.refs).value;
748
+ }
749
+ return getFieldValueAs(isUndefined(ref.value) ? _f.ref.value : ref.value, _f);
750
+ }
751
+
752
+ var getResolverOptions = (fieldsNames, _fields, criteriaMode, shouldUseNativeValidation) => {
753
+ const fields = {};
754
+ for (const name of fieldsNames) {
755
+ const field = get(_fields, name);
756
+ field && set(fields, name, field._f);
757
+ }
758
+ return {
759
+ criteriaMode,
760
+ names: [...fieldsNames],
761
+ fields,
762
+ shouldUseNativeValidation,
763
+ };
764
+ };
765
+
766
+ var isRegex = (value) => value instanceof RegExp;
767
+
768
+ var getRuleValue = (rule) => isUndefined(rule)
769
+ ? rule
770
+ : isRegex(rule)
771
+ ? rule.source
772
+ : isObject(rule)
773
+ ? isRegex(rule.value)
774
+ ? rule.value.source
775
+ : rule.value
776
+ : rule;
777
+
778
+ var getValidationModes = (mode) => ({
779
+ isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit,
780
+ isOnBlur: mode === VALIDATION_MODE.onBlur,
781
+ isOnChange: mode === VALIDATION_MODE.onChange,
782
+ isOnAll: mode === VALIDATION_MODE.all,
783
+ isOnTouch: mode === VALIDATION_MODE.onTouched,
784
+ });
785
+
786
+ const ASYNC_FUNCTION = 'AsyncFunction';
787
+ var hasPromiseValidation = (fieldReference) => !!fieldReference &&
788
+ !!fieldReference.validate &&
789
+ !!((isFunction(fieldReference.validate) &&
790
+ fieldReference.validate.constructor.name === ASYNC_FUNCTION) ||
791
+ (isObject(fieldReference.validate) &&
792
+ Object.values(fieldReference.validate).find((validateFunction) => validateFunction.constructor.name === ASYNC_FUNCTION)));
793
+
794
+ var hasValidation = (options) => options.mount &&
795
+ (options.required ||
796
+ options.min ||
797
+ options.max ||
798
+ options.maxLength ||
799
+ options.minLength ||
800
+ options.pattern ||
801
+ options.validate);
802
+
803
+ var isWatched = (name, _names, isBlurEvent) => !isBlurEvent &&
804
+ (_names.watchAll ||
805
+ _names.watch.has(name) ||
806
+ [..._names.watch].some((watchName) => name.startsWith(watchName) &&
807
+ /^\.\w+/.test(name.slice(watchName.length))));
808
+
809
+ const iterateFieldsByAction = (fields, action, fieldsNames, abortEarly) => {
810
+ for (const key of fieldsNames || Object.keys(fields)) {
811
+ const field = get(fields, key);
812
+ if (field) {
813
+ const { _f, ...currentField } = field;
814
+ if (_f) {
815
+ if (_f.refs && _f.refs[0] && action(_f.refs[0], key) && !abortEarly) {
816
+ return true;
817
+ }
818
+ else if (_f.ref && action(_f.ref, _f.name) && !abortEarly) {
819
+ return true;
820
+ }
821
+ else {
822
+ if (iterateFieldsByAction(currentField, action)) {
823
+ break;
824
+ }
825
+ }
826
+ }
827
+ else if (isObject(currentField)) {
828
+ if (iterateFieldsByAction(currentField, action)) {
829
+ break;
830
+ }
831
+ }
832
+ }
833
+ }
834
+ return;
835
+ };
836
+
837
+ function schemaErrorLookup(errors, _fields, name) {
838
+ const error = get(errors, name);
839
+ if (error || isKey(name)) {
840
+ return {
841
+ error,
842
+ name,
843
+ };
844
+ }
845
+ const names = name.split('.');
846
+ while (names.length) {
847
+ const fieldName = names.join('.');
848
+ const field = get(_fields, fieldName);
849
+ const foundError = get(errors, fieldName);
850
+ if (field && !Array.isArray(field) && name !== fieldName) {
851
+ return { name };
852
+ }
853
+ if (foundError && foundError.type) {
854
+ return {
855
+ name: fieldName,
856
+ error: foundError,
857
+ };
858
+ }
859
+ if (foundError && foundError.root && foundError.root.type) {
860
+ return {
861
+ name: `${fieldName}.root`,
862
+ error: foundError.root,
863
+ };
864
+ }
865
+ names.pop();
866
+ }
867
+ return {
868
+ name,
869
+ };
870
+ }
871
+
872
+ var shouldRenderFormState = (formStateData, _proxyFormState, updateFormState, isRoot) => {
873
+ updateFormState(formStateData);
874
+ const { name, ...formState } = formStateData;
875
+ return (isEmptyObject(formState) ||
876
+ Object.keys(formState).length >= Object.keys(_proxyFormState).length ||
877
+ Object.keys(formState).find((key) => _proxyFormState[key] ===
878
+ (!isRoot || VALIDATION_MODE.all)));
879
+ };
880
+
881
+ var shouldSubscribeByName = (name, signalName, exact) => !name ||
882
+ !signalName ||
883
+ name === signalName ||
884
+ convertToArrayPayload(name).some((currentName) => currentName &&
885
+ (exact
886
+ ? currentName === signalName
887
+ : currentName.startsWith(signalName) ||
888
+ signalName.startsWith(currentName)));
889
+
890
+ var skipValidation = (isBlurEvent, isTouched, isSubmitted, reValidateMode, mode) => {
891
+ if (mode.isOnAll) {
892
+ return false;
893
+ }
894
+ else if (!isSubmitted && mode.isOnTouch) {
895
+ return !(isTouched || isBlurEvent);
896
+ }
897
+ else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) {
898
+ return !isBlurEvent;
899
+ }
900
+ else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) {
901
+ return isBlurEvent;
902
+ }
903
+ return true;
904
+ };
905
+
906
+ var unsetEmptyArray = (ref, name) => !compact(get(ref, name)).length && unset(ref, name);
907
+
908
+ var updateFieldArrayRootError = (errors, error, name) => {
909
+ const fieldArrayErrors = convertToArrayPayload(get(errors, name));
910
+ set(fieldArrayErrors, 'root', error[name]);
911
+ set(errors, name, fieldArrayErrors);
912
+ return errors;
913
+ };
914
+
915
+ function getValidateError(result, ref, type = 'validate') {
916
+ if (isString(result) ||
917
+ (Array.isArray(result) && result.every(isString)) ||
918
+ (isBoolean(result) && !result)) {
919
+ return {
920
+ type,
921
+ message: isString(result) ? result : '',
922
+ ref,
923
+ };
924
+ }
925
+ }
926
+
927
+ var getValueAndMessage = (validationData) => isObject(validationData) && !isRegex(validationData)
928
+ ? validationData
929
+ : {
930
+ value: validationData,
931
+ message: '',
932
+ };
933
+
934
+ var validateField = async (field, disabledFieldNames, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => {
935
+ const { ref, refs, required, maxLength, minLength, min, max, pattern, validate, name, valueAsNumber, mount, } = field._f;
936
+ const inputValue = get(formValues, name);
937
+ if (!mount || disabledFieldNames.has(name)) {
938
+ return {};
939
+ }
940
+ const inputRef = refs ? refs[0] : ref;
941
+ const setCustomValidity = (message) => {
942
+ if (shouldUseNativeValidation && inputRef.reportValidity) {
943
+ inputRef.setCustomValidity(isBoolean(message) ? '' : message || '');
944
+ inputRef.reportValidity();
945
+ }
946
+ };
947
+ const error = {};
948
+ const isRadio = isRadioInput(ref);
949
+ const isCheckBox = isCheckBoxInput(ref);
950
+ const isRadioOrCheckbox = isRadio || isCheckBox;
951
+ const isEmpty = ((valueAsNumber || isFileInput(ref)) &&
952
+ isUndefined(ref.value) &&
953
+ isUndefined(inputValue)) ||
954
+ (isHTMLElement(ref) && ref.value === '') ||
955
+ inputValue === '' ||
956
+ (Array.isArray(inputValue) && !inputValue.length);
957
+ const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);
958
+ const getMinMaxMessage = (exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
959
+ const message = exceedMax ? maxLengthMessage : minLengthMessage;
960
+ error[name] = {
961
+ type: exceedMax ? maxType : minType,
962
+ message,
963
+ ref,
964
+ ...appendErrorsCurry(exceedMax ? maxType : minType, message),
965
+ };
966
+ };
967
+ if (isFieldArray
968
+ ? !Array.isArray(inputValue) || !inputValue.length
969
+ : required &&
970
+ ((!isRadioOrCheckbox && (isEmpty || isNullOrUndefined(inputValue))) ||
971
+ (isBoolean(inputValue) && !inputValue) ||
972
+ (isCheckBox && !getCheckboxValue(refs).isValid) ||
973
+ (isRadio && !getRadioValue(refs).isValid))) {
974
+ const { value, message } = isString(required)
975
+ ? { value: !!required, message: required }
976
+ : getValueAndMessage(required);
977
+ if (value) {
978
+ error[name] = {
979
+ type: INPUT_VALIDATION_RULES.required,
980
+ message,
981
+ ref: inputRef,
982
+ ...appendErrorsCurry(INPUT_VALIDATION_RULES.required, message),
983
+ };
984
+ if (!validateAllFieldCriteria) {
985
+ setCustomValidity(message);
986
+ return error;
987
+ }
988
+ }
989
+ }
990
+ if (!isEmpty && (!isNullOrUndefined(min) || !isNullOrUndefined(max))) {
991
+ let exceedMax;
992
+ let exceedMin;
993
+ const maxOutput = getValueAndMessage(max);
994
+ const minOutput = getValueAndMessage(min);
995
+ if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {
996
+ const valueNumber = ref.valueAsNumber ||
997
+ (inputValue ? +inputValue : inputValue);
998
+ if (!isNullOrUndefined(maxOutput.value)) {
999
+ exceedMax = valueNumber > maxOutput.value;
1000
+ }
1001
+ if (!isNullOrUndefined(minOutput.value)) {
1002
+ exceedMin = valueNumber < minOutput.value;
1003
+ }
1004
+ }
1005
+ else {
1006
+ const valueDate = ref.valueAsDate || new Date(inputValue);
1007
+ const convertTimeToDate = (time) => new Date(new Date().toDateString() + ' ' + time);
1008
+ const isTime = ref.type == 'time';
1009
+ const isWeek = ref.type == 'week';
1010
+ if (isString(maxOutput.value) && inputValue) {
1011
+ exceedMax = isTime
1012
+ ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value)
1013
+ : isWeek
1014
+ ? inputValue > maxOutput.value
1015
+ : valueDate > new Date(maxOutput.value);
1016
+ }
1017
+ if (isString(minOutput.value) && inputValue) {
1018
+ exceedMin = isTime
1019
+ ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value)
1020
+ : isWeek
1021
+ ? inputValue < minOutput.value
1022
+ : valueDate < new Date(minOutput.value);
1023
+ }
1024
+ }
1025
+ if (exceedMax || exceedMin) {
1026
+ getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);
1027
+ if (!validateAllFieldCriteria) {
1028
+ setCustomValidity(error[name].message);
1029
+ return error;
1030
+ }
1031
+ }
1032
+ }
1033
+ if ((maxLength || minLength) &&
1034
+ !isEmpty &&
1035
+ (isString(inputValue) || (isFieldArray && Array.isArray(inputValue)))) {
1036
+ const maxLengthOutput = getValueAndMessage(maxLength);
1037
+ const minLengthOutput = getValueAndMessage(minLength);
1038
+ const exceedMax = !isNullOrUndefined(maxLengthOutput.value) &&
1039
+ inputValue.length > +maxLengthOutput.value;
1040
+ const exceedMin = !isNullOrUndefined(minLengthOutput.value) &&
1041
+ inputValue.length < +minLengthOutput.value;
1042
+ if (exceedMax || exceedMin) {
1043
+ getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);
1044
+ if (!validateAllFieldCriteria) {
1045
+ setCustomValidity(error[name].message);
1046
+ return error;
1047
+ }
1048
+ }
1049
+ }
1050
+ if (pattern && !isEmpty && isString(inputValue)) {
1051
+ const { value: patternValue, message } = getValueAndMessage(pattern);
1052
+ if (isRegex(patternValue) && !inputValue.match(patternValue)) {
1053
+ error[name] = {
1054
+ type: INPUT_VALIDATION_RULES.pattern,
1055
+ message,
1056
+ ref,
1057
+ ...appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message),
1058
+ };
1059
+ if (!validateAllFieldCriteria) {
1060
+ setCustomValidity(message);
1061
+ return error;
1062
+ }
1063
+ }
1064
+ }
1065
+ if (validate) {
1066
+ if (isFunction(validate)) {
1067
+ const result = await validate(inputValue, formValues);
1068
+ const validateError = getValidateError(result, inputRef);
1069
+ if (validateError) {
1070
+ error[name] = {
1071
+ ...validateError,
1072
+ ...appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message),
1073
+ };
1074
+ if (!validateAllFieldCriteria) {
1075
+ setCustomValidity(validateError.message);
1076
+ return error;
1077
+ }
1078
+ }
1079
+ }
1080
+ else if (isObject(validate)) {
1081
+ let validationResult = {};
1082
+ for (const key in validate) {
1083
+ if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {
1084
+ break;
1085
+ }
1086
+ const validateError = getValidateError(await validate[key](inputValue, formValues), inputRef, key);
1087
+ if (validateError) {
1088
+ validationResult = {
1089
+ ...validateError,
1090
+ ...appendErrorsCurry(key, validateError.message),
1091
+ };
1092
+ setCustomValidity(validateError.message);
1093
+ if (validateAllFieldCriteria) {
1094
+ error[name] = validationResult;
1095
+ }
1096
+ }
1097
+ }
1098
+ if (!isEmptyObject(validationResult)) {
1099
+ error[name] = {
1100
+ ref: inputRef,
1101
+ ...validationResult,
1102
+ };
1103
+ if (!validateAllFieldCriteria) {
1104
+ return error;
1105
+ }
1106
+ }
1107
+ }
1108
+ }
1109
+ setCustomValidity(true);
1110
+ return error;
1111
+ };
1112
+
1113
+ const defaultOptions = {
1114
+ mode: VALIDATION_MODE.onSubmit,
1115
+ reValidateMode: VALIDATION_MODE.onChange,
1116
+ shouldFocusError: true,
1117
+ };
1118
+ function createFormControl(props = {}) {
1119
+ let _options = {
1120
+ ...defaultOptions,
1121
+ ...props,
1122
+ };
1123
+ let _formState = {
1124
+ submitCount: 0,
1125
+ isDirty: false,
1126
+ isReady: false,
1127
+ isLoading: isFunction(_options.defaultValues),
1128
+ isValidating: false,
1129
+ isSubmitted: false,
1130
+ isSubmitting: false,
1131
+ isSubmitSuccessful: false,
1132
+ isValid: false,
1133
+ touchedFields: {},
1134
+ dirtyFields: {},
1135
+ validatingFields: {},
1136
+ errors: _options.errors || {},
1137
+ disabled: _options.disabled || false,
1138
+ };
1139
+ let _fields = {};
1140
+ let _defaultValues = isObject(_options.defaultValues) || isObject(_options.values)
1141
+ ? cloneObject(_options.defaultValues || _options.values) || {}
1142
+ : {};
1143
+ let _formValues = _options.shouldUnregister
1144
+ ? {}
1145
+ : cloneObject(_defaultValues);
1146
+ let _state = {
1147
+ action: false,
1148
+ mount: false,
1149
+ watch: false,
1150
+ keepIsValid: false,
1151
+ };
1152
+ let _names = {
1153
+ mount: new Set(),
1154
+ disabled: new Set(),
1155
+ unMount: new Set(),
1156
+ array: new Set(),
1157
+ watch: new Set(),
1158
+ };
1159
+ let delayErrorCallback;
1160
+ let timer = 0;
1161
+ const defaultProxyFormState = {
1162
+ isDirty: false,
1163
+ dirtyFields: false,
1164
+ validatingFields: false,
1165
+ touchedFields: false,
1166
+ isValidating: false,
1167
+ isValid: false,
1168
+ errors: false,
1169
+ };
1170
+ const _proxyFormState = {
1171
+ ...defaultProxyFormState,
1172
+ };
1173
+ let _proxySubscribeFormState = {
1174
+ ..._proxyFormState,
1175
+ };
1176
+ const _subjects = {
1177
+ array: createSubject(),
1178
+ state: createSubject(),
1179
+ };
1180
+ const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
1181
+ const debounce = (callback) => (wait) => {
1182
+ clearTimeout(timer);
1183
+ timer = setTimeout(callback, wait);
1184
+ };
1185
+ const _setValid = async (shouldUpdateValid) => {
1186
+ if (_state.keepIsValid) {
1187
+ return;
1188
+ }
1189
+ if (!_options.disabled &&
1190
+ (_proxyFormState.isValid ||
1191
+ _proxySubscribeFormState.isValid ||
1192
+ shouldUpdateValid)) {
1193
+ let isValid;
1194
+ if (_options.resolver) {
1195
+ isValid = isEmptyObject((await _runSchema()).errors);
1196
+ _updateIsValidating();
1197
+ }
1198
+ else {
1199
+ isValid = await executeBuiltInValidation(_fields, true);
1200
+ }
1201
+ if (isValid !== _formState.isValid) {
1202
+ _subjects.state.next({
1203
+ isValid,
1204
+ });
1205
+ }
1206
+ }
1207
+ };
1208
+ const _updateIsValidating = (names, isValidating) => {
1209
+ if (!_options.disabled &&
1210
+ (_proxyFormState.isValidating ||
1211
+ _proxyFormState.validatingFields ||
1212
+ _proxySubscribeFormState.isValidating ||
1213
+ _proxySubscribeFormState.validatingFields)) {
1214
+ (names || Array.from(_names.mount)).forEach((name) => {
1215
+ if (name) {
1216
+ isValidating
1217
+ ? set(_formState.validatingFields, name, isValidating)
1218
+ : unset(_formState.validatingFields, name);
1219
+ }
1220
+ });
1221
+ _subjects.state.next({
1222
+ validatingFields: _formState.validatingFields,
1223
+ isValidating: !isEmptyObject(_formState.validatingFields),
1224
+ });
1225
+ }
1226
+ };
1227
+ const _setFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
1228
+ if (args && method && !_options.disabled) {
1229
+ _state.action = true;
1230
+ if (shouldUpdateFieldsAndState && Array.isArray(get(_fields, name))) {
1231
+ const fieldValues = method(get(_fields, name), args.argA, args.argB);
1232
+ shouldSetValues && set(_fields, name, fieldValues);
1233
+ }
1234
+ if (shouldUpdateFieldsAndState &&
1235
+ Array.isArray(get(_formState.errors, name))) {
1236
+ const errors = method(get(_formState.errors, name), args.argA, args.argB);
1237
+ shouldSetValues && set(_formState.errors, name, errors);
1238
+ unsetEmptyArray(_formState.errors, name);
1239
+ }
1240
+ if ((_proxyFormState.touchedFields ||
1241
+ _proxySubscribeFormState.touchedFields) &&
1242
+ shouldUpdateFieldsAndState &&
1243
+ Array.isArray(get(_formState.touchedFields, name))) {
1244
+ const touchedFields = method(get(_formState.touchedFields, name), args.argA, args.argB);
1245
+ shouldSetValues && set(_formState.touchedFields, name, touchedFields);
1246
+ }
1247
+ if (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) {
1248
+ _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);
1249
+ }
1250
+ _subjects.state.next({
1251
+ name,
1252
+ isDirty: _getDirty(name, values),
1253
+ dirtyFields: _formState.dirtyFields,
1254
+ errors: _formState.errors,
1255
+ isValid: _formState.isValid,
1256
+ });
1257
+ }
1258
+ else {
1259
+ set(_formValues, name, values);
1260
+ }
1261
+ };
1262
+ const updateErrors = (name, error) => {
1263
+ set(_formState.errors, name, error);
1264
+ _subjects.state.next({
1265
+ errors: _formState.errors,
1266
+ });
1267
+ };
1268
+ const _setErrors = (errors) => {
1269
+ _formState.errors = errors;
1270
+ _subjects.state.next({
1271
+ errors: _formState.errors,
1272
+ isValid: false,
1273
+ });
1274
+ };
1275
+ const updateValidAndValue = (name, shouldSkipSetValueAs, value, ref) => {
1276
+ const field = get(_fields, name);
1277
+ if (field) {
1278
+ const defaultValue = get(_formValues, name, isUndefined(value) ? get(_defaultValues, name) : value);
1279
+ isUndefined(defaultValue) ||
1280
+ (ref && ref.defaultChecked) ||
1281
+ shouldSkipSetValueAs
1282
+ ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f))
1283
+ : setFieldValue(name, defaultValue);
1284
+ _state.mount && !_state.action && _setValid();
1285
+ }
1286
+ };
1287
+ const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {
1288
+ let shouldUpdateField = false;
1289
+ let isPreviousDirty = false;
1290
+ const output = {
1291
+ name,
1292
+ };
1293
+ if (!_options.disabled) {
1294
+ if (!isBlurEvent || shouldDirty) {
1295
+ if (_proxyFormState.isDirty || _proxySubscribeFormState.isDirty) {
1296
+ isPreviousDirty = _formState.isDirty;
1297
+ _formState.isDirty = output.isDirty = _getDirty();
1298
+ shouldUpdateField = isPreviousDirty !== output.isDirty;
1299
+ }
1300
+ const isCurrentFieldPristine = deepEqual(get(_defaultValues, name), fieldValue);
1301
+ isPreviousDirty = !!get(_formState.dirtyFields, name);
1302
+ isCurrentFieldPristine
1303
+ ? unset(_formState.dirtyFields, name)
1304
+ : set(_formState.dirtyFields, name, true);
1305
+ output.dirtyFields = _formState.dirtyFields;
1306
+ shouldUpdateField =
1307
+ shouldUpdateField ||
1308
+ ((_proxyFormState.dirtyFields ||
1309
+ _proxySubscribeFormState.dirtyFields) &&
1310
+ isPreviousDirty !== !isCurrentFieldPristine);
1311
+ }
1312
+ if (isBlurEvent) {
1313
+ const isPreviousFieldTouched = get(_formState.touchedFields, name);
1314
+ if (!isPreviousFieldTouched) {
1315
+ set(_formState.touchedFields, name, isBlurEvent);
1316
+ output.touchedFields = _formState.touchedFields;
1317
+ shouldUpdateField =
1318
+ shouldUpdateField ||
1319
+ ((_proxyFormState.touchedFields ||
1320
+ _proxySubscribeFormState.touchedFields) &&
1321
+ isPreviousFieldTouched !== isBlurEvent);
1322
+ }
1323
+ }
1324
+ shouldUpdateField && shouldRender && _subjects.state.next(output);
1325
+ }
1326
+ return shouldUpdateField ? output : {};
1327
+ };
1328
+ const shouldRenderByError = (name, isValid, error, fieldState) => {
1329
+ const previousFieldError = get(_formState.errors, name);
1330
+ const shouldUpdateValid = (_proxyFormState.isValid || _proxySubscribeFormState.isValid) &&
1331
+ isBoolean(isValid) &&
1332
+ _formState.isValid !== isValid;
1333
+ if (_options.delayError && error) {
1334
+ delayErrorCallback = debounce(() => updateErrors(name, error));
1335
+ delayErrorCallback(_options.delayError);
1336
+ }
1337
+ else {
1338
+ clearTimeout(timer);
1339
+ delayErrorCallback = null;
1340
+ error
1341
+ ? set(_formState.errors, name, error)
1342
+ : unset(_formState.errors, name);
1343
+ }
1344
+ if ((error ? !deepEqual(previousFieldError, error) : previousFieldError) ||
1345
+ !isEmptyObject(fieldState) ||
1346
+ shouldUpdateValid) {
1347
+ const updatedFormState = {
1348
+ ...fieldState,
1349
+ ...(shouldUpdateValid && isBoolean(isValid) ? { isValid } : {}),
1350
+ errors: _formState.errors,
1351
+ name,
1352
+ };
1353
+ _formState = {
1354
+ ..._formState,
1355
+ ...updatedFormState,
1356
+ };
1357
+ _subjects.state.next(updatedFormState);
1358
+ }
1359
+ };
1360
+ const _runSchema = async (name) => {
1361
+ _updateIsValidating(name, true);
1362
+ const result = await _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
1363
+ return result;
1364
+ };
1365
+ const executeSchemaAndUpdateState = async (names) => {
1366
+ const { errors } = await _runSchema(names);
1367
+ _updateIsValidating(names);
1368
+ if (names) {
1369
+ for (const name of names) {
1370
+ const error = get(errors, name);
1371
+ error
1372
+ ? set(_formState.errors, name, error)
1373
+ : unset(_formState.errors, name);
1374
+ }
1375
+ }
1376
+ else {
1377
+ _formState.errors = errors;
1378
+ }
1379
+ return errors;
1380
+ };
1381
+ const executeBuiltInValidation = async (fields, shouldOnlyCheckValid, context = {
1382
+ valid: true,
1383
+ }) => {
1384
+ for (const name in fields) {
1385
+ const field = fields[name];
1386
+ if (field) {
1387
+ const { _f, ...fieldValue } = field;
1388
+ if (_f) {
1389
+ const isFieldArrayRoot = _names.array.has(_f.name);
1390
+ const isPromiseFunction = field._f && hasPromiseValidation(field._f);
1391
+ if (isPromiseFunction && _proxyFormState.validatingFields) {
1392
+ _updateIsValidating([_f.name], true);
1393
+ }
1394
+ const fieldError = await validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation && !shouldOnlyCheckValid, isFieldArrayRoot);
1395
+ if (isPromiseFunction && _proxyFormState.validatingFields) {
1396
+ _updateIsValidating([_f.name]);
1397
+ }
1398
+ if (fieldError[_f.name]) {
1399
+ context.valid = false;
1400
+ if (shouldOnlyCheckValid || props.shouldUseNativeValidation) {
1401
+ break;
1402
+ }
1403
+ }
1404
+ !shouldOnlyCheckValid &&
1405
+ (get(fieldError, _f.name)
1406
+ ? isFieldArrayRoot
1407
+ ? updateFieldArrayRootError(_formState.errors, fieldError, _f.name)
1408
+ : set(_formState.errors, _f.name, fieldError[_f.name])
1409
+ : unset(_formState.errors, _f.name));
1410
+ }
1411
+ !isEmptyObject(fieldValue) &&
1412
+ (await executeBuiltInValidation(fieldValue, shouldOnlyCheckValid, context));
1413
+ }
1414
+ }
1415
+ return context.valid;
1416
+ };
1417
+ const _removeUnmounted = () => {
1418
+ for (const name of _names.unMount) {
1419
+ const field = get(_fields, name);
1420
+ field &&
1421
+ (field._f.refs
1422
+ ? field._f.refs.every((ref) => !live(ref))
1423
+ : !live(field._f.ref)) &&
1424
+ unregister(name);
1425
+ }
1426
+ _names.unMount = new Set();
1427
+ };
1428
+ const _getDirty = (name, data) => !_options.disabled &&
1429
+ (name && data && set(_formValues, name, data),
1430
+ !deepEqual(getValues(), _defaultValues));
1431
+ const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {
1432
+ ...(_state.mount
1433
+ ? _formValues
1434
+ : isUndefined(defaultValue)
1435
+ ? _defaultValues
1436
+ : isString(names)
1437
+ ? { [names]: defaultValue }
1438
+ : defaultValue),
1439
+ }, isGlobal, defaultValue);
1440
+ const _getFieldArray = (name) => compact(get(_state.mount ? _formValues : _defaultValues, name, _options.shouldUnregister ? get(_defaultValues, name, []) : []));
1441
+ const setFieldValue = (name, value, options = {}) => {
1442
+ const field = get(_fields, name);
1443
+ let fieldValue = value;
1444
+ if (field) {
1445
+ const fieldReference = field._f;
1446
+ if (fieldReference) {
1447
+ !fieldReference.disabled &&
1448
+ set(_formValues, name, getFieldValueAs(value, fieldReference));
1449
+ fieldValue =
1450
+ isHTMLElement(fieldReference.ref) && isNullOrUndefined(value)
1451
+ ? ''
1452
+ : value;
1453
+ if (isMultipleSelect(fieldReference.ref)) {
1454
+ [...fieldReference.ref.options].forEach((optionRef) => (optionRef.selected = fieldValue.includes(optionRef.value)));
1455
+ }
1456
+ else if (fieldReference.refs) {
1457
+ if (isCheckBoxInput(fieldReference.ref)) {
1458
+ fieldReference.refs.forEach((checkboxRef) => {
1459
+ if (!checkboxRef.defaultChecked || !checkboxRef.disabled) {
1460
+ if (Array.isArray(fieldValue)) {
1461
+ checkboxRef.checked = !!fieldValue.find((data) => data === checkboxRef.value);
1462
+ }
1463
+ else {
1464
+ checkboxRef.checked =
1465
+ fieldValue === checkboxRef.value || !!fieldValue;
1466
+ }
1467
+ }
1468
+ });
1469
+ }
1470
+ else {
1471
+ fieldReference.refs.forEach((radioRef) => (radioRef.checked = radioRef.value === fieldValue));
1472
+ }
1473
+ }
1474
+ else if (isFileInput(fieldReference.ref)) {
1475
+ fieldReference.ref.value = '';
1476
+ }
1477
+ else {
1478
+ fieldReference.ref.value = fieldValue;
1479
+ if (!fieldReference.ref.type) {
1480
+ _subjects.state.next({
1481
+ name,
1482
+ values: cloneObject(_formValues),
1483
+ });
1484
+ }
1485
+ }
1486
+ }
1487
+ }
1488
+ (options.shouldDirty || options.shouldTouch) &&
1489
+ updateTouchAndDirty(name, fieldValue, options.shouldTouch, options.shouldDirty, true);
1490
+ options.shouldValidate && trigger(name);
1491
+ };
1492
+ const setValues = (name, value, options) => {
1493
+ for (const fieldKey in value) {
1494
+ if (!value.hasOwnProperty(fieldKey)) {
1495
+ return;
1496
+ }
1497
+ const fieldValue = value[fieldKey];
1498
+ const fieldName = name + '.' + fieldKey;
1499
+ const field = get(_fields, fieldName);
1500
+ (_names.array.has(name) ||
1501
+ isObject(fieldValue) ||
1502
+ (field && !field._f)) &&
1503
+ !isDateObject(fieldValue)
1504
+ ? setValues(fieldName, fieldValue, options)
1505
+ : setFieldValue(fieldName, fieldValue, options);
1506
+ }
1507
+ };
1508
+ const setValue = (name, value, options = {}) => {
1509
+ const field = get(_fields, name);
1510
+ const isFieldArray = _names.array.has(name);
1511
+ const cloneValue = cloneObject(value);
1512
+ set(_formValues, name, cloneValue);
1513
+ if (isFieldArray) {
1514
+ _subjects.array.next({
1515
+ name,
1516
+ values: cloneObject(_formValues),
1517
+ });
1518
+ if ((_proxyFormState.isDirty ||
1519
+ _proxyFormState.dirtyFields ||
1520
+ _proxySubscribeFormState.isDirty ||
1521
+ _proxySubscribeFormState.dirtyFields) &&
1522
+ options.shouldDirty) {
1523
+ _subjects.state.next({
1524
+ name,
1525
+ dirtyFields: getDirtyFields(_defaultValues, _formValues),
1526
+ isDirty: _getDirty(name, cloneValue),
1527
+ });
1528
+ }
1529
+ }
1530
+ else {
1531
+ field && !field._f && !isNullOrUndefined(cloneValue)
1532
+ ? setValues(name, cloneValue, options)
1533
+ : setFieldValue(name, cloneValue, options);
1534
+ }
1535
+ if (isWatched(name, _names)) {
1536
+ _subjects.state.next({
1537
+ ..._formState,
1538
+ name,
1539
+ values: cloneObject(_formValues),
1540
+ });
1541
+ }
1542
+ else {
1543
+ _subjects.state.next({
1544
+ name: _state.mount ? name : undefined,
1545
+ values: cloneObject(_formValues),
1546
+ });
1547
+ }
1548
+ };
1549
+ const onChange = async (event) => {
1550
+ _state.mount = true;
1551
+ const target = event.target;
1552
+ let name = target.name;
1553
+ let isFieldValueUpdated = true;
1554
+ const field = get(_fields, name);
1555
+ const _updateIsFieldValueUpdated = (fieldValue) => {
1556
+ isFieldValueUpdated =
1557
+ Number.isNaN(fieldValue) ||
1558
+ (isDateObject(fieldValue) && isNaN(fieldValue.getTime())) ||
1559
+ deepEqual(fieldValue, get(_formValues, name, fieldValue));
1560
+ };
1561
+ const validationModeBeforeSubmit = getValidationModes(_options.mode);
1562
+ const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
1563
+ if (field) {
1564
+ let error;
1565
+ let isValid;
1566
+ const fieldValue = target.type
1567
+ ? getFieldValue(field._f)
1568
+ : getEventValue(event);
1569
+ const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;
1570
+ const shouldSkipValidation = (!hasValidation(field._f) &&
1571
+ !_options.resolver &&
1572
+ !get(_formState.errors, name) &&
1573
+ !field._f.deps) ||
1574
+ skipValidation(isBlurEvent, get(_formState.touchedFields, name), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit);
1575
+ const watched = isWatched(name, _names, isBlurEvent);
1576
+ set(_formValues, name, fieldValue);
1577
+ if (isBlurEvent) {
1578
+ if (!target || !target.readOnly) {
1579
+ field._f.onBlur && field._f.onBlur(event);
1580
+ delayErrorCallback && delayErrorCallback(0);
1581
+ }
1582
+ }
1583
+ else if (field._f.onChange) {
1584
+ field._f.onChange(event);
1585
+ }
1586
+ const fieldState = updateTouchAndDirty(name, fieldValue, isBlurEvent);
1587
+ const shouldRender = !isEmptyObject(fieldState) || watched;
1588
+ !isBlurEvent &&
1589
+ _subjects.state.next({
1590
+ name,
1591
+ type: event.type,
1592
+ values: cloneObject(_formValues),
1593
+ });
1594
+ if (shouldSkipValidation) {
1595
+ if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
1596
+ if (_options.mode === 'onBlur') {
1597
+ if (isBlurEvent) {
1598
+ _setValid();
1599
+ }
1600
+ }
1601
+ else if (!isBlurEvent) {
1602
+ _setValid();
1603
+ }
1604
+ }
1605
+ return (shouldRender &&
1606
+ _subjects.state.next({ name, ...(watched ? {} : fieldState) }));
1607
+ }
1608
+ !isBlurEvent && watched && _subjects.state.next({ ..._formState });
1609
+ if (_options.resolver) {
1610
+ const { errors } = await _runSchema([name]);
1611
+ _updateIsValidating([name]);
1612
+ _updateIsFieldValueUpdated(fieldValue);
1613
+ if (isFieldValueUpdated) {
1614
+ const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
1615
+ const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name);
1616
+ error = errorLookupResult.error;
1617
+ name = errorLookupResult.name;
1618
+ isValid = isEmptyObject(errors);
1619
+ }
1620
+ }
1621
+ else {
1622
+ _updateIsValidating([name], true);
1623
+ error = (await validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name];
1624
+ _updateIsValidating([name]);
1625
+ _updateIsFieldValueUpdated(fieldValue);
1626
+ if (isFieldValueUpdated) {
1627
+ if (error) {
1628
+ isValid = false;
1629
+ }
1630
+ else if (_proxyFormState.isValid ||
1631
+ _proxySubscribeFormState.isValid) {
1632
+ isValid = await executeBuiltInValidation(_fields, true);
1633
+ }
1634
+ }
1635
+ }
1636
+ if (isFieldValueUpdated) {
1637
+ field._f.deps &&
1638
+ (!Array.isArray(field._f.deps) || field._f.deps.length > 0) &&
1639
+ trigger(field._f.deps);
1640
+ shouldRenderByError(name, isValid, error, fieldState);
1641
+ }
1642
+ }
1643
+ };
1644
+ const _focusInput = (ref, key) => {
1645
+ if (get(_formState.errors, key) && ref.focus) {
1646
+ ref.focus();
1647
+ return 1;
1648
+ }
1649
+ return;
1650
+ };
1651
+ const trigger = async (name, options = {}) => {
1652
+ let isValid;
1653
+ let validationResult;
1654
+ const fieldNames = convertToArrayPayload(name);
1655
+ if (_options.resolver) {
1656
+ const errors = await executeSchemaAndUpdateState(isUndefined(name) ? name : fieldNames);
1657
+ isValid = isEmptyObject(errors);
1658
+ validationResult = name
1659
+ ? !fieldNames.some((name) => get(errors, name))
1660
+ : isValid;
1661
+ }
1662
+ else if (name) {
1663
+ validationResult = (await Promise.all(fieldNames.map(async (fieldName) => {
1664
+ const field = get(_fields, fieldName);
1665
+ return await executeBuiltInValidation(field && field._f ? { [fieldName]: field } : field);
1666
+ }))).every(Boolean);
1667
+ !(!validationResult && !_formState.isValid) && _setValid();
1668
+ }
1669
+ else {
1670
+ validationResult = isValid = await executeBuiltInValidation(_fields);
1671
+ }
1672
+ _subjects.state.next({
1673
+ ...(!isString(name) ||
1674
+ ((_proxyFormState.isValid || _proxySubscribeFormState.isValid) &&
1675
+ isValid !== _formState.isValid)
1676
+ ? {}
1677
+ : { name }),
1678
+ ...(_options.resolver || !name ? { isValid } : {}),
1679
+ errors: _formState.errors,
1680
+ });
1681
+ options.shouldFocus &&
1682
+ !validationResult &&
1683
+ iterateFieldsByAction(_fields, _focusInput, name ? fieldNames : _names.mount);
1684
+ return validationResult;
1685
+ };
1686
+ const getValues = (fieldNames, config) => {
1687
+ let values = {
1688
+ ...(_state.mount ? _formValues : _defaultValues),
1689
+ };
1690
+ if (config) {
1691
+ values = extractFormValues(config.dirtyFields ? _formState.dirtyFields : _formState.touchedFields, values);
1692
+ }
1693
+ return isUndefined(fieldNames)
1694
+ ? values
1695
+ : isString(fieldNames)
1696
+ ? get(values, fieldNames)
1697
+ : fieldNames.map((name) => get(values, name));
1698
+ };
1699
+ const getFieldState = (name, formState) => ({
1700
+ invalid: !!get((formState || _formState).errors, name),
1701
+ isDirty: !!get((formState || _formState).dirtyFields, name),
1702
+ error: get((formState || _formState).errors, name),
1703
+ isValidating: !!get(_formState.validatingFields, name),
1704
+ isTouched: !!get((formState || _formState).touchedFields, name),
1705
+ });
1706
+ const clearErrors = (name) => {
1707
+ name &&
1708
+ convertToArrayPayload(name).forEach((inputName) => unset(_formState.errors, inputName));
1709
+ _subjects.state.next({
1710
+ errors: name ? _formState.errors : {},
1711
+ });
1712
+ };
1713
+ const setError = (name, error, options) => {
1714
+ const ref = (get(_fields, name, { _f: {} })._f || {}).ref;
1715
+ const currentError = get(_formState.errors, name) || {};
1716
+ // Don't override existing error messages elsewhere in the object tree.
1717
+ const { ref: currentRef, message, type, ...restOfErrorTree } = currentError;
1718
+ set(_formState.errors, name, {
1719
+ ...restOfErrorTree,
1720
+ ...error,
1721
+ ref,
1722
+ });
1723
+ _subjects.state.next({
1724
+ name,
1725
+ errors: _formState.errors,
1726
+ isValid: false,
1727
+ });
1728
+ options && options.shouldFocus && ref && ref.focus && ref.focus();
1729
+ };
1730
+ const watch = (name, defaultValue) => isFunction(name)
1731
+ ? _subjects.state.subscribe({
1732
+ next: (payload) => 'values' in payload &&
1733
+ name(_getWatch(undefined, defaultValue), payload),
1734
+ })
1735
+ : _getWatch(name, defaultValue, true);
1736
+ const _subscribe = (props) => _subjects.state.subscribe({
1737
+ next: (formState) => {
1738
+ if (shouldSubscribeByName(props.name, formState.name, props.exact) &&
1739
+ shouldRenderFormState(formState, props.formState || _proxyFormState, _setFormState, props.reRenderRoot)) {
1740
+ props.callback({
1741
+ values: { ..._formValues },
1742
+ ..._formState,
1743
+ ...formState,
1744
+ defaultValues: _defaultValues,
1745
+ });
1746
+ }
1747
+ },
1748
+ }).unsubscribe;
1749
+ const subscribe = (props) => {
1750
+ _state.mount = true;
1751
+ _proxySubscribeFormState = {
1752
+ ..._proxySubscribeFormState,
1753
+ ...props.formState,
1754
+ };
1755
+ return _subscribe({
1756
+ ...props,
1757
+ formState: {
1758
+ ...defaultProxyFormState,
1759
+ ...props.formState,
1760
+ },
1761
+ });
1762
+ };
1763
+ const unregister = (name, options = {}) => {
1764
+ for (const fieldName of name ? convertToArrayPayload(name) : _names.mount) {
1765
+ _names.mount.delete(fieldName);
1766
+ _names.array.delete(fieldName);
1767
+ if (!options.keepValue) {
1768
+ unset(_fields, fieldName);
1769
+ unset(_formValues, fieldName);
1770
+ }
1771
+ !options.keepError && unset(_formState.errors, fieldName);
1772
+ !options.keepDirty && unset(_formState.dirtyFields, fieldName);
1773
+ !options.keepTouched && unset(_formState.touchedFields, fieldName);
1774
+ !options.keepIsValidating &&
1775
+ unset(_formState.validatingFields, fieldName);
1776
+ !_options.shouldUnregister &&
1777
+ !options.keepDefaultValue &&
1778
+ unset(_defaultValues, fieldName);
1779
+ }
1780
+ _subjects.state.next({
1781
+ values: cloneObject(_formValues),
1782
+ });
1783
+ _subjects.state.next({
1784
+ ..._formState,
1785
+ ...(!options.keepDirty ? {} : { isDirty: _getDirty() }),
1786
+ });
1787
+ !options.keepIsValid && _setValid();
1788
+ };
1789
+ const _setDisabledField = ({ disabled, name, }) => {
1790
+ if ((isBoolean(disabled) && _state.mount) ||
1791
+ !!disabled ||
1792
+ _names.disabled.has(name)) {
1793
+ const wasDisabled = _names.disabled.has(name);
1794
+ const isDisabled = !!disabled;
1795
+ const disabledStateChanged = wasDisabled !== isDisabled;
1796
+ disabled ? _names.disabled.add(name) : _names.disabled.delete(name);
1797
+ disabledStateChanged && _state.mount && !_state.action && _setValid();
1798
+ }
1799
+ };
1800
+ const register = (name, options = {}) => {
1801
+ let field = get(_fields, name);
1802
+ const disabledIsDefined = isBoolean(options.disabled) || isBoolean(_options.disabled);
1803
+ set(_fields, name, {
1804
+ ...(field || {}),
1805
+ _f: {
1806
+ ...(field && field._f ? field._f : { ref: { name } }),
1807
+ name,
1808
+ mount: true,
1809
+ ...options,
1810
+ },
1811
+ });
1812
+ _names.mount.add(name);
1813
+ if (field) {
1814
+ _setDisabledField({
1815
+ disabled: isBoolean(options.disabled)
1816
+ ? options.disabled
1817
+ : _options.disabled,
1818
+ name,
1819
+ });
1820
+ }
1821
+ else {
1822
+ updateValidAndValue(name, true, options.value);
1823
+ }
1824
+ return {
1825
+ ...(disabledIsDefined
1826
+ ? { disabled: options.disabled || _options.disabled }
1827
+ : {}),
1828
+ ...(_options.progressive
1829
+ ? {
1830
+ required: !!options.required,
1831
+ min: getRuleValue(options.min),
1832
+ max: getRuleValue(options.max),
1833
+ minLength: getRuleValue(options.minLength),
1834
+ maxLength: getRuleValue(options.maxLength),
1835
+ pattern: getRuleValue(options.pattern),
1836
+ }
1837
+ : {}),
1838
+ name,
1839
+ onChange,
1840
+ onBlur: onChange,
1841
+ ref: (ref) => {
1842
+ if (ref) {
1843
+ register(name, options);
1844
+ field = get(_fields, name);
1845
+ const fieldRef = isUndefined(ref.value)
1846
+ ? ref.querySelectorAll
1847
+ ? ref.querySelectorAll('input,select,textarea')[0] || ref
1848
+ : ref
1849
+ : ref;
1850
+ const radioOrCheckbox = isRadioOrCheckbox(fieldRef);
1851
+ const refs = field._f.refs || [];
1852
+ if (radioOrCheckbox
1853
+ ? refs.find((option) => option === fieldRef)
1854
+ : fieldRef === field._f.ref) {
1855
+ return;
1856
+ }
1857
+ set(_fields, name, {
1858
+ _f: {
1859
+ ...field._f,
1860
+ ...(radioOrCheckbox
1861
+ ? {
1862
+ refs: [
1863
+ ...refs.filter(live),
1864
+ fieldRef,
1865
+ ...(Array.isArray(get(_defaultValues, name)) ? [{}] : []),
1866
+ ],
1867
+ ref: { type: fieldRef.type, name },
1868
+ }
1869
+ : { ref: fieldRef }),
1870
+ },
1871
+ });
1872
+ updateValidAndValue(name, false, undefined, fieldRef);
1873
+ }
1874
+ else {
1875
+ field = get(_fields, name, {});
1876
+ if (field._f) {
1877
+ field._f.mount = false;
1878
+ }
1879
+ (_options.shouldUnregister || options.shouldUnregister) &&
1880
+ !(isNameInFieldArray(_names.array, name) && _state.action) &&
1881
+ _names.unMount.add(name);
1882
+ }
1883
+ },
1884
+ };
1885
+ };
1886
+ const _focusError = () => _options.shouldFocusError &&
1887
+ iterateFieldsByAction(_fields, _focusInput, _names.mount);
1888
+ const _disableForm = (disabled) => {
1889
+ if (isBoolean(disabled)) {
1890
+ _subjects.state.next({ disabled });
1891
+ iterateFieldsByAction(_fields, (ref, name) => {
1892
+ const currentField = get(_fields, name);
1893
+ if (currentField) {
1894
+ ref.disabled = currentField._f.disabled || disabled;
1895
+ if (Array.isArray(currentField._f.refs)) {
1896
+ currentField._f.refs.forEach((inputRef) => {
1897
+ inputRef.disabled = currentField._f.disabled || disabled;
1898
+ });
1899
+ }
1900
+ }
1901
+ }, 0, false);
1902
+ }
1903
+ };
1904
+ const handleSubmit = (onValid, onInvalid) => async (e) => {
1905
+ let onValidError = undefined;
1906
+ if (e) {
1907
+ e.preventDefault && e.preventDefault();
1908
+ e.persist &&
1909
+ e.persist();
1910
+ }
1911
+ let fieldValues = cloneObject(_formValues);
1912
+ _subjects.state.next({
1913
+ isSubmitting: true,
1914
+ });
1915
+ if (_options.resolver) {
1916
+ const { errors, values } = await _runSchema();
1917
+ _updateIsValidating();
1918
+ _formState.errors = errors;
1919
+ fieldValues = cloneObject(values);
1920
+ }
1921
+ else {
1922
+ await executeBuiltInValidation(_fields);
1923
+ }
1924
+ if (_names.disabled.size) {
1925
+ for (const name of _names.disabled) {
1926
+ unset(fieldValues, name);
1927
+ }
1928
+ }
1929
+ unset(_formState.errors, 'root');
1930
+ if (isEmptyObject(_formState.errors)) {
1931
+ _subjects.state.next({
1932
+ errors: {},
1933
+ });
1934
+ try {
1935
+ await onValid(fieldValues, e);
1936
+ }
1937
+ catch (error) {
1938
+ onValidError = error;
1939
+ }
1940
+ }
1941
+ else {
1942
+ if (onInvalid) {
1943
+ await onInvalid({ ..._formState.errors }, e);
1944
+ }
1945
+ _focusError();
1946
+ setTimeout(_focusError);
1947
+ }
1948
+ _subjects.state.next({
1949
+ isSubmitted: true,
1950
+ isSubmitting: false,
1951
+ isSubmitSuccessful: isEmptyObject(_formState.errors) && !onValidError,
1952
+ submitCount: _formState.submitCount + 1,
1953
+ errors: _formState.errors,
1954
+ });
1955
+ if (onValidError) {
1956
+ throw onValidError;
1957
+ }
1958
+ };
1959
+ const resetField = (name, options = {}) => {
1960
+ if (get(_fields, name)) {
1961
+ if (isUndefined(options.defaultValue)) {
1962
+ setValue(name, cloneObject(get(_defaultValues, name)));
1963
+ }
1964
+ else {
1965
+ setValue(name, options.defaultValue);
1966
+ set(_defaultValues, name, cloneObject(options.defaultValue));
1967
+ }
1968
+ if (!options.keepTouched) {
1969
+ unset(_formState.touchedFields, name);
1970
+ }
1971
+ if (!options.keepDirty) {
1972
+ unset(_formState.dirtyFields, name);
1973
+ _formState.isDirty = options.defaultValue
1974
+ ? _getDirty(name, cloneObject(get(_defaultValues, name)))
1975
+ : _getDirty();
1976
+ }
1977
+ if (!options.keepError) {
1978
+ unset(_formState.errors, name);
1979
+ _proxyFormState.isValid && _setValid();
1980
+ }
1981
+ _subjects.state.next({ ..._formState });
1982
+ }
1983
+ };
1984
+ const _reset = (formValues, keepStateOptions = {}) => {
1985
+ const updatedValues = formValues ? cloneObject(formValues) : _defaultValues;
1986
+ const cloneUpdatedValues = cloneObject(updatedValues);
1987
+ const isEmptyResetValues = isEmptyObject(formValues);
1988
+ const values = isEmptyResetValues ? _defaultValues : cloneUpdatedValues;
1989
+ if (!keepStateOptions.keepDefaultValues) {
1990
+ _defaultValues = updatedValues;
1991
+ }
1992
+ if (!keepStateOptions.keepValues) {
1993
+ if (keepStateOptions.keepDirtyValues) {
1994
+ const fieldsToCheck = new Set([
1995
+ ..._names.mount,
1996
+ ...Object.keys(getDirtyFields(_defaultValues, _formValues)),
1997
+ ]);
1998
+ for (const fieldName of Array.from(fieldsToCheck)) {
1999
+ const isDirty = get(_formState.dirtyFields, fieldName);
2000
+ const existingValue = get(_formValues, fieldName);
2001
+ const newValue = get(values, fieldName);
2002
+ if (isDirty && !isUndefined(existingValue)) {
2003
+ set(values, fieldName, existingValue);
2004
+ }
2005
+ else if (!isDirty && !isUndefined(newValue)) {
2006
+ setValue(fieldName, newValue);
2007
+ }
2008
+ }
2009
+ }
2010
+ else {
2011
+ if (isWeb && isUndefined(formValues)) {
2012
+ for (const name of _names.mount) {
2013
+ const field = get(_fields, name);
2014
+ if (field && field._f) {
2015
+ const fieldReference = Array.isArray(field._f.refs)
2016
+ ? field._f.refs[0]
2017
+ : field._f.ref;
2018
+ if (isHTMLElement(fieldReference)) {
2019
+ const form = fieldReference.closest('form');
2020
+ if (form) {
2021
+ form.reset();
2022
+ break;
2023
+ }
2024
+ }
2025
+ }
2026
+ }
2027
+ }
2028
+ if (keepStateOptions.keepFieldsRef) {
2029
+ for (const fieldName of _names.mount) {
2030
+ setValue(fieldName, get(values, fieldName));
2031
+ }
2032
+ }
2033
+ else {
2034
+ _fields = {};
2035
+ }
2036
+ }
2037
+ _formValues = _options.shouldUnregister
2038
+ ? keepStateOptions.keepDefaultValues
2039
+ ? cloneObject(_defaultValues)
2040
+ : {}
2041
+ : cloneObject(values);
2042
+ _subjects.array.next({
2043
+ values: { ...values },
2044
+ });
2045
+ _subjects.state.next({
2046
+ values: { ...values },
2047
+ });
2048
+ }
2049
+ _names = {
2050
+ mount: keepStateOptions.keepDirtyValues ? _names.mount : new Set(),
2051
+ unMount: new Set(),
2052
+ array: new Set(),
2053
+ disabled: new Set(),
2054
+ watch: new Set(),
2055
+ watchAll: false,
2056
+ focus: '',
2057
+ };
2058
+ _state.mount =
2059
+ !_proxyFormState.isValid ||
2060
+ !!keepStateOptions.keepIsValid ||
2061
+ !!keepStateOptions.keepDirtyValues ||
2062
+ (!_options.shouldUnregister && !isEmptyObject(values));
2063
+ _state.watch = !!_options.shouldUnregister;
2064
+ _state.keepIsValid = !!keepStateOptions.keepIsValid;
2065
+ _state.action = false;
2066
+ // Clear errors synchronously to prevent validation errors on subsequent submissions
2067
+ // This fixes the issue where form.reset() causes validation errors on subsequent
2068
+ // submissions in Next.js 16 with Server Actions
2069
+ if (!keepStateOptions.keepErrors) {
2070
+ _formState.errors = {};
2071
+ }
2072
+ _subjects.state.next({
2073
+ submitCount: keepStateOptions.keepSubmitCount
2074
+ ? _formState.submitCount
2075
+ : 0,
2076
+ isDirty: isEmptyResetValues
2077
+ ? false
2078
+ : keepStateOptions.keepDirty
2079
+ ? _formState.isDirty
2080
+ : !!(keepStateOptions.keepDefaultValues &&
2081
+ !deepEqual(formValues, _defaultValues)),
2082
+ isSubmitted: keepStateOptions.keepIsSubmitted
2083
+ ? _formState.isSubmitted
2084
+ : false,
2085
+ dirtyFields: isEmptyResetValues
2086
+ ? {}
2087
+ : keepStateOptions.keepDirtyValues
2088
+ ? keepStateOptions.keepDefaultValues && _formValues
2089
+ ? getDirtyFields(_defaultValues, _formValues)
2090
+ : _formState.dirtyFields
2091
+ : keepStateOptions.keepDefaultValues && formValues
2092
+ ? getDirtyFields(_defaultValues, formValues)
2093
+ : keepStateOptions.keepDirty
2094
+ ? _formState.dirtyFields
2095
+ : {},
2096
+ touchedFields: keepStateOptions.keepTouched
2097
+ ? _formState.touchedFields
2098
+ : {},
2099
+ errors: keepStateOptions.keepErrors ? _formState.errors : {},
2100
+ isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful
2101
+ ? _formState.isSubmitSuccessful
2102
+ : false,
2103
+ isSubmitting: false,
2104
+ defaultValues: _defaultValues,
2105
+ });
2106
+ };
2107
+ const reset = (formValues, keepStateOptions) => _reset(isFunction(formValues)
2108
+ ? formValues(_formValues)
2109
+ : formValues, { ..._options.resetOptions, ...keepStateOptions });
2110
+ const setFocus = (name, options = {}) => {
2111
+ const field = get(_fields, name);
2112
+ const fieldReference = field && field._f;
2113
+ if (fieldReference) {
2114
+ const fieldRef = fieldReference.refs
2115
+ ? fieldReference.refs[0]
2116
+ : fieldReference.ref;
2117
+ if (fieldRef.focus) {
2118
+ // Use setTimeout to ensure focus happens after any pending state updates
2119
+ // This fixes the issue where setFocus doesn't work immediately after setError
2120
+ setTimeout(() => {
2121
+ fieldRef.focus();
2122
+ options.shouldSelect &&
2123
+ isFunction(fieldRef.select) &&
2124
+ fieldRef.select();
2125
+ });
2126
+ }
2127
+ }
2128
+ };
2129
+ const _setFormState = (updatedFormState) => {
2130
+ _formState = {
2131
+ ..._formState,
2132
+ ...updatedFormState,
2133
+ };
2134
+ };
2135
+ const _resetDefaultValues = () => isFunction(_options.defaultValues) &&
2136
+ _options.defaultValues().then((values) => {
2137
+ reset(values, _options.resetOptions);
2138
+ _subjects.state.next({
2139
+ isLoading: false,
2140
+ });
2141
+ });
2142
+ const methods = {
2143
+ control: {
2144
+ register,
2145
+ unregister,
2146
+ getFieldState,
2147
+ handleSubmit,
2148
+ setError,
2149
+ _subscribe,
2150
+ _runSchema,
2151
+ _updateIsValidating,
2152
+ _focusError,
2153
+ _getWatch,
2154
+ _getDirty,
2155
+ _setValid,
2156
+ _setFieldArray,
2157
+ _setDisabledField,
2158
+ _setErrors,
2159
+ _getFieldArray,
2160
+ _reset,
2161
+ _resetDefaultValues,
2162
+ _removeUnmounted,
2163
+ _disableForm,
2164
+ _subjects,
2165
+ _proxyFormState,
2166
+ get _fields() {
2167
+ return _fields;
2168
+ },
2169
+ get _formValues() {
2170
+ return _formValues;
2171
+ },
2172
+ get _state() {
2173
+ return _state;
2174
+ },
2175
+ set _state(value) {
2176
+ _state = value;
2177
+ },
2178
+ get _defaultValues() {
2179
+ return _defaultValues;
2180
+ },
2181
+ get _names() {
2182
+ return _names;
2183
+ },
2184
+ set _names(value) {
2185
+ _names = value;
2186
+ },
2187
+ get _formState() {
2188
+ return _formState;
2189
+ },
2190
+ get _options() {
2191
+ return _options;
2192
+ },
2193
+ set _options(value) {
2194
+ _options = {
2195
+ ..._options,
2196
+ ...value,
2197
+ };
2198
+ },
2199
+ },
2200
+ subscribe,
2201
+ trigger,
2202
+ register,
2203
+ handleSubmit,
2204
+ watch,
2205
+ setValue,
2206
+ getValues,
2207
+ reset,
2208
+ resetField,
2209
+ clearErrors,
2210
+ unregister,
2211
+ setError,
2212
+ setFocus,
2213
+ getFieldState,
2214
+ };
2215
+ return {
2216
+ ...methods,
2217
+ formControl: methods,
2218
+ };
2219
+ }
2220
+
2221
+ var generateId = () => {
2222
+ if (typeof crypto !== 'undefined' && crypto.randomUUID) {
2223
+ return crypto.randomUUID();
2224
+ }
2225
+ const d = typeof performance === 'undefined' ? Date.now() : performance.now() * 1000;
2226
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
2227
+ const r = ((Math.random() * 16 + d) % 16) | 0;
2228
+ return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);
2229
+ });
2230
+ };
2231
+
2232
+ var getFocusFieldName = (name, index, options = {}) => options.shouldFocus || isUndefined(options.shouldFocus)
2233
+ ? options.focusName ||
2234
+ `${name}.${isUndefined(options.focusIndex) ? index : options.focusIndex}.`
2235
+ : '';
2236
+
2237
+ var appendAt = (data, value) => [
2238
+ ...data,
2239
+ ...convertToArrayPayload(value),
2240
+ ];
2241
+
2242
+ var fillEmptyArray = (value) => Array.isArray(value) ? value.map(() => undefined) : undefined;
2243
+
2244
+ function insert(data, index, value) {
2245
+ return [
2246
+ ...data.slice(0, index),
2247
+ ...convertToArrayPayload(value),
2248
+ ...data.slice(index),
2249
+ ];
2250
+ }
2251
+
2252
+ var moveArrayAt = (data, from, to) => {
2253
+ if (!Array.isArray(data)) {
2254
+ return [];
2255
+ }
2256
+ if (isUndefined(data[to])) {
2257
+ data[to] = undefined;
2258
+ }
2259
+ data.splice(to, 0, data.splice(from, 1)[0]);
2260
+ return data;
2261
+ };
2262
+
2263
+ var prependAt = (data, value) => [
2264
+ ...convertToArrayPayload(value),
2265
+ ...convertToArrayPayload(data),
2266
+ ];
2267
+
2268
+ function removeAtIndexes(data, indexes) {
2269
+ let i = 0;
2270
+ const temp = [...data];
2271
+ for (const index of indexes) {
2272
+ temp.splice(index - i, 1);
2273
+ i++;
2274
+ }
2275
+ return compact(temp).length ? temp : [];
2276
+ }
2277
+ var removeArrayAt = (data, index) => isUndefined(index)
2278
+ ? []
2279
+ : removeAtIndexes(data, convertToArrayPayload(index).sort((a, b) => a - b));
2280
+
2281
+ var swapArrayAt = (data, indexA, indexB) => {
2282
+ [data[indexA], data[indexB]] = [data[indexB], data[indexA]];
2283
+ };
2284
+
2285
+ var updateAt = (fieldValues, index, value) => {
2286
+ fieldValues[index] = value;
2287
+ return fieldValues;
2288
+ };
2289
+
2290
+ /**
2291
+ * A custom hook that exposes convenient methods to perform operations with a list of dynamic inputs that need to be appended, updated, removed etc. • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn) • [Video](https://youtu.be/4MrbfGSFY2A)
2292
+ *
2293
+ * @remarks
2294
+ * [API](https://react-hook-form.com/docs/usefieldarray) • [Demo](https://codesandbox.io/s/react-hook-form-usefieldarray-ssugn)
2295
+ *
2296
+ * @param props - useFieldArray props
2297
+ *
2298
+ * @returns methods - functions to manipulate with the Field Arrays (dynamic inputs) {@link UseFieldArrayReturn}
2299
+ *
2300
+ * @example
2301
+ * ```tsx
2302
+ * function App() {
2303
+ * const { register, control, handleSubmit, reset, trigger, setError } = useForm({
2304
+ * defaultValues: {
2305
+ * test: []
2306
+ * }
2307
+ * });
2308
+ * const { fields, append } = useFieldArray({
2309
+ * control,
2310
+ * name: "test"
2311
+ * });
2312
+ *
2313
+ * return (
2314
+ * <form onSubmit={handleSubmit(data => console.log(data))}>
2315
+ * {fields.map((item, index) => (
2316
+ * <input key={item.id} {...register(`test.${index}.firstName`)} />
2317
+ * ))}
2318
+ * <button type="button" onClick={() => append({ firstName: "bill" })}>
2319
+ * append
2320
+ * </button>
2321
+ * <input type="submit" />
2322
+ * </form>
2323
+ * );
2324
+ * }
2325
+ * ```
2326
+ */
2327
+ function useFieldArray(props) {
2328
+ const formControl = useFormControlContext();
2329
+ const { control = formControl, name, keyName = 'id', shouldUnregister, rules, } = props;
2330
+ const [fields, setFields] = React.useState(control._getFieldArray(name));
2331
+ const ids = React.useRef(control._getFieldArray(name).map(generateId));
2332
+ const _actioned = React.useRef(false);
2333
+ control._names.array.add(name);
2334
+ React.useMemo(() => rules &&
2335
+ fields.length >= 0 &&
2336
+ control.register(name, rules), [control, name, fields.length, rules]);
2337
+ useIsomorphicLayoutEffect(() => control._subjects.array.subscribe({
2338
+ next: ({ values, name: fieldArrayName, }) => {
2339
+ if (fieldArrayName === name || !fieldArrayName) {
2340
+ const fieldValues = get(values, name);
2341
+ if (Array.isArray(fieldValues)) {
2342
+ setFields(fieldValues);
2343
+ ids.current = fieldValues.map(generateId);
2344
+ }
2345
+ }
2346
+ },
2347
+ }).unsubscribe, [control, name]);
2348
+ const updateValues = React.useCallback((updatedFieldArrayValues) => {
2349
+ _actioned.current = true;
2350
+ control._setFieldArray(name, updatedFieldArrayValues);
2351
+ }, [control, name]);
2352
+ const append = (value, options) => {
2353
+ const appendValue = convertToArrayPayload(cloneObject(value));
2354
+ const updatedFieldArrayValues = appendAt(control._getFieldArray(name), appendValue);
2355
+ control._names.focus = getFocusFieldName(name, updatedFieldArrayValues.length - 1, options);
2356
+ ids.current = appendAt(ids.current, appendValue.map(generateId));
2357
+ updateValues(updatedFieldArrayValues);
2358
+ setFields(updatedFieldArrayValues);
2359
+ control._setFieldArray(name, updatedFieldArrayValues, appendAt, {
2360
+ argA: fillEmptyArray(value),
2361
+ });
2362
+ };
2363
+ const prepend = (value, options) => {
2364
+ const prependValue = convertToArrayPayload(cloneObject(value));
2365
+ const updatedFieldArrayValues = prependAt(control._getFieldArray(name), prependValue);
2366
+ control._names.focus = getFocusFieldName(name, 0, options);
2367
+ ids.current = prependAt(ids.current, prependValue.map(generateId));
2368
+ updateValues(updatedFieldArrayValues);
2369
+ setFields(updatedFieldArrayValues);
2370
+ control._setFieldArray(name, updatedFieldArrayValues, prependAt, {
2371
+ argA: fillEmptyArray(value),
2372
+ });
2373
+ };
2374
+ const remove = (index) => {
2375
+ const updatedFieldArrayValues = removeArrayAt(control._getFieldArray(name), index);
2376
+ ids.current = removeArrayAt(ids.current, index);
2377
+ updateValues(updatedFieldArrayValues);
2378
+ setFields(updatedFieldArrayValues);
2379
+ !Array.isArray(get(control._fields, name)) &&
2380
+ set(control._fields, name, undefined);
2381
+ control._setFieldArray(name, updatedFieldArrayValues, removeArrayAt, {
2382
+ argA: index,
2383
+ });
2384
+ };
2385
+ const insert$1 = (index, value, options) => {
2386
+ const insertValue = convertToArrayPayload(cloneObject(value));
2387
+ const updatedFieldArrayValues = insert(control._getFieldArray(name), index, insertValue);
2388
+ control._names.focus = getFocusFieldName(name, index, options);
2389
+ ids.current = insert(ids.current, index, insertValue.map(generateId));
2390
+ updateValues(updatedFieldArrayValues);
2391
+ setFields(updatedFieldArrayValues);
2392
+ control._setFieldArray(name, updatedFieldArrayValues, insert, {
2393
+ argA: index,
2394
+ argB: fillEmptyArray(value),
2395
+ });
2396
+ };
2397
+ const swap = (indexA, indexB) => {
2398
+ const updatedFieldArrayValues = control._getFieldArray(name);
2399
+ swapArrayAt(updatedFieldArrayValues, indexA, indexB);
2400
+ swapArrayAt(ids.current, indexA, indexB);
2401
+ updateValues(updatedFieldArrayValues);
2402
+ setFields(updatedFieldArrayValues);
2403
+ control._setFieldArray(name, updatedFieldArrayValues, swapArrayAt, {
2404
+ argA: indexA,
2405
+ argB: indexB,
2406
+ }, false);
2407
+ };
2408
+ const move = (from, to) => {
2409
+ const updatedFieldArrayValues = control._getFieldArray(name);
2410
+ moveArrayAt(updatedFieldArrayValues, from, to);
2411
+ moveArrayAt(ids.current, from, to);
2412
+ updateValues(updatedFieldArrayValues);
2413
+ setFields(updatedFieldArrayValues);
2414
+ control._setFieldArray(name, updatedFieldArrayValues, moveArrayAt, {
2415
+ argA: from,
2416
+ argB: to,
2417
+ }, false);
2418
+ };
2419
+ const update = (index, value) => {
2420
+ const updateValue = cloneObject(value);
2421
+ const updatedFieldArrayValues = updateAt(control._getFieldArray(name), index, updateValue);
2422
+ ids.current = [...updatedFieldArrayValues].map((item, i) => !item || i === index ? generateId() : ids.current[i]);
2423
+ updateValues(updatedFieldArrayValues);
2424
+ setFields([...updatedFieldArrayValues]);
2425
+ control._setFieldArray(name, updatedFieldArrayValues, updateAt, {
2426
+ argA: index,
2427
+ argB: updateValue,
2428
+ }, true, false);
2429
+ };
2430
+ const replace = (value) => {
2431
+ const updatedFieldArrayValues = convertToArrayPayload(cloneObject(value));
2432
+ ids.current = updatedFieldArrayValues.map(generateId);
2433
+ updateValues([...updatedFieldArrayValues]);
2434
+ setFields([...updatedFieldArrayValues]);
2435
+ control._setFieldArray(name, [...updatedFieldArrayValues], (data) => data, {}, true, false);
2436
+ };
2437
+ React.useEffect(() => {
2438
+ control._state.action = false;
2439
+ isWatched(name, control._names) &&
2440
+ control._subjects.state.next({
2441
+ ...control._formState,
2442
+ });
2443
+ if (_actioned.current &&
2444
+ (!getValidationModes(control._options.mode).isOnSubmit ||
2445
+ control._formState.isSubmitted) &&
2446
+ !getValidationModes(control._options.reValidateMode).isOnSubmit) {
2447
+ if (control._options.resolver) {
2448
+ control._runSchema([name]).then((result) => {
2449
+ control._updateIsValidating([name]);
2450
+ const error = get(result.errors, name);
2451
+ const existingError = get(control._formState.errors, name);
2452
+ if (existingError
2453
+ ? (!error && existingError.type) ||
2454
+ (error &&
2455
+ (existingError.type !== error.type ||
2456
+ existingError.message !== error.message))
2457
+ : error && error.type) {
2458
+ error
2459
+ ? set(control._formState.errors, name, error)
2460
+ : unset(control._formState.errors, name);
2461
+ control._subjects.state.next({
2462
+ errors: control._formState.errors,
2463
+ });
2464
+ }
2465
+ });
2466
+ }
2467
+ else {
2468
+ const field = get(control._fields, name);
2469
+ if (field &&
2470
+ field._f &&
2471
+ !(getValidationModes(control._options.reValidateMode).isOnSubmit &&
2472
+ getValidationModes(control._options.mode).isOnSubmit)) {
2473
+ validateField(field, control._names.disabled, control._formValues, control._options.criteriaMode === VALIDATION_MODE.all, control._options.shouldUseNativeValidation, true).then((error) => !isEmptyObject(error) &&
2474
+ control._subjects.state.next({
2475
+ errors: updateFieldArrayRootError(control._formState.errors, error, name),
2476
+ }));
2477
+ }
2478
+ }
2479
+ }
2480
+ control._subjects.state.next({
2481
+ name,
2482
+ values: cloneObject(control._formValues),
2483
+ });
2484
+ control._names.focus &&
2485
+ iterateFieldsByAction(control._fields, (ref, key) => {
2486
+ if (control._names.focus &&
2487
+ key.startsWith(control._names.focus) &&
2488
+ ref.focus) {
2489
+ ref.focus();
2490
+ return 1;
2491
+ }
2492
+ return;
2493
+ });
2494
+ control._names.focus = '';
2495
+ control._setValid();
2496
+ _actioned.current = false;
2497
+ }, [fields, name, control]);
2498
+ React.useEffect(() => {
2499
+ !get(control._formValues, name) && control._setFieldArray(name);
2500
+ return () => {
2501
+ const updateMounted = (name, value) => {
2502
+ const field = get(control._fields, name);
2503
+ if (field && field._f) {
2504
+ field._f.mount = value;
2505
+ }
2506
+ };
2507
+ control._options.shouldUnregister || shouldUnregister
2508
+ ? control.unregister(name)
2509
+ : updateMounted(name, false);
2510
+ };
2511
+ }, [name, control, keyName, shouldUnregister]);
2512
+ return {
2513
+ swap: React.useCallback(swap, [updateValues, name, control]),
2514
+ move: React.useCallback(move, [updateValues, name, control]),
2515
+ prepend: React.useCallback(prepend, [updateValues, name, control]),
2516
+ append: React.useCallback(append, [updateValues, name, control]),
2517
+ remove: React.useCallback(remove, [updateValues, name, control]),
2518
+ insert: React.useCallback(insert$1, [updateValues, name, control]),
2519
+ update: React.useCallback(update, [updateValues, name, control]),
2520
+ replace: React.useCallback(replace, [updateValues, name, control]),
2521
+ fields: React.useMemo(() => fields.map((field, index) => ({
2522
+ ...field,
2523
+ [keyName]: ids.current[index] || generateId(),
2524
+ })), [fields, keyName]),
2525
+ };
2526
+ }
2527
+
2528
+ /**
2529
+ * Custom hook to manage the entire form.
2530
+ *
2531
+ * @remarks
2532
+ * [API](https://react-hook-form.com/docs/useform) • [Demo](https://codesandbox.io/s/react-hook-form-get-started-ts-5ksmm) • [Video](https://www.youtube.com/watch?v=RkXv4AXXC_4)
2533
+ *
2534
+ * @param props - form configuration and validation parameters.
2535
+ *
2536
+ * @returns methods - individual functions to manage the form state. {@link UseFormReturn}
2537
+ *
2538
+ * @example
2539
+ * ```tsx
2540
+ * function App() {
2541
+ * const { register, handleSubmit, watch, formState: { errors } } = useForm();
2542
+ * const onSubmit = data => console.log(data);
2543
+ *
2544
+ * console.log(watch("example"));
2545
+ *
2546
+ * return (
2547
+ * <form onSubmit={handleSubmit(onSubmit)}>
2548
+ * <input defaultValue="test" {...register("example")} />
2549
+ * <input {...register("exampleRequired", { required: true })} />
2550
+ * {errors.exampleRequired && <span>This field is required</span>}
2551
+ * <button>Submit</button>
2552
+ * </form>
2553
+ * );
2554
+ * }
2555
+ * ```
2556
+ */
2557
+ function useForm(props = {}) {
2558
+ const _formControl = React.useRef(undefined);
2559
+ const _values = React.useRef(undefined);
2560
+ const [formState, updateFormState] = React.useState({
2561
+ isDirty: false,
2562
+ isValidating: false,
2563
+ isLoading: isFunction(props.defaultValues),
2564
+ isSubmitted: false,
2565
+ isSubmitting: false,
2566
+ isSubmitSuccessful: false,
2567
+ isValid: false,
2568
+ submitCount: 0,
2569
+ dirtyFields: {},
2570
+ touchedFields: {},
2571
+ validatingFields: {},
2572
+ errors: props.errors || {},
2573
+ disabled: props.disabled || false,
2574
+ isReady: false,
2575
+ defaultValues: isFunction(props.defaultValues)
2576
+ ? undefined
2577
+ : props.defaultValues,
2578
+ });
2579
+ if (!_formControl.current) {
2580
+ if (props.formControl) {
2581
+ _formControl.current = {
2582
+ ...props.formControl,
2583
+ formState,
2584
+ };
2585
+ if (props.defaultValues && !isFunction(props.defaultValues)) {
2586
+ props.formControl.reset(props.defaultValues, props.resetOptions);
2587
+ }
2588
+ }
2589
+ else {
2590
+ const { formControl, ...rest } = createFormControl(props);
2591
+ _formControl.current = {
2592
+ ...rest,
2593
+ formState,
2594
+ };
2595
+ }
2596
+ }
2597
+ const control = _formControl.current.control;
2598
+ control._options = props;
2599
+ useIsomorphicLayoutEffect(() => {
2600
+ const sub = control._subscribe({
2601
+ formState: control._proxyFormState,
2602
+ callback: () => updateFormState({ ...control._formState }),
2603
+ reRenderRoot: true,
2604
+ });
2605
+ updateFormState((data) => ({
2606
+ ...data,
2607
+ isReady: true,
2608
+ }));
2609
+ control._formState.isReady = true;
2610
+ return sub;
2611
+ }, [control]);
2612
+ React.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
2613
+ React.useEffect(() => {
2614
+ if (props.mode) {
2615
+ control._options.mode = props.mode;
2616
+ }
2617
+ if (props.reValidateMode) {
2618
+ control._options.reValidateMode = props.reValidateMode;
2619
+ }
2620
+ }, [control, props.mode, props.reValidateMode]);
2621
+ React.useEffect(() => {
2622
+ if (props.errors) {
2623
+ control._setErrors(props.errors);
2624
+ control._focusError();
2625
+ }
2626
+ }, [control, props.errors]);
2627
+ React.useEffect(() => {
2628
+ props.shouldUnregister &&
2629
+ control._subjects.state.next({
2630
+ values: control._getWatch(),
2631
+ });
2632
+ }, [control, props.shouldUnregister]);
2633
+ React.useEffect(() => {
2634
+ if (control._proxyFormState.isDirty) {
2635
+ const isDirty = control._getDirty();
2636
+ if (isDirty !== formState.isDirty) {
2637
+ control._subjects.state.next({
2638
+ isDirty,
2639
+ });
2640
+ }
2641
+ }
2642
+ }, [control, formState.isDirty]);
2643
+ React.useEffect(() => {
2644
+ var _a;
2645
+ if (props.values && !deepEqual(props.values, _values.current)) {
2646
+ control._reset(props.values, {
2647
+ keepFieldsRef: true,
2648
+ ...control._options.resetOptions,
2649
+ });
2650
+ if (!((_a = control._options.resetOptions) === null || _a === void 0 ? void 0 : _a.keepIsValid)) {
2651
+ control._setValid();
2652
+ }
2653
+ _values.current = props.values;
2654
+ updateFormState((state) => ({ ...state }));
2655
+ }
2656
+ else {
2657
+ control._resetDefaultValues();
2658
+ }
2659
+ }, [control, props.values]);
2660
+ React.useEffect(() => {
2661
+ if (!control._state.mount) {
2662
+ control._setValid();
2663
+ control._state.mount = true;
2664
+ }
2665
+ if (control._state.watch) {
2666
+ control._state.watch = false;
2667
+ control._subjects.state.next({ ...control._formState });
2668
+ }
2669
+ control._removeUnmounted();
2670
+ });
2671
+ _formControl.current.formState = React.useMemo(() => getProxyFormState(formState, control), [control, formState]);
2672
+ return _formControl.current;
2673
+ }
2674
+
2675
+ export { useForm as a, useController as b, useFieldArray as c, useWatch as d, appendErrors as e, get as g, set as s, useFormState as u };
2676
+ //# sourceMappingURL=index.esm-Dpqxgpya.js.map