dorkos 0.127.0 → 0.128.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/THIRD-PARTY-NOTICES.md +61 -0
  2. package/dist/bin/cli.js +1890 -1099
  3. package/dist/browser/native/package-manifest.json +1 -1
  4. package/dist/browser/source-manifest.json +1 -1
  5. package/dist/client/assets/{AboutPage-BnnwvwU1.js → AboutPage-CmQERFxo.js} +1 -1
  6. package/dist/client/assets/{ActivityErrorState-DW-plne9.js → ActivityErrorState-Dw231W2w.js} +1 -1
  7. package/dist/client/assets/{ActivityPage-BMrtNC9t.js → ActivityPage-DVfeyA9u.js} +1 -1
  8. package/dist/client/assets/{ActivityRow-BnBDxJqK.js → ActivityRow-DIBH4v9c.js} +1 -1
  9. package/dist/client/assets/{AdapterIcon-J2UUIfEX.js → AdapterIcon-NqCDzgCI.js} +1 -1
  10. package/dist/client/assets/{AdapterSetupWizard-MDV6zwYC.js → AdapterSetupWizard-Dle_b9qc.js} +1 -1
  11. package/dist/client/assets/{AgentOptionRow-Dj2MlE6E.js → AgentOptionRow-BRJfZo2y.js} +1 -1
  12. package/dist/client/assets/{AgentPicker-D6MsFN_H.js → AgentPicker-B7upjYRk.js} +1 -1
  13. package/dist/client/assets/{AgentRequestCard-BTyuNOhU.js → AgentRequestCard-DXJnLk6q.js} +1 -1
  14. package/dist/client/assets/{AppearancePage-DJfJUAkw.js → AppearancePage-DXbhUt2e.js} +1 -1
  15. package/dist/client/assets/{ApplyToOverridesDialog-Akw0_458.js → ApplyToOverridesDialog-C_QQhNIf.js} +1 -1
  16. package/dist/client/assets/{AttentionSignalRow-Cx9-sStN.js → AttentionSignalRow-5E7TkG98.js} +1 -1
  17. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-CRlmlore.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-G7vrCqeA.js} +1 -1
  18. package/dist/client/assets/{BindingDialog-ZAX-h6D4.js → BindingDialog-q--8SDJF.js} +1 -1
  19. package/dist/client/assets/{BlintzCanvas-fEMJgpNx.js → BlintzCanvas-DruVZcDU.js} +3 -3
  20. package/dist/client/assets/{CanvasCsvContent-CUoIFG7g.js → CanvasCsvContent-CtLpZnTs.js} +1 -1
  21. package/dist/client/assets/{CanvasFileContent-Cg2jcXse.js → CanvasFileContent-BThy5fjD.js} +2 -2
  22. package/dist/client/assets/{CanvasModel3dContent-BL-UiHAj.js → CanvasModel3dContent-BbgR73jh.js} +2 -2
  23. package/dist/client/assets/ChannelComposer-qhk0KtW7.js +44 -0
  24. package/dist/client/assets/{ChatAppsOff-CSSu_yVC.js → ChatAppsOff-CCZUzDIH.js} +1 -1
  25. package/dist/client/assets/{CodeMirrorDiff-dfcDpguR.js → CodeMirrorDiff-BCpYdhgZ.js} +1 -1
  26. package/dist/client/assets/{CodeMirrorEditor-C1YQ35ki.js → CodeMirrorEditor-BeCubxHV.js} +1 -1
  27. package/dist/client/assets/{CommitmentList-B6RG_hWB.js → CommitmentList-BZtfTnwg.js} +1 -1
  28. package/dist/client/assets/{CommitmentsPage-CDFvo1lt.js → CommitmentsPage-DmurDgxV.js} +1 -1
  29. package/dist/client/assets/{ComputerResourceView-vJ8UfRNm.js → ComputerResourceView-Bik6GLKp.js} +1 -1
  30. package/dist/client/assets/{ComputerViewer-BTqPuZyh.js → ComputerViewer-CksBDqdu.js} +1 -1
  31. package/dist/client/assets/{ConnectionAccessLists-DPnmOuiA.js → ConnectionAccessLists-DRwO1v0V.js} +1 -1
  32. package/dist/client/assets/{ConnectionsPage-CSHnGkha.js → ConnectionsPage-Cgg36gDY.js} +1 -1
  33. package/dist/client/assets/{ConventionPage-C6WsAvm4.js → ConventionPage-CNhpF6Z1.js} +1 -1
  34. package/dist/client/assets/{ExtensionPageRoute-CGjw2Cwy.js → ExtensionPageRoute-C2zue_Pw.js} +1 -1
  35. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-CKlmwuIc.js → FloatingTanStackRouterDevtools-CqogiFob-3v1TfY1P.js} +1 -1
  36. package/dist/client/assets/{ForwardConsentHost-D8rVtTRp.js → ForwardConsentHost-Mbo0D-zk.js} +1 -1
  37. package/dist/client/assets/HandlePage-B4qbFi40.js +1 -0
  38. package/dist/client/assets/{HeartbeatPage-DQImR4dY.js → HeartbeatPage-BnNbQLCW.js} +1 -1
  39. package/dist/client/assets/{KeyEntry-BerpQFQT.js → KeyEntry-C43vkwpA.js} +1 -1
  40. package/dist/client/assets/{LexicalField-CkcKNJGL.js → LexicalField-iAHcvRmI.js} +1 -1
  41. package/dist/client/assets/{ManagesPage-CV4xieFk.js → ManagesPage-BUIJvLmv.js} +1 -1
  42. package/dist/client/assets/{Marketplace-Cp0e4Nv8.js → Marketplace-DbdLWz0-.js} +1 -1
  43. package/dist/client/assets/{MarketplaceSourcesView-ZBNnVSuv.js → MarketplaceSourcesView-BZODwhxu.js} +1 -1
  44. package/dist/client/assets/{McpAppFrame-BtKAUDBg.js → McpAppFrame-D15nxVaI.js} +1 -1
  45. package/dist/client/assets/{McpSigninBody-DjGrp_sO.js → McpSigninBody-DmBxqgxN.js} +1 -1
  46. package/dist/client/assets/{Model3dViewer-BSX1QGsE.js → Model3dViewer-RGXeJd6a.js} +1 -1
  47. package/dist/client/assets/NamePage-fhxyWDDY.js +1 -0
  48. package/dist/client/assets/{NewDirectMessageMenu-DTQ7vFsa.js → NewDirectMessageMenu-DBAdvv5p.js} +1 -1
  49. package/dist/client/assets/{NotificationsPage-q7BDVKOz.js → NotificationsPage-NRfyiinS.js} +1 -1
  50. package/dist/client/assets/{OpenMeshSwitch-aAMKDAyc.js → OpenMeshSwitch-CgQ6uefo.js} +1 -1
  51. package/dist/client/assets/{OperatorIdentityForm-CCAvadEZ.js → OperatorIdentityForm-Bls5Vo_u.js} +1 -1
  52. package/dist/client/assets/{PermissionHistory-_8m4ohGq.js → PermissionHistory-DPEPq8D9.js} +1 -1
  53. package/dist/client/assets/{PermissionsPage-DHl8sCfQ.js → PermissionsPage--k-xutbJ.js} +1 -1
  54. package/dist/client/assets/{PersonalityPopover-DOql0nWB.js → PersonalityPopover-DMMptmPS.js} +1 -1
  55. package/dist/client/assets/PhotoPage-CNHcXbz4.js +1 -0
  56. package/dist/client/assets/{PreviewRefusedNotice-BfvSYL-w.js → PreviewRefusedNotice-Ds4IO32o.js} +1 -1
  57. package/dist/client/assets/{ProfileFields-CX2mdPAV.js → ProfileFields-DbPJ7fvN.js} +1 -1
  58. package/dist/client/assets/{ProfilePanelContainer-Cj_57NEG.js → ProfilePanelContainer-CzwhrIlw.js} +1 -1
  59. package/dist/client/assets/{ProfileRolePicker-D7F0PDw9.js → ProfileRolePicker-CZEXvlJm.js} +1 -1
  60. package/dist/client/assets/{PromptSuggestionChips-BopMvYe7.js → PromptSuggestionChips-BXxC799Q.js} +1 -1
  61. package/dist/client/assets/{ReportsToPopover-CG_hjT_U.js → ReportsToPopover-YOwGLJy5.js} +1 -1
  62. package/dist/client/assets/{RoomSurface-Mt3dk4_6.js → RoomSurface-DgH3a_Fv.js} +1 -1
  63. package/dist/client/assets/{RoomsPage-ByHhS_HA.js → RoomsPage-CoXjZMWL.js} +1 -1
  64. package/dist/client/assets/{RunsOnPopover-DS8_Au0B.js → RunsOnPopover-CEkkjrGg.js} +1 -1
  65. package/dist/client/assets/{RuntimeConnectFlow-hhvWVRMu.js → RuntimeConnectFlow-DXWGgvCW.js} +1 -1
  66. package/dist/client/assets/{RuntimeSetupDialog-NKy3mLEH.js → RuntimeSetupDialog-D6L1QhMF.js} +1 -1
  67. package/dist/client/assets/{SeenDevices-65oxnxk6.js → SeenDevices-Bh2yh-PW.js} +1 -1
  68. package/dist/client/assets/{SessionsPage-WbWf0huR.js → SessionsPage-CFvkbT9X.js} +1 -1
  69. package/dist/client/assets/{SettingsDialog-e33ltTb6.js → SettingsDialog-BOOqWKcj.js} +1 -1
  70. package/dist/client/assets/{SkillsPage-Cj3XrV8s.js → SkillsPage-ntCEhUIM.js} +1 -1
  71. package/dist/client/assets/{TaskDialogWrapper-DJAGQuab.js → TaskDialogWrapper-vBWAWwTY.js} +1 -1
  72. package/dist/client/assets/{TasksEmptyState-DNI1C274.js → TasksEmptyState-C_3UkAbA.js} +1 -1
  73. package/dist/client/assets/{TasksPage-Dc1j_X1K.js → TasksPage-D0Zi6Mve.js} +1 -1
  74. package/dist/client/assets/{TeamComputerEntry-DWenh1bP.js → TeamComputerEntry-CY9eLVad.js} +1 -1
  75. package/dist/client/assets/{ToolsPage-CXKq_axq.js → ToolsPage-0_vx5P-F.js} +1 -1
  76. package/dist/client/assets/{TopologyGraph-DgTGLoaA.js → TopologyGraph-DUZLZZrB.js} +1 -1
  77. package/dist/client/assets/{TourHost-C4KKDX9k.js → TourHost-B69XAKpE.js} +1 -1
  78. package/dist/client/assets/{UnlinkDialog-GfsbP91q.js → UnlinkDialog-ptZy3IN4.js} +1 -1
  79. package/dist/client/assets/UnreadDivider-Ckey1IWn.js +1 -0
  80. package/dist/client/assets/{WidgetErrorCard-BZkAK-Ke.js → WidgetErrorCard-BlqaIsPK.js} +7 -7
  81. package/dist/client/assets/{WithheldExtensionsNotice-Dt51QZLT.js → WithheldExtensionsNotice-7Vu1Jctn.js} +1 -1
  82. package/dist/client/assets/WorkView-BekLkR4O.js +51 -0
  83. package/dist/client/assets/{_shell-BScdINMH.js → _shell-Du0F-5fK.js} +1 -1
  84. package/dist/client/assets/{_shell._home-CUusDXBM.js → _shell._home-BRIXhYLg.js} +1 -1
  85. package/dist/client/assets/{_shell._home.activity-DPjJ1_vZ.js → _shell._home.activity-5rihXoYF.js} +1 -1
  86. package/dist/client/assets/{_shell._home.index-CTBWy5Au.js → _shell._home.index-BsLNqt4f.js} +1 -1
  87. package/dist/client/assets/{_shell._home.tasks-DWFh5Qbq.js → _shell._home.tasks-Cxs5tLWA.js} +1 -1
  88. package/dist/client/assets/{_shell._home.workspaces-DWjB1sCd.js → _shell._home.workspaces-CEHDdfbP.js} +1 -1
  89. package/dist/client/assets/{_shell.channels-C6v3yOzH.js → _shell.channels-Bx6q9xVH.js} +1 -1
  90. package/dist/client/assets/{_shell.connections-jXaP35mN.js → _shell.connections-Bm0WmgXH.js} +1 -1
  91. package/dist/client/assets/{_shell.feedback-requests-CyV-aboj.js → _shell.feedback-requests-DFznTGbN.js} +1 -1
  92. package/dist/client/assets/_shell.marketplace-CsQ60Mlc.js +1 -0
  93. package/dist/client/assets/_shell.marketplace_.sources-DNyShS1x.js +1 -0
  94. package/dist/client/assets/_shell.session-BN42bV3w.js +1 -0
  95. package/dist/client/assets/{_shell.team-BPevCu33.js → _shell.team-DmA09abY.js} +3 -3
  96. package/dist/client/assets/{_shell.threads-gzYSpt7x.js → _shell.threads-HH4EvufJ.js} +1 -1
  97. package/dist/client/assets/_shell.x._extensionId-3ZlJV1iu.js +1 -0
  98. package/dist/client/assets/_shell.x._extensionId_._-3ZlJV1iu.js +1 -0
  99. package/dist/client/assets/{abnfDiagram-WEYOIA3C-iUnN9Com.js → abnfDiagram-WEYOIA3C-DxgtVd9I.js} +1 -1
  100. package/dist/client/assets/{access-copy-CP0B1ZT9.js → access-copy-Dqct36mi.js} +1 -1
  101. package/dist/client/assets/{arc-BVSQ4HBO.js → arc-C-67Ef0p.js} +1 -1
  102. package/dist/client/assets/{architectureDiagram-ZHVYKT53-_zlUU8PS.js → architectureDiagram-ZHVYKT53-B7TjdT-_.js} +1 -1
  103. package/dist/client/assets/{banner-DTCBttcQ.js → banner-C9qTs6-C.js} +1 -1
  104. package/dist/client/assets/{blockDiagram-RJAE7QA3-COqNq2ny.js → blockDiagram-RJAE7QA3-DNqxJ3Ww.js} +1 -1
  105. package/dist/client/assets/{c4Diagram-XDPPPE54-Caa3QxQ_.js → c4Diagram-XDPPPE54-D3jNLV0j.js} +1 -1
  106. package/dist/client/assets/{card-D9DO5nt4.js → card-DUmTNXJJ.js} +1 -1
  107. package/dist/client/assets/channel-B7zgJbnU.js +1 -0
  108. package/dist/client/assets/{chunk-2E7WHVMD-BqirxZIN.js → chunk-2E7WHVMD-C6OKx0ty.js} +1 -1
  109. package/dist/client/assets/{chunk-2Q5K7J3B-CYGt3XQf.js → chunk-2Q5K7J3B-Dr_6hHrZ.js} +1 -1
  110. package/dist/client/assets/{chunk-4EMNKR2T-Bx234GPP.js → chunk-4EMNKR2T-CSrZVDEt.js} +1 -1
  111. package/dist/client/assets/{chunk-55XCU76K-CAA7du3_.js → chunk-55XCU76K-CIazeRXO.js} +1 -1
  112. package/dist/client/assets/{chunk-5VM5RSS4-Dxl-FvVz.js → chunk-5VM5RSS4-C8IJ3zTR.js} +1 -1
  113. package/dist/client/assets/{chunk-JWPE2WC7-CjcTenhr.js → chunk-JWPE2WC7-D9DGXb79.js} +1 -1
  114. package/dist/client/assets/{chunk-VQ5W62QI-COdK9J2i.js → chunk-VQ5W62QI-B0LNYdif.js} +1 -1
  115. package/dist/client/assets/{chunk-XXDRQBXY-DeXzMeSy.js → chunk-XXDRQBXY-C7IAIbvZ.js} +1 -1
  116. package/dist/client/assets/{chunk-ZCHMQSOR-C7r0u2k6.js → chunk-ZCHMQSOR-C79hvjlu.js} +2 -2
  117. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-BSI2Eza3.js → classDiagram-v2-4MYWR3UA-0Di1C2ZB.js} +1 -1
  118. package/dist/client/assets/{command-C7Cl56dV.js → command-BVQb6I3_.js} +1 -1
  119. package/dist/client/assets/{cose-bilkent-JH36ORCC-CLzQXbOG.js → cose-bilkent-JH36ORCC-rZumaV4b.js} +1 -1
  120. package/dist/client/assets/{cpu-CLfYM0zq.js → cpu-DeRuDMl4.js} +1 -1
  121. package/dist/client/assets/{cynefin-EF2NZ3EQ-e_0nKhb5.js → cynefin-EF2NZ3EQ-CI9l9xhM.js} +1 -1
  122. package/dist/client/assets/{cynefinDiagram-WF24UDRP-Cflfw_GE.js → cynefinDiagram-WF24UDRP-C8CdorJJ.js} +1 -1
  123. package/dist/client/assets/{dagre-NK4GIZVX-D66Simjb.js → dagre-NK4GIZVX-AHpsTq1O.js} +1 -1
  124. package/dist/client/assets/{diagram-CBK3MWTC-CJEeUCUY.js → diagram-CBK3MWTC-BpPLL30n.js} +1 -1
  125. package/dist/client/assets/{diagram-I5XIIV2D-BPSiDLoN.js → diagram-I5XIIV2D-D6loMn3G.js} +1 -1
  126. package/dist/client/assets/{diagram-ODIL2UCW-DJptgW_s.js → diagram-ODIL2UCW-BaGNd5eN.js} +1 -1
  127. package/dist/client/assets/{diagram-PFBEJUXE-BECklqVg.js → diagram-PFBEJUXE-BnDdKu_g.js} +1 -1
  128. package/dist/client/assets/{diagram-RJA3I4VV-B-veBl7Z.js → diagram-RJA3I4VV-UXagB0_c.js} +1 -1
  129. package/dist/client/assets/{diagram-TYUNFSNR-U8kleemE.js → diagram-TYUNFSNR-C-whBP-S.js} +1 -1
  130. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-DlwBfJCe.js → ebnfDiagram-V4P3TTPT-BbG481iS.js} +1 -1
  131. package/dist/client/assets/{elk-QONTBCTQ-DnFzEb3y.js → elk-QONTBCTQ-FtssIxOc.js} +1 -1
  132. package/dist/client/assets/{empty-state-2mQX7azC.js → empty-state-CACt-76q.js} +1 -1
  133. package/dist/client/assets/{erDiagram-KYQIGQAA-CYTM37Ws.js → erDiagram-KYQIGQAA-PpFgUf4C.js} +1 -1
  134. package/dist/client/assets/{execution-config-COqY7hHn.js → execution-config-CGL73sRn.js} +1 -1
  135. package/dist/client/assets/{file-CKSjJRX5.js → file-D80JE_L0.js} +1 -1
  136. package/dist/client/assets/{file-exclamation-point-ad7FedZ9.js → file-exclamation-point-CcJ_e4_m.js} +1 -1
  137. package/dist/client/assets/{file-text-DXPPkxAL.js → file-text-Ds9edaTZ.js} +1 -1
  138. package/dist/client/assets/{find-latest-widget-fence-BsDq4SYp.js → find-latest-widget-fence-BtqFMP_f.js} +1 -1
  139. package/dist/client/assets/{flowDiagram-IUGLLWBU-DD259OPj.js → flowDiagram-IUGLLWBU-BIva66g9.js} +1 -1
  140. package/dist/client/assets/{form-C9cPRNOV.js → form-D93N5lrK.js} +1 -1
  141. package/dist/client/assets/{format-cron-DIw9_M6c.js → format-cron-BpGrgPLu.js} +1 -1
  142. package/dist/client/assets/{ganttDiagram-R7GPNTJY-BmoAVY6N.js → ganttDiagram-R7GPNTJY-CZqips_4.js} +1 -1
  143. package/dist/client/assets/{git-branch-DlUQMA-U.js → git-branch-B8JNwQ6q.js} +1 -1
  144. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-Db8GGxGr.js → gitGraphDiagram-PDYL7XHY-DoIc3lda.js} +1 -1
  145. package/dist/client/assets/{graph-BqwkokGk.js → graph-yizM0vwL.js} +1 -1
  146. package/dist/client/assets/{heart-CRoafWCm.js → heart-BavUIV45.js} +1 -1
  147. package/dist/client/assets/{highlighted-body-KPVGNVTW-D-QIuqsv.js → highlighted-body-KPVGNVTW-CGr3AgaU.js} +1 -1
  148. package/dist/client/assets/{image-lightbox-BZBT_ptW.js → image-lightbox-vgPEvSCc.js} +1 -1
  149. package/dist/client/assets/{image-off-Bc6AP3w0.js → image-off-C1uTDs9-.js} +1 -1
  150. package/dist/client/assets/{index-sCJ7YWzB.js → index-1QfQImuJ.js} +3 -3
  151. package/dist/client/assets/{index-CTFwtIJP.js → index-56EOd-zy.js} +1 -1
  152. package/dist/client/assets/{index-AxYQRAoO.js → index-7XeZCCDI.js} +1 -1
  153. package/dist/client/assets/{index-bSzhhjtG.js → index-B36osK_S.js} +1 -1
  154. package/dist/client/assets/{index-BHNwprrd.js → index-B446r3dL.js} +1 -1
  155. package/dist/client/assets/{index-Cpy9wOYc.js → index-BGo1YiUE.js} +1 -1
  156. package/dist/client/assets/{index-DV5hFlfw.js → index-BJEt9R_G.js} +1 -1
  157. package/dist/client/assets/{index-y1yAU07O.js → index-BKWJiERs.js} +1 -1
  158. package/dist/client/assets/{index-DfWZORsm.js → index-BO3yPJt-.js} +1 -1
  159. package/dist/client/assets/{index-Cs9yQ5zH.js → index-BOEPL6hN.js} +1 -1
  160. package/dist/client/assets/{index-CFV7Ggyj.js → index-BOhSPP-6.js} +1 -1
  161. package/dist/client/assets/{index-okP_lDUw.js → index-BkJlIXqM.js} +1 -1
  162. package/dist/client/assets/{index-zSj20f3H.js → index-Br6xDNvu.js} +1 -1
  163. package/dist/client/assets/{index-CNsZn6QE.js → index-C4t0UTU-.js} +1 -1
  164. package/dist/client/assets/{index-BeCzlnZ3.js → index-C8ZpJXTQ.js} +1 -1
  165. package/dist/client/assets/{index-Cx2slDvh.js → index-CJXMgnYp.js} +1 -1
  166. package/dist/client/assets/{index-CoFRHepD.js → index-CXBYgGja.js} +1 -1
  167. package/dist/client/assets/{index-a8LKmWxN.js → index-Cdod8zEY.js} +1 -1
  168. package/dist/client/assets/{index-CWfreKgt.js → index-CeDn1Ak1.js} +1 -1
  169. package/dist/client/assets/{index-Bw1l5I4w.js → index-CiGYtR9O.js} +1 -1
  170. package/dist/client/assets/{index-Hf3kLtiJ.js → index-CoKNU2F9.js} +1 -1
  171. package/dist/client/assets/{index-mrbr3BaJ.js → index-CoNMlH37.js} +1 -1
  172. package/dist/client/assets/{index-jIAsl-Y5.js → index-CrTmY12y.js} +2 -2
  173. package/dist/client/assets/{index-CMWttCLt.js → index-DE6uOpn4.js} +1 -1
  174. package/dist/client/assets/{index-CptdhVbC.js → index-DEiSJbvu.js} +1 -1
  175. package/dist/client/assets/{index-Dtb34mrg.js → index-DW4KUPHp.js} +1 -1
  176. package/dist/client/assets/{index-x0XGESNQ.js → index-DYEmUa5t.js} +1 -1
  177. package/dist/client/assets/index-Dag1qeZI.js +1 -0
  178. package/dist/client/assets/{index-CWx_JEio.js → index-Dcd4NqFB.js} +1 -1
  179. package/dist/client/assets/{index-Clr1ssap.js → index-Dm0Tav7v.js} +1 -1
  180. package/dist/client/assets/{index-CZ4wx2F3.js → index-DqkFtcGQ.js} +1 -1
  181. package/dist/client/assets/{index-eF6QtmU6.js → index-FI_y_dND.js} +1 -1
  182. package/dist/client/assets/{index-DMlo5rLX.js → index-FhWMRBQP.js} +1 -1
  183. package/dist/client/assets/{index-DDGc0Nfu.js → index-LwL5BpE4.js} +1 -1
  184. package/dist/client/assets/{index-B48IJBNm.js → index-OQuvRZTD.js} +250 -250
  185. package/dist/client/assets/{index-zIfhHvVv.js → index-QSXJR98z.js} +1 -1
  186. package/dist/client/assets/{index-78G8l1M7.js → index-SOKlO1zZ.js} +1 -1
  187. package/dist/client/assets/{index-Be3_cvW0.js → index-X282DRZf.js} +1 -1
  188. package/dist/client/assets/{index-BwOvHDL2.js → index-YSHcMqHa.js} +1 -1
  189. package/dist/client/assets/{index-DwyVu2Mh.js → index-ZR5f82z2.js} +1 -1
  190. package/dist/client/assets/index-eVrGefuq.js +1 -0
  191. package/dist/client/assets/{index-ByyXrDny.js → index-n_pnc-CO.js} +1 -1
  192. package/dist/client/assets/{index-B_i3pTpf.js → index-tgbcsB6H.js} +1 -1
  193. package/dist/client/assets/{index.esm-uC5dql6Q.js → index.esm-CAeUe7uQ.js} +1 -1
  194. package/dist/client/assets/{infoDiagram-MVDRKAX5-y6U3OQ5m.js → infoDiagram-MVDRKAX5-DweUdYSy.js} +1 -1
  195. package/dist/client/assets/{inline-code-BCFlKPIb.js → inline-code-SYHTKcle.js} +1 -1
  196. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-D32SA0vX.js → ishikawaDiagram-HPEHV2GE-DKNQIv7P.js} +1 -1
  197. package/dist/client/assets/{journeyDiagram-BOSHW7O7-D1X0dI8X.js → journeyDiagram-BOSHW7O7-DPD7F4VO.js} +1 -1
  198. package/dist/client/assets/{kanban-definition-FNSA4HC5-gU9KcKa4.js → kanban-definition-FNSA4HC5-B_uPSwxC.js} +1 -1
  199. package/dist/client/assets/{layers-A4MxcGWV.js → layers-F4mvrI2l.js} +1 -1
  200. package/dist/client/assets/{lightbulb-Dh2dYHMS.js → lightbulb-a6nNsrzy.js} +1 -1
  201. package/dist/client/assets/{link-2-qEUih2FP.js → link-2-yI2Tlm7Q.js} +1 -1
  202. package/dist/client/assets/{list-runtime-types-B1J9AtqH.js → list-runtime-types-CsGil5te.js} +1 -1
  203. package/dist/client/assets/{markdown-content-BA0KEJH_.js → markdown-content-Cjhsscbn.js} +1 -1
  204. package/dist/client/assets/{mention-pill-0aHe3D1A.js → mention-pill-BsOeTJ2f.js} +1 -1
  205. package/dist/client/assets/{mermaid.core-Birdr1kF.js → mermaid.core-9PwG-9fN.js} +4 -4
  206. package/dist/client/assets/{message-square-off-DvVenheW.js → message-square-off-aV4NMCjd.js} +1 -1
  207. package/dist/client/assets/{mindmap-definition-6OY57UG3-CLlh3nSF.js → mindmap-definition-6OY57UG3-BRbWmQkj.js} +1 -1
  208. package/dist/client/assets/{more-details-Bo2AAXHj.js → more-details-CRLU2HN4.js} +1 -1
  209. package/dist/client/assets/{owner-notice-DReCUEf1.js → owner-notice-CTJbhUak.js} +1 -1
  210. package/dist/client/assets/{package-CxZe6vve.js → package-sPggO7Dr.js} +1 -1
  211. package/dist/client/assets/{page-container-Bx1sr900.js → page-container-CnfDuiDC.js} +1 -1
  212. package/dist/client/assets/{pane-resize-handle-ojhYGmDs.js → pane-resize-handle-63OC5vfI.js} +1 -1
  213. package/dist/client/assets/{paperclip-D3-8ygf1.js → paperclip-WhPo3_WD.js} +1 -1
  214. package/dist/client/assets/{path-input-D_o1_pAa.js → path-input-C2KIXdON.js} +1 -1
  215. package/dist/client/assets/{pegDiagram-ECIUJNBX-BeMd_oXJ.js → pegDiagram-ECIUJNBX-Ct9Li_PA.js} +1 -1
  216. package/dist/client/assets/{pieDiagram-GNMPY74T-CXUXnp_A.js → pieDiagram-GNMPY74T-BAB5RA5v.js} +1 -1
  217. package/dist/client/assets/{plug-Du5LK0oZ.js → plug-_q5iqunq.js} +1 -1
  218. package/dist/client/assets/{primer-trigger-BxofQe1n.js → primer-trigger-B2tjuHBx.js} +1 -1
  219. package/dist/client/assets/{profile-errors-C0BgTjzk.js → profile-errors-COcBx7w5.js} +1 -1
  220. package/dist/client/assets/{progress-AKcr8opu.js → progress-77FCPL2y.js} +1 -1
  221. package/dist/client/assets/{quadrantDiagram-D57K4MC3-FTkKRlZm.js → quadrantDiagram-D57K4MC3-BqPJVmMS.js} +1 -1
  222. package/dist/client/assets/{query-error-state-CRmZMMkL.js → query-error-state-5236P3z0.js} +1 -1
  223. package/dist/client/assets/{radio-DQHR6Su5.js → radio-C8xmfoqO.js} +1 -1
  224. package/dist/client/assets/{railroadDiagram-Y72NRBL7-D5TdGrPg.js → railroadDiagram-Y72NRBL7-B8U11nT6.js} +1 -1
  225. package/dist/client/assets/{registry-BxY1lah6.js → registry-BzXBOE9h.js} +13 -13
  226. package/dist/client/assets/registry-sfhDu9q2.js +1 -0
  227. package/dist/client/assets/{relay-trace-schemas---fuhTF2.js → relay-trace-schemas-B80E4EUn.js} +1 -1
  228. package/dist/client/assets/{repeat-zL9y24zY.js → repeat-CHmB_vD7.js} +1 -1
  229. package/dist/client/assets/{requirementDiagram-EQYSW5RA-Dxiv9lE0.js → requirementDiagram-EQYSW5RA-CzJ1gzTh.js} +1 -1
  230. package/dist/client/assets/{room-files-source-B0WR4gIC.js → room-files-source-B0gc97Ri.js} +1 -1
  231. package/dist/client/assets/{rotate-ccw-clock-BUhy2_cF.js → rotate-ccw-clock-CCU6SVnv.js} +1 -1
  232. package/dist/client/assets/{rotate-cw-CCrNd4eJ.js → rotate-cw-B8WQa8O-.js} +1 -1
  233. package/dist/client/assets/{sankeyDiagram-SY24JHO5-C3jjstXq.js → sankeyDiagram-SY24JHO5-D4vQwyve.js} +1 -1
  234. package/dist/client/assets/{scroll-area-D6gNpFjK.js → scroll-area-FwZwM74Q.js} +1 -1
  235. package/dist/client/assets/{search-x-CUZ1LRYe.js → search-x-Q18Wm-C5.js} +1 -1
  236. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-CIDmjz0x.js → sequenceDiagram-BLEHNHQU-BVnIsPQe.js} +1 -1
  237. package/dist/client/assets/{shield-x-Ch7sY2XD.js → shield-x-ijIbRppV.js} +1 -1
  238. package/dist/client/assets/{signed-in-BQ44fFH5.js → signed-in-DEOMBWVX.js} +1 -1
  239. package/dist/client/assets/{sizeCapture-INFHLROL-Dkp-75Wy.js → sizeCapture-INFHLROL-DGb1rAJL.js} +1 -1
  240. package/dist/client/assets/{soul-file-CTFcpRMh.js → soul-file-CXgYs25S.js} +1 -1
  241. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-L_51UnwV.js → stateDiagram-v2-A6IESKWZ-DeX3IKTm.js} +1 -1
  242. package/dist/client/assets/{swimlanes-B3ENRKFQ-D-etAQQd.js → swimlanes-B3ENRKFQ-DN5ljYhG.js} +1 -1
  243. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-D8kHFWtL.js +8 -0
  244. package/dist/client/assets/{table-D6BUawIb.js → table-D9ww_3Ij.js} +1 -1
  245. package/dist/client/assets/{timeline-definition-JXYKGLGB-DNxnC3VG.js → timeline-definition-JXYKGLGB-DpRthC3r.js} +1 -1
  246. package/dist/client/assets/{trust-posture-5IWBJmA5.js → trust-posture-Dn2ciEE0.js} +1 -1
  247. package/dist/client/assets/{unplug-BVIT6OSL.js → unplug-BZ8zSvfB.js} +1 -1
  248. package/dist/client/assets/{unverified-catalog-notice-BA7_V-80.js → unverified-catalog-notice-CGy05tAO.js} +1 -1
  249. package/dist/client/assets/{use-bindings-DdWRXvtd.js → use-bindings-BLAWQRpe.js} +1 -1
  250. package/dist/client/assets/{use-composer-prefs-DC5w4eWw.js → use-composer-prefs-ICOpilWK.js} +1 -1
  251. package/dist/client/assets/{use-connector-management-DDlpD6tk.js → use-connector-management-DEMGZy9N.js} +1 -1
  252. package/dist/client/assets/{use-deep-link-scroll-Cvv0VcXx.js → use-deep-link-scroll-DxGYrks3.js} +1 -1
  253. package/dist/client/assets/{use-delete-binding-D585ISkL.js → use-delete-binding-Bnv3J5Fu.js} +1 -1
  254. package/dist/client/assets/{use-dev-links-BwS5hgur.js → use-dev-links-BOcktLiE.js} +1 -1
  255. package/dist/client/assets/{use-direct-message-panel--unflmj8.js → use-direct-message-panel-D38tSozW.js} +1 -1
  256. package/dist/client/assets/{use-external-adapter-catalog-DUyh1bH1.js → use-external-adapter-catalog-9qiNBqpc.js} +1 -1
  257. package/dist/client/assets/{use-full-activity-feed-DsNOIkL8.js → use-full-activity-feed-CtQquOBW.js} +1 -1
  258. package/dist/client/assets/use-is-below-desktop-CAGEAsCC.js +1 -0
  259. package/dist/client/assets/{use-local-browser-DGIut7R4.js → use-local-browser-B1huJhdg.js} +1 -1
  260. package/dist/client/assets/{use-mesh-topology-DNXD7seM.js → use-mesh-topology-BTYAy6zc.js} +1 -1
  261. package/dist/client/assets/{use-mounted-ref-7xoMthh4.js → use-mounted-ref-CaPc6Prv.js} +1 -1
  262. package/dist/client/assets/{use-notification-prefs-CzibxpTZ.js → use-notification-prefs-u76DPoP0.js} +1 -1
  263. package/dist/client/assets/use-pending-read-D0y6i7G9.js +1 -0
  264. package/dist/client/assets/{use-personality-commit-isaMS7W5.js → use-personality-commit-C3h8upDo.js} +1 -1
  265. package/dist/client/assets/{use-promo-activation-DesLEeyi.js → use-promo-activation-5HG08FlB.js} +1 -1
  266. package/dist/client/assets/{use-promo-dismissals-DQi8tey8.js → use-promo-dismissals-CO7-qhEl.js} +1 -1
  267. package/dist/client/assets/{use-pulse-freshness-DPplpvcq.js → use-pulse-freshness-D07Mv-Sa.js} +1 -1
  268. package/dist/client/assets/{use-room-follow-claim-C4UikQzz.js → use-room-follow-claim-DRQBuAIe.js} +1 -1
  269. package/dist/client/assets/{use-room-sessions-C6wsszcG.js → use-room-sessions-Bzk7rM40.js} +1 -1
  270. package/dist/client/assets/{use-roving-tab-list-DEh387tR.js → use-roving-tab-list-CcznVldj.js} +1 -1
  271. package/dist/client/assets/use-session-canvas-CpgE7tFb.js +27 -0
  272. package/dist/client/assets/{use-status-budget-CltxSIUD.js → use-status-budget-Xn2sIeM1.js} +2 -2
  273. package/dist/client/assets/{use-transform-CNLqlc2h.js → use-transform-ByJGn3hq.js} +1 -1
  274. package/dist/client/assets/{use-unclaimed-chats-DJyl7A1E.js → use-unclaimed-chats-C-z5fstJ.js} +1 -1
  275. package/dist/client/assets/use-update-config-L5NCTj3t.js +1 -0
  276. package/dist/client/assets/{useMutationState-BX-ggHVY.js → useMutationState-BF1EFtIZ.js} +1 -1
  277. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-2l6yZUUH.js → usecaseDiagram-WPOLBNNX-efVKbRIX.js} +1 -1
  278. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-DIOfjNDq.js → vennDiagram-Q3Y3IDCW-Bravmwce.js} +1 -1
  279. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-B5Hx1we8.js → wardleyDiagram-IVAIDKWA-fR77zByv.js} +1 -1
  280. package/dist/client/assets/{xychartDiagram-4URNHDU4-sy90CqIK.js → xychartDiagram-4URNHDU4-BphORSLh.js} +1 -1
  281. package/dist/client/index.html +1 -1
  282. package/dist/drizzle/20261030041403_dor3376_project_only_schedules.sql +1 -0
  283. package/dist/drizzle/meta/20261030041403_snapshot.json +14101 -0
  284. package/dist/drizzle/meta/_journal.json +7 -0
  285. package/dist/server/index.js +26499 -23006
  286. package/dist/server/index.js.map +2 -2
  287. package/package.json +6 -5
  288. package/dist/client/assets/ChannelComposer-BHxXoQwT.js +0 -44
  289. package/dist/client/assets/HandlePage-BciCIffv.js +0 -1
  290. package/dist/client/assets/NamePage-tBV32PJI.js +0 -1
  291. package/dist/client/assets/PhotoPage-DtX2GEvQ.js +0 -1
  292. package/dist/client/assets/UnreadDivider-C52_nmrB.js +0 -1
  293. package/dist/client/assets/WorkView-YozVoXhb.js +0 -51
  294. package/dist/client/assets/_shell.marketplace-Cp2Udmlv.js +0 -1
  295. package/dist/client/assets/_shell.marketplace_.sources-Dg0YgG-u.js +0 -1
  296. package/dist/client/assets/_shell.session-DyKnijqi.js +0 -1
  297. package/dist/client/assets/_shell.x._extensionId-BA0u_ZTU.js +0 -1
  298. package/dist/client/assets/_shell.x._extensionId_._-BA0u_ZTU.js +0 -1
  299. package/dist/client/assets/channel-CenDG0-I.js +0 -1
  300. package/dist/client/assets/index-DSt16Y0s.js +0 -1
  301. package/dist/client/assets/index-sZ8Dddnp.js +0 -1
  302. package/dist/client/assets/registry-CWK5lzYs.js +0 -1
  303. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-zjIBWGY4.js +0 -8
  304. package/dist/client/assets/use-is-below-desktop-C-4kc5lS.js +0 -1
  305. package/dist/client/assets/use-pending-read-BTR5-HXf.js +0 -1
  306. package/dist/client/assets/use-session-canvas-B2CM1KZu.js +0 -27
  307. package/dist/client/assets/use-update-config-B2rsDnxk.js +0 -1
@@ -1 +1 @@
1
- import{j as e,B as c,x,G as u,W as o}from"./index-B48IJBNm.js";const p=o("rounded-xl p-3",{variants:{tone:{muted:"bg-muted/50 text-muted-foreground",destructive:"bg-destructive/10 text-destructive"}},defaultVariants:{tone:"muted"}});function f({icon:n,headline:d,description:r,action:s,preview:t,tone:i,headingLevel:a,className:l}){const m=a?`h${a}`:"p";return e.jsxs("div",{"data-slot":"empty-state",className:u("flex flex-col items-center justify-center gap-3 p-12 text-center",l),children:[t&&e.jsx("div",{className:"pointer-events-none mb-4 w-full max-w-sm opacity-40 select-none",children:t}),e.jsx("div",{className:p({tone:i}),children:e.jsx(n,{className:"size-6","aria-hidden":!0})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(m,{className:"text-sm font-medium",children:d}),e.jsx("p",{className:"text-muted-foreground max-w-[280px] text-xs",children:r})]}),s&&e.jsxs(c,{size:"sm",variant:s.variant,onClick:s.onClick,disabled:s.disabled||s.busy,className:"mt-1",children:[s.busy&&e.jsx(x,{size:"xs"}),s.label]})]})}export{f as E};
1
+ import{j as e,B as c,x,G as u,W as o}from"./index-OQuvRZTD.js";const p=o("rounded-xl p-3",{variants:{tone:{muted:"bg-muted/50 text-muted-foreground",destructive:"bg-destructive/10 text-destructive"}},defaultVariants:{tone:"muted"}});function f({icon:n,headline:d,description:r,action:s,preview:t,tone:i,headingLevel:a,className:l}){const m=a?`h${a}`:"p";return e.jsxs("div",{"data-slot":"empty-state",className:u("flex flex-col items-center justify-center gap-3 p-12 text-center",l),children:[t&&e.jsx("div",{className:"pointer-events-none mb-4 w-full max-w-sm opacity-40 select-none",children:t}),e.jsx("div",{className:p({tone:i}),children:e.jsx(n,{className:"size-6","aria-hidden":!0})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(m,{className:"text-sm font-medium",children:d}),e.jsx("p",{className:"text-muted-foreground max-w-[280px] text-xs",children:r})]}),s&&e.jsxs(c,{size:"sm",variant:s.variant,onClick:s.onClick,disabled:s.disabled||s.busy,className:"mt-1",children:[s.busy&&e.jsx(x,{size:"xs"}),s.label]})]})}export{f as E};
@@ -1,4 +1,4 @@
1
- import{g as Ut}from"./chunk-XXDRQBXY-DeXzMeSy.js";import{s as Kt}from"./chunk-VQ5W62QI-COdK9J2i.js";import{_ as f,I as Tt,b as Zt,a as jt,s as qt,g as Wt,t as Ht,v as Qt,c as tt,l as F,k as Xt,A as Jt,z as $t,D as te,E as ee,F as se,K as ie,H as re,L as ae,q as ne,r as oe,u as le}from"./mermaid.core-Birdr1kF.js";import{s as ce}from"./transform-BqqRT-Iy.js";import{c as he}from"./channel-CenDG0-I.js";import"./index-B48IJBNm.js";import"./BlintzCanvas-fEMJgpNx.js";import"./index-zIfhHvVv.js";import"./index-sCJ7YWzB.js";var Ot=(function(){var s=f(function(G,n,h,d){for(h=h||{},d=G.length;d--;h[G[d]]=n);return h},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],l=[1,7],r=[1,9],c=[1,10],y=[1,11],g=[1,12],k=[1,30],N=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],x=[1,19],T=[1,28],I=[1,29],C=[1,20],D=[1,18],L=[1,21],w=[1,22],Nt=[2,6],u=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],q=[43,51,53,54,55,74,75],W=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],xt=[69,70,71,72,73],Ct=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,h,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:l,10:8,21:r,23:c,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:N,38:p,39:b,40:A,41:v,43:x,46:T,47:I,51:C,53:D,54:L,55:w},s(a,Nt,{1:[2,1]}),s(u,[2,3]),s(u,[2,4]),s(u,[2,5]),s(u,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(u,[2,26]),s(u,[2,27]),s(u,[2,28]),s(u,[2,29]),s(u,[2,30]),s(u,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(u,[2,36]),s(u,[2,37]),s(u,[2,38]),s(u,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:x,51:C,53:D,54:L,55:w},{10:51,43:x,51:C,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:x,51:C,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(q,[2,77]),s(q,[2,78]),s(q,[2,79]),s(q,[2,80]),s(q,[2,81]),s(u,[2,23]),s(u,[2,24]),s(u,[2,25]),{6:[1,63],7:5,8:6,9:l,10:8,21:r,23:c,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:N,38:p,39:b,40:A,41:v,43:x,46:T,47:I,51:C,53:D,54:L,55:w},{12:W,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:W,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(u,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(u,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(xt,[2,82]),s(xt,[2,83]),s(u,[2,31]),s(u,Nt),{6:st,9:it,35:90,45:Ct,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:W,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(u,[2,45],{45:B}),{6:st,9:it,35:95,45:Ct,50:rt},s(u,[2,32]),{10:97,36:96,43:x,51:C,53:D,54:L,55:w},s(u,[2,51]),s(u,[2,52]),s(u,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:x,51:C,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(u,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(u,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(u,[2,40]),{12:W,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(u,[2,46]),{10:115,20:[1,114],43:x,51:C,53:D,54:L,55:w},s(vt,[2,34]),s(u,[2,7]),s(u,[2,84]),s(u,[2,85]),s(u,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(u,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:W,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(u,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(u,[2,19]),s(u,[2,22],{16:[1,131],45:B}),s(u,[2,33]),s(u,[2,10]),{12:[1,132],45:B},s(u,[2,9]),s(yt,[2,73]),s(u,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(u,[2,20]),s(u,[2,8]),s(u,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,h){if(h.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=h,d}},"parseError"),parse:f(function(n){var h=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",ct=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=h.symbols_[S]||S),S}f(wt,"lex");for(var E,P,O,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?O=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),O=$[P]&&$[P][E]),typeof O>"u"||!O.length||!O[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(ct+1)+`:
1
+ import{g as Ut}from"./chunk-XXDRQBXY-C7IAIbvZ.js";import{s as Kt}from"./chunk-VQ5W62QI-B0LNYdif.js";import{_ as f,I as Tt,b as Zt,a as jt,s as qt,g as Wt,t as Ht,v as Qt,c as tt,l as F,k as Xt,A as Jt,z as $t,D as te,E as ee,F as se,K as ie,H as re,L as ae,q as ne,r as oe,u as le}from"./mermaid.core-9PwG-9fN.js";import{s as ce}from"./transform-BqqRT-Iy.js";import{c as he}from"./channel-B7zgJbnU.js";import"./index-OQuvRZTD.js";import"./BlintzCanvas-DruVZcDU.js";import"./index-QSXJR98z.js";import"./index-1QfQImuJ.js";var Ot=(function(){var s=f(function(G,n,h,d){for(h=h||{},d=G.length;d--;h[G[d]]=n);return h},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],l=[1,7],r=[1,9],c=[1,10],y=[1,11],g=[1,12],k=[1,30],N=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],x=[1,19],T=[1,28],I=[1,29],C=[1,20],D=[1,18],L=[1,21],w=[1,22],Nt=[2,6],u=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],q=[43,51,53,54,55,74,75],W=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],xt=[69,70,71,72,73],Ct=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,h,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:l,10:8,21:r,23:c,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:N,38:p,39:b,40:A,41:v,43:x,46:T,47:I,51:C,53:D,54:L,55:w},s(a,Nt,{1:[2,1]}),s(u,[2,3]),s(u,[2,4]),s(u,[2,5]),s(u,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(u,[2,26]),s(u,[2,27]),s(u,[2,28]),s(u,[2,29]),s(u,[2,30]),s(u,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(u,[2,36]),s(u,[2,37]),s(u,[2,38]),s(u,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:x,51:C,53:D,54:L,55:w},{10:51,43:x,51:C,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:x,51:C,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(q,[2,77]),s(q,[2,78]),s(q,[2,79]),s(q,[2,80]),s(q,[2,81]),s(u,[2,23]),s(u,[2,24]),s(u,[2,25]),{6:[1,63],7:5,8:6,9:l,10:8,21:r,23:c,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:N,38:p,39:b,40:A,41:v,43:x,46:T,47:I,51:C,53:D,54:L,55:w},{12:W,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:W,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(u,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(u,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(xt,[2,82]),s(xt,[2,83]),s(u,[2,31]),s(u,Nt),{6:st,9:it,35:90,45:Ct,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:W,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(u,[2,45],{45:B}),{6:st,9:it,35:95,45:Ct,50:rt},s(u,[2,32]),{10:97,36:96,43:x,51:C,53:D,54:L,55:w},s(u,[2,51]),s(u,[2,52]),s(u,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:x,51:C,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(u,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(u,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(u,[2,40]),{12:W,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(u,[2,46]),{10:115,20:[1,114],43:x,51:C,53:D,54:L,55:w},s(vt,[2,34]),s(u,[2,7]),s(u,[2,84]),s(u,[2,85]),s(u,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(u,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:W,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(u,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(u,[2,19]),s(u,[2,22],{16:[1,131],45:B}),s(u,[2,33]),s(u,[2,10]),{12:[1,132],45:B},s(u,[2,9]),s(yt,[2,73]),s(u,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(u,[2,20]),s(u,[2,8]),s(u,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,h){if(h.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=h,d}},"parseError"),parse:f(function(n){var h=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",ct=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=h.symbols_[S]||S),S}f(wt,"lex");for(var E,P,O,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?O=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),O=$[P]&&$[P][E]),typeof O>"u"||!O.length||!O[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(ct+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+ut.join(", ")+", got '"+(this.terminals_[E]||E)+"'":St="Parse error on line "+(ct+1)+": Unexpected "+(E==Lt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(St,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:mt,expected:ut})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(O[0]){case 1:d.push(E),_.push(m.yytext),t.push(m.yylloc),d.push(O[1]),E=null,Dt=m.yyleng,e=m.yytext,ct=m.yylineno,mt=m.yylloc;break;case 2:if(R=this.productions_[O[1]][1],U.$=_[_.length-R],U._$={first_line:t[t.length-(R||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(R||1)].first_column,last_column:t[t.length-1].last_column},Pt&&(U._$.range=[t[t.length-(R||1)].range[0],t[t.length-1].range[1]]),Et=this.performAction.apply(U,[e,Dt,ct,Y.yy,O[1],_,t].concat(Yt)),typeof Et<"u")return Et;R&&(d=d.slice(0,-1*R*2),_=_.slice(0,-1*R),t=t.slice(0,-1*R)),d.push(this.productions_[O[1]][0]),_.push(U.$),t.push(U._$),Vt=$[d[d.length-2]][d[d.length-1]],d.push(Vt);break;case 3:return!0}}return!0},"parse")},Gt=(function(){var G={EOF:1,parseError:f(function(h,d){if(this.yy.parser)this.yy.parser.parseError(h,d);else throw new Error(h)},"parseError"),setInput:f(function(n,h){return this.yy=h||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var h=n.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:f(function(n){var h=n.length,d=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===i.length?this.yylloc.first_column:0)+i[i.length-d.length].length-d[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(n){this.unput(this.match.slice(n))},"less"),pastInput:f(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var n=this.pastInput(),h=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{a6 as v,a7 as E}from"./index-B48IJBNm.js";const C={none:"None",minimal:"Minimal",low:"Low",medium:"Medium",high:"High",max:"Max",xhigh:"Extra high"};function D(n){return n?C[n]:"Default"}function w(n){return n&&n.length>0?n.map(e=>e.value):void 0}function x(n,e){var o;const i=n.runtime??e.defaultRuntime;if(!e.runtimeDeclaresCredits(i))return!1;if(i!==m)return((o=e.runtimeDefaultsToCredits)==null?void 0:o.call(e,i))??!1;if(!e.credits)return!1;const a=n.account??null;return a===v?e.credits.allowedAgents.includes(n.id):a===null&&e.credits.isDefault}const m="claude-code";function R(n){const{agent:e,defaultRuntime:i,serverDefaultModel:a,knownRuntimes:o,knownModels:c,knownAccounts:r,accountsUnavailable:h,modelSupportsEffort:g,runtimeSupportsEffort:p,runtimeLabel:f=E}=n,t=[],l=[],s=e.runtime??i,b=e.model??a??null,u=s===m&&h!==!0?e.account??null:null,d=u!==null?r==null?void 0:r.find(k=>k.id===u):void 0;return e.runtime!=null&&e.runtime!==i&&l.push({field:"runtime",label:f(e.runtime)}),e.model!=null&&l.push({field:"model",label:e.model}),e.effort!=null&&l.push({field:"effort",label:D(e.effort)}),u!==null&&l.push({field:"account",label:(d==null?void 0:d.label)??u}),o!==void 0&&!o.includes(s)?t.push({kind:"runtime-not-connected",message:`${f(s)} is not connected on this machine.`}):(e.model!=null&&c!==void 0&&!c.includes(e.model)&&t.push({kind:"model-unavailable",message:`${f(s)} no longer offers ${e.model}.`}),u!==null&&r!==void 0&&!d&&t.push({kind:"account-unregistered",message:`“${u}” isn’t on this computer. This agent runs on your default account.`})),e.effort!=null&&(p===!1?t.push({kind:"effort-unsupported-runtime",message:`${f(s)} has no effort setting. It’s ignored.`}):g===!1&&t.push({kind:"effort-unsupported-model",message:`${b??"This model"} does not take an effort setting.`})),{breakages:t,deviations:l,isException:t.length>0||l.length>0,isBroken:t.length>0}}export{x as a,R as d,D as e,w as k};
1
+ import{a6 as v,a7 as E}from"./index-OQuvRZTD.js";const C={none:"None",minimal:"Minimal",low:"Low",medium:"Medium",high:"High",max:"Max",xhigh:"Extra high"};function D(n){return n?C[n]:"Default"}function w(n){return n&&n.length>0?n.map(e=>e.value):void 0}function x(n,e){var o;const i=n.runtime??e.defaultRuntime;if(!e.runtimeDeclaresCredits(i))return!1;if(i!==m)return((o=e.runtimeDefaultsToCredits)==null?void 0:o.call(e,i))??!1;if(!e.credits)return!1;const a=n.account??null;return a===v?e.credits.allowedAgents.includes(n.id):a===null&&e.credits.isDefault}const m="claude-code";function R(n){const{agent:e,defaultRuntime:i,serverDefaultModel:a,knownRuntimes:o,knownModels:c,knownAccounts:r,accountsUnavailable:h,modelSupportsEffort:g,runtimeSupportsEffort:p,runtimeLabel:f=E}=n,t=[],l=[],s=e.runtime??i,b=e.model??a??null,u=s===m&&h!==!0?e.account??null:null,d=u!==null?r==null?void 0:r.find(k=>k.id===u):void 0;return e.runtime!=null&&e.runtime!==i&&l.push({field:"runtime",label:f(e.runtime)}),e.model!=null&&l.push({field:"model",label:e.model}),e.effort!=null&&l.push({field:"effort",label:D(e.effort)}),u!==null&&l.push({field:"account",label:(d==null?void 0:d.label)??u}),o!==void 0&&!o.includes(s)?t.push({kind:"runtime-not-connected",message:`${f(s)} is not connected on this machine.`}):(e.model!=null&&c!==void 0&&!c.includes(e.model)&&t.push({kind:"model-unavailable",message:`${f(s)} no longer offers ${e.model}.`}),u!==null&&r!==void 0&&!d&&t.push({kind:"account-unregistered",message:`“${u}” isn’t on this computer. This agent runs on your default account.`})),e.effort!=null&&(p===!1?t.push({kind:"effort-unsupported-runtime",message:`${f(s)} has no effort setting. It’s ignored.`}):g===!1&&t.push({kind:"effort-unsupported-model",message:`${b??"This model"} does not take an effort setting.`})),{breakages:t,deviations:l,isException:t.length>0||l.length>0,isBroken:t.length>0}}export{x as a,R as d,D as e,w as k};
@@ -1,4 +1,4 @@
1
- import{O as e}from"./index-B48IJBNm.js";/**
1
+ import{O as e}from"./index-OQuvRZTD.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{O as e}from"./index-B48IJBNm.js";/**
1
+ import{O as e}from"./index-OQuvRZTD.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{O as a}from"./index-B48IJBNm.js";/**
1
+ import{O as a}from"./index-OQuvRZTD.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{O as u,j as t,ap as h,G as y,fB as _,aW as N}from"./index-B48IJBNm.js";import{u as j,p as b,W as k,a as v}from"./WidgetErrorCard-BZkAK-Ke.js";import{C as E}from"./card-D9DO5nt4.js";/**
1
+ import{O as u,j as t,ap as h,G as y,fB as _,aW as N}from"./index-OQuvRZTD.js";import{u as j,p as b,W as k,a as v}from"./WidgetErrorCard-BlqaIsPK.js";import{C as E}from"./card-DUmTNXJJ.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{g as qt}from"./chunk-5VM5RSS4-Dxl-FvVz.js";import{g as Xt}from"./chunk-XXDRQBXY-DeXzMeSy.js";import{s as Qt}from"./chunk-VQ5W62QI-COdK9J2i.js";import{_ as m,p as Jt,l as te,c as Ae,q as Zt,r as $t,u as rt,b as e1,s as t1,t as s1,a as i1,g as r1,v as a1,k as n1,x as u1,J as o1,y as l1,z as st,A as c1,B as h1,D as d1,E as p1,F as f1,G as g1,H as b1}from"./mermaid.core-Birdr1kF.js";import{c as k1}from"./chunk-55XCU76K-CAA7du3_.js";import{s as it}from"./transform-BqqRT-Iy.js";import{p as A1}from"./BlintzCanvas-fEMJgpNx.js";import{c as m1}from"./channel-CenDG0-I.js";var C1="flowchart-",Pe,T1=(Pe=class{constructor(){this.vertexCounter=0,this.config=Ae(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=e1,this.setAccDescription=t1,this.setDiagramTitle=s1,this.getAccTitle=i1,this.getAccDescription=r1,this.getDiagramTitle=a1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return n1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const n of this.vertices.values())if(n.id===i)return this.diagramId?`${this.diagramId}-${n.domId}`:n.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,n,r,a,o,b,l={},k){var F,_;if(!i||i.trim().length===0)return;let u;if(k!==void 0){let B;k.includes(`
1
+ import{g as qt}from"./chunk-5VM5RSS4-C8IJ3zTR.js";import{g as Xt}from"./chunk-XXDRQBXY-C7IAIbvZ.js";import{s as Qt}from"./chunk-VQ5W62QI-B0LNYdif.js";import{_ as m,p as Jt,l as te,c as Ae,q as Zt,r as $t,u as rt,b as e1,s as t1,t as s1,a as i1,g as r1,v as a1,k as n1,x as u1,J as o1,y as l1,z as st,A as c1,B as h1,D as d1,E as p1,F as f1,G as g1,H as b1}from"./mermaid.core-9PwG-9fN.js";import{c as k1}from"./chunk-55XCU76K-CIazeRXO.js";import{s as it}from"./transform-BqqRT-Iy.js";import{p as A1}from"./BlintzCanvas-DruVZcDU.js";import{c as m1}from"./channel-B7zgJbnU.js";var C1="flowchart-",Pe,T1=(Pe=class{constructor(){this.vertexCounter=0,this.config=Ae(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=e1,this.setAccDescription=t1,this.setDiagramTitle=s1,this.getAccTitle=i1,this.getAccDescription=r1,this.getDiagramTitle=a1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return n1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const n of this.vertices.values())if(n.id===i)return this.diagramId?`${this.diagramId}-${n.domId}`:n.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,n,r,a,o,b,l={},k){var F,_;if(!i||i.trim().length===0)return;let u;if(k!==void 0){let B;k.includes(`
2
2
  `)?B=k+`
3
3
  `:B=`{
4
4
  `+k+`
@@ -1 +1 @@
1
- var et=t=>{throw TypeError(t)};var tt=(t,n,e)=>n.has(t)||et("Cannot "+e);var y=(t,n,e)=>(tt(t,n,"read from private field"),e?e.call(t):n.get(t)),N=(t,n,e)=>n.has(t)?et("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,e),k=(t,n,e,i)=>(tt(t,n,"write to private field"),i?i.call(t,e):n.set(t,e),e);var it=(t,n,e,i)=>({set _(r){k(t,n,r,e)},get _(){return y(t,n,i)}});import{r as C,lu as St,j as p,lv as pt,dp as ce,dq as he,I as yt,h0 as fe,h_ as me,h$ as Vt,eg as At,eh as Et,ei as wt,ej as It,ek as Ct,$ as Lt,gQ as Tt,eo as xt,B as Dt}from"./index-B48IJBNm.js";function kt({update:t,notify:n,unwatched:e}){return{link:i,unlink:r,propagate:h,checkDirty:s,shallowPropagate:a};function i(l,d,o){const f=d.depsTail;if(f!==void 0&&f.dep===l)return;const m=f!==void 0?f.nextDep:d.deps;if(m!==void 0&&m.dep===l){m.version=o,d.depsTail=m;return}const c=l.subsTail;if(c!==void 0&&c.version===o&&c.sub===d)return;const g=d.depsTail=l.subsTail={version:o,dep:l,sub:d,prevDep:f,nextDep:m,prevSub:c,nextSub:void 0};m!==void 0&&(m.prevDep=g),f!==void 0?f.nextDep=g:d.deps=g,c!==void 0?c.nextSub=g:l.subs=g}function r(l,d=l.sub){const o=l.dep,f=l.prevDep,m=l.nextDep,c=l.nextSub,g=l.prevSub;return m!==void 0?m.prevDep=f:d.depsTail=f,f!==void 0?f.nextDep=m:d.deps=m,c!==void 0?c.prevSub=g:o.subsTail=g,g!==void 0?g.nextSub=c:(o.subs=c)===void 0&&e(o),m}function h(l){let d=l.nextSub,o;e:do{const f=l.sub;let m=f.flags;if(m&60?m&12?m&4?!(m&48)&&u(l,f)?(f.flags=m|40,m&=1):m=0:f.flags=m&-9|32:m=0:f.flags=m|32,m&2&&n(f),m&1){const c=f.subs;if(c!==void 0){const g=(l=c).nextSub;g!==void 0&&(o={value:d,prev:o},d=g);continue}}if((l=d)!==void 0){d=l.nextSub;continue}for(;o!==void 0;)if(l=o.value,o=o.prev,l!==void 0){d=l.nextSub;continue e}break}while(!0)}function s(l,d){let o,f=0,m=!1;e:do{const c=l.dep,g=c.flags;if(d.flags&16)m=!0;else if((g&17)===17){if(t(c)){const v=c.subs;v.nextSub!==void 0&&a(v),m=!0}}else if((g&33)===33){(l.nextSub!==void 0||l.prevSub!==void 0)&&(o={value:l,prev:o}),l=c.deps,d=c,++f;continue}if(!m){const v=l.nextDep;if(v!==void 0){l=v;continue}}for(;f--;){const v=d.subs,S=v.nextSub!==void 0;if(S?(l=o.value,o=o.prev):l=v,m){if(t(d)){S&&a(v),d=l.sub;continue}m=!1}else d.flags&=-33;d=l.sub;const F=l.nextDep;if(F!==void 0){l=F;continue e}}return m}while(!0)}function a(l){do{const d=l.sub,o=d.flags;(o&48)===32&&(d.flags=o|16,(o&6)===2&&n(d))}while((l=l.nextSub)!==void 0)}function u(l,d){let o=d.depsTail;for(;o!==void 0;){if(o===l)return!0;o=o.prevDep}return!1}}function Ze(t,n,e){var h,s,a;const i=typeof t=="object",r=i?t:void 0;return{next:(h=i?t.next:t)==null?void 0:h.bind(r),error:(s=i?t.error:n)==null?void 0:s.bind(r),complete:(a=i?t.complete:e)==null?void 0:a.bind(r)}}const qe=[];let xe=0;const{link:st,unlink:Bt,propagate:jt,checkDirty:ft,shallowPropagate:rt}=kt({update(t){return t._update()},notify(t){qe[He++]=t,t.flags&=-3},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=17,je(t))}});let Ce=0,He=0,z,Xe=0;function _(t){try{++Xe,t()}finally{--Xe||mt()}}function je(t){const n=t.depsTail;let e=n!==void 0?n.nextDep:t.deps;for(;e!==void 0;)e=Bt(e,t)}function mt(){if(!(Xe>0)){for(;Ce<He;){const t=qe[Ce];qe[Ce++]=void 0,t.notify()}Ce=0,He=0}}function gt(t,n){const e=typeof t=="function",i=t,r={_snapshot:e?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:e?0:1,get(){return z!==void 0&&st(r,z,xe),r._snapshot},subscribe(h){const s=Ze(h),a={current:!1},u=Pt(()=>{var l;r.get(),a.current?(l=s.next)==null||l.call(s,r._snapshot):a.current=!0});return{unsubscribe:()=>{u.stop()}}},_update(h){const s=z,a=Object.is;if(e)z=r,++xe,r.depsTail=void 0;else if(h===void 0)return!1;e&&(r.flags=5);try{const u=r._snapshot,l=typeof h=="function"?h(u):h===void 0&&e?i(u):h;return u===void 0||!a(u,l)?(r._snapshot=l,!0):!1}finally{z=s,e&&(r.flags&=-5),je(r)}}};return e?(r.flags=17,r.get=function(){const h=r.flags;if(h&16||h&32&&ft(r.deps,r)){if(r._update()){const s=r.subs;s!==void 0&&rt(s)}}else h&32&&(r.flags=h&-33);return z!==void 0&&st(r,z,xe),r._snapshot}):r.set=function(h){if(r._update(h)){const s=r.subs;s!==void 0&&(jt(s),rt(s),mt())}},r}function Pt(t){const n=()=>{const i=z;z=e,++xe,e.depsTail=void 0,e.flags=6;try{return t()}finally{z=i,e.flags&=-5,je(e)}},e={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){const i=this.flags;i&16||i&32&&ft(this.deps,this)?n():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,je(this)}};return n(),e}var _t=class{constructor(t,n){this.atom=gt(t),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),n&&(this.actions=n(this))}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Ze(t))}},Rt=class{constructor(t){this.atom=gt(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Ze(t))}};function ie(t,n){return typeof t=="function"?new Rt(t):new _t(t)}var Nt=class{constructor(t,n){this.fn=t,this.options=n,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{const i=Date.now()-this.lastExecutionTime;if(this.options.leading&&i>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){const r=this.options.wait-i;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},r)}},this.execute=(...e)=>{var i,r;this.fn(...e),(r=(i=this.options).onExecute)==null||r.call(i,e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function Ot(t,n){return new Nt(t,n).maybeExecute}var ee,U,G,Ee,H,re,X,le,we,Re,te,ue,Q,Ie,de,Ne;class Gt{constructor({pluginId:n,debug:e=!1,enabled:i=!0,reconnectEveryMs:r=300}){N(this,ee,!0);N(this,U);N(this,G);N(this,Ee);N(this,H);N(this,re);N(this,X);N(this,le);N(this,we,0);N(this,Re,5);N(this,te,!1);N(this,ue,!1);N(this,Q,null);N(this,Ie,()=>{this.debugLog("Connected to event bus"),k(this,re,!0),k(this,te,!1),this.debugLog("Emitting queued events",y(this,H)),y(this,H).forEach(n=>this.emitEventToBus(n)),k(this,H,[]),this.stopConnectLoop(),y(this,G).call(this).removeEventListener("tanstack-connect-success",y(this,Ie))});N(this,de,()=>{if(y(this,we)<y(this,Re)){it(this,we)._++,this.dispatchCustomEvent("tanstack-connect",{});return}y(this,G).call(this).removeEventListener("tanstack-connect",y(this,de)),k(this,ue,!0),this.debugLog("Max retries reached, giving up on connection"),this.stopConnectLoop()});N(this,Ne,()=>{y(this,te)||(k(this,te,!0),y(this,G).call(this).addEventListener("tanstack-connect-success",y(this,Ie)),y(this,de).call(this))});k(this,U,n),k(this,ee,i),k(this,G,this.getGlobalTarget),k(this,Ee,e),this.debugLog(" Initializing event subscription for plugin",y(this,U)),k(this,H,[]),k(this,re,!1),k(this,ue,!1),k(this,X,null),k(this,le,r)}startConnectLoop(){y(this,X)!==null||y(this,re)||(this.debugLog(`Starting connect loop (every ${y(this,le)}ms)`),k(this,X,setInterval(y(this,de),y(this,le))))}stopConnectLoop(){k(this,te,!1),y(this,X)!==null&&(clearInterval(y(this,X)),k(this,X,null),k(this,H,[]),this.debugLog("Stopped connect loop"))}debugLog(...n){y(this,Ee)&&console.log(`🌴 [tanstack-devtools:${y(this,U)}-plugin]`,...n)}getGlobalTarget(){if(typeof globalThis<"u"&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog("Using global event target"),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<"u"&&typeof window.addEventListener<"u")return this.debugLog("Using window as event target"),window;const n=typeof EventTarget<"u"?new EventTarget:void 0;return typeof n>"u"||typeof n.addEventListener>"u"?(this.debugLog("No event mechanism available, running in non-web environment"),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog("Using new EventTarget as fallback"),n)}getPluginId(){return y(this,U)}dispatchCustomEventShim(n,e){try{const i=new Event(n,{detail:e});y(this,G).call(this).dispatchEvent(i)}catch{this.debugLog("Failed to dispatch shim event")}}dispatchCustomEvent(n,e){try{y(this,G).call(this).dispatchEvent(new CustomEvent(n,{detail:e}))}catch{this.dispatchCustomEventShim(n,e)}}emitEventToBus(n){this.debugLog("Emitting event to client bus",n),this.dispatchCustomEvent("tanstack-dispatch-event",n)}createEventPayload(n,e){return{type:`${y(this,U)}:${n}`,payload:e,pluginId:y(this,U)}}emit(n,e){if(!y(this,ee)){this.debugLog("Event bus client is disabled, not emitting event",n,e);return}if(y(this,Q)&&(this.debugLog("Emitting event to internal event target",n,e),y(this,Q).dispatchEvent(new CustomEvent(`${y(this,U)}:${n}`,{detail:this.createEventPayload(n,e)}))),y(this,ue)){this.debugLog("Previously failed to connect, not emitting to bus");return}if(!y(this,re)){this.debugLog("Bus not available, will be pushed as soon as connected"),y(this,H).push(this.createEventPayload(n,e)),typeof CustomEvent<"u"&&!y(this,te)&&(y(this,Ne).call(this),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(n,e))}on(n,e,i){const r=(i==null?void 0:i.withEventTarget)??!1,h=`${y(this,U)}:${n}`;if(r&&(y(this,Q)||k(this,Q,new EventTarget),y(this,Q).addEventListener(h,a=>{e(a.detail)})),!y(this,ee))return this.debugLog("Event bus client is disabled, not registering event",h),()=>{};const s=a=>{this.debugLog("Received event from bus",a.detail),e(a.detail)};return y(this,G).call(this).addEventListener(h,s),this.debugLog("Registered event to bus",h),()=>{var a;r&&((a=y(this,Q))==null||a.removeEventListener(h,s)),y(this,G).call(this).removeEventListener(h,s)}}onAll(n){if(!y(this,ee))return this.debugLog("Event bus client is disabled, not registering event"),()=>{};const e=i=>{const r=i.detail;n(r)};return y(this,G).call(this).addEventListener("tanstack-devtools-global",e),()=>y(this,G).call(this).removeEventListener("tanstack-devtools-global",e)}onAllPluginEvents(n){if(!y(this,ee))return this.debugLog("Event bus client is disabled, not registering event"),()=>{};const e=i=>{const r=i.detail;y(this,U)&&r.pluginId!==y(this,U)||n(r)};return y(this,G).call(this).addEventListener("tanstack-devtools-global",e),()=>y(this,G).call(this).removeEventListener("tanstack-devtools-global",e)}}ee=new WeakMap,U=new WeakMap,G=new WeakMap,Ee=new WeakMap,H=new WeakMap,re=new WeakMap,X=new WeakMap,le=new WeakMap,we=new WeakMap,Re=new WeakMap,te=new WeakMap,ue=new WeakMap,Q=new WeakMap,Ie=new WeakMap,de=new WeakMap,Ne=new WeakMap;class $t extends Gt{constructor(){super({pluginId:"form-devtools",reconnectEveryMs:1e3})}}const K=new $t;function ge(t,n){return typeof t=="function"?t(n):t}function oe(t,n){return Oe(n).reduce((i,r)=>{if(i===null)return null;if(typeof i<"u")return i[r]},t)}function be(t,n,e){const i=Oe(n);function r(h){if(!i.length)return ge(e,h);const s=i.shift();if(typeof s=="string"||typeof s=="number"&&!Array.isArray(h))return typeof h=="object"?(h===null&&(h={}),{...h,[s]:r(h[s])}):{[s]:r()};if(Array.isArray(h)&&typeof s=="number"){const a=h.slice(0,s);return[...a.length?a:new Array(s),r(h[s]),...h.slice(s+1)]}return[...new Array(s),r()]}return r(t)}function Wt(t,n){const e=Oe(n);function i(r){if(!r)return;if(e.length===1){const s=e[0];if(Array.isArray(r)&&typeof s=="number")return r.filter((l,d)=>d!==s);const{[s]:a,...u}=r;return u}const h=e.shift();if((typeof h=="string"||typeof h=="number"&&!Array.isArray(r))&&typeof r=="object")return{...r,[h]:i(r[h])};if(typeof h=="number"&&Array.isArray(r)){if(h>=r.length)return r;const s=r.slice(0,h);return[...s.length?s:new Array(h),i(r[h]),...r.slice(h+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return i(t)}const nt=46,Ge=91,$e=93,at=48,Ut=57;function Oe(t){if(Array.isArray(t))return[...t];if(typeof t!="string")throw new Error("Path must be a string.");const n=t.length,e=[];let i=n>0&&t.charCodeAt(0)===Ge?1:0,r=!0,h=-1;for(let s=i;s<=n;s++){const a=s<n?t.charCodeAt(s):-1;if(s===n||a===nt||a===Ge||a===$e){const u=s-i;if(u>0){const l=r&&(u===1||t.charCodeAt(i)!==at),d=t.slice(i,s);if(l){const o=parseInt(d,10);u<=15||String(o)===d?e.push(o):e.push(d)}else e.push(d)}else h!==$e&&!(h===-1&&a===$e)&&!(h===a&&(a===nt||a===Ge))&&e.push("");i=s+1,r=!0}else(a<at||a>Ut)&&(r=!1);h=a}return e.length||e.push(""),e}function ot(t,n){return t.length===0?n:n.length===0?t:n.startsWith("[")||n.startsWith(".")?t+n:`${t}.${n}`}function Kt(t){return!(Array.isArray(t)&&t.length===0)}function pe(t,n){const e=i=>i.validators.filter(Boolean).map(r=>({cause:r.cause,validate:r.fn}));return n.validationLogic({form:n.form,group:n.group,validators:n.validators,event:{type:t,fieldName:n.fieldName,async:!1},runValidation:e})}function ye(t,n){const{asyncDebounceMs:e}=n,{onBlurAsyncDebounceMs:i,onChangeAsyncDebounceMs:r,onDynamicAsyncDebounceMs:h}=n.validators||{},s=e??0,a=u=>u.validators.filter(Boolean).map(l=>{const d=(l==null?void 0:l.cause)||t;let o=s;switch(d){case"change":o=r??s;break;case"blur":o=i??s;break;case"dynamic":o=h??s;break;case"submit":o=0;break}return t==="submit"&&(o=0),{cause:d,validate:l.fn,debounceMs:o}});return n.validationLogic({form:n.form,group:n.group,validators:n.validators,event:{type:t,fieldName:n.fieldName,async:!0},runValidation:a})}const De=t=>!!t&&typeof t=="object"&&"fields"in t;function Z(t,n){if(Object.is(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;if(t instanceof Date&&n instanceof Date)return t.getTime()===n.getTime();if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(const[r,h]of t)if(!n.has(r)||!Object.is(h,n.get(r)))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;return!0}const e=Object.keys(t),i=Object.keys(n);if(e.length!==i.length||e.length===0&&!Array.isArray(t)&&!Array.isArray(n)&&(Object.getPrototypeOf(t)!==Object.prototype||Object.getPrototypeOf(n)!==Object.prototype))return!1;for(const r of e)if(!i.includes(r)||!Z(t[r],n[r]))return!1;return!0}const Qe=({newFormValidatorError:t,isPreviousErrorFromFormValidator:n,previousErrorValue:e})=>t?{newErrorValue:t,newSource:"form"}:n?{newErrorValue:void 0,newSource:void 0}:e?{newErrorValue:e,newSource:"field"}:{newErrorValue:void 0,newSource:void 0},Pe=({formLevelError:t,fieldLevelError:n})=>n?{newErrorValue:n,newSource:"field"}:t?{newErrorValue:t,newSource:"form"}:{newErrorValue:void 0,newSource:void 0};function $(t,n){return t==null?n:{...t,...n}}let se=256;const ke=[];let Le;for(;se--;)ke[se]=(se+256).toString(16).substring(1);function vt(){let t=0,n,e="";if(!Le||se+16>256){for(Le=new Array(256),t=256;t--;)Le[t]=256*Math.random()|0;t=0,se=0}for(;t<16;t++)n=Le[se+t],t===6?e+=ke[n&15|64]:t===8?e+=ke[n&63|128]:e+=ke[n],t&1&&t>1&&t<11&&(e+="-");return se++,e}const zt=Ot(t=>K.emit("form-state",{id:t.formId,state:t.store.state}),{wait:300});function Se(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(Array.isArray(t)){const e=[];for(let i=0;i<t.length;i++)e[i]=Se(t[i]);return e}if(t instanceof Map){const e=new Map;return t.forEach((i,r)=>{e.set(r,Se(i))}),e}if(t instanceof Set){const e=new Set;return t.forEach(i=>{e.add(Se(i))}),e}const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=Se(t[e]));return n}function ne(t,n){return n===t||n.startsWith(`${t}.`)||n.startsWith(`${t}[`)}const q=t=>{if(!t.validators)return t.runValidation({validators:[],form:t.form});const n=t.event.async,e=n?void 0:{fn:t.validators.onMount,cause:"mount"},i={fn:n?t.validators.onChangeAsync:t.validators.onChange,cause:"change"},r={fn:n?t.validators.onBlurAsync:t.validators.onBlur,cause:"blur"},h={fn:n?t.validators.onSubmitAsync:t.validators.onSubmit,cause:"submit"},s=n?void 0:{fn:()=>{},cause:"server"};switch(t.event.type){case"mount":return t.runValidation({validators:[e],form:t.form});case"submit":return t.runValidation({validators:[i,r,h,s],form:t.form});case"server":return t.runValidation({validators:[],form:t.form});case"blur":return t.runValidation({validators:[r,s],form:t.form});case"change":return t.runValidation({validators:[i,s],form:t.form});default:throw new Error(`Unknown validation event type: ${t.event.type}`)}};function qt(t,n){const e=new Map;for(const i of t){const r=i.path??[];let h=n,s="";for(let a=0;a<r.length;a++){const u=r[a];if(u===void 0)continue;const l=typeof u=="object"?u.key:u,d=Number(l);Array.isArray(h)&&!Number.isNaN(d)?s+=`[${d}]`:s+=(a>0?".":"")+String(l),typeof h=="object"&&h!==null?h=h[l]:h=void 0}e.set(s,(e.get(s)??[]).concat(i))}return Object.fromEntries(e)}const lt=(t,n)=>{const e=qt(t,n);return{form:e,fields:e}},ae={validate({value:t,validationSource:n},e){const i=e["~standard"].validate(t);if(i instanceof Promise)throw new Error("async function passed to sync validator");if(i.issues)return n==="field"?i.issues:lt(i.issues,t)},async validateAsync({value:t,validationSource:n},e){const i=await e["~standard"].validate(t);if(i.issues)return n==="field"?i.issues:lt(i.issues,t)}},Je=t=>!!t&&"~standard"in t,O={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function Y(t){function n(o){const f=t.getFieldMeta(o)??O;t.setFieldMeta(o,{...f,_arrayVersion:(f._arrayVersion||0)+1})}function e(o,f,m){n(o);const c=a(o,f,"move",m),g=Math.min(f,m),v=Math.max(f,m);for(let F=g;F<=v;F++)c.push(s(o,F));const S=Object.keys(t.fieldInfo).reduce((F,M)=>(M.startsWith(s(o,f))&&F.set(M,t.getFieldMeta(M)),F),new Map);l(c,f<m?"up":"down"),Object.keys(t.fieldInfo).filter(F=>F.startsWith(s(o,m))).forEach(F=>{const M=F.replace(s(o,m),s(o,f)),V=S.get(M);V&&t.setFieldMeta(F,V)})}function i(o,f){n(o);const m=a(o,f,"remove");l(m,"up")}function r(o,f,m){n(o),a(o,f,"swap",m).forEach(g=>{if(!g.toString().startsWith(s(o,f)))return;const v=g.toString().replace(s(o,f),s(o,m)),[S,F]=[t.getFieldMeta(g),t.getFieldMeta(v)];S&&t.setFieldMeta(v,S),F&&t.setFieldMeta(g,F)})}function h(o,f){n(o);const m=a(o,f,"insert");l(m,"down"),m.forEach(c=>{c.toString().startsWith(s(o,f))&&t.setFieldMeta(c,d())})}function s(o,f){return`${o}[${f}]`}function a(o,f,m,c){const g=[s(o,f)];switch(m){case"swap":g.push(s(o,c));break;case"move":{const[v,S]=[Math.min(f,c),Math.max(f,c)];for(let F=v;F<=S;F++)g.push(s(o,F));break}default:{const v=t.getFieldValue(o),S=Array.isArray(v)?v.length:0;for(let F=f+1;F<S;F++)g.push(s(o,F));break}}return Object.keys(t.fieldInfo).filter(v=>g.some(S=>v.startsWith(S)))}function u(o,f){return o.replace(/\[(\d+)\]/,(m,c)=>{const g=parseInt(c,10);return`[${f==="up"?g+1:Math.max(0,g-1)}]`})}function l(o,f){(f==="up"?o:[...o].reverse()).forEach(c=>{const g=u(c.toString(),f),v=t.getFieldMeta(g);v?t.setFieldMeta(c,v):t.setFieldMeta(c,d())})}const d=()=>O;return{bumpArrayVersion:n,handleArrayMove:e,handleArrayRemove:i,handleArraySwap:r,handleArrayInsert:h}}function We(t){return{values:t.values??{},errorMap:t.errorMap??{},fieldMetaBase:t.fieldMetaBase??{},formGroupStateBase:t.formGroupStateBase??{},isSubmitted:t.isSubmitted??!1,isSubmitting:t.isSubmitting??!1,isValidating:t.isValidating??!1,submissionAttempts:t.submissionAttempts??0,isSubmitSuccessful:t.isSubmitSuccessful??!1,validationMetaMap:t.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}class ut{constructor(n){var h;this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{var f,m;const s=this.store.subscribe(()=>{zt(this)}),a=K.on("request-form-state",c=>{c.payload.id===this._formId&&K.emit("form-api",{id:this._formId,state:this.store.state,options:this.options})}),u=K.on("request-form-reset",c=>{c.payload.id===this._formId&&this.reset()}),l=K.on("request-form-force-submit",c=>{c.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),d=()=>{l(),u(),a(),s.unsubscribe(),K.emit("form-unmounted",{id:this._formId})};(m=(f=this.options.listeners)==null?void 0:f.onMount)==null||m.call(f,{formApi:this});const{onMount:o}=this.options.validators||{};return K.emit("form-api",{id:this._formId,state:this.store.state,options:this.options}),o&&this.validateSync("mount"),d},this.update=s=>{if(!s)return;const a=this.options;this.options=s;const u=s.defaultValues&&!Z(s.defaultValues,a.defaultValues)&&!this.state.isTouched,l=!Z(s.defaultState,a.defaultState)&&!this.state.isTouched;if(!(!u&&!l)){if(_(()=>{this.baseStore.setState(()=>We(Object.assign({},this.state,l?s.defaultState:{},u?{values:s.defaultValues}:{})))}),u){const d=Y(this);for(const o of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(o))&&d.bumpArrayVersion(o)}K.emit("form-api",{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(s,a)=>{const{fieldMeta:u}=this.state,l=this.resetFieldMeta(u);s&&!(a!=null&&a.keepDefaultValues)&&(this.options={...this.options,defaultValues:s}),this.baseStore.setState(()=>{var o;let d=s??this.options.defaultValues??((o=this.options.defaultState)==null?void 0:o.values);return s||Object.values(this.fieldInfo).forEach(f=>{f.instance&&f.instance.options.defaultValue!==void 0&&(d=be(d,f.instance.name,f.instance.options.defaultValue))}),We({...this.options.defaultState,values:d,fieldMetaBase:l})})},this.validateAllFields=async s=>{const a=[];return _(()=>{Object.values(this.fieldInfo).forEach(l=>{if(!l.instance)return;const d=l.instance;a.push(Promise.resolve().then(()=>d.validate(s,{skipFormValidation:!0,skipGroupValidation:!0}))),l.instance.store.state.meta.isTouched||l.instance.setMeta(o=>({...o,isTouched:!0}))})}),(await Promise.all(a)).flat()},this.validateArrayFieldsStartingFrom=async(s,a,u)=>{const l=this.getFieldValue(s),d=Array.isArray(l)?Math.max(l.length-1,0):null,o=[`${s}[${a}]`];for(let g=a+1;g<=(d??0);g++)o.push(`${s}[${g}]`);const f=Object.keys(this.fieldInfo).filter(g=>o.some(v=>g.startsWith(v))),m=[];return _(()=>{f.forEach(g=>{m.push(Promise.resolve().then(()=>this.validateField(g,u)))})}),(await Promise.all(m)).flat()},this.validateField=(s,a)=>{var l,d;const u=(l=this.fieldInfo[s])==null?void 0:l.instance;if(!u){const{hasErrored:o}=this.validateSync(a);return o&&!this.options.asyncAlways?((d=this.getFieldMeta(s))==null?void 0:d.errors)??[]:this.validateAsync(a).then(()=>{var f;return((f=this.getFieldMeta(s))==null?void 0:f.errors)??[]})}return u.store.state.meta.isTouched||u.setMeta(o=>({...o,isTouched:!0})),u.validate(a)},this.validateSync=(s,a)=>{const u=pe(s,{...this.options,form:this,group:a==null?void 0:a.group,validationLogic:this.options.validationLogic||q});let l=!1;const d={};return _(()=>{var m,c,g;for(const v of u){if(!v.validate)continue;const S=this.runValidator({validate:v.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:F,fieldErrors:M}=Be(S),V=Fe(v.cause);let w=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(M||{})]);a!=null&&a.filterFieldNames&&(w=new Set([...w].filter(a.filterFieldNames)));for(const b of w){if(this.baseStore.state.fieldMetaBase[b]===void 0&&!(M!=null&&M[b]))continue;const L=this.getFieldMeta(b)??O,{errorMap:E,errorSourceMap:A}=L,D=M==null?void 0:M[b],{newErrorValue:j,newSource:T}=Qe({newFormValidatorError:D,isPreviousErrorFromFormValidator:(A==null?void 0:A[V])==="form",previousErrorValue:E==null?void 0:E[V]});T==="form"&&(d[b]={...d[b],[V]:D}),(E==null?void 0:E[V])!==j&&this.setFieldMeta(b,(I=O)=>({...I,errorMap:{...I.errorMap,[V]:j},errorSourceMap:{...I.errorSourceMap,[V]:T}}))}a!=null&&a.dontUpdateFormErrorMap||((m=this.state.errorMap)==null?void 0:m[V])!==F&&this.baseStore.setState(b=>({...b,errorMap:{...b.errorMap,[V]:F}})),(F||M)&&(l=!0)}if(a!=null&&a.dontUpdateFormErrorMap)return;const o=Fe("submit");(c=this.state.errorMap)!=null&&c[o]&&s!=="submit"&&!l&&this.baseStore.setState(v=>({...v,errorMap:{...v.errorMap,[o]:void 0}}));const f=Fe("server");(g=this.state.errorMap)!=null&&g[f]&&s!=="server"&&!l&&this.baseStore.setState(v=>({...v,errorMap:{...v.errorMap,[f]:void 0}}))}),{hasErrored:l,fieldsErrorMap:d}},this.validateAsync=async(s,a)=>{const u=ye(s,{...this.options,form:this,group:a==null?void 0:a.group,validationLogic:this.options.validationLogic||q});this.state.isFormValidating||this.baseStore.setState(m=>({...m,isFormValidating:!0}));const l=[];let d;for(const m of u){if(!m.validate)continue;const c=Fe(m.cause),g=this.state.validationMetaMap[c];g==null||g.lastAbortController.abort();const v=new AbortController;this.state.validationMetaMap[c]={lastAbortController:v},l.push(new Promise(async S=>{let F;try{F=await new Promise((E,A)=>{setTimeout(async()=>{if(v.signal.aborted)return E(void 0);try{E(await this.runValidator({validate:m.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:v.signal},type:"validateAsync"}))}catch(D){A(D)}},m.debounceMs)})}catch(E){F=E}const{formError:M,fieldErrors:V}=Be(F);V&&(d=d?{...d,...V}:V);const w=Fe(m.cause),b=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(d||{})]);let L=Array.from(b);a!=null&&a.filterFieldNames&&(L=L.filter(a.filterFieldNames));for(const E of L){if(this.baseStore.state.fieldMetaBase[E]===void 0&&!(d!=null&&d[E]))continue;const A=this.getFieldMeta(E)??O,{errorMap:D,errorSourceMap:j}=A,T=d==null?void 0:d[E],{newErrorValue:I,newSource:P}=Qe({newFormValidatorError:T,isPreviousErrorFromFormValidator:(j==null?void 0:j[w])==="form",previousErrorValue:D==null?void 0:D[w]});(D==null?void 0:D[w])!==I&&this.setFieldMeta(E,(R=O)=>({...R,errorMap:{...R.errorMap,[w]:I},errorSourceMap:{...R.errorSourceMap,[w]:P}}))}a!=null&&a.dontUpdateFormErrorMap||this.baseStore.setState(E=>({...E,errorMap:{...E.errorMap,[w]:M}})),S(d?{fieldErrors:d,errorMapKey:w}:void 0)}))}let o=[];const f={};if(l.length){o=await Promise.all(l);for(const m of o)if(m!=null&&m.fieldErrors){const{errorMapKey:c}=m;for(const[g,v]of Object.entries(m.fieldErrors)){const F={...f[g]||{},[c]:v};f[g]=F}}}return this.baseStore.setState(m=>({...m,isFormValidating:!1})),f},this.validate=(s,a)=>{const{hasErrored:u,fieldsErrorMap:l}=this.validateSync(s,a);return u&&!this.options.asyncAlways?l:this.validateAsync(s,a)},this._handleSubmit=async s=>{var l,d,o,f,m,c,g,v,S,F;this.baseStore.setState(M=>({...M,isSubmitted:!1,submissionAttempts:M.submissionAttempts+1,isSubmitSuccessful:!1})),_(()=>{Object.values(this.fieldInfo).forEach(M=>{M.instance&&(M.instance.store.state.meta.isTouched||M.instance.setMeta(V=>({...V,isTouched:!0})))})});const a=s??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){(d=(l=this.options).onSubmitInvalid)==null||d.call(l,{value:this.state.values,formApi:this,meta:a});return}this.baseStore.setState(M=>({...M,isSubmitting:!0}));const u=()=>{this.baseStore.setState(M=>({...M,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){u(),(f=(o=this.options).onSubmitInvalid)==null||f.call(o,{value:this.state.values,formApi:this,meta:a}),K.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"validateAllFields",errors:Object.values(this.state.fieldMeta).map(M=>M.errors).flat()});return}if(await this.validate("submit"),!this.state.isValid){u(),(c=(m=this.options).onSubmitInvalid)==null||c.call(m,{value:this.state.values,formApi:this,meta:a}),K.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"validate",errors:this.state.errors});return}_(()=>{Object.values(this.fieldInfo).forEach(M=>{var V;(V=M.instance)==null||V.triggerOnSubmitListener()})}),(v=(g=this.options.listeners)==null?void 0:g.onSubmit)==null||v.call(g,{formApi:this,meta:a});try{await((F=(S=this.options).onSubmit)==null?void 0:F.call(S,{value:this.state.values,formApi:this,meta:a})),_(()=>{this.baseStore.setState(M=>({...M,isSubmitted:!0,isSubmitSuccessful:!0})),K.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),u()})}catch(M){throw this.baseStore.setState(V=>({...V,isSubmitSuccessful:!1})),K.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"inflight",onError:M}),u(),M}},this.getFieldValue=s=>oe(this.state.values,s),this.getFieldMeta=s=>this.state.fieldMeta[s],this.getFormGroupMeta=s=>this.formGroupMetaDerived.state[s],this.getFieldInfo=s=>{var a;return(a=this.fieldInfo)[s]||(a[s]={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}})},this.setFieldMeta=(s,a)=>{this.baseStore.setState(u=>({...u,fieldMetaBase:{...u.fieldMetaBase,[s]:ge(a,u.fieldMetaBase[s])}}))},this.resetFieldMeta=s=>Object.keys(s).reduce((a,u)=>{const l=u;return a[l]=O,a},{}),this.setFieldValue=(s,a,u)=>{var f;const l=(u==null?void 0:u.dontUpdateMeta)??!1,d=(u==null?void 0:u.dontRunListeners)??!1,o=(u==null?void 0:u.dontValidate)??!1;_(()=>{l||this.setFieldMeta(s,m=>({...m,isTouched:!0,isDirty:!0,errorMap:{...m==null?void 0:m.errorMap,onMount:void 0}})),this.baseStore.setState(m=>({...m,values:be(m.values,s,a)}))}),d||(f=this.getFieldInfo(s).instance)==null||f.triggerOnChangeListener(),o||this.validateField(s,"change")},this.deleteField=s=>{const u=[...Object.keys(this.fieldInfo).filter(l=>{const d=s.toString();return l.startsWith(`${d}.`)||l.startsWith(`${d}[`)}),s];this.baseStore.setState(l=>{const d={...l};return u.forEach(o=>{d.values=Wt(d.values,o),delete this.fieldInfo[o],delete d.fieldMetaBase[o]}),d})},this.pushFieldValue=(s,a,u)=>{this.setFieldValue(s,l=>[...Array.isArray(l)?l:[],a],u),Y(this).bumpArrayVersion(s)},this.insertFieldValue=async(s,a,u,l)=>{this.setFieldValue(s,o=>[...o.slice(0,a),u,...o.slice(a)],$(l,{dontValidate:!0}));const d=(l==null?void 0:l.dontValidate)??!1;d||await this.validateField(s,"change"),Y(this).handleArrayInsert(s,a),d||await this.validateArrayFieldsStartingFrom(s,a,"change")},this.replaceFieldValue=async(s,a,u,l)=>{this.setFieldValue(s,o=>o.map((f,m)=>m===a?u:f),$(l,{dontValidate:!0})),Y(this).bumpArrayVersion(s),((l==null?void 0:l.dontValidate)??!1)||(await this.validateField(s,"change"),await this.validateArrayFieldsStartingFrom(s,a,"change"))},this.removeFieldValue=async(s,a,u)=>{const l=this.getFieldValue(s),d=Array.isArray(l)?Math.max(l.length-1,0):null;if(this.setFieldValue(s,f=>f.filter((m,c)=>c!==a),$(u,{dontValidate:!0})),Y(this).handleArrayRemove(s,a),d!==null){const f=`${s}[${d}]`;this.deleteField(f)}((u==null?void 0:u.dontValidate)??!1)||(await this.validateField(s,"change"),await this.validateArrayFieldsStartingFrom(s,a,"change"))},this.swapFieldValues=(s,a,u,l)=>{this.setFieldValue(s,o=>{const f=o[a],m=o[u];return be(be(o,`${a}`,m),`${u}`,f)},$(l,{dontValidate:!0})),Y(this).handleArraySwap(s,a,u),((l==null?void 0:l.dontValidate)??!1)||(this.validateField(s,"change"),this.validateField(`${s}[${a}]`,"change"),this.validateField(`${s}[${u}]`,"change"))},this.moveFieldValues=(s,a,u,l)=>{this.setFieldValue(s,o=>{const f=[...o];return f.splice(u,0,f.splice(a,1)[0]),f},$(l,{dontValidate:!0})),Y(this).handleArrayMove(s,a,u),((l==null?void 0:l.dontValidate)??!1)||(this.validateField(s,"change"),this.validateField(`${s}[${a}]`,"change"),this.validateField(`${s}[${u}]`,"change"))},this.clearFieldValues=(s,a)=>{const u=this.getFieldValue(s),l=Array.isArray(u)?Math.max(u.length-1,0):null;if(this.setFieldValue(s,[],$(a,{dontValidate:!0})),Y(this).bumpArrayVersion(s),l!==null)for(let o=0;o<=l;o++){const f=`${s}[${o}]`;this.deleteField(f)}((a==null?void 0:a.dontValidate)??!1)||this.validateField(s,"change")},this.resetField=s=>{this.baseStore.setState(a=>{var o;const u=(o=this.getFieldInfo(s).instance)==null?void 0:o.options.defaultValue,l=oe(this.options.defaultValues,s),d=u??l;return{...a,fieldMetaBase:{...a.fieldMetaBase,[s]:O},values:d!==void 0?be(a.values,s,d):a.values}})},this.setErrorMap=s=>{_(()=>{Object.entries(s).forEach(([a,u])=>{const l=a;if(De(u)){const{formError:d,fieldErrors:o}=Be(u);for(const f of Object.keys(this.fieldInfo))this.getFieldMeta(f)&&this.setFieldMeta(f,c=>({...c,errorMap:{...c.errorMap,[l]:o==null?void 0:o[f]},errorSourceMap:{...c.errorSourceMap,[l]:"form"}}));this.baseStore.setState(f=>({...f,errorMap:{...f.errorMap,[l]:d}}))}else this.baseStore.setState(d=>({...d,errorMap:{...d.errorMap,[l]:u}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((s,[a,u])=>(Object.keys(u).length&&u.errors.length&&(s[a]={errors:u.errors,errorMap:u.errorMap}),s),{})}),this.parseValuesWithSchema=s=>ae.validate({value:this.state.values,validationSource:"form"},s),this.parseValuesWithSchemaAsync=s=>ae.validateAsync({value:this.state.values,validationSource:"form"},s),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=(n==null?void 0:n.formId)??vt(),this._devtoolsSubmissionOverride=!1;let e=We({...n==null?void 0:n.defaultState,values:(n==null?void 0:n.defaultValues)??((h=n==null?void 0:n.defaultState)==null?void 0:h.values)});if(n!=null&&n.transform){e=n.transform({state:e}).state;for(const s of Object.keys(e.errorMap)){const a=e.errorMap[s];if(!(a===void 0||!De(a)))for(const u of Object.keys(a.fields)){const l=a.fields[u];if(l===void 0)continue;const d=e.fieldMetaBase[u];e.fieldMetaBase[u]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...d??{},errorSourceMap:{...(d==null?void 0:d.errorSourceMap)??{},onChange:"form"},errorMap:{...(d==null?void 0:d.errorMap)??{},[s]:l}}}}}this.baseStore=ie(e);let i;this.fieldMetaDerived=ie(s=>{var d,o,f;const a=this.baseStore.get();let u=0;const l={};for(const m of Object.keys(a.fieldMetaBase)){const c=a.fieldMetaBase[m],g=i==null?void 0:i.fieldMetaBase[m],v=s==null?void 0:s[m],S=oe(a.values,m);let F=v==null?void 0:v.errors;if(!g||c.errorMap!==g.errorMap){F=Object.values(c.errorMap??{}).filter(L=>L!==void 0);const b=(d=this.getFieldInfo(m))==null?void 0:d.instance;(!b||!b.options.disableErrorFlat)&&(F=F.flat(1))}const M=!Kt(F),V=!c.isDirty,w=Z(S,((f=(o=this.getFieldInfo(m))==null?void 0:o.instance)==null?void 0:f.options.defaultValue)??oe(this.options.defaultValues,m));if(v&&v.isPristine===V&&v.isValid===M&&v.isDefaultValue===w&&v.errors===F&&c===g){l[m]=v,u++;continue}l[m]={...c,errors:F??[],isPristine:V,isValid:M,isDefaultValue:w}}return Object.keys(a.fieldMetaBase).length?s&&u===Object.keys(a.fieldMetaBase).length?s:(i=this.baseStore.get(),l):l}),this.formGroupMetaDerived=ie(s=>{const a=this.baseStore.get(),u=this.fieldMetaDerived.get(),l={};for(const d of this.formGroupApis){const o=d.name,f=a.formGroupStateBase[o]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},m=u[o];let c=!1,g=!0,v=!1,S=!1,F=!0,M=!1;for(const W in u){if(W===o||!ne(o,W))continue;const B=u[W];B&&(B.isValidating&&(c=!0),B.isValid||(g=!1),B.isTouched&&(v=!0),B.isBlurred&&(S=!0),B.isDefaultValue||(F=!1),B.isDirty&&(M=!0))}const V=!M,w=!!c||f.isValidating,b=(m==null?void 0:m.errorMap)??{},L=(m==null?void 0:m.errorSourceMap)??{},E=!!(b.onMount||Object.entries(u).some(([W,B])=>B&&W!==o&&ne(o,W)&&B.errorMap.onMount)),A=s==null?void 0:s[o];let D=(A==null?void 0:A.errors)??[];(!A||A.__srcErrorMap!==b)&&(D=Object.values(b).reduce((W,B)=>{if(B===void 0)return W;if(B&&typeof B=="object"&&"fields"in B){const Ye=B.group;return Ye!==void 0&&W.push(Ye),W}return W.push(B),W},[]));const j=D.length===0,T=g&&j,I=d.options.canSubmitWhenInvalid??!1,P=f.submissionAttempts===0&&!v&&!E||!w&&!f.isSubmitting&&T||I;if(A&&A.errorMap===b&&A.errorSourceMap===L&&A.errors===D&&A.isFieldsValidating===c&&A.isFieldsValid===g&&A.isGroupValid===j&&A.isValid===T&&A.canSubmit===P&&A.isTouched===v&&A.isBlurred===S&&A.isPristine===V&&A.isDefaultValue===F&&A.isDirty===M&&A.isValidating===w&&A.isSubmitting===f.isSubmitting&&A.isSubmitted===f.isSubmitted&&A.submissionAttempts===f.submissionAttempts&&A.isSubmitSuccessful===f.isSubmitSuccessful){l[o]=A;continue}const R={...f,errorMap:b,errorSourceMap:L,_arrayVersion:(m==null?void 0:m._arrayVersion)??0,isTouched:v,isBlurred:S,isDirty:M,isPristine:V,isDefaultValue:F,isValid:T,errors:D,isValidating:w,isFieldsValidating:c,isFieldsValid:g,isGroupValid:j,canSubmit:P};Object.defineProperty(R,"__srcErrorMap",{value:b,enumerable:!1,configurable:!0}),l[o]=R}return l});let r;this.store=ie(s=>{var j,T;const a=this.baseStore.get(),u=this.fieldMetaDerived.get(),l=Object.values(u).filter(Boolean),d=l.some(I=>I.isValidating),o=l.every(I=>I.isValid),f=l.some(I=>I.isTouched),m=l.some(I=>I.isBlurred),c=l.every(I=>I.isDefaultValue),g=f&&((j=a.errorMap)==null?void 0:j.onMount),v=l.some(I=>I.isDirty),S=!v,F=!!((T=a.errorMap)!=null&&T.onMount||l.some(I=>{var P;return(P=I==null?void 0:I.errorMap)==null?void 0:P.onMount})),M=!!d;let V=(s==null?void 0:s.errors)??[];(!r||a.errorMap!==r.errorMap)&&(V=Object.values(a.errorMap).reduce((I,P)=>P===void 0?I:P&&De(P)?(I.push(P.form),I):(I.push(P),I),[]));const w=V.length===0,b=o&&w,L=this.options.canSubmitWhenInvalid??!1,E=a.submissionAttempts===0&&!f&&!F||!M&&!a.isSubmitting&&b||L;let A=a.errorMap;if(g&&(V=V.filter(I=>I!==a.errorMap.onMount),A=Object.assign(A,{onMount:void 0})),s&&r&&s.errorMap===A&&s.fieldMeta===this.fieldMetaDerived.state&&s.errors===V&&s.isFieldsValidating===d&&s.isFieldsValid===o&&s.isFormValid===w&&s.isValid===b&&s.canSubmit===E&&s.isTouched===f&&s.isBlurred===m&&s.isPristine===S&&s.isDefaultValue===c&&s.isDirty===v&&Z(r,a))return s;const D={...a,errorMap:A,fieldMeta:this.fieldMetaDerived.state,errors:V,isFieldsValidating:d,isFieldsValid:o,isFormValid:w,isValid:b,canSubmit:E,isTouched:f,isBlurred:m,isPristine:S,isDefaultValue:c,isDirty:v};return r=this.baseStore.get(),D}),this.handleSubmit=this.handleSubmit.bind(this),this.update(n||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(n){return Je(n.validate)?ae[n.type](n.value,n.validate):n.validate(n.value)}handleSubmit(n){return this._handleSubmit(n)}}function Be(t){if(t){if(De(t)){const n=Be(t.form).formError,e=t.fields;return{formError:n,fieldErrors:e}}return{formError:t}}return{formError:void 0}}function Fe(t){switch(t){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}class Ve{constructor(n){this.options={},this.mount=()=>{var r,h;this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});const e=this.getInfo();e.instance=this,this.update(this.options);const{onMount:i}=this.options.validators||{};if(i){const s=this.runValidator({validate:i,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});s&&this.setMeta(a=>({...a,errorMap:{...a==null?void 0:a.errorMap,onMount:s},errorSourceMap:{...a==null?void 0:a.errorSourceMap,onMount:"field"}}))}return(h=(r=this.options.listeners)==null?void 0:r.onMount)==null||h.call(r,{value:this.state.value,fieldApi:this}),()=>{var a,u,l,d;for(const[o,f]of Object.entries(this.timeoutIds.validations))f&&(clearTimeout(f),this.timeoutIds.validations[o]=null);for(const[o,f]of Object.entries(this.timeoutIds.listeners))f&&(clearTimeout(f),this.timeoutIds.listeners[o]=null);for(const[o,f]of Object.entries(this.timeoutIds.formListeners))f&&(clearTimeout(f),this.timeoutIds.formListeners[o]=null);const s=this.form.fieldInfo[this.name];if(s&&s.instance===this){for(const[o,f]of Object.entries(s.validationMetaMap))f==null||f.lastAbortController.abort(),s.validationMetaMap[o]=void 0;this.form.baseStore.setState(o=>{var f,m,c;return{...o,fieldMetaBase:{...o.fieldMetaBase,[this.name]:{...O,isTouched:((f=o.fieldMetaBase[this.name])==null?void 0:f.isTouched)??O.isTouched,isBlurred:((m=o.fieldMetaBase[this.name])==null?void 0:m.isBlurred)??O.isBlurred,isDirty:((c=o.fieldMetaBase[this.name])==null?void 0:c.isDirty)??O.isDirty}}}}),s.instance=null,(u=(a=this.options.listeners)==null?void 0:a.onUnmount)==null||u.call(a,{value:this.state.value,fieldApi:this}),(d=(l=this.form.options.listeners)==null?void 0:l.onFieldUnmount)==null||d.call(l,{formApi:this.form,fieldApi:this})}}},this.update=e=>{if(this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0){const i=this.form.getFieldValue(this.name);Z(i,e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})}this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,i)=>{this.form.setFieldValue(this.name,e,$(i,{dontRunListeners:!0,dontValidate:!0})),i!=null&&i.dontRunListeners||this.triggerOnChangeListener(),i!=null&&i.dontValidate||this.validate("change")},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,i)=>{this.form.pushFieldValue(this.name,e,$(i,{dontRunListeners:!0})),i!=null&&i.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,i,r)=>{this.form.insertFieldValue(this.name,e,i,$(r,{dontRunListeners:!0})),r!=null&&r.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,i,r)=>{this.form.replaceFieldValue(this.name,e,i,$(r,{dontRunListeners:!0})),r!=null&&r.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,i)=>{this.form.removeFieldValue(this.name,e,$(i,{dontRunListeners:!0})),i!=null&&i.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,i,r)=>{this.form.swapFieldValues(this.name,e,i,$(r,{dontRunListeners:!0})),r!=null&&r.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,i,r)=>{this.form.moveFieldValues(this.name,e,i,$(r,{dontRunListeners:!0})),r!=null&&r.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,$(e,{dontRunListeners:!0})),e!=null&&e.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=e=>{const i=Object.values(this.form.fieldInfo),r=[];for(const h of i){if(!h.instance||!(h.instance instanceof Ve))continue;const{onChangeListenTo:s,onBlurListenTo:a}=h.instance.options.validators||{};e==="change"&&(s!=null&&s.includes(this.name))&&r.push(h.instance),e==="blur"&&(a!=null&&a.includes(this.name))&&r.push(h.instance)}return r},this.validateSync=(e,i)=>{var l;const r=pe(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||q}),s=this.getLinkedFields(e).reduce((d,o)=>{const f=pe(e,{...o.options,form:o.form,fieldName:o.name,validationLogic:o.form.options.validationLogic||q});return f.forEach(m=>{m.field=o}),d.concat(f)},[]);let a=!1;_(()=>{const d=(o,f)=>{var F;const m=Me(f.cause),c=f.validate?dt(o.runValidator({validate:f.validate,value:{value:o.store.state.value,validationSource:"field",fieldApi:o},type:"validate"})):void 0,g=i[m],{newErrorValue:v,newSource:S}=Pe({formLevelError:g,fieldLevelError:c});((F=o.state.meta.errorMap)==null?void 0:F[m])!==v&&o.setMeta(M=>({...M,errorMap:{...M.errorMap,[m]:v},errorSourceMap:{...M.errorSourceMap,[m]:S}})),v&&(a=!0)};for(const o of r)d(this,o);for(const o of s)o.validate&&d(o.field,o)});const u=Me("submit");return(l=this.state.meta.errorMap)!=null&&l[u]&&e!=="submit"&&!a&&this.setMeta(d=>({...d,errorMap:{...d.errorMap,[u]:void 0},errorSourceMap:{...d.errorSourceMap,[u]:void 0}})),{hasErrored:a}},this.validateAsync=async(e,i)=>{const r=ye(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||q}),h=await i,a=this.getLinkedFields(e).reduce((c,g)=>{const v=ye(e,{...g.options,form:g.form,fieldName:g.name,validationLogic:g.form.options.validationLogic||q});return v.forEach(S=>{S.field=g}),c.concat(v)},[]),u=[],l=[],d=r.some(c=>c.validate),o=Array.from(new Set(a.filter(c=>c.validate).map(c=>c.field)));_(()=>{d&&this.startValidation();for(const c of o)c.startValidation()});const f=(c,g,v)=>{const S=Me(g.cause),F=c.getInfo(),M=F.validationMetaMap[S];M==null||M.lastAbortController.abort();const V=new AbortController;F.validationMetaMap[S]={lastAbortController:V},v.push(new Promise(async w=>{var j;let b;try{b=await new Promise((T,I)=>{c.timeoutIds.validations[g.cause]&&(clearTimeout(c.timeoutIds.validations[g.cause]),c.endValidation()),c.timeoutIds.validations[g.cause]=setTimeout(async()=>{if(V.signal.aborted)return T(void 0);try{T(await this.runValidator({validate:g.validate,value:{value:c.store.state.value,fieldApi:c,signal:V.signal,validationSource:"field"},type:"validateAsync"}))}catch(P){I(P)}},g.debounceMs)})}catch(T){b=T}if(V.signal.aborted)return w(void 0);const L=dt(b),E=(j=h[c.name])==null?void 0:j[S],{newErrorValue:A,newSource:D}=Pe({formLevelError:E,fieldLevelError:L});if(c.getInfo().instance!==c)return w(void 0);c.setMeta(T=>({...T,errorMap:{...T==null?void 0:T.errorMap,[S]:A},errorSourceMap:{...T.errorSourceMap,[S]:D}})),w(A)}))};for(const c of r)c.validate&&f(this,c,u);for(const c of a)c.validate&&f(c.field,c,l);let m=[];return(u.length||l.length)&&(m=await Promise.all(u),await Promise.all(l)),_(()=>{d&&this.endValidation();for(const c of o)c.endValidation()}),m.filter(Boolean)},this.validate=(e,i)=>{var f,m;if(!this.state.meta.isTouched)return[];const r=i!=null&&i.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(c=>this.name.startsWith(c.name));let s=(i!=null&&i.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!(i!=null&&i.skipFormValidation))for(const c of r){if(c.state.meta.submissionAttempts===0)continue;const{fieldsErrorMap:g}=this.form.validateSync(e,{group:c,dontUpdateFormErrorMap:!0,filterFieldNames:v=>ne(c.name,v)});s={...s,...g[this.name]??{}}}const{hasErrored:a}=this.validateSync(e,s),u=new WeakMap;for(const c of r){const{hasErrored:g}=c.validateSync(e,{},{skipRelatedFieldValidation:!0});u.set(c,g)}if(a&&!this.options.asyncAlways){(f=this.getInfo().validationMetaMap[Me(e)])==null||f.lastAbortController.abort();const c=[];for(const g of r)(m=g.getInfo().validationMetaMap[Me(e)])==null||m.lastAbortController.abort(),c.push(g.state.meta.errors);return[...this.state.meta.errors,...c.flat()]}const l=i!=null&&i.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),d=this.validateAsync(e,l),o=[];for(const c of r)u.get(c)&&!c.options.asyncAlways||o.push(c.validateAsync(e,l,{skipRelatedFieldValidation:!0}));return o.length===0?d:Promise.all([d,...o]).then(c=>c.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(i=>({...i,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(i=>({...i,isBlurred:!0})),this.validate("blur"),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(i=>({...i,errorMap:{...i.errorMap,...e}}))},this.parseValueWithSchema=e=>ae.validate({value:this.state.value,validationSource:"field"},e),this.parseValueWithSchemaAsync=e=>ae.validateAsync({value:this.state.value,validationSource:"field"},e),this.triggerOnBlurListener=()=>{var r,h,s,a,u,l;const e=(r=this.form.options.listeners)==null?void 0:r.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{var d,o;(o=(d=this.form.options.listeners)==null?void 0:d.onBlur)==null||o.call(d,{formApi:this.form,fieldApi:this})},e)):(s=(h=this.form.options.listeners)==null?void 0:h.onBlur)==null||s.call(h,{formApi:this.form,fieldApi:this});const i=(a=this.options.listeners)==null?void 0:a.onBlurDebounceMs;i&&i>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{var d,o;(o=(d=this.options.listeners)==null?void 0:d.onBlur)==null||o.call(d,{value:this.state.value,fieldApi:this})},i)):(l=(u=this.options.listeners)==null?void 0:u.onBlur)==null||l.call(u,{value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{var r,h,s,a,u,l;const e=(r=this.form.options.listeners)==null?void 0:r.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{var d,o;(o=(d=this.form.options.listeners)==null?void 0:d.onChange)==null||o.call(d,{formApi:this.form,fieldApi:this})},e)):(s=(h=this.form.options.listeners)==null?void 0:h.onChange)==null||s.call(h,{formApi:this.form,fieldApi:this});const i=(a=this.options.listeners)==null?void 0:a.onChangeDebounceMs;i&&i>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{var d,o;(o=(d=this.options.listeners)==null?void 0:d.onChange)==null||o.call(d,{value:this.state.value,fieldApi:this})},i)):(l=(u=this.options.listeners)==null?void 0:u.onChange)==null||l.call(u,{value:this.state.value,fieldApi:this});for(const d of this.form.formGroupApis)ne(d.name,this.name)&&d.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{var e,i;(i=(e=this.options.listeners)==null?void 0:e.onSubmit)==null||i.call(e,{value:this.state.value,fieldApi:this})},this.form=n.form,this.name=n.name,this.options=n,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=ie(e=>{this.form.store.get();const i=this.form.getFieldMeta(this.name)??{...O,...n.defaultMeta};let r=this.form.getFieldValue(this.name);return!i.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Z(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===i?e:{value:r,meta:i}})}get state(){return this.store.state}runValidator(n){return Je(n.validate)?ae[n.type](n.value,n.validate):n.validate(n.value)}startValidation(){this.setMeta(n=>{const e=n._pendingValidationsCount+1;return{...n,_pendingValidationsCount:e,isValidating:e>0&&!n.isValidating?!0:n.isValidating}})}endValidation(){this.setMeta(n=>{const e=Math.max(0,n._pendingValidationsCount-1);return{...n,_pendingValidationsCount:e,isValidating:e===0&&n.isValidating?!1:n.isValidating}})}}function dt(t){if(t)return t}function Me(t){switch(t){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}function Ue(t){return{isSubmitted:t.isSubmitted??!1,isSubmitting:t.isSubmitting??!1,isValidating:t.isValidating??!1,submissionAttempts:t.submissionAttempts??0,isSubmitSuccessful:t.isSubmitSuccessful??!1}}function Ht(t){return{...O,...t,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}class Ae{constructor(n){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(i=>{const r=i.formGroupStateBase[this.name]??Ue({});return{...i,formGroupStateBase:{...i.formGroupStateBase,[this.name]:e(r)}}})},this._lastDistributedFieldNames={},this.update=e=>{if(this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0){const i=this.form.getFieldValue(this.name);Z(i,e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})}this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...O,...this.options.defaultMeta})},this.mount=()=>{var i,r;this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(h=>({...h,formGroupStateBase:{...h.formGroupStateBase,[this.name]:h.formGroupStateBase[this.name]??Ue({...this.options.defaultState})}}));const{onMount:e}=this.options.validators||{};if(e){const h=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:"form"},type:"validate"});let s=h,a;ze(h)&&(s=h.group,a=h.fields);const u=Ke(s);u&&this.setMeta(l=>({...l,errorMap:{...l.errorMap,onMount:u},errorSourceMap:{...l.errorSourceMap,onMount:"field"}})),this.distributeFieldErrors("onMount",a)}return(r=(i=this.options.listeners)==null?void 0:i.onMount)==null||r.call(i,{value:this.state.value,groupApi:this}),()=>{var h,s;for(const[a,u]of Object.entries(this.timeoutIds.validations))u&&(clearTimeout(u),this.timeoutIds.validations[a]=null);for(const[a,u]of Object.entries(this.timeoutIds.listeners))u&&(clearTimeout(u),this.timeoutIds.listeners[a]=null);for(const[a,u]of Object.entries(this.timeoutIds.formListeners))u&&(clearTimeout(u),this.timeoutIds.formListeners[a]=null);if(this.fieldInfo.instance===this){for(const[a,u]of Object.entries(this.fieldInfo.validationMetaMap))u==null||u.lastAbortController.abort(),this.fieldInfo.validationMetaMap[a]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(a=>({...a,formGroupStateBase:{...a.formGroupStateBase,[this.name]:Ue({})}})),this.fieldInfo.instance=null,(s=(h=this.options.listeners)==null?void 0:h.onUnmount)==null||s.call(h,{value:this.state.value,groupApi:this})}}},this.setValue=(e,i)=>{this.form.setFieldValue(this.name,e,$(i,{dontRunListeners:!0,dontValidate:!0})),i!=null&&i.dontRunListeners||this.triggerOnChangeListener(),i!=null&&i.dontValidate||this.validate("change")},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{const e=Object.values(this.form.fieldInfo),i=[];for(const r of e)r.instance&&r.instance instanceof Ve&&r.instance.name.startsWith(this.name)&&i.push(r.instance);return i},this.getRelatedFieldMetasDerived=()=>{const e=Object.entries(this.form.fieldMetaDerived.state),i=[];for(const[r,h]of e)r!==this.name&&ne(this.name,r)&&i.push({...h,name:r});return i},this.buildChildFieldName=e=>e===""?this.name:e.startsWith("[")?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,i)=>{const r=this._lastDistributedFieldNames[e]??new Set,h=new Set;if(i)for(const[u,l]of Object.entries(i))l==null||l===!1||h.add(this.buildChildFieldName(u));const s=new Set([...r,...h]);let a=!1;for(const u of s){const l=u.startsWith(this.name+"[")?u.slice(this.name.length):u.slice(this.name.length+1),d=i==null?void 0:i[l],o=this.form.getFieldMeta(u);if(!o&&!d)continue;const f=o==null?void 0:o.errorMap[e],m=(o==null?void 0:o.errorSourceMap[e])==="form",{newErrorValue:c,newSource:g}=Qe({newFormValidatorError:d,isPreviousErrorFromFormValidator:m,previousErrorValue:f});c&&(a=!0),!(f===c&&(o==null?void 0:o.errorSourceMap[e])===g)&&this.form.setFieldMeta(u,(v=O)=>({...v,errorMap:{...v.errorMap,[e]:c},errorSourceMap:{...v.errorSourceMap,[e]:g}}))}return this._lastDistributedFieldNames[e]=h,a},this.validateSync=(e,i,r={})=>{var d;const h=pe(e,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||q}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((o,f)=>{const m=pe(e,{...f.options,form:f.form,validationLogic:f.form.options.validationLogic||q});return m.forEach(c=>{c.field=f}),o.concat(m)},[]);let u=!1;_(()=>{const o=(f,m)=>{var L;const c=Te(m.cause),g=f===this;let v;m.validate&&(v=f.runValidator({validate:m.validate,value:{value:f.store.state.value,validationSource:g?"form":"field",...f instanceof Ae?{groupApi:f}:{fieldApi:f}},type:"validate"}));let S=v,F;g&&ze(v)&&(S=v.group,F=v.fields);const M=Ke(S),V=i[c],{newErrorValue:w,newSource:b}=Pe({formLevelError:V,fieldLevelError:M});((L=f.state.meta.errorMap)==null?void 0:L[c])!==w&&f.setMeta(E=>({...E,errorMap:{...E.errorMap,[c]:w},errorSourceMap:{...E.errorSourceMap,[c]:b}})),w&&(u=!0),g&&this.distributeFieldErrors(c,F)&&(u=!0)};for(const f of h)o(this,f);for(const f of a)f.validate&&o(f.field,f)});const l=Te("submit");return(d=this.state.meta.errorMap)!=null&&d[l]&&e!=="submit"&&!u&&this.setMeta(o=>({...o,errorMap:{...o.errorMap,[l]:void 0},errorSourceMap:{...o.errorSourceMap,[l]:void 0}})),{hasErrored:u}},this.validateAsync=async(e,i,r={})=>{const h=ye(e,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||q}),s=await i,a=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),u=a.reduce((c,g)=>{const v=ye(e,{...g.options,form:g.form,validationLogic:g.form.options.validationLogic||q});return v.forEach(S=>{S.field=g}),c.concat(v)},[]),l=[],d=[],o=h.some(c=>c.validate)||u.some(c=>c.validate);if(o){this.state.meta.isValidating||this.setMeta(c=>({...c,isValidating:!0}));for(const c of a)c.setMeta(g=>({...g,isValidating:!0}))}const f=(c,g,v)=>{const S=Te(g.cause),F=c.getInfo(),M=F.validationMetaMap[S];M==null||M.lastAbortController.abort();const V=new AbortController;F.validationMetaMap[S]={lastAbortController:V};const w=c===this;v.push(new Promise(async b=>{var P;let L;try{L=await new Promise((R,W)=>{c.timeoutIds.validations[g.cause]&&clearTimeout(c.timeoutIds.validations[g.cause]),c.timeoutIds.validations[g.cause]=setTimeout(async()=>{if(V.signal.aborted)return R(void 0);try{R(await this.runValidator({validate:g.validate,value:{value:c.store.state.value,signal:V.signal,validationSource:w?"form":"field",...c instanceof Ae?{groupApi:c}:{fieldApi:c}},type:"validateAsync"}))}catch(B){W(B)}},g.debounceMs)})}catch(R){L=R}if(V.signal.aborted)return b(void 0);let E=L,A;w&&ze(L)&&(E=L.group,A=L.fields);const D=Ke(E),j=(P=s[c.name])==null?void 0:P[S],{newErrorValue:T,newSource:I}=Pe({formLevelError:j,fieldLevelError:D});if(c.getInfo().instance!==c)return b(void 0);c.setMeta(R=>({...R,errorMap:{...R==null?void 0:R.errorMap,[S]:T},errorSourceMap:{...R.errorSourceMap,[S]:I}})),w&&this.distributeFieldErrors(S,A),b(T)}))};for(const c of h)c.validate&&f(this,c,l);for(const c of u)c.validate&&f(c.field,c,d);let m=[];if((l.length||d.length)&&(m=await Promise.all(l),await Promise.all(d)),o){this.setMeta(c=>({...c,isValidating:!1}));for(const c of a)c.setMeta(g=>({...g,isValidating:!1}))}return m.filter(Boolean)},this.validateAllFields=async e=>{const i=[];return _(()=>{Object.values(this.getRelatedFields()).forEach(h=>{i.push(Promise.resolve().then(()=>h.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),h.store.state.meta.isTouched||h.setMeta(s=>({...s,isTouched:!0}))})}),(await Promise.all(i)).flat()},this.validateArrayFieldsStartingFrom=(e,i,r)=>this.form.validateArrayFieldsStartingFrom(e,i,r),this.validateField=(e,i)=>this.form.validateField(e,i),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,i)=>this.form.setFieldMeta(e,i),this.setFieldValue=(e,i)=>this.form.setFieldValue(e,i),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,i)=>this.form.pushFieldValue(e,i),this.insertFieldValue=(e,i,r)=>this.form.insertFieldValue(e,i,r),this.replaceFieldValue=(e,i,r)=>this.form.replaceFieldValue(e,i,r),this.swapFieldValues=(e,i,r)=>this.form.swapFieldValues(e,i,r),this.moveFieldValues=(e,i,r)=>this.form.moveFieldValues(e,i,r),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,i)=>this.form.removeFieldValue(e,i),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,i)=>{var a;const{fieldsErrorMap:r}=i!=null&&i.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:u=>ne(this.name,u)}),{hasErrored:h}=this.validateSync(e,r[this.name]??{},{skipRelatedFieldValidation:i==null?void 0:i.skipRelatedFieldValidation});if(h&&!this.options.asyncAlways)return(a=this.getInfo().validationMetaMap[Te(e)])==null||a.lastAbortController.abort(),this.state.meta.errors;const s=i!=null&&i.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:u=>ne(this.name,u)});return this.validateAsync(e,s,{skipRelatedFieldValidation:i==null?void 0:i.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{var r,h,s,a,u,l;const e=(r=this.form.options.listeners)==null?void 0:r.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{var d,o;(o=(d=this.form.options.listeners)==null?void 0:d.onChangeGroup)==null||o.call(d,{formApi:this.form,groupApi:this})},e)):(s=(h=this.form.options.listeners)==null?void 0:h.onChangeGroup)==null||s.call(h,{formApi:this.form,groupApi:this});const i=(a=this.options.listeners)==null?void 0:a.onChangeDebounceMs;i&&i>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{var d,o;(o=(d=this.options.listeners)==null?void 0:d.onChange)==null||o.call(d,{value:this.state.value,groupApi:this})},i)):(l=(u=this.options.listeners)==null?void 0:u.onChange)==null||l.call(u,{value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{var e,i;(i=(e=this.options.listeners)==null?void 0:e.onSubmit)==null||i.call(e,{value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{var h,s,a,u,l,d,o,f;this.setFormGroupState(m=>({...m,isSubmitted:!1,submissionAttempts:m.submissionAttempts+1,isSubmitSuccessful:!1})),_(()=>{Object.values(this.getRelatedFields()).forEach(m=>{m.state.meta.isTouched||m.setMeta(c=>({...c,isTouched:!0}))})});const i=e??this.options.onSubmitMeta;this.setFormGroupState(m=>({...m,isSubmitting:!0}));const r=()=>{this.setFormGroupState(m=>({...m,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.areRelatedFieldsValid()){r(),(s=(h=this.options).onGroupSubmitInvalid)==null||s.call(h,{value:this.state.value,groupApi:this,meta:i});return}if(await this.validate("submit",{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){r(),(u=(a=this.options).onGroupSubmitInvalid)==null||u.call(a,{value:this.state.value,groupApi:this,meta:i});return}_(()=>{Object.values(this.getRelatedFields()).forEach(m=>{var c,g;(g=(c=m.options.listeners)==null?void 0:c.onGroupSubmit)==null||g.call(c,{value:m.state.value,fieldApi:m})})}),(d=(l=this.options.listeners)==null?void 0:l.onSubmit)==null||d.call(l,{groupApi:this,value:this.state.value});try{await((f=(o=this.options).onGroupSubmit)==null?void 0:f.call(o,{value:this.state.value,groupApi:this,meta:i})),_(()=>{this.setFormGroupState(m=>({...m,isSubmitted:!0,isSubmitSuccessful:!0})),r()})}catch(m){throw this.setFormGroupState(c=>({...c,isSubmitSuccessful:!1})),r(),m}},this.form=n.form,this.name=n.name,this.options=n,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=ie(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();const i=this.form.getFormGroupMeta(this.name)??Ht(n.defaultMeta);let r=this.form.getFieldValue(this.name);return!i.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Z(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===i?e:{value:r,meta:i}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(n){if(Je(n.validate)){const e=ae[n.type](n.value,n.validate);return n.type==="validate"?ct(e):e.then(ct)}return n.validate(n.value)}handleSubmit(n){return this._handleSubmit(n)}}function Ke(t){if(t)return t}function ze(t){return!!t&&typeof t=="object"&&"fields"in t}function ct(t){if(!t||typeof t!="object"||!("form"in t)&&!("fields"in t))return t;const{form:n,fields:e,...i}=t;return{...i,group:n,fields:e}}function Te(t){switch(t){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}class _e{constructor(n){if(this.getFormFieldName=e=>{if(typeof this.fieldsMap=="string")return ot(this.fieldsMap,e);const i=Oe(e)[0];if(typeof i!="string")return"";const r=e.slice(i.length),h=this.fieldsMap[i];return ot(h,r)},this.getFormFieldOptions=e=>{const i={...e},r=i.validators;if(i.name=this.getFormFieldName(e.name),r&&(r.onChangeListenTo||r.onBlurListenTo)){const h={...r},s=a=>{if(a)return a.map(u=>this.getFormFieldName(u))};h.onChangeListenTo=s(r.onChangeListenTo),h.onBlurListenTo=s(r.onBlurListenTo),i.validators=h}return i},this.mount=()=>()=>{},this.validateArrayFieldsStartingFrom=async(e,i,r)=>this.form.validateArrayFieldsStartingFrom(this.getFormFieldName(e),i,r),this.validateField=(e,i)=>this.form.validateField(this.getFormFieldName(e),i),this.getFieldValue=e=>this.form.getFieldValue(this.getFormFieldName(e)),this.getFieldMeta=e=>this.form.getFieldMeta(this.getFormFieldName(e)),this.setFieldMeta=(e,i)=>this.form.setFieldMeta(this.getFormFieldName(e),i),this.setFieldValue=(e,i,r)=>this.form.setFieldValue(this.getFormFieldName(e),i,r),this.deleteField=e=>this.form.deleteField(this.getFormFieldName(e)),this.pushFieldValue=(e,i,r)=>this.form.pushFieldValue(this.getFormFieldName(e),i,r),this.insertFieldValue=async(e,i,r,h)=>this.form.insertFieldValue(this.getFormFieldName(e),i,r,h),this.replaceFieldValue=async(e,i,r,h)=>this.form.replaceFieldValue(this.getFormFieldName(e),i,r,h),this.removeFieldValue=async(e,i,r)=>this.form.removeFieldValue(this.getFormFieldName(e),i,r),this.swapFieldValues=(e,i,r,h)=>this.form.swapFieldValues(this.getFormFieldName(e),i,r,h),this.moveFieldValues=(e,i,r,h)=>this.form.moveFieldValues(this.getFormFieldName(e),i,r,h),this.clearFieldValues=(e,i)=>this.form.clearFieldValues(this.getFormFieldName(e),i),this.resetField=e=>this.form.resetField(this.getFormFieldName(e)),this.validateAllFields=e=>this.form.validateAllFields(e),n.form instanceof _e){const e=n.form;if(this.form=e.form,typeof n.fields=="string")this.fieldsMap=e.getFormFieldName(n.fields);else{const i={...n.fields};for(const r in i)i[r]=e.getFormFieldName(i[r]);this.fieldsMap=i}}else this.form=n.form,this.fieldsMap=n.fields;this.store=ie(()=>{const e=this.form.store.get();let i;if(typeof this.fieldsMap=="string")i=oe(e.values,this.fieldsMap);else{i={};const r=this.fieldsMap;for(const h in r)i[h]=oe(e.values,r[h])}return{values:i}})}get state(){return this.store.state}async handleSubmit(n){return this.form.handleSubmit(n)}}function Xt(t,n){if(!n)return;const e=Object.assign({},t,{state:Se(t.state)});n(e),e.fieldInfo!==t.fieldInfo&&(t.fieldInfo=e.fieldInfo),e.options!==t.options&&(t.options=e.options);const r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((h,s)=>(t.state[s]!==e.state[s]&&(h[s]=e.state[s]),h),{});return _(()=>{Object.keys(r).length&&t.baseStore.setState(h=>({...h,...r})),e.state.errorMap!==t.state.errorMap&&t.setErrorMap(e.state.errorMap)}),e}function Qt(t,n){return t===n}function x(t,n=i=>i,e){const i=(e==null?void 0:e.compare)??Qt,r=C.useCallback(s=>{const{unsubscribe:a}=t.subscribe(s);return a},[t]),h=C.useCallback(()=>t.get(),[t]);return St.useSyncExternalStoreWithSelector(r,h,h,n,i)}const J=typeof window<"u"?C.useLayoutEffect:C.useEffect;function Zt(t){const[n,e]=C.useState(()=>({form:t.form,name:t.name})),[i,r]=C.useState(()=>new Ve({...t}));let h=i;(n.form!==t.form||n.name!==t.name)&&(h=new Ve({...t}),r(h),e({form:t.form,name:t.name}));const s=x(h.store,t.mode==="array"?c=>c.meta._arrayVersion||0:c=>c.value),a=x(h.store,c=>c.meta.isTouched),u=x(h.store,c=>c.meta.isBlurred),l=x(h.store,c=>c.meta.isDirty),d=x(h.store,c=>c.meta.errorMap),o=x(h.store,c=>c.meta.errorSourceMap),f=x(h.store,c=>c.meta.isValidating),m=C.useMemo(()=>({...h,get state(){return{value:t.mode==="array"?h.state.value:s,get meta(){return{...h.state.meta,isTouched:a,isBlurred:u,isDirty:l,errorMap:d,errorSourceMap:o,isValidating:f}}}}}),[h,t.mode,s,a,u,l,d,o,f]);return J(h.mount,[h]),J(()=>{h.update(t)}),m}const Jt=(({children:t,...n})=>{const e=Zt(n),i=C.useMemo(()=>ge(t,e),[t,e]);return p.jsx(p.Fragment,{children:i})});function Yt(){return C.useState(()=>vt())[0]}const ei=pt,ti=C.version.split(".")[0]==="17"?Yt:ei.useId;function ii(t){const[n,e]=C.useState(()=>({form:t.form,name:t.name})),[i,r]=C.useState(()=>new Ae({...t}));(n.form!==t.form||n.name!==t.name)&&(r(new Ae({...t})),e({form:t.form,name:t.name}));const h=x(i.store,b=>b.value),s=x(i.store,b=>b.meta.isTouched),a=x(i.store,b=>b.meta.isBlurred),u=x(i.store,b=>b.meta.isDirty),l=x(i.store,b=>b.meta.errorMap),d=x(i.store,b=>b.meta.errorSourceMap),o=x(i.store,b=>b.meta.isValidating),f=x(i.store,b=>b.meta.isSubmitting),m=x(i.store,b=>b.meta.isSubmitted),c=x(i.store,b=>b.meta.submissionAttempts),g=x(i.store,b=>b.meta.isSubmitSuccessful),v=x(i.store,b=>b.meta.canSubmit),S=x(i.store,b=>b.meta.isValid),F=x(i.store,b=>b.meta.isFieldsValid),M=x(i.store,b=>b.meta.isFieldsValidating),V=x(i.store,b=>b.meta.isGroupValid),w=C.useMemo(()=>({...i,handleSubmit:((...E)=>i._handleSubmit(...E)),get state(){return{...i.state,value:h,get meta(){return{...i.state.meta,isTouched:s,isBlurred:a,isDirty:u,errorMap:l,errorSourceMap:d,isValidating:o,isSubmitting:f,isSubmitted:m,submissionAttempts:c,isSubmitSuccessful:g,canSubmit:v,isValid:S,isFieldsValid:F,isFieldsValidating:M,isGroupValid:V}}}}}),[i,h,s,a,u,l,d,o,f,m,c,g,v,S,F,M,V]);return J(i.mount,[i]),J(()=>{i.update(t)}),w}const si=(({children:t,...n})=>{const e=ii(n),i=C.useMemo(()=>ge(t,e),[t,e]);return p.jsx(p.Fragment,{children:i})});function ri({form:t,selector:n=i=>i,children:e}){const i=x(t.store,n);return p.jsx(p.Fragment,{children:ge(e,i)})}function ni(t){const n=ti(),[e,i]=C.useState(t==null?void 0:t.formId),[r,h]=C.useState(()=>new ut({...t,formId:(t==null?void 0:t.formId)??n}));if(e!==(t==null?void 0:t.formId)){const u=(t==null?void 0:t.formId)??n;h(new ut({...t,formId:u})),i(u)}const s=C.useMemo(()=>{const u={...r,handleSubmit:((...l)=>r._handleSubmit(...l)),get formId(){return r._formId},get state(){return r.store.state}};return u.Field=function(d){return p.jsx(Jt,{...d,form:r})},u.FormGroup=function(d){return p.jsx(si,{...d,form:r})},u.Subscribe=function(d){return p.jsx(ri,{form:r,selector:d.selector,children:d.children})},u},[r]);J(r.mount,[]),J(()=>{r.update(t)});const a=C.useRef(!1);return J(()=>{a.current&&t!=null&&t.transform&&Xt(r,t.transform)},[r,t==null?void 0:t.transform]),J(()=>{a.current=!0}),s}function ai({lens:t,selector:n=i=>i,children:e}){const i=x(t.store,n);return p.jsx(p.Fragment,{children:ge(e,i)})}function oi(t){const[n]=C.useState(()=>{const e=new _e(t),i=t.form instanceof _e?t.form.form:t.form,r=e;return r.AppForm=function(s){return p.jsx(i.AppForm,{...s})},r.AppField=function(s){return p.jsx(i.AppField,{...n.getFormFieldOptions(s)})},r.Field=function(s){return p.jsx(i.Field,{...n.getFormFieldOptions(s)})},r.Subscribe=function(s){return p.jsx(ai,{lens:n,selector:s.selector,children:s.children})},Object.assign(r,{...t.formComponents})});return J(n.mount,[n]),n}const ht=C.createContext(null),bt=C.createContext(null);function Ft(){const t=C.useContext(bt);if(!t)throw new Error("`formContext` only works when within a `formComponent` passed to `createFormHook`");return t}function li(){function t(){const n=C.useContext(ht);if(!n)throw new Error("`fieldContext` only works when within a `fieldComponent` passed to `createFormHook`");return n}return{fieldContext:ht,useFieldContext:t,useFormContext:Ft,formContext:bt}}function Mt({fieldComponents:t,fieldContext:n,formContext:e,formComponents:i}){function r(l){const d=ni(l),o=C.useMemo(()=>({children:c})=>p.jsx(e.Provider,{value:d,children:c}),[d]),f=C.useMemo(()=>(({children:g,...v})=>p.jsx(d.Field,{...v,children:S=>p.jsx(n.Provider,{value:S,children:g(Object.assign(S,t))})})),[d]);return C.useMemo(()=>Object.assign(d,{AppField:f,AppForm:o,...i}),[d,f,o])}function h({render:l,props:d}){return function(f){return l({...d,...f})}}function s({render:l,props:d,defaultValues:o}){return function(m){const c=C.useMemo(()=>({form:m.form,fields:m.fields,defaultValues:o,formComponents:i}),[m.form,m.fields]),g=oi(c);return l({...d,...m,group:g})}}function a(l){return Ft()}function u(l){return Mt({fieldContext:n,formContext:e,fieldComponents:{...t,...l.fieldComponents},formComponents:{...i,...l.formComponents}})}return{useAppForm:r,withForm:h,withFieldGroup:s,useTypedAppFormContext:a,extendForm:u}}const{fieldContext:ui,formContext:di,useFieldContext:ve,useFormContext:ci}=li();function hi({label:t,placeholder:n,type:e="text",description:i}){const r=ve(),{isTouched:h,errors:s}=r.state.meta,a=h?s.map(u=>({message:String(u)})):[];return p.jsxs(ce,{orientation:"vertical",children:[p.jsx(he,{htmlFor:r.name,children:t}),p.jsx(yt,{id:r.name,type:e,value:r.state.value,placeholder:n,onBlur:r.handleBlur,onChange:u=>r.handleChange(u.target.value)}),i&&p.jsx(fe,{children:i}),p.jsx(me,{errors:a})]})}function fi({label:t,placeholder:n,description:e,rows:i}){const r=ve(),{isTouched:h,errors:s}=r.state.meta,a=h?s.map(u=>({message:String(u)})):[];return p.jsxs(ce,{orientation:"vertical",children:[p.jsx(he,{htmlFor:r.name,children:t}),p.jsx(Vt,{id:r.name,value:r.state.value,placeholder:n,rows:i,onBlur:r.handleBlur,onChange:u=>r.handleChange(u.target.value)}),e&&p.jsx(fe,{children:e}),p.jsx(me,{errors:a})]})}function mi({label:t,options:n,placeholder:e,description:i}){const r=ve(),{isTouched:h,errors:s}=r.state.meta,a=h?s.map(u=>({message:String(u)})):[];return p.jsxs(ce,{orientation:"vertical",children:[p.jsx(he,{htmlFor:r.name,children:t}),p.jsxs(At,{value:r.state.value,onValueChange:u=>r.handleChange(u),onOpenChange:u=>{u||r.handleBlur()},children:[p.jsx(Et,{id:r.name,children:p.jsx(wt,{placeholder:e})}),p.jsx(It,{children:n.map(u=>p.jsx(Ct,{value:u.value,children:u.label},u.value))})]}),i&&p.jsx(fe,{children:i}),p.jsx(me,{errors:a})]})}function gi({label:t,description:n}){const e=ve(),{isTouched:i,errors:r}=e.state.meta,h=i?r.map(s=>({message:String(s)})):[];return p.jsxs(ce,{orientation:"horizontal",children:[p.jsx(he,{htmlFor:e.name,children:t}),p.jsx(Lt,{id:e.name,checked:e.state.value,onBlur:e.handleBlur,onCheckedChange:s=>e.handleChange(s)}),n&&p.jsx(fe,{children:n}),p.jsx(me,{errors:h})]})}function vi({label:t,description:n}){const e=ve(),{isTouched:i,errors:r}=e.state.meta,h=i?r.map(s=>({message:String(s)})):[];return p.jsxs(ce,{orientation:"horizontal",children:[p.jsx(Tt,{id:e.name,checked:e.state.value,onBlur:e.handleBlur,onCheckedChange:s=>e.handleChange(s===!0)}),p.jsx(he,{htmlFor:e.name,children:t}),n&&p.jsx(fe,{children:n}),p.jsx(me,{errors:h})]})}function bi({label:t,placeholder:n,description:e}){const i=ve(),{isTouched:r,errors:h}=i.state.meta,s=r?h.map(a=>({message:String(a)})):[];return p.jsxs(ce,{orientation:"vertical",children:[p.jsx(he,{htmlFor:i.name,children:t}),p.jsx(xt,{id:i.name,value:i.state.value,placeholder:n,onBlur:i.handleBlur,onChange:a=>i.handleChange(a.target.value)}),e&&p.jsx(fe,{children:e}),p.jsx(me,{errors:s})]})}function Fi({label:t,pendingLabel:n="Saving…"}){const e=ci();return p.jsx(e.Subscribe,{selector:i=>({canSubmit:i.canSubmit,isSubmitting:i.isSubmitting}),children:({canSubmit:i,isSubmitting:r})=>p.jsx(Dt,{type:"submit",disabled:!i||r,children:r?n:t})})}const{useAppForm:pi}=Mt({fieldContext:ui,formContext:di,fieldComponents:{TextField:hi,TextareaField:fi,SelectField:mi,SwitchField:gi,CheckboxField:vi,PasswordField:bi},formComponents:{SubmitButton:Fi}});export{x as a,pi as u};
1
+ var et=t=>{throw TypeError(t)};var tt=(t,n,e)=>n.has(t)||et("Cannot "+e);var y=(t,n,e)=>(tt(t,n,"read from private field"),e?e.call(t):n.get(t)),N=(t,n,e)=>n.has(t)?et("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,e),k=(t,n,e,i)=>(tt(t,n,"write to private field"),i?i.call(t,e):n.set(t,e),e);var it=(t,n,e,i)=>({set _(r){k(t,n,r,e)},get _(){return y(t,n,i)}});import{r as C,lu as St,j as p,lv as pt,dp as ce,dq as he,I as yt,h0 as fe,h_ as me,h$ as Vt,eg as At,eh as Et,ei as wt,ej as It,ek as Ct,$ as Lt,gQ as Tt,eo as xt,B as Dt}from"./index-OQuvRZTD.js";function kt({update:t,notify:n,unwatched:e}){return{link:i,unlink:r,propagate:h,checkDirty:s,shallowPropagate:a};function i(l,d,o){const f=d.depsTail;if(f!==void 0&&f.dep===l)return;const m=f!==void 0?f.nextDep:d.deps;if(m!==void 0&&m.dep===l){m.version=o,d.depsTail=m;return}const c=l.subsTail;if(c!==void 0&&c.version===o&&c.sub===d)return;const g=d.depsTail=l.subsTail={version:o,dep:l,sub:d,prevDep:f,nextDep:m,prevSub:c,nextSub:void 0};m!==void 0&&(m.prevDep=g),f!==void 0?f.nextDep=g:d.deps=g,c!==void 0?c.nextSub=g:l.subs=g}function r(l,d=l.sub){const o=l.dep,f=l.prevDep,m=l.nextDep,c=l.nextSub,g=l.prevSub;return m!==void 0?m.prevDep=f:d.depsTail=f,f!==void 0?f.nextDep=m:d.deps=m,c!==void 0?c.prevSub=g:o.subsTail=g,g!==void 0?g.nextSub=c:(o.subs=c)===void 0&&e(o),m}function h(l){let d=l.nextSub,o;e:do{const f=l.sub;let m=f.flags;if(m&60?m&12?m&4?!(m&48)&&u(l,f)?(f.flags=m|40,m&=1):m=0:f.flags=m&-9|32:m=0:f.flags=m|32,m&2&&n(f),m&1){const c=f.subs;if(c!==void 0){const g=(l=c).nextSub;g!==void 0&&(o={value:d,prev:o},d=g);continue}}if((l=d)!==void 0){d=l.nextSub;continue}for(;o!==void 0;)if(l=o.value,o=o.prev,l!==void 0){d=l.nextSub;continue e}break}while(!0)}function s(l,d){let o,f=0,m=!1;e:do{const c=l.dep,g=c.flags;if(d.flags&16)m=!0;else if((g&17)===17){if(t(c)){const v=c.subs;v.nextSub!==void 0&&a(v),m=!0}}else if((g&33)===33){(l.nextSub!==void 0||l.prevSub!==void 0)&&(o={value:l,prev:o}),l=c.deps,d=c,++f;continue}if(!m){const v=l.nextDep;if(v!==void 0){l=v;continue}}for(;f--;){const v=d.subs,S=v.nextSub!==void 0;if(S?(l=o.value,o=o.prev):l=v,m){if(t(d)){S&&a(v),d=l.sub;continue}m=!1}else d.flags&=-33;d=l.sub;const F=l.nextDep;if(F!==void 0){l=F;continue e}}return m}while(!0)}function a(l){do{const d=l.sub,o=d.flags;(o&48)===32&&(d.flags=o|16,(o&6)===2&&n(d))}while((l=l.nextSub)!==void 0)}function u(l,d){let o=d.depsTail;for(;o!==void 0;){if(o===l)return!0;o=o.prevDep}return!1}}function Ze(t,n,e){var h,s,a;const i=typeof t=="object",r=i?t:void 0;return{next:(h=i?t.next:t)==null?void 0:h.bind(r),error:(s=i?t.error:n)==null?void 0:s.bind(r),complete:(a=i?t.complete:e)==null?void 0:a.bind(r)}}const qe=[];let xe=0;const{link:st,unlink:Bt,propagate:jt,checkDirty:ft,shallowPropagate:rt}=kt({update(t){return t._update()},notify(t){qe[He++]=t,t.flags&=-3},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=17,je(t))}});let Ce=0,He=0,z,Xe=0;function _(t){try{++Xe,t()}finally{--Xe||mt()}}function je(t){const n=t.depsTail;let e=n!==void 0?n.nextDep:t.deps;for(;e!==void 0;)e=Bt(e,t)}function mt(){if(!(Xe>0)){for(;Ce<He;){const t=qe[Ce];qe[Ce++]=void 0,t.notify()}Ce=0,He=0}}function gt(t,n){const e=typeof t=="function",i=t,r={_snapshot:e?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:e?0:1,get(){return z!==void 0&&st(r,z,xe),r._snapshot},subscribe(h){const s=Ze(h),a={current:!1},u=Pt(()=>{var l;r.get(),a.current?(l=s.next)==null||l.call(s,r._snapshot):a.current=!0});return{unsubscribe:()=>{u.stop()}}},_update(h){const s=z,a=Object.is;if(e)z=r,++xe,r.depsTail=void 0;else if(h===void 0)return!1;e&&(r.flags=5);try{const u=r._snapshot,l=typeof h=="function"?h(u):h===void 0&&e?i(u):h;return u===void 0||!a(u,l)?(r._snapshot=l,!0):!1}finally{z=s,e&&(r.flags&=-5),je(r)}}};return e?(r.flags=17,r.get=function(){const h=r.flags;if(h&16||h&32&&ft(r.deps,r)){if(r._update()){const s=r.subs;s!==void 0&&rt(s)}}else h&32&&(r.flags=h&-33);return z!==void 0&&st(r,z,xe),r._snapshot}):r.set=function(h){if(r._update(h)){const s=r.subs;s!==void 0&&(jt(s),rt(s),mt())}},r}function Pt(t){const n=()=>{const i=z;z=e,++xe,e.depsTail=void 0,e.flags=6;try{return t()}finally{z=i,e.flags&=-5,je(e)}},e={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){const i=this.flags;i&16||i&32&&ft(this.deps,this)?n():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,je(this)}};return n(),e}var _t=class{constructor(t,n){this.atom=gt(t),this.get=this.get.bind(this),this.setState=this.setState.bind(this),this.subscribe=this.subscribe.bind(this),n&&(this.actions=n(this))}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Ze(t))}},Rt=class{constructor(t){this.atom=gt(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Ze(t))}};function ie(t,n){return typeof t=="function"?new Rt(t):new _t(t)}var Nt=class{constructor(t,n){this.fn=t,this.options=n,this.lastExecutionTime=0,this.isPending=!1,this.maybeExecute=(...e)=>{const i=Date.now()-this.lastExecutionTime;if(this.options.leading&&i>=this.options.wait)this.execute(...e);else if(this.lastArgs=e,!this.timeoutId&&this.options.trailing){const r=this.options.wait-i;this.isPending=!0,this.timeoutId=setTimeout(()=>{this.lastArgs!==void 0&&this.execute(...this.lastArgs)},r)}},this.execute=(...e)=>{var i,r;this.fn(...e),(r=(i=this.options).onExecute)==null||r.call(i,e,this),this.lastExecutionTime=Date.now(),this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.flush=()=>{this.isPending&&this.lastArgs&&this.execute(...this.lastArgs)},this.cancel=()=>{this.clearTimeout(),this.lastArgs=void 0,this.isPending=!1},this.clearTimeout=()=>{this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0)},this.options.leading===void 0&&this.options.trailing===void 0&&(this.options.leading=!0,this.options.trailing=!0)}};function Ot(t,n){return new Nt(t,n).maybeExecute}var ee,U,G,Ee,H,re,X,le,we,Re,te,ue,Q,Ie,de,Ne;class Gt{constructor({pluginId:n,debug:e=!1,enabled:i=!0,reconnectEveryMs:r=300}){N(this,ee,!0);N(this,U);N(this,G);N(this,Ee);N(this,H);N(this,re);N(this,X);N(this,le);N(this,we,0);N(this,Re,5);N(this,te,!1);N(this,ue,!1);N(this,Q,null);N(this,Ie,()=>{this.debugLog("Connected to event bus"),k(this,re,!0),k(this,te,!1),this.debugLog("Emitting queued events",y(this,H)),y(this,H).forEach(n=>this.emitEventToBus(n)),k(this,H,[]),this.stopConnectLoop(),y(this,G).call(this).removeEventListener("tanstack-connect-success",y(this,Ie))});N(this,de,()=>{if(y(this,we)<y(this,Re)){it(this,we)._++,this.dispatchCustomEvent("tanstack-connect",{});return}y(this,G).call(this).removeEventListener("tanstack-connect",y(this,de)),k(this,ue,!0),this.debugLog("Max retries reached, giving up on connection"),this.stopConnectLoop()});N(this,Ne,()=>{y(this,te)||(k(this,te,!0),y(this,G).call(this).addEventListener("tanstack-connect-success",y(this,Ie)),y(this,de).call(this))});k(this,U,n),k(this,ee,i),k(this,G,this.getGlobalTarget),k(this,Ee,e),this.debugLog(" Initializing event subscription for plugin",y(this,U)),k(this,H,[]),k(this,re,!1),k(this,ue,!1),k(this,X,null),k(this,le,r)}startConnectLoop(){y(this,X)!==null||y(this,re)||(this.debugLog(`Starting connect loop (every ${y(this,le)}ms)`),k(this,X,setInterval(y(this,de),y(this,le))))}stopConnectLoop(){k(this,te,!1),y(this,X)!==null&&(clearInterval(y(this,X)),k(this,X,null),k(this,H,[]),this.debugLog("Stopped connect loop"))}debugLog(...n){y(this,Ee)&&console.log(`🌴 [tanstack-devtools:${y(this,U)}-plugin]`,...n)}getGlobalTarget(){if(typeof globalThis<"u"&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog("Using global event target"),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<"u"&&typeof window.addEventListener<"u")return this.debugLog("Using window as event target"),window;const n=typeof EventTarget<"u"?new EventTarget:void 0;return typeof n>"u"||typeof n.addEventListener>"u"?(this.debugLog("No event mechanism available, running in non-web environment"),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog("Using new EventTarget as fallback"),n)}getPluginId(){return y(this,U)}dispatchCustomEventShim(n,e){try{const i=new Event(n,{detail:e});y(this,G).call(this).dispatchEvent(i)}catch{this.debugLog("Failed to dispatch shim event")}}dispatchCustomEvent(n,e){try{y(this,G).call(this).dispatchEvent(new CustomEvent(n,{detail:e}))}catch{this.dispatchCustomEventShim(n,e)}}emitEventToBus(n){this.debugLog("Emitting event to client bus",n),this.dispatchCustomEvent("tanstack-dispatch-event",n)}createEventPayload(n,e){return{type:`${y(this,U)}:${n}`,payload:e,pluginId:y(this,U)}}emit(n,e){if(!y(this,ee)){this.debugLog("Event bus client is disabled, not emitting event",n,e);return}if(y(this,Q)&&(this.debugLog("Emitting event to internal event target",n,e),y(this,Q).dispatchEvent(new CustomEvent(`${y(this,U)}:${n}`,{detail:this.createEventPayload(n,e)}))),y(this,ue)){this.debugLog("Previously failed to connect, not emitting to bus");return}if(!y(this,re)){this.debugLog("Bus not available, will be pushed as soon as connected"),y(this,H).push(this.createEventPayload(n,e)),typeof CustomEvent<"u"&&!y(this,te)&&(y(this,Ne).call(this),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(n,e))}on(n,e,i){const r=(i==null?void 0:i.withEventTarget)??!1,h=`${y(this,U)}:${n}`;if(r&&(y(this,Q)||k(this,Q,new EventTarget),y(this,Q).addEventListener(h,a=>{e(a.detail)})),!y(this,ee))return this.debugLog("Event bus client is disabled, not registering event",h),()=>{};const s=a=>{this.debugLog("Received event from bus",a.detail),e(a.detail)};return y(this,G).call(this).addEventListener(h,s),this.debugLog("Registered event to bus",h),()=>{var a;r&&((a=y(this,Q))==null||a.removeEventListener(h,s)),y(this,G).call(this).removeEventListener(h,s)}}onAll(n){if(!y(this,ee))return this.debugLog("Event bus client is disabled, not registering event"),()=>{};const e=i=>{const r=i.detail;n(r)};return y(this,G).call(this).addEventListener("tanstack-devtools-global",e),()=>y(this,G).call(this).removeEventListener("tanstack-devtools-global",e)}onAllPluginEvents(n){if(!y(this,ee))return this.debugLog("Event bus client is disabled, not registering event"),()=>{};const e=i=>{const r=i.detail;y(this,U)&&r.pluginId!==y(this,U)||n(r)};return y(this,G).call(this).addEventListener("tanstack-devtools-global",e),()=>y(this,G).call(this).removeEventListener("tanstack-devtools-global",e)}}ee=new WeakMap,U=new WeakMap,G=new WeakMap,Ee=new WeakMap,H=new WeakMap,re=new WeakMap,X=new WeakMap,le=new WeakMap,we=new WeakMap,Re=new WeakMap,te=new WeakMap,ue=new WeakMap,Q=new WeakMap,Ie=new WeakMap,de=new WeakMap,Ne=new WeakMap;class $t extends Gt{constructor(){super({pluginId:"form-devtools",reconnectEveryMs:1e3})}}const K=new $t;function ge(t,n){return typeof t=="function"?t(n):t}function oe(t,n){return Oe(n).reduce((i,r)=>{if(i===null)return null;if(typeof i<"u")return i[r]},t)}function be(t,n,e){const i=Oe(n);function r(h){if(!i.length)return ge(e,h);const s=i.shift();if(typeof s=="string"||typeof s=="number"&&!Array.isArray(h))return typeof h=="object"?(h===null&&(h={}),{...h,[s]:r(h[s])}):{[s]:r()};if(Array.isArray(h)&&typeof s=="number"){const a=h.slice(0,s);return[...a.length?a:new Array(s),r(h[s]),...h.slice(s+1)]}return[...new Array(s),r()]}return r(t)}function Wt(t,n){const e=Oe(n);function i(r){if(!r)return;if(e.length===1){const s=e[0];if(Array.isArray(r)&&typeof s=="number")return r.filter((l,d)=>d!==s);const{[s]:a,...u}=r;return u}const h=e.shift();if((typeof h=="string"||typeof h=="number"&&!Array.isArray(r))&&typeof r=="object")return{...r,[h]:i(r[h])};if(typeof h=="number"&&Array.isArray(r)){if(h>=r.length)return r;const s=r.slice(0,h);return[...s.length?s:new Array(h),i(r[h]),...r.slice(h+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return i(t)}const nt=46,Ge=91,$e=93,at=48,Ut=57;function Oe(t){if(Array.isArray(t))return[...t];if(typeof t!="string")throw new Error("Path must be a string.");const n=t.length,e=[];let i=n>0&&t.charCodeAt(0)===Ge?1:0,r=!0,h=-1;for(let s=i;s<=n;s++){const a=s<n?t.charCodeAt(s):-1;if(s===n||a===nt||a===Ge||a===$e){const u=s-i;if(u>0){const l=r&&(u===1||t.charCodeAt(i)!==at),d=t.slice(i,s);if(l){const o=parseInt(d,10);u<=15||String(o)===d?e.push(o):e.push(d)}else e.push(d)}else h!==$e&&!(h===-1&&a===$e)&&!(h===a&&(a===nt||a===Ge))&&e.push("");i=s+1,r=!0}else(a<at||a>Ut)&&(r=!1);h=a}return e.length||e.push(""),e}function ot(t,n){return t.length===0?n:n.length===0?t:n.startsWith("[")||n.startsWith(".")?t+n:`${t}.${n}`}function Kt(t){return!(Array.isArray(t)&&t.length===0)}function pe(t,n){const e=i=>i.validators.filter(Boolean).map(r=>({cause:r.cause,validate:r.fn}));return n.validationLogic({form:n.form,group:n.group,validators:n.validators,event:{type:t,fieldName:n.fieldName,async:!1},runValidation:e})}function ye(t,n){const{asyncDebounceMs:e}=n,{onBlurAsyncDebounceMs:i,onChangeAsyncDebounceMs:r,onDynamicAsyncDebounceMs:h}=n.validators||{},s=e??0,a=u=>u.validators.filter(Boolean).map(l=>{const d=(l==null?void 0:l.cause)||t;let o=s;switch(d){case"change":o=r??s;break;case"blur":o=i??s;break;case"dynamic":o=h??s;break;case"submit":o=0;break}return t==="submit"&&(o=0),{cause:d,validate:l.fn,debounceMs:o}});return n.validationLogic({form:n.form,group:n.group,validators:n.validators,event:{type:t,fieldName:n.fieldName,async:!0},runValidation:a})}const De=t=>!!t&&typeof t=="object"&&"fields"in t;function Z(t,n){if(Object.is(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;if(t instanceof Date&&n instanceof Date)return t.getTime()===n.getTime();if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(const[r,h]of t)if(!n.has(r)||!Object.is(h,n.get(r)))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;return!0}const e=Object.keys(t),i=Object.keys(n);if(e.length!==i.length||e.length===0&&!Array.isArray(t)&&!Array.isArray(n)&&(Object.getPrototypeOf(t)!==Object.prototype||Object.getPrototypeOf(n)!==Object.prototype))return!1;for(const r of e)if(!i.includes(r)||!Z(t[r],n[r]))return!1;return!0}const Qe=({newFormValidatorError:t,isPreviousErrorFromFormValidator:n,previousErrorValue:e})=>t?{newErrorValue:t,newSource:"form"}:n?{newErrorValue:void 0,newSource:void 0}:e?{newErrorValue:e,newSource:"field"}:{newErrorValue:void 0,newSource:void 0},Pe=({formLevelError:t,fieldLevelError:n})=>n?{newErrorValue:n,newSource:"field"}:t?{newErrorValue:t,newSource:"form"}:{newErrorValue:void 0,newSource:void 0};function $(t,n){return t==null?n:{...t,...n}}let se=256;const ke=[];let Le;for(;se--;)ke[se]=(se+256).toString(16).substring(1);function vt(){let t=0,n,e="";if(!Le||se+16>256){for(Le=new Array(256),t=256;t--;)Le[t]=256*Math.random()|0;t=0,se=0}for(;t<16;t++)n=Le[se+t],t===6?e+=ke[n&15|64]:t===8?e+=ke[n&63|128]:e+=ke[n],t&1&&t>1&&t<11&&(e+="-");return se++,e}const zt=Ot(t=>K.emit("form-state",{id:t.formId,state:t.store.state}),{wait:300});function Se(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(Array.isArray(t)){const e=[];for(let i=0;i<t.length;i++)e[i]=Se(t[i]);return e}if(t instanceof Map){const e=new Map;return t.forEach((i,r)=>{e.set(r,Se(i))}),e}if(t instanceof Set){const e=new Set;return t.forEach(i=>{e.add(Se(i))}),e}const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=Se(t[e]));return n}function ne(t,n){return n===t||n.startsWith(`${t}.`)||n.startsWith(`${t}[`)}const q=t=>{if(!t.validators)return t.runValidation({validators:[],form:t.form});const n=t.event.async,e=n?void 0:{fn:t.validators.onMount,cause:"mount"},i={fn:n?t.validators.onChangeAsync:t.validators.onChange,cause:"change"},r={fn:n?t.validators.onBlurAsync:t.validators.onBlur,cause:"blur"},h={fn:n?t.validators.onSubmitAsync:t.validators.onSubmit,cause:"submit"},s=n?void 0:{fn:()=>{},cause:"server"};switch(t.event.type){case"mount":return t.runValidation({validators:[e],form:t.form});case"submit":return t.runValidation({validators:[i,r,h,s],form:t.form});case"server":return t.runValidation({validators:[],form:t.form});case"blur":return t.runValidation({validators:[r,s],form:t.form});case"change":return t.runValidation({validators:[i,s],form:t.form});default:throw new Error(`Unknown validation event type: ${t.event.type}`)}};function qt(t,n){const e=new Map;for(const i of t){const r=i.path??[];let h=n,s="";for(let a=0;a<r.length;a++){const u=r[a];if(u===void 0)continue;const l=typeof u=="object"?u.key:u,d=Number(l);Array.isArray(h)&&!Number.isNaN(d)?s+=`[${d}]`:s+=(a>0?".":"")+String(l),typeof h=="object"&&h!==null?h=h[l]:h=void 0}e.set(s,(e.get(s)??[]).concat(i))}return Object.fromEntries(e)}const lt=(t,n)=>{const e=qt(t,n);return{form:e,fields:e}},ae={validate({value:t,validationSource:n},e){const i=e["~standard"].validate(t);if(i instanceof Promise)throw new Error("async function passed to sync validator");if(i.issues)return n==="field"?i.issues:lt(i.issues,t)},async validateAsync({value:t,validationSource:n},e){const i=await e["~standard"].validate(t);if(i.issues)return n==="field"?i.issues:lt(i.issues,t)}},Je=t=>!!t&&"~standard"in t,O={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,isValid:!0,isDefaultValue:!0,errors:[],errorMap:{},errorSourceMap:{},_arrayVersion:0,_pendingValidationsCount:0};function Y(t){function n(o){const f=t.getFieldMeta(o)??O;t.setFieldMeta(o,{...f,_arrayVersion:(f._arrayVersion||0)+1})}function e(o,f,m){n(o);const c=a(o,f,"move",m),g=Math.min(f,m),v=Math.max(f,m);for(let F=g;F<=v;F++)c.push(s(o,F));const S=Object.keys(t.fieldInfo).reduce((F,M)=>(M.startsWith(s(o,f))&&F.set(M,t.getFieldMeta(M)),F),new Map);l(c,f<m?"up":"down"),Object.keys(t.fieldInfo).filter(F=>F.startsWith(s(o,m))).forEach(F=>{const M=F.replace(s(o,m),s(o,f)),V=S.get(M);V&&t.setFieldMeta(F,V)})}function i(o,f){n(o);const m=a(o,f,"remove");l(m,"up")}function r(o,f,m){n(o),a(o,f,"swap",m).forEach(g=>{if(!g.toString().startsWith(s(o,f)))return;const v=g.toString().replace(s(o,f),s(o,m)),[S,F]=[t.getFieldMeta(g),t.getFieldMeta(v)];S&&t.setFieldMeta(v,S),F&&t.setFieldMeta(g,F)})}function h(o,f){n(o);const m=a(o,f,"insert");l(m,"down"),m.forEach(c=>{c.toString().startsWith(s(o,f))&&t.setFieldMeta(c,d())})}function s(o,f){return`${o}[${f}]`}function a(o,f,m,c){const g=[s(o,f)];switch(m){case"swap":g.push(s(o,c));break;case"move":{const[v,S]=[Math.min(f,c),Math.max(f,c)];for(let F=v;F<=S;F++)g.push(s(o,F));break}default:{const v=t.getFieldValue(o),S=Array.isArray(v)?v.length:0;for(let F=f+1;F<S;F++)g.push(s(o,F));break}}return Object.keys(t.fieldInfo).filter(v=>g.some(S=>v.startsWith(S)))}function u(o,f){return o.replace(/\[(\d+)\]/,(m,c)=>{const g=parseInt(c,10);return`[${f==="up"?g+1:Math.max(0,g-1)}]`})}function l(o,f){(f==="up"?o:[...o].reverse()).forEach(c=>{const g=u(c.toString(),f),v=t.getFieldMeta(g);v?t.setFieldMeta(c,v):t.setFieldMeta(c,d())})}const d=()=>O;return{bumpArrayVersion:n,handleArrayMove:e,handleArrayRemove:i,handleArraySwap:r,handleArrayInsert:h}}function We(t){return{values:t.values??{},errorMap:t.errorMap??{},fieldMetaBase:t.fieldMetaBase??{},formGroupStateBase:t.formGroupStateBase??{},isSubmitted:t.isSubmitted??!1,isSubmitting:t.isSubmitting??!1,isValidating:t.isValidating??!1,submissionAttempts:t.submissionAttempts??0,isSubmitSuccessful:t.isSubmitSuccessful??!1,validationMetaMap:t.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}}}class ut{constructor(n){var h;this.options={},this.fieldInfo={},this.formGroupApis=new Set,this.mount=()=>{var f,m;const s=this.store.subscribe(()=>{zt(this)}),a=K.on("request-form-state",c=>{c.payload.id===this._formId&&K.emit("form-api",{id:this._formId,state:this.store.state,options:this.options})}),u=K.on("request-form-reset",c=>{c.payload.id===this._formId&&this.reset()}),l=K.on("request-form-force-submit",c=>{c.payload.id===this._formId&&(this._devtoolsSubmissionOverride=!0,this.handleSubmit(),this._devtoolsSubmissionOverride=!1)}),d=()=>{l(),u(),a(),s.unsubscribe(),K.emit("form-unmounted",{id:this._formId})};(m=(f=this.options.listeners)==null?void 0:f.onMount)==null||m.call(f,{formApi:this});const{onMount:o}=this.options.validators||{};return K.emit("form-api",{id:this._formId,state:this.store.state,options:this.options}),o&&this.validateSync("mount"),d},this.update=s=>{if(!s)return;const a=this.options;this.options=s;const u=s.defaultValues&&!Z(s.defaultValues,a.defaultValues)&&!this.state.isTouched,l=!Z(s.defaultState,a.defaultState)&&!this.state.isTouched;if(!(!u&&!l)){if(_(()=>{this.baseStore.setState(()=>We(Object.assign({},this.state,l?s.defaultState:{},u?{values:s.defaultValues}:{})))}),u){const d=Y(this);for(const o of Object.keys(this.fieldInfo))Array.isArray(this.getFieldValue(o))&&d.bumpArrayVersion(o)}K.emit("form-api",{id:this._formId,state:this.store.state,options:this.options})}},this.reset=(s,a)=>{const{fieldMeta:u}=this.state,l=this.resetFieldMeta(u);s&&!(a!=null&&a.keepDefaultValues)&&(this.options={...this.options,defaultValues:s}),this.baseStore.setState(()=>{var o;let d=s??this.options.defaultValues??((o=this.options.defaultState)==null?void 0:o.values);return s||Object.values(this.fieldInfo).forEach(f=>{f.instance&&f.instance.options.defaultValue!==void 0&&(d=be(d,f.instance.name,f.instance.options.defaultValue))}),We({...this.options.defaultState,values:d,fieldMetaBase:l})})},this.validateAllFields=async s=>{const a=[];return _(()=>{Object.values(this.fieldInfo).forEach(l=>{if(!l.instance)return;const d=l.instance;a.push(Promise.resolve().then(()=>d.validate(s,{skipFormValidation:!0,skipGroupValidation:!0}))),l.instance.store.state.meta.isTouched||l.instance.setMeta(o=>({...o,isTouched:!0}))})}),(await Promise.all(a)).flat()},this.validateArrayFieldsStartingFrom=async(s,a,u)=>{const l=this.getFieldValue(s),d=Array.isArray(l)?Math.max(l.length-1,0):null,o=[`${s}[${a}]`];for(let g=a+1;g<=(d??0);g++)o.push(`${s}[${g}]`);const f=Object.keys(this.fieldInfo).filter(g=>o.some(v=>g.startsWith(v))),m=[];return _(()=>{f.forEach(g=>{m.push(Promise.resolve().then(()=>this.validateField(g,u)))})}),(await Promise.all(m)).flat()},this.validateField=(s,a)=>{var l,d;const u=(l=this.fieldInfo[s])==null?void 0:l.instance;if(!u){const{hasErrored:o}=this.validateSync(a);return o&&!this.options.asyncAlways?((d=this.getFieldMeta(s))==null?void 0:d.errors)??[]:this.validateAsync(a).then(()=>{var f;return((f=this.getFieldMeta(s))==null?void 0:f.errors)??[]})}return u.store.state.meta.isTouched||u.setMeta(o=>({...o,isTouched:!0})),u.validate(a)},this.validateSync=(s,a)=>{const u=pe(s,{...this.options,form:this,group:a==null?void 0:a.group,validationLogic:this.options.validationLogic||q});let l=!1;const d={};return _(()=>{var m,c,g;for(const v of u){if(!v.validate)continue;const S=this.runValidator({validate:v.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:F,fieldErrors:M}=Be(S),V=Fe(v.cause);let w=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(M||{})]);a!=null&&a.filterFieldNames&&(w=new Set([...w].filter(a.filterFieldNames)));for(const b of w){if(this.baseStore.state.fieldMetaBase[b]===void 0&&!(M!=null&&M[b]))continue;const L=this.getFieldMeta(b)??O,{errorMap:E,errorSourceMap:A}=L,D=M==null?void 0:M[b],{newErrorValue:j,newSource:T}=Qe({newFormValidatorError:D,isPreviousErrorFromFormValidator:(A==null?void 0:A[V])==="form",previousErrorValue:E==null?void 0:E[V]});T==="form"&&(d[b]={...d[b],[V]:D}),(E==null?void 0:E[V])!==j&&this.setFieldMeta(b,(I=O)=>({...I,errorMap:{...I.errorMap,[V]:j},errorSourceMap:{...I.errorSourceMap,[V]:T}}))}a!=null&&a.dontUpdateFormErrorMap||((m=this.state.errorMap)==null?void 0:m[V])!==F&&this.baseStore.setState(b=>({...b,errorMap:{...b.errorMap,[V]:F}})),(F||M)&&(l=!0)}if(a!=null&&a.dontUpdateFormErrorMap)return;const o=Fe("submit");(c=this.state.errorMap)!=null&&c[o]&&s!=="submit"&&!l&&this.baseStore.setState(v=>({...v,errorMap:{...v.errorMap,[o]:void 0}}));const f=Fe("server");(g=this.state.errorMap)!=null&&g[f]&&s!=="server"&&!l&&this.baseStore.setState(v=>({...v,errorMap:{...v.errorMap,[f]:void 0}}))}),{hasErrored:l,fieldsErrorMap:d}},this.validateAsync=async(s,a)=>{const u=ye(s,{...this.options,form:this,group:a==null?void 0:a.group,validationLogic:this.options.validationLogic||q});this.state.isFormValidating||this.baseStore.setState(m=>({...m,isFormValidating:!0}));const l=[];let d;for(const m of u){if(!m.validate)continue;const c=Fe(m.cause),g=this.state.validationMetaMap[c];g==null||g.lastAbortController.abort();const v=new AbortController;this.state.validationMetaMap[c]={lastAbortController:v},l.push(new Promise(async S=>{let F;try{F=await new Promise((E,A)=>{setTimeout(async()=>{if(v.signal.aborted)return E(void 0);try{E(await this.runValidator({validate:m.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:v.signal},type:"validateAsync"}))}catch(D){A(D)}},m.debounceMs)})}catch(E){F=E}const{formError:M,fieldErrors:V}=Be(F);V&&(d=d?{...d,...V}:V);const w=Fe(m.cause),b=new Set([...Object.keys(this.state.fieldMeta),...Object.keys(d||{})]);let L=Array.from(b);a!=null&&a.filterFieldNames&&(L=L.filter(a.filterFieldNames));for(const E of L){if(this.baseStore.state.fieldMetaBase[E]===void 0&&!(d!=null&&d[E]))continue;const A=this.getFieldMeta(E)??O,{errorMap:D,errorSourceMap:j}=A,T=d==null?void 0:d[E],{newErrorValue:I,newSource:P}=Qe({newFormValidatorError:T,isPreviousErrorFromFormValidator:(j==null?void 0:j[w])==="form",previousErrorValue:D==null?void 0:D[w]});(D==null?void 0:D[w])!==I&&this.setFieldMeta(E,(R=O)=>({...R,errorMap:{...R.errorMap,[w]:I},errorSourceMap:{...R.errorSourceMap,[w]:P}}))}a!=null&&a.dontUpdateFormErrorMap||this.baseStore.setState(E=>({...E,errorMap:{...E.errorMap,[w]:M}})),S(d?{fieldErrors:d,errorMapKey:w}:void 0)}))}let o=[];const f={};if(l.length){o=await Promise.all(l);for(const m of o)if(m!=null&&m.fieldErrors){const{errorMapKey:c}=m;for(const[g,v]of Object.entries(m.fieldErrors)){const F={...f[g]||{},[c]:v};f[g]=F}}}return this.baseStore.setState(m=>({...m,isFormValidating:!1})),f},this.validate=(s,a)=>{const{hasErrored:u,fieldsErrorMap:l}=this.validateSync(s,a);return u&&!this.options.asyncAlways?l:this.validateAsync(s,a)},this._handleSubmit=async s=>{var l,d,o,f,m,c,g,v,S,F;this.baseStore.setState(M=>({...M,isSubmitted:!1,submissionAttempts:M.submissionAttempts+1,isSubmitSuccessful:!1})),_(()=>{Object.values(this.fieldInfo).forEach(M=>{M.instance&&(M.instance.store.state.meta.isTouched||M.instance.setMeta(V=>({...V,isTouched:!0})))})});const a=s??this.options.onSubmitMeta;if(!this.state.canSubmit&&!this._devtoolsSubmissionOverride&&this.baseStore.state.submissionAttempts<=1){(d=(l=this.options).onSubmitInvalid)==null||d.call(l,{value:this.state.values,formApi:this,meta:a});return}this.baseStore.setState(M=>({...M,isSubmitting:!0}));const u=()=>{this.baseStore.setState(M=>({...M,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){u(),(f=(o=this.options).onSubmitInvalid)==null||f.call(o,{value:this.state.values,formApi:this,meta:a}),K.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"validateAllFields",errors:Object.values(this.state.fieldMeta).map(M=>M.errors).flat()});return}if(await this.validate("submit"),!this.state.isValid){u(),(c=(m=this.options).onSubmitInvalid)==null||c.call(m,{value:this.state.values,formApi:this,meta:a}),K.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"validate",errors:this.state.errors});return}_(()=>{Object.values(this.fieldInfo).forEach(M=>{var V;(V=M.instance)==null||V.triggerOnSubmitListener()})}),(v=(g=this.options.listeners)==null?void 0:g.onSubmit)==null||v.call(g,{formApi:this,meta:a});try{await((F=(S=this.options).onSubmit)==null?void 0:F.call(S,{value:this.state.values,formApi:this,meta:a})),_(()=>{this.baseStore.setState(M=>({...M,isSubmitted:!0,isSubmitSuccessful:!0})),K.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!0}),u()})}catch(M){throw this.baseStore.setState(V=>({...V,isSubmitSuccessful:!1})),K.emit("form-submission",{id:this._formId,submissionAttempt:this.state.submissionAttempts,successful:!1,stage:"inflight",onError:M}),u(),M}},this.getFieldValue=s=>oe(this.state.values,s),this.getFieldMeta=s=>this.state.fieldMeta[s],this.getFormGroupMeta=s=>this.formGroupMetaDerived.state[s],this.getFieldInfo=s=>{var a;return(a=this.fieldInfo)[s]||(a[s]={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}})},this.setFieldMeta=(s,a)=>{this.baseStore.setState(u=>({...u,fieldMetaBase:{...u.fieldMetaBase,[s]:ge(a,u.fieldMetaBase[s])}}))},this.resetFieldMeta=s=>Object.keys(s).reduce((a,u)=>{const l=u;return a[l]=O,a},{}),this.setFieldValue=(s,a,u)=>{var f;const l=(u==null?void 0:u.dontUpdateMeta)??!1,d=(u==null?void 0:u.dontRunListeners)??!1,o=(u==null?void 0:u.dontValidate)??!1;_(()=>{l||this.setFieldMeta(s,m=>({...m,isTouched:!0,isDirty:!0,errorMap:{...m==null?void 0:m.errorMap,onMount:void 0}})),this.baseStore.setState(m=>({...m,values:be(m.values,s,a)}))}),d||(f=this.getFieldInfo(s).instance)==null||f.triggerOnChangeListener(),o||this.validateField(s,"change")},this.deleteField=s=>{const u=[...Object.keys(this.fieldInfo).filter(l=>{const d=s.toString();return l.startsWith(`${d}.`)||l.startsWith(`${d}[`)}),s];this.baseStore.setState(l=>{const d={...l};return u.forEach(o=>{d.values=Wt(d.values,o),delete this.fieldInfo[o],delete d.fieldMetaBase[o]}),d})},this.pushFieldValue=(s,a,u)=>{this.setFieldValue(s,l=>[...Array.isArray(l)?l:[],a],u),Y(this).bumpArrayVersion(s)},this.insertFieldValue=async(s,a,u,l)=>{this.setFieldValue(s,o=>[...o.slice(0,a),u,...o.slice(a)],$(l,{dontValidate:!0}));const d=(l==null?void 0:l.dontValidate)??!1;d||await this.validateField(s,"change"),Y(this).handleArrayInsert(s,a),d||await this.validateArrayFieldsStartingFrom(s,a,"change")},this.replaceFieldValue=async(s,a,u,l)=>{this.setFieldValue(s,o=>o.map((f,m)=>m===a?u:f),$(l,{dontValidate:!0})),Y(this).bumpArrayVersion(s),((l==null?void 0:l.dontValidate)??!1)||(await this.validateField(s,"change"),await this.validateArrayFieldsStartingFrom(s,a,"change"))},this.removeFieldValue=async(s,a,u)=>{const l=this.getFieldValue(s),d=Array.isArray(l)?Math.max(l.length-1,0):null;if(this.setFieldValue(s,f=>f.filter((m,c)=>c!==a),$(u,{dontValidate:!0})),Y(this).handleArrayRemove(s,a),d!==null){const f=`${s}[${d}]`;this.deleteField(f)}((u==null?void 0:u.dontValidate)??!1)||(await this.validateField(s,"change"),await this.validateArrayFieldsStartingFrom(s,a,"change"))},this.swapFieldValues=(s,a,u,l)=>{this.setFieldValue(s,o=>{const f=o[a],m=o[u];return be(be(o,`${a}`,m),`${u}`,f)},$(l,{dontValidate:!0})),Y(this).handleArraySwap(s,a,u),((l==null?void 0:l.dontValidate)??!1)||(this.validateField(s,"change"),this.validateField(`${s}[${a}]`,"change"),this.validateField(`${s}[${u}]`,"change"))},this.moveFieldValues=(s,a,u,l)=>{this.setFieldValue(s,o=>{const f=[...o];return f.splice(u,0,f.splice(a,1)[0]),f},$(l,{dontValidate:!0})),Y(this).handleArrayMove(s,a,u),((l==null?void 0:l.dontValidate)??!1)||(this.validateField(s,"change"),this.validateField(`${s}[${a}]`,"change"),this.validateField(`${s}[${u}]`,"change"))},this.clearFieldValues=(s,a)=>{const u=this.getFieldValue(s),l=Array.isArray(u)?Math.max(u.length-1,0):null;if(this.setFieldValue(s,[],$(a,{dontValidate:!0})),Y(this).bumpArrayVersion(s),l!==null)for(let o=0;o<=l;o++){const f=`${s}[${o}]`;this.deleteField(f)}((a==null?void 0:a.dontValidate)??!1)||this.validateField(s,"change")},this.resetField=s=>{this.baseStore.setState(a=>{var o;const u=(o=this.getFieldInfo(s).instance)==null?void 0:o.options.defaultValue,l=oe(this.options.defaultValues,s),d=u??l;return{...a,fieldMetaBase:{...a.fieldMetaBase,[s]:O},values:d!==void 0?be(a.values,s,d):a.values}})},this.setErrorMap=s=>{_(()=>{Object.entries(s).forEach(([a,u])=>{const l=a;if(De(u)){const{formError:d,fieldErrors:o}=Be(u);for(const f of Object.keys(this.fieldInfo))this.getFieldMeta(f)&&this.setFieldMeta(f,c=>({...c,errorMap:{...c.errorMap,[l]:o==null?void 0:o[f]},errorSourceMap:{...c.errorSourceMap,[l]:"form"}}));this.baseStore.setState(f=>({...f,errorMap:{...f.errorMap,[l]:d}}))}else this.baseStore.setState(d=>({...d,errorMap:{...d.errorMap,[l]:u}}))})})},this.getAllErrors=()=>({form:{errors:this.state.errors,errorMap:this.state.errorMap},fields:Object.entries(this.state.fieldMeta).reduce((s,[a,u])=>(Object.keys(u).length&&u.errors.length&&(s[a]={errors:u.errors,errorMap:u.errorMap}),s),{})}),this.parseValuesWithSchema=s=>ae.validate({value:this.state.values,validationSource:"form"},s),this.parseValuesWithSchemaAsync=s=>ae.validateAsync({value:this.state.values,validationSource:"form"},s),this.timeoutIds={validations:{},listeners:{},formListeners:{}},this._formId=(n==null?void 0:n.formId)??vt(),this._devtoolsSubmissionOverride=!1;let e=We({...n==null?void 0:n.defaultState,values:(n==null?void 0:n.defaultValues)??((h=n==null?void 0:n.defaultState)==null?void 0:h.values)});if(n!=null&&n.transform){e=n.transform({state:e}).state;for(const s of Object.keys(e.errorMap)){const a=e.errorMap[s];if(!(a===void 0||!De(a)))for(const u of Object.keys(a.fields)){const l=a.fields[u];if(l===void 0)continue;const d=e.fieldMetaBase[u];e.fieldMetaBase[u]={isTouched:!1,isValidating:!1,isBlurred:!1,isDirty:!1,_arrayVersion:0,_pendingValidationsCount:0,...d??{},errorSourceMap:{...(d==null?void 0:d.errorSourceMap)??{},onChange:"form"},errorMap:{...(d==null?void 0:d.errorMap)??{},[s]:l}}}}}this.baseStore=ie(e);let i;this.fieldMetaDerived=ie(s=>{var d,o,f;const a=this.baseStore.get();let u=0;const l={};for(const m of Object.keys(a.fieldMetaBase)){const c=a.fieldMetaBase[m],g=i==null?void 0:i.fieldMetaBase[m],v=s==null?void 0:s[m],S=oe(a.values,m);let F=v==null?void 0:v.errors;if(!g||c.errorMap!==g.errorMap){F=Object.values(c.errorMap??{}).filter(L=>L!==void 0);const b=(d=this.getFieldInfo(m))==null?void 0:d.instance;(!b||!b.options.disableErrorFlat)&&(F=F.flat(1))}const M=!Kt(F),V=!c.isDirty,w=Z(S,((f=(o=this.getFieldInfo(m))==null?void 0:o.instance)==null?void 0:f.options.defaultValue)??oe(this.options.defaultValues,m));if(v&&v.isPristine===V&&v.isValid===M&&v.isDefaultValue===w&&v.errors===F&&c===g){l[m]=v,u++;continue}l[m]={...c,errors:F??[],isPristine:V,isValid:M,isDefaultValue:w}}return Object.keys(a.fieldMetaBase).length?s&&u===Object.keys(a.fieldMetaBase).length?s:(i=this.baseStore.get(),l):l}),this.formGroupMetaDerived=ie(s=>{const a=this.baseStore.get(),u=this.fieldMetaDerived.get(),l={};for(const d of this.formGroupApis){const o=d.name,f=a.formGroupStateBase[o]??{isSubmitted:!1,isSubmitting:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1},m=u[o];let c=!1,g=!0,v=!1,S=!1,F=!0,M=!1;for(const W in u){if(W===o||!ne(o,W))continue;const B=u[W];B&&(B.isValidating&&(c=!0),B.isValid||(g=!1),B.isTouched&&(v=!0),B.isBlurred&&(S=!0),B.isDefaultValue||(F=!1),B.isDirty&&(M=!0))}const V=!M,w=!!c||f.isValidating,b=(m==null?void 0:m.errorMap)??{},L=(m==null?void 0:m.errorSourceMap)??{},E=!!(b.onMount||Object.entries(u).some(([W,B])=>B&&W!==o&&ne(o,W)&&B.errorMap.onMount)),A=s==null?void 0:s[o];let D=(A==null?void 0:A.errors)??[];(!A||A.__srcErrorMap!==b)&&(D=Object.values(b).reduce((W,B)=>{if(B===void 0)return W;if(B&&typeof B=="object"&&"fields"in B){const Ye=B.group;return Ye!==void 0&&W.push(Ye),W}return W.push(B),W},[]));const j=D.length===0,T=g&&j,I=d.options.canSubmitWhenInvalid??!1,P=f.submissionAttempts===0&&!v&&!E||!w&&!f.isSubmitting&&T||I;if(A&&A.errorMap===b&&A.errorSourceMap===L&&A.errors===D&&A.isFieldsValidating===c&&A.isFieldsValid===g&&A.isGroupValid===j&&A.isValid===T&&A.canSubmit===P&&A.isTouched===v&&A.isBlurred===S&&A.isPristine===V&&A.isDefaultValue===F&&A.isDirty===M&&A.isValidating===w&&A.isSubmitting===f.isSubmitting&&A.isSubmitted===f.isSubmitted&&A.submissionAttempts===f.submissionAttempts&&A.isSubmitSuccessful===f.isSubmitSuccessful){l[o]=A;continue}const R={...f,errorMap:b,errorSourceMap:L,_arrayVersion:(m==null?void 0:m._arrayVersion)??0,isTouched:v,isBlurred:S,isDirty:M,isPristine:V,isDefaultValue:F,isValid:T,errors:D,isValidating:w,isFieldsValidating:c,isFieldsValid:g,isGroupValid:j,canSubmit:P};Object.defineProperty(R,"__srcErrorMap",{value:b,enumerable:!1,configurable:!0}),l[o]=R}return l});let r;this.store=ie(s=>{var j,T;const a=this.baseStore.get(),u=this.fieldMetaDerived.get(),l=Object.values(u).filter(Boolean),d=l.some(I=>I.isValidating),o=l.every(I=>I.isValid),f=l.some(I=>I.isTouched),m=l.some(I=>I.isBlurred),c=l.every(I=>I.isDefaultValue),g=f&&((j=a.errorMap)==null?void 0:j.onMount),v=l.some(I=>I.isDirty),S=!v,F=!!((T=a.errorMap)!=null&&T.onMount||l.some(I=>{var P;return(P=I==null?void 0:I.errorMap)==null?void 0:P.onMount})),M=!!d;let V=(s==null?void 0:s.errors)??[];(!r||a.errorMap!==r.errorMap)&&(V=Object.values(a.errorMap).reduce((I,P)=>P===void 0?I:P&&De(P)?(I.push(P.form),I):(I.push(P),I),[]));const w=V.length===0,b=o&&w,L=this.options.canSubmitWhenInvalid??!1,E=a.submissionAttempts===0&&!f&&!F||!M&&!a.isSubmitting&&b||L;let A=a.errorMap;if(g&&(V=V.filter(I=>I!==a.errorMap.onMount),A=Object.assign(A,{onMount:void 0})),s&&r&&s.errorMap===A&&s.fieldMeta===this.fieldMetaDerived.state&&s.errors===V&&s.isFieldsValidating===d&&s.isFieldsValid===o&&s.isFormValid===w&&s.isValid===b&&s.canSubmit===E&&s.isTouched===f&&s.isBlurred===m&&s.isPristine===S&&s.isDefaultValue===c&&s.isDirty===v&&Z(r,a))return s;const D={...a,errorMap:A,fieldMeta:this.fieldMetaDerived.state,errors:V,isFieldsValidating:d,isFieldsValid:o,isFormValid:w,isValid:b,canSubmit:E,isTouched:f,isBlurred:m,isPristine:S,isDefaultValue:c,isDirty:v};return r=this.baseStore.get(),D}),this.handleSubmit=this.handleSubmit.bind(this),this.update(n||{})}get state(){return this.store.state}get formId(){return this._formId}runValidator(n){return Je(n.validate)?ae[n.type](n.value,n.validate):n.validate(n.value)}handleSubmit(n){return this._handleSubmit(n)}}function Be(t){if(t){if(De(t)){const n=Be(t.form).formError,e=t.fields;return{formError:n,fieldErrors:e}}return{formError:t}}return{formError:void 0}}function Fe(t){switch(t){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}class Ve{constructor(n){this.options={},this.mount=()=>{var r,h;this.options.defaultValue!==void 0&&!this.getMeta().isTouched&&this.form.setFieldValue(this.name,this.options.defaultValue,{dontUpdateMeta:!0});const e=this.getInfo();e.instance=this,this.update(this.options);const{onMount:i}=this.options.validators||{};if(i){const s=this.runValidator({validate:i,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});s&&this.setMeta(a=>({...a,errorMap:{...a==null?void 0:a.errorMap,onMount:s},errorSourceMap:{...a==null?void 0:a.errorSourceMap,onMount:"field"}}))}return(h=(r=this.options.listeners)==null?void 0:r.onMount)==null||h.call(r,{value:this.state.value,fieldApi:this}),()=>{var a,u,l,d;for(const[o,f]of Object.entries(this.timeoutIds.validations))f&&(clearTimeout(f),this.timeoutIds.validations[o]=null);for(const[o,f]of Object.entries(this.timeoutIds.listeners))f&&(clearTimeout(f),this.timeoutIds.listeners[o]=null);for(const[o,f]of Object.entries(this.timeoutIds.formListeners))f&&(clearTimeout(f),this.timeoutIds.formListeners[o]=null);const s=this.form.fieldInfo[this.name];if(s&&s.instance===this){for(const[o,f]of Object.entries(s.validationMetaMap))f==null||f.lastAbortController.abort(),s.validationMetaMap[o]=void 0;this.form.baseStore.setState(o=>{var f,m,c;return{...o,fieldMetaBase:{...o.fieldMetaBase,[this.name]:{...O,isTouched:((f=o.fieldMetaBase[this.name])==null?void 0:f.isTouched)??O.isTouched,isBlurred:((m=o.fieldMetaBase[this.name])==null?void 0:m.isBlurred)??O.isBlurred,isDirty:((c=o.fieldMetaBase[this.name])==null?void 0:c.isDirty)??O.isDirty}}}}),s.instance=null,(u=(a=this.options.listeners)==null?void 0:a.onUnmount)==null||u.call(a,{value:this.state.value,fieldApi:this}),(d=(l=this.form.options.listeners)==null?void 0:l.onFieldUnmount)==null||d.call(l,{formApi:this.form,fieldApi:this})}}},this.update=e=>{if(this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0){const i=this.form.getFieldValue(this.name);Z(i,e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})}this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,this.state.meta)},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(e,i)=>{this.form.setFieldValue(this.name,e,$(i,{dontRunListeners:!0,dontValidate:!0})),i!=null&&i.dontRunListeners||this.triggerOnChangeListener(),i!=null&&i.dontValidate||this.validate("change")},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(e,i)=>{this.form.pushFieldValue(this.name,e,$(i,{dontRunListeners:!0})),i!=null&&i.dontRunListeners||this.triggerOnChangeListener()},this.insertValue=(e,i,r)=>{this.form.insertFieldValue(this.name,e,i,$(r,{dontRunListeners:!0})),r!=null&&r.dontRunListeners||this.triggerOnChangeListener()},this.replaceValue=(e,i,r)=>{this.form.replaceFieldValue(this.name,e,i,$(r,{dontRunListeners:!0})),r!=null&&r.dontRunListeners||this.triggerOnChangeListener()},this.removeValue=(e,i)=>{this.form.removeFieldValue(this.name,e,$(i,{dontRunListeners:!0})),i!=null&&i.dontRunListeners||this.triggerOnChangeListener()},this.swapValues=(e,i,r)=>{this.form.swapFieldValues(this.name,e,i,$(r,{dontRunListeners:!0})),r!=null&&r.dontRunListeners||this.triggerOnChangeListener()},this.moveValue=(e,i,r)=>{this.form.moveFieldValues(this.name,e,i,$(r,{dontRunListeners:!0})),r!=null&&r.dontRunListeners||this.triggerOnChangeListener()},this.clearValues=e=>{this.form.clearFieldValues(this.name,$(e,{dontRunListeners:!0})),e!=null&&e.dontRunListeners||this.triggerOnChangeListener()},this.getLinkedFields=e=>{const i=Object.values(this.form.fieldInfo),r=[];for(const h of i){if(!h.instance||!(h.instance instanceof Ve))continue;const{onChangeListenTo:s,onBlurListenTo:a}=h.instance.options.validators||{};e==="change"&&(s!=null&&s.includes(this.name))&&r.push(h.instance),e==="blur"&&(a!=null&&a.includes(this.name))&&r.push(h.instance)}return r},this.validateSync=(e,i)=>{var l;const r=pe(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||q}),s=this.getLinkedFields(e).reduce((d,o)=>{const f=pe(e,{...o.options,form:o.form,fieldName:o.name,validationLogic:o.form.options.validationLogic||q});return f.forEach(m=>{m.field=o}),d.concat(f)},[]);let a=!1;_(()=>{const d=(o,f)=>{var F;const m=Me(f.cause),c=f.validate?dt(o.runValidator({validate:f.validate,value:{value:o.store.state.value,validationSource:"field",fieldApi:o},type:"validate"})):void 0,g=i[m],{newErrorValue:v,newSource:S}=Pe({formLevelError:g,fieldLevelError:c});((F=o.state.meta.errorMap)==null?void 0:F[m])!==v&&o.setMeta(M=>({...M,errorMap:{...M.errorMap,[m]:v},errorSourceMap:{...M.errorSourceMap,[m]:S}})),v&&(a=!0)};for(const o of r)d(this,o);for(const o of s)o.validate&&d(o.field,o)});const u=Me("submit");return(l=this.state.meta.errorMap)!=null&&l[u]&&e!=="submit"&&!a&&this.setMeta(d=>({...d,errorMap:{...d.errorMap,[u]:void 0},errorSourceMap:{...d.errorSourceMap,[u]:void 0}})),{hasErrored:a}},this.validateAsync=async(e,i)=>{const r=ye(e,{...this.options,form:this.form,fieldName:this.name,validationLogic:this.form.options.validationLogic||q}),h=await i,a=this.getLinkedFields(e).reduce((c,g)=>{const v=ye(e,{...g.options,form:g.form,fieldName:g.name,validationLogic:g.form.options.validationLogic||q});return v.forEach(S=>{S.field=g}),c.concat(v)},[]),u=[],l=[],d=r.some(c=>c.validate),o=Array.from(new Set(a.filter(c=>c.validate).map(c=>c.field)));_(()=>{d&&this.startValidation();for(const c of o)c.startValidation()});const f=(c,g,v)=>{const S=Me(g.cause),F=c.getInfo(),M=F.validationMetaMap[S];M==null||M.lastAbortController.abort();const V=new AbortController;F.validationMetaMap[S]={lastAbortController:V},v.push(new Promise(async w=>{var j;let b;try{b=await new Promise((T,I)=>{c.timeoutIds.validations[g.cause]&&(clearTimeout(c.timeoutIds.validations[g.cause]),c.endValidation()),c.timeoutIds.validations[g.cause]=setTimeout(async()=>{if(V.signal.aborted)return T(void 0);try{T(await this.runValidator({validate:g.validate,value:{value:c.store.state.value,fieldApi:c,signal:V.signal,validationSource:"field"},type:"validateAsync"}))}catch(P){I(P)}},g.debounceMs)})}catch(T){b=T}if(V.signal.aborted)return w(void 0);const L=dt(b),E=(j=h[c.name])==null?void 0:j[S],{newErrorValue:A,newSource:D}=Pe({formLevelError:E,fieldLevelError:L});if(c.getInfo().instance!==c)return w(void 0);c.setMeta(T=>({...T,errorMap:{...T==null?void 0:T.errorMap,[S]:A},errorSourceMap:{...T.errorSourceMap,[S]:D}})),w(A)}))};for(const c of r)c.validate&&f(this,c,u);for(const c of a)c.validate&&f(c.field,c,l);let m=[];return(u.length||l.length)&&(m=await Promise.all(u),await Promise.all(l)),_(()=>{d&&this.endValidation();for(const c of o)c.endValidation()}),m.filter(Boolean)},this.validate=(e,i)=>{var f,m;if(!this.state.meta.isTouched)return[];const r=i!=null&&i.skipGroupValidation?[]:Array.from(this.form.formGroupApis).filter(c=>this.name.startsWith(c.name));let s=(i!=null&&i.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e)).fieldsErrorMap[this.name]??{};if(!(i!=null&&i.skipFormValidation))for(const c of r){if(c.state.meta.submissionAttempts===0)continue;const{fieldsErrorMap:g}=this.form.validateSync(e,{group:c,dontUpdateFormErrorMap:!0,filterFieldNames:v=>ne(c.name,v)});s={...s,...g[this.name]??{}}}const{hasErrored:a}=this.validateSync(e,s),u=new WeakMap;for(const c of r){const{hasErrored:g}=c.validateSync(e,{},{skipRelatedFieldValidation:!0});u.set(c,g)}if(a&&!this.options.asyncAlways){(f=this.getInfo().validationMetaMap[Me(e)])==null||f.lastAbortController.abort();const c=[];for(const g of r)(m=g.getInfo().validationMetaMap[Me(e)])==null||m.lastAbortController.abort(),c.push(g.state.meta.errors);return[...this.state.meta.errors,...c.flat()]}const l=i!=null&&i.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e),d=this.validateAsync(e,l),o=[];for(const c of r)u.get(c)&&!c.options.asyncAlways||o.push(c.validateAsync(e,l,{skipRelatedFieldValidation:!0}));return o.length===0?d:Promise.all([d,...o]).then(c=>c.flat())},this.handleChange=e=>{this.setValue(e)},this.handleBlur=()=>{this.state.meta.isTouched||this.setMeta(i=>({...i,isTouched:!0})),this.state.meta.isBlurred||this.setMeta(i=>({...i,isBlurred:!0})),this.validate("blur"),this.triggerOnBlurListener()},this.setErrorMap=e=>{this.setMeta(i=>({...i,errorMap:{...i.errorMap,...e}}))},this.parseValueWithSchema=e=>ae.validate({value:this.state.value,validationSource:"field"},e),this.parseValueWithSchemaAsync=e=>ae.validateAsync({value:this.state.value,validationSource:"field"},e),this.triggerOnBlurListener=()=>{var r,h,s,a,u,l;const e=(r=this.form.options.listeners)==null?void 0:r.onBlurDebounceMs;e&&e>0?(this.timeoutIds.formListeners.blur&&clearTimeout(this.timeoutIds.formListeners.blur),this.timeoutIds.formListeners.blur=setTimeout(()=>{var d,o;(o=(d=this.form.options.listeners)==null?void 0:d.onBlur)==null||o.call(d,{formApi:this.form,fieldApi:this})},e)):(s=(h=this.form.options.listeners)==null?void 0:h.onBlur)==null||s.call(h,{formApi:this.form,fieldApi:this});const i=(a=this.options.listeners)==null?void 0:a.onBlurDebounceMs;i&&i>0?(this.timeoutIds.listeners.blur&&clearTimeout(this.timeoutIds.listeners.blur),this.timeoutIds.listeners.blur=setTimeout(()=>{var d,o;(o=(d=this.options.listeners)==null?void 0:d.onBlur)==null||o.call(d,{value:this.state.value,fieldApi:this})},i)):(l=(u=this.options.listeners)==null?void 0:u.onBlur)==null||l.call(u,{value:this.state.value,fieldApi:this})},this.triggerOnChangeListener=()=>{var r,h,s,a,u,l;const e=(r=this.form.options.listeners)==null?void 0:r.onChangeDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{var d,o;(o=(d=this.form.options.listeners)==null?void 0:d.onChange)==null||o.call(d,{formApi:this.form,fieldApi:this})},e)):(s=(h=this.form.options.listeners)==null?void 0:h.onChange)==null||s.call(h,{formApi:this.form,fieldApi:this});const i=(a=this.options.listeners)==null?void 0:a.onChangeDebounceMs;i&&i>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{var d,o;(o=(d=this.options.listeners)==null?void 0:d.onChange)==null||o.call(d,{value:this.state.value,fieldApi:this})},i)):(l=(u=this.options.listeners)==null?void 0:u.onChange)==null||l.call(u,{value:this.state.value,fieldApi:this});for(const d of this.form.formGroupApis)ne(d.name,this.name)&&d.triggerOnChangeListener()},this.triggerOnSubmitListener=()=>{var e,i;(i=(e=this.options.listeners)==null?void 0:e.onSubmit)==null||i.call(e,{value:this.state.value,fieldApi:this})},this.form=n.form,this.name=n.name,this.options=n,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.store=ie(e=>{this.form.store.get();const i=this.form.getFieldMeta(this.name)??{...O,...n.defaultMeta};let r=this.form.getFieldValue(this.name);return!i.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Z(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===i?e:{value:r,meta:i}})}get state(){return this.store.state}runValidator(n){return Je(n.validate)?ae[n.type](n.value,n.validate):n.validate(n.value)}startValidation(){this.setMeta(n=>{const e=n._pendingValidationsCount+1;return{...n,_pendingValidationsCount:e,isValidating:e>0&&!n.isValidating?!0:n.isValidating}})}endValidation(){this.setMeta(n=>{const e=Math.max(0,n._pendingValidationsCount-1);return{...n,_pendingValidationsCount:e,isValidating:e===0&&n.isValidating?!1:n.isValidating}})}}function dt(t){if(t)return t}function Me(t){switch(t){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}function Ue(t){return{isSubmitted:t.isSubmitted??!1,isSubmitting:t.isSubmitting??!1,isValidating:t.isValidating??!1,submissionAttempts:t.submissionAttempts??0,isSubmitSuccessful:t.isSubmitSuccessful??!1}}function Ht(t){return{...O,...t,errors:[],isPristine:!0,isValid:!0,isDefaultValue:!0,isFieldsValidating:!1,isFieldsValid:!0,isGroupValid:!0,canSubmit:!0,isSubmitting:!1,isSubmitted:!1,isValidating:!1,submissionAttempts:0,isSubmitSuccessful:!1}}class Ae{constructor(n){this.options={},this.setFormGroupState=e=>{this.form.baseStore.setState(i=>{const r=i.formGroupStateBase[this.name]??Ue({});return{...i,formGroupStateBase:{...i.formGroupStateBase,[this.name]:e(r)}}})},this._lastDistributedFieldNames={},this.update=e=>{if(this.options=e,this.name=e.name,!this.state.meta.isTouched&&this.options.defaultValue!==void 0){const i=this.form.getFieldValue(this.name);Z(i,e.defaultValue)||this.form.setFieldValue(this.name,e.defaultValue,{dontUpdateMeta:!0,dontValidate:!0,dontRunListeners:!0})}this.form.getFieldMeta(this.name)||this.form.setFieldMeta(this.name,{...O,...this.options.defaultMeta})},this.mount=()=>{var i,r;this.update(this.options),this.form.formGroupApis.add(this),this.fieldInfo.instance=this,this.form.baseStore.setState(h=>({...h,formGroupStateBase:{...h.formGroupStateBase,[this.name]:h.formGroupStateBase[this.name]??Ue({...this.options.defaultState})}}));const{onMount:e}=this.options.validators||{};if(e){const h=this.runValidator({validate:e,value:{value:this.state.value,groupApi:this,validationSource:"form"},type:"validate"});let s=h,a;ze(h)&&(s=h.group,a=h.fields);const u=Ke(s);u&&this.setMeta(l=>({...l,errorMap:{...l.errorMap,onMount:u},errorSourceMap:{...l.errorSourceMap,onMount:"field"}})),this.distributeFieldErrors("onMount",a)}return(r=(i=this.options.listeners)==null?void 0:i.onMount)==null||r.call(i,{value:this.state.value,groupApi:this}),()=>{var h,s;for(const[a,u]of Object.entries(this.timeoutIds.validations))u&&(clearTimeout(u),this.timeoutIds.validations[a]=null);for(const[a,u]of Object.entries(this.timeoutIds.listeners))u&&(clearTimeout(u),this.timeoutIds.listeners[a]=null);for(const[a,u]of Object.entries(this.timeoutIds.formListeners))u&&(clearTimeout(u),this.timeoutIds.formListeners[a]=null);if(this.fieldInfo.instance===this){for(const[a,u]of Object.entries(this.fieldInfo.validationMetaMap))u==null||u.lastAbortController.abort(),this.fieldInfo.validationMetaMap[a]=void 0;this.form.formGroupApis.delete(this),this.form.baseStore.setState(a=>({...a,formGroupStateBase:{...a.formGroupStateBase,[this.name]:Ue({})}})),this.fieldInfo.instance=null,(s=(h=this.options.listeners)==null?void 0:h.onUnmount)==null||s.call(h,{value:this.state.value,groupApi:this})}}},this.setValue=(e,i)=>{this.form.setFieldValue(this.name,e,$(i,{dontRunListeners:!0,dontValidate:!0})),i!=null&&i.dontRunListeners||this.triggerOnChangeListener(),i!=null&&i.dontValidate||this.validate("change")},this.getMeta=()=>this.store.state.meta,this.setMeta=e=>this.form.setFieldMeta(this.name,e),this.getInfo=()=>this.fieldInfo,this.getRelatedFields=()=>{const e=Object.values(this.form.fieldInfo),i=[];for(const r of e)r.instance&&r.instance instanceof Ve&&r.instance.name.startsWith(this.name)&&i.push(r.instance);return i},this.getRelatedFieldMetasDerived=()=>{const e=Object.entries(this.form.fieldMetaDerived.state),i=[];for(const[r,h]of e)r!==this.name&&ne(this.name,r)&&i.push({...h,name:r});return i},this.buildChildFieldName=e=>e===""?this.name:e.startsWith("[")?`${this.name}${e}`:`${this.name}.${e}`,this.distributeFieldErrors=(e,i)=>{const r=this._lastDistributedFieldNames[e]??new Set,h=new Set;if(i)for(const[u,l]of Object.entries(i))l==null||l===!1||h.add(this.buildChildFieldName(u));const s=new Set([...r,...h]);let a=!1;for(const u of s){const l=u.startsWith(this.name+"[")?u.slice(this.name.length):u.slice(this.name.length+1),d=i==null?void 0:i[l],o=this.form.getFieldMeta(u);if(!o&&!d)continue;const f=o==null?void 0:o.errorMap[e],m=(o==null?void 0:o.errorSourceMap[e])==="form",{newErrorValue:c,newSource:g}=Qe({newFormValidatorError:d,isPreviousErrorFromFormValidator:m,previousErrorValue:f});c&&(a=!0),!(f===c&&(o==null?void 0:o.errorSourceMap[e])===g)&&this.form.setFieldMeta(u,(v=O)=>({...v,errorMap:{...v.errorMap,[e]:c},errorSourceMap:{...v.errorSourceMap,[e]:g}}))}return this._lastDistributedFieldNames[e]=h,a},this.validateSync=(e,i,r={})=>{var d;const h=pe(e,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||q}),a=(r.skipRelatedFieldValidation?[]:this.getRelatedFields()).reduce((o,f)=>{const m=pe(e,{...f.options,form:f.form,validationLogic:f.form.options.validationLogic||q});return m.forEach(c=>{c.field=f}),o.concat(m)},[]);let u=!1;_(()=>{const o=(f,m)=>{var L;const c=Te(m.cause),g=f===this;let v;m.validate&&(v=f.runValidator({validate:m.validate,value:{value:f.store.state.value,validationSource:g?"form":"field",...f instanceof Ae?{groupApi:f}:{fieldApi:f}},type:"validate"}));let S=v,F;g&&ze(v)&&(S=v.group,F=v.fields);const M=Ke(S),V=i[c],{newErrorValue:w,newSource:b}=Pe({formLevelError:V,fieldLevelError:M});((L=f.state.meta.errorMap)==null?void 0:L[c])!==w&&f.setMeta(E=>({...E,errorMap:{...E.errorMap,[c]:w},errorSourceMap:{...E.errorSourceMap,[c]:b}})),w&&(u=!0),g&&this.distributeFieldErrors(c,F)&&(u=!0)};for(const f of h)o(this,f);for(const f of a)f.validate&&o(f.field,f)});const l=Te("submit");return(d=this.state.meta.errorMap)!=null&&d[l]&&e!=="submit"&&!u&&this.setMeta(o=>({...o,errorMap:{...o.errorMap,[l]:void 0},errorSourceMap:{...o.errorSourceMap,[l]:void 0}})),{hasErrored:u}},this.validateAsync=async(e,i,r={})=>{const h=ye(e,{...this.options,form:this.form,group:this,validationLogic:this.options.validationLogic||this.form.options.validationLogic||q}),s=await i,a=r.skipRelatedFieldValidation?[]:this.getRelatedFields(),u=a.reduce((c,g)=>{const v=ye(e,{...g.options,form:g.form,validationLogic:g.form.options.validationLogic||q});return v.forEach(S=>{S.field=g}),c.concat(v)},[]),l=[],d=[],o=h.some(c=>c.validate)||u.some(c=>c.validate);if(o){this.state.meta.isValidating||this.setMeta(c=>({...c,isValidating:!0}));for(const c of a)c.setMeta(g=>({...g,isValidating:!0}))}const f=(c,g,v)=>{const S=Te(g.cause),F=c.getInfo(),M=F.validationMetaMap[S];M==null||M.lastAbortController.abort();const V=new AbortController;F.validationMetaMap[S]={lastAbortController:V};const w=c===this;v.push(new Promise(async b=>{var P;let L;try{L=await new Promise((R,W)=>{c.timeoutIds.validations[g.cause]&&clearTimeout(c.timeoutIds.validations[g.cause]),c.timeoutIds.validations[g.cause]=setTimeout(async()=>{if(V.signal.aborted)return R(void 0);try{R(await this.runValidator({validate:g.validate,value:{value:c.store.state.value,signal:V.signal,validationSource:w?"form":"field",...c instanceof Ae?{groupApi:c}:{fieldApi:c}},type:"validateAsync"}))}catch(B){W(B)}},g.debounceMs)})}catch(R){L=R}if(V.signal.aborted)return b(void 0);let E=L,A;w&&ze(L)&&(E=L.group,A=L.fields);const D=Ke(E),j=(P=s[c.name])==null?void 0:P[S],{newErrorValue:T,newSource:I}=Pe({formLevelError:j,fieldLevelError:D});if(c.getInfo().instance!==c)return b(void 0);c.setMeta(R=>({...R,errorMap:{...R==null?void 0:R.errorMap,[S]:T},errorSourceMap:{...R.errorSourceMap,[S]:I}})),w&&this.distributeFieldErrors(S,A),b(T)}))};for(const c of h)c.validate&&f(this,c,l);for(const c of u)c.validate&&f(c.field,c,d);let m=[];if((l.length||d.length)&&(m=await Promise.all(l),await Promise.all(d)),o){this.setMeta(c=>({...c,isValidating:!1}));for(const c of a)c.setMeta(g=>({...g,isValidating:!1}))}return m.filter(Boolean)},this.validateAllFields=async e=>{const i=[];return _(()=>{Object.values(this.getRelatedFields()).forEach(h=>{i.push(Promise.resolve().then(()=>h.validate(e,{skipFormValidation:!0,skipGroupValidation:!0}))),h.store.state.meta.isTouched||h.setMeta(s=>({...s,isTouched:!0}))})}),(await Promise.all(i)).flat()},this.validateArrayFieldsStartingFrom=(e,i,r)=>this.form.validateArrayFieldsStartingFrom(e,i,r),this.validateField=(e,i)=>this.form.validateField(e,i),this.getFieldValue=e=>this.form.getFieldValue(e),this.getFieldMeta=e=>this.form.getFieldMeta(e),this.setFieldMeta=(e,i)=>this.form.setFieldMeta(e,i),this.setFieldValue=(e,i)=>this.form.setFieldValue(e,i),this.deleteField=e=>this.form.deleteField(e),this.pushFieldValue=(e,i)=>this.form.pushFieldValue(e,i),this.insertFieldValue=(e,i,r)=>this.form.insertFieldValue(e,i,r),this.replaceFieldValue=(e,i,r)=>this.form.replaceFieldValue(e,i,r),this.swapFieldValues=(e,i,r)=>this.form.swapFieldValues(e,i,r),this.moveFieldValues=(e,i,r)=>this.form.moveFieldValues(e,i,r),this.clearFieldValues=e=>this.form.clearFieldValues(e),this.resetField=e=>this.form.resetField(e),this.removeFieldValue=(e,i)=>this.form.removeFieldValue(e,i),this.areRelatedFieldsValid=()=>Object.values(this.getRelatedFields()).every(e=>e.state.meta.isValid),this.validate=(e,i)=>{var a;const{fieldsErrorMap:r}=i!=null&&i.skipFormValidation?{fieldsErrorMap:{}}:this.form.validateSync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:u=>ne(this.name,u)}),{hasErrored:h}=this.validateSync(e,r[this.name]??{},{skipRelatedFieldValidation:i==null?void 0:i.skipRelatedFieldValidation});if(h&&!this.options.asyncAlways)return(a=this.getInfo().validationMetaMap[Te(e)])==null||a.lastAbortController.abort(),this.state.meta.errors;const s=i!=null&&i.skipFormValidation?Promise.resolve({}):this.form.validateAsync(e,{dontUpdateFormErrorMap:!0,filterFieldNames:u=>ne(this.name,u)});return this.validateAsync(e,s,{skipRelatedFieldValidation:i==null?void 0:i.skipRelatedFieldValidation})},this.triggerOnChangeListener=()=>{var r,h,s,a,u,l;const e=(r=this.form.options.listeners)==null?void 0:r.onChangeGroupDebounceMs;e&&e>0?(this.timeoutIds.formListeners.change&&clearTimeout(this.timeoutIds.formListeners.change),this.timeoutIds.formListeners.change=setTimeout(()=>{var d,o;(o=(d=this.form.options.listeners)==null?void 0:d.onChangeGroup)==null||o.call(d,{formApi:this.form,groupApi:this})},e)):(s=(h=this.form.options.listeners)==null?void 0:h.onChangeGroup)==null||s.call(h,{formApi:this.form,groupApi:this});const i=(a=this.options.listeners)==null?void 0:a.onChangeDebounceMs;i&&i>0?(this.timeoutIds.listeners.change&&clearTimeout(this.timeoutIds.listeners.change),this.timeoutIds.listeners.change=setTimeout(()=>{var d,o;(o=(d=this.options.listeners)==null?void 0:d.onChange)==null||o.call(d,{value:this.state.value,groupApi:this})},i)):(l=(u=this.options.listeners)==null?void 0:u.onChange)==null||l.call(u,{value:this.state.value,groupApi:this})},this.triggerOnSubmitListener=()=>{var e,i;(i=(e=this.options.listeners)==null?void 0:e.onSubmit)==null||i.call(e,{value:this.state.value,groupApi:this})},this._handleSubmit=async e=>{var h,s,a,u,l,d,o,f;this.setFormGroupState(m=>({...m,isSubmitted:!1,submissionAttempts:m.submissionAttempts+1,isSubmitSuccessful:!1})),_(()=>{Object.values(this.getRelatedFields()).forEach(m=>{m.state.meta.isTouched||m.setMeta(c=>({...c,isTouched:!0}))})});const i=e??this.options.onSubmitMeta;this.setFormGroupState(m=>({...m,isSubmitting:!0}));const r=()=>{this.setFormGroupState(m=>({...m,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.areRelatedFieldsValid()){r(),(s=(h=this.options).onGroupSubmitInvalid)==null||s.call(h,{value:this.state.value,groupApi:this,meta:i});return}if(await this.validate("submit",{skipRelatedFieldValidation:!0}),!this.areRelatedFieldsValid()||!this.state.meta.isValid){r(),(u=(a=this.options).onGroupSubmitInvalid)==null||u.call(a,{value:this.state.value,groupApi:this,meta:i});return}_(()=>{Object.values(this.getRelatedFields()).forEach(m=>{var c,g;(g=(c=m.options.listeners)==null?void 0:c.onGroupSubmit)==null||g.call(c,{value:m.state.value,fieldApi:m})})}),(d=(l=this.options.listeners)==null?void 0:l.onSubmit)==null||d.call(l,{groupApi:this,value:this.state.value});try{await((f=(o=this.options).onGroupSubmit)==null?void 0:f.call(o,{value:this.state.value,groupApi:this,meta:i})),_(()=>{this.setFormGroupState(m=>({...m,isSubmitted:!0,isSubmitSuccessful:!0})),r()})}catch(m){throw this.setFormGroupState(c=>({...c,isSubmitSuccessful:!1})),r(),m}},this.form=n.form,this.name=n.name,this.options=n,this.timeoutIds={validations:{},listeners:{},formListeners:{}},this.fieldInfo={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0,onDynamic:void 0}},this.store=ie(e=>{this.form.formGroupMetaDerived.get(),this.form.baseStore.get();const i=this.form.getFormGroupMeta(this.name)??Ht(n.defaultMeta);let r=this.form.getFieldValue(this.name);return!i.isTouched&&r===void 0&&this.options.defaultValue!==void 0&&!Z(r,this.options.defaultValue)&&(r=this.options.defaultValue),e&&e.value===r&&e.meta===i?e:{value:r,meta:i}}),this.handleSubmit=this.handleSubmit.bind(this)}get state(){return this.store.state}runValidator(n){if(Je(n.validate)){const e=ae[n.type](n.value,n.validate);return n.type==="validate"?ct(e):e.then(ct)}return n.validate(n.value)}handleSubmit(n){return this._handleSubmit(n)}}function Ke(t){if(t)return t}function ze(t){return!!t&&typeof t=="object"&&"fields"in t}function ct(t){if(!t||typeof t!="object"||!("form"in t)&&!("fields"in t))return t;const{form:n,fields:e,...i}=t;return{...i,group:n,fields:e}}function Te(t){switch(t){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"dynamic":return"onDynamic";case"change":default:return"onChange"}}class _e{constructor(n){if(this.getFormFieldName=e=>{if(typeof this.fieldsMap=="string")return ot(this.fieldsMap,e);const i=Oe(e)[0];if(typeof i!="string")return"";const r=e.slice(i.length),h=this.fieldsMap[i];return ot(h,r)},this.getFormFieldOptions=e=>{const i={...e},r=i.validators;if(i.name=this.getFormFieldName(e.name),r&&(r.onChangeListenTo||r.onBlurListenTo)){const h={...r},s=a=>{if(a)return a.map(u=>this.getFormFieldName(u))};h.onChangeListenTo=s(r.onChangeListenTo),h.onBlurListenTo=s(r.onBlurListenTo),i.validators=h}return i},this.mount=()=>()=>{},this.validateArrayFieldsStartingFrom=async(e,i,r)=>this.form.validateArrayFieldsStartingFrom(this.getFormFieldName(e),i,r),this.validateField=(e,i)=>this.form.validateField(this.getFormFieldName(e),i),this.getFieldValue=e=>this.form.getFieldValue(this.getFormFieldName(e)),this.getFieldMeta=e=>this.form.getFieldMeta(this.getFormFieldName(e)),this.setFieldMeta=(e,i)=>this.form.setFieldMeta(this.getFormFieldName(e),i),this.setFieldValue=(e,i,r)=>this.form.setFieldValue(this.getFormFieldName(e),i,r),this.deleteField=e=>this.form.deleteField(this.getFormFieldName(e)),this.pushFieldValue=(e,i,r)=>this.form.pushFieldValue(this.getFormFieldName(e),i,r),this.insertFieldValue=async(e,i,r,h)=>this.form.insertFieldValue(this.getFormFieldName(e),i,r,h),this.replaceFieldValue=async(e,i,r,h)=>this.form.replaceFieldValue(this.getFormFieldName(e),i,r,h),this.removeFieldValue=async(e,i,r)=>this.form.removeFieldValue(this.getFormFieldName(e),i,r),this.swapFieldValues=(e,i,r,h)=>this.form.swapFieldValues(this.getFormFieldName(e),i,r,h),this.moveFieldValues=(e,i,r,h)=>this.form.moveFieldValues(this.getFormFieldName(e),i,r,h),this.clearFieldValues=(e,i)=>this.form.clearFieldValues(this.getFormFieldName(e),i),this.resetField=e=>this.form.resetField(this.getFormFieldName(e)),this.validateAllFields=e=>this.form.validateAllFields(e),n.form instanceof _e){const e=n.form;if(this.form=e.form,typeof n.fields=="string")this.fieldsMap=e.getFormFieldName(n.fields);else{const i={...n.fields};for(const r in i)i[r]=e.getFormFieldName(i[r]);this.fieldsMap=i}}else this.form=n.form,this.fieldsMap=n.fields;this.store=ie(()=>{const e=this.form.store.get();let i;if(typeof this.fieldsMap=="string")i=oe(e.values,this.fieldsMap);else{i={};const r=this.fieldsMap;for(const h in r)i[h]=oe(e.values,r[h])}return{values:i}})}get state(){return this.store.state}async handleSubmit(n){return this.form.handleSubmit(n)}}function Xt(t,n){if(!n)return;const e=Object.assign({},t,{state:Se(t.state)});n(e),e.fieldInfo!==t.fieldInfo&&(t.fieldInfo=e.fieldInfo),e.options!==t.options&&(t.options=e.options);const r=Object.keys({values:null,validationMetaMap:null,fieldMetaBase:null,formGroupStateBase:null,isSubmitting:null,isSubmitted:null,isValidating:null,submissionAttempts:null,isSubmitSuccessful:null,_force_re_eval:null}).reduce((h,s)=>(t.state[s]!==e.state[s]&&(h[s]=e.state[s]),h),{});return _(()=>{Object.keys(r).length&&t.baseStore.setState(h=>({...h,...r})),e.state.errorMap!==t.state.errorMap&&t.setErrorMap(e.state.errorMap)}),e}function Qt(t,n){return t===n}function x(t,n=i=>i,e){const i=(e==null?void 0:e.compare)??Qt,r=C.useCallback(s=>{const{unsubscribe:a}=t.subscribe(s);return a},[t]),h=C.useCallback(()=>t.get(),[t]);return St.useSyncExternalStoreWithSelector(r,h,h,n,i)}const J=typeof window<"u"?C.useLayoutEffect:C.useEffect;function Zt(t){const[n,e]=C.useState(()=>({form:t.form,name:t.name})),[i,r]=C.useState(()=>new Ve({...t}));let h=i;(n.form!==t.form||n.name!==t.name)&&(h=new Ve({...t}),r(h),e({form:t.form,name:t.name}));const s=x(h.store,t.mode==="array"?c=>c.meta._arrayVersion||0:c=>c.value),a=x(h.store,c=>c.meta.isTouched),u=x(h.store,c=>c.meta.isBlurred),l=x(h.store,c=>c.meta.isDirty),d=x(h.store,c=>c.meta.errorMap),o=x(h.store,c=>c.meta.errorSourceMap),f=x(h.store,c=>c.meta.isValidating),m=C.useMemo(()=>({...h,get state(){return{value:t.mode==="array"?h.state.value:s,get meta(){return{...h.state.meta,isTouched:a,isBlurred:u,isDirty:l,errorMap:d,errorSourceMap:o,isValidating:f}}}}}),[h,t.mode,s,a,u,l,d,o,f]);return J(h.mount,[h]),J(()=>{h.update(t)}),m}const Jt=(({children:t,...n})=>{const e=Zt(n),i=C.useMemo(()=>ge(t,e),[t,e]);return p.jsx(p.Fragment,{children:i})});function Yt(){return C.useState(()=>vt())[0]}const ei=pt,ti=C.version.split(".")[0]==="17"?Yt:ei.useId;function ii(t){const[n,e]=C.useState(()=>({form:t.form,name:t.name})),[i,r]=C.useState(()=>new Ae({...t}));(n.form!==t.form||n.name!==t.name)&&(r(new Ae({...t})),e({form:t.form,name:t.name}));const h=x(i.store,b=>b.value),s=x(i.store,b=>b.meta.isTouched),a=x(i.store,b=>b.meta.isBlurred),u=x(i.store,b=>b.meta.isDirty),l=x(i.store,b=>b.meta.errorMap),d=x(i.store,b=>b.meta.errorSourceMap),o=x(i.store,b=>b.meta.isValidating),f=x(i.store,b=>b.meta.isSubmitting),m=x(i.store,b=>b.meta.isSubmitted),c=x(i.store,b=>b.meta.submissionAttempts),g=x(i.store,b=>b.meta.isSubmitSuccessful),v=x(i.store,b=>b.meta.canSubmit),S=x(i.store,b=>b.meta.isValid),F=x(i.store,b=>b.meta.isFieldsValid),M=x(i.store,b=>b.meta.isFieldsValidating),V=x(i.store,b=>b.meta.isGroupValid),w=C.useMemo(()=>({...i,handleSubmit:((...E)=>i._handleSubmit(...E)),get state(){return{...i.state,value:h,get meta(){return{...i.state.meta,isTouched:s,isBlurred:a,isDirty:u,errorMap:l,errorSourceMap:d,isValidating:o,isSubmitting:f,isSubmitted:m,submissionAttempts:c,isSubmitSuccessful:g,canSubmit:v,isValid:S,isFieldsValid:F,isFieldsValidating:M,isGroupValid:V}}}}}),[i,h,s,a,u,l,d,o,f,m,c,g,v,S,F,M,V]);return J(i.mount,[i]),J(()=>{i.update(t)}),w}const si=(({children:t,...n})=>{const e=ii(n),i=C.useMemo(()=>ge(t,e),[t,e]);return p.jsx(p.Fragment,{children:i})});function ri({form:t,selector:n=i=>i,children:e}){const i=x(t.store,n);return p.jsx(p.Fragment,{children:ge(e,i)})}function ni(t){const n=ti(),[e,i]=C.useState(t==null?void 0:t.formId),[r,h]=C.useState(()=>new ut({...t,formId:(t==null?void 0:t.formId)??n}));if(e!==(t==null?void 0:t.formId)){const u=(t==null?void 0:t.formId)??n;h(new ut({...t,formId:u})),i(u)}const s=C.useMemo(()=>{const u={...r,handleSubmit:((...l)=>r._handleSubmit(...l)),get formId(){return r._formId},get state(){return r.store.state}};return u.Field=function(d){return p.jsx(Jt,{...d,form:r})},u.FormGroup=function(d){return p.jsx(si,{...d,form:r})},u.Subscribe=function(d){return p.jsx(ri,{form:r,selector:d.selector,children:d.children})},u},[r]);J(r.mount,[]),J(()=>{r.update(t)});const a=C.useRef(!1);return J(()=>{a.current&&t!=null&&t.transform&&Xt(r,t.transform)},[r,t==null?void 0:t.transform]),J(()=>{a.current=!0}),s}function ai({lens:t,selector:n=i=>i,children:e}){const i=x(t.store,n);return p.jsx(p.Fragment,{children:ge(e,i)})}function oi(t){const[n]=C.useState(()=>{const e=new _e(t),i=t.form instanceof _e?t.form.form:t.form,r=e;return r.AppForm=function(s){return p.jsx(i.AppForm,{...s})},r.AppField=function(s){return p.jsx(i.AppField,{...n.getFormFieldOptions(s)})},r.Field=function(s){return p.jsx(i.Field,{...n.getFormFieldOptions(s)})},r.Subscribe=function(s){return p.jsx(ai,{lens:n,selector:s.selector,children:s.children})},Object.assign(r,{...t.formComponents})});return J(n.mount,[n]),n}const ht=C.createContext(null),bt=C.createContext(null);function Ft(){const t=C.useContext(bt);if(!t)throw new Error("`formContext` only works when within a `formComponent` passed to `createFormHook`");return t}function li(){function t(){const n=C.useContext(ht);if(!n)throw new Error("`fieldContext` only works when within a `fieldComponent` passed to `createFormHook`");return n}return{fieldContext:ht,useFieldContext:t,useFormContext:Ft,formContext:bt}}function Mt({fieldComponents:t,fieldContext:n,formContext:e,formComponents:i}){function r(l){const d=ni(l),o=C.useMemo(()=>({children:c})=>p.jsx(e.Provider,{value:d,children:c}),[d]),f=C.useMemo(()=>(({children:g,...v})=>p.jsx(d.Field,{...v,children:S=>p.jsx(n.Provider,{value:S,children:g(Object.assign(S,t))})})),[d]);return C.useMemo(()=>Object.assign(d,{AppField:f,AppForm:o,...i}),[d,f,o])}function h({render:l,props:d}){return function(f){return l({...d,...f})}}function s({render:l,props:d,defaultValues:o}){return function(m){const c=C.useMemo(()=>({form:m.form,fields:m.fields,defaultValues:o,formComponents:i}),[m.form,m.fields]),g=oi(c);return l({...d,...m,group:g})}}function a(l){return Ft()}function u(l){return Mt({fieldContext:n,formContext:e,fieldComponents:{...t,...l.fieldComponents},formComponents:{...i,...l.formComponents}})}return{useAppForm:r,withForm:h,withFieldGroup:s,useTypedAppFormContext:a,extendForm:u}}const{fieldContext:ui,formContext:di,useFieldContext:ve,useFormContext:ci}=li();function hi({label:t,placeholder:n,type:e="text",description:i}){const r=ve(),{isTouched:h,errors:s}=r.state.meta,a=h?s.map(u=>({message:String(u)})):[];return p.jsxs(ce,{orientation:"vertical",children:[p.jsx(he,{htmlFor:r.name,children:t}),p.jsx(yt,{id:r.name,type:e,value:r.state.value,placeholder:n,onBlur:r.handleBlur,onChange:u=>r.handleChange(u.target.value)}),i&&p.jsx(fe,{children:i}),p.jsx(me,{errors:a})]})}function fi({label:t,placeholder:n,description:e,rows:i}){const r=ve(),{isTouched:h,errors:s}=r.state.meta,a=h?s.map(u=>({message:String(u)})):[];return p.jsxs(ce,{orientation:"vertical",children:[p.jsx(he,{htmlFor:r.name,children:t}),p.jsx(Vt,{id:r.name,value:r.state.value,placeholder:n,rows:i,onBlur:r.handleBlur,onChange:u=>r.handleChange(u.target.value)}),e&&p.jsx(fe,{children:e}),p.jsx(me,{errors:a})]})}function mi({label:t,options:n,placeholder:e,description:i}){const r=ve(),{isTouched:h,errors:s}=r.state.meta,a=h?s.map(u=>({message:String(u)})):[];return p.jsxs(ce,{orientation:"vertical",children:[p.jsx(he,{htmlFor:r.name,children:t}),p.jsxs(At,{value:r.state.value,onValueChange:u=>r.handleChange(u),onOpenChange:u=>{u||r.handleBlur()},children:[p.jsx(Et,{id:r.name,children:p.jsx(wt,{placeholder:e})}),p.jsx(It,{children:n.map(u=>p.jsx(Ct,{value:u.value,children:u.label},u.value))})]}),i&&p.jsx(fe,{children:i}),p.jsx(me,{errors:a})]})}function gi({label:t,description:n}){const e=ve(),{isTouched:i,errors:r}=e.state.meta,h=i?r.map(s=>({message:String(s)})):[];return p.jsxs(ce,{orientation:"horizontal",children:[p.jsx(he,{htmlFor:e.name,children:t}),p.jsx(Lt,{id:e.name,checked:e.state.value,onBlur:e.handleBlur,onCheckedChange:s=>e.handleChange(s)}),n&&p.jsx(fe,{children:n}),p.jsx(me,{errors:h})]})}function vi({label:t,description:n}){const e=ve(),{isTouched:i,errors:r}=e.state.meta,h=i?r.map(s=>({message:String(s)})):[];return p.jsxs(ce,{orientation:"horizontal",children:[p.jsx(Tt,{id:e.name,checked:e.state.value,onBlur:e.handleBlur,onCheckedChange:s=>e.handleChange(s===!0)}),p.jsx(he,{htmlFor:e.name,children:t}),n&&p.jsx(fe,{children:n}),p.jsx(me,{errors:h})]})}function bi({label:t,placeholder:n,description:e}){const i=ve(),{isTouched:r,errors:h}=i.state.meta,s=r?h.map(a=>({message:String(a)})):[];return p.jsxs(ce,{orientation:"vertical",children:[p.jsx(he,{htmlFor:i.name,children:t}),p.jsx(xt,{id:i.name,value:i.state.value,placeholder:n,onBlur:i.handleBlur,onChange:a=>i.handleChange(a.target.value)}),e&&p.jsx(fe,{children:e}),p.jsx(me,{errors:s})]})}function Fi({label:t,pendingLabel:n="Saving…"}){const e=ci();return p.jsx(e.Subscribe,{selector:i=>({canSubmit:i.canSubmit,isSubmitting:i.isSubmitting}),children:({canSubmit:i,isSubmitting:r})=>p.jsx(Dt,{type:"submit",disabled:!i||r,children:r?n:t})})}const{useAppForm:pi}=Mt({fieldContext:ui,formContext:di,fieldComponents:{TextField:hi,TextareaField:fi,SelectField:mi,SwitchField:gi,CheckboxField:vi,PasswordField:bi},formComponents:{SubmitButton:Fi}});export{x as a,pi as u};
@@ -1 +1 @@
1
- import{a1 as d,a2 as f}from"./index-B48IJBNm.js";function p(){const t=d();return f({queryKey:["tasks","templates"],queryFn:()=>t.getTaskTemplates()})}const m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function c(t){const n=t.trim().split(/\s+/);if(n.length!==5)return null;const[r,e,a,i,u]=n;if(a!=="*"||i!=="*"||!s(e)||!s(r)||Number(e)>23||Number(r)>59)return null;if(u==="*")return`Every day at ${o(e,r)}`;if(u==="1-5")return`Every weekday at ${o(e,r)}`;if(s(u)){const y=m[Number(u)];return y?`Every ${y} at ${o(e,r)}`:null}return null}function s(t){return/^\d+$/.test(t)}function o(t,n){const r=Number(t),e=Number(n),a=r>=12?"PM":"AM";return`${r===0?12:r>12?r-12:r}:${String(e).padStart(2,"0")} ${a}`}function h(t){return c(t)??t}export{h as f,p as u};
1
+ import{a1 as d,a2 as f}from"./index-OQuvRZTD.js";function p(){const t=d();return f({queryKey:["tasks","templates"],queryFn:()=>t.getTaskTemplates()})}const m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function c(t){const n=t.trim().split(/\s+/);if(n.length!==5)return null;const[r,e,a,i,u]=n;if(a!=="*"||i!=="*"||!s(e)||!s(r)||Number(e)>23||Number(r)>59)return null;if(u==="*")return`Every day at ${o(e,r)}`;if(u==="1-5")return`Every weekday at ${o(e,r)}`;if(s(u)){const y=m[Number(u)];return y?`Every ${y} at ${o(e,r)}`:null}return null}function s(t){return/^\d+$/.test(t)}function o(t,n){const r=Number(t),e=Number(n),a=r>=12?"PM":"AM";return`${r===0?12:r>12?r-12:r}:${String(e).padStart(2,"0")} ${a}`}function h(t){return c(t)??t}export{h as f,p as u};