factory-factory 0.4.8 → 0.4.9

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 (425) hide show
  1. package/README.md +66 -29
  2. package/dist/client/assets/{Archive.es-CGY-HOtI.js → Archive.es-moH8rDRO.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft.es-BkuVunBb.js → ArrowLeft.es-CVl_zVBC.js} +1 -1
  4. package/dist/client/assets/{abnfDiagram-VCTEODGH-B2jWIJ_F.js → abnfDiagram-VCTEODGH-DzuBdUSN.js} +1 -1
  5. package/dist/client/assets/admin-page-CAsPxzW9.js +1 -0
  6. package/dist/client/assets/{alert-PePzkOCj.js → alert-2CAe526X.js} +1 -1
  7. package/dist/client/assets/{alert-dialog-BgqiS2Mp.js → alert-dialog-8vhMuR-k.js} +1 -1
  8. package/dist/client/assets/architecture-7GRP2DOG-Bcwjoi8B.js +1 -0
  9. package/dist/client/assets/{architectureDiagram-5GKGNRK7-CV8YjPRr.js → architectureDiagram-5GKGNRK7-CeuoQvaW.js} +1 -1
  10. package/dist/client/assets/{badge-BESbZ2wy.js → badge-CoDH1rER.js} +1 -1
  11. package/dist/client/assets/{blockDiagram-I7D4REHJ-BdQWAITV.js → blockDiagram-I7D4REHJ-BY92gQgN.js} +1 -1
  12. package/dist/client/assets/{c4Diagram-7LVT6UL2-Dp1ETdzU.js → c4Diagram-7LVT6UL2-D5TNBYXh.js} +1 -1
  13. package/dist/client/assets/channel-NEbtzeVB.js +1 -0
  14. package/dist/client/assets/{chunk-4HAMMTFA-BXRLulFZ.js → chunk-4HAMMTFA-DBbX-wzu.js} +1 -1
  15. package/dist/client/assets/{chunk-75Z2AOVW-FUHgKXYa.js → chunk-75Z2AOVW-962-yyBD.js} +1 -1
  16. package/dist/client/assets/{chunk-DU6HZSFF-nxkO_ute.js → chunk-DU6HZSFF-CHHMX1CR.js} +1 -1
  17. package/dist/client/assets/{chunk-F27PBJKO-Dal8QxK3.js → chunk-F27PBJKO-BOnYAGjZ.js} +1 -1
  18. package/dist/client/assets/{chunk-GMAD6QVW-B_VbYl2S.js → chunk-GMAD6QVW-DQF31PdR.js} +1 -1
  19. package/dist/client/assets/{chunk-GVQU2GXP-DobNOfAy.js → chunk-GVQU2GXP-rruJzn36.js} +1 -1
  20. package/dist/client/assets/{chunk-IMKFNOWR-D_P1eTAa.js → chunk-IMKFNOWR-GIKO0MCA.js} +1 -1
  21. package/dist/client/assets/{chunk-L3NEJ4N5-CZpV3_Q0.js → chunk-L3NEJ4N5-USlKRxmU.js} +1 -1
  22. package/dist/client/assets/{chunk-OSK3NFVY-e3uqzkQq.js → chunk-OSK3NFVY-DYQeYWNP.js} +1 -1
  23. package/dist/client/assets/{chunk-P2QGCYS3-B1FUAlmg.js → chunk-P2QGCYS3-SDkZ9hQX.js} +1 -1
  24. package/dist/client/assets/{chunk-POPQ4Y6H-BKVSxG-w.js → chunk-POPQ4Y6H-bdnFdIMc.js} +1 -1
  25. package/dist/client/assets/{chunk-PWAF6VOD-DQe8ztwz.js → chunk-PWAF6VOD-DuKrEmQw.js} +1 -1
  26. package/dist/client/assets/{chunk-SHT3W25Y-D8Ie2IK_.js → chunk-SHT3W25Y-BnWDS29f.js} +1 -1
  27. package/dist/client/assets/{chunk-SVP7TREG-_l4ZFWYL.js → chunk-SVP7TREG-BqyZjR36.js} +1 -1
  28. package/dist/client/assets/{chunk-TICWLB2K-BfcOBlR4.js → chunk-TICWLB2K-ZCb3dlre.js} +1 -1
  29. package/dist/client/assets/{ci-status-ChifTKM1.js → ci-status-cs76P3se.js} +1 -1
  30. package/dist/client/assets/classDiagram-ZZMXUADV-zE_E4kYq.js +1 -0
  31. package/dist/client/assets/classDiagram-v2-VYDZK3BY-zE_E4kYq.js +1 -0
  32. package/dist/client/assets/components-CoS_rGt2.js +1 -0
  33. package/dist/client/assets/{confirm-dialog-BAfboPjS.js → confirm-dialog-CfvO9f42.js} +1 -1
  34. package/dist/client/assets/{core-DW1Rn28Z.js → core-DW3tuXQ3.js} +1 -1
  35. package/dist/client/assets/{cynefin-OW5HDTMX-B7JP5WcM.js → cynefin-OW5HDTMX-Ci2WypGa.js} +1 -1
  36. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-B5jcLvUi.js → cynefinDiagram-5FMLGOSQ-CGea7wa2.js} +1 -1
  37. package/dist/client/assets/{dagre-GXQ25YYZ-CFkt7lun.js → dagre-GXQ25YYZ-CJcHs09G.js} +1 -1
  38. package/dist/client/assets/data-import-button-cvKmYZJe.js +6 -0
  39. package/dist/client/assets/detail-C3U9ED1b.js +1 -0
  40. package/dist/client/assets/{diagram-S7CK7UJ4-DpT9R2w0.js → diagram-S7CK7UJ4-Drsfjeco.js} +1 -1
  41. package/dist/client/assets/{diagram-UQ7AKVKN-DAy1Fpaf.js → diagram-UQ7AKVKN-0SrBP_3E.js} +1 -1
  42. package/dist/client/assets/{diagram-VSXAHHWV-Co-NFSf3.js → diagram-VSXAHHWV-DB2rqHgv.js} +1 -1
  43. package/dist/client/assets/{diagram-VX7I27RA-CaIWof2e.js → diagram-VX7I27RA-B2y3VQbR.js} +1 -1
  44. package/dist/client/assets/{diagram-Z3DM3KII-BpcVyNtl.js → diagram-Z3DM3KII-D63_zfy5.js} +1 -1
  45. package/dist/client/assets/diff-highlight.worker-FEJq0yPv.js +60 -0
  46. package/dist/client/assets/dist-BO6Gz-vk.js +1 -0
  47. package/dist/client/assets/{dist-Dtgf0TOg.js → dist-DGw3MClt.js} +1 -1
  48. package/dist/client/assets/{ebnfDiagram-PWID7BFC-CS26Rt0p.js → ebnfDiagram-PWID7BFC-8gEK-ifx.js} +1 -1
  49. package/dist/client/assets/{en-US-SlQiGO_s.js → en-US-C-x19js7.js} +1 -1
  50. package/dist/client/assets/{erDiagram-RLTQ6QDP-DsdFXV4-.js → erDiagram-RLTQ6QDP-B2CcHHg7.js} +1 -1
  51. package/dist/client/assets/eventmodeling-NTZA5JFV-DqUwwD9w.js +1 -0
  52. package/dist/client/assets/{factory-config-scripts-BoDNVi6q.js → factory-config-scripts-C2BfO5od.js} +1 -1
  53. package/dist/client/assets/flowDiagram-HODETNUW-DCZkaOsj.js +1 -0
  54. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-D_b7Bn-J.js → ganttDiagram-EL5Y4UJY-B_Y3HJTL.js} +1 -1
  55. package/dist/client/assets/{gitGraph-4MIJSDKK-De5ASUSY.js → gitGraph-4MIJSDKK-DBd1UxTm.js} +1 -1
  56. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-BHMJvUNJ.js → gitGraphDiagram-WWUBYQGX-CrdKibnu.js} +1 -1
  57. package/dist/client/assets/{home-DjDt91tt.js → home-DRzNpm0E.js} +1 -1
  58. package/dist/client/assets/hooks-3rxtNHRh.js +1 -0
  59. package/dist/client/assets/index-BJo4hZ8z.js +10 -0
  60. package/dist/client/assets/{info-A6RAGUB7-DNiM6MW6.js → info-A6RAGUB7-CCMRmQ2H.js} +1 -1
  61. package/dist/client/assets/{infoDiagram-27XIBGKW-4g58w-zo.js → infoDiagram-27XIBGKW-DO-IhKUM.js} +1 -1
  62. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DO7_eJ6Q.js → ishikawaDiagram-5VMMS53U-KejlLQ1k.js} +1 -1
  63. package/dist/client/assets/{journeyDiagram-3NMN7TZE-6CJtdIGo.js → journeyDiagram-3NMN7TZE-DemWKqD6.js} +1 -1
  64. package/dist/client/assets/jsx-runtime-BNakU3Ej.js +1 -0
  65. package/dist/client/assets/{kanban-definition-UXKFOSKX-D211MzXr.js → kanban-definition-UXKFOSKX-uRffHAE9.js} +1 -1
  66. package/dist/client/assets/{label-CI3jpwv-.js → label-ANA2Lfpk.js} +1 -1
  67. package/dist/client/assets/lib-CHy_7XQu.js +1 -0
  68. package/dist/client/assets/{line-DotOMT4o.js → line-CfCBYCoS.js} +1 -1
  69. package/dist/client/assets/list-C3P6JbyU.js +30 -0
  70. package/dist/client/assets/{list-bUzF8ozJ.js → list-oJCufmEX.js} +1 -1
  71. package/dist/client/assets/{logs-CjKXHkrB.js → logs-zb2la033.js} +1 -1
  72. package/dist/client/assets/{mermaid-diagram-CESNj6Ju.js → mermaid-diagram-kbWN558y.js} +4 -4
  73. package/dist/client/assets/{mermaid-parser.core-DK0kgowR.js → mermaid-parser.core-CpkwJ-8U.js} +3 -3
  74. package/dist/client/assets/{mindmap-definition-YA3MSWOX-DF5ewLZ5.js → mindmap-definition-YA3MSWOX-DYYi_9Si.js} +1 -1
  75. package/dist/client/assets/{mobile-baseline-B0PakiKB.js → mobile-baseline-BVS3GXLz.js} +1 -1
  76. package/dist/client/assets/new-BiEmR60A.js +1 -0
  77. package/dist/client/assets/new-CcQm3ES8.js +1 -0
  78. package/dist/client/assets/{packet-AYTQ26CC-C4EHUAzU.js → packet-AYTQ26CC-kvNXQn-j.js} +1 -1
  79. package/dist/client/assets/{page-header-BCpV1oUO.js → page-header-CpSh-j1O.js} +1 -1
  80. package/dist/client/assets/{pegDiagram-XKGWAZYB-_WrA16pJ.js → pegDiagram-XKGWAZYB-CMAngYAK.js} +1 -1
  81. package/dist/client/assets/{pie-WAS4IAKB-BkSTK6KM.js → pie-WAS4IAKB-DFNGAljQ.js} +1 -1
  82. package/dist/client/assets/{pieDiagram-E7YTZNPT-CUR0mgrL.js → pieDiagram-E7YTZNPT-XGRy7b5E.js} +1 -1
  83. package/dist/client/assets/{popover-D-6mugCQ.js → popover-CIfFCO0U.js} +1 -1
  84. package/dist/client/assets/pr-inbox-item-D9UcI0SS.js +2 -0
  85. package/dist/client/assets/{preload-helper-Czpn1I53.js → preload-helper-BZ1Pz5am.js} +1 -1
  86. package/dist/client/assets/{project-repo-form-DjzRbY9O.js → project-repo-form-Dc8ha6XP.js} +1 -1
  87. package/dist/client/assets/{provider-cli-warning-LYUDO_5Y.js → provider-cli-warning-CIAJ88Cy.js} +1 -1
  88. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-QXmh8FnA.js → quadrantDiagram-AXDQQJYC-BFek-axl.js} +1 -1
  89. package/dist/client/assets/{radar-RG4KPBEZ-ymOfNW7I.js → radar-RG4KPBEZ-k-UBw86I.js} +1 -1
  90. package/dist/client/assets/{radio-group-CcAx51bT.js → radio-group-BhmTXkIv.js} +1 -1
  91. package/dist/client/assets/{railroad-74A4TZTK-CwWB40du.js → railroad-74A4TZTK-B6DuT-HY.js} +1 -1
  92. package/dist/client/assets/railroad-abnf-HS5TGJTU-DF-z1cVb.js +1 -0
  93. package/dist/client/assets/railroad-ebnf-LZEXJU2U-C6VgaalR.js +1 -0
  94. package/dist/client/assets/railroad-peg-WCYAUIDC-DRMqhGU3.js +1 -0
  95. package/dist/client/assets/{railroadDiagram-O6MQD6OU-O7DCuidl.js → railroadDiagram-O6MQD6OU-CBzDTFh9.js} +1 -1
  96. package/dist/client/assets/redirect-DexaYCz_.js +1 -0
  97. package/dist/client/assets/{requirementDiagram-BXWQKSXE-BajIi2rw.js → requirementDiagram-BXWQKSXE-DSgpbBy3.js} +1 -1
  98. package/dist/client/assets/{reviews-B04-ADI9.js → reviews-DDO7Pvrz.js} +1 -1
  99. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-CnR7slVB.js → sankeyDiagram-P5KCCOFB-BOWaOPXp.js} +1 -1
  100. package/dist/client/assets/{select-BgEObL9n.js → select-Cq3ddA2b.js} +1 -1
  101. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-BUxl34n_.js → sequenceDiagram-WJ2MYXX4-9wHsZFGh.js} +1 -1
  102. package/dist/client/assets/spinner-BszfzCYe.js +1 -0
  103. package/dist/client/assets/{startup-script-form-c7w0nnHp.js → startup-script-form-CHvwd1Nb.js} +1 -1
  104. package/dist/client/assets/{stateDiagram-D77RDMKH-aFuhfmKp.js → stateDiagram-D77RDMKH-Blo9H6q_.js} +1 -1
  105. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BzJ9AKXW.js +1 -0
  106. package/dist/client/assets/{swimlanes-42K2YHIH-BccYx63r.js → swimlanes-42K2YHIH-DI0BHdWG.js} +1 -1
  107. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DSnxWZUW.js +8 -0
  108. package/dist/client/assets/{table-wIG3osPW.js → table-CUvMM0aA.js} +1 -1
  109. package/dist/client/assets/{tabs-Cn3M4k-N.js → tabs-BBAQyvSA.js} +1 -1
  110. package/dist/client/assets/{terminal-instance-7W1Sdy6P.js → terminal-instance-BEqkmyvv.js} +1 -1
  111. package/dist/client/assets/{textarea-BVHmIkCM.js → textarea-DxWYClhS.js} +1 -1
  112. package/dist/client/assets/{timeline-definition-24CTP7MA-CM_waoCp.js → timeline-definition-24CTP7MA-C8fyxpVm.js} +1 -1
  113. package/dist/client/assets/{tooltip-DCH0jP98.js → tooltip-DXcY1U7y.js} +1 -1
  114. package/dist/client/assets/{treeView-Q6P3EWNA-CkV-8YWk.js → treeView-Q6P3EWNA-CzQAwJw-.js} +1 -1
  115. package/dist/client/assets/{treemap-WGGIJYW6-L1FedAzz.js → treemap-WGGIJYW6-zWRSK6WR.js} +1 -1
  116. package/dist/client/assets/trpc-CQO3zfei.js +1 -0
  117. package/dist/client/assets/{use-auto-scroll-QQMmbsX-.js → use-auto-scroll-DNohsNoz.js} +1 -1
  118. package/dist/client/assets/{use-download-server-log-Bag_Et_8.js → use-download-server-log-efKIcIwE.js} +1 -1
  119. package/dist/client/assets/use-project-header-navigation-D5yIIgnb.js +1 -0
  120. package/dist/client/assets/{use-websocket-channel-DW9rsEG5.js → use-websocket-channel-dNXOJZfW.js} +1 -1
  121. package/dist/client/assets/use-websocket-transport-BuYcrZTd.js +55 -0
  122. package/dist/client/assets/vbnet-CwR9YcOY.js +57 -0
  123. package/dist/client/assets/{vennDiagram-4TSXK5OY-Djoofmfi.js → vennDiagram-4TSXK5OY-ffnMpD5u.js} +1 -1
  124. package/dist/client/assets/{wardley-WFR3VGLG-BU-g6L7U.js → wardley-WFR3VGLG-acbsrLnl.js} +1 -1
  125. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-DZNgTneT.js → wardleyDiagram-VM6X3IG4-BtqGCwsu.js} +1 -1
  126. package/dist/client/assets/workspace-a6lf168c.js +18 -0
  127. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-WTubjsZj.js → xychartDiagram-S5SC5T6Z-Bfy9xcWF.js} +1 -1
  128. package/dist/client/index.html +28 -35
  129. package/dist/prisma/generated/internal/class.js +1 -1
  130. package/dist/prisma/generated/internal/class.js.map +1 -1
  131. package/dist/prompts/quick-actions/fetch-rebase.md +5 -9
  132. package/dist/prompts/quick-actions/rename-branch.md +4 -8
  133. package/dist/prompts/quick-actions/review.md +6 -5
  134. package/dist/prompts/quick-actions/screenshots.md +7 -20
  135. package/dist/prompts/quick-actions/simplify.md +4 -1
  136. package/dist/prompts/ratchet/dispatch.md +13 -46
  137. package/dist/src/backend/orchestration/cli-health.service.d.ts.map +1 -1
  138. package/dist/src/backend/orchestration/cli-health.service.js +31 -23
  139. package/dist/src/backend/orchestration/cli-health.service.js.map +1 -1
  140. package/dist/src/backend/orchestration/cli-health.service.test.js +40 -0
  141. package/dist/src/backend/orchestration/cli-health.service.test.js.map +1 -1
  142. package/dist/src/backend/orchestration/data-backup.service.test.js +37 -4
  143. package/dist/src/backend/orchestration/data-backup.service.test.js.map +1 -1
  144. package/dist/src/backend/orchestration/event-collector.idle-refresh.test.d.ts +2 -0
  145. package/dist/src/backend/orchestration/event-collector.idle-refresh.test.d.ts.map +1 -0
  146. package/dist/src/backend/orchestration/event-collector.idle-refresh.test.js +83 -0
  147. package/dist/src/backend/orchestration/event-collector.idle-refresh.test.js.map +1 -0
  148. package/dist/src/backend/orchestration/event-collector.linear.test.d.ts +2 -0
  149. package/dist/src/backend/orchestration/event-collector.linear.test.d.ts.map +1 -0
  150. package/dist/src/backend/orchestration/event-collector.linear.test.js +206 -0
  151. package/dist/src/backend/orchestration/event-collector.linear.test.js.map +1 -0
  152. package/dist/src/backend/orchestration/event-collector.orchestrator.d.ts.map +1 -1
  153. package/dist/src/backend/orchestration/event-collector.orchestrator.js +40 -8
  154. package/dist/src/backend/orchestration/event-collector.orchestrator.js.map +1 -1
  155. package/dist/src/backend/orchestration/snapshot-reconciliation.orchestrator.d.ts +1 -0
  156. package/dist/src/backend/orchestration/snapshot-reconciliation.orchestrator.d.ts.map +1 -1
  157. package/dist/src/backend/orchestration/snapshot-reconciliation.orchestrator.js +20 -4
  158. package/dist/src/backend/orchestration/snapshot-reconciliation.orchestrator.js.map +1 -1
  159. package/dist/src/backend/orchestration/snapshot-reconciliation.orchestrator.test.js +55 -104
  160. package/dist/src/backend/orchestration/snapshot-reconciliation.orchestrator.test.js.map +1 -1
  161. package/dist/src/backend/orchestration/snapshot-reconciliation.test-helpers.d.ts +6 -0
  162. package/dist/src/backend/orchestration/snapshot-reconciliation.test-helpers.d.ts.map +1 -0
  163. package/dist/src/backend/orchestration/snapshot-reconciliation.test-helpers.js +117 -0
  164. package/dist/src/backend/orchestration/snapshot-reconciliation.test-helpers.js.map +1 -0
  165. package/dist/src/backend/orchestration/snapshot-reconciliation.test-helpers.test.d.ts +2 -0
  166. package/dist/src/backend/orchestration/snapshot-reconciliation.test-helpers.test.d.ts.map +1 -0
  167. package/dist/src/backend/orchestration/snapshot-reconciliation.test-helpers.test.js +8 -0
  168. package/dist/src/backend/orchestration/snapshot-reconciliation.test-helpers.test.js.map +1 -0
  169. package/dist/src/backend/orchestration/workspace-archive.orchestrator.d.ts.map +1 -1
  170. package/dist/src/backend/orchestration/workspace-archive.orchestrator.js +40 -34
  171. package/dist/src/backend/orchestration/workspace-archive.orchestrator.js.map +1 -1
  172. package/dist/src/backend/orchestration/workspace-archive.orchestrator.test.js +4 -0
  173. package/dist/src/backend/orchestration/workspace-archive.orchestrator.test.js.map +1 -1
  174. package/dist/src/backend/orchestration/workspace-children.orchestrator.d.ts.map +1 -1
  175. package/dist/src/backend/orchestration/workspace-children.orchestrator.js +1 -2
  176. package/dist/src/backend/orchestration/workspace-children.orchestrator.js.map +1 -1
  177. package/dist/src/backend/orchestration/workspace-init-issue-prompts.test.js +3 -3
  178. package/dist/src/backend/orchestration/workspace-init-issue-prompts.test.js.map +1 -1
  179. package/dist/src/backend/orchestration/workspace-init-script-pipeline.d.ts.map +1 -1
  180. package/dist/src/backend/orchestration/workspace-init-script-pipeline.js +3 -3
  181. package/dist/src/backend/orchestration/workspace-init-script-pipeline.js.map +1 -1
  182. package/dist/src/backend/orchestration/workspace-init-script-pipeline.test.d.ts +2 -0
  183. package/dist/src/backend/orchestration/workspace-init-script-pipeline.test.d.ts.map +1 -0
  184. package/dist/src/backend/orchestration/workspace-init-script-pipeline.test.js +52 -0
  185. package/dist/src/backend/orchestration/workspace-init-script-pipeline.test.js.map +1 -0
  186. package/dist/src/backend/orchestration/workspace-runtime-cleanup-notification.test.d.ts +2 -0
  187. package/dist/src/backend/orchestration/workspace-runtime-cleanup-notification.test.d.ts.map +1 -0
  188. package/dist/src/backend/orchestration/workspace-runtime-cleanup-notification.test.js +175 -0
  189. package/dist/src/backend/orchestration/workspace-runtime-cleanup-notification.test.js.map +1 -0
  190. package/dist/src/backend/prompts/branch-rename.js +1 -1
  191. package/dist/src/backend/prompts/ratchet-dispatch.d.ts.map +1 -1
  192. package/dist/src/backend/prompts/ratchet-dispatch.js +12 -78
  193. package/dist/src/backend/prompts/ratchet-dispatch.js.map +1 -1
  194. package/dist/src/backend/prompts/ratchet-dispatch.test.js +39 -27
  195. package/dist/src/backend/prompts/ratchet-dispatch.test.js.map +1 -1
  196. package/dist/src/backend/services/auto-iteration/service/auto-iteration.service.d.ts.map +1 -1
  197. package/dist/src/backend/services/auto-iteration/service/auto-iteration.service.js +6 -1
  198. package/dist/src/backend/services/auto-iteration/service/auto-iteration.service.js.map +1 -1
  199. package/dist/src/backend/services/auto-iteration/service/auto-iteration.service.test.js +60 -1
  200. package/dist/src/backend/services/auto-iteration/service/auto-iteration.service.test.js.map +1 -1
  201. package/dist/src/backend/services/auto-iteration/service/prompts.d.ts.map +1 -1
  202. package/dist/src/backend/services/auto-iteration/service/prompts.js +14 -54
  203. package/dist/src/backend/services/auto-iteration/service/prompts.js.map +1 -1
  204. package/dist/src/backend/services/github/service/github-cli-health-cache.test.d.ts +2 -0
  205. package/dist/src/backend/services/github/service/github-cli-health-cache.test.d.ts.map +1 -0
  206. package/dist/src/backend/services/github/service/github-cli-health-cache.test.js +45 -0
  207. package/dist/src/backend/services/github/service/github-cli-health-cache.test.js.map +1 -0
  208. package/dist/src/backend/services/github/service/github-cli.service.d.ts +1 -1
  209. package/dist/src/backend/services/github/service/github-cli.service.d.ts.map +1 -1
  210. package/dist/src/backend/services/github/service/github-cli.service.js +25 -23
  211. package/dist/src/backend/services/github/service/github-cli.service.js.map +1 -1
  212. package/dist/src/backend/services/linear/service/linear-client.service.d.ts +1 -1
  213. package/dist/src/backend/services/linear/service/linear-client.service.d.ts.map +1 -1
  214. package/dist/src/backend/services/linear/service/linear-client.service.js +24 -9
  215. package/dist/src/backend/services/linear/service/linear-client.service.js.map +1 -1
  216. package/dist/src/backend/services/linear/service/linear-client.service.test.js +46 -5
  217. package/dist/src/backend/services/linear/service/linear-client.service.test.js.map +1 -1
  218. package/dist/src/backend/services/linear/service/linear-state-sync.service.d.ts +1 -1
  219. package/dist/src/backend/services/linear/service/linear-state-sync.service.d.ts.map +1 -1
  220. package/dist/src/backend/services/linear/service/linear-state-sync.service.js +2 -1
  221. package/dist/src/backend/services/linear/service/linear-state-sync.service.js.map +1 -1
  222. package/dist/src/backend/services/linear/service/linear-state-sync.service.test.js +7 -3
  223. package/dist/src/backend/services/linear/service/linear-state-sync.service.test.js.map +1 -1
  224. package/dist/src/backend/services/ratchet/service/fixer-session.service.js +1 -1
  225. package/dist/src/backend/services/ratchet/service/fixer-session.service.js.map +1 -1
  226. package/dist/src/backend/services/ratchet/service/ratchet.service.test.js +1 -1
  227. package/dist/src/backend/services/ratchet/service/ratchet.service.test.js.map +1 -1
  228. package/dist/src/backend/services/run-script/service/startup-script.service.d.ts +1 -0
  229. package/dist/src/backend/services/run-script/service/startup-script.service.d.ts.map +1 -1
  230. package/dist/src/backend/services/run-script/service/startup-script.service.js +3 -1
  231. package/dist/src/backend/services/run-script/service/startup-script.service.js.map +1 -1
  232. package/dist/src/backend/services/session/service/acp/acp-runtime-quiescence.js +1 -1
  233. package/dist/src/backend/services/session/service/acp/acp-runtime-quiescence.js.map +1 -1
  234. package/dist/src/backend/services/session/service/acp/acp-runtime-supervisor.js +1 -1
  235. package/dist/src/backend/services/session/service/acp/acp-runtime-supervisor.js.map +1 -1
  236. package/dist/src/backend/services/session/service/acp/codex-app-server-adapter/codex-notification-queue.d.ts.map +1 -1
  237. package/dist/src/backend/services/session/service/acp/codex-app-server-adapter/codex-notification-queue.js +1 -3
  238. package/dist/src/backend/services/session/service/acp/codex-app-server-adapter/codex-notification-queue.js.map +1 -1
  239. package/dist/src/backend/services/session/service/acp/types.d.ts +0 -1
  240. package/dist/src/backend/services/session/service/acp/types.d.ts.map +1 -1
  241. package/dist/src/backend/services/session/service/chat/chat-message-handlers/handlers/start.handler.test.js +0 -1
  242. package/dist/src/backend/services/session/service/chat/chat-message-handlers/handlers/start.handler.test.js.map +1 -1
  243. package/dist/src/backend/services/session/service/data/session-provider-resolver.service.test.js +1 -1
  244. package/dist/src/backend/services/session/service/data/session-provider-resolver.service.test.js.map +1 -1
  245. package/dist/src/backend/services/session/service/index.d.ts +1 -1
  246. package/dist/src/backend/services/session/service/index.d.ts.map +1 -1
  247. package/dist/src/backend/services/session/service/index.js +1 -1
  248. package/dist/src/backend/services/session/service/index.js.map +1 -1
  249. package/dist/src/backend/services/session/service/lifecycle/session-context.service.d.ts +1 -5
  250. package/dist/src/backend/services/session/service/lifecycle/session-context.service.d.ts.map +1 -1
  251. package/dist/src/backend/services/session/service/lifecycle/session-context.service.js +2 -63
  252. package/dist/src/backend/services/session/service/lifecycle/session-context.service.js.map +1 -1
  253. package/dist/src/backend/services/session/service/lifecycle/session-context.service.test.js +23 -99
  254. package/dist/src/backend/services/session/service/lifecycle/session-context.service.test.js.map +1 -1
  255. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle-external-ports.d.ts.map +1 -1
  256. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle-external-ports.js +13 -7
  257. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle-external-ports.js.map +1 -1
  258. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle-external-ports.test.js +26 -5
  259. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle-external-ports.test.js.map +1 -1
  260. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle-gate.d.ts +1 -0
  261. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle-gate.d.ts.map +1 -1
  262. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle-gate.js +3 -0
  263. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle-gate.js.map +1 -1
  264. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle.test-helpers.d.ts +1 -1
  265. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle.test-helpers.d.ts.map +1 -1
  266. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle.test-helpers.js +0 -11
  267. package/dist/src/backend/services/session/service/lifecycle/session-lifecycle.test-helpers.js.map +1 -1
  268. package/dist/src/backend/services/session/service/lifecycle/session-runtime-exit.coordinator.d.ts +1 -1
  269. package/dist/src/backend/services/session/service/lifecycle/session-runtime-exit.coordinator.d.ts.map +1 -1
  270. package/dist/src/backend/services/session/service/lifecycle/session-runtime-exit.coordinator.js +8 -5
  271. package/dist/src/backend/services/session/service/lifecycle/session-runtime-exit.coordinator.js.map +1 -1
  272. package/dist/src/backend/services/session/service/lifecycle/session-runtime-exit.coordinator.test.js +9 -5
  273. package/dist/src/backend/services/session/service/lifecycle/session-runtime-exit.coordinator.test.js.map +1 -1
  274. package/dist/src/backend/services/session/service/lifecycle/session-services.composition.test.js +0 -1
  275. package/dist/src/backend/services/session/service/lifecycle/session-services.composition.test.js.map +1 -1
  276. package/dist/src/backend/services/session/service/lifecycle/session-startup.coordinator.d.ts.map +1 -1
  277. package/dist/src/backend/services/session/service/lifecycle/session-startup.coordinator.js +0 -1
  278. package/dist/src/backend/services/session/service/lifecycle/session-startup.coordinator.js.map +1 -1
  279. package/dist/src/backend/services/session/service/lifecycle/session-workflow-permissions.d.ts +7 -0
  280. package/dist/src/backend/services/session/service/lifecycle/session-workflow-permissions.d.ts.map +1 -0
  281. package/dist/src/backend/services/session/service/lifecycle/session-workflow-permissions.js +9 -0
  282. package/dist/src/backend/services/session/service/lifecycle/session-workflow-permissions.js.map +1 -0
  283. package/dist/src/backend/services/session/service/lifecycle/session.config.service.d.ts.map +1 -1
  284. package/dist/src/backend/services/session/service/lifecycle/session.config.service.js +4 -5
  285. package/dist/src/backend/services/session/service/lifecycle/session.config.service.js.map +1 -1
  286. package/dist/src/backend/services/session/service/lifecycle/session.config.service.test.js +8 -8
  287. package/dist/src/backend/services/session/service/lifecycle/session.config.service.test.js.map +1 -1
  288. package/dist/src/backend/services/session/service/lifecycle/session.lifecycle.facade.test.js +0 -2
  289. package/dist/src/backend/services/session/service/lifecycle/session.lifecycle.facade.test.js.map +1 -1
  290. package/dist/src/backend/services/session/service/lifecycle/session.lifecycle.service.d.ts +0 -1
  291. package/dist/src/backend/services/session/service/lifecycle/session.lifecycle.service.d.ts.map +1 -1
  292. package/dist/src/backend/services/session/service/lifecycle/session.lifecycle.service.js.map +1 -1
  293. package/dist/src/backend/services/session/service/lifecycle/session.prompt-builder.d.ts +0 -33
  294. package/dist/src/backend/services/session/service/lifecycle/session.prompt-builder.d.ts.map +1 -1
  295. package/dist/src/backend/services/session/service/lifecycle/session.prompt-builder.js +0 -40
  296. package/dist/src/backend/services/session/service/lifecycle/session.prompt-builder.js.map +1 -1
  297. package/dist/src/backend/services/session/service/lifecycle/session.prompt-builder.test.js +2 -170
  298. package/dist/src/backend/services/session/service/lifecycle/session.prompt-builder.test.js.map +1 -1
  299. package/dist/src/backend/services/session/service/lifecycle/session.repository.d.ts +4 -12
  300. package/dist/src/backend/services/session/service/lifecycle/session.repository.d.ts.map +1 -1
  301. package/dist/src/backend/services/session/service/lifecycle/session.repository.js +2 -7
  302. package/dist/src/backend/services/session/service/lifecycle/session.repository.js.map +1 -1
  303. package/dist/src/backend/services/session/service/lifecycle/session.repository.test.js +1 -4
  304. package/dist/src/backend/services/session/service/lifecycle/session.repository.test.js.map +1 -1
  305. package/dist/src/backend/services/session/service/lifecycle/session.service.test.js +0 -162
  306. package/dist/src/backend/services/session/service/lifecycle/session.service.test.js.map +1 -1
  307. package/dist/src/backend/services/session/service/voice/voice-narration.service.d.ts +1 -0
  308. package/dist/src/backend/services/session/service/voice/voice-narration.service.d.ts.map +1 -1
  309. package/dist/src/backend/services/session/service/voice/voice-narration.service.js +69 -19
  310. package/dist/src/backend/services/session/service/voice/voice-narration.service.js.map +1 -1
  311. package/dist/src/backend/services/session/service/voice/voice-narration.service.test.js +196 -113
  312. package/dist/src/backend/services/session/service/voice/voice-narration.service.test.js.map +1 -1
  313. package/dist/src/backend/services/workspace/resources/project.accessor.d.ts.map +1 -1
  314. package/dist/src/backend/services/workspace/resources/project.accessor.js +3 -0
  315. package/dist/src/backend/services/workspace/resources/project.accessor.js.map +1 -1
  316. package/dist/src/backend/services/workspace/resources/project.accessor.test.js +24 -2
  317. package/dist/src/backend/services/workspace/resources/project.accessor.test.js.map +1 -1
  318. package/dist/src/backend/services/workspace/service/lifecycle/activity.service.d.ts +2 -0
  319. package/dist/src/backend/services/workspace/service/lifecycle/activity.service.d.ts.map +1 -1
  320. package/dist/src/backend/services/workspace/service/lifecycle/activity.service.js +30 -0
  321. package/dist/src/backend/services/workspace/service/lifecycle/activity.service.js.map +1 -1
  322. package/dist/src/backend/services/workspace/service/lifecycle/activity.service.test.js +113 -0
  323. package/dist/src/backend/services/workspace/service/lifecycle/activity.service.test.js.map +1 -1
  324. package/dist/src/backend/services/workspace/service/lifecycle/creation.service.test.js +2 -2
  325. package/dist/src/backend/services/workspace/service/lifecycle/creation.service.test.js.map +1 -1
  326. package/dist/src/backend/services/workspace/service/worktree/git-ops.service.d.ts.map +1 -1
  327. package/dist/src/backend/services/workspace/service/worktree/git-ops.service.js +12 -1
  328. package/dist/src/backend/services/workspace/service/worktree/git-ops.service.js.map +1 -1
  329. package/dist/src/backend/services/workspace/service/worktree/git-ops.service.test.js +15 -0
  330. package/dist/src/backend/services/workspace/service/worktree/git-ops.service.test.js.map +1 -1
  331. package/dist/src/backend/services/workspace-git-state.service.js +1 -1
  332. package/dist/src/backend/services/workspace-git-state.service.js.map +1 -1
  333. package/dist/src/backend/trpc/admin.router.test.js +34 -1
  334. package/dist/src/backend/trpc/admin.router.test.js.map +1 -1
  335. package/dist/src/backend/trpc/admin.trpc.d.ts.map +1 -1
  336. package/dist/src/backend/trpc/admin.trpc.js +2 -2
  337. package/dist/src/backend/trpc/admin.trpc.js.map +1 -1
  338. package/dist/src/backend/trpc/voice.trpc.d.ts.map +1 -1
  339. package/dist/src/backend/trpc/voice.trpc.js +6 -3
  340. package/dist/src/backend/trpc/voice.trpc.js.map +1 -1
  341. package/dist/src/backend/trpc/voice.trpc.test.js +27 -8
  342. package/dist/src/backend/trpc/voice.trpc.test.js.map +1 -1
  343. package/dist/src/backend/trpc/workspace/init.router.test.js +40 -1
  344. package/dist/src/backend/trpc/workspace/init.router.test.js.map +1 -1
  345. package/dist/src/backend/trpc/workspace/init.trpc.d.ts.map +1 -1
  346. package/dist/src/backend/trpc/workspace/init.trpc.js +20 -14
  347. package/dist/src/backend/trpc/workspace/init.trpc.js.map +1 -1
  348. package/dist/src/backend/trpc/workspace.router.test.js +1 -0
  349. package/dist/src/backend/trpc/workspace.router.test.js.map +1 -1
  350. package/dist/src/backend/trpc/workspace.trpc.d.ts.map +1 -1
  351. package/dist/src/backend/trpc/workspace.trpc.js +17 -16
  352. package/dist/src/backend/trpc/workspace.trpc.js.map +1 -1
  353. package/dist/src/shared/deepgram-voices.d.ts +7 -3
  354. package/dist/src/shared/deepgram-voices.d.ts.map +1 -1
  355. package/dist/src/shared/deepgram-voices.js +62 -45
  356. package/dist/src/shared/deepgram-voices.js.map +1 -1
  357. package/dist/src/shared/issue-start-prompt.d.ts.map +1 -1
  358. package/dist/src/shared/issue-start-prompt.js +6 -160
  359. package/dist/src/shared/issue-start-prompt.js.map +1 -1
  360. package/dist/src/shared/schemas/export-data.schema.d.ts +4 -4
  361. package/dist/src/shared/schemas/export-data.schema.d.ts.map +1 -1
  362. package/dist/src/shared/schemas/export-data.schema.js +13 -5
  363. package/dist/src/shared/schemas/export-data.schema.js.map +1 -1
  364. package/dist/tsconfig.backend.tsbuildinfo +1 -1
  365. package/package.json +34 -28
  366. package/prisma/migrations/20260904150539_upgrade_deepgram_flux_tts/migration.sql +43 -0
  367. package/prisma/schema.prisma +1 -1
  368. package/prompts/quick-actions/fetch-rebase.md +5 -9
  369. package/prompts/quick-actions/rename-branch.md +4 -8
  370. package/prompts/quick-actions/review.md +6 -5
  371. package/prompts/quick-actions/screenshots.md +7 -20
  372. package/prompts/quick-actions/simplify.md +4 -1
  373. package/prompts/ratchet/dispatch.md +13 -46
  374. package/dist/client/assets/admin-page-DSQHBVdP.js +0 -1
  375. package/dist/client/assets/architecture-7GRP2DOG-iqZodW6v.js +0 -1
  376. package/dist/client/assets/channel-CuF41sy9.js +0 -1
  377. package/dist/client/assets/classDiagram-ZZMXUADV-CSnIdOhD.js +0 -1
  378. package/dist/client/assets/classDiagram-v2-VYDZK3BY-CSnIdOhD.js +0 -1
  379. package/dist/client/assets/components-CYsyoHP0.js +0 -1
  380. package/dist/client/assets/data-import-button-D-ZWnQAg.js +0 -6
  381. package/dist/client/assets/detail-C1zBkWd-.js +0 -1
  382. package/dist/client/assets/diff-highlight.worker-C-7SSG_d.js +0 -55
  383. package/dist/client/assets/dist-BiFeezwN.js +0 -1
  384. package/dist/client/assets/eventmodeling-NTZA5JFV-C4d4RnR4.js +0 -1
  385. package/dist/client/assets/flowDiagram-HODETNUW-Df-T-03y.js +0 -1
  386. package/dist/client/assets/hooks-BTcY6K1q.js +0 -1
  387. package/dist/client/assets/index-D34fUfAP.js +0 -10
  388. package/dist/client/assets/jsx-runtime-DE3RlOCf.js +0 -1
  389. package/dist/client/assets/lib-DyBYhPHb.js +0 -1
  390. package/dist/client/assets/list-DozL_ZP-.js +0 -184
  391. package/dist/client/assets/new-C3e5S62x.js +0 -1
  392. package/dist/client/assets/new-CCDeoRvw.js +0 -1
  393. package/dist/client/assets/pr-inbox-item-vOH1gfSf.js +0 -2
  394. package/dist/client/assets/railroad-abnf-HS5TGJTU-DGUx-UBP.js +0 -1
  395. package/dist/client/assets/railroad-ebnf-LZEXJU2U-isA18bJo.js +0 -1
  396. package/dist/client/assets/railroad-peg-WCYAUIDC-Qz11I2dz.js +0 -1
  397. package/dist/client/assets/redirect-CNaRFL8d.js +0 -1
  398. package/dist/client/assets/spinner-ASaPCL5c.js +0 -1
  399. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-C3HBCmSp.js +0 -1
  400. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DXqJPUvi.js +0 -8
  401. package/dist/client/assets/trpc-X4t2_jd5.js +0 -1
  402. package/dist/client/assets/use-project-header-navigation-BXqLQ4G_.js +0 -1
  403. package/dist/client/assets/use-websocket-transport-BT1hhmkl.js +0 -50
  404. package/dist/client/assets/vbnet-CrqJJ08J.js +0 -57
  405. package/dist/client/assets/workspace-CsQCO4D_.js +0 -18
  406. package/dist/prompts/workflows/bugfix.md +0 -86
  407. package/dist/prompts/workflows/ci-fix.md +0 -52
  408. package/dist/prompts/workflows/explore.md +0 -54
  409. package/dist/prompts/workflows/feature.md +0 -80
  410. package/dist/prompts/workflows/followup.md +0 -32
  411. package/dist/prompts/workflows/pr-review-fix.md +0 -50
  412. package/dist/src/backend/prompts/workflows.d.ts +0 -14
  413. package/dist/src/backend/prompts/workflows.d.ts.map +0 -1
  414. package/dist/src/backend/prompts/workflows.js +0 -47
  415. package/dist/src/backend/prompts/workflows.js.map +0 -1
  416. package/dist/src/backend/prompts/workflows.test.d.ts +0 -2
  417. package/dist/src/backend/prompts/workflows.test.d.ts.map +0 -1
  418. package/dist/src/backend/prompts/workflows.test.js +0 -128
  419. package/dist/src/backend/prompts/workflows.test.js.map +0 -1
  420. package/prompts/workflows/bugfix.md +0 -86
  421. package/prompts/workflows/ci-fix.md +0 -52
  422. package/prompts/workflows/explore.md +0 -54
  423. package/prompts/workflows/feature.md +0 -80
  424. package/prompts/workflows/followup.md +0 -32
  425. package/prompts/workflows/pr-review-fix.md +0 -50
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";var r=e(t(),1),i=n(),a=r.createContext(void 0),o=e=>{let t=r.useContext(a);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},s=({client:e,children:t})=>(r.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(a.Provider,{value:e,children:t})),c={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=c;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function u(e){setTimeout(e,0)}var d=typeof window>`u`||`Deno`in globalThis;function f(){}function p(e,t){return typeof e==`function`?e(t):e}function m(e){return typeof e==`number`&&e>=0&&e!==1/0}function h(e,t){return Math.max(e+(t||0)-Date.now(),0)}function g(e,t){return typeof e==`function`?e(t):e}function _(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==y(o,t.options))return!1}else if(!x(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function v(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(b(t.options.mutationKey)!==b(a))return!1}else if(!x(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function y(e,t){return(t?.queryKeyHashFn||b)(e)}function b(e){return JSON.stringify(e,(e,t)=>re(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function x(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!x(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!x(e[r],t[r]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function te(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ne(e)&&ne(t);if(!r&&!(re(e)&&re(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ee.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=te(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function S(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function re(e){if(!ie(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ie(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ie(e){return Object.prototype.toString.call(e)===`[object Object]`}function ae(e){return new Promise(t=>{l.setTimeout(t,e)})}function oe(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:te(e,t)}function se(e){return e}function ce(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function le(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var C=Symbol();function ue(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===C?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function de(e,t){return typeof e==`function`?e(...t):!!e}function fe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var pe=()=>d,me=()=>pe(),w=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},he=new class extends w{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ge=u;function _e(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ge,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var T=_e(),ve=new class extends w{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ye(e){return Math.min(1e3*2**e,3e4)}function be(e){return(e??`online`)!==`online`||ve.isOnline()}var xe=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Se(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(f);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new xe(t);g(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},p=()=>he.isFocused()&&(e.networkMode===`always`||ve.isOnline())&&e.canRun(),m=()=>be(e.networkMode)&&e.canRun(),h=e=>{c()||(r?.(),i=`resolved`,a(e))},g=e=>{c()||(r?.(),i=`rejected`,o(e))},_=()=>new Promise(t=>{r=e=>{(c()||p())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(h).catch(r=>{if(c())return;let i=e.retry??(me()?0:3),a=e.retryDelay??ye,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){g(r);return}n++,e.onFail?.(n,r),ae(o).then(()=>p()?void 0:_()).then(()=>{t?g(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:m,start:()=>(m()?v():_().then(v),s)}}var Ce=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m(this.gcTime)&&(this.#e=l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(me()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(l.clearTimeout(this.#e),this.#e=void 0)}};function we(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{fe(e,()=>t.signal,()=>n=!0)},u=ue(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?le:ce;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ee:Te,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Te(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Te(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ee(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function De(e,t){return t?Te(e,t)!=null:!1}function Oe(e,t){return!t||!e.getPreviousPageParam?!1:Ee(e,t)!=null}var ke=class extends Ce{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Me(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Me(this.options);e.data!==void 0&&(this.setState(je(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=oe(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(f).catch(f):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>g(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===C||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>g(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!h(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ue(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?we(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Se({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof xe&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof xe){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ae(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...je(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),T.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ae(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:be(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function je(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Me(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var E=class extends w{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Pe(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fe(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fe(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof g(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!S(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ie(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||g(this.options.enabled,this.#t)!==g(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return S(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(f)),t}#h(e){return!me()&&g(this.options.enabled,this.#t)!==!1&&m(e)}#g(){this.#b();let e=g(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=h(this.#r.dataUpdatedAt,e)+1;this.#u=l.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=l.setInterval(()=>{(this.options.refetchIntervalInBackground||he.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(l.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(l.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Pe(e,t),o=i&&Ie(e,n,t,r);(a||o)&&(l={...l,...Ae(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=oe(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=oe(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let _=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&_,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:_,isRefetching:_&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:Le(e,t),refetch:this.refetch,isEnabled:g(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),S(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();T.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Ne(e,t){return g(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||g(t.retryOnMount,e)!==!1)}function Pe(e,t){return Ne(e,t)||e.state.data!==void 0&&Fe(e,t,t.refetchOnMount)}function Fe(e,t,n){if(g(t.enabled,e)!==!1&&g(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Le(e,t)}return!1}function Ie(e,t,n,r){return(e!==t||g(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Le(e,n)}function Le(e,t){return g(t.enabled,e)!==!1&&e.isStaleByTime(g(t.staleTime,e))}var Re=class extends E{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:De(t,n.data),hasPreviousPage:Oe(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},ze=class extends Ce{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Be(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Se({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),T.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Be(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ve=class extends w{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),S(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&b(t.mutationKey)!==b(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Be();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){T.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function He(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Ue=class extends w{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,T.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!S(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(He(e,n).forEach(e=>{e.destroy()}),He(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=te(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new E(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&T.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},We=r.createContext(!1),Ge=()=>r.useContext(We);We.Provider;function Ke(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qe=r.createContext(Ke()),Je=()=>r.useContext(qe),Ye=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?de(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Xe=e=>{r.useEffect(()=>{e.clearReset()},[e])},Ze=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||de(n,[e.error,r])),Qe=(e,t)=>t.state.data===void 0,$e=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},et=(e,t)=>e?.suspense&&t.isPending,tt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function nt({queries:e,...t},n){let i=o(n),a=Ge(),s=Je(),c=t.subscribed!==!1,l=r.useMemo(()=>e.map(e=>{let t=i.defaultQueryOptions(e);return t._optimisticResults=a?`isRestoring`:c?`optimistic`:void 0,t}),[e,i,a,c]);l.forEach(e=>{$e(e);let t=i.getQueryCache().get(e.queryHash);Ye(e,s,t)}),Xe(s);let[u]=r.useState(()=>new Ue(i,l,t)),[d,p,m]=u.getOptimisticResult(l,t.combine),h=!a&&c;r.useSyncExternalStore(r.useCallback(e=>h?u.subscribe(T.batchCalls(e)):f,[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),r.useEffect(()=>{u.setQueries(l,t)},[l,t,u]);let g=d.some((e,t)=>et(l[t],e))?d.flatMap((e,t)=>{let n=l[t];return n&&et(n,e)?tt(n,new E(i,n),s):[]}):[];if(g.length>0)throw Promise.all(g);let _=d.find((e,t)=>{let n=l[t];return n&&Ze({result:e,errorResetBoundary:s,throwOnError:n.throwOnError,query:i.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(_)throw _.error;return p(m())}function rt(e,t,n){let i=Ge(),a=Je(),s=o(n),c=s.defaultQueryOptions(e),l=s.getQueryCache().get(c.queryHash),u=e.subscribed!==!1;c._optimisticResults=i?`isRestoring`:u?`optimistic`:void 0,$e(c),Ye(c,a,l),Xe(a);let[d]=r.useState(()=>new t(s,c)),p=d.getOptimisticResult(c),m=!i&&u;if(r.useSyncExternalStore(r.useCallback(e=>{let t=m?d.subscribe(T.batchCalls(e)):f;return d.updateResult(),t},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),r.useEffect(()=>{d.setOptions(c)},[c,d]),et(c,p))throw tt(c,d,a);if(Ze({result:p,errorResetBoundary:a,throwOnError:c.throwOnError,query:l,suspense:c.suspense}))throw p.error;return c.notifyOnChangeProps?p:d.trackResult(p)}function it(e,t){return rt(e,E,t)}function at(e,t){return rt({...e,enabled:!0,suspense:!0,throwOnError:Qe,placeholderData:void 0},E,t)}function ot(e,t){return rt({...e,enabled:!0,suspense:!0,throwOnError:Qe,placeholderData:void 0},Re,t)}function st(e,t){return nt({...e,queries:e.queries.map(e=>({...e,suspense:!0,throwOnError:Qe,enabled:!0,placeholderData:void 0}))},t)}function ct(e,t){let n=o(t);n.getQueryState(e.queryKey)||n.query(e).catch(f)}function lt(e,t){let n=o(t);n.getQueryState(e.queryKey)||n.infiniteQuery(e).catch(f)}function ut(e){return e}function dt(e){return e}function ft(e,t){let n=o(t),[i]=r.useState(()=>new Ve(n,e));r.useEffect(()=>{i.setOptions(e)},[i,e]);let a=r.useSyncExternalStore(r.useCallback(e=>i.subscribe(T.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),s=r.useCallback((...e)=>{i.mutate(e[0],e[1]).catch(f)},[i]);if(a.error&&de(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:s,mutateAsync:a.mutate}}function pt(e,t){return rt(e,Re,t)}function D(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function mt(){return Object.create(null)}var ht=typeof Symbol==`function`&&!!Symbol.asyncIterator;function gt(e){return ht&&D(e)&&Symbol.asyncIterator in e}var _t={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};_t.BAD_GATEWAY,_t.SERVICE_UNAVAILABLE,_t.GATEWAY_TIMEOUT,_t.INTERNAL_SERVER_ERROR;var vt=Object.create,yt=Object.defineProperty,bt=Object.getOwnPropertyDescriptor,xt=Object.getOwnPropertyNames,St=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty,O=(e,t)=>function(){return t||(0,e[xt(e)[0]])((t={exports:{}}).exports,t),t.exports},wt=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=xt(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Ct.call(e,s)&&s!==n&&yt(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=bt(t,s))||r.enumerable});return e},Tt=(e,t,n)=>(n=e==null?{}:vt(St(e)),wt(t||!e||!e.__esModule?yt(n,`default`,{value:e,enumerable:!0}):n,e)),Et=()=>{},Dt=e=>{Object.freeze&&Object.freeze(e)};function Ot(e,t,n){let r=t.join(`.`);return n[r]??(n[r]=new Proxy(Et,{get(r,i){if(typeof i==`string`&&i!==`then`)return Ot(e,[...t,i],n)},apply(n,r,i){let a=t[t.length-1];if(a===`valueOf`||a===`toString`||a===`toJSON`)return`tRPC.proxy(${t.slice(0,-1).join(`.`)})`;let o={args:i,path:t};return a===`call`?o={args:i.length>=2?[i[1]]:[],path:t.slice(0,-1)}:a===`apply`&&(o={args:i.length>=2?i[1]:[],path:t.slice(0,-1)}),Dt(o.args),Dt(o.path),e(o)}})),n[r]}var kt=e=>Ot(e,[],mt()),At=e=>new Proxy(Et,{get(t,n){if(n!==`then`)return e(n)}}),jt=O({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Mt=O({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=jt().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Nt=O({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=jt().default,r=Mt();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),Pt=O({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Nt();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Ft=O({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Pt();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});Tt(Ft(),1),Tt(Pt(),1);var It=Tt(Ft(),1);function Lt(e,t){if(`error`in e){let n=t.deserialize(e.error);return{ok:!1,error:(0,It.default)((0,It.default)({},e),{},{error:n})}}return{ok:!0,result:(0,It.default)((0,It.default)({},e.result),(!e.result.type||e.result.type===`data`)&&{type:`data`,data:t.deserialize(e.result.data)})}}var Rt=class extends Error{constructor(){super(`Unable to transform response from server`)}};function zt(e,t){let n;try{n=Lt(e,t)}catch{throw new Rt}if(!n.ok&&(!D(n.error.error)||typeof n.error.error.code!=`number`)||n.ok&&!D(n.result))throw new Rt;return n}Tt(Ft(),1);function Bt(e){let t={subscribe(t){let n=null,r=!1,i=!1,a=!1;function o(){if(n===null){a=!0;return}i||(i=!0,typeof n==`function`?n():n&&n.unsubscribe())}return n=e({next(e){var n;r||(n=t.next)==null||n.call(t,e)},error(e){var n;r||(r=!0,(n=t.error)==null||n.call(t,e),o())},complete(){var e;r||(r=!0,(e=t.complete)==null||e.call(t),o())}}),a&&o(),{unsubscribe:o}},pipe(...e){return e.reduce(Vt,t)}};return t}function Vt(e,t){return t(e)}function Ht(e){let t=new AbortController;return new Promise((n,r)=>{let i=!1;function a(){i||(i=!0,o.unsubscribe())}t.signal.addEventListener(`abort`,()=>{r(t.signal.reason)});let o=e.subscribe({next(e){i=!0,n(e),a()},error(e){r(e)},complete(){t.abort(),a()}})})}var Ut=Object.create,Wt=Object.defineProperty,Gt=Object.getOwnPropertyDescriptor,Kt=Object.getOwnPropertyNames,qt=Object.getPrototypeOf,Jt=Object.prototype.hasOwnProperty,k=(e,t)=>function(){return t||(0,e[Kt(e)[0]])((t={exports:{}}).exports,t),t.exports},Yt=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Kt(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Jt.call(e,s)&&s!==n&&Wt(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Gt(t,s))||r.enumerable});return e},A=(e,t,n)=>(n=e==null?{}:Ut(qt(e)),Yt(t||!e||!e.__esModule?Wt(n,`default`,{value:e,enumerable:!0}):n,e)),Xt=k({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),Zt=k({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=Xt();function r(e,t){if(e==null)return{};var r,i,a=n(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Qt=k({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),$t=k({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Qt().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),en=k({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Qt().default,r=$t();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),tn=k({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=en();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),j=k({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=tn();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),nn=A(Zt(),1),rn=A(j(),1),an=[`cursor`,`direction`];function M(e,t,n){let r=e.flatMap(e=>e.split(`.`));if(!t&&(!n||n===`any`))return r.length?[r]:[];if(n===`infinite`&&D(t)&&(`direction`in t||`cursor`in t)){let{cursor:e,direction:n}=t;return[r,{input:(0,nn.default)(t,an),type:`infinite`}]}return[r,(0,rn.default)((0,rn.default)({},t!==void 0&&t!==C&&{input:t}),n&&n!==`any`&&{type:n})]}function on(e){return M(e,void 0,`any`)}var sn=Object.create,cn=Object.defineProperty,ln=Object.getOwnPropertyDescriptor,un=Object.getOwnPropertyNames,dn=Object.getPrototypeOf,fn=Object.prototype.hasOwnProperty,N=(e,t)=>function(){return t||(0,e[un(e)[0]])((t={exports:{}}).exports,t),t.exports},pn=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=un(t),a=0,o=i.length,s;a<o;a++)s=i[a],!fn.call(e,s)&&s!==n&&cn(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ln(t,s))||r.enumerable});return e},P=(e,t,n)=>(n=e==null?{}:sn(dn(e)),pn(t||!e||!e.__esModule?cn(n,`default`,{value:e,enumerable:!0}):n,e)),mn=N({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),hn=N({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=mn().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),gn=N({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=mn().default,r=hn();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),F=N({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=gn();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),I=N({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=F();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});function _n(e){return e=>{let t=0,n=null,r=[];function i(){n||=e.subscribe({next(e){for(let n of r){var t;(t=n.next)==null||t.call(n,e)}},error(e){for(let n of r){var t;(t=n.error)==null||t.call(n,e)}},complete(){for(let t of r){var e;(e=t.complete)==null||e.call(t)}}})}function a(){if(t===0&&n){let e=n;n=null,e.unsubscribe()}}return Bt(e=>(t++,r.push(e),i(),{unsubscribe(){t--,a();let n=r.findIndex(t=>t===e);n>-1&&r.splice(n,1)}}))}}function vn(e){let t=e,n=[],r=e=>{t!==void 0&&e.next(t),n.push(e)},i=e=>{n.splice(n.indexOf(e),1)},a=Bt(e=>(r(e),()=>{i(e)}));return a.next=e=>{if(t!==e){t=e;for(let t of n)t.next(e)}},a.get=()=>t,a}function yn(e){return Bt(t=>{function n(t=0,r=e.op){let i=e.links[t];if(!i)throw Error(`No more links to execute - did you forget to add an ending link?`);return i({op:r,next(e){return n(t+1,e)}})}return n().subscribe(t)})}var bn=P(F(),1),L=P(I(),1);function xn(e){return e instanceof wn}function Sn(e){return D(e)&&D(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function Cn(e,t){return typeof e==`string`?e:D(e)&&typeof e.message==`string`?e.message:t}var wn=class e extends Error{constructor(t,n){var r,i;let a=n?.cause;super(t,{cause:a}),(0,bn.default)(this,`cause`,void 0),(0,bn.default)(this,`shape`,void 0),(0,bn.default)(this,`data`,void 0),(0,bn.default)(this,`meta`,void 0),this.meta=n?.meta,this.cause=a,this.shape=n==null||(r=n.result)==null?void 0:r.error,this.data=n==null||(i=n.result)==null?void 0:i.error.data,this.name=`TRPCClientError`,Object.setPrototypeOf(this,e.prototype)}static from(t,n={}){let r=t;return xn(r)?(n.meta&&(r.meta=(0,L.default)((0,L.default)({},r.meta),n.meta)),r):Sn(r)?new e(r.error.message,(0,L.default)((0,L.default)({},n),{},{result:r,cause:n.cause})):new e(Cn(r,`Unknown error`),(0,L.default)((0,L.default)({},n),{},{cause:r}))}};function Tn(e){let t=e;return t?`input`in t?t:{input:t,output:t}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}var En=e=>typeof e==`function`;function Dn(e){if(e)return e;if(typeof window<`u`&&En(window.fetch))return window.fetch;if(typeof globalThis<`u`&&En(globalThis.fetch))return globalThis.fetch;throw Error(`No fetch implementation found`)}var R=P(I());function On(e){return{url:e.url.toString(),fetch:e.fetch,transformer:Tn(e.transformer),methodOverride:e.methodOverride}}function kn(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];t[n]=r}return t}var An={query:`GET`,mutation:`POST`,subscription:`PATCH`};function jn(e){return`input`in e?e.transformer.input.serialize(e.input):kn(e.inputs.map(t=>e.transformer.input.serialize(t)))}var Mn=e=>{let t=e.url.split(`?`),n=t[0].replace(/\/$/,``)+`/`+e.path,r=[];if(t[1]&&r.push(t[1]),`inputs`in e&&r.push(`batch=1`),e.type===`query`||e.type===`subscription`){let t=jn(e);t!==void 0&&e.methodOverride!==`POST`&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+=`?`+r.join(`&`)),n},Nn=e=>{if(e.type===`query`&&e.methodOverride!==`POST`)return;let t=jn(e);return t===void 0?void 0:JSON.stringify(t)},Pn=e=>Rn((0,R.default)((0,R.default)({},e),{},{contentTypeHeader:`application/json`,getUrl:Mn,getBody:Nn})),Fn=class extends Error{constructor(){let e=`AbortError`;super(e),this.name=e,this.message=e}},In=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<`u`?new DOMException(`AbortError`,`AbortError`):new Fn};async function Ln(e){In(e.signal);let t=e.getUrl(e),n=e.getBody(e),r=e.methodOverride??An[e.type],i=await(async()=>{let t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a=(0,R.default)((0,R.default)((0,R.default)({},e.contentTypeHeader&&r!==`GET`?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[e.trpcAcceptHeaderKey??`trpc-accept`]:e.trpcAcceptHeader}:void 0),i);return Dn(e.fetch)(t,{method:r,signal:e.signal,body:n,headers:a})}async function Rn(e){let t={},n=await Ln(e);t.response=n;let r=await n.json();return t.responseJSON=r,{json:r,meta:t}}P(I(),1);var zn=()=>{throw Error(`Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new`)};function Bn(e){let t=null,n=null,r=()=>{clearTimeout(n),n=null,t=null};function i(t){let n=[[]],r=0;for(;;){let o=t[r];if(!o)break;let s=n[n.length-1];if(o.aborted){var i;(i=o.reject)==null||i.call(o,Error(`Aborted`)),r++;continue}if(e.validate(s.concat(o).map(e=>e.key))){s.push(o),r++;continue}if(s.length===0){var a;(a=o.reject)==null||a.call(o,Error(`Input is too big for a single dispatch`)),r++;continue}n.push([])}return n}function a(){let n=i(t);r();for(let t of n){if(!t.length)continue;let n={items:t};for(let e of t)e.batch=n;e.fetch(n.items.map(e=>e.key)).then(async e=>{await Promise.all(e.map(async(e,t)=>{let r=n.items[t];try{var i;let t=await Promise.resolve(e);(i=r.resolve)==null||i.call(r,t)}catch(e){var a;(a=r.reject)==null||a.call(r,e)}r.batch=null,r.reject=null,r.resolve=null}));for(let e of n.items){var t;(t=e.reject)==null||t.call(e,Error(`Missing result`)),e.batch=null}}).catch(e=>{for(let r of n.items){var t;(t=r.reject)==null||t.call(r,e),r.batch=null}})}}function o(e){let r={aborted:!1,key:e,batch:null,resolve:zn,reject:zn},i=new Promise((e,n)=>{r.reject=n,r.resolve=e,t??=[],t.push(r)});return n??=setTimeout(a),i}return{load:o}}function Vn(...e){let t=new AbortController,n=e.length,r=0,i=()=>{++r===n&&t.abort()};for(let t of e)t?.aborted?i():t?.addEventListener(`abort`,i,{once:!0});return t.signal}var Hn=P(I(),1);function Un(e){let t=On(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{let i=i=>({validate(e){if(n===1/0&&r===1/0)return!0;if(e.length>r)return!1;let a=e.map(e=>e.path).join(`,`),o=e.map(e=>e.input);return Mn((0,Hn.default)((0,Hn.default)({},t),{},{type:i,path:a,inputs:o,signal:null})).length<=n},async fetch(n){let r=n.map(e=>e.path).join(`,`),a=n.map(e=>e.input),o=Vn(...n.map(e=>e.signal)),s=await Pn((0,Hn.default)((0,Hn.default)({},t),{},{path:r,inputs:a,type:i,headers(){return e.headers?typeof e.headers==`function`?e.headers({opList:n}):e.headers:{}},signal:o}));return(Array.isArray(s.json)?s.json:n.map(()=>s.json)).map(e=>({meta:s.meta,json:e}))}}),a={query:Bn(i(`query`)),mutation:Bn(i(`mutation`))};return({op:e})=>Bt(n=>{if(e.type===`subscription`)throw Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let r=a[e.type].load(e),i;return r.then(e=>{i=e;let r=zt(e.json,t.transformer.output);if(!r.ok){n.error(wn.from(r.error,{meta:e.meta}));return}n.next({context:e.meta,result:r.result}),n.complete()}).catch(e=>{n.error(wn.from(e,{meta:i?.meta}))}),()=>{}})}}P(I(),1);var Wn=(e,...t)=>typeof e==`function`?e(...t):e;P(F(),1);function Gn(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function Kn(e){let t=await Wn(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function qn(e,t){let n={method:`connectionParams`,data:await Wn(e)};return t.encode(n)}P(F(),1);var z=P(F(),1);function Jn(e){let{promise:t,resolve:n,reject:r}=Gn();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}function Yn(e,{intervalMs:t,pongTimeoutMs:n}){let r,i;function a(){r=setTimeout(()=>{e.send(`PING`),i=setTimeout(()=>{e.close()},n)},t)}function o(){clearTimeout(r),a()}function s(){clearTimeout(i),o()}e.addEventListener(`open`,a),e.addEventListener(`message`,({data:e})=>{clearTimeout(r),a(),e===`PONG`&&s()}),e.addEventListener(`close`,()=>{clearTimeout(r),clearTimeout(i)})}var Xn=class e{constructor(t){if((0,z.default)(this,`id`,++e.connectCount),(0,z.default)(this,`WebSocketPonyfill`,void 0),(0,z.default)(this,`urlOptions`,void 0),(0,z.default)(this,`keepAliveOpts`,void 0),(0,z.default)(this,`encoder`,void 0),(0,z.default)(this,`wsObservable`,vn(null)),(0,z.default)(this,`openPromise`,null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++e.connectCount,t.openPromise=Kn(t.urlOptions).then(e=>new t.WebSocketPonyfill(e)).then(async e=>{t.ws=e,e.binaryType=`arraybuffer`,e.addEventListener(`message`,function({data:e}){e===`PING`&&this.send(`PONG`)}),t.keepAliveOpts.enabled&&Yn(e,t.keepAliveOpts),e.addEventListener(`close`,()=>{t.ws===e&&(t.ws=null)}),await Jn(e),t.urlOptions.connectionParams&&e.send(await qn(t.urlOptions.connectionParams,t.encoder))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var t;(t=e.ws)==null||t.close()}}};(0,z.default)(Xn,`connectCount`,0),P(F(),1),P(I(),1);var Zn=P(F(),1),Qn=P(I(),1),$n=class{constructor(e){(0,Zn.default)(this,`links`,void 0),(0,Zn.default)(this,`runtime`,void 0),(0,Zn.default)(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return yn({links:this.links,op:(0,Qn.default)((0,Qn.default)({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(_n())}async requestAsPromise(e){var t=this;try{return(await Ht(t.$request(e))).result.data}catch(e){throw wn.from(e)}}query(e,t,n){return this.requestAsPromise({type:`query`,path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:`mutation`,path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:`subscription`,path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case`state`:var t;(t=n.onConnectionStateChange)==null||t.call(n,e.result);break;case`started`:var r;(r=n.onStarted)==null||r.call(n,{context:e.context});break;case`stopped`:var i;(i=n.onStopped)==null||i.call(n);break;case`data`:case void 0:var a;(a=n.onData)==null||a.call(n,e.result.data)}},error(e){var t;(t=n.onError)==null||t.call(n,e)},complete(){var e;(e=n.onComplete)==null||e.call(n)}})}},er=Symbol.for(`trpc_untypedClient`),tr={query:`query`,mutate:`mutation`,subscribe:`subscription`},nr=e=>tr[e];function rr(e){let t=kt(({path:t,args:n})=>{let r=[...t],i=nr(r.pop()),a=r.join(`.`);return e[i](a,...n)});return At(n=>n===er?e:t[n])}function ir(e){return rr(new $n(e))}function ar(e){return e[er]}P(I(),1),P(I(),1),P(N({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,i,a=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,i=Symbol.iterator);a--;){if(n&&(t=e[n])!=null)return t.call(e);if(i&&(t=e[i])!=null)return new r(t.call(e));n=`@@asyncIterator`,i=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1),P(I(),1);var or=N({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),sr=N({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(e,t){this.v=e,this.k=t}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),cr=N({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=sr();function r(e){return new n(e,0)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),lr=N({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=sr();function r(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,c=s instanceof n;Promise.resolve(c?s.v:s).then(function(n){if(c){var r=t===`return`?`return`:`next`;if(!s.k||n.done)return i(r,n);n=e[r](n).value}a(o.done?`return`:`normal`,n)},function(e){i(`throw`,e)})}catch(e){a(`throw`,e)}}function a(e,n){switch(e){case`return`:t.resolve({value:n,done:!0});break;case`throw`:t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise(function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))})},typeof e.return!=`function`&&(this.return=void 0)}i.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},i.prototype.next=function(e){return this._invoke(`next`,e)},i.prototype.throw=function(e){return this._invoke(`throw`,e)},i.prototype.return=function(e){return this._invoke(`return`,e)},t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});P(or(),1),P(cr(),1),P(lr(),1),P(I(),1);function ur(e){return kt(({path:t,args:n})=>{let r=[...t],i=r.pop();if(i===`useMutation`)return e[i](r,...n);if(i===`_def`)return{path:r};let[a,...o]=n,s=o[0]??{};return e[i](r,a,s)})}var dr=[`client`,`ssrContext`,`ssrState`,`abortOnUnmount`],fr=r.createContext?.call(r,null),pr=e=>{switch(e){case`queryOptions`:case`fetch`:case`ensureData`:case`prefetch`:case`getData`:case`setData`:case`setQueriesData`:return`query`;case`infiniteQueryOptions`:case`fetchInfinite`:case`prefetchInfinite`:case`getInfiniteData`:case`setInfiniteData`:return`infinite`;case`setMutationDefaults`:case`getMutationDefaults`:case`isMutating`:case`cancel`:case`invalidate`:case`refetch`:case`reset`:return`any`}};function mr(e){return kt(t=>{let n=[...t.path],r=n.pop(),i=[...t.args],a=i.shift(),o=M(n,a,pr(r));return{infiniteQueryOptions:()=>e.infiniteQueryOptions(n,o,i[0]),queryOptions:()=>e.queryOptions(n,o,...i),fetch:()=>e.fetchQuery(o,...i),fetchInfinite:()=>e.fetchInfiniteQuery(o,i[0]),prefetch:()=>e.prefetchQuery(o,...i),prefetchInfinite:()=>e.prefetchInfiniteQuery(o,i[0]),ensureData:()=>e.ensureQueryData(o,...i),invalidate:()=>e.invalidateQueries(o,...i),reset:()=>e.resetQueries(o,...i),refetch:()=>e.refetchQueries(o,...i),cancel:()=>e.cancelQuery(o,...i),setData:()=>{e.setQueryData(o,i[0],i[1])},setQueriesData:()=>e.setQueriesData(o,i[0],i[1],i[2]),setInfiniteData:()=>{e.setInfiniteQueryData(o,i[0],i[1])},getData:()=>e.getQueryData(o),getInfiniteData:()=>e.getInfiniteQueryData(o),setMutationDefaults:()=>e.setMutationDefaults(on(n),a),getMutationDefaults:()=>e.getMutationDefaults(on(n)),isMutating:()=>e.isMutating({mutationKey:on(n)})}[r]()})}function hr(e){let t=rr(e.client),n=mr(e);return At(r=>{let i=r;return i===`client`?t:dr.includes(i)?e[i]:n[r]})}var gr=A(j(),1);function _r(e){let t=e instanceof $n?e:ar(e);return kt(e=>{let n=e.path,r=n.join(`.`),[i,a]=e.args;return(0,gr.default)({queryKey:M(n,i,`query`),queryFn:()=>t.query(r,i,a?.trpc)},a)})}var vr=A(j(),1);function B(e,t,n){let r=e[0],i=e[1]?.input;return n&&(i=(0,vr.default)((0,vr.default)((0,vr.default)({},i??{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})),[r.join(`.`),i,t?.trpc]}var yr=A(k({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,i,a=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,i=Symbol.iterator);a--;){if(n&&(t=e[n])!=null)return t.call(e);if(i&&(t=e[i])!=null)return new r(t.call(e));n=`@@asyncIterator`,i=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1);function br(e){return{path:e.path.join(`.`)}}function V(e){let t=br(e);return r.useMemo(()=>t,[t])}async function xr(e,t,n){let r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:`success`});let i=[];var a=!1,o=!1,s;try{for(var c=(0,yr.default)(e),l;a=!(l=await c.next()).done;a=!1){let e=l.value;i.push(e),r.setState({data:[...i]})}}catch(e){o=!0,s=e}finally{try{a&&c.return!=null&&await c.return()}finally{if(o)throw s}}return i}var H=A(j(),1);function Sr(e){let{client:t,queryClient:n}=e,r=t instanceof $n?t:ar(t);return{infiniteQueryOptions:(e,t,n)=>{let i=t[1]?.input===C;return Object.assign(dt((0,H.default)((0,H.default)({},n),{},{initialData:n?.initialData,queryKey:t,queryFn:i?C:async e=>{var i;let a=(0,H.default)((0,H.default)({},n),{},{trpc:(0,H.default)((0,H.default)({},n?.trpc),n!=null&&(i=n.trpc)!=null&&i.abortOnUnmount?{signal:e.signal}:{signal:null})});return await r.query(...B(t,a,{direction:e.direction,pageParam:e.pageParam}))},initialPageParam:n?.initialCursor??null})),{trpc:br({path:e})})},queryOptions:(e,t,i)=>{let a=t[1]?.input===C;return Object.assign(ut((0,H.default)((0,H.default)({},i),{},{initialData:i?.initialData,queryKey:t,queryFn:a?C:async e=>{var a;let o=(0,H.default)((0,H.default)({},i),{},{trpc:(0,H.default)((0,H.default)({},i?.trpc),i!=null&&(a=i.trpc)!=null&&a.abortOnUnmount?{signal:e.signal}:{signal:null})}),s=await r.query(...B(t,o));return gt(s)?xr(s,n,t):s}})),{trpc:br({path:e})})},fetchQuery:(e,t)=>n.fetchQuery((0,H.default)((0,H.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...B(e,t))})),fetchInfiniteQuery:(e,t)=>n.fetchInfiniteQuery((0,H.default)((0,H.default)({},t),{},{queryKey:e,queryFn:({pageParam:n,direction:i})=>r.query(...B(e,t,{pageParam:n,direction:i})),initialPageParam:t?.initialCursor??null})),prefetchQuery:(e,t)=>n.prefetchQuery((0,H.default)((0,H.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...B(e,t))})),prefetchInfiniteQuery:(e,t)=>n.prefetchInfiniteQuery((0,H.default)((0,H.default)({},t),{},{queryKey:e,queryFn:({pageParam:n,direction:i})=>r.query(...B(e,t,{pageParam:n,direction:i})),initialPageParam:t?.initialCursor??null})),ensureQueryData:(e,t)=>n.ensureQueryData((0,H.default)((0,H.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...B(e,t))})),invalidateQueries:(e,t,r)=>n.invalidateQueries((0,H.default)((0,H.default)({},t),{},{queryKey:e}),r),resetQueries:(e,t,r)=>n.resetQueries((0,H.default)((0,H.default)({},t),{},{queryKey:e}),r),refetchQueries:(e,t,r)=>n.refetchQueries((0,H.default)((0,H.default)({},t),{},{queryKey:e}),r),cancelQuery:(e,t)=>n.cancelQueries({queryKey:e},t),setQueryData:(e,t,r)=>n.setQueryData(e,t,r),setQueriesData:(e,t,r,i)=>n.setQueriesData((0,H.default)((0,H.default)({},t),{},{queryKey:e}),r,i),getQueryData:e=>n.getQueryData(e),setInfiniteQueryData:(e,t,r)=>n.setQueryData(e,t,r),getInfiniteQueryData:e=>n.getQueryData(e),setMutationDefaults:(t,i)=>{let a=t[0];return n.setMutationDefaults(t,typeof i==`function`?i({canonicalMutationFn:t=>r.mutation(...B([a,{input:t}],e))}):i)},getMutationDefaults:e=>n.getMutationDefaults(e),isMutating:e=>n.isMutating((0,H.default)((0,H.default)({},e),{},{exact:!0}))}}var U=A(j()),Cr=(e,t)=>new Proxy(e,{get(e,n){return t(n),e[n]}});function wr(e){var t;let n=(e==null||(t=e.overrides)==null||(t=t.useMutation)==null?void 0:t.onSuccess)??(e=>e.originalFn()),a=e?.context??fr,o=ir,s=e=>{let{abortOnUnmount:t=!1,queryClient:n,ssrContext:o}=e,[s,c]=r.useState(e.ssrState??!1),l=e.client instanceof $n?e.client:ar(e.client),u=r.useMemo(()=>Sr({client:l,queryClient:n}),[l,n]),d=r.useMemo(()=>(0,U.default)({abortOnUnmount:t,queryClient:n,client:l,ssrContext:o??null,ssrState:s},u),[t,l,u,n,o,s]);return r.useEffect(()=>{c(e=>e?`mounted`:!1)},[]),(0,i.jsx)(a.Provider,{value:d,children:e.children})};function c(){let e=r.useContext(a);if(!e)throw Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return e}function l(e,t){let{queryClient:n,ssrState:r}=c();return r&&r!==`mounted`&&n.getQueryCache().find({queryKey:e})?.state.status===`error`?(0,U.default)({retryOnMount:!1},t):t}function u(t,n,r){var i,a;let{abortOnUnmount:o,client:s,ssrState:u,queryClient:d,prefetchQuery:f}=c(),p=M(t,n,`query`),m=d.getQueryDefaults(p),h=n===C;typeof window>`u`&&u===`prepass`&&(r==null||(i=r.trpc)==null?void 0:i.ssr)!==!1&&(r?.enabled??m?.enabled)!==!1&&!h&&!d.getQueryCache().find({queryKey:p})&&f(p,r);let g=l(p,(0,U.default)((0,U.default)({},m),r)),_=(r==null||(a=r.trpc)==null?void 0:a.abortOnUnmount)??e?.abortOnUnmount??o,v=it((0,U.default)((0,U.default)({},g),{},{queryKey:p,queryFn:h?n:async e=>{let t=(0,U.default)((0,U.default)({},g),{},{trpc:(0,U.default)((0,U.default)({},g?.trpc),_?{signal:e.signal}:{signal:null})}),n=await s.query(...B(p,t));return gt(n)?xr(n,d,p):n}}),d);return v.trpc=V({path:t}),v}function d(t,n,r){var i;let a=c(),o=M(t,n,`query`),s=n===C,l=(r==null||(i=r.trpc)==null?void 0:i.abortOnUnmount)??e?.abortOnUnmount??a.abortOnUnmount;ct((0,U.default)((0,U.default)({},r),{},{queryKey:o,queryFn:s?n:e=>{let t={trpc:(0,U.default)((0,U.default)({},r?.trpc),l?{signal:e.signal}:{})};return a.client.query(...B(o,t))}}))}function f(t,n,r){var i;let a=c(),o=M(t,n,`query`),s=(r==null||(i=r.trpc)==null?void 0:i.abortOnUnmount)??e?.abortOnUnmount??a.abortOnUnmount,l=at((0,U.default)((0,U.default)({},r),{},{queryKey:o,queryFn:e=>{let t=(0,U.default)((0,U.default)({},r),{},{trpc:(0,U.default)((0,U.default)({},r?.trpc),s?{signal:e.signal}:{signal:null})});return a.client.query(...B(o,t))}}),a.queryClient);return l.trpc=V({path:t}),[l.data,l]}function p(e,t){let{client:r,queryClient:i}=c(),a=on(e),o=i.defaultMutationOptions(i.getMutationDefaults(a)),s=ft((0,U.default)((0,U.default)({},t),{},{mutationKey:a,mutationFn:n=>r.mutation(...B([e,{input:n}],t)),onSuccess(...e){return n({originalFn:()=>{var n,r;return(t==null||(n=t.onSuccess)==null?void 0:n.call(t,...e))??(o==null||(r=o.onSuccess)==null?void 0:r.call(o,...e))},queryClient:i,meta:t?.meta??o?.meta??{}})}}),i);return s.trpc=V({path:e}),s}let m={data:void 0,error:null,status:`idle`},h={data:void 0,error:null,status:`connecting`};function g(e,t,n){let i=n?.enabled??t!==C,a=b(M(e,t,`any`)),{client:o}=c(),s=r.useRef(n);r.useEffect(()=>{s.current=n});let[l]=r.useState(new Set([])),u=r.useCallback(e=>{l.add(e)},[l]),d=r.useRef(null),f=r.useCallback(e=>{let t=g.current,n=g.current=e(t),r=!1;for(let e of l)if(t[e]!==n[e]){r=!0;break}r&&v(Cr(n,u))},[u,l]),p=r.useCallback(()=>{var n;if((n=d.current)==null||n.unsubscribe(),!i){f(()=>(0,U.default)((0,U.default)({},m),{},{reset:p}));return}f(()=>(0,U.default)((0,U.default)({},h),{},{reset:p}));let r=o.subscription(e.join(`.`),t??void 0,{onStarted:()=>{var e,t;(e=(t=s.current).onStarted)==null||e.call(t),f(e=>(0,U.default)((0,U.default)({},e),{},{status:`pending`,error:null}))},onData:e=>{var t,n;(t=(n=s.current).onData)==null||t.call(n,e),f(t=>(0,U.default)((0,U.default)({},t),{},{status:`pending`,data:e,error:null}))},onError:e=>{var t,n;(t=(n=s.current).onError)==null||t.call(n,e),f(t=>(0,U.default)((0,U.default)({},t),{},{status:`error`,error:e}))},onConnectionStateChange:e=>{f(t=>{switch(e.state){case`idle`:return(0,U.default)((0,U.default)({},t),{},{status:e.state,error:null,data:void 0});case`connecting`:return(0,U.default)((0,U.default)({},t),{},{error:e.error,status:e.state});case`pending`:return t}})},onComplete:()=>{var e,t;(e=(t=s.current).onComplete)==null||e.call(t),f(e=>(0,U.default)((0,U.default)({},e),{},{status:`idle`,error:null,data:void 0}))}});d.current=r},[o,a,i,f]);r.useEffect(()=>(p(),()=>{var e;(e=d.current)==null||e.unsubscribe()}),[p]);let g=r.useRef(i?(0,U.default)((0,U.default)({},h),{},{reset:p}):(0,U.default)((0,U.default)({},m),{},{reset:p})),[_,v]=r.useState(Cr(g.current,u));return _}function _(e,t,n){var r,i;let{client:a,ssrState:o,prefetchInfiniteQuery:s,queryClient:u,abortOnUnmount:d}=c(),f=M(e,t,`infinite`),p=u.getQueryDefaults(f),m=t===C;typeof window>`u`&&o===`prepass`&&(n==null||(r=n.trpc)==null?void 0:r.ssr)!==!1&&(n?.enabled??p?.enabled)!==!1&&!m&&!u.getQueryCache().find({queryKey:f})&&s(f,(0,U.default)((0,U.default)({},p),n));let h=l(f,(0,U.default)((0,U.default)({},p),n)),g=(n==null||(i=n.trpc)==null?void 0:i.abortOnUnmount)??d,_=pt((0,U.default)((0,U.default)({},h),{},{initialPageParam:n.initialCursor??null,persister:n.persister,queryKey:f,queryFn:m?t:e=>{let t=(0,U.default)((0,U.default)({},h),{},{trpc:(0,U.default)((0,U.default)({},h?.trpc),g?{signal:e.signal}:{signal:null})});return a.query(...B(f,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}),u);return _.trpc=V({path:e}),_}function v(e,t,n){var r;let i=c(),a=M(e,t,`infinite`),o=i.queryClient.getQueryDefaults(a),s=t===C,u=l(a,(0,U.default)((0,U.default)({},o),n)),d=(n==null||(r=n.trpc)==null?void 0:r.abortOnUnmount)??i.abortOnUnmount;lt((0,U.default)((0,U.default)({},n),{},{initialPageParam:n.initialCursor??null,queryKey:a,queryFn:s?t:e=>{let t=(0,U.default)((0,U.default)({},u),{},{trpc:(0,U.default)((0,U.default)({},u?.trpc),d?{signal:e.signal}:{})});return i.client.query(...B(a,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}))}function y(e,t,n){var r;let i=c(),a=M(e,t,`infinite`),o=i.queryClient.getQueryDefaults(a),s=l(a,(0,U.default)((0,U.default)({},o),n)),u=(n==null||(r=n.trpc)==null?void 0:r.abortOnUnmount)??i.abortOnUnmount,d=ot((0,U.default)((0,U.default)({},n),{},{initialPageParam:n.initialCursor??null,queryKey:a,queryFn:e=>{let t=(0,U.default)((0,U.default)({},s),{},{trpc:(0,U.default)((0,U.default)({},s?.trpc),u?{signal:e.signal}:{})});return i.client.query(...B(a,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}),i.queryClient);return d.trpc=V({path:e}),[d.data,d]}return{Provider:s,createClient:o,useContext:c,useUtils:c,useQuery:u,usePrefetchQuery:d,useSuspenseQuery:f,useQueries:(e,t)=>{let{ssrState:n,queryClient:r,prefetchQuery:i,client:a}=c(),o=e(_r(a));if(typeof window>`u`&&n===`prepass`)for(let e of o){let t=e;t.trpc?.ssr!==!1&&!r.getQueryCache().find({queryKey:t.queryKey})&&i(t.queryKey,t)}return nt({queries:o.map(e=>(0,U.default)((0,U.default)({},e),{},{queryKey:e.queryKey})),combine:t?.combine},r)},useSuspenseQueries:e=>{let{queryClient:t,client:n}=c(),r=st({queries:e(_r(n)).map(e=>(0,U.default)((0,U.default)({},e),{},{queryFn:e.queryFn,queryKey:e.queryKey}))},t);return[r.map(e=>e.data),r]},useMutation:p,useSubscription:g,useInfiniteQuery:_,usePrefetchInfiniteQuery:v,useSuspenseInfiniteQuery:y}}function Tr(e){let t=ur(e);return At(n=>n===`useContext`||n===`useUtils`?()=>{let t=e.useUtils();return r.useMemo(()=>hr(t),[t])}:e.hasOwnProperty(n)?e[n]:t[n])}function Er(e){return Tr(wr(e))}var Dr=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},Or=class{constructor(e){this.generateIdentifier=e,this.kv=new Dr}register(e,t){this.kv.getByValue(e)||(t||=this.generateIdentifier(e),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},kr=class extends Or{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t==`object`?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function Ar(e){if(`values`in Object)return Object.values(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function jr(e,t){let n=Ar(e);if(`find`in n)return n.find(t);let r=n;for(let e=0;e<r.length;e++){let n=r[e];if(t(n))return n}}function W(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function Mr(e,t){return e.indexOf(t)!==-1}function Nr(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var Pr=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return jr(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},Fr=e=>Object.prototype.toString.call(e).slice(8,-1),Ir=e=>e===void 0,Lr=e=>e===null,G=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null||Object.getPrototypeOf(e)===Object.prototype,Rr=e=>G(e)&&Object.keys(e).length===0,K=e=>Array.isArray(e),zr=e=>typeof e==`string`,Br=e=>typeof e==`number`&&!isNaN(e),Vr=e=>typeof e==`boolean`,Hr=e=>e instanceof RegExp,q=e=>e instanceof Map,J=e=>e instanceof Set,Ur=e=>Fr(e)===`Symbol`,Wr=e=>e instanceof Date&&!isNaN(e.valueOf()),Gr=e=>e instanceof Error,Kr=e=>typeof e==`number`&&isNaN(e),qr=e=>Vr(e)||Lr(e)||Ir(e)||Br(e)||zr(e)||Ur(e),Jr=e=>typeof e==`bigint`,Yr=e=>e===1/0||e===-1/0,Xr=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Zr=e=>e instanceof URL,Qr=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),$r=e=>e.map(String).map(Qr).join(`.`),Y=(e,t)=>{let n=[],r=``;for(let i=0;i<e.length;i++){let a=e.charAt(i);if(!t&&a===`\\`){let t=e.charAt(i+1);if(t===`\\`){r+=`\\`,i++;continue}if(t!==`.`)throw Error(`invalid path`)}if(a===`\\`&&e.charAt(i+1)===`.`){r+=`.`,i++;continue}if(a===`.`){n.push(r),r=``;continue}r+=a}let i=r;return n.push(i),n};function X(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var ei=[X(Ir,`undefined`,()=>null,()=>void 0),X(Jr,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),X(Wr,`Date`,e=>e.toISOString(),e=>new Date(e)),X(Gr,`Error`,(e,t)=>{let n={name:e.name,message:e.message};return`cause`in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n},(e,t)=>{let n=Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n}),X(Hr,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),X(J,`set`,e=>[...e.values()],e=>new Set(e)),X(q,`map`,e=>[...e.entries()],e=>new Map(e)),X(e=>Kr(e)||Yr(e),`number`,e=>Kr(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),X(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),X(Zr,`URL`,e=>e.toString(),e=>new URL(e))];function ti(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var ni=ti((e,t)=>Ur(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>[`symbol`,t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{let r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown symbol`);return r}),ri=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),ii=ti(Xr,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=ri[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function ai(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var oi=ti(ai,(e,t)=>[`class`,t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};let r={};return n.forEach(t=>{r[t]=e[t]}),r},(e,t,n)=>{let r=n.classRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),si=ti((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>[`custom`,t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{let r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error(`Trying to deserialize unknown custom value`);return r.deserialize(e)}),ci=[oi,ni,si,ii],li=(e,t)=>{let n=Nr(ci,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=Nr(ei,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},ui={};ei.forEach(e=>{ui[e.annotation]=e});var di=(e,t,n)=>{if(K(t))switch(t[0]){case`symbol`:return ni.untransform(e,t,n);case`class`:return oi.untransform(e,t,n);case`custom`:return si.untransform(e,t,n);case`typed-array`:return ii.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=ui[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},Z=(e,t)=>{if(t>e.size)throw Error(`index out of bounds`);let n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function fi(e){if(Mr(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(Mr(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(Mr(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var pi=(e,t)=>{fi(t);for(let n=0;n<t.length;n++){let r=t[n];if(J(e))e=Z(e,+r);else if(q(e)){let i=+r,a=+t[++n]==0?`key`:`value`,o=Z(e,i);switch(a){case`key`:e=o;break;case`value`:e=e.get(o)}}else e=e[r]}return e},mi=(e,t,n)=>{if(fi(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(K(r)){let e=+n;r=r[e]}else if(G(r))r=r[n];else if(J(r)){let e=+n;r=Z(r,e)}else if(q(r)){if(e===t.length-2)break;let i=+n,a=+t[++e]==0?`key`:`value`,o=Z(r,i);switch(a){case`key`:r=o;break;case`value`:r=r.get(o)}}}let i=t[t.length-1];if(K(r)?r[+i]=n(r[+i]):G(r)&&(r[i]=n(r[i])),J(r)){let e=Z(r,+i),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(q(r)){let e=+t[t.length-2],a=Z(r,e);switch(+i==0?`key`:`value`){case`key`:{let e=n(a);r.set(e,r.get(a)),e!==a&&r.delete(a);break}case`value`:r.set(a,n(r.get(a)))}}return e},hi=e=>e<1;function gi(e,t,n,r=[]){if(!e)return;let i=hi(n);if(!K(e)){W(e,(e,a)=>gi(e,t,n,[...r,...Y(a,i)]));return}let[a,o]=e;o&&W(o,(e,a)=>{gi(e,t,n,[...r,...Y(a,i)])}),t(a,r)}function _i(e,t,n,r){return gi(t,(t,n)=>{e=mi(e,n,e=>di(e,t,r))},n),e}function vi(e,t,n){let r=hi(n);function i(t,n){let i=pi(e,Y(n,r));t.map(e=>Y(e,r)).forEach(t=>{e=mi(e,t,()=>i)})}if(K(t)){let[n,a]=t;n.forEach(t=>{e=mi(e,Y(t,r),()=>e)}),a&&W(a,i)}else W(t,i);return e}var yi=(e,t)=>G(e)||K(e)||q(e)||J(e)||Gr(e)||ai(e,t);function bi(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function xi(e,t){let n={},r;return e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[i,...a]=e;i.length===0?r=a.map($r):n[$r(i)]=a.map($r)}),r?Rr(n)?[r]:[r,n]:Rr(n)?void 0:n}var Si=(e,t,n,r,i=[],a=[],o=new Map)=>{let s=qr(e);if(!s){bi(e,i,t);let n=o.get(e);if(n)return r?{transformedValue:null}:n}if(!yi(e,n)){let t=li(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return s||o.set(e,r),r}if(Mr(a,e))return{transformedValue:null};let c=li(e,n),l=c?.value??e,u=K(l)?[]:{},d={};W(l,(s,c)=>{if(c===`__proto__`||c===`constructor`||c===`prototype`)throw Error(`Detected property ${c}. This is a prototype pollution risk, please remove it from your object.`);let l=Si(s,t,n,r,[...i,c],[...a,e],o);u[c]=l.transformedValue,K(l.annotations)?d[Qr(c)]=l.annotations:G(l.annotations)&&W(l.annotations,(e,t)=>{d[Qr(c)+`.`+t]=e})});let f=Rr(d)?{transformedValue:u,annotations:c?[c.type]:void 0}:{transformedValue:u,annotations:c?[c.type,d]:d};return s||o.set(e,f),f};function Ci(e,t,n,r){if(Object.prototype.propertyIsEnumerable.call(r,t)){e[t]=n;return}Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function wi(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.prototype.toString.call(e)===`[object Object]`}function Q(e,t,n,r){if(typeof e!=`object`||!e)return e;let i=Array.isArray(e);if(!i&&!wi(e))return e;let a=t.get(e);if(a!==void 0)return a;let o=i?Array(e.length):{};return t.set(e,o),n.push(e),r.push(o),o}function Ti(e,t={}){if(typeof e!=`object`||!e)return e;let n=new Map,r=[],i=[],a=Q(e,n,r,i),o=Array.isArray(t.props)?t.props:void 0,s=t.nonenumerable===!0;for(;r.length;){let e=r.pop(),t=i.pop();if(Array.isArray(e)){for(let a=0;a<e.length;a++)a in e&&(t[a]=Q(e[a],n,r,i));continue}if(s)for(let a of Object.getOwnPropertyNames(e))a!==`__proto__`&&(!o||o.includes(a))&&Ci(t,a,Q(e[a],n,r,i),e);else for(let a in e)Object.prototype.hasOwnProperty.call(e,a)&&a!==`__proto__`&&(!o||o.includes(a))&&(t[a]=Q(e[a],n,r,i));for(let a of Object.getOwnPropertySymbols(e))(!o||o.includes(a))&&(s||Object.prototype.propertyIsEnumerable.call(e,a))&&Ci(t,a,Q(e[a],n,r,i),e)}return a}var $=class{constructor({dedupe:e=!1}={}){this.classRegistry=new kr,this.symbolRegistry=new Or(e=>e.description??``),this.customTransformerRegistry=new Pr,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=Si(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let i=xi(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r.meta&&(r.meta.v=1),r}deserialize(e,t){let{json:n,meta:r}=e,i=t?.inPlace?n:Ti(n);return r?.values&&(i=_i(i,r.values,r.v??0,this)),r?.referentialEqualities&&(i=vi(i,r.referentialEqualities,r.v??0)),i}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};$.defaultInstance=new $,$.serialize=$.defaultInstance.serialize.bind($.defaultInstance),$.deserialize=$.defaultInstance.deserialize.bind($.defaultInstance),$.stringify=$.defaultInstance.stringify.bind($.defaultInstance),$.parse=$.defaultInstance.parse.bind($.defaultInstance),$.registerClass=$.defaultInstance.registerClass.bind($.defaultInstance),$.registerSymbol=$.defaultInstance.registerSymbol.bind($.defaultInstance),$.registerCustom=$.defaultInstance.registerCustom.bind($.defaultInstance),$.allowErrorProps=$.defaultInstance.allowErrorProps.bind($.defaultInstance),$.serialize,$.deserialize,$.stringify,$.parse,$.registerClass,$.registerCustom,$.registerSymbol,$.allowErrorProps;var Ei=Er(),Di=()=>``;function Oi(){return Ei.createClient({links:[Un({url:`${Di()}/api/trpc`,transformer:$})]})}export{g as _,ve as a,w as c,y as d,se as f,x as g,f as h,ke as i,p as l,_ as m,Ei as n,T as o,v as p,ze as r,he as s,Oi as t,b as u,C as v,s as y};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-DE3RlOCf.js";import{h as r,o as i}from"./dist-BiFeezwN.js";import{a,r as o}from"./hooks-BTcY6K1q.js";import{d as s,i as c,n as l,o as u,t as d}from"./select-BgEObL9n.js";import{p as f}from"./radio-group-CcAx51bT.js";import{n as p,r as m}from"./index-D34fUfAP.js";var h=e(t(),1),g=new Map([[`bold`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M184.49,167.51a12,12,0,0,1,0,17l-48,48a12,12,0,0,1-17,0l-48-48a12,12,0,0,1,17-17L128,207l39.51-39.52A12,12,0,0,1,184.49,167.51Zm-96-79L128,49l39.51,39.52a12,12,0,0,0,17-17l-48-48a12,12,0,0,0-17,0l-48,48a12,12,0,0,0,17,17Z`}))],[`duotone`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M80,176h96l-48,48ZM128,32,80,80h96Z`,opacity:`0.2`}),h.createElement(`path`,{d:`M176,168H80a8,8,0,0,0-5.66,13.66l48,48a8,8,0,0,0,11.32,0l48-48A8,8,0,0,0,176,168Zm-48,44.69L99.31,184h57.38ZM80,88h96a8,8,0,0,0,5.66-13.66l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,80,88Zm48-44.69L156.69,72H99.31Z`}))],[`fill`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M72.61,83.06a8,8,0,0,1,1.73-8.72l48-48a8,8,0,0,1,11.32,0l48,48A8,8,0,0,1,176,88H80A8,8,0,0,1,72.61,83.06ZM176,168H80a8,8,0,0,0-5.66,13.66l48,48a8,8,0,0,0,11.32,0l48-48A8,8,0,0,0,176,168Z`}))],[`light`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M180.24,171.76a6,6,0,0,1,0,8.48l-48,48a6,6,0,0,1-8.48,0l-48-48a6,6,0,0,1,8.48-8.48L128,215.51l43.76-43.75A6,6,0,0,1,180.24,171.76Zm-96-87.52L128,40.49l43.76,43.75a6,6,0,0,0,8.48-8.48l-48-48a6,6,0,0,0-8.48,0l-48,48a6,6,0,0,0,8.48,8.48Z`}))],[`regular`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M181.66,170.34a8,8,0,0,1,0,11.32l-48,48a8,8,0,0,1-11.32,0l-48-48a8,8,0,0,1,11.32-11.32L128,212.69l42.34-42.35A8,8,0,0,1,181.66,170.34Zm-96-84.68L128,43.31l42.34,42.35a8,8,0,0,0,11.32-11.32l-48-48a8,8,0,0,0-11.32,0l-48,48A8,8,0,0,0,85.66,85.66Z`}))],[`thin`,h.createElement(h.Fragment,null,h.createElement(`path`,{d:`M178.83,173.17a4,4,0,0,1,0,5.66l-48,48a4,4,0,0,1-5.66,0l-48-48a4,4,0,0,1,5.66-5.66L128,218.34l45.17-45.17A4,4,0,0,1,178.83,173.17Zm-96-90.34L128,37.66l45.17,45.17a4,4,0,1,0,5.66-5.66l-48-48a4,4,0,0,0-5.66,0l-48,48a4,4,0,0,0,5.66,5.66Z`}))]]),_=h.forwardRef((e,t)=>h.createElement(r,{ref:t,...e,weights:g}));_.displayName=`CaretUpDownIcon`;var v=n(),y=`__current_project__`,b=`h-7 w-auto max-w-[6rem] border-0 bg-transparent px-0.5 text-sm font-semibold text-foreground shadow-none focus:ring-0 sm:max-w-[18rem] sm:px-1 md:max-w-none md:overflow-visible md:text-clip`;function x(e){let t=e.trim().split(/[\s\-_/.]+/).filter(Boolean);return t.length===0?e:t.length===1?t[0]?.slice(0,2).toUpperCase()??e:t.slice(0,3).map(e=>e[0]?.toUpperCase()??``).join(``)}function S({selectedProjectSlug:e,onProjectChange:t,projects:n,triggerClassName:r,projectButtonClassName:a,triggerId:o=`project-select`,onCurrentProjectSelect:p,showLeadingSlash:m=!1,showTrailingSlash:h=!1,trailingSeparatorType:g=`chevron`}){let S=f(),C=n?.find(t=>t.slug===e),w=C?.name??`Select a project`,T=S&&C?x(C.name):w,E=!!(C&&p),D=E?n?.filter(t=>t.slug!==e):n;return(0,v.jsxs)(`div`,{className:`flex min-w-0 items-center gap-0.5`,children:[m?(0,v.jsx)(`span`,{className:`hidden text-muted-foreground md:inline-flex`,"aria-hidden":!0,children:(0,v.jsx)(s,{className:`h-3.5 w-3.5`})}):null,(0,v.jsx)(`button`,{type:`button`,onClick:()=>{p?.()},disabled:!p,className:i(`min-w-0 truncate text-left`,p?`cursor-pointer hover:text-foreground hover:underline focus-visible:text-foreground focus-visible:underline`:`cursor-default`,b,a),"aria-label":`Open ${w} kanban`,children:T}),(0,v.jsxs)(d,{value:e,onValueChange:e=>{if(e===y){p?.();return}t(e)},children:[(0,v.jsxs)(u,{id:o,"aria-label":`Open project menu`,className:i(`h-7 w-6 shrink-0 border-0 bg-transparent px-0.5 text-muted-foreground shadow-none focus:ring-0 md:w-7 md:px-1 [&>svg:last-of-type]:hidden`,r),children:[(0,v.jsx)(`span`,{className:`sr-only`,children:`Open project menu`}),(0,v.jsx)(`span`,{className:`inline-flex items-center text-current`,"aria-hidden":!0,children:(0,v.jsx)(_,{className:`h-3 w-3 opacity-70 md:h-3.5 md:w-3.5`})})]}),(0,v.jsxs)(l,{children:[E&&C?(0,v.jsx)(c,{value:C.slug,className:`hidden`,"aria-hidden":!0,children:C.name}):null,E&&C?(0,v.jsx)(c,{value:y,children:C.name}):null,D?.map(e=>(0,v.jsx)(c,{value:e.slug,children:e.name},e.id)),(0,v.jsx)(c,{value:`__create__`,className:`text-muted-foreground`,children:`+ Create project`}),(0,v.jsx)(c,{value:`__manage__`,className:`text-muted-foreground`,children:`Manage projects...`})]})]}),h?(0,v.jsx)(`span`,{className:`-ml-0.5 text-muted-foreground`,"aria-hidden":!0,children:g===`slash`?(0,v.jsx)(`span`,{className:`text-xs`,children:`/`}):(0,v.jsx)(s,{className:`h-3.5 w-3.5`})}):null]})}function C(){let{pathname:e}=o(),t=a(),{projects:n,selectedProjectSlug:r,selectProjectSlug:i}=m(),s=p(e)??r,c=(0,h.useCallback)(e=>{i(e),t(`/projects/${e}/workspaces`)},[t,i]);return{selectedProjectSlug:s,projects:n,handleProjectChange:(0,h.useCallback)(e=>{if(e===`__manage__`){t(`/projects`);return}if(e===`__create__`){t(`/projects/new`);return}c(e)},[t,c]),handleCurrentProjectSelect:(0,h.useCallback)(()=>{s&&c(s)},[s,c])}}export{S as n,_ as r,C as t};
@@ -1,50 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t}from"./jsx-runtime-DE3RlOCf.js";import{h as n}from"./dist-BiFeezwN.js";var r=e(t(),1),i=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M120,137,48,201A12,12,0,1,1,32,183l61.91-55L32,73A12,12,0,1,1,48,55l72,64A12,12,0,0,1,120,137Zm96,43H120a12,12,0,0,0,0,24h96a12,12,0,0,0,0-24Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,80V192H40V64H200A16,16,0,0,1,216,80Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M117.31,134l-72,64a8,8,0,1,1-10.63-12L100,128,34.69,70A8,8,0,1,1,45.32,58l72,64a8,8,0,0,1,0,12ZM216,184H120a8,8,0,0,0,0,16h96a8,8,0,0,0,0-16Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM77.66,173.66a8,8,0,0,1-11.32-11.32L100.69,128,66.34,93.66A8,8,0,0,1,77.66,82.34l40,40a8,8,0,0,1,0,11.32ZM192,176H128a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M116,132.48l-72,64a6,6,0,0,1-8-9L103,128,36,68.49a6,6,0,0,1,8-9l72,64a6,6,0,0,1,0,9ZM216,186H120a6,6,0,0,0,0,12h96a6,6,0,0,0,0-12Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M117.31,134l-72,64a8,8,0,1,1-10.63-12L100,128,34.69,70A8,8,0,1,1,45.32,58l72,64a8,8,0,0,1,0,12ZM216,184H120a8,8,0,0,0,0,16h96a8,8,0,0,0,0-16Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M116,128a4,4,0,0,1-1.34,3l-72,64a4,4,0,1,1-5.32-6L106,128,37.34,67a4,4,0,0,1,5.32-6l72,64A4,4,0,0,1,116,128Zm100,60H120a4,4,0,0,0,0,8h96a4,4,0,0,0,0-8Z`}))]]),a=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z`}))]]),o=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:i}));o.displayName=`TerminalIcon`;var s=r.forwardRef((e,t)=>r.createElement(n,{ref:t,...e,weights:a}));s.displayName=`WarningIcon`;var c=[`loading`,`starting`,`running`,`idle`,`stopping`,`error`],l=[`unknown`,`alive`,`stopped`],u=[`WORKING`,`IDLE`];function d(e){return e.phase===`loading`||e.phase===`starting`||e.phase===`stopping`?e.phase:e.phase===`error`?`error`:e.processState===`stopped`?e.lastExit?.unexpected?`unexpected-exit`:`stopped`:e.activity===`WORKING`||e.phase===`running`?`working`:`idle`}function f(e){return d({phase:e.runtimePhase,processState:e.processState,activity:e.activity,lastExit:e.lastExit})}function p(){return{phase:`idle`,processState:`stopped`,activity:`IDLE`,updatedAt:new Date().toISOString()}}function m(e){return`Exited unexpectedly${e.code===null?``:` (code ${e.code})`}`}function h(e,t,n){let r=t?.trim();return e===`error`?r||(n?.unexpected?m(n):`Session entered an error state`):n?.unexpected?r||m(n):null}function ee(e){return h(e.runtimePhase,e.errorMessage,e.lastExit)}function te(e){return h(e.phase,e.errorMessage,e.lastExit)}function ne(e){return e.activity===`WORKING`||e.runtimePhase===`running`}function re(e){if(!e||e.length===0)return null;for(let t of e){let e=ee(t);if(e)return{sessionId:t.sessionId,message:e}}return null}function g(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function _(e,t=`|`){return e.map(e=>me(e)).join(t)}function v(e,t){return typeof t==`bigint`?t.toString():t}function ie(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ae(e){return e==null}function oe(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function se(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function y(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function b(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ce(e){return JSON.stringify(e)}function le(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ue=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var de=ie(()=>{if(I.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function S(e){if(x(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return x(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function fe(e){return S(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var pe=new Set([`string`,`number`,`symbol`]);function C(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function w(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function T(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function me(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function he(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var ge={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function _e(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return w(e,b(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&y(e,r,n.shape[r])}return y(this,`shape`,e),e},checks:[]}))}function ve(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return w(e,b(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return y(this,`shape`,r),r},checks:[]}))}function ye(e,t){if(!S(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return w(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return y(this,`shape`,n),n}}))}function be(e,t){if(!S(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return w(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return y(this,`shape`,n),n}}))}function xe(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return w(e,b(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return y(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Se(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return w(t,b(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return y(this,`shape`,i),i},checks:[]}))}function Ce(e,t,n){return w(t,b(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return y(this,`shape`,i),i}}))}function E(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function we(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function D(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function O(e){return typeof e==`string`?e:e?.message}function Te(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function k(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:O(e.inst?._zod.def?.error?.(e))??O(a?.(e))??O(t?.error?.(e))??O(n.customError?.(e))??O(n.localeError?.(e))??`Invalid input`,{inst:s,schema:c,continue:l,input:u,...d}=e;return d.path??=[],d.message=o,t?.reportInput&&(d.input=u),d}function Ee(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}var De=/[\uD800-\uDBFF]/;function Oe(e){let t=e.length;if(!De.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function ke(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ae(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function A(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function je(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ne(e,n,r.value)}}function j(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Me(e,t,n){return j(e,t,n,!1)}function Ne(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:j(this,t,n.bind(this))},set(e){j(this,t,e)}})}function Pe(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Fe,M=!1,Ie={configurable:!0,get(){M=!0}};function N(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Fe!==e._zod){Fe=void 0;return}Fe=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Ie);let e=M;M=!1;try{let r=n(this);return M?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),M||=e,r}catch(n){throw delete this[t],M||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Le(e,t,n,r){let i=Pe(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Re=`~constantCatch`;function ze(e){let t=()=>e;return t[Re]=!0,t}var Be,Ve={value:void 0,enumerable:!1},He=`captureStackTrace`in Error?Error:null;function Ue(e){let t=He;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return He=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function P(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),je(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ue(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var F=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},We=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Be=globalThis).__zod_globalConfig??(Be.__zod_globalConfig={});var I=globalThis.__zod_globalConfig;function L(e){return e&&Object.assign(I,e),I}function Ge(){let e=this._zod;return e.message??=JSON.stringify(e.def,v,2),e.message}function Ke(e){this._zod.message=e}var qe={get:Ge,set:Ke,enumerable:!0,configurable:!0},Je={value:void 0,enumerable:!1},Ye={value:void 0,enumerable:!1},Xe=new WeakSet([Object.prototype,Error.prototype]),Ze=(e,t)=>{e.name=`$ZodError`,Je.value=e._zod,Object.defineProperty(e,"_zod",Je),Ye.value=t,Object.defineProperty(e,"issues",Ye),Je.value=void 0,Ye.value=void 0,Object.defineProperty(e,"message",qe);let n=Object.getPrototypeOf(e);Xe.has(n)||(Xe.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Qe=P(`$ZodError`,Ze),$e=P(`$ZodError`,Ze,void 0,{Parent:Error});function et(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function tt(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?et(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function nt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function rt(e,t){return{callee:t?.callee??e,Err:t?.Err}}var it=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new F;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>k(e,o,L())));throw ue(n,a?.callee??t),n}return s.value};return t},at=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>k(e,o,L())));throw ue(n,a?.callee??t),n}return s.value};return t},R=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new F;return a.issues.length?{success:!1,error:new(e??Qe)(a.issues.map(e=>k(e,i,L())))}:{success:!0,data:a.value}},ot=R($e),st=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>k(e,i,L())))}:{success:!0,data:a.value}},ct=st($e),lt=e=>{let t=it(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,rt(n,a))};return n},ut=e=>{let t=it(e),n=(e,r,i,a)=>t(e,r,i,rt(n,a));return n},dt=e=>{let t=at(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,rt(n,a))};return n},ft=e=>{let t=at(e),n=async(e,r,i,a)=>await t(e,r,i,rt(n,a));return n},pt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return R(e)(t,n,i)},mt=e=>(t,n,r)=>R(e)(t,n,r),ht=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return st(e)(t,n,i)},gt=e=>async(t,n,r)=>st(e)(t,n,r),_t=/^[cC][0-9a-z]{6,}$/,vt=/^[0-9a-z]+$/,yt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,bt=/^[0-9a-vA-V]{20}$/,xt=/^[A-Za-z0-9]{27}$/,St=/^[a-zA-Z0-9_-]{21}$/;function Ct(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var wt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Tt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Et=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Dt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ot=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function kt(){return new RegExp(Ot,`u`)}var At=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,jt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Mt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Nt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Pt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ft=/^[A-Za-z0-9_-]*$/,It=/^https?$/,Lt=/^\+[1-9]\d{6,14}$/,Rt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function zt(e){return RegExp(`^${e}$`)}var Bt=zt(Rt);function Vt(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ht(e){return RegExp(`^${Vt(e)}$`)}function Ut(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Vt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Vt({precision:e.precision})}`:n;return RegExp(`^${Rt}T(?:${r})$`)}var Wt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Gt=/^-?\d+$/,Kt=/^-?\d+(?:\.\d+)?$/,qt=/^(?:true|false)$/i,Jt=/^[^A-Z]*$/,Yt=/^[^a-z]*$/,z=P(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Xt=e=>{let t=e.value;return!ae(t)&&t.size!==void 0},Zt=e=>{let t=e.value;return!ae(t)&&t.length!==void 0},Qt={number:`number`,bigint:`bigint`,object:`date`},$t=P(`$ZodCheckLessThan`,(e,t)=>{z.init(e,t);let n=Qt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Qt[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),en=P(`$ZodCheckGreaterThan`,(e,t)=>{z.init(e,t);let n=Qt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Qt[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tn=P(`$ZodCheckMultipleOf`,(e,t)=>{z.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):se(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),nn=P(`$ZodCheckNumberFormat`,(e,t)=>{z.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ge[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Gt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),rn=P(`$ZodCheckMaxSize`,(e,t)=>{var n;z.init(e,t),(n=e._zod.def).when??(n.when=Xt),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Ee(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),an=P(`$ZodCheckMinSize`,(e,t)=>{var n;z.init(e,t),(n=e._zod.def).when??(n.when=Xt),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Ee(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),on=P(`$ZodCheckSizeEquals`,(e,t)=>{var n;z.init(e,t),(n=e._zod.def).when??(n.when=Xt),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Ee(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),sn=P(`$ZodCheckMaxLength`,(e,t)=>{var n;z.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Oe(r):i)<=t.maximum)return;let a=ke(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cn=P(`$ZodCheckMinLength`,(e,t)=>{var n;z.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Oe(r):i)>=t.minimum)return;let a=ke(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ln=P(`$ZodCheckLengthEquals`,(e,t)=>{var n;z.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Oe(r):i;if(a===t.length)return;let o=ke(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),un=P(`$ZodCheckStringFormat`,(e,t)=>{var n,r;z.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),dn=P(`$ZodCheckRegex`,(e,t)=>{un.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fn=P(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Jt,un.init(e,t)}),pn=P(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Yt,un.init(e,t)}),mn=P(`$ZodCheckIncludes`,(e,t)=>{z.init(e,t);let n=C(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),hn=P(`$ZodCheckStartsWith`,(e,t)=>{z.init(e,t);let n=RegExp(`^${C(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),gn=P(`$ZodCheckEndsWith`,(e,t)=>{z.init(e,t);let n=RegExp(`.*${C(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),_n=P(`$ZodCheckOverwrite`,(e,t)=>{z.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),vn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
2
- `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
3
- `)}\n};`)(...Object.values(this.closed))}},yn={major:4,minor:5,patch:4},B=P(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=E(t),a;for(let o of n){if(o._zod.def.when){if(we(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new F;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Te(t.issues,n,e),i||=E(t,n))});else{if(t.issues.length===n)continue;Te(t.issues,n,e),i||=E(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(E(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new F;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new F;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Me(this,`~standard`,xn(this))},set"~standard"(e){j(this,`~standard`,e)}}),bn=e=>e.success?{value:e.data}:{issues:e.error?.issues};function xn(e){return{validate:t=>{try{return bn(ot(e,t))}catch{return ct(e,t).then(bn)}},vendor:`zod`,version:1}}var Sn=P(`$ZodString`,(e,t)=>{B.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Wt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),V=P(`$ZodStringFormat`,(e,t)=>{un.init(e,t),Sn.init(e,t)}),Cn=P(`$ZodGUID`,(e,t)=>{t.pattern??=Tt,V.init(e,t)}),wn=P(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Et(e)}else t.pattern??=Et();V.init(e,t)}),Tn=P(`$ZodEmail`,(e,t)=>{t.pattern??=Dt,V.init(e,t)});function En(e,t){if(!t.normalize&&t.protocol?.source===It.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var Dn=/[\t\n\r]/g;function On(e){return e.replace(Dn,``)}function kn(e,t){return t.lastIndex=0,t.test(e.hostname)}function An(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var jn=P(`$ZodURL`,(e,t)=>{V.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=En(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!kn(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!An(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:On(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Mn=P(`$ZodEmoji`,(e,t)=>{t.pattern??=kt(),V.init(e,t)}),Nn=P(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?St:Ct(t.length),V.init(e,t)}),Pn=P(`$ZodCUID`,(e,t)=>{t.pattern??=_t,V.init(e,t)}),Fn=P(`$ZodCUID2`,(e,t)=>{t.pattern??=vt,V.init(e,t)}),In=P(`$ZodULID`,(e,t)=>{t.pattern??=yt,V.init(e,t)}),Ln=P(`$ZodXID`,(e,t)=>{t.pattern??=bt,V.init(e,t)}),Rn=P(`$ZodKSUID`,(e,t)=>{t.pattern??=xt,V.init(e,t)}),zn=P(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ut(t),V.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),Bn=P(`$ZodISODate`,(e,t)=>{t.pattern??=Bt,V.init(e,t)}),Vn=P(`$ZodISOTime`,(e,t)=>{t.pattern??=Ht(t),V.init(e,t)}),Hn=P(`$ZodISODuration`,(e,t)=>{t.pattern??=wt,V.init(e,t)}),Un=P(`$ZodIPv4`,(e,t)=>{t.pattern??=At,V.init(e,t),e._zod.bag.format=`ipv4`}),Wn=/^[0-9a-fA-F:.]+$/;function Gn(e){if(!Wn.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Kn=P(`$ZodIPv6`,(e,t)=>{t.pattern??=jt,V.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{Gn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),qn=P(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Mt,V.init(e,t)});function Jn(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Gn(n)}var Yn=P(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Nt,V.init(e,t),e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Xn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Zn=P(`$ZodBase64`,(e,t)=>{t.pattern??=Pt,V.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Xn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Qn(e){if(!Ft.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Xn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var $n=P(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ft,V.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Qn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),er=P(`$ZodE164`,(e,t)=>{t.pattern??=Lt,V.init(e,t)});function tr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var nr=P(`$ZodJWT`,(e,t)=>{V.init(e,t),e._zod.check=n=>{tr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),rr=P(`$ZodNumber`,(e,t)=>{B.init(e,t),e._zod.pattern=e._zod.bag.pattern??Kt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),ir=P(`$ZodNumberFormat`,(e,t)=>{nn.init(e,t),rr.init(e,t)}),ar=P(`$ZodBoolean`,(e,t)=>{B.init(e,t),e._zod.pattern=qt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),or=P(`$ZodUnknown`,(e,t)=>{B.init(e,t),e._zod.parse=e=>e}),sr=P(`$ZodNever`,(e,t)=>{B.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function cr(e,t,n){e.issues.length&&t.issues.push(...D(n,e.issues)),t.value[n]=e.value}var lr=P(`$ZodArray`,(e,t)=>{B.init(e,t);let n=I.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;e<a.length;e++){let n=a[e],s=t.element._zod.run({value:n,issues:[]},i);s instanceof Promise?o.push(s.then(t=>cr(t,r,e))):cr(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function ur(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...D(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}var dr=[];function fr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:dr,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=he(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function pr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ur(e,n,i,t,u,d))):ur(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var mr=new WeakMap,hr=P(`$ZodObject`,(e,t)=>{if(B.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;mr.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),mr.set(t,n),n}})}let n=ie(()=>fr(t));N(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||y(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=x,i=t.catchall,a,o=I.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>ur(n,t,e,c,r,i))):ur(a,t,e,c,r,i)}return i?pr(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),gr=P(`$ZodObjectJIT`,(e,t)=>{hr.init(e,t);let n=e._zod.parse,r=ie(()=>fr(t)),i=I.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new vn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
4
- for (let i = 0; i < ${e}.issues.length; i++) {
5
- const iss = ${e}.issues[i];
6
- iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
7
- payload.issues.push(iss);
8
- }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:ce(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
9
- const ${n}_present = ${i};
10
- if (!${n}.issues.length || ${n}_present) {
11
- if (${n}.issues.length) {${c(n,r)}
12
- }
13
-
14
- if (${e}) {
15
- newResult[${r}] = ${n}.value;
16
- }
17
- }
18
-
19
- `)}else f?o.write(`
20
- if (${n}.issues.length) {${c(n,r)}
21
- }
22
-
23
- if (${n}.value === undefined) {
24
- if (${i}) {
25
- newResult[${r}] = undefined;
26
- }
27
- } else {
28
- newResult[${r}] = ${n}.value;
29
- }
30
-
31
- `):o.write(`
32
- const ${n}_present = ${i};
33
- if (${n}.issues.length) {${c(n,r)}
34
- }
35
- if (!${n}_present && !${n}.issues.length) {
36
- payload.issues.push({
37
- code: "invalid_type",
38
- expected: "nonoptional",
39
- input: undefined,
40
- path: [${r}]
41
- });
42
- }
43
-
44
- if (${n}_present) {
45
- newResult[${r}] = ${n}.value;
46
- }
47
-
48
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=x,c=!I.jitless,l=c&&de.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?pr([],p,i,f,d,e):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function _r(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!E(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>k(e,r,L())))}),t)}var vr=P(`$ZodUnion`,(e,t)=>{B.init(e,t),N(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),N(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),N(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),N(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>oe(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>_r(t,r,e,i)):_r(o,r,e,i)}}),yr=P(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,vr.init(e,t);let n=e._zod.parse;N(e,`propValues`,e=>{let t={};for(let n of e.def.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[e,n]of Object.entries(r)){Object.prototype.hasOwnProperty.call(t,e)||y(t,e,new Set);for(let r of n)t[e].add(r)}}return t}),t.options.forEach((e,n)=>{let r=mr.get(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=ie(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!x(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),br=P(`$ZodIntersection`,(e,t)=>{B.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Sr(e,t,n)):Sr(e,i,a)}});function xr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(S(e)&&S(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=xr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=xr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Sr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=xr(t.value,n.value);if(!c.valid){if(E(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Cr=P(`$ZodRecord`,(e,t)=>{B.init(e,t);let n=I.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!S(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>k(e,i,L())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...D(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...D(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Kt.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>k(e,i,L())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...D(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...D(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),wr=P(`$ZodMap`,(e,t)=>{B.init(e,t);let n=I.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!(a instanceof Map))return r.issues.push({expected:`map`,code:`invalid_type`,input:a,inst:e}),r;let o=[];r.value=n?n.alloc(e,r,new Map,i):new Map;for(let[n,s]of a){let c=t.keyType._zod.run({value:n,issues:[]},i),l=t.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([t,o])=>{Tr(t,o,r,n,a,e,i)})):Tr(c,l,r,n,a,e,i)}return o.length?Promise.all(o).then(()=>r):r}});function Tr(e,t,n,r,i,a,o){e.issues.length&&(pe.has(typeof r)?n.issues.push(...D(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>k(e,o,L()))})),t.issues.length&&(pe.has(typeof r)?n.issues.push(...D(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>k(e,o,L()))})),n.value.set(e.value,t.value)}var Er=P(`$ZodEnum`,(e,t)=>{B.init(e,t);let n=g(t.entries),r=new Set(n);e._zod.values=r;let i=n.filter(e=>pe.has(typeof e));e._zod.pattern=RegExp(i.length?`^(${i.map(e=>C(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Dr=P(`$ZodLiteral`,(e,t)=>{B.init(e,t);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(t.values.length?`^(${t.values.map(e=>typeof e==`string`?C(e):e?C(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Or=P(`$ZodTransform`,(e,t)=>{B.init(e,t),e._zod.optin=`optional`,I.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new We(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new F;return n.value=i,n}});function kr(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ar=P(`$ZodOptional`,(e,t)=>{B.init(e,t),N(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,N(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),N(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${oe(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>kr(e,t)):kr(e,r)}return t.innerType._zod.run(e,n)}}),jr=P(`$ZodExactOptional`,(e,t)=>{Ar.init(e,t),N(e,`values`,e=>e.def.innerType._zod.values),N(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Mr=P(`$ZodNullable`,(e,t)=>{B.init(e,t),N(e,`optin`,e=>e.def.innerType._zod.optin),N(e,`optout`,e=>e.def.innerType._zod.optout),N(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${oe(t.source)}|null)$`):void 0}),N(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Nr=P(`$ZodDefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,N(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Pr(e,t)):Pr(r,t)}});function Pr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Fr=P(`$ZodPrefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,N(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ir=P(`$ZodNonOptional`,(e,t)=>{B.init(e,t),N(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Lr(t,e)):Lr(i,e)}});function Lr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Rr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>k(e,r,L()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var zr=P(`$ZodCatch`,(e,t)=>{B.init(e,t),N(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),N(e,`optout`,e=>e.def.innerType._zod.optout),N(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Rr(e,r,t,n)):Rr(e,r,t,n)}}),Br=P(`$ZodPipe`,(e,t)=>{B.init(e,t),N(e,`values`,e=>e.def.in._zod.values),N(e,`optin`,e=>e.def.in._zod.optin),N(e,`optout`,e=>e.def.out._zod.optout),N(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Vr(e,t.in,n)):Vr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Vr(e,t.out,n)):Vr(r,t.out,n)}});function Vr(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Hr=P(`$ZodReadonly`,(e,t)=>{B.init(e,t),N(e,`propValues`,e=>e.def.innerType._zod.propValues),N(e,`values`,e=>e.def.innerType._zod.values),N(e,`optin`,e=>e.def.innerType?._zod?.optin),N(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Ur):Ur(r)}});function Ur(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Wr=P(`$ZodCustom`,(e,t)=>{z.init(e,t),B.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Gr(t,n,r,e));Gr(i,n,r,e)}});function Gr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(A(e))}}var Kr=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},qr=`~memo`,Jr=[];function Yr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Xr=new WeakMap;function Zr(e,t){let n=Xr.get(e);if(n!==void 0)return n;if(t.has(e))return!0;t.add(e);let r=!1,i=e=>{!r&&e?._zod&&Zr(e,t)&&(r=!0)},a=e._zod.def;switch(a.type){case`object`:for(let e of Reflect.ownKeys(a.shape))i(a.shape[e]);i(a.catchall);break;case`array`:i(a.element);break;case`tuple`:for(let e of a.items)i(e);i(a.rest);break;case`record`:case`map`:i(a.keyType),i(a.valueType);break;case`set`:i(a.valueType);break;case`union`:for(let e of a.options)i(e);break;case`intersection`:i(a.left),i(a.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:i(a.innerType);break;case`pipe`:i(a.in),i(a.out);break;case`function`:i(a.input),i(a.output);break;case`lazy`:i(e._zod.innerType);break;case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in a){let t=Object.getOwnPropertyDescriptor(a,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)i(n);else if(Array.isArray(n))for(let e of n)i(e)}}}return t.delete(e),Xr.set(e,r),r}function Qr(e,t){let n=e.buckets.get(t);return n||(n=new Map,e.buckets.set(t,n)),n}var $r,ei=[],ti={alloc(e,t,n){let r=$r;if(!r)return n;$r=void 0;let i={value:n,issues:null};return r.set(t.value,i),ei.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&ri(n,e.value))throw new Kr;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,a=(o,s)=>{if(n===void 0&&(n=Zr(e,new Set),!n))return e._zod.parse=t,e._zod.run===a&&(e._zod.run=t),t(o,s);let c=o.value;if(typeof c!=`object`||!c)return t(o,s);let l=s[qr];l||(l={buckets:new Map,backEdges:void 0},s[qr]=l);let u;r===s?u=i:(u=Qr(l,e),r=s,i=u);let d=u.get(c);if(d)return o.value=d.value,d.issues?d.issues.length&&o.issues.push(...Yr(d.issues)):(o.memo=!0,l.backEdges??(l.backEdges=new Set),l.backEdges.add(d.value)),o;$r=u;let f=ei.length,p=t(o,s);$r=void 0;let m=ei.length>f?ei.pop():void 0;return p instanceof Promise?p.then(e=>(m&&(m.issues=e.issues.length?Yr(e.issues):Jr),e)):(m&&(m.issues=p.issues.length?Yr(p.issues):Jr),p)};e._zod.parse=a,e._zod.run===t&&(e._zod.run=a)})}};function ni(){return ti}function ri(e,t){let n=e[qr]?.backEdges;return n!==void 0&&typeof t==`object`&&!!t&&n.has(t)}var ii=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Ae(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${me(e.values[0])}`:`Invalid option: expected one of ${_(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${_(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function ai(){return{localeError:ii()}}var oi,si=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ci(){return new si}(oi=globalThis).__zod_globalRegistry??(oi.__zod_globalRegistry=ci());var H=globalThis.__zod_globalRegistry;function li(e,t){return new e({type:`string`,...T(t)})}function ui(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...T(t)})}function di(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...T(t)})}function fi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...T(t)})}function pi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...T(t)})}function mi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...T(t)})}function hi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...T(t)})}function gi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...T(t)})}function _i(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...T(t)})}function vi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...T(t)})}function yi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...T(t)})}function bi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...T(t)})}function xi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...T(t)})}function Si(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...T(t)})}function Ci(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...T(t)})}function wi(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...T(t)})}function Ti(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...T(t)})}function Ei(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...T(t)})}function Di(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...T(t)})}function Oi(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...T(t)})}function ki(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...T(t)})}function Ai(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...T(t)})}function ji(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...T(t)})}function Mi(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...T(t)})}function Ni(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...T(t)})}function Pi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...T(t)})}function Fi(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...T(t)})}function Ii(e,t){return new e({type:`number`,checks:[],...T(t)})}function Li(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...T(t)})}function Ri(e,t){return new e({type:`boolean`,...T(t)})}function zi(e){return new e({type:`unknown`})}function Bi(e,t){return new e({type:`never`,...T(t)})}function Vi(e,t){return new $t({check:`less_than`,...T(t),value:e,inclusive:!1})}function Hi(e,t){return new $t({check:`less_than`,...T(t),value:e,inclusive:!0})}function Ui(e,t){return new en({check:`greater_than`,...T(t),value:e,inclusive:!1})}function Wi(e,t){return new en({check:`greater_than`,...T(t),value:e,inclusive:!0})}function Gi(e,t){return new tn({check:`multiple_of`,...T(t),value:e})}function Ki(e,t){return new rn({check:`max_size`,...T(t),maximum:e})}function qi(e,t){return new an({check:`min_size`,...T(t),minimum:e})}function Ji(e,t){return new on({check:`size_equals`,...T(t),size:e})}function Yi(e,t){return new sn({check:`max_length`,...T(t),maximum:e})}function Xi(e,t){return new cn({check:`min_length`,...T(t),minimum:e})}function Zi(e,t){return new ln({check:`length_equals`,...T(t),length:e})}function Qi(e,t){return new dn({check:`string_format`,format:`regex`,...T(t),pattern:e})}function $i(e){return new fn({check:`string_format`,format:`lowercase`,...T(e)})}function ea(e){return new pn({check:`string_format`,format:`uppercase`,...T(e)})}function ta(e,t){return new mn({check:`string_format`,format:`includes`,...T(t),includes:e})}function na(e,t){return new hn({check:`string_format`,format:`starts_with`,...T(t),prefix:e})}function ra(e,t){return new gn({check:`string_format`,format:`ends_with`,...T(t),suffix:e})}function U(e){return new _n({check:`overwrite`,tx:e})}function ia(e){return U(t=>t.normalize(e))}function aa(){return U(e=>e.trim())}function oa(){return U(e=>e.toLowerCase())}function sa(){return U(e=>e.toUpperCase())}function ca(){return U(e=>le(e))}function la(e,t,n){return new e({type:`array`,element:t,...T(n)})}function ua(e,t,n){let r=T(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function da(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...T(n)})}function fa(e,t){let n=pa(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(A(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(A(r))}},e(t.value,t)),t);return n}function pa(e,t){let n=new z({check:`custom`,...T(t)});return n._zod.check=e,n}function W(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&y(e,t,n[t]);return e}function ma(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??H,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function G(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function K(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,K(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&W(o.schema,c),t.io===`input`&&q(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ha(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ga(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${ha(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+ha(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
49
-
50
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function _a(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;_a(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var va=new Set([`type`,`properties`,`required`,`additionalProperties`]),ya=[`oneOf`,`anyOf`];function ba(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function xa(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!va.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??ba(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}y(n,r,e.length===1?e[0]:xa(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=ba(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Sa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of va)if(t in e)return;let n=t.filter(e=>ya.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=xa(t);else{let e=n[0],i=ya.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>xa([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,W(e,r))}function Ca(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):W(i,s),W(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())_a(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Sa(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}W(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,y(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:J(t,`input`,e.processors),output:J(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function q(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return q(r.element,n);if(r.type===`set`)return q(r.valueType,n);if(r.type===`lazy`)return q(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return q(r.innerType,n);if(r.type===`intersection`)return q(r.left,n)||q(r.right,n);if(r.type===`record`||r.type===`map`)return q(r.keyType,n)||q(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:q(r.in,n)||q(r.out,n);if(r.type===`object`){for(let e in r.shape)if(q(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(q(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(q(e,n))return!0;return!!(r.rest&&q(r.rest,n))}return!1}var wa=(e,t={})=>n=>{let r=ma({...n,processors:t});return K(e,r),ga(r,e),Ca(r,e)},J=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ma({...i??{},target:a,io:t,processors:n});return K(e,o),ga(o,e),Ca(o,e)},Ta={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ea=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ta[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Da=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(Number.isFinite(c)&&c!==0?i.multipleOf=Math.abs(c):G(e,t,i,r,`A multipleOf divisor of ${c} cannot be represented in JSON Schema`))},Oa=(e,t,n,r)=>{n.type=`boolean`},ka=(e,t,n,r)=>{n.not={}},Aa=(e,t,n,r)=>{let i=e._zod.def,a=g(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ja=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(G(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(G(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ma=(e,t,n,r)=>{G(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Na=(e,t,n,r)=>{G(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Pa=(e,t,n,r)=>{G(e,t,n,r,`Map cannot be represented in JSON Schema`)},Fa=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=K(a.element,t,{...r,path:[...r.path,`items`]})};function Ia(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ia(t.out):t.type===`catch`?Ia(t.innerType):e._zod.optin}var La=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&G(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)y(i.properties,e,K(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?Ia(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=K(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ra=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>K(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},za=(e,t,n,r)=>{let i=e._zod.def,a=K(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=K(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Ba(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Ba(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Ba(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Kt:Gt).source),p):p}var Va=new WeakMap;function Ha(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Va.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Ba(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Ua=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=K(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)y(i.patternProperties,t.source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=K(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Va.get(t);n||(n=[],Va.set(t,n),t.deferred.push(()=>Ha(t))),n.push(e)}i.additionalProperties=K(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ia(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Wa=(e,t,n,r)=>{let i=e._zod.def,a=K(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ga=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ka=Symbol();function qa(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(G(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ka):JSON.parse(o)}var Ja=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=qa(i.defaultValue,e,t,n,r);o!==Ka&&(n.default=o)},Ya=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=qa(i.defaultValue,e,t,n,r);o!==Ka&&(n._prefault=o)},Xa=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{G(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Za=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;K(o,t,r);let s=t.seen.get(e);s.ref=o},Qa=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},$a=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},eo=new WeakSet([Object.prototype,Error.prototype]);function to(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Y=P(`ZodError`,(e,t)=>{Qe.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);eo.has(n)||(eo.add(n),to(n,`format`,e=>t=>nt(e,t)),to(n,`flatten`,e=>t=>tt(e,t)),to(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,v,2)}),to(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,v,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),no=it(Y),ro=at(Y),io=R(Y),ao=st(Y),oo=lt(Y),so=ut(Y),co=dt(Y),lo=ft(Y),uo=pt(Y),fo=mt(Y),po=ht(Y),mo=gt(Y);function ho(){I.localeError||L(ai())}function X(){I.memoizer||L({memoizer:ni()})}var Z=P(`ZodType`,(e,t)=>(ho(),B.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(b(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return w(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Rs(e,t))},superRefine(e,t){return this.check(zs(e,t))},overwrite(e){return this.check(U(e))},optional(){return ys(this)},exactOptional(){return xs(this)},nullable(){return Cs(this)},nullish(){return ys(Cs(this))},nonoptional(e){return ks(this,e)},array(){return $o(this)},or(e){return rs([this,e])},and(e){return ss(this,e)},transform(e){return Ns(this,_s(e))},default(e){return Ts(this,e)},prefault(e){return Ds(this,e)},catch(e){return js(this,e)},pipe(e){return Ns(this,e)},readonly(){return Fs(this)},describe(e){let t=this.clone();return H.add(t,{description:e}),t},meta(...e){if(e.length===0)return H.get(this);let t=this.clone();return H.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Me(this,`~standard`,{...xn(this),jsonSchema:{input:J(this,`input`),output:J(this,`output`)}})},set"~standard"(e){j(this,`~standard`,e)},parse:function e(t,n){return no(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ro(this,t,n,{callee:e})},safeParse(e,t){return io(this,e,t)},async safeParseAsync(e,t){return ao(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){j(this,`spa`,e)},encode:function e(t,n){return oo(this,t,n,{callee:e})},decode:function e(t,n){return so(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await co(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await lo(this,t,n,{callee:e})},safeEncode(e,t){return uo(this,e,t)},safeDecode(e,t){return fo(this,e,t)},async safeEncodeAsync(e,t){return po(this,e,t)},async safeDecodeAsync(e,t){return mo(this,e,t)},toJSONSchema(e){return wa(this,{})(e)},get description(){return H.get(this)?.description},get _def(){return this._zod.def}}),go=P(`_ZodString`,(e,t)=>{Sn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ea(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(Qi(...e))},includes(...e){return this.check(ta(...e))},startsWith(...e){return this.check(na(...e))},endsWith(...e){return this.check(ra(...e))},min(...e){return this.check(Xi(...e))},max(...e){return this.check(Yi(...e))},length(...e){return this.check(Zi(...e))},nonempty(...e){return this.check(Xi(1,...e))},lowercase(e){return this.check($i(e))},uppercase(e){return this.check(ea(e))},trim(){return this.check(aa())},normalize(...e){return this.check(ia(...e))},toLowerCase(){return this.check(oa())},toUpperCase(){return this.check(sa())},slugify(){return this.check(ca())}}),_o=P(`ZodString`,(e,t)=>{Sn.init(e,t),go.init(e,t)},{email(e){return this.check(ui(Co,e))},url(e){return this.check(gi(Eo,e))},jwt(e){return this.check(ji(Vo,e))},emoji(e){return this.check(_i(Do,e))},guid(e){return this.check(di(wo,e))},uuid(e){return this.check(fi(To,e))},uuidv4(e){return this.check(pi(To,e))},uuidv6(e){return this.check(mi(To,e))},uuidv7(e){return this.check(hi(To,e))},nanoid(e){return this.check(vi(Oo,e))},cuid(e){return this.check(yi(ko,e))},cuid2(e){return this.check(bi(Ao,e))},ulid(e){return this.check(xi(jo,e))},base64(e){return this.check(Oi(Ro,e))},base64url(e){return this.check(ki(zo,e))},xid(e){return this.check(Si(Mo,e))},ksuid(e){return this.check(Ci(No,e))},ipv4(e){return this.check(wi(Po,e))},ipv6(e){return this.check(Ti(Fo,e))},cidrv4(e){return this.check(Ei(Io,e))},cidrv6(e){return this.check(Di(Lo,e))},e164(e){return this.check(Ai(Bo,e))},datetime(e){return this.check(Mi(yo,e))},date(e){return this.check(Ni(bo,e))},time(e){return this.check(Pi(xo,e))},duration(e){return this.check(Fi(So,e))}});function vo(e){return li(_o,e)}var Q=P(`ZodStringFormat`,(e,t)=>{V.init(e,t),go.init(e,t)}),yo=P(`ZodISODateTime`,(e,t)=>{zn.init(e,t),Q.init(e,t)}),bo=P(`ZodISODate`,(e,t)=>{Bn.init(e,t),Q.init(e,t)}),xo=P(`ZodISOTime`,(e,t)=>{Vn.init(e,t),Q.init(e,t)}),So=P(`ZodISODuration`,(e,t)=>{Hn.init(e,t),Q.init(e,t)}),Co=P(`ZodEmail`,(e,t)=>{Tn.init(e,t),Q.init(e,t)}),wo=P(`ZodGUID`,(e,t)=>{Cn.init(e,t),Q.init(e,t)}),To=P(`ZodUUID`,(e,t)=>{wn.init(e,t),Q.init(e,t)}),Eo=P(`ZodURL`,(e,t)=>{jn.init(e,t),Q.init(e,t)}),Do=P(`ZodEmoji`,(e,t)=>{Mn.init(e,t),Q.init(e,t)}),Oo=P(`ZodNanoID`,(e,t)=>{Nn.init(e,t),Q.init(e,t)}),ko=P(`ZodCUID`,(e,t)=>{Pn.init(e,t),Q.init(e,t)}),Ao=P(`ZodCUID2`,(e,t)=>{Fn.init(e,t),Q.init(e,t)}),jo=P(`ZodULID`,(e,t)=>{In.init(e,t),Q.init(e,t)}),Mo=P(`ZodXID`,(e,t)=>{Ln.init(e,t),Q.init(e,t)}),No=P(`ZodKSUID`,(e,t)=>{Rn.init(e,t),Q.init(e,t)}),Po=P(`ZodIPv4`,(e,t)=>{Un.init(e,t),Q.init(e,t)}),Fo=P(`ZodIPv6`,(e,t)=>{Kn.init(e,t),Q.init(e,t)}),Io=P(`ZodCIDRv4`,(e,t)=>{qn.init(e,t),Q.init(e,t)}),Lo=P(`ZodCIDRv6`,(e,t)=>{Yn.init(e,t),Q.init(e,t)}),Ro=P(`ZodBase64`,(e,t)=>{Zn.init(e,t),Q.init(e,t)}),zo=P(`ZodBase64URL`,(e,t)=>{$n.init(e,t),Q.init(e,t)}),Bo=P(`ZodE164`,(e,t)=>{er.init(e,t),Q.init(e,t)}),Vo=P(`ZodJWT`,(e,t)=>{nr.init(e,t),Q.init(e,t)}),Ho=P(`ZodNumber`,(e,t)=>{rr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Da(e,t,n,r);let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null},{gt(e,t){return this.check(Ui(e,t))},gte(e,t){return this.check(Wi(e,t))},min(e,t){return this.check(Wi(e,t))},lt(e,t){return this.check(Vi(e,t))},lte(e,t){return this.check(Hi(e,t))},max(e,t){return this.check(Hi(e,t))},int(e){return this.check(Go(e))},safe(e){return this.check(Go(e))},positive(e){return this.check(Ui(0,e))},nonnegative(e){return this.check(Wi(0,e))},negative(e){return this.check(Vi(0,e))},nonpositive(e){return this.check(Hi(0,e))},multipleOf(e,t){return this.check(Gi(e,t))},step(e,t){return this.check(Gi(e,t))},finite(){return this}});function Uo(e){return Ii(Ho,e)}var Wo=P(`ZodNumberFormat`,(e,t)=>{ir.init(e,t),Ho.init(e,t)});function Go(e){return Li(Wo,e)}var Ko=P(`ZodBoolean`,(e,t)=>{ar.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oa(e,t,n,r)});function qo(e){return Ri(Ko,e)}var Jo=P(`ZodUnknown`,(e,t)=>{or.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Yo(){return zi(Jo)}var Xo=P(`ZodNever`,(e,t)=>{sr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ka(e,t,n,r)});function Zo(e){return Bi(Xo,e)}var Qo=P(`ZodArray`,(e,t)=>{X(),lr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fa(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Xi(e,t))},nonempty(e){return this.check(Xi(1,e))},max(e,t){return this.check(Yi(e,t))},length(e,t){return this.check(Zi(e,t))},unwrap(){return this.element}});function $o(e,t){return la(Qo,e,t)}var es=P(`ZodObject`,(e,t)=>{X(),gr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>La(e,t,n,r),Le(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return fs(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Yo()})},loose(){return this.clone({...this._zod.def,catchall:Yo()})},strict(){return this.clone({...this._zod.def,catchall:Zo()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ye(this,e)},safeExtend(e){return be(this,e)},merge(e){return xe(this,e)},pick(e){return _e(this,e)},omit(e){return ve(this,e)},partial(...e){return Se(vs,this,e[0])},exactPartial(...e){return Se(bs,this,e[0],`exactPartial`)},required(...e){return Ce(Os,this,e[0])}});function ts(e,t){return new es({type:`object`,shape:e??{},...T(t)})}var ns=P(`ZodUnion`,(e,t)=>{vr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ra(e,t,n,r),e.options=t.options});function rs(e,t){return new ns({type:`union`,options:e,...T(t)})}var is=P(`ZodDiscriminatedUnion`,(e,t)=>{ns.init(e,t),yr.init(e,t)});function as(e,t,n){return new is({type:`union`,options:t,discriminator:e,...T(n)})}var os=P(`ZodIntersection`,(e,t)=>{br.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r)});function ss(e,t){return new os({type:`intersection`,left:e,right:t})}var cs=P(`ZodRecord`,(e,t)=>{X(),Cr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ls(e,t,n){return!t||!t._zod?new cs({type:`record`,keyType:vo(),valueType:e,...T(t)}):new cs({type:`record`,keyType:e,valueType:t,...T(n)})}var us=P(`ZodMap`,(e,t)=>{X(),wr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pa(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(qi(...t)),e.nonempty=t=>e.check(qi(1,t)),e.max=(...t)=>e.check(Ki(...t)),e.size=(...t)=>e.check(Ji(...t))});function ds(e,t,n){return new us({type:`map`,keyType:e,valueType:t,...T(n)})}var $=P(`ZodEnum`,(e,t)=>{Er.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Aa(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new $({...t,checks:[],...T(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new $({...t,checks:[],...T(r),entries:i})}});function fs(e,t){return new $({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...T(t)})}function ps(e,t){return new $({type:`enum`,entries:e,...T(t)})}var ms=P(`ZodLiteral`,(e,t)=>{Dr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ja(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function hs(e,t){return new ms({type:`literal`,values:Array.isArray(e)?e:[e],...T(t)})}var gs=P(`ZodTransform`,(e,t)=>{X(),Or.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Na(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new We(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(A(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(A(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function _s(e){return new gs({type:`transform`,transform:e})}var vs=P(`ZodOptional`,(e,t)=>{Ar.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ys(e){return new vs({type:`optional`,innerType:e})}var bs=P(`ZodExactOptional`,(e,t)=>{jr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$a(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xs(e){return new bs({type:`optional`,innerType:e})}var Ss=P(`ZodNullable`,(e,t)=>{Mr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cs(e){return new Ss({type:`nullable`,innerType:e})}var ws=P(`ZodDefault`,(e,t)=>{Nr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ts(e,t){return new ws({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():fe(t)}})}var Es=P(`ZodPrefault`,(e,t)=>{Fr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ds(e,t){return new Es({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():fe(t)}})}var Os=P(`ZodNonOptional`,(e,t)=>{Ir.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ks(e,t){return new Os({type:`nonoptional`,innerType:e,...T(t)})}var As=P(`ZodCatch`,(e,t)=>{zr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function js(e,t){return new As({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ze(t)})}var Ms=P(`ZodPipe`,(e,t)=>{Br.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.in=t.in,e.out=t.out});function Ns(e,t){return new Ms({type:`pipe`,in:e,out:t})}var Ps=P(`ZodReadonly`,(e,t)=>{Hr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fs(e){return new Ps({type:`readonly`,innerType:e})}var Is=P(`ZodCustom`,(e,t)=>{Wr.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ma(e,t,n,r)});function Ls(e,t){return ua(Is,e??(()=>!0),t)}function Rs(e,t={}){return da(Is,e,t)}function zs(e,t){return fa(e,t)}var Bs=1e3,Vs=3e4;function Hs(e){let t=Math.min(Bs*2**e,Vs);return t+Math.random()*t*.25}function Us(e,t){let n=new URLSearchParams;for(let[e,r]of Object.entries(t))r!==void 0&&n.set(e,r);return`${e}?${n.toString()}`}var Ws=100,Gs=10,Ks=new Set([`stop`,`interrupt`,`soft_stop`]);function qs(e){let t=typeof e==`object`&&e&&`type`in e?e.type:void 0;return typeof t==`string`&&Ks.has(t)}function Js(e){try{let t=JSON.stringify(e);return typeof t==`string`?t:null}catch{return null}}function Ys(e,t){let n=Js(t);if(n===null)return!1;try{return e.send(n),!0}catch{return!1}}function Xs(e,t,n,r){let i=n;for(;i<r;i+=1){let n=t[i];if(n===void 0)continue;let r=Js(n);if(r!==null)try{e.send(r)}catch{return i}}return i}function Zs(e){let{url:t,onMessage:n,onConnected:i,onDisconnected:a,queuePolicy:o=`replay`}=e,[s,c]=(0,r.useState)(!1),[l,u]=(0,r.useState)(!1),d=(0,r.useRef)(null),f=(0,r.useRef)(0),p=(0,r.useRef)(null),m=(0,r.useRef)(!1),h=(0,r.useRef)([]),ee=(0,r.useRef)(null),te=(0,r.useRef)(n),ne=(0,r.useRef)(i),re=(0,r.useRef)(a);(0,r.useEffect)(()=>{te.current=n,ne.current=i,re.current=a},[n,i,a]);let g=(0,r.useCallback)((e,t)=>{let n=t?h.current.filter(e=>!qs(e)):h.current;h.current=[];let r=0;for(;r<n.length;){if(e.readyState!==WebSocket.OPEN){h.current=n.slice(r);return}let t=Math.min(r+Gs,n.length),i=Xs(e,n,r,t);if(i<t){h.current=n.slice(i);return}r=i}},[]),_=(0,r.useCallback)(()=>{if(!t||d.current?.readyState===WebSocket.OPEN)return;d.current&&=(d.current.close(),null),p.current&&=(clearTimeout(p.current),null),m.current=!1,u(!1);let e=new WebSocket(t);d.current=e,e.onopen=()=>{if(d.current===e){if(c(!0),f.current=0,o!==`replay`){h.current=[],ne.current?.();return}g(e,!0),ne.current?.()}},e.onmessage=t=>{if(d.current===e)try{if(typeof t.data!=`string`)return;let e=JSON.parse(t.data);te.current?.(e)}catch{}},e.onclose=()=>{if(d.current===e&&(c(!1),d.current=null,re.current?.(),!m.current)){if(f.current<10){let e=Hs(f.current);f.current+=1,p.current=setTimeout(()=>{_()},e)}else u(!0)}},e.onerror=()=>{}},[g,o,t]),v=(0,r.useCallback)(()=>{t&&(typeof navigator<`u`&&navigator.onLine===!1||d.current?.readyState!==WebSocket.OPEN&&d.current?.readyState!==WebSocket.CONNECTING&&(f.current=0,m.current=!1,_()))},[_,t]);return(0,r.useEffect)(()=>{let e=ee.current;return ee.current=t,e!==null&&t!==null&&e!==t&&(h.current=[],f.current=0),t?_():(m.current=!0,h.current=[],d.current&&=(d.current.close(),null),c(!1),u(!1),f.current=0),()=>{m.current=!0,p.current&&=(clearTimeout(p.current),null),d.current&&(d.current.close(),d.current=null,c(!1))}},[t,_]),(0,r.useEffect)(()=>{if(!t||typeof window>`u`||typeof document>`u`)return;let e=()=>{document.visibilityState===`visible`&&v()},n=e=>{e.persisted&&v()},r=()=>{v()};return document.addEventListener(`visibilitychange`,e),window.addEventListener(`pageshow`,n),window.addEventListener(`online`,r),()=>{document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`pageshow`,n),window.removeEventListener(`online`,r)}},[t,v]),{connected:s,gaveUp:l,send:(0,r.useCallback)(e=>{let t=d.current,n=t?.readyState===WebSocket.OPEN,r=h.current.length>0;return n&&!r&&t&&Ys(t,e)?!0:o===`replay`&&(h.current.length<Ws&&h.current.push(e),n&&t&&g(t,!1),!1)},[g,o]),reconnect:(0,r.useCallback)(()=>{f.current=0,m.current=!1,h.current=[],d.current&&=(d.current.close(),null),_()},[_])}}export{te as C,s as D,f as E,o as O,re as S,ne as T,u as _,qo as a,p as b,hs as c,Uo as d,ts as f,Yo as g,rs as h,$o as i,ds as l,vo as m,Us as n,Ls as o,ls as p,fs as r,as as s,Zs as t,ps as u,c as v,ee as w,d as x,l as y};