@higgsfield/video-editor-mcp 1.0.7 → 1.1.1-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/THIRD_PARTY_NOTICES.md +24 -24
  2. package/dist/cli.mjs +134 -125
  3. package/dist/index.html +136 -133
  4. package/dist/launcher.mjs +90 -90
  5. package/dist/server.mjs +1553 -1389
  6. package/node_modules/@higgsfield/higgsedit/README.md +181 -1
  7. package/node_modules/@higgsfield/higgsedit/dist/capture-page.js +902 -314
  8. package/node_modules/@higgsfield/higgsedit/dist/chunk-2JYLVSVV.mjs +1594 -0
  9. package/node_modules/@higgsfield/higgsedit/dist/chunk-2WKNH7OL.mjs +16 -0
  10. package/node_modules/@higgsfield/higgsedit/dist/{chunk-OMKZ5BXM.mjs → chunk-5LTTL3Q3.mjs} +1 -1
  11. package/node_modules/@higgsfield/higgsedit/dist/chunk-7PYXSJS7.mjs +717 -0
  12. package/node_modules/@higgsfield/higgsedit/dist/{chunk-MLJAIZGP.mjs → chunk-BH2QF635.mjs} +33 -326
  13. package/node_modules/@higgsfield/higgsedit/dist/{chunk-WZR5PZM7.mjs → chunk-BV5COOQZ.mjs} +250 -161
  14. package/node_modules/@higgsfield/higgsedit/dist/{chunk-HTCYVKFX.mjs → chunk-C3GSB3XZ.mjs} +8 -7
  15. package/node_modules/@higgsfield/higgsedit/dist/{chunk-CYH2EUQV.mjs → chunk-DVN4LUXV.mjs} +13 -4
  16. package/node_modules/@higgsfield/higgsedit/dist/chunk-F4CMIG5G.mjs +36 -0
  17. package/node_modules/@higgsfield/higgsedit/dist/chunk-IEPPEDEU.mjs +33 -0
  18. package/node_modules/@higgsfield/higgsedit/dist/{chunk-UVAZ6I6U.mjs → chunk-KIWGVAPJ.mjs} +16 -12
  19. package/node_modules/@higgsfield/higgsedit/dist/{chunk-L6QDNSL3.mjs → chunk-L5LWBA6A.mjs} +5 -5
  20. package/node_modules/@higgsfield/higgsedit/dist/chunk-LMQR3DHT.mjs +37 -0
  21. package/node_modules/@higgsfield/higgsedit/dist/chunk-LTKMGZ6T.mjs +58 -0
  22. package/node_modules/@higgsfield/higgsedit/dist/{chunk-VI6IV6JP.mjs → chunk-MV2JTTBQ.mjs} +65 -47
  23. package/node_modules/@higgsfield/higgsedit/dist/{chunk-4D6AXU4B.mjs → chunk-NARTAWRN.mjs} +50 -30
  24. package/node_modules/@higgsfield/higgsedit/dist/{chunk-27NBQ5FA.mjs → chunk-NUXTKQNM.mjs} +33 -21
  25. package/node_modules/@higgsfield/higgsedit/dist/chunk-OCIZ36XD.mjs +40 -0
  26. package/node_modules/@higgsfield/higgsedit/dist/{chunk-MK6PL7N4.mjs → chunk-OF6RMSM2.mjs} +19 -17
  27. package/node_modules/@higgsfield/higgsedit/dist/{chunk-6BETMESC.mjs → chunk-P2BGHTRR.mjs} +2 -2
  28. package/node_modules/@higgsfield/higgsedit/dist/{chunk-EKFC4S4M.mjs → chunk-PAHMD6SU.mjs} +5 -0
  29. package/node_modules/@higgsfield/higgsedit/dist/{chunk-QVLAEV3U.mjs → chunk-PFQYUJQL.mjs} +3 -4
  30. package/node_modules/@higgsfield/higgsedit/dist/chunk-QJTILFBS.mjs +335 -0
  31. package/node_modules/@higgsfield/higgsedit/dist/chunk-QQ3GGKDN.mjs +21 -0
  32. package/node_modules/@higgsfield/higgsedit/dist/chunk-TH7TK67K.mjs +23 -0
  33. package/node_modules/@higgsfield/higgsedit/dist/{chunk-SIMO6I3D.mjs → chunk-UDL5AHKO.mjs} +163 -158
  34. package/node_modules/@higgsfield/higgsedit/dist/chunk-UMWOUQN3.mjs +60 -0
  35. package/node_modules/@higgsfield/higgsedit/dist/{chunk-3AIM3THH.mjs → chunk-VLM5EOWJ.mjs} +4 -4
  36. package/node_modules/@higgsfield/higgsedit/dist/chunk-WENFTPXQ.mjs +403 -0
  37. package/node_modules/@higgsfield/higgsedit/dist/chunk-YLVXQIPX.mjs +464 -0
  38. package/node_modules/@higgsfield/higgsedit/dist/editor/.vite/manifest.json +559 -506
  39. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/agent-corner-bottom-q4hZltI-.svg +431 -0
  40. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/agent-corner-top-BJYI-I24.svg +431 -0
  41. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/confirmation-BTnwl3LS.css +1 -0
  42. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/drag-Bt_t4HZO.css +1 -0
  43. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/local-B3OTAV_A.css +1 -0
  44. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/menubar-2Y1Y2XJt.css +1 -0
  45. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/model-DdE4hCgf.css +1 -0
  46. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/{IconText1-CzbCrP7v.css → notifications-B08L1jSe.css} +1 -1
  47. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/{panel-g852pZf_.css → panel-BRN_AbBM.css} +1 -1
  48. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-CYELNqrv.css +1 -0
  49. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-DYLpT6oA.css +1 -0
  50. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-v84HaGTZ.css +1 -0
  51. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconChainLink1-Bxb1Or0F.js +1 -0
  52. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconCheckmark2Medium-daaES9uF.js → IconCheckmark2Medium-hegaz9mQ.js} +1 -1
  53. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconChevronDownSmall-BhTBJk26.js → IconChevronDownSmall-DaruzJwU.js} +1 -1
  54. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconClosedCaptioning-BPqcqKsD.js +1 -0
  55. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconCrossMedium-acfnCXOM.js → IconCrossMedium-BsPFJzc6.js} +1 -1
  56. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconOpenaiFilled-D1fzthmi.js +1 -0
  57. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconPause-pTeVSvUe.js → IconPause-ClNg8pao.js} +1 -1
  58. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{IconPlayFilled-CwdgIuDG.js → IconPlayFilled-CHb-7GSx.js} +1 -1
  59. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconSparklesSoftFilled-o7o33KRn.js +1 -0
  60. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/ai-composer-B9h-eaki.js +567 -0
  61. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/auto-layout-BO20Tg4B.js +1 -0
  62. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{button-CjG6GcgF.js → button-Cg0U0zpV.js} +1 -1
  63. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/canvas-Bw4CVzfw.js +1 -0
  64. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/capabilities-BCd4-zPF.js +1 -0
  65. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/commands-QeSqAbCt.js +1 -0
  66. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/components-tXMtIZNL.js +51 -0
  67. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/confirmation-CO2PHR_z.js +1 -0
  68. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/dom-6aoQn29n.js +1 -0
  69. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/drag-Dw8b_vO2.js +1 -0
  70. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{editing-CjWbiCxv.js → editing-Cy-SaOyB.js} +1 -1
  71. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/edits-CqLBqir0.js +1 -0
  72. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/export-dialog-BjBskOe3.js +2 -0
  73. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/factories-Bw_iQrUL.js +1 -0
  74. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/id3-CSR0NCRI.js +2 -0
  75. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/import-DP49i4ke.js +1 -0
  76. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/import-error-CMz9sLPe.js +1 -0
  77. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/ingest-DsmIc415.js +1 -0
  78. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/jsx-runtime-B5yqYJvp.js +1 -0
  79. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/{media-Bwjxu-0U.js → media-DQw6vU_T.js} +1 -1
  80. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/menubar-D31srALX.js +1 -0
  81. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/meters-D0nZVEJs.js +1 -0
  82. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/mode-DEG6doKF.js +1 -0
  83. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/model-Duf9fszJ.js +2 -0
  84. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/model-DyAkLA69.js +1 -0
  85. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/notifications-DqWZNIrK.js +9 -0
  86. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/palette-HT83gWgL.js +1 -0
  87. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-B5Mvm6dg.js +7 -0
  88. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-BC90wyvd.js +1 -0
  89. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-Bw_ZJ2JI.js +3 -0
  90. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DNS060Nt.js +3 -0
  91. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DSgxIrEq.js +2 -0
  92. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DgBttE5O.js +1 -0
  93. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-assets-_T2bHsHW.js +771 -0
  94. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-inspector-DfHvAt5X.js +2 -0
  95. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-nBZvHlkA.js +1 -0
  96. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-timeline-DsCpJVSt.js +327 -0
  97. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-viewport-CEhZwZ67.js +280 -0
  98. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/projects-2_tW9Do7.js +1 -0
  99. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/react-dom-1uB7Vbbb.js +1 -0
  100. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/schemas-CddYAOcj.js +64 -0
  101. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/session-BpFeKAI2.js +1 -0
  102. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/src-BLG3tYBa.js +2 -0
  103. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/styles-e2n2A_JN.js +284 -0
  104. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/supercomputer-CuV0zYKd.js +24 -0
  105. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/tabs-XeAgs9cs.js +1 -0
  106. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/toggle-DbNEaSIl.js +1 -0
  107. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-C8Ll3qFl.js +69 -0
  108. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-bar-Dv1LPFbu.js +1 -0
  109. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useOpenInteractionType-HWSfSsp2.js +1 -0
  110. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useRenderElement-D4SOg3N_.js +1 -0
  111. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/value-EB7YmAdS.js +1 -0
  112. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/writeback-support-fj5rA9k3.js +1 -0
  113. package/node_modules/@higgsfield/higgsedit/dist/editor/editor-B-WAkLt7.js +372 -0
  114. package/node_modules/@higgsfield/higgsedit/dist/higgsedit.mjs +39 -24
  115. package/node_modules/@higgsfield/higgsedit/dist/jsx/hooks.d.ts +26 -0
  116. package/node_modules/@higgsfield/higgsedit/dist/jsx/index.d.ts +17 -0
  117. package/node_modules/@higgsfield/higgsedit/dist/jsx/inspect.d.ts +42 -0
  118. package/node_modules/@higgsfield/higgsedit/dist/jsx/jsx-runtime.d.ts +28 -0
  119. package/node_modules/@higgsfield/higgsedit/dist/jsx/svg.d.ts +9 -0
  120. package/node_modules/@higgsfield/higgsedit/dist/jsx/time.d.ts +6 -0
  121. package/node_modules/@higgsfield/higgsedit/dist/jsx/types.d.ts +420 -0
  122. package/node_modules/@higgsfield/higgsedit/package.json +28 -20
  123. package/package.json +4 -3
  124. package/plugin/.codex-plugin/plugin.json +1 -1
  125. package/plugin/plugin.json +1 -1
  126. package/plugin/skills/video-editing/references/caption-titling.md +1 -1
  127. package/plugin/skills/video-editing/references/local-setup.md +3 -3
  128. package/node_modules/@higgsfield/higgsedit/dist/chunk-C6SASQHE.mjs +0 -424
  129. package/node_modules/@higgsfield/higgsedit/dist/chunk-FZ5U36SQ.mjs +0 -83
  130. package/node_modules/@higgsfield/higgsedit/dist/chunk-QLPCYN6K.mjs +0 -292
  131. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/edit-drag-D2EV5ddd.css +0 -1
  132. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/editor-CuRHT75g.css +0 -1
  133. package/node_modules/@higgsfield/higgsedit/dist/editor/assets/panel-DnuQD7ja.css +0 -1
  134. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/FieldControl-B0fenhBJ.js +0 -2
  135. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconChainLink1-Cwv1X7hi.js +0 -1
  136. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconEyeOpen-BqTT9_VV.js +0 -1
  137. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconEyeSlash-Whv58c1m.js +0 -1
  138. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconPencil-Dr17k_7e.js +0 -1
  139. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconPlay-BroH3ziH.js +0 -1
  140. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconPlusSmall-43T9aE3d.js +0 -1
  141. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconText1-BaP_p9DW.js +0 -1
  142. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/IconTrashCan-DX2w2AIC.js +0 -1
  143. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/ai-composer-C-l0eIdP.js +0 -560
  144. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/captions-Cd-bDG3G.js +0 -1
  145. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/clip-highlight-DpAvcA4x.js +0 -1
  146. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/components-e3ZbUVns.js +0 -1
  147. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/disposables-CwUPjcuA.js +0 -1
  148. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/drag-HLBkto5o.js +0 -1
  149. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/dropdown-BJ04G_X3.js +0 -1
  150. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/edit-drag-Bg6LggKC.js +0 -1
  151. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/edits-a2IixhrN.js +0 -1
  152. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/export-dialog-4I4gqI5V.js +0 -2
  153. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/face-tracker-DzVfjVOO.js +0 -1
  154. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/fit-imported-media-CaCB0x0b.js +0 -1
  155. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/generation-queue-DuL2F4-_.js +0 -1
  156. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/import-error-CMARA0Hy.js +0 -1
  157. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/jsx-runtime-B-hcVAMW.js +0 -1
  158. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/menubar-Bs26OdwP.js +0 -1
  159. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/meters-YEr9OQjq.js +0 -1
  160. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/paints-DS2Msf91.js +0 -67
  161. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/palette-CcS9IcAC.js +0 -1
  162. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-7M3uQokX.js +0 -1
  163. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-BBK1NyG-.js +0 -1
  164. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-CHZTs7By.js +0 -4
  165. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DaSOa3MP.js +0 -2
  166. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-DlK3RYVo.js +0 -1
  167. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-Dst5OKWu.js +0 -2
  168. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-H_ZoDiKK.js +0 -2
  169. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-Rn9Z7Eek.js +0 -3
  170. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-assets-FAghGFG3.js +0 -678
  171. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-inspector-DEqULBNF.js +0 -260
  172. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-timeline-0GYNz1uc.js +0 -333
  173. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/panel-viewport-DOWjJi5-.js +0 -317
  174. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/projects-BBJc7h5_.js +0 -2
  175. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/session-B9sZaFKC.js +0 -1
  176. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/supercomputer-CX-LCL6Y.js +0 -24
  177. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/tabs-CvKQ-eas.js +0 -1
  178. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/toggle-CrzrwiDZ.js +0 -1
  179. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-BgRfk-Qq.js +0 -69
  180. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/transport-bar-C9nqAfE2.js +0 -1
  181. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/typography-C5-w9LOu-kD3uLKkf.js +0 -1
  182. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useOpenInteractionType-DbrQ6Ehu.js +0 -1
  183. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/useRenderElement-bbxXdYq0.js +0 -1
  184. package/node_modules/@higgsfield/higgsedit/dist/editor/chunks/writeback-support-BZfNpkmB.js +0 -1
  185. package/node_modules/@higgsfield/higgsedit/dist/editor/editor-Csn2_T_e.js +0 -293
  186. package/node_modules/@higgsfield/higgsedit/dist/export-settings.mjs +0 -75
  187. package/node_modules/@higgsfield/higgsedit/dist/history.mjs +0 -295
  188. package/node_modules/@higgsfield/higgsedit/dist/media-upload.mjs +0 -381
  189. package/node_modules/@higgsfield/higgsedit/dist/proxy.mjs +0 -170
@@ -0,0 +1,280 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/panel-DNS060Nt.js","chunks/jsx-runtime-B5yqYJvp.js","chunks/notifications-DqWZNIrK.js","chunks/react-dom-1uB7Vbbb.js","assets/notifications-B08L1jSe.css","chunks/capabilities-BCd4-zPF.js","chunks/session-BpFeKAI2.js","chunks/ingest-DsmIc415.js","chunks/factories-Bw_iQrUL.js","chunks/value-EB7YmAdS.js","chunks/schemas-CddYAOcj.js","chunks/IconCheckmark2Medium-hegaz9mQ.js","chunks/import-error-CMz9sLPe.js","chunks/dom-6aoQn29n.js","chunks/import-DP49i4ke.js","chunks/asset-op-C6YhYJcd.js","chunks/editing-Cy-SaOyB.js","chunks/model-Duf9fszJ.js","chunks/useRenderElement-D4SOg3N_.js","chunks/components-tXMtIZNL.js","chunks/useOpenInteractionType-HWSfSsp2.js","chunks/button-Cg0U0zpV.js","editor-B-WAkLt7.js","chunks/src-BLG3tYBa.js","chunks/edits-CqLBqir0.js","assets/local-B3OTAV_A.css","chunks/mode-DEG6doKF.js","chunks/toggle-DbNEaSIl.js","chunks/IconOpenaiFilled-D1fzthmi.js","chunks/id3-CSR0NCRI.js","chunks/auto-layout-BO20Tg4B.js","chunks/IconChainLink1-Bxb1Or0F.js","chunks/canvas-Bw4CVzfw.js","chunks/palette-HT83gWgL.js","chunks/drag-Dw8b_vO2.js","assets/drag-Bt_t4HZO.css","chunks/IconPlayFilled-CHb-7GSx.js","assets/panel-CYELNqrv.css"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./dom-6aoQn29n.js";import{St as t,Ut as n}from"../editor-B-WAkLt7.js";import{t as r}from"./panel-4DTzhYdA.js";var i=`
3
+ .fv-root {
4
+ position: relative;
5
+ height: 100%;
6
+ min-height: 240px;
7
+ overflow: clip;
8
+ background: var(--bg-panel, #0d0d0d);
9
+ container-type: inline-size;
10
+ display: flex;
11
+ flex-direction: column;
12
+ }
13
+ .fv-design-title { display: none; }
14
+ .fv-player-settings {
15
+ position: absolute;
16
+ top: 12px;
17
+ right: 12px;
18
+ z-index: 25;
19
+ display: flex;
20
+ align-items: center;
21
+ gap: 8px;
22
+ max-width: calc(100% - 24px);
23
+ flex-wrap: wrap;
24
+ justify-content: flex-end;
25
+ }
26
+ .fv-zoom-controls { display: flex; align-items: center; gap: 4px; }
27
+ .fv-player-settings .fv-aspect-ratio {
28
+ display: inline-flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ box-sizing: border-box;
32
+ height: 28px;
33
+ min-width: 28px;
34
+ padding: 6px 14px;
35
+ border: 0;
36
+ border-radius: 9999px;
37
+ background: rgb(0 0 0 / 30%);
38
+ backdrop-filter: blur(40px);
39
+ -webkit-backdrop-filter: blur(40px);
40
+ color: #fff;
41
+ font: 500 12px / 16px var(--hf-type-family-primary, Inter, sans-serif);
42
+ white-space: nowrap;
43
+ box-shadow: none;
44
+ }
45
+ .fv-player-settings .fv-aspect-ratio { padding: 6px 8px 6px 10px; gap: 0; background: rgb(0 0 0 / 50%); cursor: pointer; }
46
+ .fv-aspect-ratio > span { padding-inline: 6px; }
47
+ .fv-aspect-ratio > svg { flex: none; color: rgb(255 255 255 / 50%); }
48
+ .fv-player-settings .fv-aspect-ratio:hover:not(:disabled),
49
+ .fv-player-settings .fv-aspect-ratio[data-popup-open] { background: rgb(0 0 0 / 70%); }
50
+ .fv-player-settings .fv-aspect-ratio:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
51
+ .fv-stage {
52
+ position: relative;
53
+ flex: 1 1 0;
54
+ min-height: 0;
55
+ overflow: clip;
56
+ }
57
+ .fv-root[data-empty] .fv-stage > :is(.fv-canvas, .fv-selection-toolbar, .fv-context-toolbar) {
58
+ visibility: hidden;
59
+ pointer-events: none;
60
+ transition: none;
61
+ }
62
+ .fv-canvas {
63
+ position: absolute;
64
+ inset: 0;
65
+ width: 100%;
66
+ height: 100%;
67
+ display: block;
68
+ }
69
+ .fv-context-toolbar {
70
+ position: absolute;
71
+ left: 0;
72
+ top: 0;
73
+ z-index: 20;
74
+ display: none;
75
+ max-width: calc(100% - 16px);
76
+ flex-wrap: wrap;
77
+ align-items: center;
78
+ gap: 3px;
79
+ padding: 4px;
80
+ border: 1px solid var(--hf-color-border-default);
81
+ border-radius: 8px;
82
+ background: var(--hf-color-background-tertiary);
83
+ color: var(--hf-color-text-primary);
84
+ box-shadow: 0 4px 12px var(--hf-color-overlay-dim-soft);
85
+ user-select: none;
86
+ }
87
+ .fshell[data-view-mode="contextual"] .fv-context-toolbar:not([hidden]) { display: flex; }
88
+ .fv-context-toolbar[hidden] { display: none; }
89
+ .fv-context-toolbar button {
90
+ display: inline-flex;
91
+ align-items: center;
92
+ justify-content: center;
93
+ min-width: 28px;
94
+ height: 28px;
95
+ padding: 0 6px;
96
+ border: 0;
97
+ border-radius: 6px;
98
+ background: transparent;
99
+ color: inherit;
100
+ cursor: pointer;
101
+ }
102
+ .fv-context-toolbar button:hover { background: var(--hf-color-overlay-hover); }
103
+ .fv-context-toolbar button:focus-visible { outline: 2px solid var(--hf-color-border-focus); outline-offset: 1px; }
104
+ .fv-context-toolbar button[aria-pressed="true"],
105
+ .fv-context-toolbar button.active { background: var(--hf-color-brand-primary); color: var(--hf-color-text-inverse); }
106
+ .fv-context-toolbar button:disabled { opacity: 0.4; cursor: default; }
107
+ .fv-context-divider { width: 1px; height: 18px; background: var(--hf-color-border-subtle); }
108
+ .fv-context-editor {
109
+ position: absolute;
110
+ top: calc(100% + 8px);
111
+ left: 50%;
112
+ z-index: 20;
113
+ transform: translateX(-50%);
114
+ width: 320px;
115
+ box-sizing: border-box;
116
+ padding: 10px;
117
+ border: 1px solid var(--hf-color-border-default);
118
+ border-radius: 8px;
119
+ background: var(--hf-color-background-secondary);
120
+ color: var(--hf-color-text-primary);
121
+ box-shadow: 0 8px 24px var(--hf-color-overlay-dim-soft);
122
+ font: 400 var(--hf-type-size-100) / var(--hf-type-line-height-300) var(--hf-type-family-primary);
123
+ user-select: none;
124
+ }
125
+ .fv-context-editor-title,
126
+ .fv-context-editor-row {
127
+ display: flex;
128
+ align-items: center;
129
+ gap: 8px;
130
+ }
131
+ .fv-context-editor-title {
132
+ justify-content: space-between;
133
+ min-height: 28px;
134
+ padding-bottom: 8px;
135
+ margin-bottom: 8px;
136
+ border-bottom: 1px solid var(--hf-color-border-subtle);
137
+ font-weight: 600;
138
+ }
139
+ .fv-context-editor-name {
140
+ min-width: 0;
141
+ overflow: hidden;
142
+ white-space: nowrap;
143
+ text-overflow: ellipsis;
144
+ }
145
+ .fv-context-editor-row {
146
+ min-height: 34px;
147
+ color: var(--hf-color-text-tertiary);
148
+ }
149
+ .fv-context-editor-row > span:first-child { width: 72px; flex: none; }
150
+ .fv-context-editor-row .fui-slider { min-width: 0; }
151
+ .fv-context-value {
152
+ width: 34px;
153
+ flex: none;
154
+ color: var(--hf-color-text-primary);
155
+ text-align: right;
156
+ font-variant-numeric: tabular-nums;
157
+ }
158
+ .fv-context-align {
159
+ display: flex;
160
+ align-items: center;
161
+ padding: 2px;
162
+ border-radius: 6px;
163
+ background: var(--hf-color-background-primary);
164
+ }
165
+ .fv-context-align button { height: 24px; min-width: 26px; padding: 0 4px; }
166
+ .fv-context-number {
167
+ display: flex;
168
+ align-items: center;
169
+ gap: 4px;
170
+ min-width: 0;
171
+ color: var(--hf-color-text-tertiary);
172
+ }
173
+ .fv-context-number .fui-number { width: 62px; }
174
+ .fv-context-rotation { width: 100%; flex: 1; }
175
+ .fv-context-editor .fui-color-field { flex: 1; }
176
+ .fv-context-editor .fui-hex { width: 100%; }
177
+ .fv-scene-controls {
178
+ position: absolute;
179
+ left: 12px;
180
+ right: 12px;
181
+ bottom: 12px;
182
+ z-index: 40;
183
+ display: grid;
184
+ grid-template-columns: 1fr auto 1fr;
185
+ align-items: center;
186
+ gap: 12px;
187
+ pointer-events: none;
188
+ user-select: none;
189
+ }
190
+ .fv-scene-controls > * { pointer-events: auto; }
191
+ .fv-player-transport { grid-column: 2; display: flex; align-items: center; gap: 12px; }
192
+ .fv-scene-controls .fv-player-button,
193
+ .fv-player-timecode {
194
+ height: 32px;
195
+ border: 0;
196
+ border-radius: 500px;
197
+ color: #fff;
198
+ background: rgb(0 0 0 / 50%);
199
+ backdrop-filter: blur(40px);
200
+ box-shadow: none;
201
+ }
202
+ .fv-scene-controls .fv-player-button { width: 32px; min-width: 32px; padding: 0; }
203
+ .fv-scene-controls .fv-player-button:hover { background: rgb(0 0 0 / 70%); }
204
+ .fv-scene-controls .fv-player-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
205
+ .fv-player-timecode {
206
+ display: flex;
207
+ align-items: center;
208
+ justify-content: center;
209
+ min-width: 106px;
210
+ padding: 0 14px;
211
+ font-size: 12px;
212
+ font-weight: 500;
213
+ line-height: 16px;
214
+ font-variant-numeric: tabular-nums;
215
+ white-space: pre;
216
+ }
217
+ .fv-player-total { color: rgb(255 255 255 / 50%); }
218
+ .fv-scene-controls .fv-player-fullscreen { grid-column: 3; justify-self: end; background: rgb(0 0 0 / 30%); }
219
+ .fv-player-error { position: absolute; right: 16px; bottom: 54px; z-index: 10; padding: 8px 12px; border-radius: 8px; background: rgb(0 0 0 / 75%); color: #fff; font-size: 12px; }
220
+ @container (max-width: 480px) {
221
+ .fv-scene-controls { grid-template-columns: 1fr auto; }
222
+ .fv-player-transport { grid-column: 1; justify-self: center; }
223
+ .fv-scene-controls .fv-player-fullscreen { grid-column: 2; }
224
+ }
225
+ .fshell[data-design="higgsfield"] .fv-root:not(:fullscreen) .fv-design-title {
226
+ display: flex;
227
+ position: absolute;
228
+ top: 12px;
229
+ left: 12px;
230
+ z-index: 10;
231
+ align-items: center;
232
+ min-height: 32px;
233
+ padding: 4px 12px;
234
+ border-radius: 500px;
235
+ background: rgb(0 0 0 / 50%);
236
+ backdrop-filter: blur(40px);
237
+ color: var(--hf-color-text-primary);
238
+ font-size: var(--hf-type-size-200);
239
+ font-weight: 500;
240
+ line-height: 20px;
241
+ }
242
+
243
+ .fshell[data-design="higgsfield"] .fv-crumb-item {
244
+ display: inline-flex;
245
+ align-items: center;
246
+ min-width: 0;
247
+ }
248
+ .fshell[data-design="higgsfield"] .fv-crumb-sep {
249
+ padding: 0 6px;
250
+ color: var(--hf-color-text-tertiary);
251
+ user-select: none;
252
+ }
253
+ .fshell[data-design="higgsfield"] .fv-crumb {
254
+ max-width: 220px;
255
+ overflow: hidden;
256
+ text-overflow: ellipsis;
257
+ white-space: nowrap;
258
+ font: inherit;
259
+ }
260
+ .fshell[data-design="higgsfield"] button.fv-crumb {
261
+ padding: 2px 4px;
262
+ border: 0;
263
+ border-radius: 4px;
264
+ background: none;
265
+ color: var(--hf-color-text-secondary);
266
+ cursor: pointer;
267
+ }
268
+ .fshell[data-design="higgsfield"] button.fv-crumb:hover {
269
+ background: var(--hf-color-overlay-hover);
270
+ color: var(--hf-color-text-primary);
271
+ }
272
+ .fshell[data-design="higgsfield"] button.fv-crumb:focus-visible {
273
+ outline: 2px solid var(--hf-color-border-focus);
274
+ outline-offset: -1px;
275
+ }
276
+ .fshell[data-design="higgsfield"] .fv-crumb-current {
277
+ padding: 2px 4px;
278
+ color: var(--hf-color-text-primary);
279
+ }
280
+ `,a=`fable-panel-viewport-styles`;function o(t){e(t,a,i)}var s=`fable.panel-viewport.main`,c=[`move`,`frame`,`rect`,`text`];function l(){let e=[];return{bind(t,n){let r={stage:t,session:n};return e.push(r),{dispose:()=>{let t=e.indexOf(r);t!==-1&&e.splice(t,1)}}},active:()=>e[e.length-1]??null}}function u(e){let i=new n,a=l();for(let t of c)i.add(e.extensions.register(`tool`,`fable.panel-viewport.tool.${t}`,f(t,a)));return i.add(e.extensions.register(`panel`,s,r(()=>t(()=>import(`./panel-DNS060Nt.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37])),{props:()=>({bindStage:a.bind}),styles:o}))),i.add(e.commands.register(`fable.panel-viewport.zoomToFit`,e=>{if(e==null)return a.active()?.stage.zoomToFit();typeof e==`object`&&e&&!Array.isArray(e)&&`documentId`in e&&`sceneId`in e&&`scope`in e&&typeof e.documentId==`string`&&typeof e.sceneId==`string`&&e.scope===`scene`&&a.active()?.stage.zoomToFit({documentId:e.documentId,sceneId:e.sceneId,scope:`scene`})})),i.add(e.commands.register(`fable.panel-viewport.zoomToActual`,()=>a.active()?.stage.zoomToActual())),i.add(e.commands.register(`fable.panel-viewport.scrubPreview`,e=>a.active()?.stage.scrubPreview(d(e)))),i}function d(e){if(typeof e!=`object`||!e||Array.isArray(e))return null;let{src:t,time:n}=e;return typeof t==`string`&&typeof n==`number`&&Number.isFinite(n)?{src:t,time:n}:null}function f(e,t){return{activate:()=>t.active()?.session.setActiveTool(e),deactivate:()=>{},onPointer:e=>t.active()?.stage.toolPointer(e)??!1}}export{u as activate};
@@ -0,0 +1 @@
1
+ function e(e,t){return e.commands.register(`fable.projects.open`,t)}export{e as activate};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./jsx-runtime-B5yqYJvp.js";var n=t((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},t.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},t.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},t.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},t.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)}},t.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},t.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)}},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},t.useFormStatus=function(){return c.H.useHostTransitionStatus()},t.version=`19.2.8`})),r=t(((e,t)=>{function r(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),t.exports=n()}));export{r as t};
@@ -0,0 +1,64 @@
1
+ import{n as e,t}from"./capabilities-BCd4-zPF.js";import{t as n}from"./session-BpFeKAI2.js";import{n as r}from"./ingest-DsmIc415.js";import{t as i}from"./value-EB7YmAdS.js";var a=new WeakMap;function o(e){let t=a.get(e);return t||(t=new i(null),a.set(e,t)),t}function s(e,t,n){typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||o(e).set({documentId:t,clipId:n,startedAt:performance.now()})}async function c(e,t,n,r=t.activeSceneId){if(n.some(e=>e.kind===`image`||e.kind===`video`))try{await e.commands.execute(`fable.panel-viewport.zoomToFit`,{documentId:t.id,sceneId:r,scope:`scene`})}catch(t){e.log.warn(`Could not fit imported media in the viewport`,String(t))}}var l=`capability:ai/generation-queue`;function u(a,o,l,u=()=>{}){let d=new i([]),f=new i([]),p=new i(null),m=new i(null),h=new i(null),g=new Map,_=o.queueSession??new Map,v=new Map,y=new Set,b=(e,t)=>`${e}:${t}`,x=(e,t)=>{y.add(b(e,t)),y.size>200&&y.delete(y.values().next().value)},S=!1,C,w=Promise.resolve(),T=e=>{let t=w.then(e);return w=t.catch(()=>{}),t},E,D,ee,O,k=null,A,j,M=!1;function N(){if(O&&!S){M=!0;try{_.set(O,{startedAt:k,items:d.get(),dismissed:[...y],selectedId:m.get(),imageStartedAt:A})}finally{M=!1}}}function P(e){k===null&&!d.get().length||D||(D=o.watchVideoFeed(e,()=>d.get(),te,t=>{S||O!==e||p.set(t?`Could not sync videos. Retrying…`:null)},k??void 0,A,k!==null))}let F=Promise.all([a.require(e),a.require(n),a.require(t),a.require(`capability:storage/local`)]).then(([e,t,n,r])=>{E=e;let i=(e,t)=>{D?.(),D=void 0,k=t?.startedAt??null,A=t?.imageStartedAt,y.clear();for(let e of t?.dismissed??[])y.add(e);d.set(t?.items??[]),m.set(t?.selectedId??null),p.set(null);for(let e of d.get())l(e);e&&P(e)},a=()=>{let t=e.snapshot()?.id;S||t===O||(j?.(),O=t,h.set(null),i(t,t?_.get(t):void 0),j=t?_.subscribe?.(t,e=>{!S&&!M&&O===t&&i(t,e)}):void 0)};return S||(ee=e.onEvent(a),a()),{document:e,session:t,placement:n,storage:r}});F.catch(e=>a.log.error(`Generation queue could not connect`,String(e)));function I(e){let t=d.get(),n=t.find(t=>t.id===e.id);n&&Object.keys(e).every(t=>n[t]===e[t])||(n?.status!==`completed`||!n.resultUrl||e.status===`completed`&&e.resultUrl)&&(d.set(n?t.map(t=>t.id===e.id?e:t):[...t,e]),N(),l(e))}function te(e){S||e.projectId!==E?.snapshot()?.id||y.has(b(e.projectId,e.id))||!d.get().some(t=>t.id===e.id)&&d.get().length>=100||I(e)}async function ne(e){let{document:t,session:n,placement:i,storage:l}=await F,f=t.snapshot();if(S||!f||f.id!==e.projectId)throw Error(`The video editor project changed`);let p=f.scenes.find(e=>e.id===f.activeSceneId),m=n.currentTime.get(),h=new Set(n.selection.get().clipIds),g=p?.tracks.find(e=>!e.locked&&!e.hidden&&(!e.clips.length||e.clips.some(e=>e.kind!==`audio`))&&e.clips.some(e=>h.has(e.id)))??p?.tracks.find(e=>!e.locked&&!e.hidden&&(!e.clips.length||e.clips.some(e=>e.kind!==`audio`))&&e.clips.some(e=>e.timeRange.start<=m&&m<e.timeRange.start+e.timeRange.duration)),_=await r({fetchResult:o.fetchResultFile,rememberSource:o.mediaSources?.remember,importFile:l.importFile.bind(l),snapshot:()=>S?null:t.snapshot(),placement:i,commit:T,execute:(e,t)=>a.commands.execute(e,t),playhead:()=>m,insertion:{afterPlayhead:!0,preferredTrackId:g?.id},select:r=>{n.setSelection({clipIds:[r]});let i=t.snapshot()?.scenes.find(e=>e.id===f.activeSceneId)?.tracks.flatMap(e=>e.clips).find(e=>e.id===r);i&&(n.pause(),n.seek(i.timeRange.start),n.setTimelineView({scrollX:Math.max(0,i.timeRange.start*n.timelineView.get().pxPerSecond-24)}),s(t,f.id,r),c(a,f,[{kind:e.kind}]))}},e);if(!_.ok)throw Error(_.message);u(e.id),x(e.projectId,e.id),d.set(d.get().filter(t=>t.id!==e.id||t.projectId!==e.projectId)),N()}function re(e,t=`video`){return C||(C=F.then(async({document:n})=>{let r=n.snapshot()?.id;if(S||!r)throw Error(`Open a video editor project first`);let i=k===null,a=t===`image`&&A===void 0;a&&(A=Date.now(),D?.(),D=void 0),i&&(k=Date.now(),D?.(),D=void 0),(i||a)&&(N(),P(r));try{await e()}catch(e){throw a&&O===r&&(A=void 0,D?.(),D=void 0,i||P(r),N()),i&&O===r&&(D?.(),D=void 0,k=null,p.set(null),N(),P(r)),e}}).finally(()=>{C=void 0}),C)}return{items:d,importing:f,syncError:p,selectedId:m,creationDraft:h,select(e){!S&&d.get().some(t=>t.id===e)&&(m.set(e),N())},sendRequest:re,async createMedia(e,t){let{document:n}=await F,r=n.snapshot()?.id;if(S||!r)throw Error(`Open a video editor project first`);(h.get()?.kind!==e||t!==void 0)&&h.set({projectId:r,kind:e,prompt:t})},submitVideos(e,t){let n=g.get(e);if(n)return n;let r=F.then(async({document:n})=>{if(S||n.snapshot()?.id!==e)throw Error(`The video editor project changed`);let r=await t();if(!r.length)return;let i=o.submittedVideos(r,e);if(!S&&n.snapshot()?.id===e){i.forEach(te),m.set(i[0].id),N(),P(e);return}let a=_.get(e),s=new Set(a?.dismissed),c=new Map(a?.items.map(e=>[e.id,e]));for(let t of i)s.has(b(e,t.id))||c.set(t.id,t);_.set(e,{startedAt:a?.startedAt??null,imageStartedAt:a?.imageStartedAt,items:[...c.values()].slice(-100),dismissed:a?.dismissed??[],selectedId:i[0].id})}).finally(()=>g.delete(e));return g.set(e,r),r},accept(e){let t=v.get(e);if(t)return t;if(y.has(b(E?.snapshot()?.id,e)))return Promise.resolve();let n=d.get().find(t=>t.id===e);if(!n||n.status!==`completed`||!n.resultUrl)return Promise.reject(Error(`Video is not ready to add`));f.set([...f.get(),e]);let r=ne(n).finally(()=>{v.delete(e),f.set(f.get().filter(t=>t!==e))});return v.set(e,r),r},async refresh(e){let t=d.get().find(t=>t.id===e);if(!t||S||t.projectId!==E?.snapshot()?.id)return;let n=await o.getJob(e);!S&&t.projectId===E?.snapshot()?.id&&te({...n,projectId:t.projectId})},dismiss(e){v.has(e)||(x(E?.snapshot()?.id,e),d.set(d.get().filter(t=>t.id!==e)),N())},dispose(){S=!0,D?.(),j?.(),ee?.dispose()}}}var d;function f(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var p=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},m=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(d=globalThis).__zod_globalConfig??(d.__zod_globalConfig={});var h=globalThis.__zod_globalConfig;function g(e){return e&&Object.assign(h,e),h}function _(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 v(e,t){return typeof t==`bigint`?t.toString():t}function y(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function b(e){return e==null}function x(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function S(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var C=Symbol(`evaluating`);function w(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==C)return r===void 0&&(r=C,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function T(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function E(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function D(e){return JSON.stringify(e)}function ee(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var O=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function k(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var A=y(()=>{if(h.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function j(e){if(k(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return k(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function M(e){return j(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var N=new Set([`string`,`number`,`symbol`]);function P(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function F(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function I(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 te(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var ne={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function re(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 F(e,E(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return T(this,`shape`,e),e},checks:[]}))}function ie(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 F(e,E(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return T(this,`shape`,r),r},checks:[]}))}function ae(e,t){if(!j(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 in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,E(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return T(this,`shape`,n),n}}))}function oe(e,t){if(!j(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return F(e,E(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return T(this,`shape`,n),n}}))}function se(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return F(e,E(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return T(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ce(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return F(t,E(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return T(this,`shape`,i),i},checks:[]}))}function le(e,t,n){return F(t,E(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return T(this,`shape`,i),i}}))}function L(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 ue(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 R(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function de(e){return typeof e==`string`?e:e?.message}function z(e,t,n){let r=e.message?e.message:de(e.inst?._zod.def?.error?.(e))??de(t?.error?.(e))??de(n.customError?.(e))??de(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function fe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function B(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var pe=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,v,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},me=f(`$ZodError`,pe),he=f(`$ZodError`,pe,{Parent:Error});function ge(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function _e(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];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var ve=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new p;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>z(e,a,g())));throw O(t,i?.callee),t}return o.value},ye=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>z(e,a,g())));throw O(t,i?.callee),t}return o.value},be=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 p;return a.issues.length?{success:!1,error:new(e??me)(a.issues.map(e=>z(e,i,g())))}:{success:!0,data:a.value}},xe=be(he),Se=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=>z(e,i,g())))}:{success:!0,data:a.value}},Ce=Se(he),we=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ve(e)(t,n,i)},Te=e=>(t,n,r)=>ve(e)(t,n,r),Ee=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ye(e)(t,n,i)},De=e=>async(t,n,r)=>ye(e)(t,n,r),Oe=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return be(e)(t,n,i)},ke=e=>(t,n,r)=>be(e)(t,n,r),Ae=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Se(e)(t,n,i)},je=e=>async(t,n,r)=>Se(e)(t,n,r),Me=/^[cC][0-9a-z]{6,}$/,Ne=/^[0-9a-z]+$/,Pe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fe=/^[0-9a-vA-V]{20}$/,Ie=/^[A-Za-z0-9]{27}$/,Le=/^[a-zA-Z0-9_-]{21}$/,Re=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ze=/^([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})$/,Be=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)$/,Ve=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,He=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Ue(){return new RegExp(He,`u`)}var We=/^(?:(?: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])$/,Ge=/^(([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}|:))$/,Ke=/^((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])$/,qe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Je=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ye=/^[A-Za-z0-9_-]*$/,Xe=/^https?$/,Ze=/^\+[1-9]\d{6,14}$/,Qe=`(?:(?:\\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])))`,$e=RegExp(`^${Qe}$`);function et(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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tt(e){return RegExp(`^${et(e)}$`)}function nt(e){let t=et({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Qe}T(?:${r})$`)}var rt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},it=/^-?\d+$/,at=/^-?\d+(?:\.\d+)?$/,ot=/^(?:true|false)$/i,st=/^null$/i,ct=/^[^A-Z]*$/,lt=/^[^a-z]*$/,V=f(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ut={number:`number`,bigint:`bigint`,object:`date`},dt=f(`$ZodCheckLessThan`,(e,t)=>{V.init(e,t);let n=ut[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: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})}}),ft=f(`$ZodCheckGreaterThan`,(e,t)=>{V.init(e,t);let n=ut[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: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})}}),pt=f(`$ZodCheckMultipleOf`,(e,t)=>{V.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`?n.value%t.value===BigInt(0):S(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})}}),mt=f(`$ZodCheckNumberFormat`,(e,t)=>{V.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ne[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=it)}),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})}}),ht=f(`$ZodCheckMaxLength`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!b(t)&&t.length!==void 0}),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;if(r.length<=t.maximum)return;let i=fe(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gt=f(`$ZodCheckMinLength`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!b(t)&&t.length!==void 0}),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;if(r.length>=t.minimum)return;let i=fe(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_t=f(`$ZodCheckLengthEquals`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!b(t)&&t.length!==void 0}),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;if(i===t.length)return;let a=fe(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),vt=f(`$ZodCheckStringFormat`,(e,t)=>{var n,r;V.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=()=>{})}),yt=f(`$ZodCheckRegex`,(e,t)=>{vt.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})}}),bt=f(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ct,vt.init(e,t)}),xt=f(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=lt,vt.init(e,t)}),St=f(`$ZodCheckIncludes`,(e,t)=>{V.init(e,t);let n=P(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})}}),Ct=f(`$ZodCheckStartsWith`,(e,t)=>{V.init(e,t);let n=RegExp(`^${P(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})}}),wt=f(`$ZodCheckEndsWith`,(e,t)=>{V.init(e,t);let n=RegExp(`.*${P(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})}}),Tt=f(`$ZodCheckOverwrite`,(e,t)=>{V.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Et=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}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?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
3
+ `))}},Dt={major:4,minor:4,patch:3},H=f(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Dt;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=L(e),i;for(let a of t){if(a._zod.def.when){if(ue(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new p;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=L(e,t))});else{if(e.issues.length===t)continue;r||=L(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(L(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new p;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new p;return o.then(e=>t(e,r,a))}return t(o,r,a)}}w(e,`~standard`,()=>({validate:t=>{try{let n=xe(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ce(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ot=f(`$ZodString`,(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??rt(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}}),U=f(`$ZodStringFormat`,(e,t)=>{vt.init(e,t),Ot.init(e,t)}),kt=f(`$ZodGUID`,(e,t)=>{t.pattern??=ze,U.init(e,t)}),At=f(`$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??=Be(e)}else t.pattern??=Be();U.init(e,t)}),jt=f(`$ZodEmail`,(e,t)=>{t.pattern??=Ve,U.init(e,t)}),Mt=f(`$ZodURL`,(e,t)=>{U.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Xe.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.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:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Nt=f(`$ZodEmoji`,(e,t)=>{t.pattern??=Ue(),U.init(e,t)}),Pt=f(`$ZodNanoID`,(e,t)=>{t.pattern??=Le,U.init(e,t)}),Ft=f(`$ZodCUID`,(e,t)=>{t.pattern??=Me,U.init(e,t)}),It=f(`$ZodCUID2`,(e,t)=>{t.pattern??=Ne,U.init(e,t)}),Lt=f(`$ZodULID`,(e,t)=>{t.pattern??=Pe,U.init(e,t)}),Rt=f(`$ZodXID`,(e,t)=>{t.pattern??=Fe,U.init(e,t)}),zt=f(`$ZodKSUID`,(e,t)=>{t.pattern??=Ie,U.init(e,t)}),Bt=f(`$ZodISODateTime`,(e,t)=>{t.pattern??=nt(t),U.init(e,t)}),Vt=f(`$ZodISODate`,(e,t)=>{t.pattern??=$e,U.init(e,t)}),Ht=f(`$ZodISOTime`,(e,t)=>{t.pattern??=tt(t),U.init(e,t)}),Ut=f(`$ZodISODuration`,(e,t)=>{t.pattern??=Re,U.init(e,t)}),Wt=f(`$ZodIPv4`,(e,t)=>{t.pattern??=We,U.init(e,t),e._zod.bag.format=`ipv4`}),Gt=f(`$ZodIPv6`,(e,t)=>{t.pattern??=Ge,U.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Kt=f(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ke,U.init(e,t)}),qt=f(`$ZodCIDRv6`,(e,t)=>{t.pattern??=qe,U.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Jt(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Yt=f(`$ZodBase64`,(e,t)=>{t.pattern??=Je,U.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Jt(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Xt(e){if(!Ye.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Jt(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Zt=f(`$ZodBase64URL`,(e,t)=>{t.pattern??=Ye,U.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Xt(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Qt=f(`$ZodE164`,(e,t)=>{t.pattern??=Ze,U.init(e,t)});function $t(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 en=f(`$ZodJWT`,(e,t)=>{U.init(e,t),e._zod.check=n=>{$t(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),tn=f(`$ZodNumber`,(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??at,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:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),nn=f(`$ZodNumberFormat`,(e,t)=>{mt.init(e,t),tn.init(e,t)}),rn=f(`$ZodBoolean`,(e,t)=>{H.init(e,t),e._zod.pattern=ot,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}}),an=f(`$ZodNull`,(e,t)=>{H.init(e,t),e._zod.pattern=st,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),on=f(`$ZodUnknown`,(e,t)=>{H.init(e,t),e._zod.parse=e=>e}),sn=f(`$ZodNever`,(e,t)=>{H.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function cn(e,t,n){e.issues.length&&t.issues.push(...R(n,e.issues)),t.value[n]=e.value}var ln=f(`$ZodArray`,(e,t)=>{H.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>cn(t,n,e))):cn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function un(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...R(n,e.issues))}if(!o&&!i){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}function dn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=te(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function fn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(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=>un(e,n,i,t,u,d))):un(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var pn=f(`$ZodObject`,(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=y(()=>dn(t));w(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=k,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>un(n,t,e,s,r,i))):un(a,t,e,s,r,i)}return i?fn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),mn=f(`$ZodObjectJIT`,(e,t)=>{pn.init(e,t);let n=e._zod.parse,r=y(()=>dn(t)),i=e=>{let t=new Et([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=D(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=D(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
4
+ if (${n}.issues.length) {
5
+ if (${o} in input) {
6
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
7
+ ...iss,
8
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
9
+ })));
10
+ }
11
+ }
12
+
13
+ if (${n}.value === undefined) {
14
+ if (${o} in input) {
15
+ newResult[${o}] = undefined;
16
+ }
17
+ } else {
18
+ newResult[${o}] = ${n}.value;
19
+ }
20
+
21
+ `):c?t.write(`
22
+ if (${n}.issues.length) {
23
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
26
+ })));
27
+ }
28
+
29
+ if (${n}.value === undefined) {
30
+ if (${o} in input) {
31
+ newResult[${o}] = undefined;
32
+ }
33
+ } else {
34
+ newResult[${o}] = ${n}.value;
35
+ }
36
+
37
+ `):t.write(`
38
+ const ${n}_present = ${o} in input;
39
+ if (${n}.issues.length) {
40
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
41
+ ...iss,
42
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
43
+ })));
44
+ }
45
+ if (!${n}_present && !${n}.issues.length) {
46
+ payload.issues.push({
47
+ code: "invalid_type",
48
+ expected: "nonoptional",
49
+ input: undefined,
50
+ path: [${o}]
51
+ });
52
+ }
53
+
54
+ if (${n}_present) {
55
+ if (${n}.value === undefined) {
56
+ newResult[${o}] = undefined;
57
+ } else {
58
+ newResult[${o}] = ${n}.value;
59
+ }
60
+ }
61
+
62
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=k,s=!h.jitless,c=s&&A.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?fn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function hn(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=>!L(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=>z(e,r,g())))}),t)}var gn=f(`$ZodUnion`,(e,t)=>{H.init(e,t),w(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),w(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),w(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),w(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>x(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=>hn(t,r,e,i)):hn(o,r,e,i)}}),_n=f(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,gn.init(e,t);let n=e._zod.parse;w(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=y(()=>{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(!k(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)}}),vn=f(`$ZodIntersection`,(e,t)=>{H.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])=>bn(e,t,n)):bn(e,i,a)}});function yn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(j(e)&&j(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=yn(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=yn(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 bn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),L(e))return e;let o=yn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var xn=f(`$ZodRecord`,(e,t)=>{H.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!j(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>z(e,r,g())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...R(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...R(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&at.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>z(e,r,g())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...R(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...R(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Sn=f(`$ZodEnum`,(e,t)=>{H.init(e,t);let n=_(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>N.has(typeof e)).map(e=>typeof e==`string`?P(e):e.toString()).join(`|`)})$`),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}}),Cn=f(`$ZodLiteral`,(e,t)=>{if(H.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?P(e):e?P(e.toString()):String(e)).join(`|`)})$`),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}}),wn=f(`$ZodTransform`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new m(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.fallback=!0,n));if(i instanceof Promise)throw new p;return n.value=i,n.fallback=!0,n}});function Tn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var En=f(`$ZodOptional`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,w(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),w(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${x(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Tn(e,r)):Tn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Dn=f(`$ZodExactOptional`,(e,t)=>{En.init(e,t),w(e._zod,`values`,()=>t.innerType._zod.values),w(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),On=f(`$ZodNullable`,(e,t)=>{H.init(e,t),w(e._zod,`optin`,()=>t.innerType._zod.optin),w(e._zod,`optout`,()=>t.innerType._zod.optout),w(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${x(e.source)}|null)$`):void 0}),w(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),kn=f(`$ZodDefault`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,w(e._zod,`values`,()=>t.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=>An(e,t)):An(r,t)}});function An(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var jn=f(`$ZodPrefault`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,w(e._zod,`values`,()=>t.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))}),Mn=f(`$ZodNonOptional`,(e,t)=>{H.init(e,t),w(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].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=>Nn(t,e)):Nn(i,e)}});function Nn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Pn=f(`$ZodCatch`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,w(e._zod,`optout`,()=>t.innerType._zod.optout),w(e._zod,`values`,()=>t.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(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>z(e,n,g()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>z(e,n,g()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Fn=f(`$ZodPipe`,(e,t)=>{H.init(e,t),w(e._zod,`values`,()=>t.in._zod.values),w(e._zod,`optin`,()=>t.in._zod.optin),w(e._zod,`optout`,()=>t.out._zod.optout),w(e._zod,`propValues`,()=>t.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=>In(e,t.in,n)):In(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>In(e,t.out,n)):In(r,t.out,n)}});function In(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Ln=f(`$ZodReadonly`,(e,t)=>{H.init(e,t),w(e._zod,`propValues`,()=>t.innerType._zod.propValues),w(e._zod,`values`,()=>t.innerType._zod.values),w(e._zod,`optin`,()=>t.innerType?._zod?.optin),w(e._zod,`optout`,()=>t.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(Rn):Rn(r)}});function Rn(e){return e.value=Object.freeze(e.value),e}var zn=f(`$ZodLazy`,(e,t)=>{H.init(e,t),w(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),w(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),w(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),w(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),w(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Bn=f(`$ZodCustom`,(e,t)=>{V.init(e,t),H.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=>Vn(t,n,r,e));Vn(i,n,r,e)}});function Vn(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(B(e))}}var Hn,Un=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 Wn(){return new Un}(Hn=globalThis).__zod_globalRegistry??(Hn.__zod_globalRegistry=Wn());var W=globalThis.__zod_globalRegistry;function Gn(e,t){return new e({type:`string`,...I(t)})}function Kn(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...I(t)})}function qn(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...I(t)})}function Jn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...I(t)})}function Yn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...I(t)})}function Xn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...I(t)})}function Zn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...I(t)})}function Qn(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...I(t)})}function $n(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...I(t)})}function er(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...I(t)})}function tr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...I(t)})}function nr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...I(t)})}function rr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...I(t)})}function ir(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...I(t)})}function ar(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...I(t)})}function or(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...I(t)})}function sr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...I(t)})}function cr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...I(t)})}function lr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...I(t)})}function ur(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...I(t)})}function dr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...I(t)})}function fr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...I(t)})}function pr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...I(t)})}function mr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...I(t)})}function hr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...I(t)})}function gr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...I(t)})}function _r(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...I(t)})}function vr(e,t){return new e({type:`number`,checks:[],...I(t)})}function yr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...I(t)})}function br(e,t){return new e({type:`boolean`,...I(t)})}function xr(e,t){return new e({type:`null`,...I(t)})}function Sr(e){return new e({type:`unknown`})}function Cr(e,t){return new e({type:`never`,...I(t)})}function wr(e,t){return new dt({check:`less_than`,...I(t),value:e,inclusive:!1})}function Tr(e,t){return new dt({check:`less_than`,...I(t),value:e,inclusive:!0})}function Er(e,t){return new ft({check:`greater_than`,...I(t),value:e,inclusive:!1})}function Dr(e,t){return new ft({check:`greater_than`,...I(t),value:e,inclusive:!0})}function Or(e,t){return new pt({check:`multiple_of`,...I(t),value:e})}function kr(e,t){return new ht({check:`max_length`,...I(t),maximum:e})}function Ar(e,t){return new gt({check:`min_length`,...I(t),minimum:e})}function jr(e,t){return new _t({check:`length_equals`,...I(t),length:e})}function Mr(e,t){return new yt({check:`string_format`,format:`regex`,...I(t),pattern:e})}function Nr(e){return new bt({check:`string_format`,format:`lowercase`,...I(e)})}function Pr(e){return new xt({check:`string_format`,format:`uppercase`,...I(e)})}function Fr(e,t){return new St({check:`string_format`,format:`includes`,...I(t),includes:e})}function Ir(e,t){return new Ct({check:`string_format`,format:`starts_with`,...I(t),prefix:e})}function Lr(e,t){return new wt({check:`string_format`,format:`ends_with`,...I(t),suffix:e})}function G(e){return new Tt({check:`overwrite`,tx:e})}function Rr(e){return G(t=>t.normalize(e))}function zr(){return G(e=>e.trim())}function Br(){return G(e=>e.toLowerCase())}function Vr(){return G(e=>e.toUpperCase())}function Hr(){return G(e=>ee(e))}function Ur(e,t,n){return new e({type:`array`,element:t,...I(n)})}function Wr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...I(n)})}function Gr(e,t){let n=Kr(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(B(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(B(r))}},e(t.value,t)),t);return n}function Kr(e,t){let n=new V({check:`custom`,...I(t)});return n._zod.check=e,n}function qr(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??W,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 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);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&&Object.assign(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 Jr(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);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}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+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>
63
+
64
+ 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}}}function Yr(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)):Object.assign(i,s),Object.assign(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??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);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)}Object.assign(i,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??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}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`)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 Xr=(e,t={})=>n=>{let r=qr({...n,processors:t});return K(e,r),Jr(r,e),Yr(r,e)},J=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=qr({...i??{},target:a,io:t,processors:n});return K(e,o),Jr(o,e),Yr(o,e)},Zr={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Qr=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Zr[s]??s,i.format===``&&delete i.format,s===`time`&&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}))])}},$r=(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`&&(i.multipleOf=c)},ei=(e,t,n,r)=>{n.type=`boolean`},ti=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ni=(e,t,n,r)=>{n.not={}},ri=(e,t,n,r)=>{let i=e._zod.def,a=_(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ii=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);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}},ai=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},oi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},si=(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`]})},ci=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)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]._zod;return t.io===`input`?n.optin===void 0:n.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)},li=(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},ui=(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;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},di=(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)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=K(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=K(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},fi=(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`}]},pi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},mi=(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.default=JSON.parse(JSON.stringify(i.defaultValue))},hi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},gi=(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{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},_i=(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},vi=(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},yi=(e,t,n,r)=>{let i=e._zod.def;K(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},bi=(e,t,n,r)=>{let i=e._zod.innerType;K(i,t,r);let a=t.seen.get(e);a.ref=i},xi=f(`ZodISODateTime`,(e,t)=>{Bt.init(e,t),Q.init(e,t)});function Si(e){return mr(xi,e)}var Ci=f(`ZodISODate`,(e,t)=>{Vt.init(e,t),Q.init(e,t)});function wi(e){return hr(Ci,e)}var Ti=f(`ZodISOTime`,(e,t)=>{Ht.init(e,t),Q.init(e,t)});function Ei(e){return gr(Ti,e)}var Di=f(`ZodISODuration`,(e,t)=>{Ut.init(e,t),Q.init(e,t)});function Oi(e){return _r(Di,e)}var Y=f(`ZodError`,(e,t)=>{me.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>_e(e,t)},flatten:{value:t=>ge(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,v,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,v,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),ki=ve(Y),Ai=ye(Y),ji=be(Y),Mi=Se(Y),Ni=we(Y),Pi=Te(Y),Fi=Ee(Y),Ii=De(Y),Li=Oe(Y),Ri=ke(Y),zi=Ae(Y),Bi=je(Y),Vi=new WeakMap;function X(e,t,n){let r=Object.getPrototypeOf(e),i=Vi.get(r);if(i||(i=new Set,Vi.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Z=f(`ZodType`,(e,t)=>(H.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:J(e,`input`),output:J(e,`output`)}}),e.toJSONSchema=Xr(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>ki(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ji(e,t,n),e.parseAsync=async(t,n)=>Ai(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Mi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ni(e,t,n),e.decode=(t,n)=>Pi(e,t,n),e.encodeAsync=async(t,n)=>Fi(e,t,n),e.decodeAsync=async(t,n)=>Ii(e,t,n),e.safeEncode=(t,n)=>Li(e,t,n),e.safeDecode=(t,n)=>Ri(e,t,n),e.safeEncodeAsync=async(t,n)=>zi(e,t,n),e.safeDecodeAsync=async(t,n)=>Bi(e,t,n),X(e,`ZodType`,{check(...e){let t=this.def;return this.clone(E(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 F(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(lo(e,t))},superRefine(e,t){return this.check(uo(e,t))},overwrite(e){return this.check(G(e))},optional(){return Ua(this)},exactOptional(){return Ga(this)},nullable(){return qa(this)},nullish(){return Ua(qa(this))},nonoptional(e){return $a(this,e)},array(){return wa(this)},or(e){return ka([this,e])},and(e){return Na(this,e)},transform(e){return ro(this,Va(e))},default(e){return Ya(this,e)},prefault(e){return Za(this,e)},catch(e){return to(this,e)},pipe(e){return ro(this,e)},readonly(){return ao(this)},describe(e){let t=this.clone();return W.add(t,{description:e}),t},meta(...e){if(e.length===0)return W.get(this);let t=this.clone();return W.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return W.get(e)?.description},configurable:!0}),e)),Hi=f(`_ZodString`,(e,t)=>{Ot.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qr(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,X(e,`_ZodString`,{regex(...e){return this.check(Mr(...e))},includes(...e){return this.check(Fr(...e))},startsWith(...e){return this.check(Ir(...e))},endsWith(...e){return this.check(Lr(...e))},min(...e){return this.check(Ar(...e))},max(...e){return this.check(kr(...e))},length(...e){return this.check(jr(...e))},nonempty(...e){return this.check(Ar(1,...e))},lowercase(e){return this.check(Nr(e))},uppercase(e){return this.check(Pr(e))},trim(){return this.check(zr())},normalize(...e){return this.check(Rr(...e))},toLowerCase(){return this.check(Br())},toUpperCase(){return this.check(Vr())},slugify(){return this.check(Hr())}})}),Ui=f(`ZodString`,(e,t)=>{Ot.init(e,t),Hi.init(e,t),e.email=t=>e.check(Kn(Gi,t)),e.url=t=>e.check(Qn(Ji,t)),e.jwt=t=>e.check(pr(ua,t)),e.emoji=t=>e.check($n(Xi,t)),e.guid=t=>e.check(qn(Ki,t)),e.uuid=t=>e.check(Jn($,t)),e.uuidv4=t=>e.check(Yn($,t)),e.uuidv6=t=>e.check(Xn($,t)),e.uuidv7=t=>e.check(Zn($,t)),e.nanoid=t=>e.check(er(Zi,t)),e.guid=t=>e.check(qn(Ki,t)),e.cuid=t=>e.check(tr(Qi,t)),e.cuid2=t=>e.check(nr($i,t)),e.ulid=t=>e.check(rr(ea,t)),e.base64=t=>e.check(ur(sa,t)),e.base64url=t=>e.check(dr(ca,t)),e.xid=t=>e.check(ir(ta,t)),e.ksuid=t=>e.check(ar(na,t)),e.ipv4=t=>e.check(or(ra,t)),e.ipv6=t=>e.check(sr(ia,t)),e.cidrv4=t=>e.check(cr(aa,t)),e.cidrv6=t=>e.check(lr(oa,t)),e.e164=t=>e.check(fr(la,t)),e.datetime=t=>e.check(Si(t)),e.date=t=>e.check(wi(t)),e.time=t=>e.check(Ei(t)),e.duration=t=>e.check(Oi(t))});function Wi(e){return Gn(Ui,e)}var Q=f(`ZodStringFormat`,(e,t)=>{U.init(e,t),Hi.init(e,t)}),Gi=f(`ZodEmail`,(e,t)=>{jt.init(e,t),Q.init(e,t)}),Ki=f(`ZodGUID`,(e,t)=>{kt.init(e,t),Q.init(e,t)}),$=f(`ZodUUID`,(e,t)=>{At.init(e,t),Q.init(e,t)});function qi(e){return Jn($,e)}var Ji=f(`ZodURL`,(e,t)=>{Mt.init(e,t),Q.init(e,t)});function Yi(e){return Qn(Ji,e)}var Xi=f(`ZodEmoji`,(e,t)=>{Nt.init(e,t),Q.init(e,t)}),Zi=f(`ZodNanoID`,(e,t)=>{Pt.init(e,t),Q.init(e,t)}),Qi=f(`ZodCUID`,(e,t)=>{Ft.init(e,t),Q.init(e,t)}),$i=f(`ZodCUID2`,(e,t)=>{It.init(e,t),Q.init(e,t)}),ea=f(`ZodULID`,(e,t)=>{Lt.init(e,t),Q.init(e,t)}),ta=f(`ZodXID`,(e,t)=>{Rt.init(e,t),Q.init(e,t)}),na=f(`ZodKSUID`,(e,t)=>{zt.init(e,t),Q.init(e,t)}),ra=f(`ZodIPv4`,(e,t)=>{Wt.init(e,t),Q.init(e,t)}),ia=f(`ZodIPv6`,(e,t)=>{Gt.init(e,t),Q.init(e,t)}),aa=f(`ZodCIDRv4`,(e,t)=>{Kt.init(e,t),Q.init(e,t)}),oa=f(`ZodCIDRv6`,(e,t)=>{qt.init(e,t),Q.init(e,t)}),sa=f(`ZodBase64`,(e,t)=>{Yt.init(e,t),Q.init(e,t)}),ca=f(`ZodBase64URL`,(e,t)=>{Zt.init(e,t),Q.init(e,t)}),la=f(`ZodE164`,(e,t)=>{Qt.init(e,t),Q.init(e,t)}),ua=f(`ZodJWT`,(e,t)=>{en.init(e,t),Q.init(e,t)}),da=f(`ZodNumber`,(e,t)=>{tn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$r(e,t,n,r),X(e,`ZodNumber`,{gt(e,t){return this.check(Er(e,t))},gte(e,t){return this.check(Dr(e,t))},min(e,t){return this.check(Dr(e,t))},lt(e,t){return this.check(wr(e,t))},lte(e,t){return this.check(Tr(e,t))},max(e,t){return this.check(Tr(e,t))},int(e){return this.check(ma(e))},safe(e){return this.check(ma(e))},positive(e){return this.check(Er(0,e))},nonnegative(e){return this.check(Dr(0,e))},negative(e){return this.check(wr(0,e))},nonpositive(e){return this.check(Tr(0,e))},multipleOf(e,t){return this.check(Or(e,t))},step(e,t){return this.check(Or(e,t))},finite(){return this}});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});function fa(e){return vr(da,e)}var pa=f(`ZodNumberFormat`,(e,t)=>{nn.init(e,t),da.init(e,t)});function ma(e){return yr(pa,e)}var ha=f(`ZodBoolean`,(e,t)=>{rn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ei(e,t,n,r)});function ga(e){return br(ha,e)}var _a=f(`ZodNull`,(e,t)=>{an.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ti(e,t,n,r)});function va(e){return xr(_a,e)}var ya=f(`ZodUnknown`,(e,t)=>{on.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ba(){return Sr(ya)}var xa=f(`ZodNever`,(e,t)=>{sn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ni(e,t,n,r)});function Sa(e){return Cr(xa,e)}var Ca=f(`ZodArray`,(e,t)=>{ln.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r),e.element=t.element,X(e,`ZodArray`,{min(e,t){return this.check(Ar(e,t))},nonempty(e){return this.check(Ar(1,e))},max(e,t){return this.check(kr(e,t))},length(e,t){return this.check(jr(e,t))},unwrap(){return this.element}})});function wa(e,t){return Ur(Ca,e,t)}var Ta=f(`ZodObject`,(e,t)=>{mn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r),w(e,`shape`,()=>t.shape),X(e,`ZodObject`,{keyof(){return La(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:ba()})},loose(){return this.clone({...this._zod.def,catchall:ba()})},strict(){return this.clone({...this._zod.def,catchall:Sa()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ae(this,e)},safeExtend(e){return oe(this,e)},merge(e){return se(this,e)},pick(e){return re(this,e)},omit(e){return ie(this,e)},partial(...e){return ce(Ha,this,e[0])},required(...e){return le(Qa,this,e[0])}})});function Ea(e,t){return new Ta({type:`object`,shape:e??{},...I(t)})}function Da(e,t){return new Ta({type:`object`,shape:e,catchall:ba(),...I(t)})}var Oa=f(`ZodUnion`,(e,t)=>{gn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r),e.options=t.options});function ka(e,t){return new Oa({type:`union`,options:e,...I(t)})}var Aa=f(`ZodDiscriminatedUnion`,(e,t)=>{Oa.init(e,t),_n.init(e,t)});function ja(e,t,n){return new Aa({type:`union`,options:t,discriminator:e,...I(n)})}var Ma=f(`ZodIntersection`,(e,t)=>{vn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r)});function Na(e,t){return new Ma({type:`intersection`,left:e,right:t})}var Pa=f(`ZodRecord`,(e,t)=>{xn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Fa(e,t,n){return!t||!t._zod?new Pa({type:`record`,keyType:Wi(),valueType:e,...I(t)}):new Pa({type:`record`,keyType:e,valueType:t,...I(n)})}var Ia=f(`ZodEnum`,(e,t)=>{Sn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ri(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 Ia({...t,checks:[],...I(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 Ia({...t,checks:[],...I(r),entries:i})}});function La(e,t){return new Ia({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...I(t)})}var Ra=f(`ZodLiteral`,(e,t)=>{Cn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ii(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 za(e,t){return new Ra({type:`literal`,values:Array.isArray(e)?e:[e],...I(t)})}var Ba=f(`ZodTransform`,(e,t)=>{wn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new m(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(B(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(B(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Va(e){return new Ba({type:`transform`,transform:e})}var Ha=f(`ZodOptional`,(e,t)=>{En.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ua(e){return new Ha({type:`optional`,innerType:e})}var Wa=f(`ZodExactOptional`,(e,t)=>{Dn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ga(e){return new Wa({type:`optional`,innerType:e})}var Ka=f(`ZodNullable`,(e,t)=>{On.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qa(e){return new Ka({type:`nullable`,innerType:e})}var Ja=f(`ZodDefault`,(e,t)=>{kn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ya(e,t){return new Ja({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():M(t)}})}var Xa=f(`ZodPrefault`,(e,t)=>{jn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Za(e,t){return new Xa({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():M(t)}})}var Qa=f(`ZodNonOptional`,(e,t)=>{Mn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $a(e,t){return new Qa({type:`nonoptional`,innerType:e,...I(t)})}var eo=f(`ZodCatch`,(e,t)=>{Pn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function to(e,t){return new eo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var no=f(`ZodPipe`,(e,t)=>{Fn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),e.in=t.in,e.out=t.out});function ro(e,t){return new no({type:`pipe`,in:e,out:t})}var io=f(`ZodReadonly`,(e,t)=>{Ln.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e){return new io({type:`readonly`,innerType:e})}var oo=f(`ZodLazy`,(e,t)=>{zn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function so(e){return new oo({type:`lazy`,getter:e})}var co=f(`ZodCustom`,(e,t)=>{Bn.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ai(e,t,n,r)});function lo(e,t={}){return Wr(co,e,t)}function uo(e,t){return Gr(e,t)}function fo(e){let t=so(()=>ka([Wi(e),fa(),ga(),va(),wa(t),Fa(Wi(),t)]));return t}export{u as _,fo as a,o as b,fa as c,Wi as d,ka as f,l as g,qi as h,ja as i,Ea as l,Yi as m,wa as n,za as o,ba as p,ga as r,Da as s,La as t,Fa as u,c as v,s as y};
@@ -0,0 +1 @@
1
+ var e=`capability:editor/session`,t=`capability:engine.player`,n=[1,2,4,8,16],r=`session/play`,i=`session/pause`,a=`session/seek`,o=`session/selection`,s=`session/tool`,c=`session/clipboard`;export{r as a,s as c,i,n as l,t as n,a as o,c as r,o as s,e as t};
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./jsx-runtime-B5yqYJvp.js";function t(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e!=`string`)return;let n=e.trim();if(n===``)return;let r=/^(-?\d+(?:\.\d+)?)f$/i.exec(n);if(r)return Number(r[1])/t;if(n.includes(`:`)){let e=n.startsWith(`-`),t=n.replace(/^-/,``).split(`:`);if(t.length<2||t.length>3||t.some(e=>!/^\d+(?:\.\d+)?$/.test(e)))return;let r=t.map(Number).reduce((e,t)=>e*60+t,0);return e?-r:r}return/^-?\d+(?:\.\d+)?$/.test(n)?Number(n):void 0}function n(e){throw Error(`${e}() only works inside a project mounted by higgsedit`)}function r(){return n(`useTicker`)}function i(){return n(`useResolution`)}function a(e){return n(`useLocalTime("${e}")`)}var o=[`number`,`color`,`text`,`font`,`boolean`,`select`],s=class extends Error{},c=new Set([`min`,`max`,`step`]),l=new Set([...c,`options`,`path`,`label`]),u=e=>o.includes(e);function d(e){if(!e.startsWith(`/**`))return;let t=e.slice(3).replace(/\*\/$/,``);for(let e of t.split(`
2
+ `)){let t=e.replace(/^\s*\*?\s*/,``),n=/^@inspect(?=\s|$)/.exec(t);if(n)return t.slice(n[0].length)}}function f(e){let t=[],n=[],r=0,i=()=>e[r]??``;for(;r<e.length;){if(/\s/.test(i())){r++;continue}let a=r;for(;r<e.length&&!/[\s=]/.test(i());)r++;let o=e.slice(a,r);if(i()!==`=`){t.push(o);continue}r++;let c;if(i()===`"`){let t=e.indexOf(`"`,r+1);if(t<0)throw new s(`@inspect: unclosed quote after ${o}=`);c=e.slice(r+1,t),r=t+1}else{let t=r;for(;r<e.length&&!/\s/.test(i());)r++;c=e.slice(t,r)}n.push([o,c])}return{words:t,pairs:n}}function p(e){let t=d(e);if(t===void 0)return;let{words:n,pairs:r}=f(t),[i,...a]=n;if(!i)throw new s(`@inspect: say which control (${o.join(`, `)})`);if(!u(i))throw new s(`@inspect: "${i}" is not a control type (${o.join(`, `)})`);if(a.length)throw new s(`@inspect: "${a.join(` `)}" is not a key=value option`);let p={type:i},m=new Set;for(let[e,t]of r){if(!l.has(e))throw new s(`@inspect: no option called "${e}" (known: min, max, step, options, path, label)`);if(m.has(e))throw new s(`@inspect: ${e}= appears more than once`);if(m.add(e),c.has(e)){if(i!==`number`)throw new s(`@inspect: ${e}= is for number controls`);let n=t.trim()===``?NaN:Number(t);if(!Number.isFinite(n))throw new s(`@inspect: ${e}=${t} is not a number`);p[e]=n}else if(e===`options`){if(i!==`select`)throw new s(`@inspect: options= is for select controls`);p.options=t.split(`,`).map(e=>e.trim()).filter(Boolean)}else if(e===`path`){if(p.path=t.split(`/`).map(e=>e.trim()).filter(Boolean),!p.path.length)throw new s(`@inspect: path= is empty`)}else{if(!t.trim())throw new s(`@inspect: label= is empty`);p.label=t.trim()}}if(p.path&&p.label!==void 0)throw new s(`@inspect: use path= or label=, not both (a path ends in its label)`);if(p.min!==void 0&&p.max!==void 0&&p.min>p.max)throw new s(`@inspect: min ${p.min} is above max ${p.max}`);if(p.step!==void 0&&p.step<=0)throw new s(`@inspect: "step" must be above 0`);if(i===`select`&&(p.options?.length??0)<2)throw new s(`@inspect select needs at least two options: options="a,b"`);return p}function m(e,t){switch(e.type){case`number`:return typeof t==`number`?Number.isFinite(t)?void 0:`@inspect number needs a finite number`:`@inspect number needs a number literal`;case`boolean`:return typeof t==`boolean`?void 0:`@inspect boolean needs true or false`;case`select`:return typeof t==`string`?e.options?.includes(t)?void 0:`"${t}" is not one of ${e.options?.join(`, `)}`:`@inspect select needs a string literal`;default:return typeof t==`string`?void 0:`@inspect ${e.type} needs a string literal`}}function h(e){let[t=``,...n]=e.match(/[A-Z]+(?![a-z])|[A-Z]?[a-z\d]+/g)??[e];return[t.charAt(0).toUpperCase()+t.slice(1),...n].join(` `)}function g(e,t){return t.path?{label:t.path.at(-1),group:t.path.slice(0,-1)}:{label:t.label??h(e),group:[]}}var _=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),v=new Set([`rect`,`text`,`image`]),y=`svg:`,b=e=>e.startsWith(`svg:`)||_.has(e)&&!v.has(e);function x(e,t){if(!v.has(e))return!1;for(let e of t)if(b(e))return!0;return!1}var S=e({CAPTION_ALIGNS:()=>T,CAPTION_PRESETS:()=>w,EASINGS:()=>D,INSPECT_TYPES:()=>o,INTRINSICS:()=>C,InspectTagError:()=>s,SVG_PREFIX:()=>y,TRANSITION_TYPES:()=>O,inspectMismatch:()=>m,inspectPresentation:()=>g,isIntrinsic:()=>E,isSvgContent:()=>x,isSvgTag:()=>b,parseTime:()=>t,readInspectTag:()=>p,useLocalTime:()=>a,useResolution:()=>i,useTicker:()=>r}),C=[`stage`,`scene`,`group`,`rect`,`text`,`image`,`video`,`audio`,`sequence`,`captions`,`textRange`,`adjustmentLayer`,`surface`,`html`,`shaderPaint`],w=[`classic`,`whisper`,`cascade`,`spotlight`,`paper`,`guinea`,`stark`],T=[`top`,`center`,`bottom`],E=e=>C.includes(e),D=[`linear`,`easeIn`,`easeOut`,`easeInOut`,`step`],O=[`dissolve`,`slideFromRight`,`slideFromLeft`,`fadeToBlack`,`fadeToWhite`,`whipPan`,`zoomThrough`,`pixelDissolve`];export{E as a,b as c,t as d,O as i,m as l,w as n,S as o,C as r,y as s,T as t,g as u};