@jucie.io/cli 1.0.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 (704) hide show
  1. package/dist/jucie.js +322 -0
  2. package/dist/stage/chunks/addAction-FSI6BXB4.js +1 -0
  3. package/dist/stage/chunks/addAnimationBinding-Y4VROY4L.js +1 -0
  4. package/dist/stage/chunks/addAttribute-CNJGHQSS.js +1 -0
  5. package/dist/stage/chunks/addComponent-VWD6O7CQ.js +1 -0
  6. package/dist/stage/chunks/addComputed-FQVHDUIE.js +1 -0
  7. package/dist/stage/chunks/addEvent-54ZE2DVJ.js +1 -0
  8. package/dist/stage/chunks/addLifecycleHook-VCCSTQ3G.js +1 -0
  9. package/dist/stage/chunks/addNode-AOA2MS25.js +1 -0
  10. package/dist/stage/chunks/addOption-ISGTUY6U.js +1 -0
  11. package/dist/stage/chunks/addParamToRoute-CRDV7MVF.js +1 -0
  12. package/dist/stage/chunks/addState-N3MBR533.js +1 -0
  13. package/dist/stage/chunks/addStore-PHY52777.js +1 -0
  14. package/dist/stage/chunks/addToken-QSTDKYFU.js +1 -0
  15. package/dist/stage/chunks/addValue-NBDF57UK.js +1 -0
  16. package/dist/stage/chunks/aiRelay-FSM6HGF7.js +1 -0
  17. package/dist/stage/chunks/assets-OAQXQVKM.js +1 -0
  18. package/dist/stage/chunks/bootstrap-LFMD2YRN.js +15 -0
  19. package/dist/stage/chunks/chunk-2SXGPNIX.js +1 -0
  20. package/dist/stage/chunks/chunk-2YZN7IFG.js +1 -0
  21. package/dist/stage/chunks/chunk-32FG2JVJ.js +1 -0
  22. package/dist/stage/chunks/chunk-32WBU6VH.js +1 -0
  23. package/dist/stage/chunks/chunk-45CXRNTO.js +1 -0
  24. package/dist/stage/chunks/chunk-45LFQ7GZ.js +1 -0
  25. package/dist/stage/chunks/chunk-4FPLUVEY.js +1 -0
  26. package/dist/stage/chunks/chunk-4MTM6BM7.js +1 -0
  27. package/dist/stage/chunks/chunk-4VALYMSL.js +1 -0
  28. package/dist/stage/chunks/chunk-4XNQRZ5E.js +1 -0
  29. package/dist/stage/chunks/chunk-4Y2YKFNP.js +1 -0
  30. package/dist/stage/chunks/chunk-5GOTVZFC.js +1 -0
  31. package/dist/stage/chunks/chunk-5OOKGI32.js +3 -0
  32. package/dist/stage/chunks/chunk-5PUPZLDN.js +1 -0
  33. package/dist/stage/chunks/chunk-5SOTDESD.js +1 -0
  34. package/dist/stage/chunks/chunk-5YRZZCXL.js +1 -0
  35. package/dist/stage/chunks/chunk-6EIGTDJQ.js +1 -0
  36. package/dist/stage/chunks/chunk-6GMURG26.js +1 -0
  37. package/dist/stage/chunks/chunk-6ZZBJPN5.js +1 -0
  38. package/dist/stage/chunks/chunk-73MAM44D.js +1 -0
  39. package/dist/stage/chunks/chunk-7L4V7JRT.js +1 -0
  40. package/dist/stage/chunks/chunk-AJVQKPCQ.js +1 -0
  41. package/dist/stage/chunks/chunk-AMAA7VJU.js +1 -0
  42. package/dist/stage/chunks/chunk-ARGFDBBK.js +1 -0
  43. package/dist/stage/chunks/chunk-BEYPHEBR.js +1 -0
  44. package/dist/stage/chunks/chunk-BS35FNXF.js +1 -0
  45. package/dist/stage/chunks/chunk-BVAPODQ7.js +5 -0
  46. package/dist/stage/chunks/chunk-C3DY5XVP.js +1 -0
  47. package/dist/stage/chunks/chunk-CUIKYKRZ.js +1 -0
  48. package/dist/stage/chunks/chunk-CVDUFBBG.js +1 -0
  49. package/dist/stage/chunks/chunk-D3V5OTLH.js +1 -0
  50. package/dist/stage/chunks/chunk-D6NZE747.js +1 -0
  51. package/dist/stage/chunks/chunk-DCOWKGJI.js +1 -0
  52. package/dist/stage/chunks/chunk-DSKLC3WF.js +1 -0
  53. package/dist/stage/chunks/chunk-EO7UBT4B.js +1 -0
  54. package/dist/stage/chunks/chunk-EPBR3BES.js +1 -0
  55. package/dist/stage/chunks/chunk-FSECMWCM.js +1 -0
  56. package/dist/stage/chunks/chunk-FTRUORC5.js +1 -0
  57. package/dist/stage/chunks/chunk-GDGHGTYN.js +1 -0
  58. package/dist/stage/chunks/chunk-GG4NWMR6.js +1 -0
  59. package/dist/stage/chunks/chunk-GIVV5ZCM.js +1 -0
  60. package/dist/stage/chunks/chunk-H3VC542J.js +1 -0
  61. package/dist/stage/chunks/chunk-HBEU7BDR.js +1 -0
  62. package/dist/stage/chunks/chunk-HBEWYDHO.js +1 -0
  63. package/dist/stage/chunks/chunk-HI7ALMQD.js +1 -0
  64. package/dist/stage/chunks/chunk-JKMOVSI4.js +1 -0
  65. package/dist/stage/chunks/chunk-K6PCHHH7.js +1 -0
  66. package/dist/stage/chunks/chunk-K7MC6G4X.js +1 -0
  67. package/dist/stage/chunks/chunk-KCVDFPJI.js +1 -0
  68. package/dist/stage/chunks/chunk-L4CU73MS.js +1 -0
  69. package/dist/stage/chunks/chunk-L7VQYHXR.js +1 -0
  70. package/dist/stage/chunks/chunk-LKQDYABR.js +1 -0
  71. package/dist/stage/chunks/chunk-LOILFK74.js +55 -0
  72. package/dist/stage/chunks/chunk-LR6DSVPP.js +1 -0
  73. package/dist/stage/chunks/chunk-MLL2ANA6.js +1 -0
  74. package/dist/stage/chunks/chunk-MXIF2FGR.js +1 -0
  75. package/dist/stage/chunks/chunk-N4AFW5M3.js +1 -0
  76. package/dist/stage/chunks/chunk-ODSNVDNS.js +1 -0
  77. package/dist/stage/chunks/chunk-OPVVANFS.js +1 -0
  78. package/dist/stage/chunks/chunk-OQ52NUNN.js +1 -0
  79. package/dist/stage/chunks/chunk-OWARHUEW.js +1 -0
  80. package/dist/stage/chunks/chunk-P3WBUN2B.js +1 -0
  81. package/dist/stage/chunks/chunk-P4ODI2G4.js +1 -0
  82. package/dist/stage/chunks/chunk-PSNKOX4A.js +37 -0
  83. package/dist/stage/chunks/chunk-PU3DZ3MV.js +1 -0
  84. package/dist/stage/chunks/chunk-QCZ4EDGZ.js +1 -0
  85. package/dist/stage/chunks/chunk-QG2BGE2O.js +1 -0
  86. package/dist/stage/chunks/chunk-QTBRJH2Q.js +1 -0
  87. package/dist/stage/chunks/chunk-RWJ7EPNM.js +1 -0
  88. package/dist/stage/chunks/chunk-RZ74UWF3.js +1 -0
  89. package/dist/stage/chunks/chunk-SECM4LZZ.js +1 -0
  90. package/dist/stage/chunks/chunk-SMO45CB3.js +1 -0
  91. package/dist/stage/chunks/chunk-SRRJXNKG.js +1 -0
  92. package/dist/stage/chunks/chunk-TBDEUSP4.js +1 -0
  93. package/dist/stage/chunks/chunk-TEUB5MUS.js +1 -0
  94. package/dist/stage/chunks/chunk-TV4PHWEG.js +1 -0
  95. package/dist/stage/chunks/chunk-U2OFNNHI.js +1 -0
  96. package/dist/stage/chunks/chunk-U3IV5DRQ.js +1 -0
  97. package/dist/stage/chunks/chunk-V4F2T2VR.js +1 -0
  98. package/dist/stage/chunks/chunk-V7BNWQS6.js +1 -0
  99. package/dist/stage/chunks/chunk-X2DYJVYZ.js +1 -0
  100. package/dist/stage/chunks/chunk-X6HJCJ3C.js +1 -0
  101. package/dist/stage/chunks/chunk-XKEDVW6X.js +1 -0
  102. package/dist/stage/chunks/chunk-YMUEID4R.js +1 -0
  103. package/dist/stage/chunks/chunk-YN5VQBDN.js +1 -0
  104. package/dist/stage/chunks/chunk-ZCAGAEP2.js +1 -0
  105. package/dist/stage/chunks/chunk-ZEWKYCOX.js +1 -0
  106. package/dist/stage/chunks/clearDestination-P3FTW7VJ.js +1 -0
  107. package/dist/stage/chunks/clearName-YFCAGL36.js +1 -0
  108. package/dist/stage/chunks/clearOptionsExpression-DF4IPDKH.js +1 -0
  109. package/dist/stage/chunks/clearRender-4YRSLAVX.js +1 -0
  110. package/dist/stage/chunks/clearRepeat-7TPSR6FL.js +1 -0
  111. package/dist/stage/chunks/contentEditor-VMXQHHFX.js +1 -0
  112. package/dist/stage/chunks/createAction-XVCUAVTP.js +1 -0
  113. package/dist/stage/chunks/createAnimation-YAXYGTZ2.js +1 -0
  114. package/dist/stage/chunks/createComputed-6XPJKJMP.js +1 -0
  115. package/dist/stage/chunks/createTextContent-BL7YGYP5.js +1 -0
  116. package/dist/stage/chunks/createValue-QMG7LOR4.js +1 -0
  117. package/dist/stage/chunks/disconnectNode-OY65I4GB.js +1 -0
  118. package/dist/stage/chunks/history-KHLKDDEZ.js +1 -0
  119. package/dist/stage/chunks/id-T5EU463K.js +1 -0
  120. package/dist/stage/chunks/main-3QLLHM43.js +1 -0
  121. package/dist/stage/chunks/main-7EICBMQ2.js +1 -0
  122. package/dist/stage/chunks/main-BLNWJ3UJ.js +1 -0
  123. package/dist/stage/chunks/main-NIVRMJR3.js +1 -0
  124. package/dist/stage/chunks/moveNodeToLastChildOf-PSU5X3UJ.js +1 -0
  125. package/dist/stage/chunks/nodeGraph-7M5JI3VA.js +1 -0
  126. package/dist/stage/chunks/normalizeEventName-6HVMB5GN.js +1 -0
  127. package/dist/stage/chunks/normalizeLayoutContext-NWKVWWWS.js +1 -0
  128. package/dist/stage/chunks/preview-bootstrap-LB3AH2CS.js +1 -0
  129. package/dist/stage/chunks/react-G5SWVCZA.js +1 -0
  130. package/dist/stage/chunks/removeAction-H3EDG2CG.js +1 -0
  131. package/dist/stage/chunks/removeAnimationBinding-JRXL2AOH.js +1 -0
  132. package/dist/stage/chunks/removeAttribute-6RYM7MYC.js +1 -0
  133. package/dist/stage/chunks/removeComputed-3HL3BXKY.js +1 -0
  134. package/dist/stage/chunks/removeEvent-CP3SVSHQ.js +1 -0
  135. package/dist/stage/chunks/removeLifecycleHook-Q76BUDFU.js +1 -0
  136. package/dist/stage/chunks/removeNode-OFMYW2LY.js +1 -0
  137. package/dist/stage/chunks/removeOption-Y6QYTQ7C.js +1 -0
  138. package/dist/stage/chunks/removeParamFromRoute-MHUMB7RO.js +1 -0
  139. package/dist/stage/chunks/removeState-HEDFV7HD.js +1 -0
  140. package/dist/stage/chunks/removeStore-BQDKUY3I.js +1 -0
  141. package/dist/stage/chunks/removeToken-CKODWTLX.js +1 -0
  142. package/dist/stage/chunks/removeValue-OTRFOOIB.js +1 -0
  143. package/dist/stage/chunks/screen-capture-bootstrap-BRQD4OSY.js +1 -0
  144. package/dist/stage/chunks/setDestination-3H4RDE7F.js +1 -0
  145. package/dist/stage/chunks/setHomePage-UZUWIELK.js +1 -0
  146. package/dist/stage/chunks/setHtmlId-V2DQ2Z6D.js +1 -0
  147. package/dist/stage/chunks/setName-QKDRLH7I.js +1 -0
  148. package/dist/stage/chunks/setNodeLayout-3LRJGZNL.js +1 -0
  149. package/dist/stage/chunks/setOptionsExpression-4NFPAI24.js +1 -0
  150. package/dist/stage/chunks/setRender-XQJWRRYD.js +1 -0
  151. package/dist/stage/chunks/setRepeat-PAW7YMSY.js +1 -0
  152. package/dist/stage/chunks/setTagName-Y7O7I6SO.js +1 -0
  153. package/dist/stage/chunks/updateAction-XSXILF2R.js +1 -0
  154. package/dist/stage/chunks/updateAnimationBinding-LQTVD3O6.js +1 -0
  155. package/dist/stage/chunks/updateAttribute-USA3HPEX.js +1 -0
  156. package/dist/stage/chunks/updateBounds-3L2AJ72O.js +1 -0
  157. package/dist/stage/chunks/updateComputed-UALAJ4RF.js +1 -0
  158. package/dist/stage/chunks/updateEvent-NXMQSGDQ.js +1 -0
  159. package/dist/stage/chunks/updateHtml-AEMCHPUQ.js +1 -0
  160. package/dist/stage/chunks/updateLifecycleHook-6MCUOVJH.js +1 -0
  161. package/dist/stage/chunks/updateOption-JCNXPYXP.js +1 -0
  162. package/dist/stage/chunks/updateRoute-CI3GOLVJ.js +1 -0
  163. package/dist/stage/chunks/updateState-QJID3WQV.js +1 -0
  164. package/dist/stage/chunks/updateStyle-FR7K7R73.js +1 -0
  165. package/dist/stage/chunks/updateToken-JX6R3YU7.js +1 -0
  166. package/dist/stage/chunks/updateValue-2B5ZNGZI.js +1 -0
  167. package/dist/stage/chunks/user-2EMXBDUX.js +1 -0
  168. package/dist/stage/chunks/validateStorePayload-PJ5AD64S.js +3 -0
  169. package/dist/stage/chunks/viewport-UOMSIPMH.js +1 -0
  170. package/dist/stage/chunks/window-KCOIKBXQ.js +1 -0
  171. package/dist/stage/design.js +1 -0
  172. package/dist/stage/dev.js +1 -0
  173. package/dist/stage/preview.js +1 -0
  174. package/dist/stage/prod.js +1 -0
  175. package/dist/stage-bundles/preact/chunks/addAction-5FCPHQHB.js +9 -0
  176. package/dist/stage-bundles/preact/chunks/addAnimationBinding-5UBXLWDB.js +7 -0
  177. package/dist/stage-bundles/preact/chunks/addAttribute-PWIHRX6Y.js +12 -0
  178. package/dist/stage-bundles/preact/chunks/addComponent-77PUZWLS.js +14 -0
  179. package/dist/stage-bundles/preact/chunks/addComputed-5J47SS67.js +9 -0
  180. package/dist/stage-bundles/preact/chunks/addEvent-P2KGVMLM.js +11 -0
  181. package/dist/stage-bundles/preact/chunks/addLifecycleHook-VSOAZGTG.js +8 -0
  182. package/dist/stage-bundles/preact/chunks/addNode-GCJR257S.js +19 -0
  183. package/dist/stage-bundles/preact/chunks/addOption-3U3LAV4C.js +8 -0
  184. package/dist/stage-bundles/preact/chunks/addParamToRoute-43UDJ4YE.js +7 -0
  185. package/dist/stage-bundles/preact/chunks/addState-ZWDA2CLN.js +11 -0
  186. package/dist/stage-bundles/preact/chunks/addStore-A4CRKMPO.js +7 -0
  187. package/dist/stage-bundles/preact/chunks/addToken-7P5NGEG4.js +8 -0
  188. package/dist/stage-bundles/preact/chunks/addValue-VQW7HQX7.js +8 -0
  189. package/dist/stage-bundles/preact/chunks/aiRelay-TFBJ7BF4.js +184 -0
  190. package/dist/stage-bundles/preact/chunks/assets-3W46CFCY.js +42 -0
  191. package/dist/stage-bundles/preact/chunks/bootstrap-VNVZAVV5.js +4080 -0
  192. package/dist/stage-bundles/preact/chunks/chunk-22J4JOPG.js +9 -0
  193. package/dist/stage-bundles/preact/chunks/chunk-236DY7EE.js +92 -0
  194. package/dist/stage-bundles/preact/chunks/chunk-2H2EQ2RG.js +24 -0
  195. package/dist/stage-bundles/preact/chunks/chunk-2Y25YY3N.js +12 -0
  196. package/dist/stage-bundles/preact/chunks/chunk-3MJKS6VX.js +19 -0
  197. package/dist/stage-bundles/preact/chunks/chunk-3NLDBJQD.js +12 -0
  198. package/dist/stage-bundles/preact/chunks/chunk-43L3STHY.js +172 -0
  199. package/dist/stage-bundles/preact/chunks/chunk-4A4WKSGY.js +66 -0
  200. package/dist/stage-bundles/preact/chunks/chunk-5C4ZCCYX.js +421 -0
  201. package/dist/stage-bundles/preact/chunks/chunk-65Q2CFW7.js +18 -0
  202. package/dist/stage-bundles/preact/chunks/chunk-667SIQGW.js +12 -0
  203. package/dist/stage-bundles/preact/chunks/chunk-6B6PKOOA.js +140 -0
  204. package/dist/stage-bundles/preact/chunks/chunk-6BXKZHN6.js +19 -0
  205. package/dist/stage-bundles/preact/chunks/chunk-6E57QUN7.js +21 -0
  206. package/dist/stage-bundles/preact/chunks/chunk-6QYYO5LM.js +12 -0
  207. package/dist/stage-bundles/preact/chunks/chunk-6R3QXFFF.js +47 -0
  208. package/dist/stage-bundles/preact/chunks/chunk-6RLI7CFQ.js +12 -0
  209. package/dist/stage-bundles/preact/chunks/chunk-6TDZGYJG.js +13 -0
  210. package/dist/stage-bundles/preact/chunks/chunk-AI3MQHWR.js +51 -0
  211. package/dist/stage-bundles/preact/chunks/chunk-BWZPEI76.js +18 -0
  212. package/dist/stage-bundles/preact/chunks/chunk-CHZVDVQC.js +8 -0
  213. package/dist/stage-bundles/preact/chunks/chunk-CJOJNMRC.js +8 -0
  214. package/dist/stage-bundles/preact/chunks/chunk-CXATTVPL.js +24 -0
  215. package/dist/stage-bundles/preact/chunks/chunk-CYH47R7O.js +49 -0
  216. package/dist/stage-bundles/preact/chunks/chunk-DBHMBCBM.js +14 -0
  217. package/dist/stage-bundles/preact/chunks/chunk-DCKGUW2M.js +8 -0
  218. package/dist/stage-bundles/preact/chunks/chunk-EB5FGFFG.js +12 -0
  219. package/dist/stage-bundles/preact/chunks/chunk-F6JYAVEC.js +15 -0
  220. package/dist/stage-bundles/preact/chunks/chunk-F77HGOQB.js +8 -0
  221. package/dist/stage-bundles/preact/chunks/chunk-FSIANI7E.js +11 -0
  222. package/dist/stage-bundles/preact/chunks/chunk-FZZDMYBZ.js +12 -0
  223. package/dist/stage-bundles/preact/chunks/chunk-H75SQT4U.js +105 -0
  224. package/dist/stage-bundles/preact/chunks/chunk-HPCVUQI4.js +224 -0
  225. package/dist/stage-bundles/preact/chunks/chunk-I5OE2BAU.js +25863 -0
  226. package/dist/stage-bundles/preact/chunks/chunk-IDGFZWZY.js +13 -0
  227. package/dist/stage-bundles/preact/chunks/chunk-IIIXGKVH.js +17 -0
  228. package/dist/stage-bundles/preact/chunks/chunk-ILZWSEWK.js +19 -0
  229. package/dist/stage-bundles/preact/chunks/chunk-IO3NSIEJ.js +8 -0
  230. package/dist/stage-bundles/preact/chunks/chunk-ISOZDDO2.js +157 -0
  231. package/dist/stage-bundles/preact/chunks/chunk-JDIO27MU.js +8 -0
  232. package/dist/stage-bundles/preact/chunks/chunk-JJVRBJGQ.js +1353 -0
  233. package/dist/stage-bundles/preact/chunks/chunk-K7ZULZJF.js +116 -0
  234. package/dist/stage-bundles/preact/chunks/chunk-KF4MVCJ6.js +13 -0
  235. package/dist/stage-bundles/preact/chunks/chunk-KHURU62K.js +27 -0
  236. package/dist/stage-bundles/preact/chunks/chunk-KKLU24SB.js +33 -0
  237. package/dist/stage-bundles/preact/chunks/chunk-KOBPYD4N.js +8 -0
  238. package/dist/stage-bundles/preact/chunks/chunk-LH4ZDX3T.js +58 -0
  239. package/dist/stage-bundles/preact/chunks/chunk-M3YT4JBL.js +12 -0
  240. package/dist/stage-bundles/preact/chunks/chunk-MAPYANXA.js +8 -0
  241. package/dist/stage-bundles/preact/chunks/chunk-MBN7CVNW.js +4290 -0
  242. package/dist/stage-bundles/preact/chunks/chunk-MMCB6GGX.js +8 -0
  243. package/dist/stage-bundles/preact/chunks/chunk-NCUWZXVZ.js +8 -0
  244. package/dist/stage-bundles/preact/chunks/chunk-O3KQTA3H.js +21 -0
  245. package/dist/stage-bundles/preact/chunks/chunk-OARTKQPG.js +153 -0
  246. package/dist/stage-bundles/preact/chunks/chunk-P7UUT7BU.js +12 -0
  247. package/dist/stage-bundles/preact/chunks/chunk-PHVB7SAE.js +22 -0
  248. package/dist/stage-bundles/preact/chunks/chunk-PKSFATQY.js +10 -0
  249. package/dist/stage-bundles/preact/chunks/chunk-PU2GET2S.js +18 -0
  250. package/dist/stage-bundles/preact/chunks/chunk-QBXKRHK5.js +11 -0
  251. package/dist/stage-bundles/preact/chunks/chunk-QCQXLZJH.js +18 -0
  252. package/dist/stage-bundles/preact/chunks/chunk-QIOKODGT.js +14 -0
  253. package/dist/stage-bundles/preact/chunks/chunk-R5DUYWXP.js +8 -0
  254. package/dist/stage-bundles/preact/chunks/chunk-RCIDQRAS.js +54 -0
  255. package/dist/stage-bundles/preact/chunks/chunk-RI7XWDHX.js +10 -0
  256. package/dist/stage-bundles/preact/chunks/chunk-RZG5LCPH.js +12 -0
  257. package/dist/stage-bundles/preact/chunks/chunk-S4NZQRJJ.js +12 -0
  258. package/dist/stage-bundles/preact/chunks/chunk-S5L2YBXG.js +143 -0
  259. package/dist/stage-bundles/preact/chunks/chunk-SF5BLQ7P.js +14 -0
  260. package/dist/stage-bundles/preact/chunks/chunk-SPTKNGHA.js +14 -0
  261. package/dist/stage-bundles/preact/chunks/chunk-TKHCH4WB.js +35 -0
  262. package/dist/stage-bundles/preact/chunks/chunk-TVB3GD7L.js +8 -0
  263. package/dist/stage-bundles/preact/chunks/chunk-TVGXBOIT.js +18 -0
  264. package/dist/stage-bundles/preact/chunks/chunk-U7U7L7XZ.js +31 -0
  265. package/dist/stage-bundles/preact/chunks/chunk-UFHA3ODE.js +528 -0
  266. package/dist/stage-bundles/preact/chunks/chunk-UHGV762U.js +12 -0
  267. package/dist/stage-bundles/preact/chunks/chunk-V6MKKC23.js +18 -0
  268. package/dist/stage-bundles/preact/chunks/chunk-VK4FEQKG.js +18 -0
  269. package/dist/stage-bundles/preact/chunks/chunk-VZNGMF63.js +12 -0
  270. package/dist/stage-bundles/preact/chunks/chunk-W5CGYUVM.js +8 -0
  271. package/dist/stage-bundles/preact/chunks/chunk-W7QH4UII.js +54 -0
  272. package/dist/stage-bundles/preact/chunks/chunk-WMV5J37V.js +8 -0
  273. package/dist/stage-bundles/preact/chunks/chunk-WXDXWNWW.js +8 -0
  274. package/dist/stage-bundles/preact/chunks/chunk-XKFPCFZH.js +8 -0
  275. package/dist/stage-bundles/preact/chunks/chunk-YCZNHFZA.js +15 -0
  276. package/dist/stage-bundles/preact/chunks/chunk-YEEGISBQ.js +23 -0
  277. package/dist/stage-bundles/preact/chunks/chunk-YM3NAGCN.js +8 -0
  278. package/dist/stage-bundles/preact/chunks/chunk-YMVTSVEM.js +26 -0
  279. package/dist/stage-bundles/preact/chunks/chunk-YXNMNEJV.js +329 -0
  280. package/dist/stage-bundles/preact/chunks/clearDestination-EMCIEDAP.js +7 -0
  281. package/dist/stage-bundles/preact/chunks/clearName-O7J77F77.js +7 -0
  282. package/dist/stage-bundles/preact/chunks/clearOptionsExpression-RGDXKYVX.js +7 -0
  283. package/dist/stage-bundles/preact/chunks/clearRender-DFMNHXXQ.js +7 -0
  284. package/dist/stage-bundles/preact/chunks/clearRepeat-436RGATR.js +7 -0
  285. package/dist/stage-bundles/preact/chunks/contentEditor-NLMG4U5G.js +67 -0
  286. package/dist/stage-bundles/preact/chunks/createAction-CKUAX4TU.js +8 -0
  287. package/dist/stage-bundles/preact/chunks/createAnimation-URI5366N.js +7 -0
  288. package/dist/stage-bundles/preact/chunks/createComputed-I23CA5NX.js +8 -0
  289. package/dist/stage-bundles/preact/chunks/createTextContent-K4G7KNQ5.js +10 -0
  290. package/dist/stage-bundles/preact/chunks/createValue-D5MP2SMM.js +7 -0
  291. package/dist/stage-bundles/preact/chunks/disconnectNode-GM5F3ZMB.js +8 -0
  292. package/dist/stage-bundles/preact/chunks/history-7PFZW7N6.js +51 -0
  293. package/dist/stage-bundles/preact/chunks/id-VSNJWKHU.js +53 -0
  294. package/dist/stage-bundles/preact/chunks/main-GQD7B74Q.js +103 -0
  295. package/dist/stage-bundles/preact/chunks/main-M2BBXKSW.js +154 -0
  296. package/dist/stage-bundles/preact/chunks/main-QDV3BMBP.js +109 -0
  297. package/dist/stage-bundles/preact/chunks/main-QOB4HBIK.js +31 -0
  298. package/dist/stage-bundles/preact/chunks/moveNodeToLastChildOf-Z6JUVLGM.js +12 -0
  299. package/dist/stage-bundles/preact/chunks/nodeGraph-TTOC6H4R.js +53 -0
  300. package/dist/stage-bundles/preact/chunks/normalizeEventName-2JPOX7Y6.js +128 -0
  301. package/dist/stage-bundles/preact/chunks/normalizeLayoutContext-Y44QODFX.js +9 -0
  302. package/dist/stage-bundles/preact/chunks/preact-FCSVXHIZ.js +39 -0
  303. package/dist/stage-bundles/preact/chunks/preview-bootstrap-QHWGL6NH.js +137 -0
  304. package/dist/stage-bundles/preact/chunks/removeAction-PPAIVTW3.js +7 -0
  305. package/dist/stage-bundles/preact/chunks/removeAnimationBinding-UQ24BSXP.js +7 -0
  306. package/dist/stage-bundles/preact/chunks/removeAttribute-P2IDGOQH.js +7 -0
  307. package/dist/stage-bundles/preact/chunks/removeComputed-7C66NNZA.js +7 -0
  308. package/dist/stage-bundles/preact/chunks/removeEvent-KTSOCV4C.js +7 -0
  309. package/dist/stage-bundles/preact/chunks/removeLifecycleHook-NKXLF3QT.js +7 -0
  310. package/dist/stage-bundles/preact/chunks/removeNode-A7C34C42.js +10 -0
  311. package/dist/stage-bundles/preact/chunks/removeOption-6HW62A5Y.js +7 -0
  312. package/dist/stage-bundles/preact/chunks/removeParamFromRoute-LIKPDVU4.js +7 -0
  313. package/dist/stage-bundles/preact/chunks/removeState-PO6J3JYQ.js +7 -0
  314. package/dist/stage-bundles/preact/chunks/removeStore-5ZZ57NHV.js +7 -0
  315. package/dist/stage-bundles/preact/chunks/removeToken-BKJE3U6Q.js +7 -0
  316. package/dist/stage-bundles/preact/chunks/removeValue-5FNPXWNL.js +7 -0
  317. package/dist/stage-bundles/preact/chunks/screen-capture-bootstrap-YWUN6QRP.js +128 -0
  318. package/dist/stage-bundles/preact/chunks/setDestination-DAYIYYIV.js +7 -0
  319. package/dist/stage-bundles/preact/chunks/setHomePage-MHCP4P24.js +7 -0
  320. package/dist/stage-bundles/preact/chunks/setHtmlId-3HYPFT3T.js +7 -0
  321. package/dist/stage-bundles/preact/chunks/setName-OQOO3URG.js +7 -0
  322. package/dist/stage-bundles/preact/chunks/setNodeLayout-PWQS32M2.js +10 -0
  323. package/dist/stage-bundles/preact/chunks/setOptionsExpression-XZZOJPCM.js +8 -0
  324. package/dist/stage-bundles/preact/chunks/setRender-NHXZZGME.js +10 -0
  325. package/dist/stage-bundles/preact/chunks/setRepeat-YZTZFDTQ.js +10 -0
  326. package/dist/stage-bundles/preact/chunks/setTagName-EGPQ66XI.js +7 -0
  327. package/dist/stage-bundles/preact/chunks/updateAction-ZSNXUEQA.js +9 -0
  328. package/dist/stage-bundles/preact/chunks/updateAnimationBinding-X2UXYQKJ.js +7 -0
  329. package/dist/stage-bundles/preact/chunks/updateAttribute-ODXM7YXA.js +12 -0
  330. package/dist/stage-bundles/preact/chunks/updateBounds-PEGOZ4FT.js +7 -0
  331. package/dist/stage-bundles/preact/chunks/updateComputed-6LNN453F.js +9 -0
  332. package/dist/stage-bundles/preact/chunks/updateEvent-ZHCKBJIM.js +11 -0
  333. package/dist/stage-bundles/preact/chunks/updateHtml-6BPU5PRY.js +7 -0
  334. package/dist/stage-bundles/preact/chunks/updateLifecycleHook-JEMQQYM5.js +8 -0
  335. package/dist/stage-bundles/preact/chunks/updateOption-SH33P5WW.js +8 -0
  336. package/dist/stage-bundles/preact/chunks/updateRoute-3RRPY2T5.js +7 -0
  337. package/dist/stage-bundles/preact/chunks/updateState-WRLF4SSC.js +11 -0
  338. package/dist/stage-bundles/preact/chunks/updateStyle-WAPTDAU5.js +7 -0
  339. package/dist/stage-bundles/preact/chunks/updateToken-CFIIILXB.js +7 -0
  340. package/dist/stage-bundles/preact/chunks/updateValue-JTEEC2B6.js +8 -0
  341. package/dist/stage-bundles/preact/chunks/user-ZLGCTRZX.js +44 -0
  342. package/dist/stage-bundles/preact/chunks/validateStorePayload-7A2INWJV.js +61 -0
  343. package/dist/stage-bundles/preact/chunks/viewport-OTNUF4XI.js +21 -0
  344. package/dist/stage-bundles/preact/chunks/window-73DBL24T.js +32 -0
  345. package/dist/stage-bundles/preact/entry.js +85 -0
  346. package/dist/stage-bundles/preact/framework-compat.js +103 -0
  347. package/dist/stage-bundles/preact/framework-hooks.js +35 -0
  348. package/dist/stage-bundles/preact/framework-jsx-runtime.js +102 -0
  349. package/dist/stage-bundles/preact/framework.js +33 -0
  350. package/dist/stage-bundles/preact/sdk.js +44 -0
  351. package/dist/stage-bundles/react/chunks/addAction-UV7MSISB.js +9 -0
  352. package/dist/stage-bundles/react/chunks/addAnimationBinding-M4VWTNNB.js +7 -0
  353. package/dist/stage-bundles/react/chunks/addAttribute-V4C3VUVK.js +12 -0
  354. package/dist/stage-bundles/react/chunks/addComponent-GUOHFGDG.js +14 -0
  355. package/dist/stage-bundles/react/chunks/addComputed-N3SUFIVQ.js +9 -0
  356. package/dist/stage-bundles/react/chunks/addEvent-GQCCRSGP.js +11 -0
  357. package/dist/stage-bundles/react/chunks/addLifecycleHook-GC5MHVSH.js +8 -0
  358. package/dist/stage-bundles/react/chunks/addNode-TX462HCE.js +19 -0
  359. package/dist/stage-bundles/react/chunks/addOption-7T3ZUC3A.js +8 -0
  360. package/dist/stage-bundles/react/chunks/addParamToRoute-Q6Z5A6RQ.js +7 -0
  361. package/dist/stage-bundles/react/chunks/addState-IKDWEJIW.js +11 -0
  362. package/dist/stage-bundles/react/chunks/addStore-SR7UK24M.js +7 -0
  363. package/dist/stage-bundles/react/chunks/addToken-2G5DPV5Z.js +8 -0
  364. package/dist/stage-bundles/react/chunks/addValue-UYM36PD7.js +8 -0
  365. package/dist/stage-bundles/react/chunks/aiRelay-RULC7GEA.js +184 -0
  366. package/dist/stage-bundles/react/chunks/assets-24YGC7SD.js +42 -0
  367. package/dist/stage-bundles/react/chunks/bootstrap-6YUSZ2AL.js +4080 -0
  368. package/dist/stage-bundles/react/chunks/chunk-22J4JOPG.js +9 -0
  369. package/dist/stage-bundles/react/chunks/chunk-236DY7EE.js +92 -0
  370. package/dist/stage-bundles/react/chunks/chunk-2H2EQ2RG.js +24 -0
  371. package/dist/stage-bundles/react/chunks/chunk-2Y25YY3N.js +12 -0
  372. package/dist/stage-bundles/react/chunks/chunk-3BDWFE4Q.js +1353 -0
  373. package/dist/stage-bundles/react/chunks/chunk-3MJKS6VX.js +19 -0
  374. package/dist/stage-bundles/react/chunks/chunk-3NLDBJQD.js +12 -0
  375. package/dist/stage-bundles/react/chunks/chunk-5C4ODH2L.js +198 -0
  376. package/dist/stage-bundles/react/chunks/chunk-5EXNWE4S.js +4290 -0
  377. package/dist/stage-bundles/react/chunks/chunk-65Q2CFW7.js +18 -0
  378. package/dist/stage-bundles/react/chunks/chunk-667SIQGW.js +12 -0
  379. package/dist/stage-bundles/react/chunks/chunk-6B6PKOOA.js +140 -0
  380. package/dist/stage-bundles/react/chunks/chunk-6BXKZHN6.js +19 -0
  381. package/dist/stage-bundles/react/chunks/chunk-6E57QUN7.js +21 -0
  382. package/dist/stage-bundles/react/chunks/chunk-6QYYO5LM.js +12 -0
  383. package/dist/stage-bundles/react/chunks/chunk-6R3QXFFF.js +47 -0
  384. package/dist/stage-bundles/react/chunks/chunk-6RLI7CFQ.js +12 -0
  385. package/dist/stage-bundles/react/chunks/chunk-6TDZGYJG.js +13 -0
  386. package/dist/stage-bundles/react/chunks/chunk-7MWSPEGH.js +172 -0
  387. package/dist/stage-bundles/react/chunks/chunk-A65NYJEZ.js +157 -0
  388. package/dist/stage-bundles/react/chunks/chunk-ABVPSM2D.js +278 -0
  389. package/dist/stage-bundles/react/chunks/chunk-AI3MQHWR.js +51 -0
  390. package/dist/stage-bundles/react/chunks/chunk-BWZPEI76.js +18 -0
  391. package/dist/stage-bundles/react/chunks/chunk-CHZVDVQC.js +8 -0
  392. package/dist/stage-bundles/react/chunks/chunk-CJOJNMRC.js +8 -0
  393. package/dist/stage-bundles/react/chunks/chunk-CXATTVPL.js +24 -0
  394. package/dist/stage-bundles/react/chunks/chunk-DBHMBCBM.js +14 -0
  395. package/dist/stage-bundles/react/chunks/chunk-DCKGUW2M.js +8 -0
  396. package/dist/stage-bundles/react/chunks/chunk-EB5FGFFG.js +12 -0
  397. package/dist/stage-bundles/react/chunks/chunk-F6JYAVEC.js +15 -0
  398. package/dist/stage-bundles/react/chunks/chunk-F77HGOQB.js +8 -0
  399. package/dist/stage-bundles/react/chunks/chunk-FSIANI7E.js +11 -0
  400. package/dist/stage-bundles/react/chunks/chunk-FZZDMYBZ.js +12 -0
  401. package/dist/stage-bundles/react/chunks/chunk-H75SQT4U.js +105 -0
  402. package/dist/stage-bundles/react/chunks/chunk-IDGFZWZY.js +13 -0
  403. package/dist/stage-bundles/react/chunks/chunk-IIIXGKVH.js +17 -0
  404. package/dist/stage-bundles/react/chunks/chunk-ILZWSEWK.js +19 -0
  405. package/dist/stage-bundles/react/chunks/chunk-IO3NSIEJ.js +8 -0
  406. package/dist/stage-bundles/react/chunks/chunk-JDIO27MU.js +8 -0
  407. package/dist/stage-bundles/react/chunks/chunk-K7ZULZJF.js +116 -0
  408. package/dist/stage-bundles/react/chunks/chunk-KF4MVCJ6.js +13 -0
  409. package/dist/stage-bundles/react/chunks/chunk-KHURU62K.js +27 -0
  410. package/dist/stage-bundles/react/chunks/chunk-KKLU24SB.js +33 -0
  411. package/dist/stage-bundles/react/chunks/chunk-KOBPYD4N.js +8 -0
  412. package/dist/stage-bundles/react/chunks/chunk-LH4ZDX3T.js +58 -0
  413. package/dist/stage-bundles/react/chunks/chunk-M3YT4JBL.js +12 -0
  414. package/dist/stage-bundles/react/chunks/chunk-MAPYANXA.js +8 -0
  415. package/dist/stage-bundles/react/chunks/chunk-MMCB6GGX.js +8 -0
  416. package/dist/stage-bundles/react/chunks/chunk-NCUWZXVZ.js +8 -0
  417. package/dist/stage-bundles/react/chunks/chunk-O3KQTA3H.js +21 -0
  418. package/dist/stage-bundles/react/chunks/chunk-P7UUT7BU.js +12 -0
  419. package/dist/stage-bundles/react/chunks/chunk-PHVB7SAE.js +22 -0
  420. package/dist/stage-bundles/react/chunks/chunk-PKSFATQY.js +10 -0
  421. package/dist/stage-bundles/react/chunks/chunk-PU2GET2S.js +18 -0
  422. package/dist/stage-bundles/react/chunks/chunk-QBXKRHK5.js +11 -0
  423. package/dist/stage-bundles/react/chunks/chunk-QCQXLZJH.js +18 -0
  424. package/dist/stage-bundles/react/chunks/chunk-QIOKODGT.js +14 -0
  425. package/dist/stage-bundles/react/chunks/chunk-QTTED7GZ.js +49 -0
  426. package/dist/stage-bundles/react/chunks/chunk-QVH24VHP.js +473 -0
  427. package/dist/stage-bundles/react/chunks/chunk-R5DUYWXP.js +8 -0
  428. package/dist/stage-bundles/react/chunks/chunk-RCIDQRAS.js +54 -0
  429. package/dist/stage-bundles/react/chunks/chunk-RI7XWDHX.js +10 -0
  430. package/dist/stage-bundles/react/chunks/chunk-RZDFRJVR.js +13065 -0
  431. package/dist/stage-bundles/react/chunks/chunk-RZG5LCPH.js +12 -0
  432. package/dist/stage-bundles/react/chunks/chunk-S4NZQRJJ.js +12 -0
  433. package/dist/stage-bundles/react/chunks/chunk-S5L2YBXG.js +143 -0
  434. package/dist/stage-bundles/react/chunks/chunk-SF5BLQ7P.js +14 -0
  435. package/dist/stage-bundles/react/chunks/chunk-SPTKNGHA.js +14 -0
  436. package/dist/stage-bundles/react/chunks/chunk-TKHCH4WB.js +35 -0
  437. package/dist/stage-bundles/react/chunks/chunk-TVB3GD7L.js +8 -0
  438. package/dist/stage-bundles/react/chunks/chunk-TVGXBOIT.js +18 -0
  439. package/dist/stage-bundles/react/chunks/chunk-U7U7L7XZ.js +31 -0
  440. package/dist/stage-bundles/react/chunks/chunk-UHGV762U.js +12 -0
  441. package/dist/stage-bundles/react/chunks/chunk-V6MKKC23.js +18 -0
  442. package/dist/stage-bundles/react/chunks/chunk-VK4FEQKG.js +18 -0
  443. package/dist/stage-bundles/react/chunks/chunk-VZNGMF63.js +12 -0
  444. package/dist/stage-bundles/react/chunks/chunk-W5CGYUVM.js +8 -0
  445. package/dist/stage-bundles/react/chunks/chunk-W7QH4UII.js +54 -0
  446. package/dist/stage-bundles/react/chunks/chunk-WMV5J37V.js +8 -0
  447. package/dist/stage-bundles/react/chunks/chunk-WXDXWNWW.js +8 -0
  448. package/dist/stage-bundles/react/chunks/chunk-XKFPCFZH.js +8 -0
  449. package/dist/stage-bundles/react/chunks/chunk-XVJJ3LG4.js +528 -0
  450. package/dist/stage-bundles/react/chunks/chunk-YCZNHFZA.js +15 -0
  451. package/dist/stage-bundles/react/chunks/chunk-YEEGISBQ.js +23 -0
  452. package/dist/stage-bundles/react/chunks/chunk-YM3NAGCN.js +8 -0
  453. package/dist/stage-bundles/react/chunks/chunk-YMVTSVEM.js +26 -0
  454. package/dist/stage-bundles/react/chunks/chunk-ZHZLVPR6.js +68 -0
  455. package/dist/stage-bundles/react/chunks/chunk-ZP3VSN3A.js +12093 -0
  456. package/dist/stage-bundles/react/chunks/clearDestination-KO6YHLX2.js +7 -0
  457. package/dist/stage-bundles/react/chunks/clearName-AAUKJ3OX.js +7 -0
  458. package/dist/stage-bundles/react/chunks/clearOptionsExpression-YGCMAZEE.js +7 -0
  459. package/dist/stage-bundles/react/chunks/clearRender-TTNIVIPG.js +7 -0
  460. package/dist/stage-bundles/react/chunks/clearRepeat-AZLSTBXI.js +7 -0
  461. package/dist/stage-bundles/react/chunks/contentEditor-HE34KY6R.js +67 -0
  462. package/dist/stage-bundles/react/chunks/createAction-N6UW7YDP.js +8 -0
  463. package/dist/stage-bundles/react/chunks/createAnimation-RIBXIT62.js +7 -0
  464. package/dist/stage-bundles/react/chunks/createComputed-KKULWYID.js +8 -0
  465. package/dist/stage-bundles/react/chunks/createTextContent-R5YRKNJL.js +10 -0
  466. package/dist/stage-bundles/react/chunks/createValue-SL4Y3LPI.js +7 -0
  467. package/dist/stage-bundles/react/chunks/disconnectNode-J6YACRLT.js +8 -0
  468. package/dist/stage-bundles/react/chunks/history-KTZZH7TG.js +51 -0
  469. package/dist/stage-bundles/react/chunks/id-WBHG2QOH.js +53 -0
  470. package/dist/stage-bundles/react/chunks/main-EMRULEYO.js +103 -0
  471. package/dist/stage-bundles/react/chunks/main-IVVVSUSO.js +109 -0
  472. package/dist/stage-bundles/react/chunks/main-Y7QHSAW7.js +154 -0
  473. package/dist/stage-bundles/react/chunks/main-YSWDZAGN.js +31 -0
  474. package/dist/stage-bundles/react/chunks/moveNodeToLastChildOf-IUKGA7IO.js +12 -0
  475. package/dist/stage-bundles/react/chunks/nodeGraph-GGV7TAPQ.js +53 -0
  476. package/dist/stage-bundles/react/chunks/normalizeEventName-EWVVRI6K.js +128 -0
  477. package/dist/stage-bundles/react/chunks/normalizeLayoutContext-TO4WKUWF.js +9 -0
  478. package/dist/stage-bundles/react/chunks/preview-bootstrap-FVKBRYC5.js +137 -0
  479. package/dist/stage-bundles/react/chunks/react-GONY7QDQ.js +44 -0
  480. package/dist/stage-bundles/react/chunks/removeAction-4PGYJ6CA.js +7 -0
  481. package/dist/stage-bundles/react/chunks/removeAnimationBinding-3SYE7FD3.js +7 -0
  482. package/dist/stage-bundles/react/chunks/removeAttribute-4QEKTGTP.js +7 -0
  483. package/dist/stage-bundles/react/chunks/removeComputed-5J772TBY.js +7 -0
  484. package/dist/stage-bundles/react/chunks/removeEvent-7ODGVHMT.js +7 -0
  485. package/dist/stage-bundles/react/chunks/removeLifecycleHook-3XIZU6TW.js +7 -0
  486. package/dist/stage-bundles/react/chunks/removeNode-DY2ULYNK.js +10 -0
  487. package/dist/stage-bundles/react/chunks/removeOption-V4NBH6EE.js +7 -0
  488. package/dist/stage-bundles/react/chunks/removeParamFromRoute-IMXTBRSZ.js +7 -0
  489. package/dist/stage-bundles/react/chunks/removeState-EBT6YGSZ.js +7 -0
  490. package/dist/stage-bundles/react/chunks/removeStore-UJA67G3O.js +7 -0
  491. package/dist/stage-bundles/react/chunks/removeToken-EDVBR3OL.js +7 -0
  492. package/dist/stage-bundles/react/chunks/removeValue-UPOTPB3T.js +7 -0
  493. package/dist/stage-bundles/react/chunks/screen-capture-bootstrap-XMTHAMIX.js +128 -0
  494. package/dist/stage-bundles/react/chunks/setDestination-M6MQACBQ.js +7 -0
  495. package/dist/stage-bundles/react/chunks/setHomePage-4U4Z3RU7.js +7 -0
  496. package/dist/stage-bundles/react/chunks/setHtmlId-MN7AQG5H.js +7 -0
  497. package/dist/stage-bundles/react/chunks/setName-W4MXGWGB.js +7 -0
  498. package/dist/stage-bundles/react/chunks/setNodeLayout-K2VNUD2H.js +10 -0
  499. package/dist/stage-bundles/react/chunks/setOptionsExpression-KQLKXH4C.js +8 -0
  500. package/dist/stage-bundles/react/chunks/setRender-UJAXCTRA.js +10 -0
  501. package/dist/stage-bundles/react/chunks/setRepeat-X5GZ4F2P.js +10 -0
  502. package/dist/stage-bundles/react/chunks/setTagName-5DMTFJTJ.js +7 -0
  503. package/dist/stage-bundles/react/chunks/updateAction-6KYOHLA3.js +9 -0
  504. package/dist/stage-bundles/react/chunks/updateAnimationBinding-SENX3Z5S.js +7 -0
  505. package/dist/stage-bundles/react/chunks/updateAttribute-VWGV37R7.js +12 -0
  506. package/dist/stage-bundles/react/chunks/updateBounds-WKOI6XJ3.js +7 -0
  507. package/dist/stage-bundles/react/chunks/updateComputed-7QBBBXFC.js +9 -0
  508. package/dist/stage-bundles/react/chunks/updateEvent-4PDSQ3Q4.js +11 -0
  509. package/dist/stage-bundles/react/chunks/updateHtml-EJFF2LPA.js +7 -0
  510. package/dist/stage-bundles/react/chunks/updateLifecycleHook-36JI5KSF.js +8 -0
  511. package/dist/stage-bundles/react/chunks/updateOption-ZEZ4TP7K.js +8 -0
  512. package/dist/stage-bundles/react/chunks/updateRoute-P5OTKOOG.js +7 -0
  513. package/dist/stage-bundles/react/chunks/updateState-B2RIQRWF.js +11 -0
  514. package/dist/stage-bundles/react/chunks/updateStyle-FN7CGZTJ.js +7 -0
  515. package/dist/stage-bundles/react/chunks/updateToken-DMJBW7ZK.js +7 -0
  516. package/dist/stage-bundles/react/chunks/updateValue-6FPRH4CG.js +8 -0
  517. package/dist/stage-bundles/react/chunks/user-MDIKS6ZN.js +44 -0
  518. package/dist/stage-bundles/react/chunks/validateStorePayload-HE65PPAB.js +61 -0
  519. package/dist/stage-bundles/react/chunks/viewport-DKL3EJOU.js +21 -0
  520. package/dist/stage-bundles/react/chunks/window-RCEXDLL7.js +32 -0
  521. package/dist/stage-bundles/react/entry.js +85 -0
  522. package/dist/stage-bundles/react/framework-dom-client.js +22 -0
  523. package/dist/stage-bundles/react/framework-dom.js +21 -0
  524. package/dist/stage-bundles/react/framework-jsx-runtime.js +73 -0
  525. package/dist/stage-bundles/react/framework.js +20 -0
  526. package/dist/stage-bundles/react/sdk.js +49 -0
  527. package/dist/stage-bundles/vue/chunks/addAction-5FCPHQHB.js +9 -0
  528. package/dist/stage-bundles/vue/chunks/addAnimationBinding-5UBXLWDB.js +7 -0
  529. package/dist/stage-bundles/vue/chunks/addAttribute-PWIHRX6Y.js +12 -0
  530. package/dist/stage-bundles/vue/chunks/addComponent-77PUZWLS.js +14 -0
  531. package/dist/stage-bundles/vue/chunks/addComputed-5J47SS67.js +9 -0
  532. package/dist/stage-bundles/vue/chunks/addEvent-P2KGVMLM.js +11 -0
  533. package/dist/stage-bundles/vue/chunks/addLifecycleHook-VSOAZGTG.js +8 -0
  534. package/dist/stage-bundles/vue/chunks/addNode-DMJXP7VV.js +19 -0
  535. package/dist/stage-bundles/vue/chunks/addOption-3U3LAV4C.js +8 -0
  536. package/dist/stage-bundles/vue/chunks/addParamToRoute-43UDJ4YE.js +7 -0
  537. package/dist/stage-bundles/vue/chunks/addState-ZWDA2CLN.js +11 -0
  538. package/dist/stage-bundles/vue/chunks/addStore-A4CRKMPO.js +7 -0
  539. package/dist/stage-bundles/vue/chunks/addToken-7P5NGEG4.js +8 -0
  540. package/dist/stage-bundles/vue/chunks/addValue-VQW7HQX7.js +8 -0
  541. package/dist/stage-bundles/vue/chunks/aiRelay-TFBJ7BF4.js +184 -0
  542. package/dist/stage-bundles/vue/chunks/assets-3W46CFCY.js +42 -0
  543. package/dist/stage-bundles/vue/chunks/bootstrap-Y4GN2FZZ.js +4078 -0
  544. package/dist/stage-bundles/vue/chunks/chunk-22J4JOPG.js +9 -0
  545. package/dist/stage-bundles/vue/chunks/chunk-2H2EQ2RG.js +24 -0
  546. package/dist/stage-bundles/vue/chunks/chunk-2Y25YY3N.js +12 -0
  547. package/dist/stage-bundles/vue/chunks/chunk-3MJKS6VX.js +19 -0
  548. package/dist/stage-bundles/vue/chunks/chunk-3N472G56.js +4290 -0
  549. package/dist/stage-bundles/vue/chunks/chunk-3NLDBJQD.js +12 -0
  550. package/dist/stage-bundles/vue/chunks/chunk-442CZ2YL.js +144 -0
  551. package/dist/stage-bundles/vue/chunks/chunk-44GL4NDX.js +25863 -0
  552. package/dist/stage-bundles/vue/chunks/chunk-4A4WKSGY.js +66 -0
  553. package/dist/stage-bundles/vue/chunks/chunk-4VX5AMMQ.js +54 -0
  554. package/dist/stage-bundles/vue/chunks/chunk-65Q2CFW7.js +18 -0
  555. package/dist/stage-bundles/vue/chunks/chunk-667SIQGW.js +12 -0
  556. package/dist/stage-bundles/vue/chunks/chunk-6BXKZHN6.js +19 -0
  557. package/dist/stage-bundles/vue/chunks/chunk-6E57QUN7.js +21 -0
  558. package/dist/stage-bundles/vue/chunks/chunk-6QYYO5LM.js +12 -0
  559. package/dist/stage-bundles/vue/chunks/chunk-6R3QXFFF.js +47 -0
  560. package/dist/stage-bundles/vue/chunks/chunk-6RLI7CFQ.js +12 -0
  561. package/dist/stage-bundles/vue/chunks/chunk-6TDZGYJG.js +13 -0
  562. package/dist/stage-bundles/vue/chunks/chunk-AI3MQHWR.js +51 -0
  563. package/dist/stage-bundles/vue/chunks/chunk-BWZPEI76.js +18 -0
  564. package/dist/stage-bundles/vue/chunks/chunk-CHZVDVQC.js +8 -0
  565. package/dist/stage-bundles/vue/chunks/chunk-CJOJNMRC.js +8 -0
  566. package/dist/stage-bundles/vue/chunks/chunk-CXATTVPL.js +24 -0
  567. package/dist/stage-bundles/vue/chunks/chunk-DBHMBCBM.js +14 -0
  568. package/dist/stage-bundles/vue/chunks/chunk-DCKGUW2M.js +8 -0
  569. package/dist/stage-bundles/vue/chunks/chunk-EB5FGFFG.js +12 -0
  570. package/dist/stage-bundles/vue/chunks/chunk-F6JYAVEC.js +15 -0
  571. package/dist/stage-bundles/vue/chunks/chunk-F77HGOQB.js +8 -0
  572. package/dist/stage-bundles/vue/chunks/chunk-FSIANI7E.js +11 -0
  573. package/dist/stage-bundles/vue/chunks/chunk-FZZDMYBZ.js +12 -0
  574. package/dist/stage-bundles/vue/chunks/chunk-GI5C7GB7.js +12838 -0
  575. package/dist/stage-bundles/vue/chunks/chunk-H75SQT4U.js +105 -0
  576. package/dist/stage-bundles/vue/chunks/chunk-IDGFZWZY.js +13 -0
  577. package/dist/stage-bundles/vue/chunks/chunk-IIIXGKVH.js +17 -0
  578. package/dist/stage-bundles/vue/chunks/chunk-ILZWSEWK.js +19 -0
  579. package/dist/stage-bundles/vue/chunks/chunk-IO3NSIEJ.js +8 -0
  580. package/dist/stage-bundles/vue/chunks/chunk-IRDAUQG3.js +49 -0
  581. package/dist/stage-bundles/vue/chunks/chunk-ISOZDDO2.js +157 -0
  582. package/dist/stage-bundles/vue/chunks/chunk-IVU4565D.js +26 -0
  583. package/dist/stage-bundles/vue/chunks/chunk-JDIO27MU.js +8 -0
  584. package/dist/stage-bundles/vue/chunks/chunk-JJVRBJGQ.js +1353 -0
  585. package/dist/stage-bundles/vue/chunks/chunk-JKOWPFOY.js +172 -0
  586. package/dist/stage-bundles/vue/chunks/chunk-K7ZULZJF.js +116 -0
  587. package/dist/stage-bundles/vue/chunks/chunk-KF4MVCJ6.js +13 -0
  588. package/dist/stage-bundles/vue/chunks/chunk-KHURU62K.js +27 -0
  589. package/dist/stage-bundles/vue/chunks/chunk-KKLU24SB.js +33 -0
  590. package/dist/stage-bundles/vue/chunks/chunk-KOBPYD4N.js +8 -0
  591. package/dist/stage-bundles/vue/chunks/chunk-LH4ZDX3T.js +58 -0
  592. package/dist/stage-bundles/vue/chunks/chunk-M3YT4JBL.js +12 -0
  593. package/dist/stage-bundles/vue/chunks/chunk-MAPYANXA.js +8 -0
  594. package/dist/stage-bundles/vue/chunks/chunk-MMCB6GGX.js +8 -0
  595. package/dist/stage-bundles/vue/chunks/chunk-NCUWZXVZ.js +8 -0
  596. package/dist/stage-bundles/vue/chunks/chunk-O3KQTA3H.js +21 -0
  597. package/dist/stage-bundles/vue/chunks/chunk-P7UUT7BU.js +12 -0
  598. package/dist/stage-bundles/vue/chunks/chunk-PHVB7SAE.js +22 -0
  599. package/dist/stage-bundles/vue/chunks/chunk-PKSFATQY.js +10 -0
  600. package/dist/stage-bundles/vue/chunks/chunk-PU2GET2S.js +18 -0
  601. package/dist/stage-bundles/vue/chunks/chunk-QBXKRHK5.js +11 -0
  602. package/dist/stage-bundles/vue/chunks/chunk-QCQXLZJH.js +18 -0
  603. package/dist/stage-bundles/vue/chunks/chunk-QIOKODGT.js +14 -0
  604. package/dist/stage-bundles/vue/chunks/chunk-R5DUYWXP.js +8 -0
  605. package/dist/stage-bundles/vue/chunks/chunk-RHAVY7VB.js +92 -0
  606. package/dist/stage-bundles/vue/chunks/chunk-RI7XWDHX.js +10 -0
  607. package/dist/stage-bundles/vue/chunks/chunk-RZG5LCPH.js +12 -0
  608. package/dist/stage-bundles/vue/chunks/chunk-S4NZQRJJ.js +12 -0
  609. package/dist/stage-bundles/vue/chunks/chunk-S5L2YBXG.js +143 -0
  610. package/dist/stage-bundles/vue/chunks/chunk-SF5BLQ7P.js +14 -0
  611. package/dist/stage-bundles/vue/chunks/chunk-SKOTGWTH.js +140 -0
  612. package/dist/stage-bundles/vue/chunks/chunk-SPTKNGHA.js +14 -0
  613. package/dist/stage-bundles/vue/chunks/chunk-TKHCH4WB.js +35 -0
  614. package/dist/stage-bundles/vue/chunks/chunk-TVB3GD7L.js +8 -0
  615. package/dist/stage-bundles/vue/chunks/chunk-TVGXBOIT.js +18 -0
  616. package/dist/stage-bundles/vue/chunks/chunk-U7U7L7XZ.js +31 -0
  617. package/dist/stage-bundles/vue/chunks/chunk-UFHA3ODE.js +528 -0
  618. package/dist/stage-bundles/vue/chunks/chunk-UHGV762U.js +12 -0
  619. package/dist/stage-bundles/vue/chunks/chunk-V6MKKC23.js +18 -0
  620. package/dist/stage-bundles/vue/chunks/chunk-VK4FEQKG.js +18 -0
  621. package/dist/stage-bundles/vue/chunks/chunk-VZNGMF63.js +12 -0
  622. package/dist/stage-bundles/vue/chunks/chunk-W5CGYUVM.js +8 -0
  623. package/dist/stage-bundles/vue/chunks/chunk-W7QH4UII.js +54 -0
  624. package/dist/stage-bundles/vue/chunks/chunk-WMV5J37V.js +8 -0
  625. package/dist/stage-bundles/vue/chunks/chunk-WXDXWNWW.js +8 -0
  626. package/dist/stage-bundles/vue/chunks/chunk-XKFPCFZH.js +8 -0
  627. package/dist/stage-bundles/vue/chunks/chunk-YCZNHFZA.js +15 -0
  628. package/dist/stage-bundles/vue/chunks/chunk-YEEGISBQ.js +23 -0
  629. package/dist/stage-bundles/vue/chunks/chunk-YM3NAGCN.js +8 -0
  630. package/dist/stage-bundles/vue/chunks/clearDestination-EMCIEDAP.js +7 -0
  631. package/dist/stage-bundles/vue/chunks/clearName-O7J77F77.js +7 -0
  632. package/dist/stage-bundles/vue/chunks/clearOptionsExpression-RGDXKYVX.js +7 -0
  633. package/dist/stage-bundles/vue/chunks/clearRender-DFMNHXXQ.js +7 -0
  634. package/dist/stage-bundles/vue/chunks/clearRepeat-436RGATR.js +7 -0
  635. package/dist/stage-bundles/vue/chunks/contentEditor-XVLK5LYS.js +67 -0
  636. package/dist/stage-bundles/vue/chunks/createAction-CKUAX4TU.js +8 -0
  637. package/dist/stage-bundles/vue/chunks/createAnimation-URI5366N.js +7 -0
  638. package/dist/stage-bundles/vue/chunks/createComputed-I23CA5NX.js +8 -0
  639. package/dist/stage-bundles/vue/chunks/createTextContent-K4G7KNQ5.js +10 -0
  640. package/dist/stage-bundles/vue/chunks/createValue-D5MP2SMM.js +7 -0
  641. package/dist/stage-bundles/vue/chunks/disconnectNode-GM5F3ZMB.js +8 -0
  642. package/dist/stage-bundles/vue/chunks/history-7PFZW7N6.js +51 -0
  643. package/dist/stage-bundles/vue/chunks/id-VSNJWKHU.js +53 -0
  644. package/dist/stage-bundles/vue/chunks/main-GQD7B74Q.js +103 -0
  645. package/dist/stage-bundles/vue/chunks/main-L3KI7XBW.js +154 -0
  646. package/dist/stage-bundles/vue/chunks/main-SWZDSGE3.js +109 -0
  647. package/dist/stage-bundles/vue/chunks/main-ULK5YAYM.js +31 -0
  648. package/dist/stage-bundles/vue/chunks/moveNodeToLastChildOf-X46IGL47.js +12 -0
  649. package/dist/stage-bundles/vue/chunks/nodeGraph-TTOC6H4R.js +53 -0
  650. package/dist/stage-bundles/vue/chunks/normalizeEventName-2JPOX7Y6.js +128 -0
  651. package/dist/stage-bundles/vue/chunks/normalizeLayoutContext-SY3L4IB7.js +9 -0
  652. package/dist/stage-bundles/vue/chunks/preview-bootstrap-SIVRGDR2.js +135 -0
  653. package/dist/stage-bundles/vue/chunks/removeAction-PPAIVTW3.js +7 -0
  654. package/dist/stage-bundles/vue/chunks/removeAnimationBinding-UQ24BSXP.js +7 -0
  655. package/dist/stage-bundles/vue/chunks/removeAttribute-P2IDGOQH.js +7 -0
  656. package/dist/stage-bundles/vue/chunks/removeComputed-7C66NNZA.js +7 -0
  657. package/dist/stage-bundles/vue/chunks/removeEvent-KTSOCV4C.js +7 -0
  658. package/dist/stage-bundles/vue/chunks/removeLifecycleHook-NKXLF3QT.js +7 -0
  659. package/dist/stage-bundles/vue/chunks/removeNode-A7C34C42.js +10 -0
  660. package/dist/stage-bundles/vue/chunks/removeOption-6HW62A5Y.js +7 -0
  661. package/dist/stage-bundles/vue/chunks/removeParamFromRoute-LIKPDVU4.js +7 -0
  662. package/dist/stage-bundles/vue/chunks/removeState-PO6J3JYQ.js +7 -0
  663. package/dist/stage-bundles/vue/chunks/removeStore-5ZZ57NHV.js +7 -0
  664. package/dist/stage-bundles/vue/chunks/removeToken-BKJE3U6Q.js +7 -0
  665. package/dist/stage-bundles/vue/chunks/removeValue-5FNPXWNL.js +7 -0
  666. package/dist/stage-bundles/vue/chunks/screen-capture-bootstrap-GV75P6QF.js +126 -0
  667. package/dist/stage-bundles/vue/chunks/setDestination-DAYIYYIV.js +7 -0
  668. package/dist/stage-bundles/vue/chunks/setHomePage-MHCP4P24.js +7 -0
  669. package/dist/stage-bundles/vue/chunks/setHtmlId-3HYPFT3T.js +7 -0
  670. package/dist/stage-bundles/vue/chunks/setName-OQOO3URG.js +7 -0
  671. package/dist/stage-bundles/vue/chunks/setNodeLayout-W5QFJBKT.js +10 -0
  672. package/dist/stage-bundles/vue/chunks/setOptionsExpression-XZZOJPCM.js +8 -0
  673. package/dist/stage-bundles/vue/chunks/setRender-NHXZZGME.js +10 -0
  674. package/dist/stage-bundles/vue/chunks/setRepeat-YZTZFDTQ.js +10 -0
  675. package/dist/stage-bundles/vue/chunks/setTagName-EGPQ66XI.js +7 -0
  676. package/dist/stage-bundles/vue/chunks/updateAction-ZSNXUEQA.js +9 -0
  677. package/dist/stage-bundles/vue/chunks/updateAnimationBinding-X2UXYQKJ.js +7 -0
  678. package/dist/stage-bundles/vue/chunks/updateAttribute-ODXM7YXA.js +12 -0
  679. package/dist/stage-bundles/vue/chunks/updateBounds-PEGOZ4FT.js +7 -0
  680. package/dist/stage-bundles/vue/chunks/updateComputed-6LNN453F.js +9 -0
  681. package/dist/stage-bundles/vue/chunks/updateEvent-ZHCKBJIM.js +11 -0
  682. package/dist/stage-bundles/vue/chunks/updateHtml-6BPU5PRY.js +7 -0
  683. package/dist/stage-bundles/vue/chunks/updateLifecycleHook-JEMQQYM5.js +8 -0
  684. package/dist/stage-bundles/vue/chunks/updateOption-SH33P5WW.js +8 -0
  685. package/dist/stage-bundles/vue/chunks/updateRoute-3RRPY2T5.js +7 -0
  686. package/dist/stage-bundles/vue/chunks/updateState-WRLF4SSC.js +11 -0
  687. package/dist/stage-bundles/vue/chunks/updateStyle-WAPTDAU5.js +7 -0
  688. package/dist/stage-bundles/vue/chunks/updateToken-CFIIILXB.js +7 -0
  689. package/dist/stage-bundles/vue/chunks/updateValue-JTEEC2B6.js +8 -0
  690. package/dist/stage-bundles/vue/chunks/user-ZLGCTRZX.js +44 -0
  691. package/dist/stage-bundles/vue/chunks/validateStorePayload-7A2INWJV.js +61 -0
  692. package/dist/stage-bundles/vue/chunks/viewport-OTNUF4XI.js +21 -0
  693. package/dist/stage-bundles/vue/chunks/vue-2GZIKYJR.js +37 -0
  694. package/dist/stage-bundles/vue/chunks/window-73DBL24T.js +32 -0
  695. package/dist/stage-bundles/vue/entry.js +85 -0
  696. package/dist/stage-bundles/vue/framework-jsx-runtime.js +34 -0
  697. package/dist/stage-bundles/vue/framework.js +352 -0
  698. package/dist/stage-bundles/vue/sdk.js +42 -0
  699. package/dist/templates/.gitignore.template +29 -0
  700. package/dist/templates/index.html.template +17 -0
  701. package/dist/templates/jucie.config.js.template +15 -0
  702. package/dist/templates/package.json.template +14 -0
  703. package/dist/templates/sceneGraph/wal.log +0 -0
  704. package/package.json +92 -0
package/dist/jucie.js ADDED
@@ -0,0 +1,322 @@
1
+ #!/usr/bin/env node
2
+ var dL=Object.create;var qi=Object.defineProperty;var pL=Object.getOwnPropertyDescriptor;var fL=Object.getOwnPropertyNames;var mL=Object.getPrototypeOf,hL=Object.prototype.hasOwnProperty;var gL=(t,e,r)=>e in t?qi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var a=(t,e)=>qi(t,"name",{value:e,configurable:!0});var p=(t,e)=>()=>(t&&(e=t(t=0)),e);var Z=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),R=(t,e)=>{for(var r in e)qi(t,r,{get:e[r],enumerable:!0})},yL=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of fL(e))!hL.call(t,o)&&o!==r&&qi(t,o,{get:()=>e[o],enumerable:!(n=pL(e,o))||n.enumerable});return t};var t$=(t,e,r)=>(r=t!=null?dL(mL(t)):{},yL(e||!t||!t.__esModule?qi(r,"default",{value:t,enumerable:!0}):r,t));var Qe=(t,e,r)=>(gL(t,typeof e!="symbol"?e+"":e,r),r),th=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var _=(t,e,r)=>(th(t,e,"read from private field"),r?r.call(t):e.get(t)),j=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},oe=(t,e,r,n)=>(th(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var Y=(t,e,r)=>(th(t,e,"access private method"),r);function r$(t,e,r){let n=r??"default";if(t.set([e,".activeBreakpoint"],n),n!=="default")t.push([e,"locked"],"width");else{let s=(t.get([e,"locked"])??[]).indexOf("width");s!==-1&&t.splice([e,"locked"],s,1)}}var n$=p(()=>{a(r$,"setActiveBreakpoint")});function o$(t,e){t.remove([e,".activeBreakpoint"])}var s$=p(()=>{a(o$,"clearActiveBreakpoint")});import{defineContracts as vL}from"@jucie.io/engine-message";var bL,a$=p(()=>{n$();s$();bL=vL("node:breakpoint",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{namespace:"scene-graph",schema:["String","Number"],handler:(r,n)=>{r$(e,r,n)}},clear:{namespace:"scene-graph",schema:["String"],handler:r=>{o$(e,r)}}}})});function Fl(t){return typeof t=="string"&&t.includes("{{")}function sh(t){if(!Fl(t))return null;let e=t.match(/^\{\{(.+)\}\}$/);return e?e[1].trim():null}function Vi(t){if(!t)return[];let e=t.matchAll(/(?<![.\w])([a-zA-Z_$][\w]*)/g);return[...new Set([...e].map(n=>n[1]))].filter(n=>!wL.has(n))}var wL,ah=p(()=>{wL=new Set(["true","false","null","undefined","this","return","if","else","for","while","function","var","let","const","new","typeof","instanceof","Array","Object","String","Number","Boolean","Date","Math","JSON","console","window","document"]);a(Fl,"hasExpression");a(sh,"parseExpression");a(Vi,"parseDependencies")});var kL,ih,i$=p(()=>{kL="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ih=a((t=21)=>{let e="",r=t|0;for(;r-- >0;)e+=kL[Math.random()*64|0];return e},"nanoid")});var c$={};R(c$,{clearGeneratedIds:()=>FL,createActorId:()=>PL,createAnimationId:()=>OL,createAssetId:()=>TL,createChannelId:()=>zL,createDescriptorId:()=>lh,createDocumentId:()=>IL,createId:()=>$L,createLongId:()=>jL,createMessageRequestId:()=>RL,createNodeId:()=>Hi,createPortId:()=>CL,createSceneId:()=>EL,createSecureId:()=>DL,createSpaceId:()=>NL,createStoreId:()=>AL,createTokenId:()=>uh,createUuid:()=>ML,getGeneratedIds:()=>UL,isIdGenerated:()=>qL,isValidId:()=>LL,loadExistingIds:()=>HL,parseId:()=>ZL,removeGeneratedId:()=>VL});function SL(){let t=jo[Ul]++,e=Math.random().toString(36).slice(2,4);return`${jo[ch]}${t}${e}`}function nt(t="",e={}){let{short:r=!1,length:n=21,customLength:o=null}=e,s,i=0,c=100;do{if(r){let u=SL();s=t?`${t}_${u}`:u}else if(o){let u=ih(o);s=t?`${t}_${u}`:u}else{let u=ih(n);s=t?`${t}_${u}`:u}if(i++,i>c)throw new Error(`Failed to generate unique ID after ${c} attempts`)}while(Gn.has(s));return Gn.add(s),s}function ZL(t){let[e]=t.split("_");return{type:e,id:t}}function LL(t,e={}){let{short:r=!1,length:n=21,customLength:o=null}=e;if(typeof t!="string")return!1;if(!t.includes("_"))return r?t.length>=10&&t.length<=12:t.length===n;let[s,i]=t.split("_");return r?i.length>=10&&i.length<=12:o?i.length===o:i.length===n}function FL(){Gn.clear()}function UL(){return Array.from(Gn)}function qL(t){return Gn.has(t)}function VL(t){return Gn.delete(t)}function HL(t){Array.isArray(t)&&(t.forEach(e=>{typeof e=="string"&&Gn.add(e)}),jo[Ul]=Gn.size)}var jo,Ul,ch,Gn,$L,EL,NL,TL,zL,Hi,OL,uh,PL,IL,CL,RL,AL,lh,jL,ML,DL,Bi=p(()=>{i$();jo=globalThis,Ul=Symbol.for("\u26D4\uFE0Funique-id-counter"),ch=Symbol.for("\u26D4\uFE0Funique-id-session");jo[Ul]||(jo[Ul]=0);jo[ch]||(jo[ch]=Math.random().toString(36).slice(2,6));Gn=new Set;a(SL,"createBaseId");a(nt,"generateId");$L=a((t={})=>nt("",{short:!0,...t}),"createId"),EL=a((t={})=>nt("sc",t),"createSceneId"),NL=a((t={})=>nt("sp",t),"createSpaceId"),TL=a((t={})=>nt("as",t),"createAssetId"),zL=a((t={})=>nt("ch",t),"createChannelId"),Hi=a((t={})=>nt("nd",{short:!0,...t}),"createNodeId"),OL=a((t={})=>nt("anim",{short:!0,...t}),"createAnimationId"),uh=a((t={})=>nt("tok",{short:!0,...t}),"createTokenId"),PL=a((t={})=>nt("actor",t),"createActorId"),IL=a((t={})=>nt("doc",t),"createDocumentId"),CL=a((t={})=>nt("port",t),"createPortId"),RL=a((t={})=>nt("msgReq",t),"createMessageRequestId"),AL=a((t={})=>nt("str",t),"createStoreId"),lh=a((t={})=>nt("desc",t),"createDescriptorId"),jL=a((t={})=>nt("",{length:32,...t}),"createLongId"),ML=a((t={})=>nt("uuid",{customLength:36,...t}),"createUuid"),DL=a((t={})=>nt("sec",{customLength:64,...t}),"createSecureId");a(ZL,"parseId");a(LL,"isValidId");a(FL,"clearGeneratedIds");a(UL,"getGeneratedIds");a(qL,"isIdGenerated");a(VL,"removeGeneratedId");a(HL,"loadExistingIds")});var ql=p(()=>{Bi()});function WL(t){if(t==null||t==="")return null;try{return new Function("ctx","event",t),null}catch{try{return new Function(`return (${t})`),null}catch(r){return r.message}}}function KL(t){if(t==null||t==="")return null;try{return new Function("ctx",t),null}catch{try{return new Function("ctx",`return (${t})`),null}catch(r){return r.message}}}function YL(t){return t==null?null:!Array.isArray(t)||t.length===0?"binding must be a non-empty array of strings":t.every(e=>typeof e=="string"&&e.length>0)?null:"every segment in binding must be a non-empty string"}function XL(t){let e={...t,error:null};switch(e.mode){case"code":e.error=WL(e.code);break;case"computed":e.error=KL(e.computed);break;case"binding":e.error=YL(e.binding);break;case"value":default:break}return e}function Re(t={}){let e=JL();return t.id||(t.id=lh()),t.name!=null&&(e.name=t.name),t.value!==void 0&&(e.value=t.value),t.binding!=null&&(e.binding=t.binding),t.computed!=null&&(e.computed=t.computed),t.code!=null&&(e.code=t.code),t.mode&&BL.has(t.mode)&&(e.mode=t.mode),e.mode==="computed"&&!e.computed&&(e.computed=GL),e.mode==="code"&&!e.code&&(e.code=Vl),e.mode==="computed"&&e.computed&&(e.dependencies=Vi(e.computed)),t.removable===!1&&(e.removable=!1),XL(e)}var BL,GL,Vl,JL,tr=p(()=>{ah();ql();BL=new Set(["value","binding","computed","code"]),GL=`function (ctx) {
3
+ return true
4
+ }`,Vl=`function (ctx, event) {
5
+
6
+ }`,JL=a(()=>({name:null,mode:"value",value:null,binding:null,computed:null,code:null,error:null,removable:!0}),"DEFAULTS");a(WL,"validateCode");a(KL,"validateComputed");a(YL,"validateBinding");a(XL,"validateDescriptor");a(Re,"createDescriptor")});function Hl({name:t,mode:e,...r}={}){return Re({name:t,mode:e??"value",...r})}var dh=p(()=>{tr();a(Hl,"createClassName")});function u$(t,e,r={}){let n=typeof r=="string"?{value:r}:r;return t.push([e,"className"],Hl({mode:"value",...n}))}var l$=p(()=>{dh();a(u$,"addClassName")});function d$(t,e,r,n){return t.setWhere([e,"className"],{value:r},Hl(n))}var p$=p(()=>{dh();a(d$,"updateClassName")});function f$(t,e,r){return t.removeWhere([e,"className"],{value:r})}var m$=p(()=>{a(f$,"removeClassName")});import{defineContracts as QL}from"@jucie.io/engine-message";var e9,h$=p(()=>{l$();p$();m$();e9=QL("node:className",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{add:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>u$(e,r,n)},update:{namespace:"scene-graph",schema:["String","String","Object"],handler:(r,n,o)=>d$(e,r,n,o)},remove:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>f$(e,r,n)}}})});function Tt(t,e){return t.has([e])}var Qs=p(()=>{a(Tt,"nodeExists")});var g$={};R(g$,{disconnectNode:()=>un});function un(t,e){if(!e||!Tt(t,e))return!1;t.update(["app","children"],(n=[])=>n.filter(o=>o!==e)),t.update(["temp","children"],(n=[])=>n.filter(o=>o!==e));let r=t.findWhen("children","includes",e);return r&&t.update(r,(n=[])=>n.filter(o=>o!==e)),!0}var Gi=p(()=>{Qs();a(un,"disconnectNode")});function Sr(t,e,r=[]){let n=t.get([e,"children"])||[];for(let o of n)r.push(o),r=Sr(t,o,r);return r}var ea=p(()=>{a(Sr,"findDescendantIds")});var ta,Bl=p(()=>{ta=a(t=>structuredClone?structuredClone(t):JSON.parse(JSON.stringify(t)),"clone")});function y$(t,e){let r=e.flatMap(o=>Sr(t,o));e.forEach(o=>{un(t,o)}),e=[...e,...r];let n={};for(let o of e)n[o]=t.remove([o]);return ta(n)}var _$=p(()=>{Gi();ea();Bl();a(y$,"cutNodes")});function x$(t,e){let r=e.flatMap(o=>Sr(t,o));e=[...e,...r];let n={};for(let o of e){let s=t.get([o]);s&&(n[o]=s)}return ta(n)}var v$=p(()=>{ea();Bl();a(x$,"copyNodes")});function Gl(t,e){return t.update(["temp","children"],(r=[])=>r.indexOf(e)===-1?[...r,e]:r),!0}var ph=p(()=>{a(Gl,"moveNodeToTemp")});function b$(t,e){let r=t.get([e,"layout"]);if(r&&r!=="none")return r;let n=t.get([e,"style","default","display"]);return n==="flex"||n==="grid"?n:"none"}var w$=p(()=>{a(b$,"getLayoutContext")});function Jl(t,e,r){let n=t.get([e,"style"]);if(!(!n||!r.length))for(let o in n){let s=n[o];if(!(!s||typeof s!="object")){for(let i of r)i in s&&t.remove([e,"style",o,i]);for(let i in s){if(!i.startsWith(":")&&!i.startsWith("&."))continue;let c=s[i];if(!(!c||typeof c!="object"))for(let u of r)u in c&&t.remove([e,"style",o,i,u])}}}}var fh=p(()=>{a(Jl,"stripStyleProperties")});function k$(t,e){Jl(t,e,t9)}var t9,S$=p(()=>{fh();t9=["top","left","right","bottom"];a(k$,"stripPositionalStyles")});function mh(){return{layout:"none",draggable:!0,resizable:!0,selectable:!0,locked:[],anchor:[],dimensions:[],expandedStyles:[],childrenType:"children"}}var $$=p(()=>{a(mh,"defaultNodeBehavior")});function ra(t){if(t===E$||t==null)return E$;let e=String(t);return e.startsWith("@")?e:`@${e}`}var E$,Wl=p(()=>{E$="default";a(ra,"toBpKey")});var hh={};R(hh,{updateStyle:()=>Ji});function na(t){return t!=null&&t!=="auto"}function Ji(t,e,r,{breakpoint:n="default",interactionState:o,anchor:s}={}){let i=ra(n),c=o??t.get([e,".interactionState"])??[],u={};for(let l of r9)l in r&&(u[l]=r[l],delete r[l]);for(let l of n9)delete r[l];return s=s??t.get([e,"anchor"]),t.update([e,"style",i],(l={})=>{let d={...l,...u};if(s)for(let m of o9)s.includes(m)||delete d[m];return na(d.left)&&na(d.right)&&!("width"in u)&&na(d.width)&&delete d.width,na(d.top)&&na(d.bottom)&&!("height"in u)&&na(d.height)&&delete d.height,d}),t.update([e,"style",i,...c],(l={})=>({...l,...r})),t.get([e,"style",i])}var r9,n9,o9,oa=p(()=>{Wl();r9=["top","left","right","bottom","width","height"],n9=["display","position"];a(na,"isConstrainedEdge");o9=["top","left","right","bottom"];a(Ji,"updateStyle")});var gh={};R(gh,{updateBounds:()=>Wi});function Wi(t,e,r){let n=t.get([e,"bounds"])??{};return t.set([e,"bounds"],{...n,...r})}var Ki=p(()=>{a(Wi,"updateBounds")});function N$(t,e){return t?e?t.filter(r=>!e.includes(r)):t:[]}var T$=p(()=>{a(N$,"arrayDiff")});function z$(t,e,r){let n=t.get([e,"anchor"]),o=N$(n,r);return o.length&&Jl(t,e,o),t.set([e,"anchor"],r),!0}var O$=p(()=>{T$();fh();a(z$,"updateAnchor")});function rr(t,e){return t.set([e,".position"],null)}var sa=p(()=>{a(rr,"clearPosition")});function ln(t,e,r,n){if(!r||typeof r!="object")return;let o=Object.keys(r).sort();for(let s of o){let i=r[s];switch(s){case"style":{let c=r?.anchor;Ji(t,e,i,{breakpoint:n,anchor:c}),rr(t,e);break}case"bounds":Wi(t,e,i);break;case"anchor":z$(t,e,i);break;default:t.set([e,s],i);break}}}function P$(t,e,r={}){let n={...mh(),...r};for(let o of Object.keys(n))t.set([e,o],n[o])}function I$(t,e){let r=mh();for(let n of Object.keys(r))t.set([e,n],r[n]);t.set([e,"hidden"],void 0),t.set([e,"isComponentRoot"],void 0)}var Yi=p(()=>{$$();oa();Ki();O$();sa();a(ln,"applyNodePatch");a(P$,"setNodeBehavior");a(I$,"resetNodeBehavior")});var C$={};R(C$,{normalizeLayoutContext:()=>ot});function ot(t,e,r){if(b$(t,r)!=="none"){k$(t,e),ln(t,e,{anchor:[],dimensions:[]});return}let o=t.get([e,"anchor"]);(!o||!o.length)&&ln(t,e,{anchor:["top","left"],dimensions:["width","height"]})}var dn=p(()=>{w$();S$();Yi();a(ot,"normalizeLayoutContext")});function Zt(t,e){return t.update(["app","children"],(r=[])=>r.indexOf(e)===-1?[...r,e]:r),ot(t,e,"app"),!0}var Mo=p(()=>{dn();a(Zt,"moveNodeToRoot")});function Kl(t,e){return t.has([e])?t.get(["app","children"])?.includes(e)?"root":t.get(["temp","children"])?.includes(e)?"temp":t.get(["components","children"])?.includes(e)?"components":"nested":null}var yh=p(()=>{a(Kl,"getNodeLevel")});function Lr(t,e,r,n){let o=t.get([e]);if(!o||!o.bounds)return!0;if(n==="instance")return!1;let s=o.type==="component";if(n==="root"||n==="temp")return!s;if(n==="after"||n==="before"){let i=Kl(t,r);return s?i==="components":i==="root"||i==="temp"}return n==="firstChildOf"||n==="lastChildOf"?s?r==="components":r==="app"||r==="temp":!1}var aa=p(()=>{yh();a(Lr,"canMoveFrame")});function R$(t){return t?t.ex&&t.ex in ia?ia[t.ex]:t.tagName&&t.tagName in ia?ia[t.tagName]:t.type&&t.type in ia?ia[t.type]:t.childrenType??null:null}var ia,A$=p(()=>{ia={layout:"*",div:"*",section:"*",header:"*",footer:"*",article:"*",main:"*",aside:"*",nav:"*",form:"*",template:"*",text:"text",heading:"text",h1:"text",h2:"text",h3:"text",h4:"text",h5:"text",h6:"text",paragraph:"text",p:"text",span:"text",label:"text",blockquote:"text",pre:"text",codeElement:"text",strong:"text",em:"text",small:"text",mark:"text",ul:["li"],ol:["li"],li:"*",dl:["dt","dd"],dt:"text",dd:"text",table:["thead","tbody","tfoot","tr"],thead:["tr"],tbody:["tr"],tfoot:["tr"],tr:["td","th"],td:"*",th:"*",interactive:"text",button:"text",a:"text",summary:"text",details:"*",dialog:"*",input:null,checkbox:null,radio:null,email:null,password:null,phone:null,color:null,date:null,file:null,hidden:null,number:null,range:null,search:null,textInput:null,select:"options",textarea:"text",media:null,img:null,audio:null,iframe:null,video:"*",figure:"*",figcaption:"text",fieldset:"*",legend:"text",meter:null,progress:null,slot:"*",frame:"*",component:"children"};a(R$,"getChildrenType")});function nr(t,e,r=null){if(e==="app"||e==="temp"||e==="components")return!0;let n=R$(t.get([e]));return!n||n==="text"?!1:n==="*"||n==="children"||n==="options"?!0:Array.isArray(n)?r===null?!0:n.includes(r):!1}var Do=p(()=>{A$();a(nr,"canAcceptChildren")});var j$={};R(j$,{moveNodeToLastChildOf:()=>pn});function pn(t,e,r){if(!Tt(t,r)||!Tt(t,e))return;let n=t.get([e,"ex"])??t.get([e,"type"]);if(nr(t,r,n)){if(!Lr(t,e,r,"lastChildOf")){Zt(t,e);return}return t.update([r,"children"],(o=[])=>{let s=o.indexOf(e);if(s!==-1){let i=[...o];return i.splice(s,1),[...i,e]}return[...o,e]}),ot(t,e,r),!0}}var ca=p(()=>{aa();Do();Qs();Mo();dn();a(pn,"moveNodeToLastChildOf")});function ua(t,e,r){if(!Lr(t,e,r,"after")){Zt(t,e);return}if(t.get(["app","children"])?.includes(r))return t.update(["app","children"],(c=[])=>{let u=c.indexOf(r);if(u===-1)return[...c,e];let l=[...c];return l.splice(u+1,0,e),l}),ot(t,e,"app"),!0;let o=t.findWhen("children","includes",r);if(!o)return new Error("Failed to move node after: parent not found");let s=o[0],i=t.get([e,"ex"])??t.get([e,"type"]);if(nr(t,s,i))return t.update(o,(c=[])=>{let u=c.indexOf(r);if(u===-1)return[...c,e];let l=[...c];return l.splice(u+1,0,e),l}),ot(t,e,s),!0}var Yl=p(()=>{aa();Do();Mo();dn();a(ua,"moveNodeAfter")});function Xl(t,e,r){if(!Lr(t,e,r,"before")){Zt(t,e);return}if(t.get(["app","children"])?.includes(r))return Zt(t,e),!0;let o=t.findWhen("children","includes",r);if(!o)return new Error("Failed to move node before: parent not found");let s=o[0],i=t.get([e,"ex"])??t.get([e,"type"]);if(nr(t,s,i))return t.update(o,(c=[])=>{let u=c.indexOf(r);if(u===-1)return[e,...c];let l=[...c];return l.splice(u,0,e),l}),ot(t,e,s),!0}var _h=p(()=>{Mo();aa();Do();dn();a(Xl,"moveNodeBefore")});function Xi(t){let e=Object.keys(t),r={},n=new Map;e.forEach(c=>{let u=Hi();n.set(c,u)}),e.forEach(c=>{let u=n.get(c),d={...t[c]};d.children&&Array.isArray(d.children)&&(d.children=d.children.map(m=>n.get(m)||null).filter(m=>m!==null)),d.slots&&Array.isArray(d.slots)&&(d.slots=d.slots.map(m=>({...m,id:n.get(m.id)??m.id,children:(m.children||[]).map(h=>n.get(h)??h)}))),d.type==="frame"&&(d.route=d.route?{...d.route,path:`${u}`}:{path:`${u}`}),r[u]=d});let o=Object.keys(r),s=new Set;return Object.values(r).forEach(c=>{c.children&&Array.isArray(c.children)&&c.children.forEach(u=>{u&&s.add(u)})}),[o.filter(c=>!s.has(c)),r]}var Ql=p(()=>{Bi();a(Xi,"cloneNodes")});function ed(t,e,{parent:r,after:n,before:o,root:s,temp:i}={}){let[c,u]=Xi(e);for(let[l,d]of Object.entries(u))t.set(l,d);if(i)for(let l of c)Gl(t,l);if(s)for(let l of c)Zt(t,l);if(r)for(let l of c)pn(t,l,r);if(n)for(let l of c)ua(t,l,n),n=l;if(o)for(let l of c)Xl(t,l,o),o=l;return c}var xh=p(()=>{ph();Mo();ca();Yl();_h();Ql();a(ed,"pasteNodes")});function td(t,e){let r=Sr(t,e),n=[e,...r],o={};for(let s of n){let i=t.get([s]);i&&(o[s]=i)}return ta(o)}var vh=p(()=>{ea();Bl();a(td,"copyNode")});function rd(t,e){let r=[];for(let n of e){let o=td(t,n);r=r.concat(ed(t,o,{after:n}))}return r}var bh=p(()=>{vh();xh();a(rd,"duplicateNodes")});function or(t,e){let r=t.get([e,"locked"]);return!r||!r.includes("*")}var la=p(()=>{a(or,"canEditNode")});import{defineContracts as s9}from"@jucie.io/engine-message";var a9,M$=p(()=>{_$();v$();xh();bh();la();dn();a9=s9("node:clipboard",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{cut:{namespace:"scene-graph",schema:["Array"],handler:r=>{let n=r.filter(s=>or(e,s));return n.length===0?{}:y$(e,n)}},copy:{namespace:"scene-graph",schema:["Array"],handler:r=>x$(e,r)},paste:{namespace:"scene-graph",schema:["Object","Object"],handler:(r,n)=>{let o=ed(e,r,n);if(n.parent)for(let s of o)ot(e,s,n.parent);return o}},duplicate:{namespace:"scene-graph",schema:["Array","Object","Object"],handler:(r,n,o)=>{let s=rd(e,r,n);o&&typeof o=="function"&&o(s)}}}})});function D$(t,e,r){return t.set([e,"contextName"],r)}var Z$=p(()=>{a(D$,"setContextName")});function L$(t,e,r){return t.set([e,"contextName"],r)}var F$=p(()=>{a(L$,"updateContextName")});function U$(t,e){return t.set([e,"contextName"],null)}var q$=p(()=>{a(U$,"clearContextName")});import{defineContracts as i9}from"@jucie.io/engine-message";var c9,V$=p(()=>{Z$();F$();q$();c9=i9("node:contextName",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{schema:["String","String"],handler:(r,n)=>{D$(e,r,n)},namespace:"scene-graph"},update:{schema:["String","String"],handler:(r,n)=>{L$(e,r,n)},namespace:"scene-graph"},clear:{schema:["String"],handler:r=>{U$(e,r)},namespace:"scene-graph"}}})});function nd({name:t,mode:e,...r}={}){return Re({name:t,mode:e??"binding",...r})}var wh=p(()=>{tr();a(nd,"createState")});var H$={};R(H$,{addState:()=>kh});function kh(t,e,r){return t.unshift([e,"states"],nd({name:r}))}var Sh=p(()=>{wh();a(kh,"addState")});var B$={};R(B$,{updateState:()=>$h});function $h(t,e,r,n){return t.setWhere([e,"states"],{name:r},nd(n))}var Eh=p(()=>{wh();a($h,"updateState")});var G$={};R(G$,{removeState:()=>Nh});function Nh(t,e,r){return t.removeWhere([e,"states"],{name:r})}var Th=p(()=>{a(Nh,"removeState")});import{defineContracts as u9}from"@jucie.io/engine-message";var l9,J$=p(()=>{Sh();Eh();Th();l9=u9("node:state",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{add:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>kh(e,r,n)},update:{namespace:"scene-graph",schema:["String","String","Object"],handler:(r,n,o)=>$h(e,r,n,o)},remove:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>Nh(e,r,n)}}})});var W$,K$=p(()=>{W$={__version:1,type:"node",render:{name:null,mode:"value",value:!0,binding:null,computed:null,code:null,error:null},name:null,layout:"none",draggable:!0,resizable:!0,selectable:!0,locked:[],anchor:[],dimensions:[],expandedStyles:[],childrenType:null,repeat:null,contextName:null,attributes:[],events:[],className:[],states:[],lifecycle:[],animations:[],style:{}}});var Y$,X$=p(()=>{Y$={type:"element",ex:"node",style:{default:{}}}});var Q$,eE=p(()=>{Q$={type:"container",ex:"node",childrenType:"*",bounds:{width:0,height:0,x:0,y:0},breakpoints:[{name:"Mobile",type:"mobile",min:320,editable:!1},{name:"Tablet",type:"mobile",min:768,editable:!1},{name:"Desktop",type:"desktop",min:1280,editable:!1}]}});var zh={};R(zh,{article:()=>g9,aside:()=>_9,div:()=>p9,footer:()=>h9,form:()=>v9,header:()=>m9,layout:()=>d9,main:()=>y9,nav:()=>x9,section:()=>f9,template:()=>b9});var d9,p9,f9,m9,h9,g9,y9,_9,x9,v9,b9,tE=p(()=>{d9={ex:"element",anchor:["top","left"],dimensions:["width","height"],childrenType:"*",children:[]},p9={ex:"layout",tagName:"div"},f9={ex:"layout",tagName:"section"},m9={ex:"layout",tagName:"header"},h9={ex:"layout",tagName:"footer"},g9={ex:"layout",tagName:"article"},y9={ex:"layout",tagName:"main"},_9={ex:"layout",tagName:"aside"},x9={ex:"layout",tagName:"nav"},v9={ex:"layout",tagName:"form"},b9={ex:"layout",tagName:"template",html:"<div>HTML template</div>",style:{default:{width:"250px",height:"100px"}}}});var Oh={};R(Oh,{createTextContent:()=>Ne});function w9(t){if(typeof t=="string"){let e=t.trim();return e?[e]:null}if(Array.isArray(t)){let e=t.filter(r=>typeof r=="string"&&r.trim());return e.length>0?e:null}return null}function Ne({value:t="",mode:e,specificPatterns:r,...n}={}){let o=w9(r);return{...Re({mode:e??"value",value:t,...n}),...o?{specificPatterns:o}:{}}}var fn=p(()=>{tr();a(w9,"normalizeSpecificPatterns");a(Ne,"createTextContent")});var Ph={};R(Ph,{blockquote:()=>A9,br:()=>q9,codeElement:()=>M9,em:()=>Z9,h1:()=>$9,h2:()=>E9,h3:()=>N9,h4:()=>T9,h5:()=>z9,h6:()=>O9,heading:()=>S9,hr:()=>U9,label:()=>R9,mark:()=>F9,p:()=>I9,paragraph:()=>P9,pre:()=>j9,small:()=>L9,span:()=>C9,strong:()=>D9,text:()=>k9});var k9,S9,$9,E9,N9,T9,z9,O9,P9,I9,C9,R9,A9,j9,M9,D9,Z9,L9,F9,U9,q9,rE=p(()=>{fn();k9={ex:"element",anchor:["top","left"],dimensions:["width"],childrenType:"text",textContent:Ne({value:""})},S9={ex:"text",textContent:Ne({value:""}),style:{default:{margin:"0"}}},$9={ex:"heading",tagName:"h1",textContent:Ne({value:"Heading 1"})},E9={ex:"heading",tagName:"h2",textContent:Ne({value:"Heading 2"})},N9={ex:"heading",tagName:"h3",textContent:Ne({value:"Heading 3"})},T9={ex:"heading",tagName:"h4",textContent:Ne({value:"Heading 4"})},z9={ex:"heading",tagName:"h5",textContent:Ne({value:"Heading 5"})},O9={ex:"heading",tagName:"h6",textContent:Ne({value:"Heading 6"})},P9={ex:"text",textContent:Ne({value:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."}),style:{default:{margin:"0"}}},I9={ex:"paragraph",tagName:"p"},C9={ex:"text",tagName:"span",textContent:Ne({value:"Lorem ipsum"})},R9={ex:"text",tagName:"label",textContent:Ne({value:"Label text"})},A9={ex:"text",tagName:"blockquote",textContent:Ne({value:"Blockquote text"})},j9={ex:"text",tagName:"pre",textContent:Ne({value:"Preformatted text"})},M9={ex:"text",tagName:"code",textContent:Ne({value:"code"})},D9={ex:"text",tagName:"strong",textContent:Ne({value:"Bold text"})},Z9={ex:"text",tagName:"em",textContent:Ne({value:"Emphasized text"})},L9={ex:"text",tagName:"small",textContent:Ne({value:"Small text"})},F9={ex:"text",tagName:"mark",textContent:Ne({value:"Highlighted text"})},U9={ex:"element",tagName:"hr",anchor:["top","left"],dimensions:["width"],childrenType:"none"},q9={ex:"element",tagName:"br",anchor:["top","left"],dimensions:["width"],childrenType:"none"}});var Ih={};R(Ih,{a:()=>B9,button:()=>H9,details:()=>G9,dialog:()=>W9,interactive:()=>V9,summary:()=>J9});var V9,H9,B9,G9,J9,W9,nE=p(()=>{fn();V9={ex:"element",interactive:!0,childrenType:"text",anchor:["top","left"],style:{default:{width:"auto",height:"auto",cursor:"pointer"}}},H9={ex:"interactive",tagName:"button",dimensions:["width","height"],textContent:Ne({value:"Button text"}),style:{default:{"background-color":"#e9e9e9",border:"1px solid #d5d5d5","border-radius":"4px",padding:"6px 12px",width:"120px",height:"auto"}}},B9={ex:"interactive",tagName:"a",textContent:Ne({value:"Link text"}),destination:{type:"page",id:null,path:null,target:null,replace:!1,params:null,query:null}},G9={ex:"interactive",tagName:"details",childrenType:"*",dimensions:["width","height"],style:{default:{cursor:"default"}}},J9={ex:"interactive",tagName:"summary",textContent:Ne({value:"Summary text"})},W9={ex:"interactive",tagName:"dialog",childrenType:"*",dimensions:["width","height"],style:{default:{cursor:"default",width:"300px",height:"200px"}}}});var Rh={};R(Rh,{checkbox:()=>iF,color:()=>sF,date:()=>aF,email:()=>Q9,file:()=>uF,hidden:()=>lF,input:()=>Y9,number:()=>tF,password:()=>eF,phone:()=>nF,radio:()=>cF,range:()=>oF,search:()=>rF,select:()=>dF,textInput:()=>X9,textarea:()=>pF});var Lt,K9,Ft,Fr,Ch,Y9,X9,Q9,eF,tF,rF,nF,oF,sF,aF,iF,cF,uF,lF,dF,pF,oE=p(()=>{tr();Lt=a(t=>Re({name:"type",mode:"value",value:t,removable:!1}),"type"),K9=a(()=>Re({name:"value",mode:"value",value:"",removable:!1}),"value"),Ft=a(()=>Re({name:"model",mode:"binding",binding:null,removable:!0}),"model"),Fr=a(()=>Re({name:"onInput",mode:"code",code:Vl,removable:!1}),"onInput"),Ch=a(()=>Re({name:"onChange",mode:"code",code:Vl,removable:!1}),"onChange"),Y9={ex:"element",tagName:"input",anchor:["top","left"],dimensions:["width"],childrenType:"none",style:{default:{width:"auto",height:"auto"}}},X9={ex:"input",attributes:[Lt("text"),Ft()],events:[Fr()]},Q9={ex:"input",attributes:[Lt("email"),Ft()],events:[Fr()]},eF={ex:"input",attributes:[Lt("password"),Ft()],events:[Fr()]},tF={ex:"input",attributes:[Lt("number"),Ft()],events:[Fr()]},rF={ex:"input",attributes:[Lt("search"),Ft()],events:[Fr()]},nF={ex:"input",attributes:[Lt("tel"),Ft()],events:[Fr()]},oF={ex:"input",attributes:[Lt("range"),Ft()],events:[Fr()]},sF={ex:"input",attributes:[Lt("color"),Ft()],events:[Fr()]},aF={ex:"input",attributes:[Lt("date"),Ft()],events:[Fr()]},iF={ex:"input",attributes:[Lt("checkbox"),Ft()],events:[Ch()]},cF={ex:"input",attributes:[Lt("radio"),Ft()],events:[Ch()]},uF={ex:"input",attributes:[Lt("file")]},lF={ex:"input",attributes:[Lt("hidden"),K9()]},dF={ex:"input",tagName:"select",childrenType:"options",attributes:[Ft()],events:[Ch()]},pF={ex:"input",tagName:"textarea",childrenType:"text",dimensions:["width","height"],attributes:[Ft()],events:[Fr()]}});var Ah={};R(Ah,{audio:()=>hF,figcaption:()=>_F,figure:()=>yF,iframe:()=>xF,img:()=>mF,media:()=>fF,video:()=>gF});var sE,fF,mF,hF,gF,yF,_F,xF,aE=p(()=>{tr();sE=Re({name:"controls",mode:"value",value:!0,removable:!1}),fF={ex:"element",anchor:["top","left"],dimensions:["width","height"],style:{default:{display:"block",width:"auto",height:"auto","object-fit":"contain"}}},mF={ex:"media",tagName:"img",childrenType:"none"},hF={ex:"media",tagName:"audio",childrenType:"none",dimensions:["width"],attributes:[sE],style:{default:{width:"320px"}}},gF={ex:"media",tagName:"video",childrenType:"*",attributes:[sE],style:{default:{width:"320px",height:"240px"}}},yF={ex:"media",tagName:"figure",childrenType:"*",dimensions:["width","height"],style:{default:{width:"auto",height:"auto",margin:"0"}}},_F={ex:"media",tagName:"figcaption",childrenType:"text"},xF={ex:"media",tagName:"iframe",childrenType:"none",dimensions:["width","height"]}});var jh={};R(jh,{dd:()=>$F,dl:()=>kF,dt:()=>SF,li:()=>wF,ol:()=>vF,ul:()=>bF});var vF,bF,wF,kF,SF,$F,iE=p(()=>{vF={ex:"element",tagName:"ol",anchor:["top","left"],dimensions:["width"],childrenType:["li"],children:[]},bF={ex:"element",tagName:"ul",anchor:["top","left"],dimensions:["width"],childrenType:["li"],children:[]},wF={ex:"element",tagName:"li",anchor:["top","left"],dimensions:["width"],childrenType:"*"},kF={ex:"element",tagName:"dl",anchor:["top","left"],dimensions:["width"],childrenType:["dt","dd"],children:[]},SF={ex:"element",tagName:"dt",anchor:["top","left"],dimensions:["width"],childrenType:"text"},$F={ex:"element",tagName:"dd",anchor:["top","left"],dimensions:["width"],childrenType:"text"}});var Mh={};R(Mh,{table:()=>EF,tbody:()=>TF,td:()=>IF,tfoot:()=>zF,th:()=>PF,thead:()=>NF,tr:()=>OF});var EF,NF,TF,zF,OF,PF,IF,cE=p(()=>{EF={ex:"element",tagName:"table",anchor:["top","left"],dimensions:["width"],childrenType:["thead","tbody","tfoot","tr"],children:[]},NF={ex:"element",tagName:"thead",childrenType:["tr"],children:[]},TF={ex:"element",tagName:"tbody",childrenType:["tr"],children:[]},zF={ex:"element",tagName:"tfoot",childrenType:["tr"],children:[]},OF={ex:"element",tagName:"tr",childrenType:["td","th"],children:[]},PF={ex:"element",tagName:"th",childrenType:"*"},IF={ex:"element",tagName:"td",childrenType:"*"}});var Dh={};R(Dh,{fieldset:()=>CF,legend:()=>RF,meter:()=>AF,progress:()=>jF});var CF,RF,AF,jF,uE=p(()=>{CF={ex:"element",tagName:"fieldset",anchor:["top","left"],dimensions:["width","height"],childrenType:"children",style:{default:{border:"1px solid #cccccc",padding:"16px"}}},RF={ex:"element",tagName:"legend",childrenType:"text"},AF={ex:"element",tagName:"meter",childrenType:"none"},jF={ex:"element",tagName:"progress",childrenType:"none"}});var Zh={};R(Zh,{slot:()=>MF});var MF,lE=p(()=>{MF={type:"slot",ex:"element",tagName:"slot",anchor:["top","left"],dimensions:["width","height"],childrenType:"*"}});var dE,pE=p(()=>{dE={type:"frame",ex:"container",tagName:"div",bounds:{top:0,left:0,width:360,height:740,x:void 0,y:void 0},style:{default:{background:"white"}},children:[],route:{path:null}}});var fE,mE=p(()=>{fE={type:"instance",ex:"node",component:null,library:null,props:[],childrenType:"component"}});var hE,gE=p(()=>{hE={type:"code",ex:"node",body:"",language:"js",params:[],returns:null}});var yE,_E=p(()=>{yE={type:"animation",ex:"node",scope:"node",name:null,duration:300,easing:"ease",fill:"none",direction:"normal",iterations:1,delay:0,endDelay:0,iterationStart:0,composite:"replace",keyframes:[]}});var xE,vE=p(()=>{xE={type:"component",ex:"container",name:"",library:"local",props:[],emits:[],data:[],children:[]}});var bE,wE=p(()=>{bE={type:"graphic",ex:"node",tagName:"div",props:{},template:[],style:{default:{margin:"0",width:"100px",height:"100px"}}}});var Zo,od=p(()=>{K$();X$();eE();tE();rE();nE();oE();aE();iE();cE();uE();lE();pE();mE();gE();_E();vE();wE();Fh();id();Zo={node:W$,element:Y$,container:Q$,...zh,...Ph,...Ih,...Rh,...Ah,...jh,...Mh,...Dh,...Zh,frame:dE,instance:fE,code:hE,animation:yE,component:xE,graphic:bE}});function sd(t){let e=[],r=t;for(;r&&Zo[r];)e.push(r),r=Zo[r].ex;return e}function ad(t){return Zo[t]?.ex??null}function da(t){return!!Zo[t]}function Lh(t){let e=t?.ex??t?.type;for(let r of sd(e))if(DF.has(r))return r;return null}var DF,Fh=p(()=>{od();a(sd,"chainOf");a(ad,"baseOf");a(da,"isKnownType");DF=new Set(["element","container","frame","instance","component","slot","animation","graphic","code","node"]);a(Lh,"categoryOf")});function ZF(t,e){let r=new Map(t.map(n=>[n.name,n]));for(let n of e)r.set(n.name,n);return Array.from(r.values())}function kE(t,e){let r=sd(t).reverse(),n=[];for(let o of r){let s=Zo[o];s?.[e]&&(n=ZF(n,s[e]))}return n}function pa(t,e={}){if(!da(t))throw new Error(`createNode: unknown prototype "${t}". Did you mean to register it first?`);let r=Lh({type:t}),n=r===t?{type:t,...e}:{type:r,ex:t,...e};if(!n.attributes){let o=kE(t,"attributes");o.length&&(n.attributes=o.map(s=>({...s})))}if(!n.events){let o=kE(t,"events");o.length&&(n.events=o.map(s=>({...s})))}return[Hi(),n]}var id=p(()=>{ql();Fh();od();a(ZF,"mergeByName");a(kE,"resolveDescriptors");a(pa,"createNode")});function Qi(t){return cd.find(e=>e.key===t)??null}function Uh(){return cd.map(t=>t.key)}function ec(t,e={}){if(t==="custom")return{name:e.name||"Custom",bounds:{width:e.width??SE.width,height:e.height??SE.height,x:0,y:0}};let r=Qi(t);if(!r)throw new Error(`Unknown frame preset "${t}". Available: ${Uh().join(", ")}`);return{name:t,bounds:{width:r.width,height:r.height,x:0,y:0}}}var cd,SE,Lo=p(()=>{cd=[{key:"iPhone 15",category:"phone",width:393,height:852},{key:"iPhone SE",category:"phone",width:375,height:667},{key:"Pixel 8",category:"phone",width:412,height:915},{key:"Galaxy S24",category:"phone",width:360,height:780},{key:"iPad Air",category:"tablet",width:820,height:1180},{key:"iPad Mini",category:"tablet",width:768,height:1024},{key:"Surface Pro",category:"tablet",width:912,height:1368},{key:"Desktop",category:"desktop",width:1280,height:800},{key:"Desktop Large",category:"desktop",width:1920,height:1080},{key:"custom",category:"custom",width:null,height:null}];a(Qi,"getFramePreset");a(Uh,"getAvailableFrames");SE={width:360,height:740,x:0,y:0};a(ec,"createFrameOverrides")});function LF(t={}){let e=t.frame??t.viewport;if(!e)return t;let{frame:r,viewport:n,width:o,height:s,name:i,bounds:c,...u}=t,{name:l,bounds:d}=ec(e,{name:i,width:o,height:s});return{...u,frame:e,name:l,bounds:{x:c?.x??d.x??0,y:c?.y??d.y??0,width:c?.width??d.width,height:c?.height??d.height}}}function Jn(t,e,r={}){let n=e==="frame"?LF(r):r,[o,s]=pa(e,n);return e==="frame"&&(s.route={path:`${o}`}),t.set([o],s),o}var tc=p(()=>{id();Lo();a(LF,"buildFrameNodeProps");a(Jn,"createNodeEntry")});var Vh={};R(Vh,{addNode:()=>qh});function qh(t,e,r,n="app"){let o=Jn(t,e,r);return pn(t,o,n),o}var ud=p(()=>{tc();ca();a(qh,"addNode")});function $E(t,e,r){let n=Jn(t,e,r);return Gl(t,n),n}var EE=p(()=>{tc();ph();a($E,"addTemp")});function UF(t,e){let r=t.get([e,"children"])??[],n=0;for(let o of r){let s=t.get([o]);if(s?.type!=="slot")continue;let i=FF.exec(s.name??"");i&&(n=Math.max(n,Number(i[1])))}return`Slot ${n+1}`}function NE(t,e,r={}){let n=r.name??UF(t,e),o=Jn(t,"slot",{...r,name:n});return t.update([e,"children"],(s=[])=>[...s,o]),o}var FF,TE=p(()=>{tc();FF=/^Slot (\d+)$/;a(UF,"nextSlotName");a(NE,"addSlot")});function zE(t,e,r){if(!Tt(t,e)||!Tt(t,r))return!1;let n=t.findWhen("children","includes",e);return n?(t.update(n,(o=[])=>o.map(s=>s===e?r:s)),!0):!1}var OE=p(()=>{Qs();a(zE,"replaceNode")});var IE={};R(IE,{addComponent:()=>Hh});function VF(t,e,r,n){let o=t.get([e,"style"]);if(!o)return;let s=new Set(n??[]);for(let i in o){let c=o[i];if(!c||typeof c!="object")continue;let u={},l=!1;for(let d of PE)d in c&&s.has(d)&&(u[d]=c[d],l=!0);l&&(t.update([r,"style",i],(d={})=>({...d,...u})),t.update([e,"style",i],(d={})=>{let m={...d};for(let h of qF)delete m[h];return m}))}}function Hh(t,e,r,n=null){let o=t.get([e,".position"]),s=t.get([e,"anchor"]),i=t.get([e,"dimensions"]),c=td(t,e),[u,l]=Xi(c),d=u[0];for(let[y,x]of Object.entries(l))t.set([y],x);let[m,h]=pa("component",{children:[d],name:r,bounds:n}),[f,g]=pa("instance",{component:m});t.set([m],h),t.set([f],g),t.update(["components","children"],(y=[])=>y.indexOf(m)===-1?[...y,m]:y),zE(t,e,f);let v=Sr(t,e);for(let y of v)t.remove([y]);return t.remove([e]),o&&t.set([f,".position"],o),s&&t.set([f,"anchor"],s),i&&t.set([f,"dimensions"],i),VF(t,d,f,s),t.set([d,"isComponentRoot"],!0),t.set([d,"anchor"],[]),f}var PE,qF,Bh=p(()=>{id();OE();vh();Ql();ea();PE=["top","left","right","bottom"],qF=[...PE];a(VF,"migratePositionalStyles");a(Hh,"addComponent")});import{defineContracts as HF}from"@jucie.io/engine-message";var BF,CE=p(()=>{ud();ca();Yl();EE();TE();bh();Bh();sa();oa();tc();BF=HF("node:add",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{element:{namespace:"scene-graph",schema:["String","Object","Object"],handler:(r,n,o)=>{if(r==="slot")return[NE(e,o?.parent??"app",n)];let s=Jn(e,r,n);return o?.after?ua(e,s,o.after):pn(e,s,o?.parent??"app"),[s]}},tempNode:{namespace:"scene-graph",schema:["String","Object"],handler:(r,n)=>[$E(e,r,n)]},component:{namespace:"scene-graph",schema:["String","String","Object"],handler:(r,n,o)=>[Hh(e,r,n,o)]},duplicates:{namespace:"scene-graph",schema:["Array"],handler:r=>{for(let o of r)rr(e,o);return rd(e,r)}},images:{namespace:"scene-graph",schema:["Array"],handler:r=>{let n=[],o=e.batch();for(let s of r){let i=qh(e,"element",{tagName:"img",attributes:[{name:"src",value:s.url},{name:"alt",value:s.meta.name}]});n.push(i)}return o(),n}}}})});function ld({name:t,mode:e,...r}={}){return Re({name:t,mode:e??"binding",...r})}var Gh=p(()=>{tr();a(ld,"createEvent")});var RE={};R(RE,{addEvent:()=>Jh});function Jh(t,e,r){return t.unshift([e,"events"],ld({name:r}))}var Wh=p(()=>{Gh();a(Jh,"addEvent")});var Yh={};R(Yh,{updateEvent:()=>Kh});function Kh(t,e,r,n){return t.setWhere([e,"events"],{name:r},ld(n))}var dd=p(()=>{Gh();a(Kh,"updateEvent")});var AE={};R(AE,{removeEvent:()=>Xh});function Xh(t,e,r){return t.removeWhere([e,"events"],{name:r})}var Qh=p(()=>{a(Xh,"removeEvent")});import{defineContracts as GF}from"@jucie.io/engine-message";var JF,jE=p(()=>{Wh();dd();Qh();JF=GF("node:event",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{add:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>Jh(e,r,n)},update:{namespace:"scene-graph",schema:["String","String","Object"],handler:(r,n,o)=>Kh(e,r,n,o)},remove:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>Xh(e,r,n)}}})});function pd({name:t,mode:e,...r}={}){return Re({name:t,mode:e??"value",...r})}var eg=p(()=>{tr();a(pd,"createAttribute")});var ME={};R(ME,{removeAttribute:()=>rc});function rc(t,e,r){typeof t.removeAllWhere=="function"?t.removeAllWhere([e,"attributes"],{name:r}):t.removeWhere([e,"attributes"],{name:r})}var fd=p(()=>{a(rc,"removeAttribute")});function md(t,e,r){if(!WF.has(r))return[];let n=r==="model"?["value","checked"]:["model"],o=[];for(let s of n)(t.get([e,"attributes"])??[]).some(c=>c.name===s)&&(rc(t,e,s),o.push(s));return t.get([e,"model"])!=null&&t.set([e,"model"],null),o}var WF,tg=p(()=>{fd();WF=new Set(["model","value","checked"]);a(md,"clearValueChannelConflict")});var DE={};R(DE,{addAttribute:()=>rg});function rg(t,e,r={}){let o=pd(typeof r=="string"?{name:r}:r);return o.name&&md(t,e,o.name),t.unshift([e,"attributes"],o)}var ng=p(()=>{eg();tg();a(rg,"addAttribute")});var ZE={};R(ZE,{updateAttribute:()=>og});function og(t,e,r,n){let o=pd(n),s=o.name??r;md(t,e,s),t.findWhere([e,"attributes"],{name:r})!==void 0?t.setWhere([e,"attributes"],{name:r},o):t.push([e,"attributes"],o)}var sg=p(()=>{eg();tg();a(og,"updateAttribute")});import{defineContracts as KF}from"@jucie.io/engine-message";var YF,LE=p(()=>{ng();sg();fd();YF=KF("node:attribute",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{add:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>rg(e,r,n)},update:{namespace:"scene-graph",schema:["String","String","Object"],handler:(r,n,o)=>og(e,r,n,o)},remove:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>rc(e,r,n)}}})});function nc({name:t,mode:e,...r}={}){return Re({name:t,mode:e??"value",...r})}var hd=p(()=>{tr();a(nc,"createProp")});function FE(t,e,r={}){let o=nc(typeof r=="string"?{name:r}:r);return t.unshift([e,"props"],o)}var UE=p(()=>{hd();a(FE,"addProp")});function qE(t,e,r,n){let o=nc(n);t.findWhere([e,"props"],{name:r})!==void 0?t.setWhere([e,"props"],{name:r},o):t.push([e,"props"],o)}var VE=p(()=>{hd();a(qE,"updateProp")});function HE(t,e,r){typeof t.removeAllWhere=="function"?t.removeAllWhere([e,"props"],{name:r}):t.removeWhere([e,"props"],{name:r})}var BE=p(()=>{a(HE,"removeProp")});import{defineContracts as XF}from"@jucie.io/engine-message";var QF,GE=p(()=>{UE();VE();BE();QF=XF("node:prop",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{add:{namespace:"scene-graph",schema:["String","Object"],handler:(r,n)=>FE(e,r,n)},update:{namespace:"scene-graph",schema:["String","String","Object"],handler:(r,n,o)=>qE(e,r,n,o)},remove:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>HE(e,r,n)}}})});function JE(t,e,r,n){console.log("updateSlot",t,e,r,n),t.updateWhere([e,"slots"],{id:r},o=>{switch(console.log("currentSlot",o,"updatedSlot",n),o.childrenType){case"text":return{...o,textContent:Re(n)};default:return o}})}var WE=p(()=>{fn();tr();a(JE,"updateSlot")});function KE(t=[]){if(!Array.isArray(t))return[];let e=[];for(let r of t){if(!r||typeof r=="string"||!r.id)continue;let n=r.childrenType??"children";if(r.required===!0||n==="text"&&r.textContent!=null){if(n==="text"){let s=r.textContent?.value??"";e.push({id:r.id,name:r.name,childrenType:"text",textContent:Ne({value:s}),children:null});continue}e.push({id:r.id,name:r.name,childrenType:n,textContent:null,children:[]})}}return e}function ag(t=[],e=[]){let r=Array.isArray(t)?[...t]:[],n=new Set(r.map(o=>o?.id).filter(Boolean));for(let o of KE(e))n.has(o.id)||(r.push(o),n.add(o.id));return r}var ig=p(()=>{fn();a(KE,"buildSlotsFromMeta");a(ag,"mergeMissingSlotsFromMeta")});function YE(t,e,r=[]){if(!e)return;let n=t.get([e,"slots"])??[],o=ag(n,r),s=new Set(n.map(c=>c?.id).filter(Boolean));o.some(c=>c?.id&&!s.has(c.id))&&t.set([e,"slots"],o)}var XE=p(()=>{ig();a(YE,"ensureSlotsFromMeta")});import{defineContracts as eU}from"@jucie.io/engine-message";var tU,QE=p(()=>{WE();XE();tU=eU("node:slot",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{update:{namespace:"scene-graph",schema:["String","String","Object"],handler:(r,n,o)=>{console.log("updateSlot",r,n,o),JE(e,r,n,o)}},ensureFromMeta:{namespace:"scene-graph",schema:["String","Array"],handler:(r,n)=>{YE(e,r,n)}}}})});var eN={};R(eN,{updateHtml:()=>cg});function cg(t,e,r){return t.set([e,"html"],r)}var ug=p(()=>{a(cg,"updateHtml")});import{defineContracts as rU}from"@jucie.io/engine-message";var nU,tN=p(()=>{ug();nU=rU("node:html",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{update:{schema:["String","String"],handler:(r,n)=>{cg(e,r,n)},namespace:"scene-graph"}}})});function gd({path:t=null,target:e=null,id:r=null,type:n="url",replace:o=!1,params:s=[],query:i=null}){return{path:t,target:e,id:r,type:n,replace:o,params:s,query:i}}var lg=p(()=>{a(gd,"createDestination")});function rN(t,e,r){return t.update([e,"destination"],(n={})=>gd({...n,...r}))}var nN=p(()=>{lg();a(rN,"updateDestination")});var oN={};R(oN,{setDestination:()=>dg});function dg(t,e,r={}){return t.set([e,"destination"],gd(r))}var pg=p(()=>{lg();a(dg,"setDestination")});var sN={};R(sN,{clearDestination:()=>fg});function fg(t,e){return t.remove([e,"destination"])}var mg=p(()=>{a(fg,"clearDestination")});import{defineContracts as oU}from"@jucie.io/engine-message";var sU,aN=p(()=>{nN();pg();mg();sU=oU("node:destination",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{namespace:"scene-graph",schema:["String","Object"],handler:(r,n={})=>{dg(e,r,n)}},update:{namespace:"scene-graph",schema:["String","Object"],handler:(r,n)=>{rN(e,r,n)}},remove:{namespace:"scene-graph",schema:["String"],handler:r=>{fg(e,r)}}}})});function iN(t,e,r){return t.update([e,".position"],(n={x:0,y:0})=>({...n,...r}))}var cN=p(()=>{a(iN,"updatePosition")});import{defineContracts as aU}from"@jucie.io/engine-message";var iU,uN=p(()=>{sa();cN();iU=aU("node:drag",t=>{let e=t("state"),r=e?.ref(["nodes"])??null,n=null;if(!e||!r)throw new Error("State or node cache not found");return{start:{namespace:"scene-graph",handler:()=>n=e.history?.group()},apply:{namespace:"scene-graph",schema:["Array"],handler:o=>{for(let[s,i]of o)s&&i[".position"]&&iN(r,s,i[".position"])}},end:{namespace:"scene-graph",schema:["Array"],handler:o=>{for(let s of o)s&&rr(r,s);n?(n("Drag nodes"),n=null):e.history?.commit("Drag nodes")}},clear:{namespace:"scene-graph",schema:["Array"],handler:o=>{for(let s of o)s&&rr(r,s);n&&(n(),n=null)}}}})});function yd({key:t,mode:e,binding:r=null,code:n=""}){return{key:t,mode:e??"binding",binding:r,code:n}}var hg=p(()=>{a(yd,"createLifecycleHook")});var lN={};R(lN,{addLifecycleHook:()=>gg});function gg(t,e,r){return t.unshift([e,"lifecycle"],yd({key:r}))}var yg=p(()=>{hg();a(gg,"addLifecycleHook")});var xg={};R(xg,{updateLifecycleHook:()=>_g});function _g(t,e,r,n){return t.setWhere([e,"lifecycle"],{key:r},yd(n))}var _d=p(()=>{hg();a(_g,"updateLifecycleHook")});var dN={};R(dN,{removeLifecycleHook:()=>vg});function vg(t,e,r){return t.removeWhere([e,"lifecycle"],{key:r})}var bg=p(()=>{a(vg,"removeLifecycleHook")});import{defineContracts as cU}from"@jucie.io/engine-message";var uU,pN=p(()=>{yg();_d();bg();uU=cU("node:lifecycle",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{add:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>gg(e,r,n)},update:{namespace:"scene-graph",schema:["String","String","Object"],handler:(r,n,o)=>_g(e,r,n,o)},remove:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>vg(e,r,n)}}})});function fN(t,e,r){if(!(t.get([e,".interactionState"])??[]).includes(r))return t.push([e,".interactionState"],r)}var mN=p(()=>{a(fN,"addInteractionState")});function hN(t,e,r){let o=(t.get([e,".interactionState"])??[]).indexOf(r);if(o!==-1)return t.splice([e,".interactionState"],o,1)}var gN=p(()=>{a(hN,"removeInteractionState")});function yN(t,e){t.remove([e,".interactionState"])}var _N=p(()=>{a(yN,"clearInteractionState")});import{defineContracts as lU}from"@jucie.io/engine-message";var dU,xN=p(()=>{mN();gN();_N();dU=lU("node:interactionState",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{add:{schema:["String","String"],namespace:"scene-graph",handler:(r,n)=>{fN(e,r,n)}},remove:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>{hN(e,r,n)}},clear:{namespace:"scene-graph",schema:["String"],handler:r=>{yN(e,r)}}}})});import{defineContracts as pU}from"@jucie.io/engine-message";var fU,vN=p(()=>{sa();Yi();la();fU=pU("node:patch",t=>{let[e,r]=t("state","sceneCompiler"),n=e?.ref(["nodes"])??null,o=null;if(!e||!n)throw new Error("State or node cache not found");return{start:{namespace:"scene-graph",schema:"*",handler:()=>{o=e.history?.group()}},apply:{namespace:"scene-graph",schema:["Array"],handler:s=>{let i=e.batch();for(let[c,u]of s){if(!c||!u||!or(n,c))continue;let l=r.getActiveBreakpoint(c);ln(n,c,u,l)}i()}},end:{namespace:"scene-graph",schema:["String"],handler:(s="Patch")=>{o?(o(s),o=null):e.history?.commit(s)}},clear:{namespace:"scene-graph",schema:["Array"],handler:s=>{for(let i of s)i&&rr(n,i);o&&(o(),o=null)}}}})});import{defineContracts as mU}from"@jucie.io/engine-message";var hU,bN=p(()=>{Yi();hU=mU("node:behavior",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{schema:["String","Object"],handler:(r,n)=>{P$(e,r,n)},namespace:"scene-graph"},update:{schema:["Array"],handler:r=>{for(let[n,o]of r)ln(e,n,o)},namespace:"scene-graph"},clear:{schema:["String"],handler:r=>{I$(e,r)},namespace:"scene-graph"}}})});function xd(t,e,r,{breakpoint:n="default",interactionState:o}={}){let s=ra(n),i=o??t.get([e,".interactionState"])??[];return t.remove([e,"style",s,...i,r])}var wg=p(()=>{Wl();a(xd,"removeStyle")});function wN(t,e,r){t.update([e,"style","default"],(n={})=>({...n,display:r}))}var kN=p(()=>{a(wN,"setDisplayMode")});var Sg={};R(Sg,{setNodeLayout:()=>kg});function kg(t,e,r){let n=r==null||r===""?"none":r;ln(t,e,{layout:n}),n==="none"?xd(t,e,"display"):SN[n]&&wN(t,e,SN[n]);let o=t.get([e,"children"])??[];for(let s of o)ot(t,s,e);if(t.get([e,"type"])==="slot"){let s=t.findAllWhen("id","is",e);for(let i of s){let c=t.get(i.slice(0,-1));console.log("slotEntry",c);for(let u of c?.children??[])ot(t,u,e)}}return{id:e,layout:n,childrenUpdated:o.length}}var SN,vd=p(()=>{Yi();dn();wg();kN();SN={block:"block",flex:"flex",grid:"grid"};a(kg,"setNodeLayout")});import{defineContracts as gU}from"@jucie.io/engine-message";var yU,$N=p(()=>{vd();la();yU=gU("node:layout",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{schema:["String","String"],handler:(r,n)=>{if(or(e,r))return kg(e,r,n)},namespace:"scene-graph"}}})});function EN({id:t=null,name:e=void 0,children:r=[]}={}){return{id:t,name:e,children:r}}var NN=p(()=>{a(EN,"createSlotChild")});function _U(t,e,{before:r,after:n}={}){if(t.includes(e))return t;if(r){let o=t.indexOf(r);if(o===-1)return[e,...t];let s=[...t];return s.splice(o,0,e),s}if(n){let o=t.indexOf(n);if(o===-1)return[...t,e];let s=[...t];return s.splice(o+1,0,e),s}return[...t,e]}function TN(t,e,r,{slotId:n=null,name:o=void 0,before:s,after:i}={}){if(Tt(t,r)&&Tt(t,e)){if(!Lr(t,e,r,"lastChildOf")){Zt(t,e);return}return t.update([r,"slots"],(c=[])=>{let u=c.findIndex(h=>h.id===n);if(u===-1)return[...c,EN({id:n,name:o,children:[e]})];let l=c[u],d=l.children||[],m=[...c];return m[u]={...l,children:_U(d,e,{before:s,after:i})},m}),ot(t,e,n||r),!0}}var zN=p(()=>{NN();aa();Qs();Mo();dn();a(_U,"insertIntoSlotChildren");a(TN,"moveNodeToSlotChildOf")});function bd(t,e){if(!e)return;let r=a(o=>{if(!t.has([o]))return;let s=t.get([o,"slots"]);!Array.isArray(s)||!s.length||t.update([o,"slots"],(i=[])=>{let c=!1,u=i.map(l=>{let d=l.children||[];return d.includes(e)?(c=!0,{...l,children:d.filter(m=>m!==e)}):l});return c?u:i})},"stripFromSlots");r("app"),r("temp");let n=a(o=>{for(let s of o||[])t.has([s])&&(r(s),n(t.get([s,"children"])||[]))},"visit");n(t.get(["app","children"])),n(t.get(["temp","children"]))}var $g=p(()=>{a(bd,"removeNodeIdFromAllInstanceSlots")});function ON(t,e,r,n){if(!Tt(t,e)||!Tt(t,r))return!1;let o=t.get([e,"ex"])??t.get([e,"type"]);return!(!nr(t,r,o)||!Lr(t,e,r,n))}var PN=p(()=>{Qs();Do();aa();a(ON,"canNestUnder")});import{defineContracts as xU}from"@jucie.io/engine-message";var vU,IN=p(()=>{ca();zN();_h();Yl();Mo();Gi();$g();sa();PN();la();yh();vU=xU("node:move",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{apply:{namespace:"scene-graph",schema:["Array","Object"],handler:(r,n)=>{console.log("moveContracts",r,n);let o=r.filter(c=>or(e,c)),s=[],i=[];for(let c of o)n.before||n.after||n.instance?s.push(c):n.parent?ON(e,c,n.parent,"lastChildOf")?s.push(c):Kl(e,c)==="temp"&&i.push(c):s.push(c);if(!(s.length===0&&i.length===0)){for(let c of s)un(e,c),rr(e,c),bd(e,c);if(n.instance)for(let c of s)TN(e,c,n.instance,{slotId:n.slotId,name:n.name,before:n.before,after:n.after});else if(n.before)for(let c of s)Xl(e,c,n.before);else if(n.after)for(let c of s)ua(e,c,n.after);else if(n.parent)for(let c of s)pn(e,c,n.parent);for(let c of i)un(e,c),rr(e,c),Zt(e,c)}}}}})});var CN={};R(CN,{setName:()=>Eg});function Eg(t,e,r){return t.set([e,"name"],r)}var Ng=p(()=>{a(Eg,"setName")});function RN(t,e,r){return t.set([e,"name"],r)}var AN=p(()=>{a(RN,"updateName")});var zg={};R(zg,{clearName:()=>Tg});function Tg(t,e){return t.set([e,"name"],null)}var wd=p(()=>{a(Tg,"clearName")});import{defineContracts as bU}from"@jucie.io/engine-message";var wU,jN=p(()=>{Ng();AN();wd();wU=bU("node:name",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{schema:["String","String"],handler:(r,n)=>{Eg(e,r,n)},namespace:"scene-graph"},update:{schema:["String","String"],handler:(r,n)=>{console.log("updateName",r,n),RN(e,r,n)},namespace:"scene-graph"},clear:{schema:["String"],handler:r=>{Tg(e,r)},namespace:"scene-graph"}}})});function oc({value:t,label:e}){return{value:t,label:e||t}}var kd=p(()=>{a(oc,"createOption")});var MN={};R(MN,{addOption:()=>Og});function Og(t,e,{value:r,label:n}){return t.push([e,"options","set"],oc({value:r,label:n}))}var Pg=p(()=>{kd();a(Og,"addOption")});var DN={};R(DN,{updateOption:()=>Ig});function Ig(t,e,r,{value:n,label:o}){let s=oc({value:n,label:o});return t.findWhere([e,"options","set"],{value:r})===void 0?t.push([e,"options","set"],s):t.setWhere([e,"options","set"],{value:r},s)}var Cg=p(()=>{kd();a(Ig,"updateOption")});var ZN={};R(ZN,{removeOption:()=>Rg});function Rg(t,e,r){return t.removeWhere([e,"options","set"],{value:r})}var Ag=p(()=>{a(Rg,"removeOption")});var LN={};R(LN,{setOptionsExpression:()=>jg});function Sd(t){let e=Fl(t)?sh(t):null;return{value:(t??"").trim(),expression:e,dependencies:e?Vi(e):[]}}function jg(t,e,{binding:r,valueKey:n,labelKey:o}){let s=Fl(r)?sh(r):null;return t.update([e,"options"],(i={})=>({...i,type:"binding",binding:r??i.binding,expression:s??i.expression,dependencies:s?Vi(s):i.dependencies??[],valueKey:n!==void 0?Sd(n):i.valueKey??Sd("value"),labelKey:o!==void 0?Sd(o):i.labelKey??Sd("label")}))}var Mg=p(()=>{ah();a(Sd,"parseField");a(jg,"setOptionsExpression")});var FN={};R(FN,{clearOptionsExpression:()=>Dg});function Dg(t,e){return t.update([e,"options"],(r={})=>({...r,type:"set",binding:null,expression:null,dependencies:[],valueKey:{value:"value",expression:null,dependencies:[]},labelKey:{value:"label",expression:null,dependencies:[]}}))}var Zg=p(()=>{a(Dg,"clearOptionsExpression")});import{defineContracts as kU}from"@jucie.io/engine-message";var SU,UN=p(()=>{Pg();Cg();Ag();Mg();Zg();SU=kU("node:options",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{add:{schema:["String","Object"],handler:(r,n)=>{Og(e,r,n)},namespace:"scene-graph"},update:{schema:["String","String","Object"],handler:(r,n,o)=>{Ig(e,r,n,o)},namespace:"scene-graph"},remove:{schema:["String","String"],handler:(r,n)=>{Rg(e,r,n)},namespace:"scene-graph"},setExpression:{schema:["String","Object"],handler:(r,n)=>{jg(e,r,n)},namespace:"scene-graph"},clearExpression:{schema:["String"],handler:r=>{Dg(e,r)},namespace:"scene-graph"}}})});import{defineContracts as $U}from"@jucie.io/engine-message";var EU,qN=p(()=>{EU=$U("node:order",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{bringToFront:{schema:["Array"],handler:r=>{for(let n of r){let o=e.findWhen("children","includes",n);o&&e.update(o,(s=[])=>[...s.filter(c=>c!==n),n])}},namespace:"scene-graph"},sendToBack:{schema:["Array"],handler:r=>{for(let n of r){let o=e.findWhen("children","includes",n);o&&e.update(o,(s=[])=>{let i=s.filter(c=>c!==n);return[n,...i]})}},namespace:"scene-graph"},moveForward:{schema:["Array"],handler:r=>{for(let n of r){let o=e.findWhen("children","includes",n);o&&e.update(o,(s=[])=>{let i=s.indexOf(n);if(i===-1||i===s.length-1)return s;let c=[...s];return[c[i],c[i+1]]=[c[i+1],c[i]],c})}},namespace:"scene-graph"},moveBackward:{schema:["Array"],handler:r=>{for(let n of r){let o=e.findWhen("children","includes",n);o&&e.update(o,(s=[])=>{let i=s.indexOf(n);if(i===-1||i===0)return s;let c=[...s];return[c[i],c[i-1]]=[c[i-1],c[i]],c})}},namespace:"scene-graph"}}})});var VN={};R(VN,{removeNode:()=>Lg});function Lg(t,e){let r=Sr(t,e);for(let o of[e,...r])bd(t,o);un(t,e);let n={};for(let o of r)un(t,o),n[o]=t.remove(o);return n[e]=t.remove([e]),[e,n]}var Fg=p(()=>{Gi();ea();$g();a(Lg,"removeNode")});import{defineContracts as NU}from"@jucie.io/engine-message";var TU,HN=p(()=>{Fg();TU=NU("node:remove",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{nodes:{namespace:"scene-graph",schema:["Array"],handler:r=>{for(let n of r)Lg(e,n)}}}})});function $d({mode:t,...e}={}){return Re({mode:t??"value",...e})}var Ug=p(()=>{tr();a($d,"createRender")});var BN={};R(BN,{setRender:()=>qg});function qg(t,e,r={}){return t.set([e,"render"],$d(r))}var Vg=p(()=>{Ug();a(qg,"setRender")});function GN(t,e,r){return t.update([e,"render"],(n={})=>$d({...n,...r}))}var JN=p(()=>{Ug();a(GN,"updateRender")});var WN={};R(WN,{clearRender:()=>Hg});function Hg(t,e){return t.set([e,"render"],null)}var Bg=p(()=>{a(Hg,"clearRender")});import{defineContracts as zU}from"@jucie.io/engine-message";var OU,KN=p(()=>{Vg();JN();Bg();OU=zU("node:render",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{schema:["String","Object"],handler:(r,n)=>{qg(e,r,n)},namespace:"scene-graph"},update:{schema:["String","Object"],handler:(r,n)=>{GN(e,r,n)},namespace:"scene-graph"},clear:{schema:["String"],handler:r=>{Hg(e,r)},namespace:"scene-graph"}}})});function Ed({descriptor:t,keyOn:e=null,key:r="$key",as:n="$item",index:o="$index"}={}){return{descriptor:Re(t),keyOn:e,key:r,as:n,index:o}}var Gg=p(()=>{tr();a(Ed,"createRepeat")});var YN={};R(YN,{setRepeat:()=>sc});function sc(t,e,r={}){return t.set([e,"repeat"],Ed(r))}var Nd=p(()=>{Gg();a(sc,"setRepeat")});function XN(t,e,r){return t.update([e,"repeat"],(n={})=>Ed({...n,...r}))}var QN=p(()=>{Gg();a(XN,"updateRepeat")});var eT={};R(eT,{clearRepeat:()=>ac});function ac(t,e){return t.set([e,"repeat"],null)}var Td=p(()=>{a(ac,"clearRepeat")});function tT(t,e){return t.get([e,"repeat"])?t:sc(t,e,{})}var rT=p(()=>{Nd();a(tT,"enableRepeat")});function nT(t,e){return ac(t,e)}var oT=p(()=>{Td();a(nT,"disableRepeat")});import{defineContracts as PU}from"@jucie.io/engine-message";var IU,sT=p(()=>{Nd();QN();Td();rT();oT();IU=PU("node:repeat",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{schema:["String","Object"],handler:(r,n)=>{sc(e,r,n)},namespace:"scene-graph"},update:{schema:["String","Object"],handler:(r,n)=>{XN(e,r,n)},namespace:"scene-graph"},clear:{schema:["String"],handler:r=>{ac(e,r)},namespace:"scene-graph"},enable:{schema:["String"],handler:r=>{tT(e,r)},namespace:"scene-graph"},disable:{schema:["String"],handler:r=>{nT(e,r)},namespace:"scene-graph"}}})});function aT({path:t=null,params:e=[]}={}){return{path:t,params:e}}var iT=p(()=>{a(aT,"createRoute")});var cT={};R(cT,{updateRoute:()=>Jg});function Jg(t,e,r){return t.update([e,"route"],(n={})=>aT({...n,...r}))}var Wg=p(()=>{iT();a(Jg,"updateRoute")});function uT({key:t=null,optional:e=!1}={}){return{key:t,optional:e}}var lT=p(()=>{a(uT,"createParam")});var dT={};R(dT,{addParamToRoute:()=>Kg});function Kg(t,e){return t.push([e,"route","params"],uT())}var Yg=p(()=>{lT();a(Kg,"addParamToRoute")});var pT={};R(pT,{removeParamFromRoute:()=>Xg});function Xg(t,e,r){return t.splice([e,"route","params"],r,1)}var Qg=p(()=>{a(Xg,"removeParamFromRoute")});var fT={};R(fT,{setHomePage:()=>ey});function ey(t,e,r){t.findAllWhen("home","is",!0).forEach(n=>{t.set(n,!1);let o=[...n.slice(0,-1),"path"];t.set(o,e)}),r&&(t.set([e,"route","home"],!0),t.set([e,"route","path"],"/"))}var ty=p(()=>{a(ey,"setHomePage")});import{defineContracts as CU}from"@jucie.io/engine-message";var RU,mT=p(()=>{Wg();Yg();Qg();ty();RU=CU("node:route",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{update:{schema:["String","Object"],namespace:"scene-graph",handler:(r,n)=>{Jg(e,r,n)}},addParam:{schema:["String"],namespace:"scene-graph",handler:r=>{Kg(e,r)}},removeParam:{namespace:"scene-graph",schema:["String","Number"],handler:(r,n)=>{Xg(e,r,n)}},setHomePage:{schema:["String","Boolean"],namespace:"scene-graph",handler:(r,n)=>{ey(e,r,n)}}}})});function hT(t,e,{breakpoint:r="default",interactionState:n=[]}={}){let o=ra(r);return t.remove([e,"style",o,...n])}var gT=p(()=>{Wl();a(hT,"clearStyle")});function zd(t,e){let n=t.get([e])?.type;return n==="frame"||n==="component"||n==="viewport"}var yT=p(()=>{a(zd,"isContainerNode")});import{defineContracts as AU}from"@jucie.io/engine-message";var jU,_T=p(()=>{oa();wg();gT();la();yT();jU=AU("node:style",t=>{let[e,r]=t("state","sceneCompiler"),n=e?.ref(["nodes"])??null;return{update:{schema:["Object"],handler:o=>{for(let[s,i]of Object.entries(o)){if(!or(n,s))continue;delete i.position;let c=zd(n,s)?"default":r.getActiveBreakpoint(s);Ji(n,s,i,{breakpoint:c})}},namespace:"scene-graph"},remove:{schema:["Array","Array"],handler:(o,s)=>{for(let i of o){if(!or(n,i))continue;let c=zd(n,i)?"default":r.getActiveBreakpoint(i);for(let u of s)xd(n,i,u,{breakpoint:c})}},namespace:"scene-graph"},clear:{schema:["Array"],handler:o=>{for(let s of o){if(!or(n,s))continue;let i=zd(n,s)?"default":r.getActiveBreakpoint(s);i==="default"||i==null||hT(n,s,{breakpoint:i})}},namespace:"scene-graph"}}})});var xT={};R(xT,{setTagName:()=>ry});function ry(t,e,r){return t.set([e,"tagName"],r)}var ny=p(()=>{a(ry,"setTagName")});function vT(t,e,r){return t.set([e,"tagName"],r)}var bT=p(()=>{a(vT,"updateTagName")});function wT(t,e){return t.set([e,"tagName"],null)}var kT=p(()=>{a(wT,"clearTagName")});import{defineContracts as MU}from"@jucie.io/engine-message";var DU,ST=p(()=>{ny();bT();kT();DU=MU("node:tagName",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{schema:["String","String"],handler:(r,n)=>{ry(e,r,n)},namespace:"scene-graph"},update:{schema:["String","String"],handler:(r,n)=>{vT(e,r,n)},namespace:"scene-graph"},clear:{schema:["String"],handler:r=>{wT(e,r)},namespace:"scene-graph"}}})});function $T(t,e,r){if(nr(t,e))return;let n="",o;return typeof r=="string"?n=r:r!=null&&typeof r=="object"&&(n=r.value??"",Object.prototype.hasOwnProperty.call(r,"specificPatterns")&&(o=r.specificPatterns)),t.set([e,"textContent"],Ne({value:n,specificPatterns:o}))}var ET=p(()=>{fn();Do();a($T,"setTextContent")});function NT(t,e,r={}){if(nr(t,e))return;let n=typeof r=="string"?{value:r}:r;return t.update([e,"textContent"],(o={})=>{let s={...o,...n};return!Object.prototype.hasOwnProperty.call(n,"specificPatterns")&&o.specificPatterns!==void 0&&(s.specificPatterns=o.specificPatterns),Ne(s)})}var TT=p(()=>{fn();Do();a(NT,"updateTextContent")});function zT(t,e){return t.remove([e,"textContent"])}var OT=p(()=>{a(zT,"clearTextContent")});function ic(t,e,r=!0){return t.set([e,".editingTextContent"],r)}var PT=p(()=>{a(ic,"setEditingTextContent")});function IT(t,e){return t.remove([e,".editingTextContent"])}var CT=p(()=>{a(IT,"removeEditingTextContent")});import{defineContracts as ZU}from"@jucie.io/engine-message";var LU,RT=p(()=>{ET();TT();OT();PT();CT();LU=ZU("node:textContent",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");let r=null;return{set:{schema:["String","Object"],handler:(n,o)=>{$T(e,n,o)},namespace:"scene-graph"},update:{schema:["String","Object"],handler:(n,o)=>{NT(e,n,o)},namespace:"scene-graph"},clear:{schema:["String"],handler:n=>{zT(e,n)},namespace:"scene-graph"},"editing:enable":{schema:["String"],namespace:"scene-graph",handler:n=>(r&&(ic(e,r,!1),r=null),r=n,ic(e,n,!0),!0)},"editing:disable":{schema:"*",namespace:"scene-graph",handler:n=>(n?ic(e,n,!1):r&&(ic(e,r,!1),r=null),r=null,!0)},"editing:remove":{schema:["String"],namespace:"scene-graph",handler:n=>(IT(e,n),!0)}}})});function AT(t,e,r){return t.set([e,"type"],r)}var jT=p(()=>{a(AT,"setType")});function MT(t,e,r){return t.set([e,"type"],r)}var DT=p(()=>{a(MT,"updateType")});function ZT(t,e){return t.set([e,"type"],null)}var LT=p(()=>{a(ZT,"clearType")});import{defineContracts as FU}from"@jucie.io/engine-message";var UU,FT=p(()=>{jT();DT();LT();UU=FU("node:type",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{schema:["String","String"],handler:(r,n)=>{AT(e,r,n)},namespace:"scene-graph"},update:{schema:["String","String"],handler:(r,n)=>{MT(e,r,n)},namespace:"scene-graph"},clear:{schema:["String"],handler:r=>{ZT(e,r)},namespace:"scene-graph"}}})});function cc(t,e,r,n={}){let{name:o,bounds:s}=ec(r,n),i=t.get([e,"bounds"])??{};t.set([e,"frame"],r),t.set([e,"name"],o),t.update([e,"bounds"],()=>({...i,width:s.width,height:s.height}))}var oy=p(()=>{Lo();a(cc,"setFramePreset")});function UT(t,e,{name:r,width:n,height:o}){if(r==="custom"){cc(t,e,"custom",{name:r,width:n,height:o});return}if(!Qi(r))return new Error(`Invalid viewport name "${r}"`);cc(t,e,r)}var qT=p(()=>{Lo();oy();a(UT,"setViewport")});function VT(t,e){return t.set([e,"frame"],void 0),t.set([e,"viewport"],null)}var HT=p(()=>{a(VT,"clearViewport")});import{defineContracts as qU}from"@jucie.io/engine-message";var VU,BT=p(()=>{qT();oy();Ki();HT();VU=qU("node:viewport",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{schema:["String","Object"],handler:(r,n)=>{UT(e,r,n)},namespace:"scene-graph"},setPreset:{schema:["String","String","Object"],handler:(r,n,o={})=>{cc(e,r,n,o)},namespace:"scene-graph"},update:{schema:["String","Object"],handler:(r,n)=>{Wi(e,r,n)},namespace:"scene-graph"},clear:{schema:["String"],handler:r=>{VT(e,r)},namespace:"scene-graph"}}})});var GT={};R(GT,{setHtmlId:()=>sy});function sy(t,e,r){return t.set([e,"id"],r)}var ay=p(()=>{a(sy,"setHtmlId")});function JT(t,e){return t.set([e,"id"],null)}var WT=p(()=>{a(JT,"clearHtmlId")});import{defineContracts as HU}from"@jucie.io/engine-message";var BU,KT=p(()=>{ay();WT();BU=HU("node:id",t=>{let e=t("state")?.ref(["nodes"])??null;if(!e)throw new Error("Node cache not found");return{set:{namespace:"scene-graph",schema:["String","String"],handler:(r,n)=>{sy(e,r,n)}},clear:{namespace:"scene-graph",schema:["String"],handler:r=>{JT(e,r)}}}})});var YT=p(()=>{});var iy=p(()=>{});var XT=p(()=>{iy()});var QT=p(()=>{});var e1=p(()=>{});var t1=p(()=>{});var r1=p(()=>{});var T=p(()=>{YT();XT();iy();QT();e1();t1();r1()});var fa=p(()=>{});var sr=p(()=>{fa();T()});var uc=p(()=>{sr();T()});var n1=p(()=>{uc();T()});var o1=p(()=>{uc();T()});var s1=p(()=>{uc();T()});var a1=p(()=>{uc();T()});var i1=p(()=>{n1();o1();s1();a1()});var Fo=p(()=>{sr();T()});var c1=p(()=>{Fo();T()});var u1=p(()=>{Fo();T()});var l1=p(()=>{Fo();T()});var d1=p(()=>{Fo();T()});var p1=p(()=>{Fo();T()});var f1=p(()=>{Fo();T()});var m1=p(()=>{c1();u1();l1();d1();p1();f1()});var st=p(()=>{sr();T()});var h1=p(()=>{st();T()});var g1=p(()=>{st();T()});var y1=p(()=>{st();T()});var _1=p(()=>{st();T()});var x1=p(()=>{st();T()});var v1=p(()=>{st();T()});var b1=p(()=>{st();T()});var w1=p(()=>{st();T()});var k1=p(()=>{st();T()});var S1=p(()=>{st();T()});var $1=p(()=>{st();T()});var E1=p(()=>{st();T()});var N1=p(()=>{st();T()});var T1=p(()=>{st();T()});var z1=p(()=>{st();T()});var O1=p(()=>{st();T()});var P1=p(()=>{h1();g1();y1();_1();x1();v1();b1();w1();k1();S1();$1();E1();N1();T1();z1();O1()});var ma=p(()=>{sr();T()});var I1=p(()=>{ma();T()});var C1=p(()=>{ma();T()});var R1=p(()=>{ma();T()});var A1=p(()=>{ma();T()});var j1=p(()=>{ma();T()});var M1=p(()=>{I1();C1();R1();A1();j1()});var $r=p(()=>{sr();T()});var D1=p(()=>{$r();T()});var Z1=p(()=>{$r();T()});var L1=p(()=>{$r();T()});var F1=p(()=>{$r();T()});var U1=p(()=>{$r();T()});var q1=p(()=>{$r();T()});var V1=p(()=>{$r();T()});var H1=p(()=>{$r();T()});var B1=p(()=>{$r();T()});var G1=p(()=>{$r();T()});var J1=p(()=>{D1();Z1();L1();F1();U1();q1();V1();H1();B1();G1()});var Uo=p(()=>{sr();T()});var W1=p(()=>{Uo();T()});var K1=p(()=>{Uo();T()});var Y1=p(()=>{Uo();T()});var X1=p(()=>{Uo();T()});var Q1=p(()=>{Uo();T()});var ez=p(()=>{Uo();T()});var tz=p(()=>{W1();K1();Y1();X1();Q1();ez()});var ha=p(()=>{sr();T()});var rz=p(()=>{ha();T()});var nz=p(()=>{ha();T()});var oz=p(()=>{ha();T()});var sz=p(()=>{ha();T()});var az=p(()=>{ha();T()});var ar=p(()=>{sr();T()});var iz=p(()=>{ar();T()});var cz=p(()=>{rz();nz();oz();sz();az();iz()});var Wn=p(()=>{sr();T()});var uz=p(()=>{Wn();T()});var lz=p(()=>{Wn();T()});var dz=p(()=>{Wn();T()});var pz=p(()=>{Wn();T()});var fz=p(()=>{Wn();T()});var mz=p(()=>{Wn();T()});var hz=p(()=>{Wn();T()});var gz=p(()=>{uz();lz();dz();pz();fz();mz();hz()});var yz=p(()=>{ar();T()});var _z=p(()=>{ar();T()});var xz=p(()=>{ar();T()});var vz=p(()=>{ar();T()});var bz=p(()=>{ar();T()});var wz=p(()=>{ar();T()});var kz=p(()=>{ar();T()});var Sz=p(()=>{ar();T()});var $z=p(()=>{ar();T()});var Ez=p(()=>{ar();T()});var Nz=p(()=>{sr();T()});var Tz=p(()=>{sr();T()});var zz=p(()=>{yz();_z();xz();vz();bz();wz();kz();Sz();$z();Ez();Nz();Tz()});var Oz=p(()=>{T();i1();m1();P1();M1();J1();tz();cz();gz();zz()});var Pz=p(()=>{Lo()});var Iz=p(()=>{fa();T()});var Cz=p(()=>{T();Iz()});var Cd=p(()=>{T();fa()});var Az=p(()=>{T();Cd()});var jz=p(()=>{T();Cd()});var Mz=p(()=>{T()});var Dz=p(()=>{T();Cd()});var Zz=p(()=>{T();Az();jz();Mz();Dz()});var Lz=p(()=>{fa();T()});var Fz=p(()=>{Lz();T()});var Uz=p(()=>{T();Fz()});var qz=p(()=>{});var Vz=p(()=>{qz()});var Hz=p(()=>{fa();T()});var Bz=p(()=>{Oz();Pz();Cz();Zz();Uz();Vz();Hz()});var Gz,Jz=p(()=>{Gz=[{type:"element",displayName:"Fieldset",category:"form",swapGroup:null,keywords:["form"],tagName:"fieldset"},{type:"element",displayName:"Legend",category:"form",swapGroup:null,keywords:["form"],tagName:"legend"},{type:"element",displayName:"Progress",category:"form",swapGroup:null,keywords:["form"],tagName:"progress"},{type:"element",displayName:"Meter",category:"form",swapGroup:null,keywords:["form"],tagName:"meter"}]});var Wz,Kz=p(()=>{Wz=[{type:"element",displayName:"Heading 1",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h1"},{type:"element",displayName:"Heading 2",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h2"},{type:"element",displayName:"Heading 3",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h3"},{type:"element",displayName:"Heading 4",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h4"},{type:"element",displayName:"Heading 5",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h5"},{type:"element",displayName:"Heading 6",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h6"}]});var Yz,Xz=p(()=>{Yz=[{type:"element",displayName:"Radio",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"radio"},{type:"element",displayName:"Text",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"text"},{type:"element",displayName:"Checkbox",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"checkbox"},{type:"element",displayName:"Phone",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"phone"},{type:"element",displayName:"Email",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"email"},{type:"element",displayName:"Password",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"password"},{type:"element",displayName:"Select",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"select"},{type:"element",displayName:"Textarea",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"textarea"},{type:"element",displayName:"Number",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"number"},{type:"element",displayName:"Date",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"date"},{type:"element",displayName:"Range",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"range"},{type:"element",displayName:"File Upload",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"file"},{type:"element",displayName:"Search",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"search"},{type:"element",displayName:"Color Picker",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"color"},{type:"element",displayName:"Hidden",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"hidden"}]});var Qz,eO=p(()=>{Qz=[{type:"element",displayName:"Button",category:"interactive",swapGroup:"interactive",keywords:["interactive"],tagName:"button"},{type:"element",displayName:"Link",category:"interactive",swapGroup:"interactive",keywords:["interactive"],tagName:"a"},{type:"element",displayName:"Details",category:"interactive",swapGroup:null,keywords:["interactive"],tagName:"details"},{type:"element",displayName:"Summary",category:"interactive",swapGroup:null,keywords:["interactive"],tagName:"summary"},{type:"element",displayName:"Dialog",category:"interactive",swapGroup:null,keywords:["interactive"],tagName:"dialog"}]});var tO,rO=p(()=>{tO=[{type:"element",displayName:"Aside",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"aside"},{type:"element",displayName:"Footer",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"footer"},{type:"element",displayName:"Form",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"form"},{type:"element",displayName:"Header",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"header"},{type:"element",displayName:"Main",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"main"},{type:"element",displayName:"Section",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"section"},{type:"element",displayName:"Article",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"article"},{type:"element",displayName:"Nav",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"nav"},{type:"element",displayName:"Div",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"div"},{type:"element",displayName:"Template",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"template"}]});var nO,oO=p(()=>{nO=[{type:"element",displayName:"Ordered List",category:"lists",swapGroup:"list-container",keywords:["lists"],tagName:"ol"},{type:"element",displayName:"Unordered List",category:"lists",swapGroup:"list-container",keywords:["lists"],tagName:"ul"},{type:"element",displayName:"List Item",category:"lists",swapGroup:null,keywords:["lists"],tagName:"li"},{type:"element",displayName:"Definition List",category:"lists",swapGroup:"list-container",keywords:["lists"],tagName:"dl"},{type:"element",displayName:"Definition Term",category:"lists",swapGroup:null,keywords:["lists"],tagName:"dt"},{type:"element",displayName:"Definition Description",category:"lists",swapGroup:null,keywords:["lists"],tagName:"dd"}]});var sO,aO=p(()=>{sO=[{type:"element",displayName:"Image",category:"media",swapGroup:null,keywords:["media"],tagName:"img"},{type:"element",displayName:"Video",category:"media",swapGroup:null,keywords:["media"],tagName:"video"},{type:"element",displayName:"Audio",category:"media",swapGroup:null,keywords:["media"],tagName:"audio"},{type:"element",displayName:"Iframe",category:"media",swapGroup:null,keywords:["media"],tagName:"iframe"},{type:"element",displayName:"Figure",category:"media",swapGroup:null,keywords:["media"],tagName:"figure"},{type:"element",displayName:"Figcaption",category:"media",swapGroup:null,keywords:["media"],tagName:"figcaption"}]});var iO,cO=p(()=>{iO=[{type:"element",displayName:"Table",category:"tables",swapGroup:null,keywords:["tables"],tagName:"table"},{type:"element",displayName:"Table Head",category:"tables",swapGroup:null,keywords:["tables"],tagName:"thead"},{type:"element",displayName:"Table Body",category:"tables",swapGroup:null,keywords:["tables"],tagName:"tbody"},{type:"element",displayName:"Table Foot",category:"tables",swapGroup:null,keywords:["tables"],tagName:"tfoot"},{type:"element",displayName:"Table Row",category:"tables",swapGroup:null,keywords:["tables"],tagName:"tr"},{type:"element",displayName:"Table Header Cell",category:"tables",swapGroup:null,keywords:["tables"],tagName:"th"},{type:"element",displayName:"Table Cell",category:"tables",swapGroup:null,keywords:["tables"],tagName:"td"}]});var uO,lO=p(()=>{uO=[{type:"element",displayName:"Paragraph",category:"text",swapGroup:"text",keywords:["text"],tagName:"p"},{type:"element",displayName:"Label",category:"text",swapGroup:"text",keywords:["text"],tagName:"label"},{type:"element",displayName:"Span",category:"text",swapGroup:"text",keywords:["text"],tagName:"span"},{type:"element",displayName:"Blockquote",category:"text",swapGroup:null,keywords:["text"],tagName:"blockquote"},{type:"element",displayName:"Preformatted",category:"text",swapGroup:null,keywords:["text"],tagName:"pre"},{type:"element",displayName:"Code",category:"text",swapGroup:"text",keywords:["text"],tagName:"code"},{type:"element",displayName:"Strong",category:"text",swapGroup:"text",keywords:["text"],tagName:"strong"},{type:"element",displayName:"Emphasis",category:"text",swapGroup:"text",keywords:["text"],tagName:"em"},{type:"element",displayName:"Small",category:"text",swapGroup:"text",keywords:["text"],tagName:"small"},{type:"element",displayName:"Mark",category:"text",swapGroup:null,keywords:["text"],tagName:"mark"},{type:"element",displayName:"Horizontal Rule",category:"text",swapGroup:null,keywords:["text","divider"],tagName:"hr"},{type:"element",displayName:"Line Break",category:"text",swapGroup:null,keywords:["text"],tagName:"br"}]});var dO,pO=p(()=>{dO=[{type:"slot",displayName:"Slot",category:"special",keywords:["slot","placeholder","component","template"],tagName:"slot"}]});var n6,fO=p(()=>{Jz();Kz();Xz();eO();rO();oO();aO();cO();lO();pO();n6=[...tO,...Wz,...Yz,...Qz,...nO,...sO,...uO,...Gz,...iO,...dO]});var mO=p(()=>{});var hO=p(()=>{Bz();Ql();kd();hd();ig();Lo();fO();mO()});var gO=p(()=>{a$();h$();M$();V$();J$();CE();jE();LE();GE();QE();tN();aN();uN();pN();xN();vN();bN();$N();IN();jN();UN();qN();HN();KN();sT();mT();_T();ST();RT();FT();BT();KT();hO()});function Rd(){return`function () {
7
+ // Store state, computed, and actions are available on this
8
+ }`}var uy=p(()=>{a(Rd,"createCode")});var yO={};R(yO,{createAction:()=>pc});function pc({name:t,code:e=Rd()}){return{name:t,code:e}}var Ad=p(()=>{uy();a(pc,"createAction")});var _O={};R(_O,{addAction:()=>ly});function ly(t,e){return t.update([e,"actions"],(r=[])=>{let n=`action${r.length+1}`;return r.some(o=>o.name===n)||r.unshift(pc({name:n})),r})}var dy=p(()=>{Ad();a(ly,"addAction")});var fy={};R(fy,{updateAction:()=>py});function py(t,e,r,n){return t.update([e,"actions"],(o=[])=>(o[r]&&(o[r]=pc(n)),o))}var jd=p(()=>{Ad();a(py,"updateAction")});var xO={};R(xO,{removeAction:()=>my});function my(t,e,r){return t.update([e,"actions"],(n=[])=>(n[r]&&n.splice(r,1),n))}var hy=p(()=>{a(my,"removeAction")});import{defineContracts as o6}from"@jucie.io/engine-message";var s6,vO=p(()=>{dy();jd();hy();s6=o6("store:action",t=>{let e=t("state")?.ref(["stores"])??null;if(!e)throw new Error("Stores not found");return{add:{namespace:"scene-graph",schema:["String"],handler:r=>ly(e,r)},update:{namespace:"scene-graph",schema:["String","Number","Object"],handler:(r,n,o)=>py(e,r,n,o)},remove:{namespace:"scene-graph",schema:["String","Number"],handler:(r,n)=>my(e,r,n)}}})});var bO={};R(bO,{createComputed:()=>fc});function fc({name:t,code:e=Rd()}){return{name:t,code:e}}var Md=p(()=>{uy();a(fc,"createComputed")});var wO={};R(wO,{addComputed:()=>gy});function gy(t,e){return t.update([e,"computed"],(r=[])=>{let n=`computed${r.length+1}`;return r.some(o=>o.name===n)||r.unshift(fc({name:n})),r})}var yy=p(()=>{Md();a(gy,"addComputed")});var xy={};R(xy,{updateComputed:()=>_y});function _y(t,e,r,n){return t.update([e,"computed"],(o=[])=>(o[r]&&(o[r]=fc(n)),o))}var Dd=p(()=>{Md();a(_y,"updateComputed")});var kO={};R(kO,{removeComputed:()=>vy});function vy(t,e,r){return t.update([e,"computed"],(n=[])=>(n[r]&&n.splice(r,1),n))}var by=p(()=>{a(vy,"removeComputed")});import{defineContracts as a6}from"@jucie.io/engine-message";var i6,SO=p(()=>{yy();Dd();by();i6=a6("store:computed",t=>{let e=t("state")?.ref(["stores"])??null;if(!e)throw new Error("Stores not found");return{add:{schema:["String"],namespace:"scene-graph",handler:r=>{gy(e,r)}},update:{schema:["String","Number","Object"],namespace:"scene-graph",handler:(r,n,o)=>{_y(e,r,n,o)}},remove:{schema:["String","Number"],namespace:"scene-graph",handler:(r,n)=>{vy(e,r,n)}}}})});var $O={};R($O,{createValue:()=>mc});function mc({key:t,type:e,value:r=""}){return{key:t,type:e,value:r}}var Zd=p(()=>{a(mc,"createValue")});var EO={};R(EO,{addValue:()=>wy});function wy(t,e,r){return t.update([e,"state"],(n=[])=>{let o=`state${n.length+1}`;return n.some(s=>s.key===o)||n.unshift(mc({key:o,type:r||"string",value:""})),n})}var ky=p(()=>{Zd();a(wy,"addValue")});var $y={};R($y,{updateValue:()=>Sy});function Sy(t,e,r,n){return t.update([e,"state"],(o=[])=>(o[r]&&(o[r]=mc(n)),o))}var Ld=p(()=>{Zd();a(Sy,"updateValue")});var NO={};R(NO,{removeValue:()=>Ey});function Ey(t,e,r){return t.update([e,"state"],(n=[])=>(n[r]&&n.splice(r,1),n))}var Ny=p(()=>{a(Ey,"removeValue")});import{defineContracts as c6}from"@jucie.io/engine-message";var u6,TO=p(()=>{ky();Ld();Ny();u6=c6("store:state",t=>{let e=t("state")?.ref(["stores"])??null;if(!e)throw new Error("Stores not found");return{add:{schema:["String","String"],namespace:"scene-graph",handler:(r,n)=>{wy(e,r,n)}},update:{schema:["String","Number","Object"],namespace:"scene-graph",handler:(r,n,o)=>{Sy(e,r,n,o)}},remove:{schema:["String","Number"],namespace:"scene-graph",handler:(r,n)=>{Ey(e,r,n)}}}})});function zO({name:t,code:e="",state:r=[],computed:n=[],actions:o=[]}){return{name:t,code:e,state:r,computed:n,actions:o}}var OO=p(()=>{a(zO,"createStore")});var PO={};R(PO,{addStore:()=>Ty});function Ty(t,e){let r=zO({name:e});return t.set([e],r),e}var zy=p(()=>{OO();a(Ty,"addStore")});var IO={};R(IO,{removeStore:()=>Oy});function Oy(t,e){return t.remove([e])}var Py=p(()=>{a(Oy,"removeStore")});import{defineContracts as l6}from"@jucie.io/engine-message";var d6,CO=p(()=>{zy();Py();d6=l6("store",t=>{let e=t("state")?.ref(["stores"])??null;if(!e)throw new Error("Stores not found");return{get:{namespace:"scene-graph",handler:r=>r?e.get([r]):e.get()??{}},add:{schema:["String"],namespace:"scene-graph",handler:r=>Ty(e,r)},remove:{schema:["String"],namespace:"scene-graph",handler:r=>{Oy(e,r)}}}})});var RO=p(()=>{vO();SO();TO();CO()});var AO=p(()=>{});function Iy(t){if(!(!t||typeof t!="object"))for(let e of Object.keys(t)){let r=t[e];!r||typeof r!="object"||(r.type==="viewport"&&(r.type="frame"),"autoLayout"in r&&delete r.autoLayout)}}var jO=p(()=>{a(Iy,"normalizeViewportNodesToFrame")});var MO,DO=p(()=>{MO=[{type:"aside",displayName:"Aside",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"aside"},{type:"footer",displayName:"Footer",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"footer"},{type:"form",displayName:"Form",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"form"},{type:"header",displayName:"Header",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"header"},{type:"main",displayName:"Main",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"main"},{type:"section",displayName:"Section",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"section"},{type:"article",displayName:"Article",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"article"},{type:"nav",displayName:"Nav",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"nav"},{type:"div",displayName:"Div",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"div"},{type:"template",displayName:"Template",category:"layout",swapGroup:"layout",keywords:["layout"],tagName:"template"}]});var ZO,LO=p(()=>{ZO=[{type:"h1",displayName:"Heading 1",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h1"},{type:"h2",displayName:"Heading 2",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h2"},{type:"h3",displayName:"Heading 3",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h3"},{type:"h4",displayName:"Heading 4",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h4"},{type:"h5",displayName:"Heading 5",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h5"},{type:"h6",displayName:"Heading 6",keywords:["headings"],category:"headings",swapGroup:"headings",tagName:"h6"},{type:"p",displayName:"Paragraph",category:"text",swapGroup:"text",keywords:["text"],tagName:"p"},{type:"label",displayName:"Label",category:"text",swapGroup:"text",keywords:["text"],tagName:"label"},{type:"span",displayName:"Span",category:"text",swapGroup:"text",keywords:["text"],tagName:"span"},{type:"blockquote",displayName:"Blockquote",category:"text",swapGroup:null,keywords:["text"],tagName:"blockquote"},{type:"pre",displayName:"Preformatted",category:"text",swapGroup:null,keywords:["text"],tagName:"pre"},{type:"codeElement",displayName:"Code",category:"text",swapGroup:"text",keywords:["text"],tagName:"code"},{type:"strong",displayName:"Strong",category:"text",swapGroup:"text",keywords:["text"],tagName:"strong"},{type:"em",displayName:"Emphasis",category:"text",swapGroup:"text",keywords:["text"],tagName:"em"},{type:"small",displayName:"Small",category:"text",swapGroup:"text",keywords:["text"],tagName:"small"},{type:"mark",displayName:"Mark",category:"text",swapGroup:null,keywords:["text"],tagName:"mark"},{type:"hr",displayName:"Horizontal Rule",category:"text",swapGroup:null,keywords:["text","divider"],tagName:"hr"},{type:"br",displayName:"Line Break",category:"text",swapGroup:null,keywords:["text"],tagName:"br"}]});var FO,UO=p(()=>{FO=[{type:"button",displayName:"Button",category:"interactive",swapGroup:"interactive",keywords:["interactive"],tagName:"button"},{type:"a",displayName:"Link",category:"interactive",swapGroup:"interactive",keywords:["interactive"],tagName:"a"},{type:"details",displayName:"Details",category:"interactive",swapGroup:null,keywords:["interactive"],tagName:"details"},{type:"summary",displayName:"Summary",category:"interactive",swapGroup:null,keywords:["interactive"],tagName:"summary"},{type:"dialog",displayName:"Dialog",category:"interactive",swapGroup:null,keywords:["interactive"],tagName:"dialog"}]});var qO,VO=p(()=>{qO=[{type:"radio",displayName:"Radio",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"textInput",displayName:"Text",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"checkbox",displayName:"Checkbox",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"phone",displayName:"Phone",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"email",displayName:"Email",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"password",displayName:"Password",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"select",displayName:"Select",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"select"},{type:"textarea",displayName:"Textarea",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"textarea"},{type:"number",displayName:"Number",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"date",displayName:"Date",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"range",displayName:"Range",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"file",displayName:"File Upload",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"search",displayName:"Search",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"color",displayName:"Color Picker",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"},{type:"hidden",displayName:"Hidden",category:"inputs",swapGroup:null,keywords:["inputs"],tagName:"input"}]});var HO,BO=p(()=>{HO=[{type:"img",displayName:"Image",category:"media",swapGroup:null,keywords:["media"],tagName:"img"},{type:"video",displayName:"Video",category:"media",swapGroup:null,keywords:["media"],tagName:"video"},{type:"audio",displayName:"Audio",category:"media",swapGroup:null,keywords:["media"],tagName:"audio"},{type:"iframe",displayName:"Iframe",category:"media",swapGroup:null,keywords:["media"],tagName:"iframe"},{type:"figure",displayName:"Figure",category:"media",swapGroup:null,keywords:["media"],tagName:"figure"},{type:"figcaption",displayName:"Figcaption",category:"media",swapGroup:null,keywords:["media"],tagName:"figcaption"}]});var GO,JO=p(()=>{GO=[{type:"ol",displayName:"Ordered List",category:"lists",swapGroup:"list-container",keywords:["lists"],tagName:"ol"},{type:"ul",displayName:"Unordered List",category:"lists",swapGroup:"list-container",keywords:["lists"],tagName:"ul"},{type:"li",displayName:"List Item",category:"lists",swapGroup:null,keywords:["lists"],tagName:"li"},{type:"dl",displayName:"Definition List",category:"lists",swapGroup:"list-container",keywords:["lists"],tagName:"dl"},{type:"dt",displayName:"Definition Term",category:"lists",swapGroup:null,keywords:["lists"],tagName:"dt"},{type:"dd",displayName:"Definition Description",category:"lists",swapGroup:null,keywords:["lists"],tagName:"dd"}]});var WO,KO=p(()=>{WO=[{type:"table",displayName:"Table",category:"tables",swapGroup:null,keywords:["tables"],tagName:"table"},{type:"thead",displayName:"Table Head",category:"tables",swapGroup:null,keywords:["tables"],tagName:"thead"},{type:"tbody",displayName:"Table Body",category:"tables",swapGroup:null,keywords:["tables"],tagName:"tbody"},{type:"tfoot",displayName:"Table Foot",category:"tables",swapGroup:null,keywords:["tables"],tagName:"tfoot"},{type:"tr",displayName:"Table Row",category:"tables",swapGroup:null,keywords:["tables"],tagName:"tr"},{type:"th",displayName:"Table Header Cell",category:"tables",swapGroup:null,keywords:["tables"],tagName:"th"},{type:"td",displayName:"Table Cell",category:"tables",swapGroup:null,keywords:["tables"],tagName:"td"}]});var YO,XO=p(()=>{YO=[{type:"fieldset",displayName:"Fieldset",category:"form",swapGroup:null,keywords:["form"],tagName:"fieldset"},{type:"legend",displayName:"Legend",category:"form",swapGroup:null,keywords:["form"],tagName:"legend"},{type:"meter",displayName:"Meter",category:"form",swapGroup:null,keywords:["form"],tagName:"meter"},{type:"progress",displayName:"Progress",category:"form",swapGroup:null,keywords:["form"],tagName:"progress"}]});var QO,eP=p(()=>{QO=[{type:"slot",displayName:"Slot",category:"special",swapGroup:null,keywords:["slot","placeholder","component","template"],tagName:"slot"}]});var z$e,tP=p(()=>{gO();RO();ql();AO();Lo();jO();DO();LO();UO();VO();BO();JO();KO();XO();eP();z$e=[...MO,...ZO,...FO,...qO,...HO,...GO,...WO,...YO,...QO]});import{createHash as p6}from"crypto";function qo(t){let e=typeof t=="string"?t:JSON.stringify(t,f6);return p6("sha256").update(e).digest("hex")}function f6(t,e){return t.startsWith(".")?void 0:e}var hc=p(()=>{a(qo,"generateCID");a(f6,"filterDotKeys")});var Er,Cy,gc,rP=p(()=>{Cy=class Cy{constructor(e={}){j(this,Er,new Map);e&&Object.entries(e).forEach(([r,n])=>{_(this,Er).set(r,n)})}get(e){return _(this,Er).get(e)}set(e,r){_(this,Er).set(e,r)}has(e){return _(this,Er).has(e)}delete(e){_(this,Er).delete(e)}toObject(){return Object.fromEntries(_(this,Er))}getAllRids(){return Array.from(_(this,Er).keys())}pointsTo(e,r){return _(this,Er).get(e)===r}};Er=new WeakMap,a(Cy,"NodePointers");gc=Cy});import{writeFile as Ry,mkdir as yc,appendFile as Ay,readFile as jy,readdir as m6,rename as h6}from"fs/promises";import{join as ya}from"path";function nP(t,e){return JSON.stringify({cid:t,data:e},(r,n)=>{if(!r.startsWith("."))return n})}var Kn,_c,ft,_a,Yn,hn,ir,Vr,Ud,oP,qd,sP,Vd,aP,Hd,iP,My,Fd,cP=p(()=>{rP();hc();a(nP,"packLine");My=class My{constructor({name:e,defaultRoots:r={},sceneGraph:n,branch:o="main"}){j(this,Ud);j(this,qd);j(this,Vd);j(this,Hd);j(this,Kn,void 0);j(this,_c,void 0);j(this,ft,void 0);j(this,_a,void 0);j(this,Yn,void 0);j(this,hn,void 0);j(this,ir,new Map);j(this,Vr,new gc);oe(this,Kn,e),oe(this,_c,r),oe(this,_a,o),oe(this,ft,ya(n,e)),oe(this,Yn,ya(_(this,ft),`${e}.pack`)),oe(this,hn,ya(_(this,ft),`index-${o}.jsonl`))}get name(){return _(this,Kn)}get dir(){return _(this,ft)}get currentBranch(){return _(this,_a)}async loadData(){let e=await jy(_(this,Yn),"utf8").catch(()=>"");_(this,ir).clear();for(let i of e.trim().split(`
9
+ `).filter(Boolean))try{let{cid:c,data:u}=JSON.parse(i);_(this,ir).set(c,u)}catch{}let r=await jy(_(this,hn),"utf8").catch(()=>""),n={};for(let i of r.trim().split(`
10
+ `).filter(Boolean))try{let c=JSON.parse(i);for(let[u,l]of Object.entries(c))l==null?delete n[u]:n[u]=l}catch{}let o={},s={..._(this,_c)};for(let[i,c]of Object.entries(n)){if(!c||typeof c!="string")continue;let u=_(this,ir).get(c);u!==void 0?(s[i]=u,o[i]=c):console.warn(`[CAS:${_(this,Kn)}] CID not found for key "${i}" \u2014 pointer will be dropped`)}return oe(this,Vr,new gc(o)),console.log(`[CAS:${_(this,Kn)}] Loaded ${Object.keys(s).length} entries`),s}setupMatcher(e){e.matcher.createMatcher([_(this,Kn)],async r=>{if(r)for(let[n,o]of Object.entries(r))o?await Y(this,Ud,oP).call(this,n,o):await Y(this,qd,sP).call(this,n)})}switchBranch(e){oe(this,_a,e),oe(this,hn,ya(_(this,ft),`index-${e}.jsonl`))}async createBranch(e){let r=ya(_(this,ft),`index-${e}.jsonl`),n=_(this,Vr).toObject(),o=Object.entries(n).map(([s,i])=>JSON.stringify({[s]:i})).join(`
11
+ `);await yc(_(this,ft),{recursive:!0}),await Ry(r,o?o+`
12
+ `:"","utf8")}async garbageCollect(e={dryRun:!1}){let r=_(this,Vr).toObject(),n=Object.entries(r).filter(([,l])=>l!=null);if(!e.dryRun){let l=n.map(([d,m])=>JSON.stringify({[d]:m})).join(`
13
+ `);await yc(_(this,ft),{recursive:!0}),await Ry(_(this,hn),l?l+`
14
+ `:"","utf8")}let s=(await m6(_(this,ft)).catch(()=>[])).filter(l=>l.startsWith("index-")&&l.endsWith(".jsonl")),i=new Set;for(let l of s){let d=await jy(ya(_(this,ft),l),"utf8").catch(()=>"");for(let m of d.trim().split(`
15
+ `).filter(Boolean))try{let h=JSON.parse(m);Object.values(h).forEach(f=>{f&&i.add(f)})}catch{}}let u=[..._(this,ir).keys()].filter(l=>!i.has(l));if(!e.dryRun&&u.length>0){for(let m of u)_(this,ir).delete(m);let l=_(this,Yn)+".tmp",d=[..._(this,ir).entries()].map(([m,h])=>nP(m,h)).join(`
16
+ `);await Ry(l,d?d+`
17
+ `:"","utf8"),await h6(l,_(this,Yn))}return{deleted:u.length,kept:_(this,ir).size}}};Kn=new WeakMap,_c=new WeakMap,ft=new WeakMap,_a=new WeakMap,Yn=new WeakMap,hn=new WeakMap,ir=new WeakMap,Vr=new WeakMap,Ud=new WeakSet,oP=a(async function(e,r){if(!e||e==="undefined"||typeof e!="string")return;let n=qo(r);!n||typeof n!="string"||(_(this,ir).has(n)||(_(this,ir).set(n,r),await yc(_(this,ft),{recursive:!0}),await Ay(_(this,Yn),nP(n,r)+`
18
+ `,"utf8")),await Y(this,Vd,aP).call(this,e,n))},"#writeItem"),qd=new WeakSet,sP=a(async function(e){if(!e||e==="undefined")return;_(this,Vr).get(e)&&await Y(this,Hd,iP).call(this,e)},"#removeItem"),Vd=new WeakSet,aP=a(async function(e,r){!e||!r||_(this,Vr).pointsTo(e,r)||(_(this,Vr).set(e,r),await yc(_(this,ft),{recursive:!0}),await Ay(_(this,hn),JSON.stringify({[e]:r})+`
19
+ `,"utf8"))},"#setPointer"),Hd=new WeakSet,iP=a(async function(e){e&&(_(this,Vr).delete(e),await yc(_(this,ft),{recursive:!0}),await Ay(_(this,hn),JSON.stringify({[e]:null})+`
20
+ `,"utf8"))},"#deletePointer"),a(My,"CASNamespace");Fd=My});var Vo,xc,Bd=p(()=>{Vo={type:"root",children:[],meta:{childrenType:"children"}},xc=[{name:"nodes",defaultRoots:{app:Vo,temp:Vo,components:Vo}},{name:"animations",defaultRoots:{}},{name:"tokens",defaultRoots:{}}]});import{ServiceProvider as g6}from"@jucie.io/engine";import{Matcher as y6}from"@jucie.io/state-matcher";import{writeFile as _6,mkdir as x6,readFile as v6,readdir as b6,unlink as w6}from"fs/promises";import{join as uP}from"path";var Ho,Nr,xa,cr,va,Gd,vc,Dy,Jd,lP,Wd,gn,dP=p(()=>{tP();hc();cP();Bd();Wd=class Wd extends g6{constructor(){super(...arguments);j(this,va);j(this,vc);j(this,Jd);j(this,Ho,null);j(this,Nr,"main");j(this,xa,null);j(this,cr,new Map)}initialize(){oe(this,Ho,this.config.sceneGraph),oe(this,Nr,this.config.branch||"main"),oe(this,xa,uP(_(this,Ho),"branches.json"));let r=this.inject("state");if(!r)return;r.matcher||r.use(y6);let n=this.config.namespaces??xc;for(let o of n){let s=new Fd({name:o.name,defaultRoots:o.defaultRoots??{},sceneGraph:_(this,Ho),branch:_(this,Nr)});_(this,cr).set(o.name,s)}}actions(){return{generateCID:r=>qo(r),loadScene:()=>this.loadScene(),garbageCollect:r=>this.runGarbageCollection(r),createBranch:(r,n)=>this.createBranch(r,n),switchBranch:r=>this.switchBranch(r),listBranches:()=>this.listBranches(),getCurrentBranch:()=>_(this,Nr),deleteBranch:r=>this.deleteBranch(r)}}async loadScene(){console.time("\u23F1\uFE0F Total loadScene");let r=this.inject("state");if(r)try{for(let o of _(this,cr).values())await o.loadData();await this.runGarbageCollection();let n={};for(let o of _(this,cr).values())n[o.name]=await o.loadData();n.nodes&&Iy(n.nodes),r.load(n);for(let o of _(this,cr).values())o.setupMatcher(r);return console.timeEnd("\u23F1\uFE0F Total loadScene"),n}catch(n){console.warn("\u26A0\uFE0F Could not load scene, using default:",n.message)}}async createBranch(r,n){if(!r||r.includes("/")||r.includes("\\"))throw new Error(`Invalid branch name: ${r}`);for(let o of _(this,cr).values())await o.createBranch(r);return await Y(this,Jd,lP).call(this,r,{displayName:n||r,created:new Date().toISOString(),createdFrom:_(this,Nr)}),console.log(`\u{1F33F} Created branch '${r}' from '${_(this,Nr)}'`),r}async switchBranch(r){oe(this,Nr,r);for(let n of _(this,cr).values())n.switchBranch(r);return console.log(`\u{1F500} Switched to branch '${r}'`),r}async listBranches(){let r=[..._(this,cr).values()][0];if(!r)return[];let o=(await b6(r.dir).catch(()=>[])).filter(i=>i.startsWith("index-")&&i.endsWith(".jsonl")).map(i=>i.replace("index-","").replace(".jsonl","")),s=await Y(this,va,Gd).call(this);return o.map(i=>({name:i,current:i===_(this,Nr),...s[i]}))}async deleteBranch(r){if(r===_(this,Nr))throw new Error(`Cannot delete current branch '${r}'`);for(let o of _(this,cr).values()){let s=uP(o.dir,`index-${r}.jsonl`);await w6(s).catch(()=>{})}let n=await Y(this,va,Gd).call(this);return delete n[r],await Y(this,vc,Dy).call(this,n),console.log(`\u{1F5D1}\uFE0F Deleted branch '${r}'`),r}async runGarbageCollection(r={dryRun:!1}){console.log("\u{1F9F9} Starting garbage collection...");let n={};for(let o of _(this,cr).values())n[o.name]=await o.garbageCollect(r),console.log(`\u2705 GC [${o.name}]: removed ${n[o.name].deleted}, kept ${n[o.name].kept}`);return n}};Ho=new WeakMap,Nr=new WeakMap,xa=new WeakMap,cr=new WeakMap,va=new WeakSet,Gd=a(async function(){try{let r=await v6(_(this,xa),"utf8");return JSON.parse(r)}catch{return{}}},"#loadBranchesMetadata"),vc=new WeakSet,Dy=a(async function(r){await x6(_(this,Ho),{recursive:!0}),await _6(_(this,xa),JSON.stringify(r,null,2),"utf8")},"#saveBranchesMetadata"),Jd=new WeakSet,lP=a(async function(r,n){let o=await Y(this,va,Gd).call(this);o[r]={...o[r],...n},await Y(this,vc,Dy).call(this,o)},"#updateBranchMetadata"),a(Wd,"CAS"),Qe(Wd,"manifest",{name:"CAS",namespace:"cas"});gn=Wd});import{writeFileSync as ba,mkdirSync as Zy}from"fs";import{join as yn}from"path";function Ly(t){let e=yn(t,"nodes");Zy(e,{recursive:!0}),ba(yn(e,"nodes.pack"),JSON.stringify({cid:Kd,data:Vo})+`
21
+ `,"utf8"),ba(yn(e,"index-main.jsonl"),`${JSON.stringify({app:Kd})}
22
+ ${JSON.stringify({temp:Kd})}
23
+ ${JSON.stringify({components:Kd})}
24
+ `,"utf8");let r=yn(t,"animations");Zy(r,{recursive:!0}),ba(yn(r,"animations.pack"),"","utf8"),ba(yn(r,"index-main.jsonl"),"","utf8");let n=yn(t,"tokens");Zy(n,{recursive:!0}),ba(yn(n,"tokens.pack"),"","utf8"),ba(yn(n,"index-main.jsonl"),"","utf8")}var Kd,pP=p(()=>{hc();Bd();Kd=qo(Vo);a(Ly,"seedProject")});var bc=p(()=>{dP();hc();pP();Bd()});import{ServiceProvider as P6}from"@jucie.io/engine";import{Matcher as I6}from"@jucie.io/state-matcher";import{watch as C6}from"chokidar";import{readFile as R6,writeFile as A6,mkdir as j6,access as M6,constants as D6,unlink as Z6}from"fs/promises";import{glob as L6}from"glob";import wa from"path";import*as Qn from"recast";import{createHash as F6}from"crypto";import{parse as gP}from"@babel/parser";var Ae,yP,ka,wc,Bo,_n,Ue,xn,ep,vn,_P=p(()=>{({builders:Ae,namedTypes:yP}=Qn.types),ep=class ep extends P6{constructor(){super(...arguments);j(this,ka,new Set);j(this,wc,new Set);j(this,Bo,new Set);j(this,_n,null);j(this,Ue,null);j(this,xn,new Map)}initialize(r){let n=r("state");!n||!n.matcher||n.matcher||n.use(I6)}actions(){return{start:()=>this.start(),build:()=>this.build(),scanDirectory:r=>this.scanDirectory(r),watchDirectory:r=>this.watchDirectory(r),stopWatching:()=>this.stopWatching(),parse:r=>this.parse(r),generate:r=>this.generate(r),generateHash:r=>this.generateHash(r),parseAndStore:(r,n)=>this.parseAndStore(r,n),writeFile:(r,n)=>this.writeFile(r,n),removeFile:r=>this.removeFile(r),getStore:r=>this.inject("state")?.get(["stores",r]),getAllStores:()=>this.inject("state")?.get(["stores"])}}async generateHash(r){let n=F6("sha256"),o=r;return o.charCodeAt(0)===65279&&(o=o.slice(1)),o=o.replace(/\r\n/g,`
25
+ `),o=o.normalize("NFC"),n.update(o),n.digest("hex")}async start(r){try{if(oe(this,Ue,r||this.config.stores),!_(this,Ue))throw new Error("StoreParser start error: Base directory not defined");await this.scanDirectory(_(this,Ue)),this.watchDirectory(_(this,Ue));let n=this.inject("state"),o=n?.get(["stores"]);return n&&(!o||Object.keys(o).length===0)&&n.set(["stores","default"],{}),this}catch(n){return console.error("StoreParser start error",n),null}}async build(){return oe(this,Ue,this.config.stores),await this.scanDirectory(_(this,Ue)),this.inject("state").get(["stores"])}async scanDirectory(r){oe(this,Ue,r||this.config.stores),console.log("\u{1F50D} Scanning directory:",_(this,Ue));let n=await this.findAllStoreFiles(_(this,Ue));for(let o of n){let s=this.extractStoreName(o,_(this,Ue));await this.parseAndStore(o,s)}return console.log(`\u{1F4C2} Scanned ${n.length} store file(s)`),this.inject("state").get(["stores"])}async findAllStoreFiles(r){return L6.sync(`${r}/**/*.{js,mjs,ts}`,{ignore:"**/node_modules/**"})}watchDirectory(r){return oe(this,Ue,r||this.config.stores),console.log("\u{1F50D} Watching directory:",_(this,Ue)),oe(this,_n,C6(_(this,Ue),{ignored:/(^|[\/\\])\../,persistent:!0,ignoreInitial:!1,awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}})),_(this,_n).on("add",n=>this.handleFileAdded(n)).on("change",n=>this.handleFileChanged(n)).on("unlink",n=>this.handleFileDeleted(n)),this.inject("state").matcher.createMatcher(["stores"],async n=>{if(!n)return;let o=Object.entries(n);for(let[s,i]of o){if(!i){await this.removeFile(s);continue}try{let c=this.generate(i);await this.writeFile(s,c)}catch(c){console.error(`\u26A0\uFE0F Skipped writing store "${s}": ${c.message}`)}}}),console.log(`\u{1F441}\uFE0F Watching directory: ${r}`),_(this,_n)}async handleFileAdded(r){if(console.log("\u{1F50D} File added:",r),!this.isValidStoreFile(r))return;let n=this.extractStoreName(r,_(this,Ue));if(_(this,wc).has(n)){_(this,wc).delete(n);return}else await this.parseAndStore(r,n);console.log(`\u2795 Added store: ${n}`)}async handleFileChanged(r){if(console.log("\u{1F50D} File changed:",r),!this.isValidStoreFile(r))return;let n=this.extractStoreName(r,_(this,Ue));_(this,ka).has(n)?_(this,ka).delete(n):await this.parseAndStore(r,n),console.log(`\u{1F504} Updated store: ${n}`)}handleFileDeleted(r){console.log("\u{1F50D} File deleted:",r);let n=this.extractStoreName(r,_(this,Ue));if(_(this,xn).delete(n),_(this,Bo).has(n)){_(this,Bo).delete(n);return}else this.inject("state")?.remove(["stores",n]);console.log(`\u2796 Removed store: ${n}`)}async parseAndStore(r,n){try{let o=await R6(r,"utf8"),s=await this.generateHash(o),i=_(this,xn).get(n);if(s===i){console.log(`\u23ED\uFE0F Skipped parsing ${n} (no content change)`);return}let c=this.parse(o),u=this.inject("state");return u&&u.set(["stores",n],c),_(this,xn).set(n,s),c}catch(o){return console.error(` \u2717 Failed to parse ${n}:`,o.message),null}}extractStoreName(r,n){return wa.relative(n,r).replace(/\.(js|mjs|ts)$/,"").replace(/\\/g,"/")}isValidStoreFile(r){let n=[".js",".mjs",".ts"],o=wa.extname(r);return n.includes(o)}stopWatching(){_(this,_n)&&(_(this,_n).close(),oe(this,_n,null),console.log("\u{1F6D1} Store watcher stopped"))}async fileExists(r){try{return await M6(wa.join(_(this,Ue),`${r}.js`),D6.F_OK),!0}catch{return!1}}async writeFile(r,n){try{if(!r||!_(this,Ue))return;let o=await this.generateHash(n),s=_(this,xn).get(r);if(o===s){console.log(`\u23ED\uFE0F Skipped writing ${r} (no content change)`);return}let i=wa.join(_(this,Ue),`${r}.js`);console.log("\u{1F50D} Writing store file to:",i),_(this,ka).add(r),await j6(wa.dirname(i),{recursive:!0}),await A6(i,n,"utf8"),_(this,xn).set(r,o),console.log(`\u{1F4BE} Wrote store file: ${r}`)}catch(o){throw console.trace(`Failed to write store file: ${r}:`,o.message),new Error(`Failed to write store file: ${r}: ${o.message}`)}}async removeFile(r){if(!r||!_(this,Ue))return;let n=wa.join(_(this,Ue),`${r}.js`);try{_(this,Bo).add(r),await Z6(n),_(this,xn).delete(r),console.log(`\u{1F5D1}\uFE0F Removed store file: ${r}`)}catch(o){throw _(this,Bo).delete(r),console.error(`Failed to remove store file: ${r}:`,o.message),new Error(`Failed to remove store file: ${r}: ${o.message}`)}}parse(r){let n={};try{let s=Qn.parse(r,{parser:{parse(c){return gP(c,{sourceType:"module",plugins:["optionalChaining","nullishCoalescingOperator"]})}}}).program.body.find(c=>yP.ExportDefaultDeclaration.check(c));if(!s||!yP.ObjectExpression.check(s.declaration))throw new Error("No export default object found");return s.declaration.properties.forEach(c=>{if(!c||c.type!=="ObjectProperty")return;let u=c.key.name,l=c.value;u==="state"&&c.value.type==="ObjectExpression"?n.state=this.extractState(l):u==="computed"&&c.value.type==="ObjectExpression"?n.computed=this.extractFunctions(l):u==="actions"&&c.value.type==="ObjectExpression"&&(n.actions=this.extractFunctions(l))}),n}catch(o){throw console.error("Failed to parse store code:",o.message),new Error(`Invalid store code: ${o.message}`)}}generate(r){try{let n=this.buildAST(r);return Qn.print(n,{tabWidth:2,quote:"single",trailingComma:!1}).code}catch(n){throw console.error("Failed to generate store code:",n.message),new Error(`Code generation failed: ${n.message}`)}}buildAST(r){let n=[];if(r.state?.length>0){let i=this.buildStateObject(r.state);n.push(Ae.property("init",Ae.identifier("state"),i))}if(r.computed?.length>0){let i=this.buildFunctionsObject(r.computed);n.push(Ae.property("init",Ae.identifier("computed"),i))}if(r.actions?.length>0){let i=this.buildFunctionsObject(r.actions);n.push(Ae.property("init",Ae.identifier("actions"),i))}let o=Ae.objectExpression(n),s=Ae.exportDefaultDeclaration(o);return Ae.program([s])}buildStateObject(r){let n=r.map(o=>{let s=this.valueToASTNode(o.value),i=[Ae.property("init",Ae.identifier("type"),Ae.literal(o.type)),Ae.property("init",Ae.identifier("default"),s)],c=Ae.objectExpression(i);return Ae.property("init",Ae.identifier(o.key),c)});return Ae.objectExpression(n)}valueToASTNode(r){if(Array.isArray(r))return Ae.arrayExpression(r.map(n=>this.valueToASTNode(n)));if(typeof r=="object"&&r!==null){let n=Object.entries(r).map(([o,s])=>Ae.property("init",Ae.identifier(o),this.valueToASTNode(s)));return Ae.objectExpression(n)}else return Ae.literal(r)}buildFunctionsObject(r){let n=r.map(o=>{let i=Qn.parse(`(${o.code})`,{parser:{parse(c){return gP(c,{sourceType:"module",plugins:["optionalChaining","nullishCoalescingOperator"]})}}}).program.body[0].expression;return i.extra&&(i.extra.parenthesized=!1),Ae.property("init",Ae.identifier(o.name),i)});return Ae.objectExpression(n)}extractState(r){return r.properties.map(n=>{let o=n.key.name,s=n.value,i="string",c="";return s.type==="ObjectExpression"&&s.properties.forEach(u=>{u.key.name==="type"&&(u.value.type==="StringLiteral"||u.value.type==="Literal")&&(i=u.value.value),u.key.name==="default"&&(c=this.getLiteralValue(u.value))}),{key:o,type:i,value:c}})}extractFunctions(r){return r.properties.map(n=>{let o=n.key.name,s=n.value,i=Qn.print(s).code;return{name:o,code:i}})}getLiteralValue(r){if(r.type==="StringLiteral"||r.type==="NumericLiteral"||r.type==="BooleanLiteral"||r.type==="Literal")return r.value;if(r.type==="NullLiteral")return null;if(r.type==="ArrayExpression")return r.elements.map(n=>this.getLiteralValue(n));if(r.type==="ObjectExpression"){let n={};return r.properties.forEach(o=>{if(o.type==="ObjectProperty"||o.type==="Property"){let s=o.key.name||o.key.value;n[s]=this.getLiteralValue(o.value)}}),n}return""}};ka=new WeakMap,wc=new WeakMap,Bo=new WeakMap,_n=new WeakMap,Ue=new WeakMap,xn=new WeakMap,a(ep,"StoreParser"),Qe(ep,"manifest",{name:"StoreParser",namespace:"storeParser"});vn=ep});var tp=p(()=>{_P()});import{ServiceProvider as U6}from"@jucie.io/engine";import{readFile as kc,writeFile as qy,readdir as q6,cp as V6,mkdir as Sc,stat as H6,unlink as B6}from"fs/promises";import{join as Go,relative as G6,extname as J6,basename as rp,dirname as W6}from"path";import{existsSync as Vy}from"fs";import{watch as K6}from"chokidar";import{glob as Y6}from"glob";import{createHash as X6}from"crypto";import Q6 from"image-size";var bn,wn,Sa,$c,$a,We,np,Jo,xP=p(()=>{np=class np extends U6{constructor(){super(...arguments);j(this,bn,null);j(this,wn,new Map);j(this,Sa,new Set);j(this,$c,new Set);j(this,$a,new Set);j(this,We,null)}initialize(){this.validateConfig()}actions(){return{copyAssets:()=>this.copyAssets(),processHtml:()=>this.processHtml(),build:r=>this.build(r),watch:()=>this.watch(),scanDirectory:r=>this.scanDirectory(r),watchDirectory:r=>this.watchDirectory(r),stopWatching:()=>this.stopWatching(),parseAssetFile:r=>this.parseAssetFile(r),saveUploadedFile:(r,n)=>this.saveUploadedFile(r,n),deleteAsset:r=>this.deleteAsset(r),generateHash:r=>this.generateHash(r),getAllAssets:()=>this.inject("state")?.get(["assets"])}}validateConfig(){let{projectRoot:r,outdir:n}=this.config;if(!r)throw new Error("[StaticAssets] projectRoot is required in config");if(!n)throw new Error("[StaticAssets] outdir is required in config");console.log("[StaticAssets] Service initialized"),console.log(` Project root: ${r}`),console.log(` Output directory: ${n}`)}async copyAssets(){let{assets:r,outdir:n}=this.config;console.log(`
26
+ \u{1F4CB} Copying static assets...`);try{if(!r||!Vy(r))return console.log(" \u26A0\uFE0F No assets directory found, skipping asset copy"),{success:!0,fileCount:0,skipped:!0};console.log(` Source: ${r}`);let o=Go(n,"assets");await Sc(o,{recursive:!0}),console.log(` Target: ${o}`),console.log(" Copying files..."),await V6(r,o,{recursive:!0,force:!0,errorOnExist:!1});let s=await this.countFiles(o);return console.log(` \u2705 Copied ${s} asset file(s)`),{success:!0,fileCount:s,source:r,target:o}}catch(o){throw console.error(" \u274C Failed to copy assets:",o.message),new Error(`[StaticAssets] Asset copy failed: ${o.message}`)}}async processHtml({fontLinks:r=""}={}){let{projectRoot:n,outdir:o,name:s}=this.config,i=this.config.htmlTemplate||Go(n,"index.html");console.log(`
27
+ \u{1F4C4} Processing HTML template...`),console.log(` Template: ${i}`);try{if(!Vy(i))return console.log(" \u26A0\uFE0F Template not found, creating default HTML"),await this.createDefaultHtml(o,s,{fontLinks:r});console.log(" Reading template...");let c=await kc(i,"utf8");console.log(" Processing template variables..."),c=this.processTemplate(c,this.config),console.log(" Injecting meta tags..."),c=this.injectMetaTags(c,this.config),r&&(console.log(" Injecting font links..."),c=this.injectFontLinks(c,r)),console.log(" Validating HTML structure..."),this.validateHtml(c);let u=Go(o,"index.html");return await Sc(o,{recursive:!0}),await qy(u,c,"utf8"),console.log(` \u2705 HTML processed and written to ${u}`),{success:!0,usedDefault:!1,outputPath:u,templatePath:i}}catch(c){throw console.error(" \u274C Failed to process HTML:",c.message),new Error(`[StaticAssets] HTML processing failed: ${c.message}`)}}processTemplate(r,n){let o={PROJECT_NAME:n.name||"Jucie App",TITLE:n.html?.title||n.title||n.name||"Jucie App",DESCRIPTION:n.html?.description||n.description||"",FRAMEWORK:n.framework||"react",MODE:n.env||"production",BASE_URL:n.baseUrl||"/",LANG:n.html?.lang||"en",THEME_COLOR:n.html?.themeColor||"#000000"},s=r;for(let[i,c]of Object.entries(o))s=s.replace(new RegExp(`%${i}%`,"g"),c);for(let[i,c]of Object.entries(o))s=s.replace(new RegExp(`\\{\\{${i}\\}\\}`,"g"),c);return s}injectMetaTags(r,n){let{html:o={}}=n,s=[];if((o.description||n.description)&&s.push(`<meta name="description" content="${o.description||n.description}" />`),o.themeColor&&s.push(`<meta name="theme-color" content="${o.themeColor}" />`),o.meta&&Array.isArray(o.meta))for(let i of o.meta){let c=Object.entries(i).map(([u,l])=>`${u}="${l}"`).join(" ");s.push(`<meta ${c} />`)}if(s.length>0&&!r.includes("<!-- meta-injected -->")){let i=s.join(`
28
+ `);r=r.replace("</head>",` ${i}
29
+ <!-- meta-injected -->
30
+ </head>`)}return r}injectFontLinks(r,n){if(!n||r.includes("<!-- fonts-injected -->"))return r;let o=n.split(`
31
+ `).map(s=>` ${s}`).join(`
32
+ `);return r.replace("</head>",`${o}
33
+ <!-- fonts-injected -->
34
+ </head>`)}validateHtml(r){let n=[{pattern:/<div[^>]*id=["']app["']/,message:'Missing <div id="app"></div>'},{pattern:/type=["']module["']/,message:"Missing module script tag"},{pattern:/src=["']\/main\.js["']/,message:"Missing main.js reference"}];for(let{pattern:o,message:s}of n)o.test(r)||console.warn(` \u26A0\uFE0F ${s}`)}async createDefaultHtml(r,n,{fontLinks:o=""}={}){let{name:s,html:i={}}=this.config,c=o?`${o.split(`
35
+ `).map(l=>` ${l}`).join(`
36
+ `)}
37
+ <!-- fonts-injected -->
38
+ `:"",u=`<!DOCTYPE html>
39
+ <html lang="${i.lang||"en"}">
40
+ <head>
41
+ <meta charset="UTF-8" />
42
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
43
+ <title>${i.title||s||"Jucie App"}</title>
44
+ ${i.description?`<meta name="description" content="${i.description}" />`:""}
45
+ ${i.themeColor?`<meta name="theme-color" content="${i.themeColor}" />`:""}
46
+ ${i.favicon?`<link rel="icon" href="${i.favicon}" />`:""}
47
+ ${c} <style>
48
+ *, *::before, *::after { box-sizing: border-box; }
49
+ html, body { margin: 0; padding: 0; }
50
+ </style>
51
+ </head>
52
+ <body>
53
+ <div id="app" data-rid="app" data-node-id="app"></div>
54
+ <script type="module" src="/main.js"></script>
55
+ </body>
56
+ </html>`;return await Sc(r,{recursive:!0}),await qy(Go(r,"index.html"),u,"utf8"),{success:!0,usedDefault:!0}}async countFiles(r){try{let n=await q6(r,{withFileTypes:!0}),o=0;for(let s of n)s.isFile()?o++:s.isDirectory()&&(o+=await this.countFiles(Go(r,s.name)));return o}catch(n){return console.warn(` \u26A0\uFE0F Error counting files in ${r}:`,n.message),0}}async build({fontLinks:r=""}={}){console.log(`
57
+ \u{1F3A8} Processing static assets...`);try{let n=await this.copyAssets(),o=await this.processHtml({fontLinks:r});return console.log(`
58
+ \u2705 Static assets processed successfully`),{success:!0,assets:n,html:o}}catch(n){throw console.error(`
59
+ \u274C Static assets processing failed:`,n.message),n}}async watch(r){return oe(this,We,r||this.config.assets),console.log("\u{1F441}\uFE0F Starting asset watcher..."),console.log(` Assets directory: ${_(this,We)}`),await this.scanDirectory(_(this,We)),this.watchDirectory(_(this,We)),this.inject("state")?.get(["assets"])}async scanDirectory(r){oe(this,We,r||this.config.assets),console.log("\u{1F50D} Scanning assets directory:",_(this,We));try{if(!Vy(_(this,We)))return console.log(" \u26A0\uFE0F Assets directory not found, creating it..."),await Sc(_(this,We),{recursive:!0}),{};let n=await this.findAllAssetFiles(_(this,We)),o={};for(let i of n)try{let c=await this.parseAssetFile(i);if(c){o[c.id]=c;let u=await kc(i),l=await this.generateHash(u);_(this,wn).set(i,l)}}catch(c){console.warn(` \u26A0\uFE0F Failed to parse ${i}:`,c.message)}let s=this.inject("state");return s&&s.set(["assets"],o),console.log(`\u{1F4C2} Scanned ${n.length} asset file(s)`),o}catch(n){throw console.error(" \u274C Failed to scan directory:",n.message),n}}async findAllAssetFiles(r){return Y6.sync(`${r}/**/*.*`,{ignore:["**/node_modules/**","**/.gitkeep","**/.*"],nodir:!0})}async parseAssetFile(r){try{_(this,We)||oe(this,We,this.config.assets);let n=await H6(r),o=G6(_(this,We),r).replace(/\\/g,"/"),s=J6(r).slice(1),i=rp(r),c=await kc(r),u=await this.generateHash(c),l=this.getMimeType(s),d=this.getAssetType(s),m={id:o,name:i,path:o,hash:u,url:`/assets/${o}`,extension:s,size:n.size,mimeType:l,type:d,lastModified:n.mtime.toISOString()};if(d==="image")try{let h=Q6(r);m.dimensions={width:h.width,height:h.height}}catch{console.warn(` \u26A0\uFE0F Could not get dimensions for ${i}`)}return m}catch(n){return console.error(` \u274C Error parsing asset file ${r}:`,n.message),null}}watchDirectory(r){return oe(this,We,r||this.config.assets),console.log("\u{1F441}\uFE0F Watching assets directory:",_(this,We)),oe(this,bn,K6(_(this,We),{ignored:/(^|[\/\\])\../,persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:100,pollInterval:50}})),_(this,bn).on("add",n=>this.handleFileAdded(n)).on("change",n=>this.handleFileChanged(n)).on("unlink",n=>this.handleFileDeleted(n)),_(this,bn)}async handleFileAdded(r){if(console.log("\u{1F50D} File added:",r),!this.isValidAssetFile(r))return;if(_(this,Sa).has(r)){_(this,Sa).delete(r);return}let n=await this.parseAssetFile(r);if(n){let o=this.inject("state");o&&o.set(["assets",n.id],n);let s=await kc(r),i=await this.generateHash(s);_(this,wn).set(r,i),console.log(`\u2795 Added asset: ${n.name}`)}}async handleFileChanged(r){if(console.log("\u{1F50D} File changed:",r),!this.isValidAssetFile(r))return;if(_(this,$c).has(r)){_(this,$c).delete(r);return}let n=await kc(r),o=await this.generateHash(n),s=_(this,wn).get(r);if(o===s){console.log(`\u23ED\uFE0F Skipped ${rp(r)} (no content change)`);return}let i=await this.parseAssetFile(r);if(i){let c=this.inject("state");c&&c.set(["assets",i.id],i),_(this,wn).set(r,o),console.log(`\u{1F504} Updated asset: ${i.name}`)}}async handleFileDeleted(r){console.log("\u{1F50D} File deleted:",r);let n=rp(r);if(_(this,$a).has(r)){_(this,$a).delete(r);return}let o=this.inject("state");if(o){let s=o.get(["assets"])||{},i=Object.keys(s).find(c=>s[c].name===n);i&&o.remove(["assets",i])}_(this,wn).delete(r),console.log(`\u2796 Removed asset: ${n}`)}async saveUploadedFile(r,n){try{_(this,We)||oe(this,We,this.config.assets);let o=n.name,s=Go(_(this,We),o);_(this,Sa).add(s),await Sc(W6(s),{recursive:!0}),await qy(s,r),console.log(`\u{1F4BE} Saved uploaded file: ${o}`);let i=await this.parseAssetFile(s);if(i){let c=this.inject("state");c&&c.set(["assets",i.id],i)}return i}catch(o){throw console.error(" \u274C Failed to save uploaded file:",o.message),o}}async deleteAsset(r){try{let n=Go(_(this,We),r);_(this,$a).add(n),await B6(n),_(this,wn).delete(n),console.log(`\u{1F5D1}\uFE0F Deleted asset: ${r}`)}catch(n){throw console.error(` \u274C Failed to delete asset ${r}:`,n.message),n}}stopWatching(){_(this,bn)&&(_(this,bn).close(),oe(this,bn,null),console.log("\u{1F6D1} Asset watcher stopped"))}async generateHash(r){let n=X6("sha256"),o=r;return typeof r=="string"&&(o.charCodeAt(0)===65279&&(o=o.slice(1)),o=o.replace(/\r\n/g,`
60
+ `),o=o.normalize("NFC")),n.update(o),n.digest("hex")}getMimeType(r){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",svg:"image/svg+xml",webp:"image/webp",ico:"image/x-icon",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",mov:"video/quicktime",mp3:"audio/mpeg",wav:"audio/wav",oga:"audio/ogg",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",json:"application/json",txt:"text/plain",css:"text/css",js:"text/javascript"}[r.toLowerCase()]||"application/octet-stream"}getAssetType(r){let n=["jpg","jpeg","png","gif","svg","webp","ico"],o=["mp4","webm","ogg","mov"],s=["mp3","wav","ogg"],i=["pdf","doc","docx"],c=["woff","woff2","ttf","otf"],u=r.toLowerCase();return n.includes(u)?"image":o.includes(u)?"video":s.includes(u)?"audio":i.includes(u)?"document":c.includes(u)?"font":"other"}isValidAssetFile(r){let n=rp(r);return!(n.startsWith(".")||r.includes("node_modules")||n===".gitkeep")}};bn=new WeakMap,wn=new WeakMap,Sa=new WeakMap,$c=new WeakMap,$a=new WeakMap,We=new WeakMap,a(np,"StaticAssets"),Qe(np,"manifest",{name:"Static Assets",namespace:"staticAssets",version:"1.0.0",description:"Handles static asset copying and HTML processing for builds"});Jo=np});var Hy=p(()=>{xP()});import{defineEsPlugin as uq}from"@jucie.io/engine-esbuild";var Ko,PP=p(()=>{Ko=uq("jucie-scene",t=>{let e=t("state");return r=>{r.onResolve({filter:/^jucie:scene$/},()=>({path:"virtual:scene",namespace:"scene"})),r.onLoad({filter:/.*/,namespace:"scene"},()=>({contents:`export const scene = ${JSON.stringify(e.get())};`,loader:"js"}))}})});import{defineEsPlugin as lq}from"@jucie.io/engine-esbuild";function dq(t){let e=t.location;return e?`${t.text} (${e.file}:${e.line}:${e.column})`:t.text}function Ky({onFirstBuild:t}={}){return lq("build-status",e=>{let r=e("log"),n=!0;return o=>{o.onEnd(s=>{let i=(s.errors??[]).map(dq);i.length&&r.error("stage bundle build failed",{errors:i}),n&&(n=!1,t?.({errors:i}))})}})}var IP=p(()=>{a(dq,"formatError");a(Ky,"createBuildStatusPlugin")});function CP(t){let e=Oc[t]||Oc.react,r={};for(let[n,o]of Object.entries(e))r[o]=`/${n}.js`;return r}var Oc,Yy=p(()=>{Oc={vue:{framework:"vue","framework-jsx-runtime":"vue/jsx-runtime"},react:{framework:"react","framework-jsx-runtime":"react/jsx-runtime","framework-dom":"react-dom","framework-dom-client":"react-dom/client"},preact:{framework:"preact","framework-jsx-runtime":"preact/jsx-runtime","framework-hooks":"preact/hooks","framework-compat":"preact/compat"}};a(CP,"frameworkUrlMap")});import{defineEsPlugin as pq}from"@jucie.io/engine-esbuild";function fq(t){return t.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&")}var Xy,RP=p(()=>{Yy();a(fq,"escapeRegex");Xy=pq("prebuilt-externals",t=>{let e=t("cache");return r=>{let n=e.get(["jucieConfig","framework"])||"react",o=CP(n),s=new RegExp(`^(${Object.keys(o).map(fq).join("|")})$`);r.onResolve({filter:s},i=>({path:o[i.path],external:!0})),r.onResolve({filter:/^jucie:sdk$/},()=>({path:"/sdk.js",external:!0}))}})});import{defineEsPlugin as mq}from"@jucie.io/engine-esbuild";var Pc,AP=p(()=>{Pc=mq("jucie-config",t=>{let e=t("cache");return r=>{r.onResolve({filter:/^jucie:config$/},()=>({path:"virtual:config",namespace:"config"})),r.onLoad({filter:/.*/,namespace:"config"},()=>({contents:`export const jucieConfig = ${JSON.stringify(e.get(["jucieConfig"]))};`,loader:"js"}))}})});import{defineEsPlugin as hq}from"@jucie.io/engine-esbuild";var Na,jP=p(()=>{Na=hq("notify-rebuild",t=>{let e=t("cache"),r=t("log");return n=>{n.onEnd(()=>{let o=e.get(["sseClients"]);try{if(!o)return;for(let s of o)s.write(`event: change
61
+ data: {}
62
+
63
+ `)}catch(s){r.error("SSE broadcast failed",{error:s.message})}})}})});import{join as gq}from"path";import{readdirSync as yq,existsSync as Qy,statSync as _q}from"fs";import{defineEsPlugin as xq}from"@jucie.io/engine-esbuild";function e_(t){return t?(Array.isArray(t)?t:[t]).map(r=>typeof r=="string"?{type:"directory",path:r}:r&&typeof r=="object"&&r.name&&r.from?{type:"library",name:r.name,from:r.from,manifest:r.manifest||null}:(console.warn("[jucie] Invalid components entry (skipped):",r),null)).filter(Boolean):[]}function vq(t){return Qy(t)?yq(t).filter(r=>{if(!r.endsWith(".js")||r==="index.js")return!1;let n=gq(t,r);return _q(n).isFile()}).map(r=>{let n=r.replace(".js",""),s=n.split(/[-_]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")||n.charAt(0).toUpperCase()+n.slice(1),i={displayName:s.replace(/([A-Z])/g," $1").trim(),category:"components",keywords:[n,"component"],tagName:n};return{fileName:r,name:n,exportName:s,meta:i}}):[]}function MP(t){return JSON.stringify(String(t).replaceAll("\\","/"))}function bq({components:t,libraries:e}){let r=t.map(u=>`import ${u.exportName} from './${u.fileName}';`),n=e.flatMap(u=>{let l=[`import * as _${u.name}Raw from ${MP(u.from)};`];return u.manifest&&l.push(`import ${u.name}Manifest from ${MP(u.manifest)};`),l}),o=t.map(u=>{let l=JSON.stringify(u.meta,null,2).split(`
64
+ `).join(`
65
+ `);return` ${u.exportName}: ${l}`}),s=t.map(u=>` ${u.exportName}`),i=e.map(u=>u.manifest?[`const ${u.name}Components = Object.fromEntries(`,` Object.keys(${u.name}Manifest)`,` .filter(key => key in _${u.name}Raw)`,` .map(key => [key, _${u.name}Raw[key]])`,");"].join(`
66
+ `):`const ${u.name}Components = _${u.name}Raw;`),c=e.map(u=>` ${u.name}: { components: ${u.name}Components, manifest: ${u.manifest?`${u.name}Manifest`:"null"} }`);return["// Local component imports",...r,"","// Library imports",...n,"","// Local components object","const localComponents = {",s.join(`,
67
+ `),"};","","// Local component manifest (built at scan time)","const localManifest = {",o.join(`,
68
+ `),"};","","// Library component objects (manifest-filtered or raw)",...i,"","// Unified namespace map","export default {"," local: { components: localComponents, manifest: localManifest },",...c.map(u=>` ${u.trimStart()},`),"};"].join(`
69
+ `).trim()}var to,t_=p(()=>{to=xq("directory-components",(t,e)=>r=>{r.onResolve({filter:/^@components$/},()=>({path:"@components",namespace:"components-dir"})),r.onLoad({filter:/.*/,namespace:"components-dir"},()=>{let n=e_(e.components||e.componentsDir),o=n.filter(d=>d.type==="directory"),s=n.filter(d=>d.type==="library"),i=o.flatMap(d=>vq(d.path)),u=o.find(d=>Qy(d.path))?.path||e.root||process.cwd();return{contents:bq({components:i,libraries:s}),loader:"js",resolveDir:u,watchDirs:o.map(d=>d.path).filter(d=>Qy(d))}})});a(e_,"normalizeEntries");a(vq,"scanComponentsDirectory");a(MP,"toImportSpecifier");a(bq,"getContents")});import{defineEsPlugin as wq}from"@jucie.io/engine-esbuild";import{createRequire as kq}from"module";var Sq,DP,Yo,ZP=p(()=>{Sq=kq(import.meta.url),DP={react:"@packages/jucie-sdk/react",vue:"@packages/jucie-sdk/vue",preact:"@packages/jucie-sdk/preact",angular:"@packages/jucie-sdk/angular"},Yo=wq("jucie-sdk",t=>{let e=t("cache");return r=>{r.onResolve({filter:/^jucie:sdk$/},()=>{let n=e.get(["jucieConfig","framework"])||"react",o=DP[n]||DP.react;return{path:Sq.resolve(o),external:!1}})}})});import{join as $q}from"path";import{existsSync as Eq}from"fs";import{defineEsPlugin as Nq}from"@jucie.io/engine-esbuild";var Tq,ro,LP=p(()=>{Tq=`export const __jucieMainStub = true;
70
+ `,ro=Nq("jucie-main",t=>{let e=t("cache");return r=>{r.onResolve({filter:/^jucie:main$/},()=>{let n=e.get(["jucieConfig","projectRoot"])||process.cwd(),o=$q(n,"src","main.js");return Eq(o)?{path:o,external:!1}:{path:"virtual:jucie-main",namespace:"jucie-main"}}),r.onLoad({filter:/.*/,namespace:"jucie-main"},()=>({contents:Tq,loader:"js"}))}})});var no=p(()=>{PP();IP();RP();AP();jP();t_();ZP();LP()});function s_(t,e){yp&&(t>o_||(Rc.push(e),Rc.length>JP&&Rc.shift()))}function a_(){return new Date().toISOString()}function $n(t){return t&&(t.onSuccess=e=>(Ot(t)&&e(t),t),t.onFailure=e=>(lr(t)&&e(t),t),t.onError=e=>(oo(t)&&e(t),t),t)}function WP(t,e){return Ot(t)&&e(t),$n(t)}function KP(t,e){return lr(t)&&e(t),$n(t)}function YP(t,e){return oo(t)&&e(t),$n(t)}function Sn(t,e={},r){let n={kind:"success",ok:!0,value:t,data:e,code:r,timestamp:a_(),toJSON(){return{kind:"success",ok:!0,value:this.value,data:this.data,code:this.code,timestamp:this.timestamp,[Qo]:!0}}};return s_(Ac.info,["SUCCESS",n]),$n(n)}function es(t,e={},r){let n={kind:"failure",ok:!1,reason:t,data:e,code:r,timestamp:a_(),toJSON(){return{kind:"failure",ok:!1,reason:this.reason,data:this.data,code:this.code,timestamp:this.timestamp,[Qo]:!0}}};return s_(Ac.warn,["FAILURE",n]),$n(n)}function ts(t,e={},r){let n=new Error(t);if(n.kind="error",n.ok=!1,n.code=r,n.data=e,n.timestamp=a_(),s_(Ac.error,["ERROR",{message:t,code:r,data:e,stack:n.stack}]),Cc)throw n;return $n(n)}function i_(t){return!!(t&&typeof t=="object"&&"kind"in t&&"ok"in t)}function Ot(t){return t?.kind==="success"&&t?.ok===!0}function lr(t){return t?.kind==="failure"&&t?.ok===!1}function oo(t){return t instanceof Error&&t.kind==="error"}function c_(t){if(Ot(t))return t.value;throw new Error("Cannot get value from non-success result")}function XP(t){if(lr(t))return t.reason;throw new Error("Cannot get reason from non-failure result")}function QP(t){return Ot(t)||lr(t)?t.data||{}:{}}function eI(t,e){return Ot(t)?Sn(e(t.value,t),t.data,t.code):t}function tI(t,e){if(lr(t)){let r=e(t.reason,t);return es(r??t.reason,t.data,t.code)}return t}function rI(t,e){if(Ot(t)){let r=e(t.value,t);return i_(r)?r:Sn(r)}return t}function nI(t,{success:e,failure:r}){return Ot(t)&&typeof e=="function"&&e(t),lr(t)&&typeof r=="function"&&r(t),t}function oI(t,e){return Ot(t)?t.value:e}function sI(t,e){return Ot(t)?t.value:e(t)}function u_(t,{success:e,failure:r,error:n}){if(Ot(t))return e?e(t):void 0;if(lr(t))return r?r(t):void 0;if(oo(t))return n?n(t):void 0;throw new Error("Unknown result shape")}async function aI(t,{failureCode:e,mapError:r}={}){try{let n=await t;return Sn(n)}catch(n){if(typeof r=="function"){let o=r(n)||{};return es(o.reason??"Operation failed",o.data,o.code??e)}return ts(n?.message||"Unhandled error",{original:n},e)}}async function iI(t){let e=await Promise.all(t);for(let r of e)if(lr(r)||oo(r))return r;return Sn(e.map(c_))}function cI(t){return u_($n(t),{success:e=>({kind:"success",ok:!0,value:e.value,data:e.data,code:e.code,timestamp:e.timestamp,[Qo]:!0}),failure:e=>({kind:"failure",ok:!1,reason:e.reason,data:e.data,code:e.code,timestamp:e.timestamp,[Qo]:!0}),error:e=>({kind:"error",ok:!1,message:e.message,code:e.code,data:e.data,timestamp:e.timestamp,[Qo]:!0})})}function l_(t){return!t||typeof t!="object"||!t[Qo]?t:t.kind==="success"?Sn(t.value,t.data,t.code):t.kind==="failure"?es(t.reason,t.data,t.code):t.kind==="error"?ts(t.message||"Remote error",t.data,t.code):t}function d_(t,e){return e&&e[Qo]&&e.kind?l_(e):e}function p_(t){return JSON.parse(t,d_)}async function uI(t,e={}){try{let n=await(await fetch(t,{...e,headers:{"Content-Type":"application/json",...e.headers}})).text();return p_(n)}catch(r){let n=Cc;Cc=!1;let o=ts(r.message||"Network request failed",{url:t,originalError:r.message,options:e},"NETWORK_ERROR");return Cc=n,o}}var Ac,yp,JP,o_,Cc,Rc,Qo,jc,lI=p(()=>{Ac={error:0,warn:1,info:2,debug:3},yp=!1,JP=100,o_=Ac.error,Cc=!0,Rc=[];a(s_,"addToLog");a(a_,"nowIso");Qo="_result";a($n,"withChains");a(WP,"onSuccess");a(KP,"onFailure");a(YP,"onError");a(Sn,"makeSuccess");a(es,"makeFailure");a(ts,"makeError");a(i_,"isResult");a(Ot,"isSuccess");a(lr,"isFailure");a(oo,"isError");a(c_,"getValue");a(XP,"getReason");a(QP,"getData");a(eI,"map");a(tI,"mapFailure");a(rI,"flatMap");a(nI,"tap");a(oI,"unwrapOr");a(sI,"unwrapOrElse");a(u_,"match");a(aI,"fromPromise");a(iI,"all");a(cI,"toWire");a(l_,"fromWire");a(d_,"revive");a(p_,"parse");a(uI,"fetchResult");jc={success:Sn,failure:es,error:ts,createSuccess:Sn,createFailure:es,createError:ts,enableLog(){yp=!0},disableLog(){yp=!1},setMaxLog(t){JP=t},setLogLevel(t){o_=Ac[t]??o_},setThrowErrors(t){Cc=!!t},printLog(){if(yp)for(let t of Rc)console.log(t)},clearLog(){Rc.length=0},isResult:i_,isSuccess:Ot,isFailure:lr,isError:oo,successful:Ot,failed:lr,errored:oo,getValue:c_,getReason:XP,getData:QP,map:eI,mapFailure:tI,flatMap:rI,tap:nI,unwrapOr:oI,unwrapOrElse:sI,match:u_,fromPromise:aI,all:iI,toWire:cI,fromWire:l_,revive:d_,parse:p_,fetch:uI,onSuccess:WP,onFailure:KP,onError:YP,withChains:$n}});var f_=p(()=>{lI()});import{defineEsConfig as Jq}from"@jucie.io/engine-esbuild";import{dirname as Wq,join as Kq}from"path";import{fileURLToPath as Yq}from"url";var Xq,dI,pI=p(()=>{Xq=a(()=>{let t=Yq(import.meta.url);return Wq(t)},"getBundleDir"),dI=Jq("previewConfig",(t,e)=>({entryPoints:[Kq(Xq(),"entry.js")],bundle:!0,format:"esm",platform:"browser",sourcemap:!0,sourcesContent:!0,target:["es2020"],jsx:"automatic",jsxImportSource:e.framework==="preact"?"preact":e.framework==="vue"?"vue":"react",loader:{".js":"jsx",".ts":"ts",".tsx":"tsx",".d.ts":"ts"},define:{"process.env.NODE_ENV":JSON.stringify(process.env.NODE_ENV||"development"),"process.env.BASE_URL":JSON.stringify("/"),"process.env.JUCIE_FRAMEWORK":JSON.stringify(e.framework||"react")},treeShaking:!0,splitting:!0,chunkNames:"chunks/[name]-[hash]",assetNames:"assets/[name]-[hash]",external:["fs","path","crypto","stream","http","https","url","querystring","child_process","os","util","zlib","node:crypto","node:http","node:util","node:fs","node:path","firebase-admin","@google-cloud/*","@fastify/*","google-auth-library","google-gax","gtoken","gcp-metadata","teeny-request","jwks-rsa","agent-base","@aws-sdk/client-s3"],outExtension:{".js":".js",".css":".css"}}))});function fI(t){return{[m_]:String(t)}}function _p(t,...e){let r="";for(let n=0;n<t.length;n++)if(r+=t[n],n<e.length){let o=e[n];r+=o&&o[m_]!==void 0?o[m_]:String(o).replace(/[&<>"']/g,s=>Qq[s])}return r}var Qq,m_,h_=p(()=>{Qq={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},m_=Symbol("html.raw");a(fI,"raw");a(_p,"html")});var xp,g_=p(()=>{h_();xp=a(({title:t,scriptSrc:e})=>_p`<!DOCTYPE html>
71
+ <html lang="en">
72
+ <head>
73
+ <meta charset="UTF-8" />
74
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
75
+ <title>${t}</title>
76
+ <style>
77
+ * { box-sizing: border-box; }
78
+ body, html { font-family: Helvetica, Arial, sans-serif; margin: 0; padding: 0; }
79
+ </style>
80
+ </head>
81
+ <body>
82
+ <div id="app" data-rid="app" data-node-id="app"></div>
83
+ <script type="module" src="${e}"></script>
84
+ </body>
85
+ </html>`,"default")});import{defineRoutes as e3}from"@jucie.io/engine-server";var mI,hI=p(()=>{g_();mI=e3("design",(t,e)=>{let r=t("log");return[{method:"get",path:"/*",handler:({respond:n})=>{try{return n.html(xp({title:`${e.name||"Jucie App"} - Preview`,scriptSrc:"/main.js"}))}catch(o){return r.error("render failed",{error:o.message}),n.text("Internal Server Error",500)}}}]})});import{defineRoutes as t3}from"@jucie.io/engine-server";import{resolve as gI}from"path";var yI,_I=p(()=>{g_();yI=t3("js",(t,e)=>{let r=t("log");return[{method:"get",path:"/",handler:({respond:n})=>{try{return n.html(xp({title:`${e.name||"Jucie App"} - Preview`,scriptSrc:"/main.js"}))}catch(o){return r.error("render failed",{error:o.message,path:"/"}),n.text("Internal Server Error",500)}}},{method:"get",path:"/main.js",handler:({respond:n})=>{try{let o=e.view==="preview"?"preview.js":"design.js";return n.file(gI(e.outdir,o))}catch(o){return r.error("failed to serve main.js",{error:o.message}),n.text("Internal Server Error",500)}}},{method:"get",path:"/chunks/*",handler:({respond:n,req:o})=>{try{return n.file(gI(e.outdir,o.path.slice(1)))}catch(s){return r.error("failed to serve chunk",{error:s.message,path:o.path}),n.text("Internal Server Error",500)}}},{method:"get",path:"/assets/*",handler:({res:n,respond:o})=>{let s=t("cache"),i=s.get(["sseClients"])&&new Set;try{return n.setHeader("Content-Type","text/event-stream"),n.setHeader("Cache-Control","no-cache"),n.setHeader("Connection","keep-alive"),n.write(`: connected
86
+
87
+ `),s&&i&&(n.on("close",()=>{let c=s.get(["sseClients"]);c.delete(ctx.res),s.set(["sseClients"],c)}),i.add(n),s.set(["sseClients"],i)),o.handled()}catch(c){return r.error("SSE connection failed",{error:c.message}),o.text("Internal Server Error",500)}}},{method:"get",path:"/hmr",handler:({res:n,respond:o})=>{let s=t("cache");try{if(n.setHeader("Content-Type","text/event-stream"),n.setHeader("Cache-Control","no-cache"),n.setHeader("Connection","keep-alive"),n.write(`: connected
88
+
89
+ `),s){let i=s.get("sseClients")||new Set;i.add(n),n.on("close",()=>i.delete(n)),s.set(["sseClients"],i)}return o.handled()}catch(i){r.error("HMR connection failed",{error:i.message})}}}]})});var xI={};R(xI,{createPreviewServer:()=>i3});import{Engine as r3}from"@jucie.io/engine";import{Server as n3}from"@jucie.io/engine-server";import{State as o3}from"@jucie.io/state";import{Matcher as s3}from"@jucie.io/state-matcher";import{EsBuild as a3}from"@jucie.io/engine-esbuild";async function i3(t={}){let e={error(){},warn(){},info(){},debug(){}};try{let r=o3.create().install(s3),n=r3.create({state:r}).install(n3.configure(t),gn.configure(t),vn.configure(t),a3.configure(t));return e=n.log.child({ns:"stage:preview"}),n.cache.set(["jucieConfig"],t),n.esBuild.use(dI,to,Yo,ro,Ko,Pc,Na),n.server.use(yI,mI),await n.cas.loadScene(),await n.storeParser.start(),await n.esBuild.build(),await n.server.listen(),e.info("preview server started",{port:n.server.getHttpServer().address().port}),{basePath:`http://localhost:${n.server.getHttpServer().address().port}`,view:t.view||"preview",env:t.env||"dev",nodeId:null}}catch(r){return e.error("preview server failed",{error:r.message,stack:r.stack}),jc.failure(r)}}var vI=p(()=>{f_();bc();tp();pI();no();hI();_I();a(i3,"createPreviewServer")});import{ServiceProvider as k1e}from"@jucie.io/engine";var S1e,VC=p(()=>{S1e=60*60*1e3});import{ServiceProvider as T1e}from"@jucie.io/engine";var HC=p(()=>{});import{createDefinition as sH}from"@jucie.io/engine";function Tn(t){let e=t._name,r=t();return{namespace:e,operations:Object.entries(r).map(([n,o])=>({name:n,fullName:`${e}:${n}`,alias:o.alias||null,mcpName:o.mcpName||null,description:o.description||"",schema:o.schema||[],examples:o.examples||[],returns:o.returns||"Object"}))}}function W_(t,e,r){if(!Array.isArray(e)||e.length===0)return!0;let n=e[0];if(typeof n!="object"||Array.isArray(n))return console.warn(`Schema for ${r} should be an object with named parameters`),!0;for(let[o,s]of Object.entries(n)){let i=typeof s=="string"&&s.endsWith("?"),c=i?s.slice(0,-1):s,u=t[o];if(!(o in t)||u===void 0){if(i)continue;throw new Error(`Missing required parameter "${o}" in ${r}`)}let l=Array.isArray(u)?"Array":u===null?"Null":typeof u=="object"?"Object":u.constructor.name;if(l!==c&&c!=="Any")throw new Error(`Parameter "${o}" in ${r} must be of type ${c}, got ${l}`)}return!0}var Ht,eu=p(()=>{Ht=sH("AI_OPERATIONS",[Object]);a(Tn,"extractOperationsMetadata");a(W_,"validateOperationArgs")});function K_(t){let e=cH(t);return[aH,...e.map(iH)]}function iH(t){let e=t.operations.map(r=>{let n=Array.isArray(r.schema)?r.schema[0]:null,o=n&&typeof n=="object"?Object.entries(n).map(([i,c])=>`${i}: ${c}`).join(", "):"",s=r.examples?.[0]?`
90
+ Example: ${JSON.stringify(r.examples[0].args)}`:"";return` ${r.name} \u2014 ${r.description}
91
+ Args: { ${o} }${s}`}).join(`
92
+
93
+ `);return{name:t.namespace,description:`${t.namespace} operations. Pass "op" as the operation name and "args" matching that op's schema.
94
+
95
+ ${e}`,input_schema:{type:"object",properties:{op:{type:"string",description:`Operation name within ${t.namespace}`},args:{type:"object",description:"Arguments matching the operation's schema"},ref:{type:"string",description:"Optional {{name}} reference for cross-operation use"},message:{type:"string",description:"Short explanation of what you are doing (1 sentence)"}},required:["op","args"]}}}function cH(t){return!Array.isArray(t)||t.length===0?[]:t[0]?.namespace&&Array.isArray(t[0]?.operations)?t:t.map(e=>Tn(e))}var aH,Y_=p(()=>{eu();aH={name:"respond",description:"Send a conversational response to the user. Use this for greetings, questions, clarifications, status updates, or when the build task is fully complete.",input_schema:{type:"object",properties:{message:{type:"string",description:"Your conversational response to the user"}},required:["message"]}};a(K_,"buildAnthropicTools");a(iH,"buildNamespaceTool");a(cH,"normalizeNamespaces")});import{ServiceProvider as uH}from"@jucie.io/engine";var uo,Ma,lo,Kr,Ip,BC,Cp,GC,Rp,tu,JC=p(()=>{eu();Y_();Rp=class Rp extends uH{constructor(){super(...arguments);j(this,Ip);j(this,Cp);j(this,uo,new Map);j(this,Ma,[]);j(this,lo,new Map);j(this,Kr,new Map)}getters(){return{operationsMetadata:()=>this.getOperationsMetadata(),anthropicTools:()=>this.getAnthropicTools()}}actions(){return{use:(...r)=>{for(let n of r)Y(this,Ip,BC).call(this,n);return this},has:r=>_(this,uo).has(r),resolveType:r=>this.resolveType(r),describeUnresolved:r=>this.describeUnresolved(r),executeOperation:(r,n,o)=>this.executeOperation(r,n,o),executeBatch:r=>this.executeBatch(r)}}resolveType(r){return typeof r!="string"||!r?null:r.includes(":")?_(this,uo).has(r)?r:null:_(this,lo).get(r)??_(this,Kr).get(r)??null}describeUnresolved(r){if(this.resolveType(r))return null;if(typeof r=="string"&&!r.includes(":")&&_(this,Kr).has(r)&&_(this,Kr).get(r)===null){let n=[];for(let[s,i]of _(this,uo))i.name===r&&n.push(i.alias?`${s} (alias: ${i.alias})`:s);let o=n.length?n.join(" or "):r;return`Ambiguous operation: "${r}". Use ${o}.`}return`Unknown operation: ${r}`}getOperationsMetadata(){return _(this,Ma).map(r=>Tn(r))}getAnthropicTools(){return K_(_(this,Ma))}async executeOperation(r,n,o=null){let s=this.resolveType(r),i=_(this,uo).get(s);if(!i)throw new Error(this.describeUnresolved(r));try{W_(n,i.schema,r)}catch(c){throw console.error(`Validation failed for ${r}:`,c),c}try{return{result:await i.handler(n),ref:o}}catch(c){throw console.error(`Handler failed for ${r}:`,c),c}}async executeBatch(r){let{operations:n,description:o,expectation:s}=r;console.log("AiOperations: Executing batch",{count:n.length,description:o});let i=new Map,c=[],u=[];try{for(let l=0;l<n.length;l++){let d=n[l];console.log(`AiOperations: Executing [${l+1}/${n.length}] ${d.type}`);let m=Y(this,Cp,GC).call(this,d.args,i),{result:h}=await this.executeOperation(d.type,m,d.ref),f=h.id??h.rootId;if(d.ref&&f&&(i.set(d.ref,f),u.push(f)),h.treeMap)for(let[g,v]of Object.entries(h.treeMap))i.set(g,v),u.push(v);h.createdIds?.length&&u.push(...h.createdIds),c.push({operation:d.type,success:!0,result:h})}return console.log("AiOperations: Execution complete",{total:n.length,successful:c.length,createdIds:u}),{success:!0,description:o,expectation:s,results:c,createdIds:u,refMap:Object.fromEntries(i)}}catch(l){return console.error("AiOperations: Batch execution failed",l),{success:!1,description:o,error:l.message,failedAt:c.length,results:c}}}};uo=new WeakMap,Ma=new WeakMap,lo=new WeakMap,Kr=new WeakMap,Ip=new WeakSet,BC=a(function(r){let n=this.inject("log");if(!r||typeof r!="function")throw new Error("Operation factory must be a function");let o=r._name;if(!o)throw new Error("Operation factory must have a _name property (use defineAiOperations)");n.info(`AiOperations: Registering operations for namespace "${o}"`),_(this,Ma).push(r);let s=r(this.inject);for(let[i,c]of Object.entries(s)){let{handler:u,schema:l,description:d,examples:m,returns:h,alias:f}=c,g=`${o}:${i}`;if(!u||typeof u!="function")throw new Error(`Operation ${g} must have a handler function`);d||console.warn(`Operation ${g} missing description`),_(this,uo).set(g,{namespace:o,name:i,handler:u,schema:l||[],description:d||"",examples:m||[],returns:h||"Object",alias:f||null}),f&&(_(this,lo).has(f)&&_(this,lo).get(f)!==g&&console.warn(`AiOperations: alias "${f}" already registered for ${_(this,lo).get(f)}, overriding with ${g}`),_(this,lo).set(f,g)),_(this,Kr).has(i)&&_(this,Kr).get(i)!==g?_(this,Kr).set(i,null):_(this,Kr).set(i,g)}},"#setupOperations"),Cp=new WeakSet,GC=a(function(r,n){return r&&JSON.parse(JSON.stringify(r),(o,s)=>o==="ref"?s:typeof s=="string"&&s.match(/^\{\{.*\}\}$/)?n.get(s)??n.get(s.replace(/\.[^}]+(?=\}\}$)/,""))??s:s)},"#resolveReferences"),a(Rp,"AiOperations"),Qe(Rp,"manifest",{name:"AiOperations",namespace:"aiOps",version:"1.0.0",description:"AI operation registry and executor",author:"",license:"MIT",homepage:""});tu=Rp});function X_(t){let e=lH(t),r=["Run multiple scene operations in a single round-trip. Use this instead of calling individual tools one-by-one whenever you have independent operations.","",'Each operation is an object with an "op" field plus its parameters:',""];for(let n of e){r.push(` ${n.namespace.toUpperCase()}`);for(let o of n.operations){let s=Array.isArray(o.schema)?o.schema[0]:null,i=s&&typeof s=="object"?Object.entries(s).map(([u,l])=>`${u}: ${l}`).join(", "):"",c=o.alias??o.name;r.push(` { op: "${c}"${i?`, ${i}`:""} }`)}r.push("")}return r.push("Returns an array of results in the same order as the input.","",'REFERENCES: add ref: "{{myRef}}" to a create operation, then use "{{myRef}}" as a value (e.g. parent or nodeId) in later operations of the SAME batch \u2014 it resolves to the created node id.'),r.join(`
96
+ `)}function lH(t){return!Array.isArray(t)||t.length===0?[]:t[0]?.namespace&&Array.isArray(t[0]?.operations)?t:t.map(e=>Tn(e))}var WC=p(()=>{eu();a(X_,"buildBatchDescription");a(lH,"normalizeNamespaces")});var zn=p(()=>{VC();HC();JC();eu();Y_();WC()});import{ServiceProvider as dH}from"@jucie.io/engine";var pH,nu,Q_,Ap,KC,jp,YC,Mp,XC,Dp,ru,QC=p(()=>{pH=20,Dp=class Dp extends dH{constructor(){super(...arguments);j(this,nu);j(this,Ap);j(this,jp);j(this,Mp)}actions(r,n){return{run:o=>this.run(o,n)}}async run({prompt:r,sessionId:n=null,token:o=null,getContext:s,execute:i=null,signal:c=null,onProgress:u=a(()=>{},"onProgress")},l){let d=this.inject("aiOps"),m=this.inject("aiHistory"),h=l.maxIterations??pH,f=i??(C=>d.executeBatch(C)),g=d.anthropicTools,v=l.playbook??null,y=n?await m.buildHistory(n):[],x=a(C=>n?m.appendMessage(n,C):Promise.resolve(),"record"),k=[],w=a(async()=>{let C="Run stopped.";return await x({type:"ai",text:C,timestamp:Date.now()}),{stopped:!0,message:C,createdIds:k}},"stopped");if(await x({type:"user",text:r,timestamp:Date.now()}),c?.aborted)return w();let b=await s({awaitRender:!1}),E=r,A=0,O=Date.now(),B=[];for(let C=0;C<h;C++){let K=Date.now();if(c?.aborted)return w();let ae;try{ae=await Y(this,jp,YC).call(this,{prompt:E,context:{...b,availableOperations:d.operationsMetadata},history:y,tools:g,playbook:v,token:o??l.token,signal:c},l)}catch(ze){if(ze.name==="AbortError"||c?.aborted)return w();throw ze}if(c?.aborted)return w();if(!Y(this,Mp,XC).call(this,ae)){let ze=ae.message??(typeof ae=="string"?ae:"Done.");return await x({type:"ai",text:ze,timestamp:Date.now()}),Y(this,nu,Q_).call(this,r,B,O,"complete"),{message:ze,createdIds:k}}let pt=await f(ae);if(k.push(...pt.createdIds??[]),B.push({iteration:C+1,operations:ae.operations.length,durationMs:Date.now()-K,tokens:ae.usage??null}),await x({type:"ai",text:ae.message||ae.description,operationsSummary:ae.operations.map(ze=>({type:ze.type,args:ze.args,ref:ze.ref})),timestamp:Date.now()}),y.push({role:"user",content:E},{role:"assistant",content:ae.message||ae.description||"",hadOperations:!0,operationsSummary:ae.operations.map(ze=>({type:ze.type,args:ze.args,ref:ze.ref}))}),u({message:ae.message,iteration:C+1,maxIterations:h,createdIds:pt.createdIds}),!pt.success){let ze=`Batch failed at operation ${pt.failedAt}: ${pt.error}`;if(await x({type:"ai",text:ze,timestamp:Date.now()}),A+=1,A>=3)return{error:ze,createdIds:k};let Ye=d.operationsMetadata.flatMap(Ys=>Ys.operations.map(Xs=>` ${Xs.fullName}`)).join(`
97
+ `);b=await s({awaitRender:!1}),E=`ERROR: ${ze}
98
+
99
+ Valid operation types:
100
+ ${Ye}
101
+
102
+ Retry the failed and remaining operations using only valid operation types.
103
+ Original task: "${r}"`;continue}if(A=0,c?.aborted)return w();b=await s({awaitRender:!0}),E=`${pt.results.length} operation(s) applied. Original task: "${r}". Review the updated scene and continue building until the task is fully complete. Only call respond when you are done.`}let q="Iteration limit reached.";return await x({type:"ai",text:q,timestamp:Date.now()}),Y(this,nu,Q_).call(this,r,B,O,"limit_reached"),{message:q,createdIds:k}}};nu=new WeakSet,Q_=a(function(r,n,o,s){let i=n.reduce((l,d)=>l+d.operations,0),c=n.reduce((l,d)=>d.tokens?l+(d.tokens.input_tokens??0)+(d.tokens.output_tokens??0):l,0),u={reason:s,prompt:r.substring(0,120),iterations:n.length,totalOperations:i,totalDurationMs:Date.now()-o,totalTokens:c||void 0,timestamp:Date.now(),perIteration:n.map(l=>({i:l.iteration,ops:l.operations,ms:l.durationMs,...l.tokens?{tokens:l.tokens}:{}}))};console.log("[AiAgent] run complete",JSON.stringify(u,null,2)),Y(this,Ap,KC).call(this,u).catch(()=>{})},"#logRunSummary"),Ap=new WeakSet,KC=a(async function(r){let o=await this.inject("aiHistory").getRunLogDir(),{appendFile:s}=await import("fs/promises"),{join:i}=await import("path");await s(i(o,"runs.jsonl"),JSON.stringify(r)+`
104
+ `)},"#persistRunLog"),jp=new WeakSet,YC=a(async function({prompt:r,context:n,history:o,tools:s=null,playbook:i=null,token:c,signal:u=null},l){let d={"Content-Type":"application/json"};c&&(d.Authorization=`Bearer ${c}`);let m;try{m=await fetch(l.aiServerUrl,{method:"POST",headers:d,body:JSON.stringify({prompt:r,context:n,history:o,tools:s,playbook:i}),signal:u??void 0})}catch(g){throw g}let h=await m.json();if(!m.ok)throw new Error(h.error??`AI server error ${m.status}`);let f=h.content;if(typeof f=="string")try{f=JSON.parse(f)}catch{f={message:f}}return h.usage&&typeof f=="object"&&(f.usage=h.usage),f},"#request"),Mp=new WeakSet,XC=a(function(r){return r&&typeof r=="object"&&Array.isArray(r.operations)&&r.operations.length>0},"#isOperationsBatch"),a(Dp,"AiAgent"),Qe(Dp,"manifest",{name:"AiAgent",namespace:"aiAgent",version:"1.0.0",description:"Server-side AI agent loop"});ru=Dp});import{ServiceProvider as fH}from"@jucie.io/engine";import{mkdir as mH,readdir as hH,readFile as gH,appendFile as yH,writeFile as _H,unlink as xH,stat as vH}from"fs/promises";import{join as eR}from"path";import{randomUUID as bH}from"crypto";var wH,Da,On,ds,ps,ou,Zp,su,tR=p(()=>{wH=20,Zp=class Zp extends fH{constructor(){super(...arguments);j(this,On);j(this,ps);j(this,Da,null)}actions(r,n){return{listSessions:()=>this.listSessions(n),createSession:()=>this.createSession(n),deleteSession:o=>this.deleteSession(o,n),getMessages:o=>this.getMessages(o,n),appendMessage:(o,s)=>this.appendMessage(o,s,n),buildHistory:(o,s)=>this.buildHistory(o,n,s),getRunLogDir:()=>Y(this,On,ds).call(this,n)}}async listSessions(r){let n=await Y(this,On,ds).call(this,r),o=(await hH(n)).filter(i=>i.endsWith(".jsonl"));return(await Promise.all(o.map(async i=>{let c=i.slice(0,-6),u=eR(n,i),[l,d]=await Promise.all([vH(u),this.getMessages(c,r)]),m=d.find(h=>h.type==="user");return{id:c,title:m?.text?.slice(0,80)??"New chat",createdAt:d[0]?.timestamp??l.birthtimeMs,updatedAt:d[d.length-1]?.timestamp??l.mtimeMs,messageCount:d.length}}))).sort((i,c)=>c.updatedAt-i.updatedAt)}async createSession(r){await Y(this,On,ds).call(this,r);let n=bH();return await _H(Y(this,ps,ou).call(this,n,r),""),{id:n}}async deleteSession(r,n){return await Y(this,On,ds).call(this,n),await xH(Y(this,ps,ou).call(this,r,n)),{id:r,deleted:!0}}async getMessages(r,n){await Y(this,On,ds).call(this,n);let o;try{o=await gH(Y(this,ps,ou).call(this,r,n),"utf8")}catch(s){if(s.code==="ENOENT")return[];throw s}return o.split(`
105
+ `).filter(Boolean).map(s=>{try{return JSON.parse(s)}catch{return null}}).filter(Boolean)}async appendMessage(r,n,o){return await Y(this,On,ds).call(this,o),await yH(Y(this,ps,ou).call(this,r,o),JSON.stringify(n)+`
106
+ `),n}async buildHistory(r,n,o=wH){return(await this.getMessages(r,n)).slice(-o).map(i=>{let c={role:i.type==="user"?"user":"assistant",content:i.text};return i.operationsSummary&&(c.hadOperations=!0,c.operationsSummary=i.operationsSummary),c})}};Da=new WeakMap,On=new WeakSet,ds=a(async function(r){return _(this,Da)||oe(this,Da,mH(r.dir,{recursive:!0})),await _(this,Da),r.dir},"#ensureDir"),ps=new WeakSet,ou=a(function(r,n){if(!/^[a-zA-Z0-9_-]+$/.test(r))throw new Error(`Invalid session id: ${r}`);return eR(n.dir,`${r}.jsonl`)},"#pathFor"),a(Zp,"AiHistory"),Qe(Zp,"manifest",{name:"AiHistory",namespace:"aiHistory",version:"1.0.0",description:"Persistent AI chat sessions (jsonl per session)"});su=Zp});var rR=p(()=>{QC();tR()});var nR,oR=p(()=>{zn();nR=Ht("node",t=>({create:{description:'Create a new node in the scene graph. type is a prototype name (e.g. div, header, p, button, frame). Optional props (e.g. name, frame) and parent (defaults to "app").',alias:"create",mcpName:"create_node",schema:[{type:"String",props:"Object?",parent:"String?"}],examples:[{args:{type:"button",parent:"app"},description:"Create a button element"},{args:{type:"nav",parent:"app"},description:"Create a nav element"},{args:{type:"frame",props:{frame:"iPhone SE",name:"Home"}},description:"Create an iPhone SE frame named Home"}],returns:"{ id: String, type: String }",handler:async e=>{let r=t("state"),{addNode:n}=await Promise.resolve().then(()=>(ud(),Vh)),o=r.ref(["nodes"]),{type:s,props:i,parent:c="app"}=e,u=n(o,s,i,c);if(u instanceof Error)throw u;if(s==="frame"){let d=(o.get(["app","children"])??[]).filter(m=>m!==u);if(d.length>0){let m=0;for(let f of d){let g=o.get([f,"bounds"]);g&&(m=Math.max(m,(g.x??0)+(g.width??0)))}let{updateBounds:h}=await Promise.resolve().then(()=>(Ki(),gh));h(o,u,{x:m+100,y:0})}}return{id:u,type:s}}},updateStyle:{description:'Update styles for a node. Optional breakpoint targets a variant: "@720" (responsive), ":hover" (pseudo-state), "&.is-active" (custom state).',mcpName:"update_style",schema:[{nodeId:"String",styles:"Object",breakpoint:"String?"}],examples:[{args:{nodeId:"nd_123",styles:{"background-color":"#2563eb",padding:"16px","border-radius":"8px"}},description:"Set background, padding, and border radius"},{args:{nodeId:"nd_123",styles:{"background-color":"#1d4ed8"},breakpoint:":hover"},description:"Set hover background"}],returns:"{ id: String, styles: Object }",handler:async e=>{let r=t("state"),{updateStyle:n}=await Promise.resolve().then(()=>(oa(),hh)),o=r.ref(["nodes"]),{nodeId:s,styles:i,breakpoint:c}=e,u=["display","position"].filter(h=>h in i),l={};c&&(c.startsWith(":")||c.startsWith("&")?l.interactionState=[c]:l.breakpoint=c);let d=n(o,s,{...i},l),m={id:s,styles:d};return u.length&&(m.warning=`Ignored ${u.join(", ")} \u2014 use node:setAutoLayout to change layout mode.`),m}},updateText:{description:"Set text content for a node. Use {{expression}} syntax for dynamic values.",mcpName:"update_text",schema:[{nodeId:"String",value:"String"}],examples:[{args:{nodeId:"nd_heading",value:"Welcome"},description:'Set static text to "Welcome"'},{args:{nodeId:"nd_label",value:"{{user.name}}"},description:"Set dynamic text with expression"}],returns:"{ id: String, textContent: Object }",handler:async e=>{let r=t("state"),{createTextContent:n}=await Promise.resolve().then(()=>(fn(),Oh)),o=r.ref(["nodes"]),{nodeId:s,value:i}=e,c=n({value:i});return o.set([s,"textContent"],c),{id:s,textContent:c}}},move:{description:"Move a node to be the last child of another node",mcpName:"move_node",schema:[{nodeId:"String",parentId:"String"}],examples:[{args:{nodeId:"nd_link",parentId:"nd_nav"},description:"Move link into nav"}],returns:"{ id: String, movedTo: String, success: Boolean }",handler:async e=>{let r=t("state"),{disconnectNode:n}=await Promise.resolve().then(()=>(Gi(),g$)),{moveNodeToLastChildOf:o}=await Promise.resolve().then(()=>(ca(),j$)),s=r.ref(["nodes"]),{nodeId:i,parentId:c}=e;n(s,i);let u=o(s,i,c);return{id:i,movedTo:c,success:u}}},remove:{description:"Remove a node and all its descendants from the scene graph",alias:"removeNode",mcpName:"remove_node",schema:[{nodeId:"String"}],examples:[{args:{nodeId:"nd_old_element"},description:"Remove an element"}],returns:"{ id: String, removed: Boolean, removedNodes: Object }",handler:async e=>{let r=t("state"),{removeNode:n}=await Promise.resolve().then(()=>(Fg(),VN)),o=r.ref(["nodes"]),{nodeId:s}=e,[i,c]=n(o,s);return{id:i,removed:!0,removedNodes:c}}},setAutoLayout:{description:'Set the layout mode of a container node ("none" | "block" | "flex" | "grid"). Sets layout on the parent and the corresponding display style, and normalizes all direct children so they flow correctly. Always use this instead of setting display via updateStyle.',alias:"setLayout",mcpName:"set_layout",schema:[{nodeId:"String",layout:"String"}],examples:[{args:{nodeId:"nd_container",layout:"flex"},description:"Enable flex auto-layout on a container"},{args:{nodeId:"nd_container",layout:"none"},description:"Disable auto-layout, reverting children to absolute positioning"}],returns:"{ id: String, layout: String, childrenUpdated: Number }",handler:async e=>{let r=t("state"),{setNodeLayout:n}=await Promise.resolve().then(()=>(vd(),Sg)),o=r.ref(["nodes"]),{nodeId:s,layout:i}=e;return n(o,s,i)}},setName:{description:"Set a display name on a node. Names appear in get_scene output and make the tree readable. Pass an empty string to clear back to the default (tag name).",mcpName:"set_name",schema:[{nodeId:"String",name:"String"}],examples:[{args:{nodeId:"nd_123",name:"Hero Section"},description:"Name a section"}],returns:"{ id: String, name: String }",handler:async e=>{let n=t("state").ref(["nodes"]),{nodeId:o,name:s}=e;if(s===""){let{clearName:c}=await Promise.resolve().then(()=>(wd(),zg));return c(n,o),{id:o,name:""}}let{setName:i}=await Promise.resolve().then(()=>(Ng(),CN));return i(n,o,s),{id:o,name:s}}},clearName:{description:"Clear the display name from a node, reverting to its tag name.",schema:[{nodeId:"String"}],examples:[{args:{nodeId:"nd_123"},description:"Clear name back to default"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{clearName:n}=await Promise.resolve().then(()=>(wd(),zg)),o=r.ref(["nodes"]),{nodeId:s}=e;return n(o,s),{id:s}}},addComponent:{description:"Convert an existing node into a reusable local component. The node is replaced in-place by an instance; the original tree becomes the component definition. Returns instanceId and componentId.",mcpName:"add_component",schema:[{nodeId:"String",name:"String?"}],examples:[{args:{nodeId:"nd_card",name:"Card"},description:"Convert a card node into a reusable component"}],returns:"{ instanceId: String, componentId: String, name: String }",handler:async e=>{let r=t("state"),{addComponent:n}=await Promise.resolve().then(()=>(Bh(),IE)),o=r.ref(["nodes"]),{nodeId:s,name:i=""}=e,c=n(o,s,i),u=o.get([c,"component"]);return{instanceId:c,componentId:u,name:i}}}}))});var sR,aR=p(()=>{zn();sR=Ht("tree",t=>({create:{description:'Create a nested tree of nodes recursively (use for complex structures like mobile pages). For frames, parent MUST be "app".',alias:"createTree",schema:[{tree:"Object",parent:"String?"}],examples:[{args:{tree:{type:"frame",name:"Home",frame:"iPhone SE",bounds:{x:0,y:400},styles:{display:"flex","flex-direction":"column",overflow:"hidden"},children:[{type:"header",styles:{padding:"16px"},children:[{type:"h1",text:"App Name"}]},{type:"main",styles:{flex:"1"}},{type:"footer",styles:{padding:"16px"},text:"Footer"}]},parent:"app"},description:"Create mobile page with header, main, footer \u2014 frame is the flex container"}],returns:"{ rootId: String, createdIds: Array, treeMap: Object }",handler:async e=>{let r=t("state"),n=t("log"),{addNode:o}=await Promise.resolve().then(()=>(ud(),Vh)),{updateStyle:s}=await Promise.resolve().then(()=>(oa(),hh)),{setNodeLayout:i}=await Promise.resolve().then(()=>(vd(),Sg)),{normalizeLayoutContext:c}=await Promise.resolve().then(()=>(dn(),C$)),{createTextContent:u}=await Promise.resolve().then(()=>(fn(),Oh)),l=r.ref(["nodes"]),{tree:d,parent:m="app"}=e,h=[],f={},g=a((y,x)=>{let{type:k,children:w,styles:b,style:E,text:A,ref:O,bounds:B,...q}=y,C=o(l,k,q,x);if(h.push(C),O&&(f[O]=C),k==="frame"&&B){let{x:Ye,y:Ys}=B,Xs=l.get([C,"bounds"])??{};l.set([C,"bounds"],{...Xs,...Ye!=null?{x:Ye}:{},...Ys!=null?{y:Ys}:{}})}let K=q.name;K&&l.set([C,"name"],K);let ae=b||E;ae&&Object.keys(ae).length>0&&s(l,C,{...ae});let pt=ae?.display??l.get([C,"style","default","display"]),ze=pt==="flex"||pt==="grid";if(ze)try{i(l,C,pt)}catch(Ye){n.warn("setNodeLayout failed for parent",{id:C,error:Ye.message})}if(A&&!(w?.length>0)){let Ye=u({value:A});l.set([C,"textContent"],Ye)}return w&&w.length>0&&w.forEach(Ye=>{if(ze){let Xs=Ye.styles||Ye.style||{};Xs.position!=="absolute"&&(Ye={...Ye,styles:{width:"auto",height:"auto",top:"auto",left:"auto",...Xs}})}let Ys=g(Ye,C);ze&&c(l,Ys,C)}),C},"createRecursive"),v=g(d,m);return{id:v,rootId:v,createdIds:h,treeMap:f,type:"tree"}}}}))});var Lp={};R(Lp,{normalizeEventName:()=>SH});function SH(t){if(typeof t!="string"||t.length===0)throw new Error('Event name must be a non-empty string. Use React-style names like "onClick" or "onSubmit".');if(kH.has(t))return t;let e=t.toLowerCase(),r=e.startsWith("on")?e.slice(2):e,n=ex[r]??ex[e];if(n)return n;throw new Error(`Unknown event name: "${t}". Use React-style names like "onClick", "onSubmit", or "onMouseEnter".`)}var ex,kH,Fp=p(()=>{ex={click:"onClick",dblclick:"onDoubleClick",doubleclick:"onDoubleClick",contextmenu:"onContextMenu",mousedown:"onMouseDown",mouseup:"onMouseUp",mousemove:"onMouseMove",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseover:"onMouseOver",mouseout:"onMouseOut",drag:"onDrag",dragstart:"onDragStart",dragend:"onDragEnd",dragenter:"onDragEnter",dragleave:"onDragLeave",dragover:"onDragOver",drop:"onDrop",keydown:"onKeyDown",keyup:"onKeyUp",keypress:"onKeyPress",change:"onChange",input:"onInput",submit:"onSubmit",reset:"onReset",focus:"onFocus",blur:"onBlur",invalid:"onInvalid",formdata:"onFormData",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",touchcancel:"onTouchCancel",wheel:"onWheel",copy:"onCopy",cut:"onCut",paste:"onPaste",abort:"onAbort",canplay:"onCanPlay",canplaythrough:"onCanPlayThrough",durationchange:"onDurationChange",emptied:"onEmptied",ended:"onEnded",loadeddata:"onLoadedData",loadedmetadata:"onLoadedMetadata",loadstart:"onLoadStart",pause:"onPause",play:"onPlay",playing:"onPlaying",progress:"onProgress",ratechange:"onRateChange",seeked:"onSeeked",seeking:"onSeeking",stalled:"onStalled",suspend:"onSuspend",timeupdate:"onTimeUpdate",volumechange:"onVolumeChange",waiting:"onWaiting",animationstart:"onAnimationStart",animationend:"onAnimationEnd",animationiteration:"onAnimationIteration",transitionend:"onTransitionEnd",load:"onLoad",error:"onError",scroll:"onScroll",scrollend:"onScrollEnd",resize:"onResize",select:"onSelect",toggle:"onToggle",afterprint:"onAfterPrint",beforeprint:"onBeforePrint",beforeunload:"onBeforeUnload",hashchange:"onHashChange",languagechange:"onLanguageChange",message:"onMessage",messageerror:"onMessageError",offline:"onOffline",online:"onOnline",pagehide:"onPageHide",pageshow:"onPageShow",popstate:"onPopState",rejectionhandled:"onRejectionHandled",storage:"onStorage",unhandledrejection:"onUnhandledRejection",unload:"onUnload",auxclick:"onAuxClick",beforematch:"onBeforeMatch",beforetoggle:"onBeforeToggle",cancel:"onCancel",close:"onClose",contextlost:"onContextLost",contextrestored:"onContextRestored",cuechange:"onCueChange",securitypolicyviolation:"onSecurityPolicyViolation",slotchange:"onSlotChange"},kH=new Set(Object.values(ex));a(SH,"normalizeEventName")});var iR,cR=p(()=>{zn();iR=Ht("behavior",t=>({addEvent:{description:'Add or replace an event handler on a node (replaces any existing handler with the same name). Event names use React-style onX format (onClick, onSubmit, onInput, onChange, onMouseEnter, etc.); lowercase names like "click" or "submit" are auto-normalized. Use binding for zero-arg store actions (e.g. "$store.myStore.doSomething"); use code when you need arguments or complex logic \u2014 code MUST be a complete function expression: function (ctx, event) { ... }. Access stores inside the handler via ctx.$store.<storeName>.',mcpName:"add_event",schema:[{nodeId:"String",name:"String",binding:"String?",code:"String?",mode:"String?"}],examples:[{args:{nodeId:"nd_btn",name:"onClick",binding:"$store.default.increment"},description:"Call store action on click"},{args:{nodeId:"nd_btn",name:"onClick",code:`function (ctx, event) {
107
+ ctx.$store.todo.items.push({ text: ctx.$store.todo.newTodo, done: false })
108
+ ctx.$store.todo.newTodo = ""
109
+ }`},description:"Add click handler with code"},{args:{nodeId:"nd_form",name:"onSubmit",code:`function (ctx, event) {
110
+ event.preventDefault()
111
+ }`},description:"Prevent default on form submit"}],returns:"{ id: String, name: String }",handler:async e=>{let r=t("state"),{addEvent:n}=await Promise.resolve().then(()=>(Wh(),RE)),{updateEvent:o}=await Promise.resolve().then(()=>(dd(),Yh)),{normalizeEventName:s}=await Promise.resolve().then(()=>(Fp(),Lp)),i=r.ref(["nodes"]),{nodeId:c,name:u,binding:l,code:d,mode:m}=e,h=s(u);if((i.get([c,"events"])??[]).find(v=>v.name===h)||n(i,c,h),l!==void 0){let v=(i.get([c,"events"])??[]).find(y=>y.name===h)??{name:h};o(i,c,h,{...v,mode:"binding",binding:l.split("."),code:null})}else if(d!==void 0){let v=(i.get([c,"events"])??[]).find(y=>y.name===h)??{name:h};o(i,c,h,{...v,mode:m??"code",code:d,binding:null})}return{id:c,name:h}}},updateEvent:{description:"Update an existing event handler by name",schema:[{nodeId:"String",name:"String",event:"Object"}],examples:[{args:{nodeId:"nd_btn",name:"onClick",event:{mode:"code",code:'alert("hi")'}},description:"Update onClick handler"}],returns:"{ id: String, name: String }",handler:async e=>{let r=t("state"),{updateEvent:n}=await Promise.resolve().then(()=>(dd(),Yh)),{normalizeEventName:o}=await Promise.resolve().then(()=>(Fp(),Lp)),s=r.ref(["nodes"]),{nodeId:i,name:c,event:u}=e,l=o(c),d=u?.name!==void 0?{...u,name:o(u.name)}:{...u,name:l};return n(s,i,l,d),{id:i,name:l}}},removeEvent:{description:"Remove an event handler by name",schema:[{nodeId:"String",name:"String"}],examples:[{args:{nodeId:"nd_btn",name:"onClick"},description:"Remove onClick handler"}],returns:"{ id: String, name: String }",handler:async e=>{let r=t("state"),{removeEvent:n}=await Promise.resolve().then(()=>(Qh(),AE)),{normalizeEventName:o}=await Promise.resolve().then(()=>(Fp(),Lp)),s=r.ref(["nodes"]),{nodeId:i,name:c}=e,u=o(c);return n(s,i,u),{id:i,name:u}}},updateRoute:{description:"Set the route path on a frame node for multi-page navigation",schema:[{nodeId:"String",route:"Any"}],examples:[{args:{nodeId:"nd_frame",route:"/about"},description:"Set route path"},{args:{nodeId:"nd_frame",route:{path:"/users/:id"}},description:"Set route with params"}],returns:"{ id: String, route: Object }",handler:async e=>{let r=t("state"),{updateRoute:n}=await Promise.resolve().then(()=>(Wg(),cT)),o=r.ref(["nodes"]),{nodeId:s,route:i}=e,c=typeof i=="string"?{path:i}:i;return n(o,s,c),{id:s,route:c}}},setHomePage:{description:"Mark a frame as the home page (root route)",schema:[{nodeId:"String",isHomePage:"Any"}],examples:[{args:{nodeId:"nd_frame",isHomePage:!0},description:"Set as home page"}],returns:"{ id: String, isHomePage: Any }",handler:async e=>{let r=t("state"),{setHomePage:n}=await Promise.resolve().then(()=>(ty(),fT)),o=r.ref(["nodes"]),{nodeId:s,isHomePage:i}=e;return n(o,s,i),{id:s,isHomePage:i}}},setDestination:{description:"Set a navigation destination on a link or button node",schema:[{nodeId:"String",destination:"Any"}],examples:[{args:{nodeId:"nd_link",destination:"/about"},description:"Navigate to /about on click"}],returns:"{ id: String, destination: Object }",handler:async e=>{let r=t("state"),{setDestination:n}=await Promise.resolve().then(()=>(pg(),oN)),o=r.ref(["nodes"]),{nodeId:s,destination:i}=e,c=typeof i=="string"?{path:i}:i;return n(o,s,c),{id:s,destination:c}}},clearDestination:{description:"Remove the navigation destination from a node",schema:[{nodeId:"String"}],examples:[{args:{nodeId:"nd_link"},description:"Clear navigation destination"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{clearDestination:n}=await Promise.resolve().then(()=>(mg(),sN)),o=r.ref(["nodes"]),{nodeId:s}=e;return n(o,s),{id:s}}},setRepeat:{description:'Repeat a node for each item in a data binding (loop). binding is a dot-path on ctx (e.g. "$store.todo.items").',schema:[{nodeId:"String",binding:"String",as:"String?",index:"String?",key:"Any?",keyOn:"Any?"}],examples:[{args:{nodeId:"nd_card",binding:"$store.todo.items",as:"$item"},description:"Repeat card for each item in the todo store"}],returns:"{ id: String, binding: String }",handler:async e=>{let r=t("state"),{setRepeat:n}=await Promise.resolve().then(()=>(Nd(),YN)),o=r.ref(["nodes"]),{nodeId:s,binding:i,as:c,index:u,key:l,keyOn:d}=e,m=i.split(".");return n(o,s,{descriptor:{mode:"binding",binding:m},as:c,index:u,key:l,keyOn:d}),{id:s,binding:i}}},clearRepeat:{description:"Remove repeat binding from a node",schema:[{nodeId:"String"}],examples:[{args:{nodeId:"nd_card"},description:"Stop repeating"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{clearRepeat:n}=await Promise.resolve().then(()=>(Td(),eT)),o=r.ref(["nodes"]),{nodeId:s}=e;return n(o,s),{id:s}}},setRender:{description:'Conditionally show/hide a node based on an expression. Pass an expression that uses ctx (e.g. "ctx.$store.user.isAdmin"); it is wrapped as a computed function automatically. Stores are at ctx.$store.<name>; loop vars at ctx.$item / ctx.$index.',schema:[{nodeId:"String",value:"String"}],examples:[{args:{nodeId:"nd_admin",value:"ctx.$store.user.isAdmin"},description:"Show only for admins"}],returns:"{ id: String, value: String }",handler:async e=>{let r=t("state"),{setRender:n}=await Promise.resolve().then(()=>(Vg(),BN)),o=r.ref(["nodes"]),{nodeId:s,value:i}=e,c=`function (ctx) {
112
+ return ${i}
113
+ }`;return n(o,s,{mode:"computed",computed:c}),{id:s,value:i}}},clearRender:{description:"Remove conditional rendering from a node (always show)",schema:[{nodeId:"String"}],examples:[{args:{nodeId:"nd_admin"},description:"Always render"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{clearRender:n}=await Promise.resolve().then(()=>(Bg(),WN)),o=r.ref(["nodes"]),{nodeId:s}=e;return n(o,s),{id:s}}},addState:{description:'Register a custom state class on a node (e.g. "is-active"). Style it with updateStyle breakpoint "&.is-active".',schema:[{nodeId:"String",stateName:"String"}],examples:[{args:{nodeId:"nd_tab",stateName:"is-active"},description:"Add active state"}],returns:"{ id: String, stateName: String }",handler:async e=>{let r=t("state"),{addState:n}=await Promise.resolve().then(()=>(Sh(),H$)),o=r.ref(["nodes"]),{nodeId:s,stateName:i}=e;return n(o,s,i),{id:s,stateName:i}}},updateState:{description:"Set the expression that controls when a state is active",schema:[{nodeId:"String",stateName:"String",expression:"String"}],examples:[{args:{nodeId:"nd_tab",stateName:"is-active",expression:'$router.currentRoute?.path === "/"'},description:"Activate on home route"}],returns:"{ id: String, stateName: String }",handler:async e=>{let r=t("state"),{updateState:n}=await Promise.resolve().then(()=>(Eh(),B$)),o=r.ref(["nodes"]),{nodeId:s,stateName:i,expression:c}=e;return n(o,s,i,{name:i,mode:"computed",computed:c??null}),{id:s,stateName:i}}},removeState:{description:"Remove a custom state from a node",schema:[{nodeId:"String",stateName:"String"}],examples:[{args:{nodeId:"nd_tab",stateName:"is-active"},description:"Remove active state"}],returns:"{ id: String, stateName: String }",handler:async e=>{let r=t("state"),{removeState:n}=await Promise.resolve().then(()=>(Th(),G$)),o=r.ref(["nodes"]),{nodeId:s,stateName:i}=e;return n(o,s,i),{id:s,stateName:i}}},updateBounds:{description:"Update the position and size of a node",schema:[{nodeId:"String",bounds:"Object"}],examples:[{args:{nodeId:"nd_frame",bounds:{x:500,y:0,width:375,height:667}},description:"Position a frame"}],returns:"{ id: String, bounds: Object }",handler:async e=>{let r=t("state"),{updateBounds:n}=await Promise.resolve().then(()=>(Ki(),gh)),o=r.ref(["nodes"]),{nodeId:s,bounds:i}=e;return n(o,s,i),{id:s,bounds:i}}},setHtmlId:{description:"Set the HTML id attribute on a node",schema:[{nodeId:"String",id:"String"}],examples:[{args:{nodeId:"nd_section",id:"hero-section"},description:"Set HTML id for anchor links"}],returns:"{ id: String, htmlId: String }",handler:async e=>{let r=t("state"),{setHtmlId:n}=await Promise.resolve().then(()=>(ay(),GT)),o=r.ref(["nodes"]),{nodeId:s,id:i}=e;return n(o,s,i),{id:s,htmlId:i}}},addAttribute:{description:"Add a custom HTML attribute to a node",schema:[{nodeId:"String",name:"String",value:"Any?",mode:"String?"}],examples:[{args:{nodeId:"nd_img",name:"src",value:"/hero.png"},description:"Set image source"},{args:{nodeId:"nd_img",name:"alt",value:"Hero image"},description:"Set alt text"}],returns:"{ id: String, name: String }",handler:async e=>{let r=t("state"),{addAttribute:n}=await Promise.resolve().then(()=>(ng(),DE)),o=r.ref(["nodes"]),{nodeId:s,name:i,value:c,mode:u}=e;return n(o,s,{name:i,value:c,mode:u}),{id:s,name:i}}},updateAttribute:{description:'Update or upsert an attribute by name. For two-way input binding use name "model", mode "binding", and binding "$store.path". model XOR value/checked \u2014 setting model clears value and checked; setting value or checked clears model.',schema:[{nodeId:"String",name:"String",mode:"String?",value:"Any?",binding:"Any?",computed:"String?",code:"String?"}],examples:[{args:{nodeId:"nd_img",name:"src",value:"/new-hero.png"},description:"Change image source"},{args:{nodeId:"nd_email",name:"model",mode:"binding",binding:"$store.form.email"},description:"Two-way bind input to store"}],returns:"{ id: String, name: String }",handler:async e=>{let r=t("state"),{updateAttribute:n}=await Promise.resolve().then(()=>(sg(),ZE)),o=r.ref(["nodes"]),{nodeId:s,...i}=e;return typeof i.binding=="string"&&(i.binding=i.binding.split(".")),i.name==="model"&&i.mode==null&&(i.mode="binding"),n(o,s,i.name,i),{id:s,name:i.name}}},removeAttribute:{description:"Remove an attribute by name",schema:[{nodeId:"String",name:"String"}],examples:[{args:{nodeId:"nd_img",name:"src"},description:"Remove src attribute"}],returns:"{ id: String, name: String }",handler:async e=>{let r=t("state"),{removeAttribute:n}=await Promise.resolve().then(()=>(fd(),ME)),o=r.ref(["nodes"]),{nodeId:s,name:i}=e;return n(o,s,i),{id:s,name:i}}},addLifecycleHook:{description:'Add a lifecycle hook to a node (mount, unmount, update). mode is "code" with a code string, or "binding" with a store action binding.',schema:[{nodeId:"String",key:"String",code:"String?",binding:"String?"}],examples:[{args:{nodeId:"nd_page",key:"mount",code:'console.log("mounted")'},description:"Run code on mount"},{args:{nodeId:"nd_page",key:"mount",binding:"cart.load"},description:"Call a store action on mount"}],returns:"{ id: String, key: String }",handler:async e=>{let r=t("state"),{addLifecycleHook:n}=await Promise.resolve().then(()=>(yg(),lN)),{updateLifecycleHook:o}=await Promise.resolve().then(()=>(_d(),xg)),s=r.ref(["nodes"]),{nodeId:i,key:c,code:u,binding:l}=e;return n(s,i,c),(u!==void 0||l!==void 0)&&o(s,i,c,{key:c,mode:u!==void 0?"code":"binding",code:u??"",binding:l??null}),{id:i,key:c}}},updateLifecycleHook:{description:"Update a lifecycle hook by key. hook may include key, mode, code, binding.",schema:[{nodeId:"String",key:"String",hook:"Object"}],returns:"{ id: String, key: String }",handler:async e=>{let r=t("state"),{updateLifecycleHook:n}=await Promise.resolve().then(()=>(_d(),xg)),o=r.ref(["nodes"]),{nodeId:s,key:i,hook:c}=e,u=(o.get([s,"lifecycle"])??[]).find(l=>l.key===i)??{key:i};return n(o,s,i,{...u,...c}),{id:s,key:i}}},removeLifecycleHook:{description:"Remove a lifecycle hook by key.",schema:[{nodeId:"String",key:"String"}],returns:"{ id: String, key: String }",handler:async e=>{let r=t("state"),{removeLifecycleHook:n}=await Promise.resolve().then(()=>(bg(),dN));return n(r.ref(["nodes"]),e.nodeId,e.key),{id:e.nodeId,key:e.key}}},addOption:{description:"Add a static option to a select node.",schema:[{nodeId:"String",value:"String",label:"String?"}],examples:[{args:{nodeId:"nd_select",value:"us",label:"United States"},description:"Add a select option"}],returns:"{ id: String, value: String }",handler:async e=>{let r=t("state"),{addOption:n}=await Promise.resolve().then(()=>(Pg(),MN)),o=r.ref(["nodes"]),{nodeId:s,value:i,label:c}=e;return n(o,s,{value:i,label:c??i}),{id:s,value:i}}},updateOption:{description:"Update a select option by its current value. Pass the old value to look up, and optionally a new value/label.",schema:[{nodeId:"String",value:"String",newValue:"String?",label:"String?"}],returns:"{ id: String, value: String }",handler:async e=>{let r=t("state"),{updateOption:n}=await Promise.resolve().then(()=>(Cg(),DN)),o=r.ref(["nodes"]),{nodeId:s,value:i,newValue:c,label:u}=e,l=c??i;return n(o,s,i,{value:l,label:u??l}),{id:s,value:l}}},removeOption:{description:"Remove a select option by value.",schema:[{nodeId:"String",value:"String"}],returns:"{ id: String, value: String }",handler:async e=>{let r=t("state"),{removeOption:n}=await Promise.resolve().then(()=>(Ag(),ZN));return n(r.ref(["nodes"]),e.nodeId,e.value),{id:e.nodeId,value:e.value}}},setOptionsExpression:{description:"Bind a select node's options to a data expression instead of a static list. binding is a {{expression}} returning an array; valueKey/labelKey pick fields from each item.",schema:[{nodeId:"String",binding:"String",valueKey:"String?",labelKey:"String?"}],examples:[{args:{nodeId:"nd_select",binding:"{{countries}}",valueKey:"code",labelKey:"name"},description:"Populate options from a store"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{setOptionsExpression:n}=await Promise.resolve().then(()=>(Mg(),LN)),o=r.ref(["nodes"]),{nodeId:s,binding:i,valueKey:c,labelKey:u}=e;return n(o,s,{binding:i,valueKey:c,labelKey:u}),{id:s}}},clearOptionsExpression:{description:"Switch a select node back to its static options list.",schema:[{nodeId:"String"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{clearOptionsExpression:n}=await Promise.resolve().then(()=>(Zg(),FN));return n(r.ref(["nodes"]),e.nodeId),{id:e.nodeId}}},setTagName:{description:"Change the HTML tag of an element node (e.g. div to section).",mcpName:"set_tag_name",schema:[{nodeId:"String",tagName:"String"}],examples:[{args:{nodeId:"nd_box",tagName:"section"},description:"Make a div semantic"}],returns:"{ id: String, tagName: String }",handler:async e=>{let r=t("state"),{setTagName:n}=await Promise.resolve().then(()=>(ny(),xT)),o=r.ref(["nodes"]),{nodeId:s,tagName:i}=e;return n(o,s,i),{id:s,tagName:i}}},updateHtml:{description:"Set the inner HTML of a template node (raw HTML embed).",schema:[{nodeId:"String",html:"String"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{updateHtml:n}=await Promise.resolve().then(()=>(ug(),eN));return n(r.ref(["nodes"]),e.nodeId,e.html),{id:e.nodeId}}},addRouteParam:{description:"Add a route parameter to a frame route (e.g. an :id segment). Set key to name it; optional marks it optional.",schema:[{nodeId:"String",key:"String?",optional:"Boolean?"}],examples:[{args:{nodeId:"nd_frame",key:"id"},description:"Add an :id param to the route"}],returns:"{ id: String, index: Number }",handler:async e=>{let r=t("state"),{addParamToRoute:n}=await Promise.resolve().then(()=>(Yg(),dT)),o=r.ref(["nodes"]),{nodeId:s,key:i,optional:c}=e;n(o,s);let l=(o.get([s,"route","params"])??[]).length-1;return(i!==void 0||c!==void 0)&&o.set([s,"route","params",l],{key:i??null,optional:c??!1}),{id:s,index:l}}},removeRouteParam:{description:"Remove a route parameter from a frame route by index.",schema:[{nodeId:"String",index:"Number"}],returns:"{ id: String, index: Number }",handler:async e=>{let r=t("state"),{removeParamFromRoute:n}=await Promise.resolve().then(()=>(Qg(),pT));return n(r.ref(["nodes"]),e.nodeId,e.index),{id:e.nodeId,index:e.index}}}}))});var uR,lR=p(()=>{uR=a(()=>({$value:null,$type:"color",$path:null}),"tokenDefaults")});var dR={};R(dR,{addToken:()=>$H});function $H(t,e={}){let r=uh();return t.set([r],{...uR(),...e}),r}var pR=p(()=>{Bi();lR();a($H,"addToken")});var fR={};R(fR,{updateToken:()=>EH});function EH(t,e,r){if(t.get([e]))for(let[o,s]of Object.entries(r))t.set([e,o],s)}var mR=p(()=>{a(EH,"updateToken")});var hR={};R(hR,{removeToken:()=>NH});function NH(t,e){let r=t.get([e]);return t.set([e],null),r}var gR=p(()=>{a(NH,"removeToken")});var yR,_R=p(()=>{zn();yR=Ht("token",t=>({create:{description:'Create a design token. path is the token name (e.g. "color/primary"), type is the token kind (color, dimension, fontFamily, etc.), value is the CSS value. Reference tokens in styles via the slugged path (slashes/dots become dashes): path "color/primary" \u2192 var(--color-primary).',mcpName:"create_token",schema:[{path:"String",value:"String",type:"String?"}],examples:[{args:{path:"color/primary",value:"#3B82F6",type:"color"},description:"Create a primary color token"},{args:{path:"spacing/lg",value:"24px",type:"dimension"},description:"Create a spacing token"}],returns:"{ id: String, path: String }",handler:async e=>{let r=t("state"),{addToken:n}=await Promise.resolve().then(()=>(pR(),dR)),o=r.ref(["tokens"]),{path:s,value:i,type:c}=e;return{id:n(o,{$path:s,$value:i,...c!==void 0?{$type:c}:{}}),path:s}}},update:{description:"Update a design token. changes may include path, value, or type.",mcpName:"update_token",schema:[{tokenId:"String",changes:"Object"}],examples:[{args:{tokenId:"tk_abc",changes:{value:"#EF4444"}},description:"Change a token value"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{updateToken:n}=await Promise.resolve().then(()=>(mR(),fR)),o=r.ref(["tokens"]),{tokenId:s,changes:i={}}=e,c={};return i.path!==void 0&&(c.$path=i.path),i.value!==void 0&&(c.$value=i.value),i.type!==void 0&&(c.$type=i.type),n(o,s,c),{id:s}}},delete:{description:"Delete a design token by id.",mcpName:"delete_token",schema:[{tokenId:"String"}],examples:[{args:{tokenId:"tk_abc"},description:"Delete a token"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{removeToken:n}=await Promise.resolve().then(()=>(gR(),hR)),o=r.ref(["tokens"]);return n(o,e.tokenId),{id:e.tokenId}}}}))});var vR={};R(vR,{validateStorePayload:()=>zH});function TH(t){return typeof t=="string"&&/^\s*function\b/.test(t)}function zH(t){let e=[];if(!t||typeof t!="object"||Array.isArray(t))throw new Error("store payload must be an object");(typeof t.name!="string"||!t.name.trim())&&e.push("name must be a non-empty string"),t.state!==void 0&&(Array.isArray(t.state)?t.state.forEach((r,n)=>{if(!r||typeof r!="object"||Array.isArray(r)){e.push(`state[${n}] must be an object`);return}(typeof r.key!="string"||!r.key.trim())&&e.push(`state[${n}].key must be a non-empty string`),(typeof r.type!="string"||!xR.has(r.type))&&e.push(`state[${n}].type must be one of ${[...xR].join("|")}`)}):e.push("state must be an array"));for(let r of["computed","actions"])if(t[r]!==void 0){if(!Array.isArray(t[r])){e.push(`${r} must be an array`);continue}t[r].forEach((n,o)=>{if(!n||typeof n!="object"||Array.isArray(n)){e.push(`${r}[${o}] must be an object`);return}(typeof n.name!="string"||!n.name.trim())&&e.push(`${r}[${o}].name must be a non-empty string`),TH(n.code)||e.push(`${r}[${o}].code must be a function expression string (e.g. function () { ... })`)})}if(e.length)throw new Error(`Invalid store payload:
114
+ - ${e.join(`
115
+ - `)}`);return!0}var xR,bR=p(()=>{xR=new Set(["string","number","boolean","array","object"]);a(TH,"isFunctionCode");a(zH,"validateStorePayload")});function tx(t,e){if(t==null||typeof t!="string")return t;switch(e){case"number":return t===""?0:Number(t);case"boolean":return t==="true"||t==="1";case"array":case"object":if(!t||t==="")return e==="array"?[]:{};try{return JSON.parse(t)}catch{return e==="array"?[]:{}}default:return t}}function Za(t,{key:e,name:r,index:n}){let o=e??r;return o!==void 0?t.findIndex(s=>(s.key??s.name)===o):n??-1}var wR,kR=p(()=>{zn();a(tx,"coerceValue");a(Za,"resolveIndex");wR=Ht("store",t=>({create:{description:"Create a data store. Stores hold reactive values, computed properties, and actions that nodes can bind to (via repeat, model, render, or {{expressions}}). The store id is its name. Optionally pass state/computed/actions arrays to seed the store in one call. Store actions and computed use this for state (e.g. function () { this.items = []; }), not a context first argument.",alias:"createStore",mcpName:"create_store",schema:[{name:"String",state:"Array?",computed:"Array?",actions:"Array?"}],examples:[{args:{name:"todo",state:[{key:"newText",type:"string",value:""},{key:"items",type:"array",value:[]}],actions:[{name:"addTodo",code:'function () { const text = this.newText.trim(); if (!text) return; this.items = [...this.items, { text, done: false }]; this.newText = ""; }'}]},description:"Create a todo store with state and actions in one call"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{validateStorePayload:n}=await Promise.resolve().then(()=>(bR(),vR)),{addStore:o}=await Promise.resolve().then(()=>(zy(),PO)),{createValue:s}=await Promise.resolve().then(()=>(Zd(),$O)),{createComputed:i}=await Promise.resolve().then(()=>(Md(),bO)),{createAction:c}=await Promise.resolve().then(()=>(Ad(),yO));n(e);let u=r.ref(["stores"]),l=o(u,e.name);return e.state?.length&&u.set([l,"state"],e.state.map(d=>s({key:d.key,type:d.type,value:tx(d.value,d.type)}))),e.computed?.length&&u.set([l,"computed"],e.computed.map(d=>i({name:d.name,code:d.code}))),e.actions?.length&&u.set([l,"actions"],e.actions.map(d=>c({name:d.name,code:d.code}))),{id:l}}},remove:{description:"Remove a data store and everything in it.",alias:"removeStore",schema:[{storeId:"String"}],returns:"{ id: String }",handler:async e=>{let r=t("state"),{removeStore:n}=await Promise.resolve().then(()=>(Py(),IO));return n(r.ref(["stores"]),e.storeId),{id:e.storeId}}},addValue:{description:"Add a reactive value to a store. key is the value name, type is string/number/boolean/array/object, value is the initial value.",mcpName:"add_store_value",schema:[{storeId:"String",key:"String?",type:"String?",value:"String?"}],examples:[{args:{storeId:"cart",key:"items",type:"array",value:"[]"},description:"Add an items array to the cart store"}],returns:"{ storeId: String, key: String, index: Number }",handler:async e=>{let r=t("state"),{addValue:n}=await Promise.resolve().then(()=>(ky(),EO)),{updateValue:o}=await Promise.resolve().then(()=>(Ld(),$y)),s=r.ref(["stores"]),{storeId:i,key:c,type:u,value:l}=e;n(s,i,u);let d=s.get([i,"state"])??[],m=0,h=d[m];if(c!==void 0||l!==void 0){let f=u??h.type;o(s,i,m,{key:c??h.key,type:f,value:tx(l??h.value,f)})}return{storeId:i,key:c??h.key,index:m}}},updateValue:{description:"Update a store value by key (or index). changes may include key, type, value.",schema:[{storeId:"String",key:"String?",index:"Number?",changes:"Object"}],examples:[{args:{storeId:"cart",key:"items",changes:{value:'[{"id":1}]'}},description:"Set the items value"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let r=t("state"),{updateValue:n}=await Promise.resolve().then(()=>(Ld(),$y)),o=r.ref(["stores"]),{storeId:s,changes:i={}}=e,c=o.get([s,"state"])??[],u=Za(c,e);if(u<0)throw new Error(`store value not found: ${e.key??e.index} in ${s}`);let l={...c[u],...i};return i.value!==void 0&&(l.value=tx(l.value,l.type)),n(o,s,u,l),{storeId:s,index:u}}},removeValue:{description:"Remove a store value by key (or index).",schema:[{storeId:"String",key:"String?",index:"Number?"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let r=t("state"),{removeValue:n}=await Promise.resolve().then(()=>(Ny(),NO)),o=r.ref(["stores"]),s=o.get([e.storeId,"state"])??[],i=Za(s,e);if(i<0)throw new Error(`store value not found: ${e.key??e.index} in ${e.storeId}`);return n(o,e.storeId,i),{storeId:e.storeId,index:i}}},addComputed:{description:"Add a computed property to a store. code is a function body string: function () { ... } with store state available on this (e.g. this.items).",schema:[{storeId:"String",name:"String?",code:"String?"}],examples:[{args:{storeId:"cart",name:"total",code:"function () { return this.items.reduce((s, i) => s + i.price, 0); }"},description:"Add a cart total computed"}],returns:"{ storeId: String, name: String, index: Number }",handler:async e=>{let r=t("state"),{addComputed:n}=await Promise.resolve().then(()=>(yy(),wO)),{updateComputed:o}=await Promise.resolve().then(()=>(Dd(),xy)),s=r.ref(["stores"]),{storeId:i,name:c,code:u}=e;n(s,i);let l=s.get([i,"computed"])??[],d=0,m=l[d];return(c!==void 0||u!==void 0)&&o(s,i,d,{name:c??m.name,code:u??m.code}),{storeId:i,name:c??m.name,index:d}}},updateComputed:{description:"Update a store computed property by name (or index). changes may include name, code.",schema:[{storeId:"String",name:"String?",index:"Number?",changes:"Object"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let r=t("state"),{updateComputed:n}=await Promise.resolve().then(()=>(Dd(),xy)),o=r.ref(["stores"]),{storeId:s,changes:i={}}=e,c=o.get([s,"computed"])??[],u=Za(c,e);if(u<0)throw new Error(`store computed not found: ${e.name??e.index} in ${s}`);return n(o,s,u,{...c[u],...i}),{storeId:s,index:u}}},removeComputed:{description:"Remove a store computed property by name (or index).",schema:[{storeId:"String",name:"String?",index:"Number?"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let r=t("state"),{removeComputed:n}=await Promise.resolve().then(()=>(by(),kO)),o=r.ref(["stores"]),s=o.get([e.storeId,"computed"])??[],i=Za(s,e);if(i<0)throw new Error(`store computed not found: ${e.name??e.index} in ${e.storeId}`);return n(o,e.storeId,i),{storeId:e.storeId,index:i}}},addAction:{description:"Add an action to a store. code is a function body string: function () { ... } that can read and mutate store values via this (e.g. this.items).",schema:[{storeId:"String",name:"String?",code:"String?"}],examples:[{args:{storeId:"cart",name:"clear",code:"function () { this.items = []; }"},description:"Add a clear-cart action"}],returns:"{ storeId: String, name: String, index: Number }",handler:async e=>{let r=t("state"),{addAction:n}=await Promise.resolve().then(()=>(dy(),_O)),{updateAction:o}=await Promise.resolve().then(()=>(jd(),fy)),s=r.ref(["stores"]),{storeId:i,name:c,code:u}=e;n(s,i);let l=s.get([i,"actions"])??[],d=0,m=l[d];return(c!==void 0||u!==void 0)&&o(s,i,d,{name:c??m.name,code:u??m.code}),{storeId:i,name:c??m.name,index:d}}},updateAction:{description:"Update a store action by name (or index). changes may include name, code.",schema:[{storeId:"String",name:"String?",index:"Number?",changes:"Object"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let r=t("state"),{updateAction:n}=await Promise.resolve().then(()=>(jd(),fy)),o=r.ref(["stores"]),{storeId:s,changes:i={}}=e,c=o.get([s,"actions"])??[],u=Za(c,e);if(u<0)throw new Error(`store action not found: ${e.name??e.index} in ${s}`);return n(o,s,u,{...c[u],...i}),{storeId:s,index:u}}},removeAction:{description:"Remove a store action by name (or index).",schema:[{storeId:"String",name:"String?",index:"Number?"}],returns:"{ storeId: String, index: Number }",handler:async e=>{let r=t("state"),{removeAction:n}=await Promise.resolve().then(()=>(hy(),xO)),o=r.ref(["stores"]),s=o.get([e.storeId,"actions"])??[],i=Za(s,e);if(i<0)throw new Error(`store action not found: ${e.name??e.index} in ${e.storeId}`);return n(o,e.storeId,i),{storeId:e.storeId,index:i}}}}))});var SR,$R=p(()=>{SR=a(()=>({__version:1,type:"animation",scope:"node",name:null,duration:300,easing:"ease",fill:"none",direction:"normal",iterations:1,delay:0,endDelay:0,iterationStart:0,composite:"replace",keyframes:[]}),"animationDefaults")});var ER={};R(ER,{createAnimation:()=>OH});function OH(t={}){return{...SR(),...Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0))}}var NR=p(()=>{$R();a(OH,"createAnimation")});var TR={};R(TR,{addAnimationBinding:()=>PH});function PH(t,e,r){t.push([e,"animations"],r)}var zR=p(()=>{a(PH,"addAnimationBinding")});var OR={};R(OR,{removeAnimationBinding:()=>IH});function IH(t,e,r){t.removeWhere([e,"animations"],{id:r})}var PR=p(()=>{a(IH,"removeAnimationBinding")});var IR={};R(IR,{updateAnimationBinding:()=>CH});function CH(t,e,r,n){let o=t.findWhere([e,"animations"],{id:r});if(o===void 0)return;let s={...o,...n};t.setWhere([e,"animations"],{id:r},s)}var CR=p(()=>{a(CH,"updateAnimationBinding")});var RR,AR=p(()=>{zn();RR=Ht("animation",t=>({create:{description:'Create an animation asset. keyframes is a Web Animations API keyframe array (e.g. [{ opacity: 0 }, { opacity: 1 }]). scope is "project" (reusable) or "node". Bind it to nodes with animation:bind.',mcpName:"create_animation",schema:[{name:"String",keyframes:"Array",duration:"Number?",easing:"String?",iterations:"Number?",fill:"String?",scope:"String?"}],examples:[{args:{name:"Fade In",keyframes:[{opacity:0},{opacity:1}],duration:400,easing:"ease-out",scope:"project"},description:"Create a reusable fade-in animation"}],returns:"{ id: String, name: String }",handler:async e=>{let r=t("state"),{createAnimation:n}=await Promise.resolve().then(()=>(NR(),ER)),{createAnimationId:o}=await Promise.resolve().then(()=>(Bi(),c$)),s=r.ref(["animations"]),{name:i,keyframes:c,duration:u,easing:l,iterations:d,fill:m,scope:h}=e,f=o();return s.set([f],n({name:i,keyframes:c,duration:u,easing:l,iterations:d,fill:m,scope:h??"project"})),{id:f,name:i}}},update:{description:"Update an animation asset. changes may include name, keyframes, duration, easing, iterations, fill, direction, delay.",schema:[{animationId:"String",changes:"Object"}],examples:[{args:{animationId:"anim_abc",changes:{duration:600}},description:"Slow an animation down"}],returns:"{ id: String }",handler:async e=>{let n=t("state").ref(["animations"]),{animationId:o,changes:s={}}=e;if(!n.get([o]))throw new Error(`animation not found: ${o}`);for(let[c,u]of Object.entries(s))n.set([o,c],u);return{id:o}}},delete:{description:"Delete an animation asset by id. Does not remove bindings that reference it.",schema:[{animationId:"String"}],returns:"{ id: String }",handler:async e=>(t("state").ref(["animations"]).set([e.animationId],null),{id:e.animationId})},bind:{description:'Bind an animation to a node. play is the trigger: "mount", "click", "hover", etc. Set reverse to a trigger to play backwards on that event.',mcpName:"bind_animation",schema:[{nodeId:"String",animationId:"String",play:"String?",reverse:"String?"}],examples:[{args:{nodeId:"nd_hero",animationId:"anim_abc",play:"mount"},description:"Fade the hero in on mount"}],returns:"{ nodeId: String, animationId: String, index: Number }",handler:async e=>{let r=t("state"),{addAnimationBinding:n}=await Promise.resolve().then(()=>(zR(),TR)),o=r.ref(["nodes"]),{nodeId:s,animationId:i,play:c,reverse:u}=e,l={id:i,play:c??"mount"};return u!==void 0&&(l.reverse=u),n(o,s,l),{nodeId:s,animationId:i}}},unbind:{description:"Remove an animation binding from a node by animation id.",schema:[{nodeId:"String",animationId:"String"}],returns:"{ nodeId: String, animationId: String }",handler:async e=>{let r=t("state"),{removeAnimationBinding:n}=await Promise.resolve().then(()=>(PR(),OR));return n(r.ref(["nodes"]),e.nodeId,e.animationId),{nodeId:e.nodeId,animationId:e.animationId}}},updateBinding:{description:"Update an animation binding on a node by animation id. binding may include play, reverse, or id.",schema:[{nodeId:"String",animationId:"String",binding:"Object"}],returns:"{ nodeId: String, animationId: String }",handler:async e=>{let r=t("state"),{updateAnimationBinding:n}=await Promise.resolve().then(()=>(CR(),IR));return n(r.ref(["nodes"]),e.nodeId,e.animationId,e.binding),{nodeId:e.nodeId,animationId:e.animationId}}}}))});var Up,rx=p(()=>{oR();aR();cR();_R();kR();AR();Up=[nR,sR,iR,yR,wR,RR]});import{readFileSync as RH,readdirSync as Kze}from"fs";import{join as AH,dirname as jH}from"path";import{fileURLToPath as MH}from"url";function jR(t=LH){return t.map(e=>{let r=AH(ZH,e.endsWith(".md")?e:`${e}.md`);return RH(r,"utf-8")}).join(`
116
+
117
+ `)}var DH,ZH,LH,MR=p(()=>{DH=jH(MH(import.meta.url)),ZH=DH,LH=["elements.md","layout.md","interactivity.md","workflow.md"];a(jR,"loadPlaybook")});import{ServiceProvider as FH}from"@jucie.io/engine";import{readFile as UH}from"fs/promises";import{basename as qH}from"path";function DR(t){let e=new Set,r=/\.([a-zA-Z_][\w-]*)/g,n;for(;n=r.exec(t);)e.add(n[1]);return[...e].sort()}async function VH(t,e){let r=[];for(let n of t)try{if(typeof n=="string"){let s=await(await fetch(n)).text();r.push({url:n,type:"remote",classNames:DR(s)})}else if(n&&typeof n=="object"&&n.path){let o=await UH(n.path,"utf-8");r.push({name:n.name??null,path:n.path,type:"local",classNames:DR(o)})}}catch(o){e.warn("failed to load library",{entry:n,error:o.message})}return r}var Pn,qp,au,ZR=p(()=>{qp=class qp extends FH{constructor(){super(...arguments);j(this,Pn,[])}actions(){return{load:()=>this.load(),getEntries:()=>_(this,Pn),getClassNames:()=>_(this,Pn).flatMap(r=>r.classNames),findLocal:r=>_(this,Pn).find(n=>n.type==="local"&&qH(n.path)===r)}}async load(){let r=this.config.libraries??[],n=this.inject("log")?.child({ns:"libraries"})??{warn(){},info(){}};oe(this,Pn,await VH(r,n));let o=this.inject("state");if(o){let s=_(this,Pn).flatMap(i=>i.classNames);o.set(["libraryClassNames"],s)}return _(this,Pn)}};Pn=new WeakMap,a(qp,"Libraries"),Qe(qp,"manifest",{name:"Libraries",namespace:"libraries",version:"1.0.0",description:"Manages CSS library loading, class name extraction, and serving"});au=qp;a(DR,"extractClassNames");a(VH,"normalizeLibraries")});var LR=p(()=>{ZR()});import{defineEsConfig as HH}from"@jucie.io/engine-esbuild";import{dirname as BH,join as GH}from"path";import{fileURLToPath as JH}from"url";var WH,FR,UR=p(()=>{WH=a(()=>{let t=JH(import.meta.url);return BH(t)},"getBundleDir"),FR=HH("designConfig",(t,e)=>({entryPoints:[GH(WH(),"entry.js")],bundle:!0,format:"esm",platform:"browser",sourcemap:!0,sourcesContent:!0,target:["es2020"],jsx:"automatic",jsxImportSource:e.framework==="preact"?"preact":e.framework==="vue"?"vue":"react",loader:{".js":"jsx",".ts":"ts",".tsx":"tsx",".d.ts":"ts"},define:{"process.env.NODE_ENV":JSON.stringify(process.env.NODE_ENV||"development"),"process.env.BASE_URL":JSON.stringify("/"),"process.env.JUCIE_FRAMEWORK":JSON.stringify(e.framework||"react")},treeShaking:!0,splitting:!0,chunkNames:"chunks/[name]-[hash]",assetNames:"assets/[name]-[hash]",external:["fs","path","crypto","stream","http","https","url","querystring","child_process","os","util","zlib","node:crypto","node:http","node:util","node:fs","node:path","firebase-admin","@google-cloud/*","@fastify/*","google-auth-library","google-gax","gtoken","gcp-metadata","teeny-request","jwks-rsa","agent-base","@aws-sdk/client-s3"],outExtension:{".js":".js",".css":".css"}}))});import{defineEsConfig as KH}from"@jucie.io/engine-esbuild";import{existsSync as qR,readdirSync as YH}from"fs";import{join as XH}from"path";function HR(t){let e=e_(t.components||t.componentsDir);if(e.some(o=>o.type==="library")||e.some(o=>o.type==="directory"&&qR(o.path)&&YH(o.path).some(s=>s.endsWith(".js")&&s!=="index.js")))return!0;let n=t.projectRoot||process.cwd();return qR(XH(n,"src","main.js"))}var VR,BR=p(()=>{t_();VR=KH("componentsConfig",(t,e)=>({entryPoints:[{in:"@components",out:"components"},{in:"jucie:main",out:"user-main"}],bundle:!0,format:"esm",platform:"browser",sourcemap:!0,sourcesContent:!0,target:["es2020"],jsx:"automatic",jsxImportSource:e.framework==="preact"?"preact":e.framework==="vue"?"vue":"react",loader:{".js":"jsx",".ts":"ts",".tsx":"tsx",".d.ts":"ts"},define:{"process.env.NODE_ENV":JSON.stringify(process.env.NODE_ENV||"development"),"process.env.BASE_URL":JSON.stringify("/"),"process.env.JUCIE_FRAMEWORK":JSON.stringify(e.framework||"react")},treeShaking:!0,splitting:!1,outExtension:{".js":".js",".css":".css"}}));a(HR,"hasProjectCode")});var GR,JR=p(()=>{h_();GR=a(({title:t,scriptSrc:e,stylesheets:r=[]})=>_p`<!DOCTYPE html>
118
+ <html lang="en">
119
+ <head>
120
+ <meta charset="UTF-8" />
121
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
122
+ <title>${t}</title>
123
+ ${fI(r.map(n=>`<link rel="stylesheet" href="${n}">`).join(`
124
+ `))}
125
+ <style>
126
+ * { box-sizing: border-box; }
127
+ body, html { font-family: Helvetica, Arial, sans-serif; margin: 0; padding: 0; }
128
+ html {
129
+ width: 100vw; height: 100vh; overflow: hidden;
130
+ position: fixed; top: 0; left: 0;
131
+ }
132
+ body { position: absolute; top: 0; left: 0; will-change: transform; backface-visibility: hidden; transform-style: preserve-3d; }
133
+ #app, #temp, #components { display: contents; }
134
+ #app > *, #temp > *, #components > * { position: absolute !important; }
135
+ </style>
136
+ </head>
137
+ <body>
138
+ <div id="app" data-rid="app" data-node-id="app"></div>
139
+ <div id="temp" data-rid="temp" data-node-id="temp"></div>
140
+ <div id="components" data-rid="components" data-node-id="components"></div>
141
+ <script type="module" src="${e}"></script>
142
+ <script>
143
+ if (typeof EventSource !== 'undefined') {
144
+ const es = new EventSource('/hmr');
145
+ es.addEventListener('change', () => { location.reload(); });
146
+ }
147
+ </script>
148
+ </body>
149
+ </html>`,"default")});import{defineRoutes as QH}from"@jucie.io/engine-server";import{join as eB}from"path";var WR,KR=p(()=>{JR();WR=QH((t,e)=>{let r=t("log"),n=t("libraries");function o(){return n.getEntries().map(i=>i.type==="remote"?i.url:`/libraries/${i.path.split("/").pop()}`)}a(o,"getStylesheetUrls");function s(i){try{return i.html(GR({title:`${e.name||"Jucie App"} - Design`,scriptSrc:"/main.js",stylesheets:o()}))}catch(c){return r.error("render failed",{error:c.message}),i.text("Internal Server Error",500)}}return a(s,"renderDesign"),[{method:"get",path:"/assets/*",handler:({respond:i,req:c})=>{let u=c.path.replace("/assets/",""),l=decodeURIComponent(u),d=eB(e.assets,l);return i.file(d)}},{method:"get",path:"/",handler:({respond:i})=>s(i)},{method:"get",path:"/*",handler:({respond:i})=>s(i)}]})});import{defineRoutes as tB}from"@jucie.io/engine-server";import{resolve as Vp,join as nx}from"path";import{existsSync as YR}from"fs";var XR,rB,nB,QR,eA=p(()=>{Yy();XR={"content-type":"text/javascript; charset=utf-8"},rB=`export default {};
150
+ `,nB=`export const __jucieMainStub = true;
151
+ `,QR=tB((t,e)=>{let r=t("log"),n=e.prebuiltStageDir||null,o=e.framework||"react",s=[{method:"get",path:"/main.js",handler:({respond:i})=>{try{let c=n?nx(n,"entry.js"):Vp(e.outdir,"entry.js");return i.file(c)}catch(c){return r.error("failed to serve main.js",{error:c.message}),i.text("Internal Server Error",500)}}},{method:"get",path:"/chunks/*",handler:({respond:i,req:c})=>{try{let u=n||Vp(e.outdir);return i.file(nx(u,c.path.slice(1)))}catch(u){return r.error("failed to serve chunk",{error:u.message,path:c.path}),i.text("Internal Server Error",500)}}},{method:"get",path:"/config.json",handler:({respond:i})=>i.json({name:e.name??null,version:e.version??null,framework:o,metadata:e.metadata??null,mode:e.mode??"design"})},{method:"get",path:"/hmr",handler:({res:i,respond:c})=>{let u=t("cache");try{if(i.setHeader("Content-Type","text/event-stream"),i.setHeader("Cache-Control","no-cache"),i.setHeader("Connection","keep-alive"),i.write(`: connected
152
+
153
+ `),u){let l=u.get("sseClients")||new Set;l.add(i),i.on("close",()=>l.delete(i)),u.set(["sseClients"],l)}return c.handled()}catch(l){r.error("HMR connection failed",{error:l.message})}}}];if(n){let i=Oc[o]||Oc.react;for(let c of[...Object.keys(i),"sdk"])s.push({method:"get",path:`/${c}.js`,handler:({respond:u})=>u.file(nx(n,`${c}.js`))});s.push({method:"get",path:"/components.js",handler:({respond:c})=>{let u=Vp(e.outdir,"components.js");return YR(u)?c.file(u):c.text(rB,200,XR)}}),s.push({method:"get",path:"/user-main.js",handler:({respond:c})=>{let u=Vp(e.outdir,"user-main.js");return YR(u)?c.file(u):c.text(nB,200,XR)}})}return s})});import{defineRoutes as oB}from"@jucie.io/engine-server";function sB(t,e,{maxDepth:r=1/0}={}){let n=" ",o=a((y,x)=>{let k=n.repeat(x);return y.split(`
154
+ `).map(w=>k+w).join(`
155
+ `)},"indent"),s=a(y=>String(y).replace(/"/g,"&quot;"),"esc"),i=a(y=>String(y).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"escText"),c=a(y=>Math.round(y??0),"r"),u=a(y=>`${c(y.x)},${c(y.y)},${c(y.width)}x${c(y.height)}`,"formatBounds"),l=a(y=>{let x=a(w=>!w||typeof w!="object"?"":Object.entries(w).map(([b,E])=>`${b}: ${E}`).join("; "),"cssDecls"),k=[];y.default&&k.push(x(y.default));for(let w of Object.keys(y)){if(w==="default")continue;let b=x(y[w]);b&&k.push(`${w}: { ${b} }`)}return k.filter(Boolean).join(" | ")},"formatStyle"),d=a(y=>Array.isArray(y)?y.join("."):y??"","formatBinding"),m=a(y=>y.map(x=>{let k=x.key??x.name??x.event;if(!k)return null;if(x.mode==="binding"||x.binding){let b=d(x.binding);return b?`${k}=${b}`:k}let w=x.code??x.expression??x.value??x.handler??"";return w?`${k}=${w}`:k}).filter(Boolean).join(", "),"formatEvents"),h=a(y=>y.map(x=>{let k=x.key??x.name;if(!k)return null;if(x.mode==="binding"||x.binding){let b=d(x.binding);return b?`${k}=${b}`:k}let w=x.expression?`{{${x.expression}}}`:x.value??"";return w!==""?`${k}=${w}`:k}).filter(Boolean).join(", "),"formatAttrs"),f=a((y,x)=>{let k=[],w=y.id??x;if(w&&k.push(`id="${s(w)}"`),y.name&&k.push(`name="${s(y.name)}"`),y.bounds&&k.push(`bounds="${u(y.bounds)}"`),y.style&&Object.keys(y.style).length){let b=l(y.style);b&&k.push(`style="${s(b)}"`)}return y.events?.length&&k.push(`events="${s(m(y.events))}"`),y.attributes?.length&&k.push(`attrs="${s(h(y.attributes))}"`),y.className?.length&&k.push(`class="${y.className.join(" ")}"`),y.repeat&&k.push(`repeat="${s(JSON.stringify(y.repeat))}"`),y.component&&k.push(`component="${s(y.component)}"`),y.library&&k.push(`library="${s(y.library)}"`),y.props&&Object.keys(y.props).length&&k.push(`props="${s(JSON.stringify(y.props))}"`),y.route?.path&&k.push(`route="${s(y.route.path)}"`),y.render?.value&&k.push(`render="{{${s(y.render.value)}}}"`),y.destination?.path&&k.push(`dest="${s(y.destination.path)}"`),k.length?" "+k.join(" "):""},"buildAttrString"),g=a(y=>{let x=t[y];if(!x)return null;if(x.ex&&t[x.ex]){let k=g(x.ex);if(!k)return x;let{ex:w,...b}=x;return Object.assign({},k,b)}return x},"resolveNode"),v=a((y,x)=>{let k=t[y],w=g(y);if(!w)return`<!-- missing: ${y} -->`;let b,E;if(w.type==="element"){let ae=k?.ex&&da(k.ex)?k.ex:w.type;b=ae,E=ad(ae)}else if(w.type){b=w.type;let ae=k?.ex&&da(k.ex)?k.ex:w.type;E=ad(ae)}else b=y,E=null;let A=E?`${b}:${E}`:b,O=f(w,y),B=w.textContent?.value||null,q=Array.isArray(w.children)?w.children:[];if(!(q.length>0||B!=null&&B!==""))return`<${A}${O} />`;if(x>=r){let ae=q.length?`<\u22EF${q.length} children>`:"<\u22EFtext>";return`<${A}${O}>${ae}</${A}>`}if(B!=null&&B!==""&&q.length===0)return`<${A}${O}>${i(B)}</${A}>`;let K=q.map(ae=>o(v(ae,x+1),1)).join(`
156
+ `);return`<${A}${O}>
157
+ ${K}
158
+ </${A}>`},"renderNode");return v(e,0)}var tA,rA=p(()=>{od();a(sB,"projectJsx");tA=oB(t=>{let e=t("log");return[{method:"get",path:"/mcp/screenshot",handler:({respond:r})=>{let s=[...t("cache").get(["connections"])??new Set][0];return s?new Promise(i=>{let c=setTimeout(()=>{s.off("server:screenshot:result",u),i(r.json({error:"screenshot timeout"},504))},1e4);function u(l={}){clearTimeout(c),i(l.error?r.json({error:l.error},500):r.json(l))}a(u,"onResult"),s.once("server:screenshot:result",u),s.emit("stage:screenshot:capture")}):r.json({error:"no stage connected"},503)}},{method:"get",path:"/mcp/scene",handler:({req:r,respond:n})=>{try{let o=t("state"),s=r.query.root??"app",i=r.query.depth!=null?Number(r.query.depth):1/0,c=o.get(["nodes"]);if(!c)return n.json({error:"no scene loaded"},503);let u=sB(c,s,{maxDepth:i});return n.json({jsx:u})}catch(o){return e.error("mcp /scene failed",{error:o.message}),n.json({error:o.message},500)}}},{method:"get",path:"/mcp/tools",handler:({respond:r})=>{try{let n=t("aiOps");return r.json({namespaces:n.operationsMetadata})}catch(n){return e.error("mcp /tools failed",{error:n.message}),r.json({error:n.message},500)}}},{method:"post",path:"/mcp/operations",handler:async({req:r,respond:n})=>{try{let o=t("aiOps"),{operations:s=[]}=r.body??{},i=a(y=>{if(y.op){let x=o.resolveType(y.op);if(!x)return{error:o.describeUnresolved(y.op)};let{op:k,ref:w,...b}=y;return{type:x,args:b,ref:w}}if(typeof y.type=="string"){let x=o.resolveType(y.type);return x?{type:x,args:y.args??{},ref:y.ref}:{error:o.describeUnresolved(y.type)}}return{error:`unknown op: ${y.op??y.type}`}},"translate"),c=s.map(i),u=c.filter(y=>y.error),d={operations:c.filter(y=>!y.error)},f=[...t("cache").get(["connections"])??new Set].find(y=>y.data?.aiStageRequest),g;if(f)try{g=await f.data.aiStageRequest("stage:ai:operations:execute",{batch:d},3e3)}catch(y){e.warn("mcp /operations: stage execute failed, falling back to server",{error:y.message}),g=await o.executeBatch(d)}else g=await o.executeBatch(d);let v=g.results.map(y=>y.result);return u.length&&u.forEach(y=>{e.warn("mcp /operations: unresolved op",{error:y.error}),v.push({error:y.error})}),n.json({results:v})}catch(o){return e.error("mcp /operations failed",{error:o.message}),n.json({error:o.message},500)}}}]})});import{defineRoutes as aB}from"@jucie.io/engine-server";var nA,oA=p(()=>{nA=aB(t=>{let e=t("log"),r=t("aiHistory"),n=a((o,s,i=500)=>(e.error("ai chats route failed",{error:s.message}),o.json({error:s.message},i)),"fail");return[{method:"get",path:"/ai/chats",handler:async({respond:o})=>{try{return o.json({sessions:await r.listSessions()})}catch(s){return n(o,s)}}},{method:"post",path:"/ai/chats",handler:async({respond:o})=>{try{return o.json(await r.createSession())}catch(s){return n(o,s)}}},{method:"get",path:"/ai/chats/:id",handler:async({req:o,respond:s})=>{try{let i=await r.getMessages(o.params.id);return s.json({id:o.params.id,messages:i})}catch(i){return n(s,i)}}},{method:"delete",path:"/ai/chats/:id",handler:async({req:o,respond:s})=>{try{return s.json(await r.deleteSession(o.params.id))}catch(i){return n(s,i)}}}]})});import{defineRoutes as iB}from"@jucie.io/engine-server";var sA,aA=p(()=>{sA=iB(t=>{let e=t("libraries");return[{method:"get",path:"/libraries/:filename",handler:({respond:r,req:n})=>{let o=e.findLocal(n.params.filename);return o?r.file(o.path):r.text("Not found",404)}},{method:"get",path:"/api/libraries",handler:({respond:r})=>{let n=e.getClassNames(),o=[...new Set(n)].sort();return r.json({classNames:o})}}]})});var cA={};R(cA,{createDesignServer:()=>gB});import{existsSync as cB}from"fs";import{Engine as uB}from"@jucie.io/engine";import{Server as lB}from"@jucie.io/engine-server";import{SocketServer as dB}from"@jucie.io/engine-socket/server";import{OnChange as pB}from"@jucie.io/state-on-change";import{join as ox}from"path";import{State as fB}from"@jucie.io/state";import{Matcher as mB}from"@jucie.io/state-matcher";import{EsBuild as hB}from"@jucie.io/engine-esbuild";async function gB(t={}){let e={error(){},warn(){},info(){},debug(){}},r=null;try{let n={},o=0,s=t.framework||"react",i=t.stageBundles?ox(t.stageBundles,s):null;t.prebuiltStageDir=i&&cB(ox(i,"entry.js"))?i:null;let c=fB.create().install(mB,pB);r=uB.create({state:c}).install(lB.configure(t),dB.configure({...t.socket,maxHttpBufferSize:5e7}),gn.configure({...t,namespaces:xc}),vn.configure(t),Jo.configure(t),au.configure(t),hB.configure(t),tu,ru.configure({aiServerUrl:t.aiServerUrl??process.env.AI_SERVER_URL??"https://ai.jucie.app/ai/generate",playbook:jR()}),su.configure({dir:ox(t.projectRoot??process.cwd(),".jucie","chats")})),r.aiOps.use(...Up),e=r.log.child({ns:"stage:design"}),r.cache.set(["jucieConfig"],t),r.cache.set(["connections"],new Set);let u=t.prebuiltStageDir?HR(t):!0,l,d=new Promise(f=>{l=f}),m=Ky({onFirstBuild:l});t.prebuiltStageDir?u&&r.esBuild.use(VR,to,ro,Xy,Na,m):r.esBuild.use(FR,to,Yo,ro,Ko,Na,m),r.server.use(QR,tA,nA,sA,WR);let h={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, PUT, DELETE, OPTIONS","access-control-allow-headers":"content-type, authorization"};if(r.server.hooks({onRequest:({req:f,respond:g})=>{if(f.method==="OPTIONS")return g.text("",204,h)},onSend:(f,g)=>{g&&(g.headers={...h,...g.headers})}}),await r.server.listen(),await r.socket.start(),await r.cas.loadScene(),await r.libraries.load(),await r.storeParser.start(),await r.staticAssets.watch(),u){await r.esBuild.watch();let f=await d;if(f.errors.length)throw new Error(`Stage bundle failed to build:
159
+ ${f.errors.join(`
160
+ `)}`)}return r.socket.get().on("connect",f=>{let g=r.cache.get(["connections"]);g.add(f);let v=`User ${g.size}`,y=iA[o%iA.length];o++;let x={name:v,color:y,position:{x:0,y:0},selection:[]};f.emit("studio:load",r.state.get()),f.on("server:commit:changes",A=>{r.state.apply(A),f.broadcast.emit("stage:apply:changes",A)}),f.on("server:broadcast:changes",A=>f.broadcast.emit("stage:apply:changes",A)),f.on("server:broadcast:pointer",A=>{n[f.id].pointer=A,f.broadcast.emit("stage:relay:user:update",f.id,n[f.id])}),f.on("server:broadcast:selectedIds",A=>{n[f.id].selectedIds=A,f.broadcast.emit("stage:relay:user:update",f.id,n[f.id])}),f.on("server:check:asset-exists",async A=>{e.debug("checking asset exists",{filename:A});try{let O=await r.staticAssets.checkFileExists(A),B=O?await r.staticAssets.getNextAvailableName(A):A;f.emit("stage:asset:exists",{exists:O,filename:A,nextAvailable:B})}catch(O){e.error("asset exists check failed",{error:O.message}),f.emit("stage:asset:exists",{exists:!1,error:O.message})}}),f.on("server:upload:asset",async({meta:A,data:O})=>{e.debug("asset upload request",{name:A.name});try{let B=Buffer.from(O),q=await r.staticAssets.saveUploadedFile(B,A);e.info("asset saved",{id:q.id}),f.emit("stage:asset:uploaded",{success:!0,id:q.id,url:q.url,asset:q})}catch(B){e.error("asset upload failed",{error:B.message}),f.emit("stage:asset:uploaded",{success:!1,error:B.message})}}),f.broadcast.emit("stage:relay:user:connected",f.id,x),Object.keys(n).length>0&&r.socket.get().to(f.id).emit("stage:relay:users:set",n),n[f.id]=x,f.on("server:screenshot:result",({imageData:A,error:O}={})=>{r.cache.set(["lastScreenshot"],{imageData:A,error:O,ts:Date.now()})});let k=0,w=new Map;function b(A,O={},B=15e3){return new Promise((q,C)=>{let K=++k,ae=setTimeout(()=>{w.delete(K),C(new Error(`${A} timed out`))},B);w.set(K,{resolve:q,reject:C,timeout:ae}),f.emit(A,{requestId:K,...O})})}a(b,"stageRequest"),f.on("server:ai:result",({requestId:A,result:O,error:B}={})=>{let q=w.get(A);q&&(clearTimeout(q.timeout),w.delete(A),B?q.reject(new Error(B)):q.resolve(O??{}))}),f.data.aiStageRequest=b;let E=null;f.on("server:ai:stop",()=>{E?.abort()}),f.on("server:ai:agent",async({prompt:A,sessionId:O,token:B}={})=>{E?.abort();let q=new AbortController;E=q;try{let C=await r.aiAgent.run({prompt:A,sessionId:O,token:B,signal:q.signal,getContext:(K={})=>b("stage:ai:context:capture",K),execute:K=>b("stage:ai:operations:execute",{batch:K},6e4),onProgress:K=>f.emit("stage:ai:progress",K)});f.emit("stage:ai:response",{...C,sessionId:O})}catch(C){e.error("ai agent failed",{error:C.message}),f.emit("stage:ai:response",{error:C.message,sessionId:O})}finally{E===q&&(E=null)}}),f.on("disconnect",()=>{E?.abort();for(let{reject:A,timeout:O}of w.values())clearTimeout(O),A(new Error("stage disconnected"));w.clear(),delete n[f.id],r.cache.get(["connections"]).delete(f),f.broadcast.emit("stage:relay:user:disconnected",f.id)})}),r.state.onChange.addListener(f=>{e.debug("broadcasting state changes",{keys:Object.keys(f)});for(let g of r.cache.get(["connections"]))g.emit("stage:changes:apply",f)}),{basePath:`http://localhost:${r.server.getHttpServer().address().port}`,view:t.view||"design",env:t.env||"dev",nodeId:null,name:t.name||null,engine:r}}catch(n){e.error("design server failed",{error:n.message,stack:n.stack});try{await r?.server?.stop()}catch{}return jc.failure(n)}}var iA,uA=p(()=>{f_();zn();rR();rx();MR();bc();tp();Hy();LR();UR();BR();no();KR();eA();rA();oA();aA();iA=["#3B82F6","#EF4444","#10B981","#8B5CF6","#EC4899","#F97316","#06B6D4","#6366F1"];a(gB,"createDesignServer")});var ol=Z(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.regexpCode=ke.getEsmExportName=ke.getProperty=ke.safeStringify=ke.stringify=ke.strConcat=ke.addCodeArg=ke.str=ke._=ke.nil=ke._Code=ke.Name=ke.IDENTIFIER=ke._CodeOrName=void 0;var Uw=class Uw{};a(Uw,"_CodeOrName");var rl=Uw;ke._CodeOrName=rl;ke.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var qw=class qw extends rl{constructor(e){if(super(),!ke.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};a(qw,"Name");var ws=qw;ke.Name=ws;var Vw=class Vw extends rl{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof ws&&(r[n.str]=(r[n.str]||0)+1),r),{})}};a(Vw,"_Code");var yr=Vw;ke._Code=yr;ke.nil=new yr("");function WD(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Fw(r,e[n]),r.push(t[++n]);return new yr(r)}a(WD,"_");ke._=WD;var Lw=new yr("+");function KD(t,...e){let r=[nl(t[0])],n=0;for(;n<e.length;)r.push(Lw),Fw(r,e[n]),r.push(Lw,nl(t[++n]));return HW(r),new yr(r)}a(KD,"str");ke.str=KD;function Fw(t,e){e instanceof yr?t.push(...e._items):e instanceof ws?t.push(e):t.push(JW(e))}a(Fw,"addCodeArg");ke.addCodeArg=Fw;function HW(t){let e=1;for(;e<t.length-1;){if(t[e]===Lw){let r=BW(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}a(HW,"optimize");function BW(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ws||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof ws))return`"${t}${e.slice(1)}`}a(BW,"mergeExprItems");function GW(t,e){return e.emptyStr()?t:t.emptyStr()?e:KD`${t}${e}`}a(GW,"strConcat");ke.strConcat=GW;function JW(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:nl(Array.isArray(t)?t.join(","):t)}a(JW,"interpolate");function WW(t){return new yr(nl(t))}a(WW,"stringify");ke.stringify=WW;function nl(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}a(nl,"safeStringify");ke.safeStringify=nl;function KW(t){return typeof t=="string"&&ke.IDENTIFIER.test(t)?new yr(`.${t}`):WD`[${t}]`}a(KW,"getProperty");ke.getProperty=KW;function YW(t){if(typeof t=="string"&&ke.IDENTIFIER.test(t))return new yr(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}a(YW,"getEsmExportName");ke.getEsmExportName=YW;function XW(t){return new yr(t.toString())}a(XW,"regexpCode");ke.regexpCode=XW});var Yw=Z(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.ValueScope=Rt.ValueScopeName=Rt.Scope=Rt.varKinds=Rt.UsedValueState=void 0;var Ct=ol(),Gw=class Gw extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}};a(Gw,"ValueError");var Hw=Gw,em;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(em||(Rt.UsedValueState=em={}));Rt.varKinds={const:new Ct.Name("const"),let:new Ct.Name("let"),var:new Ct.Name("var")};var Jw=class Jw{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ct.Name?e:this.name(e)}name(e){return new Ct.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};a(Jw,"Scope");var tm=Jw;Rt.Scope=tm;var Ww=class Ww extends Ct.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ct._)`.${new Ct.Name(r)}[${n}]`}};a(Ww,"ValueScopeName");var rm=Ww;Rt.ValueScopeName=rm;var QW=(0,Ct._)`\n`,Kw=class Kw extends tm{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?QW:Ct.nil}}get(){return this._scope}name(e){return new rm(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,i=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[s];if(c){let d=c.get(i);if(d)return d}else c=this._values[s]=new Map;c.set(i,o);let u=this._scope[s]||(this._scope[s]=[]),l=u.length;return u[l]=r.ref,o.setValue(r,{property:s,itemIndex:l}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ct._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=Ct.nil;for(let i in e){let c=e[i];if(!c)continue;let u=n[i]=n[i]||new Map;c.forEach(l=>{if(u.has(l))return;u.set(l,em.Started);let d=r(l);if(d){let m=this.opts.es5?Rt.varKinds.var:Rt.varKinds.const;s=(0,Ct._)`${s}${m} ${l} = ${d};${this.opts._n}`}else if(d=o?.(l))s=(0,Ct._)`${s}${d}${this.opts._n}`;else throw new Hw(l);u.set(l,em.Completed)})}return s}};a(Kw,"ValueScope");var Bw=Kw;Rt.ValueScope=Bw});var le=Z(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.or=fe.and=fe.not=fe.CodeGen=fe.operators=fe.varKinds=fe.ValueScopeName=fe.ValueScope=fe.Scope=fe.Name=fe.regexpCode=fe.stringify=fe.getProperty=fe.nil=fe.strConcat=fe.str=fe._=void 0;var ve=ol(),Rr=Yw(),ko=ol();Object.defineProperty(fe,"_",{enumerable:!0,get:function(){return ko._}});Object.defineProperty(fe,"str",{enumerable:!0,get:function(){return ko.str}});Object.defineProperty(fe,"strConcat",{enumerable:!0,get:function(){return ko.strConcat}});Object.defineProperty(fe,"nil",{enumerable:!0,get:function(){return ko.nil}});Object.defineProperty(fe,"getProperty",{enumerable:!0,get:function(){return ko.getProperty}});Object.defineProperty(fe,"stringify",{enumerable:!0,get:function(){return ko.stringify}});Object.defineProperty(fe,"regexpCode",{enumerable:!0,get:function(){return ko.regexpCode}});Object.defineProperty(fe,"Name",{enumerable:!0,get:function(){return ko.Name}});var am=Yw();Object.defineProperty(fe,"Scope",{enumerable:!0,get:function(){return am.Scope}});Object.defineProperty(fe,"ValueScope",{enumerable:!0,get:function(){return am.ValueScope}});Object.defineProperty(fe,"ValueScopeName",{enumerable:!0,get:function(){return am.ValueScopeName}});Object.defineProperty(fe,"varKinds",{enumerable:!0,get:function(){return am.varKinds}});fe.operators={GT:new ve._Code(">"),GTE:new ve._Code(">="),LT:new ve._Code("<"),LTE:new ve._Code("<="),EQ:new ve._Code("==="),NEQ:new ve._Code("!=="),NOT:new ve._Code("!"),OR:new ve._Code("||"),AND:new ve._Code("&&"),ADD:new ve._Code("+")};var l0=class l0{optimizeNodes(){return this}optimizeNames(e,r){return this}};a(l0,"Node");var Zn=l0,d0=class d0 extends Zn{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Rr.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=yi(this.rhs,e,r)),this}get names(){return this.rhs instanceof ve._CodeOrName?this.rhs.names:{}}};a(d0,"Def");var Xw=d0,p0=class p0 extends Zn{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof ve.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=yi(this.rhs,e,r),this}get names(){let e=this.lhs instanceof ve.Name?{}:{...this.lhs.names};return sm(e,this.rhs)}};a(p0,"Assign");var nm=p0,f0=class f0 extends nm{constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}};a(f0,"AssignOp");var Qw=f0,m0=class m0 extends Zn{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}};a(m0,"Label");var e0=m0,h0=class h0 extends Zn{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}};a(h0,"Break");var t0=h0,g0=class g0 extends Zn{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}};a(g0,"Throw");var r0=g0,y0=class y0 extends Zn{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=yi(this.code,e,r),this}get names(){return this.code instanceof ve._CodeOrName?this.code.names:{}}};a(y0,"AnyCode");var n0=y0,_0=class _0 extends Zn{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(eK(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>$s(e,r.names),{})}};a(_0,"ParentNode");var sl=_0,x0=class x0 extends sl{render(e){return"{"+e._n+super.render(e)+"}"+e._n}};a(x0,"BlockNode");var Ln=x0,v0=class v0 extends sl{};a(v0,"Root");var o0=v0,b0=class b0 extends Ln{};a(b0,"Else");var gi=b0;gi.kind="else";var hi=class hi extends Ln{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new gi(n):n}if(r)return e===!1?r instanceof hi?r:r.nodes:this.nodes.length?this:new hi(YD(e),r instanceof hi?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=yi(this.condition,e,r),this}get names(){let e=super.names;return sm(e,this.condition),this.else&&$s(e,this.else.names),e}};a(hi,"If");var ks=hi;ks.kind="if";var w0=class w0 extends Ln{};a(w0,"For");var Ss=w0;Ss.kind="for";var k0=class k0 extends Ss{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=yi(this.iteration,e,r),this}get names(){return $s(super.names,this.iteration.names)}};a(k0,"ForLoop");var s0=k0,S0=class S0 extends Ss{constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?Rr.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=sm(super.names,this.from);return sm(e,this.to)}};a(S0,"ForRange");var a0=S0,$0=class $0 extends Ss{constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=yi(this.iterable,e,r),this}get names(){return $s(super.names,this.iterable.names)}};a($0,"ForIter");var om=$0,E0=class E0 extends Ln{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};a(E0,"Func");var al=E0;al.kind="func";var N0=class N0 extends sl{render(e){return"return "+super.render(e)}};a(N0,"Return");var il=N0;il.kind="return";var T0=class T0 extends Ln{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&$s(e,this.catch.names),this.finally&&$s(e,this.finally.names),e}};a(T0,"Try");var i0=T0,z0=class z0 extends Ln{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};a(z0,"Catch");var cl=z0;cl.kind="catch";var O0=class O0 extends Ln{render(e){return"finally"+super.render(e)}};a(O0,"Finally");var ul=O0;ul.kind="finally";var P0=class P0{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
161
+ `:""},this._extScope=e,this._scope=new Rr.Scope({parent:e}),this._nodes=[new o0]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new Xw(e,s,n)),s}const(e,r,n){return this._def(Rr.varKinds.const,e,r,n)}let(e,r,n){return this._def(Rr.varKinds.let,e,r,n)}var(e,r,n){return this._def(Rr.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new nm(e,r,n))}add(e,r){return this._leafNode(new Qw(e,fe.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==ve.nil&&this._leafNode(new n0(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,ve.addCodeArg)(r,o));return r.push("}"),new ve._Code(r)}if(e,r,n){if(this._blockNode(new ks(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new ks(e))}else(){return this._elseNode(new gi)}endIf(){return this._endBlockNode(ks,gi)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new s0(e),r)}forRange(e,r,n,o,s=this.opts.es5?Rr.varKinds.var:Rr.varKinds.let){let i=this._scope.toName(e);return this._for(new a0(s,i,r,n),()=>o(i))}forOf(e,r,n,o=Rr.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof ve.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ve._)`${i}.length`,c=>{this.var(s,(0,ve._)`${i}[${c}]`),n(s)})}return this._for(new om("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?Rr.varKinds.var:Rr.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,ve._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new om("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(Ss)}label(e){return this._leafNode(new e0(e))}break(e){return this._leafNode(new t0(e))}return(e){let r=new il;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(il)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new i0;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new cl(s),r(s)}return n&&(this._currNode=o.finally=new ul,this.code(n)),this._endBlockNode(cl,ul)}throw(e){return this._leafNode(new r0(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=ve.nil,n,o){return this._blockNode(new al(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(al)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof ks))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};a(P0,"CodeGen");var c0=P0;fe.CodeGen=c0;function $s(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a($s,"addNames");function sm(t,e){return e instanceof ve._CodeOrName?$s(t,e.names):t}a(sm,"addExprNames");function yi(t,e,r){if(t instanceof ve.Name)return n(t);if(!o(t))return t;return new ve._Code(t._items.reduce((s,i)=>(i instanceof ve.Name&&(i=n(i)),i instanceof ve._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function o(s){return s instanceof ve._Code&&s._items.some(i=>i instanceof ve.Name&&e[i.str]===1&&r[i.str]!==void 0)}}a(yi,"optimizeExpr");function eK(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(eK,"subtractNames");function YD(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,ve._)`!${u0(t)}`}a(YD,"not");fe.not=YD;var tK=XD(fe.operators.AND);function rK(...t){return t.reduce(tK)}a(rK,"and");fe.and=rK;var nK=XD(fe.operators.OR);function oK(...t){return t.reduce(nK)}a(oK,"or");fe.or=oK;function XD(t){return(e,r)=>e===ve.nil?r:r===ve.nil?e:(0,ve._)`${u0(e)} ${t} ${u0(r)}`}a(XD,"mappend");function u0(t){return t instanceof ve.Name?t:(0,ve._)`(${t})`}a(u0,"par")});var be=Z(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.checkStrictMode=me.getErrorPath=me.Type=me.useFunc=me.setEvaluated=me.evaluatedPropsToName=me.mergeEvaluated=me.eachItem=me.unescapeJsonPointer=me.escapeJsonPointer=me.escapeFragment=me.unescapeFragment=me.schemaRefOrVal=me.schemaHasRulesButRef=me.schemaHasRules=me.checkUnknownRules=me.alwaysValidSchema=me.toHash=void 0;var Ce=le(),sK=ol();function aK(t){let e={};for(let r of t)e[r]=!0;return e}a(aK,"toHash");me.toHash=aK;function iK(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(t2(t,e),!r2(e,t.self.RULES.all))}a(iK,"alwaysValidSchema");me.alwaysValidSchema=iK;function t2(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||s2(t,`unknown keyword: "${s}"`)}a(t2,"checkUnknownRules");me.checkUnknownRules=t2;function r2(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(r2,"schemaHasRules");me.schemaHasRules=r2;function cK(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(cK,"schemaHasRulesButRef");me.schemaHasRulesButRef=cK;function uK({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Ce._)`${r}`}return(0,Ce._)`${t}${e}${(0,Ce.getProperty)(n)}`}a(uK,"schemaRefOrVal");me.schemaRefOrVal=uK;function lK(t){return n2(decodeURIComponent(t))}a(lK,"unescapeFragment");me.unescapeFragment=lK;function dK(t){return encodeURIComponent(C0(t))}a(dK,"escapeFragment");me.escapeFragment=dK;function C0(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(C0,"escapeJsonPointer");me.escapeJsonPointer=C0;function n2(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(n2,"unescapeJsonPointer");me.unescapeJsonPointer=n2;function pK(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(pK,"eachItem");me.eachItem=pK;function QD({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,i,c)=>{let u=i===void 0?s:i instanceof Ce.Name?(s instanceof Ce.Name?t(o,s,i):e(o,s,i),i):s instanceof Ce.Name?(e(o,i,s),s):r(s,i);return c===Ce.Name&&!(u instanceof Ce.Name)?n(o,u):u}}a(QD,"makeMergeEvaluated");me.mergeEvaluated={props:QD({mergeNames:(t,e,r)=>t.if((0,Ce._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Ce._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Ce._)`${r} || {}`).code((0,Ce._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Ce._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Ce._)`${r} || {}`),R0(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:o2}),items:QD({mergeNames:(t,e,r)=>t.if((0,Ce._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Ce._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Ce._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Ce._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function o2(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Ce._)`{}`);return e!==void 0&&R0(t,r,e),r}a(o2,"evaluatedPropsToName");me.evaluatedPropsToName=o2;function R0(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Ce._)`${e}${(0,Ce.getProperty)(n)}`,!0))}a(R0,"setEvaluated");me.setEvaluated=R0;var e2={};function fK(t,e){return t.scopeValue("func",{ref:e,code:e2[e.code]||(e2[e.code]=new sK._Code(e.code))})}a(fK,"useFunc");me.useFunc=fK;var I0;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(I0||(me.Type=I0={}));function mK(t,e,r){if(t instanceof Ce.Name){let n=e===I0.Num;return r?n?(0,Ce._)`"[" + ${t} + "]"`:(0,Ce._)`"['" + ${t} + "']"`:n?(0,Ce._)`"/" + ${t}`:(0,Ce._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Ce.getProperty)(t).toString():"/"+C0(t)}a(mK,"getErrorPath");me.getErrorPath=mK;function s2(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}a(s2,"checkStrictMode");me.checkStrictMode=s2});var Fn=Z(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});var ht=le(),hK={data:new ht.Name("data"),valCxt:new ht.Name("valCxt"),instancePath:new ht.Name("instancePath"),parentData:new ht.Name("parentData"),parentDataProperty:new ht.Name("parentDataProperty"),rootData:new ht.Name("rootData"),dynamicAnchors:new ht.Name("dynamicAnchors"),vErrors:new ht.Name("vErrors"),errors:new ht.Name("errors"),this:new ht.Name("this"),self:new ht.Name("self"),scope:new ht.Name("scope"),json:new ht.Name("json"),jsonPos:new ht.Name("jsonPos"),jsonLen:new ht.Name("jsonLen"),jsonPart:new ht.Name("jsonPart")};A0.default=hK});var ll=Z(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.extendErrors=gt.resetErrorsCount=gt.reportExtraError=gt.reportError=gt.keyword$DataError=gt.keywordError=void 0;var we=le(),im=be(),Et=Fn();gt.keywordError={message:({keyword:t})=>(0,we.str)`must pass "${t}" keyword validation`};gt.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,we.str)`"${t}" keyword must be ${e} ($data)`:(0,we.str)`"${t}" keyword is invalid ($data)`};function gK(t,e=gt.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:i,allErrors:c}=o,u=c2(t,e,r);n??(i||c)?a2(s,u):i2(o,(0,we._)`[${u}]`)}a(gK,"reportError");gt.reportError=gK;function yK(t,e=gt.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:i}=n,c=c2(t,e,r);a2(o,c),s||i||i2(n,Et.default.vErrors)}a(yK,"reportExtraError");gt.reportExtraError=yK;function _K(t,e){t.assign(Et.default.errors,e),t.if((0,we._)`${Et.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,we._)`${Et.default.vErrors}.length`,e),()=>t.assign(Et.default.vErrors,null)))}a(_K,"resetErrorsCount");gt.resetErrorsCount=_K;function xK({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",o,Et.default.errors,c=>{t.const(i,(0,we._)`${Et.default.vErrors}[${c}]`),t.if((0,we._)`${i}.instancePath === undefined`,()=>t.assign((0,we._)`${i}.instancePath`,(0,we.strConcat)(Et.default.instancePath,s.errorPath))),t.assign((0,we._)`${i}.schemaPath`,(0,we.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,we._)`${i}.schema`,r),t.assign((0,we._)`${i}.data`,n))})}a(xK,"extendErrors");gt.extendErrors=xK;function a2(t,e){let r=t.const("err",e);t.if((0,we._)`${Et.default.vErrors} === null`,()=>t.assign(Et.default.vErrors,(0,we._)`[${r}]`),(0,we._)`${Et.default.vErrors}.push(${r})`),t.code((0,we._)`${Et.default.errors}++`)}a(a2,"addError");function i2(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,we._)`new ${t.ValidationError}(${e})`):(r.assign((0,we._)`${n}.errors`,e),r.return(!1))}a(i2,"returnErrors");var Es={keyword:new we.Name("keyword"),schemaPath:new we.Name("schemaPath"),params:new we.Name("params"),propertyName:new we.Name("propertyName"),message:new we.Name("message"),schema:new we.Name("schema"),parentSchema:new we.Name("parentSchema")};function c2(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,we._)`{}`:vK(t,e,r)}a(c2,"errorObjectCode");function vK(t,e,r={}){let{gen:n,it:o}=t,s=[bK(o,r),wK(t,r)];return kK(t,e,s),n.object(...s)}a(vK,"errorObject");function bK({errorPath:t},{instancePath:e}){let r=e?(0,we.str)`${t}${(0,im.getErrorPath)(e,im.Type.Str)}`:t;return[Et.default.instancePath,(0,we.strConcat)(Et.default.instancePath,r)]}a(bK,"errorInstancePath");function wK({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,we.str)`${e}/${t}`;return r&&(o=(0,we.str)`${o}${(0,im.getErrorPath)(r,im.Type.Str)}`),[Es.schemaPath,o]}a(wK,"errorSchemaPath");function kK(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:i,it:c}=t,{opts:u,propertyName:l,topSchemaRef:d,schemaPath:m}=c;n.push([Es.keyword,o],[Es.params,typeof e=="function"?e(t):e||(0,we._)`{}`]),u.messages&&n.push([Es.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([Es.schema,i],[Es.parentSchema,(0,we._)`${d}${m}`],[Et.default.data,s]),l&&n.push([Es.propertyName,l])}a(kK,"extraErrorProps")});var l2=Z(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.boolOrEmptySchema=_i.topBoolOrEmptySchema=void 0;var SK=ll(),$K=le(),EK=Fn(),NK={message:"boolean schema is false"};function TK(t){let{gen:e,schema:r,validateName:n}=t;r===!1?u2(t,!1):typeof r=="object"&&r.$async===!0?e.return(EK.default.data):(e.assign((0,$K._)`${n}.errors`,null),e.return(!0))}a(TK,"topBoolOrEmptySchema");_i.topBoolOrEmptySchema=TK;function zK(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),u2(t)):r.var(e,!0)}a(zK,"boolOrEmptySchema");_i.boolOrEmptySchema=zK;function u2(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,SK.reportError)(o,NK,void 0,e)}a(u2,"falseSchemaError")});var j0=Z(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.getRules=xi.isJSONType=void 0;var OK=["string","number","integer","boolean","null","object","array"],PK=new Set(OK);function IK(t){return typeof t=="string"&&PK.has(t)}a(IK,"isJSONType");xi.isJSONType=IK;function CK(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}a(CK,"getRules");xi.getRules=CK});var M0=Z(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.shouldUseRule=So.shouldUseGroup=So.schemaHasRulesForType=void 0;function RK({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&d2(t,n)}a(RK,"schemaHasRulesForType");So.schemaHasRulesForType=RK;function d2(t,e){return e.rules.some(r=>p2(t,r))}a(d2,"shouldUseGroup");So.shouldUseGroup=d2;function p2(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}a(p2,"shouldUseRule");So.shouldUseRule=p2});var dl=Z(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.reportTypeError=yt.checkDataTypes=yt.checkDataType=yt.coerceAndCheckDataType=yt.getJSONTypes=yt.getSchemaTypes=yt.DataType=void 0;var AK=j0(),jK=M0(),MK=ll(),ue=le(),f2=be(),vi;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(vi||(yt.DataType=vi={}));function DK(t){let e=m2(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}a(DK,"getSchemaTypes");yt.getSchemaTypes=DK;function m2(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(AK.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(m2,"getJSONTypes");yt.getJSONTypes=m2;function ZK(t,e){let{gen:r,data:n,opts:o}=t,s=LK(e,o.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,jK.schemaHasRulesForType)(t,e[0]));if(i){let c=Z0(e,n,o.strictNumbers,vi.Wrong);r.if(c,()=>{s.length?FK(t,e,s):L0(t)})}return i}a(ZK,"coerceAndCheckDataType");yt.coerceAndCheckDataType=ZK;var h2=new Set(["string","number","integer","boolean","null"]);function LK(t,e){return e?t.filter(r=>h2.has(r)||e==="array"&&r==="array"):[]}a(LK,"coerceToTypes");function FK(t,e,r){let{gen:n,data:o,opts:s}=t,i=n.let("dataType",(0,ue._)`typeof ${o}`),c=n.let("coerced",(0,ue._)`undefined`);s.coerceTypes==="array"&&n.if((0,ue._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,ue._)`${o}[0]`).assign(i,(0,ue._)`typeof ${o}`).if(Z0(e,o,s.strictNumbers),()=>n.assign(c,o))),n.if((0,ue._)`${c} !== undefined`);for(let l of r)(h2.has(l)||l==="array"&&s.coerceTypes==="array")&&u(l);n.else(),L0(t),n.endIf(),n.if((0,ue._)`${c} !== undefined`,()=>{n.assign(o,c),UK(t,c)});function u(l){switch(l){case"string":n.elseIf((0,ue._)`${i} == "number" || ${i} == "boolean"`).assign(c,(0,ue._)`"" + ${o}`).elseIf((0,ue._)`${o} === null`).assign(c,(0,ue._)`""`);return;case"number":n.elseIf((0,ue._)`${i} == "boolean" || ${o} === null
162
+ || (${i} == "string" && ${o} && ${o} == +${o})`).assign(c,(0,ue._)`+${o}`);return;case"integer":n.elseIf((0,ue._)`${i} === "boolean" || ${o} === null
163
+ || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(c,(0,ue._)`+${o}`);return;case"boolean":n.elseIf((0,ue._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(c,!1).elseIf((0,ue._)`${o} === "true" || ${o} === 1`).assign(c,!0);return;case"null":n.elseIf((0,ue._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(c,null);return;case"array":n.elseIf((0,ue._)`${i} === "string" || ${i} === "number"
164
+ || ${i} === "boolean" || ${o} === null`).assign(c,(0,ue._)`[${o}]`)}}a(u,"coerceSpecificType")}a(FK,"coerceData");function UK({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,ue._)`${e} !== undefined`,()=>t.assign((0,ue._)`${e}[${r}]`,n))}a(UK,"assignParentData");function D0(t,e,r,n=vi.Correct){let o=n===vi.Correct?ue.operators.EQ:ue.operators.NEQ,s;switch(t){case"null":return(0,ue._)`${e} ${o} null`;case"array":s=(0,ue._)`Array.isArray(${e})`;break;case"object":s=(0,ue._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i((0,ue._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return(0,ue._)`typeof ${e} ${o} ${t}`}return n===vi.Correct?s:(0,ue.not)(s);function i(c=ue.nil){return(0,ue.and)((0,ue._)`typeof ${e} == "number"`,c,r?(0,ue._)`isFinite(${e})`:ue.nil)}}a(D0,"checkDataType");yt.checkDataType=D0;function Z0(t,e,r,n){if(t.length===1)return D0(t[0],e,r,n);let o,s=(0,f2.toHash)(t);if(s.array&&s.object){let i=(0,ue._)`typeof ${e} != "object"`;o=s.null?i:(0,ue._)`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else o=ue.nil;s.number&&delete s.integer;for(let i in s)o=(0,ue.and)(o,D0(i,e,r,n));return o}a(Z0,"checkDataTypes");yt.checkDataTypes=Z0;var qK={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,ue._)`{type: ${t}}`:(0,ue._)`{type: ${e}}`};function L0(t){let e=VK(t);(0,MK.reportError)(e,qK)}a(L0,"reportTypeError");yt.reportTypeError=L0;function VK(t){let{gen:e,data:r,schema:n}=t,o=(0,f2.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(VK,"getTypeErrorContext")});var y2=Z(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.assignDefaults=void 0;var bi=le(),HK=be();function BK(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)g2(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>g2(t,s,o.default))}a(BK,"assignDefaults");cm.assignDefaults=BK;function g2(t,e,r){let{gen:n,compositeRule:o,data:s,opts:i}=t;if(r===void 0)return;let c=(0,bi._)`${s}${(0,bi.getProperty)(e)}`;if(o){(0,HK.checkStrictMode)(t,`default is ignored for: ${c}`);return}let u=(0,bi._)`${c} === undefined`;i.useDefaults==="empty"&&(u=(0,bi._)`${u} || ${c} === null || ${c} === ""`),n.if(u,(0,bi._)`${c} = ${(0,bi.stringify)(r)}`)}a(g2,"assignDefault")});var _r=Z(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.validateUnion=Oe.validateArray=Oe.usePattern=Oe.callValidateCode=Oe.schemaProperties=Oe.allSchemaProperties=Oe.noPropertyInData=Oe.propertyInData=Oe.isOwnProperty=Oe.hasPropFunc=Oe.reportMissingProp=Oe.checkMissingProp=Oe.checkReportMissingProp=void 0;var Ze=le(),F0=be(),$o=Fn(),GK=be();function JK(t,e){let{gen:r,data:n,it:o}=t;r.if(q0(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Ze._)`${e}`},!0),t.error()})}a(JK,"checkReportMissingProp");Oe.checkReportMissingProp=JK;function WK({gen:t,data:e,it:{opts:r}},n,o){return(0,Ze.or)(...n.map(s=>(0,Ze.and)(q0(t,e,s,r.ownProperties),(0,Ze._)`${o} = ${s}`)))}a(WK,"checkMissingProp");Oe.checkMissingProp=WK;function KK(t,e){t.setParams({missingProperty:e},!0),t.error()}a(KK,"reportMissingProp");Oe.reportMissingProp=KK;function _2(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ze._)`Object.prototype.hasOwnProperty`})}a(_2,"hasPropFunc");Oe.hasPropFunc=_2;function U0(t,e,r){return(0,Ze._)`${_2(t)}.call(${e}, ${r})`}a(U0,"isOwnProperty");Oe.isOwnProperty=U0;function YK(t,e,r,n){let o=(0,Ze._)`${e}${(0,Ze.getProperty)(r)} !== undefined`;return n?(0,Ze._)`${o} && ${U0(t,e,r)}`:o}a(YK,"propertyInData");Oe.propertyInData=YK;function q0(t,e,r,n){let o=(0,Ze._)`${e}${(0,Ze.getProperty)(r)} === undefined`;return n?(0,Ze.or)(o,(0,Ze.not)(U0(t,e,r))):o}a(q0,"noPropertyInData");Oe.noPropertyInData=q0;function x2(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(x2,"allSchemaProperties");Oe.allSchemaProperties=x2;function XK(t,e){return x2(e).filter(r=>!(0,F0.alwaysValidSchema)(t,e[r]))}a(XK,"schemaProperties");Oe.schemaProperties=XK;function QK({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:i},c,u,l){let d=l?(0,Ze._)`${t}, ${e}, ${n}${o}`:e,m=[[$o.default.instancePath,(0,Ze.strConcat)($o.default.instancePath,s)],[$o.default.parentData,i.parentData],[$o.default.parentDataProperty,i.parentDataProperty],[$o.default.rootData,$o.default.rootData]];i.opts.dynamicRef&&m.push([$o.default.dynamicAnchors,$o.default.dynamicAnchors]);let h=(0,Ze._)`${d}, ${r.object(...m)}`;return u!==Ze.nil?(0,Ze._)`${c}.call(${u}, ${h})`:(0,Ze._)`${c}(${h})`}a(QK,"callValidateCode");Oe.callValidateCode=QK;var e7=(0,Ze._)`new RegExp`;function t7({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,Ze._)`${o.code==="new RegExp"?e7:(0,GK.useFunc)(t,o)}(${r}, ${n})`})}a(t7,"usePattern");Oe.usePattern=t7;function r7(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let c=e.let("valid",!0);return i(()=>e.assign(c,!1)),c}return e.var(s,!0),i(()=>e.break()),s;function i(c){let u=e.const("len",(0,Ze._)`${r}.length`);e.forRange("i",0,u,l=>{t.subschema({keyword:n,dataProp:l,dataPropType:F0.Type.Num},s),e.if((0,Ze.not)(s),c)})}a(i,"validateItems")}a(r7,"validateArray");Oe.validateArray=r7;function n7(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,F0.alwaysValidSchema)(o,u))&&!o.opts.unevaluated)return;let i=e.let("valid",!1),c=e.name("_valid");e.block(()=>r.forEach((u,l)=>{let d=t.subschema({keyword:n,schemaProp:l,compositeRule:!0},c);e.assign(i,(0,Ze._)`${i} || ${c}`),t.mergeValidEvaluated(d,c)||e.if((0,Ze.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}a(n7,"validateUnion");Oe.validateUnion=n7});var w2=Z(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.validateKeywordUsage=en.validSchemaType=en.funcKeywordCode=en.macroKeywordCode=void 0;var Nt=le(),Ns=Fn(),o7=_r(),s7=ll();function a7(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=t,c=e.macro.call(i.self,o,s,i),u=b2(r,n,c);i.opts.validateSchema!==!1&&i.self.validateSchema(c,!0);let l=r.name("valid");t.subschema({schema:c,schemaPath:Nt.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},l),t.pass(l,()=>t.error(!0))}a(a7,"macroKeywordCode");en.macroKeywordCode=a7;function i7(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:c,it:u}=t;u7(u,e);let l=!c&&e.compile?e.compile.call(u.self,s,i,u):e.validate,d=b2(n,o,l),m=n.let("valid");t.block$data(m,h),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function h(){if(e.errors===!1)v(),e.modifying&&v2(t),y(()=>t.error());else{let x=e.async?f():g();e.modifying&&v2(t),y(()=>c7(t,x))}}a(h,"validateKeyword");function f(){let x=n.let("ruleErrs",null);return n.try(()=>v((0,Nt._)`await `),k=>n.assign(m,!1).if((0,Nt._)`${k} instanceof ${u.ValidationError}`,()=>n.assign(x,(0,Nt._)`${k}.errors`),()=>n.throw(k))),x}a(f,"validateAsync");function g(){let x=(0,Nt._)`${d}.errors`;return n.assign(x,null),v(Nt.nil),x}a(g,"validateSync");function v(x=e.async?(0,Nt._)`await `:Nt.nil){let k=u.opts.passContext?Ns.default.this:Ns.default.self,w=!("compile"in e&&!c||e.schema===!1);n.assign(m,(0,Nt._)`${x}${(0,o7.callValidateCode)(t,d,k,w)}`,e.modifying)}a(v,"assignValid");function y(x){var k;n.if((0,Nt.not)((k=e.valid)!==null&&k!==void 0?k:m),x)}a(y,"reportErrs")}a(i7,"funcKeywordCode");en.funcKeywordCode=i7;function v2(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Nt._)`${n.parentData}[${n.parentDataProperty}]`))}a(v2,"modifyData");function c7(t,e){let{gen:r}=t;r.if((0,Nt._)`Array.isArray(${e})`,()=>{r.assign(Ns.default.vErrors,(0,Nt._)`${Ns.default.vErrors} === null ? ${e} : ${Ns.default.vErrors}.concat(${e})`).assign(Ns.default.errors,(0,Nt._)`${Ns.default.vErrors}.length`),(0,s7.extendErrors)(t)},()=>t.error())}a(c7,"addErrs");function u7({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(u7,"checkAsyncKeyword");function b2(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Nt.stringify)(r)})}a(b2,"useKeyword");function l7(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}a(l7,"validSchemaType");en.validSchemaType=l7;function d7({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let i=o.dependencies;if(i?.some(c=>!Object.prototype.hasOwnProperty.call(t,c)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}a(d7,"validateKeywordUsage");en.validateKeywordUsage=d7});var S2=Z(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.extendSubschemaMode=Eo.extendSubschemaData=Eo.getSubschema=void 0;var tn=le(),k2=be();function p7(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let c=t.schema[e];return r===void 0?{schema:c,schemaPath:(0,tn._)`${t.schemaPath}${(0,tn.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:c[r],schemaPath:(0,tn._)`${t.schemaPath}${(0,tn.getProperty)(e)}${(0,tn.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,k2.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}a(p7,"getSubschema");Eo.getSubschema=p7;function f7(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:i}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=e;if(r!==void 0){let{errorPath:l,dataPathArr:d,opts:m}=e,h=c.let("data",(0,tn._)`${e.data}${(0,tn.getProperty)(r)}`,!0);u(h),t.errorPath=(0,tn.str)`${l}${(0,k2.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,tn._)`${r}`,t.dataPathArr=[...d,t.parentDataProperty]}if(o!==void 0){let l=o instanceof tn.Name?o:c.let("data",o,!0);u(l),i!==void 0&&(t.propertyName=i)}s&&(t.dataTypes=s);function u(l){t.data=l,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,l]}a(u,"dataContextProps")}a(f7,"extendSubschemaData");Eo.extendSubschemaData=f7;function m7(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}a(m7,"extendSubschemaMode");Eo.extendSubschemaMode=m7});var V0=Z((BDe,$2)=>{"use strict";$2.exports=a(function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r},"equal")});var N2=Z((JDe,E2)=>{"use strict";var No=E2.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};um(e,n,o,t,"",t)};No.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};No.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};No.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};No.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function um(t,e,r,n,o,s,i,c,u,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,i,c,u,l);for(var d in n){var m=n[d];if(Array.isArray(m)){if(d in No.arrayKeywords)for(var h=0;h<m.length;h++)um(t,e,r,m[h],o+"/"+d+"/"+h,s,o,d,n,h)}else if(d in No.propsKeywords){if(m&&typeof m=="object")for(var f in m)um(t,e,r,m[f],o+"/"+d+"/"+h7(f),s,o,d,n,f)}else(d in No.keywords||t.allKeys&&!(d in No.skipKeywords))&&um(t,e,r,m,o+"/"+d,s,o,d,n)}r(n,o,s,i,c,u,l)}}a(um,"_traverse");function h7(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(h7,"escapeJsonPtr")});var pl=Z(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.getSchemaRefs=At.resolveUrl=At.normalizeId=At._getFullPath=At.getFullPath=At.inlineRef=void 0;var g7=be(),y7=V0(),_7=N2(),x7=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function v7(t,e=!0){return typeof t=="boolean"?!0:e===!0?!H0(t):e?T2(t)<=e:!1}a(v7,"inlineRef");At.inlineRef=v7;var b7=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function H0(t){for(let e in t){if(b7.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(H0)||typeof r=="object"&&H0(r))return!0}return!1}a(H0,"hasRef");function T2(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!x7.has(r)&&(typeof t[r]=="object"&&(0,g7.eachItem)(t[r],n=>e+=T2(n)),e===1/0))return 1/0}return e}a(T2,"countKeys");function z2(t,e="",r){r!==!1&&(e=wi(e));let n=t.parse(e);return O2(t,n)}a(z2,"getFullPath");At.getFullPath=z2;function O2(t,e){return t.serialize(e).split("#")[0]+"#"}a(O2,"_getFullPath");At._getFullPath=O2;var w7=/#\/?$/;function wi(t){return t?t.replace(w7,""):""}a(wi,"normalizeId");At.normalizeId=wi;function k7(t,e,r){return r=wi(r),t.resolve(e,r)}a(k7,"resolveUrl");At.resolveUrl=k7;var S7=/^[a-z_][-a-z0-9._]*$/i;function $7(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=wi(t[r]||e),s={"":o},i=z2(n,o,!1),c={},u=new Set;return _7(t,{allKeys:!0},(m,h,f,g)=>{if(g===void 0)return;let v=i+h,y=s[g];typeof m[r]=="string"&&(y=x.call(this,m[r])),k.call(this,m.$anchor),k.call(this,m.$dynamicAnchor),s[h]=y;function x(w){let b=this.opts.uriResolver.resolve;if(w=wi(y?b(y,w):w),u.has(w))throw d(w);u.add(w);let E=this.refs[w];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?l(m,E.schema,w):w!==wi(v)&&(w[0]==="#"?(l(m,c[w],w),c[w]=m):this.refs[w]=v),w}a(x,"addRef");function k(w){if(typeof w=="string"){if(!S7.test(w))throw new Error(`invalid anchor "${w}"`);x.call(this,`#${w}`)}}a(k,"addAnchor")}),c;function l(m,h,f){if(h!==void 0&&!y7(m,h))throw d(f)}a(l,"checkAmbiguosRef");function d(m){return new Error(`reference "${m}" resolves to more than one schema`)}a(d,"ambiguos")}a($7,"getSchemaRefs");At.getSchemaRefs=$7});var hl=Z(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.getData=To.KeywordCxt=To.validateFunctionCode=void 0;var A2=l2(),P2=dl(),G0=M0(),lm=dl(),E7=y2(),ml=w2(),B0=S2(),W=le(),se=Fn(),N7=pl(),Un=be(),fl=ll();function T7(t){if(D2(t)&&(Z2(t),M2(t))){P7(t);return}j2(t,()=>(0,A2.topBoolOrEmptySchema)(t))}a(T7,"validateFunctionCode");To.validateFunctionCode=T7;function j2({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,W._)`${se.default.data}, ${se.default.valCxt}`,n.$async,()=>{t.code((0,W._)`"use strict"; ${I2(r,o)}`),O7(t,o),t.code(s)}):t.func(e,(0,W._)`${se.default.data}, ${z7(o)}`,n.$async,()=>t.code(I2(r,o)).code(s))}a(j2,"validateFunction");function z7(t){return(0,W._)`{${se.default.instancePath}="", ${se.default.parentData}, ${se.default.parentDataProperty}, ${se.default.rootData}=${se.default.data}${t.dynamicRef?(0,W._)`, ${se.default.dynamicAnchors}={}`:W.nil}}={}`}a(z7,"destructureValCxt");function O7(t,e){t.if(se.default.valCxt,()=>{t.var(se.default.instancePath,(0,W._)`${se.default.valCxt}.${se.default.instancePath}`),t.var(se.default.parentData,(0,W._)`${se.default.valCxt}.${se.default.parentData}`),t.var(se.default.parentDataProperty,(0,W._)`${se.default.valCxt}.${se.default.parentDataProperty}`),t.var(se.default.rootData,(0,W._)`${se.default.valCxt}.${se.default.rootData}`),e.dynamicRef&&t.var(se.default.dynamicAnchors,(0,W._)`${se.default.valCxt}.${se.default.dynamicAnchors}`)},()=>{t.var(se.default.instancePath,(0,W._)`""`),t.var(se.default.parentData,(0,W._)`undefined`),t.var(se.default.parentDataProperty,(0,W._)`undefined`),t.var(se.default.rootData,se.default.data),e.dynamicRef&&t.var(se.default.dynamicAnchors,(0,W._)`{}`)})}a(O7,"destructureValCxtES5");function P7(t){let{schema:e,opts:r,gen:n}=t;j2(t,()=>{r.$comment&&e.$comment&&F2(t),j7(t),n.let(se.default.vErrors,null),n.let(se.default.errors,0),r.unevaluated&&I7(t),L2(t),Z7(t)})}a(P7,"topSchemaObjCode");function I7(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,W._)`${r}.evaluated`),e.if((0,W._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,W._)`${t.evaluated}.props`,(0,W._)`undefined`)),e.if((0,W._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,W._)`${t.evaluated}.items`,(0,W._)`undefined`))}a(I7,"resetEvaluated");function I2(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,W._)`/*# sourceURL=${r} */`:W.nil}a(I2,"funcSourceUrl");function C7(t,e){if(D2(t)&&(Z2(t),M2(t))){R7(t,e);return}(0,A2.boolOrEmptySchema)(t,e)}a(C7,"subschemaCode");function M2({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}a(M2,"schemaCxtHasRules");function D2(t){return typeof t.schema!="boolean"}a(D2,"isSchemaObj");function R7(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&F2(t),M7(t),D7(t);let s=n.const("_errs",se.default.errors);L2(t,s),n.var(e,(0,W._)`${s} === ${se.default.errors}`)}a(R7,"subSchemaObjCode");function Z2(t){(0,Un.checkUnknownRules)(t),A7(t)}a(Z2,"checkKeywords");function L2(t,e){if(t.opts.jtd)return C2(t,[],!1,e);let r=(0,P2.getSchemaTypes)(t.schema),n=(0,P2.coerceAndCheckDataType)(t,r);C2(t,r,!n,e)}a(L2,"typeAndKeywords");function A7(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Un.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(A7,"checkRefsAndKeywords");function j7(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Un.checkStrictMode)(t,"default is ignored in the schema root")}a(j7,"checkNoDefault");function M7(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,N7.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(M7,"updateContext");function D7(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(D7,"checkAsyncSchema");function F2({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,W._)`${se.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=(0,W.str)`${n}/$comment`,c=t.scopeValue("root",{ref:e.root});t.code((0,W._)`${se.default.self}.opts.$comment(${s}, ${i}, ${c}.schema)`)}}a(F2,"commentKeyword");function Z7(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,W._)`${se.default.errors} === 0`,()=>e.return(se.default.data),()=>e.throw((0,W._)`new ${o}(${se.default.vErrors})`)):(e.assign((0,W._)`${n}.errors`,se.default.vErrors),s.unevaluated&&L7(t),e.return((0,W._)`${se.default.errors} === 0`))}a(Z7,"returnResults");function L7({gen:t,evaluated:e,props:r,items:n}){r instanceof W.Name&&t.assign((0,W._)`${e}.props`,r),n instanceof W.Name&&t.assign((0,W._)`${e}.items`,n)}a(L7,"assignEvaluated");function C2(t,e,r,n){let{gen:o,schema:s,data:i,allErrors:c,opts:u,self:l}=t,{RULES:d}=l;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,Un.schemaHasRulesButRef)(s,d))){o.block(()=>q2(t,"$ref",d.all.$ref.definition));return}u.jtd||F7(t,e),o.block(()=>{for(let h of d.rules)m(h);m(d.post)});function m(h){(0,G0.shouldUseGroup)(s,h)&&(h.type?(o.if((0,lm.checkDataType)(h.type,i,u.strictNumbers)),R2(t,h),e.length===1&&e[0]===h.type&&r&&(o.else(),(0,lm.reportTypeError)(t)),o.endIf()):R2(t,h),c||o.if((0,W._)`${se.default.errors} === ${n||0}`))}a(m,"groupKeywords")}a(C2,"schemaKeywords");function R2(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,E7.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,G0.shouldUseRule)(n,s)&&q2(t,s.keyword,s.definition,e.type)})}a(R2,"iterateKeywords");function F7(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(U7(t,e),t.opts.allowUnionTypes||q7(t,e),V7(t,t.dataTypes))}a(F7,"checkStrictTypes");function U7(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{U2(t.dataTypes,r)||J0(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),B7(t,e)}}a(U7,"checkContextTypes");function q7(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&J0(t,"use allowUnionTypes to allow union type keyword")}a(q7,"checkMultipleTypes");function V7(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,G0.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(i=>H7(e,i))&&J0(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(V7,"checkKeywordTypes");function H7(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(H7,"hasApplicableType");function U2(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(U2,"includesType");function B7(t,e){let r=[];for(let n of t.dataTypes)U2(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(B7,"narrowSchemaTypes");function J0(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Un.checkStrictMode)(t,e,t.opts.strictTypes)}a(J0,"strictTypesError");var W0=class W0{constructor(e,r,n){if((0,ml.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Un.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",V2(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ml.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",se.default.errors))}result(e,r,n){this.failResult((0,W.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,W.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,W._)`${r} !== undefined && (${(0,W.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?fl.reportExtraError:fl.reportError)(this,this.def.error,r)}$dataError(){(0,fl.reportError)(this,this.def.$dataError||fl.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,fl.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=W.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=W.nil,r=W.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:i}=this;n.if((0,W.or)((0,W._)`${o} === undefined`,r)),e!==W.nil&&n.assign(e,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==W.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,W.or)(i(),c());function i(){if(n.length){if(!(r instanceof W.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,W._)`${(0,lm.checkDataTypes)(u,r,s.opts.strictNumbers,lm.DataType.Wrong)}`}return W.nil}function c(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,W._)`!${u}(${r})`}return W.nil}}subschema(e,r){let n=(0,B0.getSubschema)(this.it,e);(0,B0.extendSubschemaData)(n,this.it,e),(0,B0.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return C7(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Un.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Un.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,W.Name)),!0}};a(W0,"KeywordCxt");var dm=W0;To.KeywordCxt=dm;function q2(t,e,r,n){let o=new dm(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,ml.funcKeywordCode)(o,r):"macro"in r?(0,ml.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,ml.funcKeywordCode)(o,r)}a(q2,"keywordCode");var G7=/^\/(?:[^~]|~0|~1)*$/,J7=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function V2(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return se.default.rootData;if(t[0]==="/"){if(!G7.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=se.default.rootData}else{let l=J7.exec(t);if(!l)throw new Error(`Invalid JSON-pointer: ${t}`);let d=+l[1];if(o=l[2],o==="#"){if(d>=e)throw new Error(u("property/index",d));return n[e-d]}if(d>e)throw new Error(u("data",d));if(s=r[e-d],!o)return s}let i=s,c=o.split("/");for(let l of c)l&&(s=(0,W._)`${s}${(0,W.getProperty)((0,Un.unescapeJsonPointer)(l))}`,i=(0,W._)`${i} && ${s}`);return i;function u(l,d){return`Cannot access ${l} ${d} levels up, current level is ${e}`}}a(V2,"getData");To.getData=V2});var pm=Z(Y0=>{"use strict";Object.defineProperty(Y0,"__esModule",{value:!0});var X0=class X0 extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};a(X0,"ValidationError");var K0=X0;Y0.default=K0});var gl=Z(tk=>{"use strict";Object.defineProperty(tk,"__esModule",{value:!0});var Q0=pl(),rk=class rk extends Error{constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Q0.resolveUrl)(e,r,n),this.missingSchema=(0,Q0.normalizeId)((0,Q0.getFullPath)(e,this.missingRef))}};a(rk,"MissingRefError");var ek=rk;tk.default=ek});var mm=Z(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.resolveSchema=xr.getCompilingSchema=xr.resolveRef=xr.compileSchema=xr.SchemaEnv=void 0;var Ar=le(),W7=pm(),Ts=Fn(),jr=pl(),H2=be(),K7=hl(),sk=class sk{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,jr.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};a(sk,"SchemaEnv");var ki=sk;xr.SchemaEnv=ki;function ok(t){let e=B2.call(this,t);if(e)return e;let r=(0,jr.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new Ar.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),c;t.$async&&(c=i.scopeValue("Error",{ref:W7.default,code:(0,Ar._)`require("ajv/dist/runtime/validation_error").default`}));let u=i.scopeName("validate");t.validateName=u;let l={gen:i,allErrors:this.opts.allErrors,data:Ts.default.data,parentData:Ts.default.parentData,parentDataProperty:Ts.default.parentDataProperty,dataNames:[Ts.default.data],dataPathArr:[Ar.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ar.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:c,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Ar.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ar._)`""`,opts:this.opts,self:this},d;try{this._compilations.add(t),(0,K7.validateFunctionCode)(l),i.optimize(this.opts.code.optimize);let m=i.toString();d=`${i.scopeRefs(Ts.default.scope)}return ${m}`,this.opts.code.process&&(d=this.opts.code.process(d,t));let f=new Function(`${Ts.default.self}`,`${Ts.default.scope}`,d)(this,this.scope.get());if(this.scope.value(u,{ref:f}),f.errors=null,f.schema=t.schema,f.schemaEnv=t,t.$async&&(f.$async=!0),this.opts.code.source===!0&&(f.source={validateName:u,validateCode:m,scopeValues:i._values}),this.opts.unevaluated){let{props:g,items:v}=l;f.evaluated={props:g instanceof Ar.Name?void 0:g,items:v instanceof Ar.Name?void 0:v,dynamicProps:g instanceof Ar.Name,dynamicItems:v instanceof Ar.Name},f.source&&(f.source.evaluated=(0,Ar.stringify)(f.evaluated))}return t.validate=f,t}catch(m){throw delete t.validate,delete t.validateName,d&&this.logger.error("Error compiling schema, function code:",d),m}finally{this._compilations.delete(t)}}a(ok,"compileSchema");xr.compileSchema=ok;function Y7(t,e,r){var n;r=(0,jr.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=eY.call(this,t,r);if(s===void 0){let i=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;i&&(s=new ki({schema:i,schemaId:c,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=X7.call(this,s)}a(Y7,"resolveRef");xr.resolveRef=Y7;function X7(t){return(0,jr.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:ok.call(this,t)}a(X7,"inlineOrCompile");function B2(t){for(let e of this._compilations)if(Q7(e,t))return e}a(B2,"getCompilingSchema");xr.getCompilingSchema=B2;function Q7(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(Q7,"sameSchemaEnv");function eY(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||fm.call(this,t,e)}a(eY,"resolve");function fm(t,e){let r=this.opts.uriResolver.parse(e),n=(0,jr._getFullPath)(this.opts.uriResolver,r),o=(0,jr.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return nk.call(this,r,t);let s=(0,jr.normalizeId)(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let c=fm.call(this,t,i);return typeof c?.schema!="object"?void 0:nk.call(this,r,c)}if(typeof i?.schema=="object"){if(i.validate||ok.call(this,i),s===(0,jr.normalizeId)(e)){let{schema:c}=i,{schemaId:u}=this.opts,l=c[u];return l&&(o=(0,jr.resolveUrl)(this.opts.uriResolver,o,l)),new ki({schema:c,schemaId:u,root:t,baseId:o})}return nk.call(this,r,i)}}a(fm,"resolveSchema");xr.resolveSchema=fm;var tY=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function nk(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let c of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,H2.unescapeFragment)(c)];if(u===void 0)return;r=u;let l=typeof r=="object"&&r[this.opts.schemaId];!tY.has(c)&&l&&(e=(0,jr.resolveUrl)(this.opts.uriResolver,e,l))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,H2.schemaHasRulesButRef)(r,this.RULES)){let c=(0,jr.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=fm.call(this,n,c)}let{schemaId:i}=this.opts;if(s=s||new ki({schema:r,schemaId:i,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(nk,"getJsonPointer")});var G2=Z((a2e,rY)=>{rY.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var ck=Z((i2e,Q2)=>{"use strict";var nY=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),W2=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),ak=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),K2=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),oY=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function ik(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}a(ik,"stringArrayToHexStripped");var sY=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function J2(t){return t.length=0,!0}a(J2,"consumeIsZone");function aY(t,e,r){if(t.length){let n=ik(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(aY,"consumeHextets");function iY(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,i=!1,c=aY;for(let u=0;u<t.length;u++){let l=t[u];if(!(l==="["||l==="]"))if(l===":"){if(s===!0&&(i=!0),!c(o,n,r))break;if(++e>7){r.error=!0;break}u>0&&t[u-1]===":"&&(s=!0),n.push(":");continue}else if(l==="%"){if(!c(o,n,r))break;c=J2}else{o.push(l);continue}}return o.length&&(c===J2?r.zone=o.join(""):i?n.push(o.join("")):n.push(ik(o))),r.address=n.join(""),r}a(iY,"getIPV6");function Y2(t){if(cY(t,":")<2)return{host:t,isIPV6:!1};let e=iY(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}a(Y2,"normalizeIPv6");function cY(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}a(cY,"findToken");function uY(t){let e=t,r=[],n=-1,o=0;for(;o=e.length;){if(o===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(o===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(o===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}a(uY,"removeDotSegments");var lY={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},dY=/[@/?#:]/g,pY=/[@/?#]/g;function X2(t,e){let r=e?pY:dY;return r.lastIndex=0,t.replace(r,n=>lY[n])}a(X2,"reescapeHostDelimiters");function fY(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let o=t.slice(n+1,n+3);if(ak(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&K2(i)?r+=i:r+="%"+s,n+=2;continue}}r+=t[n]}return r}a(fY,"normalizePercentEncoding");function mY(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(ak(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));s!=="."&&K2(s)?e+=s:e+="%"+o,r+=2;continue}}oY(t[r])?e+=t[r]:e+=escape(t[r])}return e}a(mY,"normalizePathEncoding");function hY(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(ak(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}a(hY,"escapePreservingEscapes");function gY(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!W2(r)){let n=Y2(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=X2(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}a(gY,"recomposeAuthority");Q2.exports={nonSimpleDomain:sY,recomposeAuthority:gY,reescapeHostDelimiters:X2,normalizePercentEncoding:fY,normalizePathEncoding:mY,escapePreservingEscapes:hY,removeDotSegments:uY,isIPv4:W2,isUUID:nY,normalizeIPv6:Y2,stringArrayToHexStripped:ik}});var oZ=Z((u2e,nZ)=>{"use strict";var{isUUID:yY}=ck(),_Y=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,xY=["http","https","ws","wss","urn","urn:uuid"];function vY(t){return xY.indexOf(t)!==-1}a(vY,"isValidSchemeName");function uk(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}a(uk,"wsIsSecure");function eZ(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(eZ,"httpParse");function tZ(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}a(tZ,"httpSerialize");function bY(t){return t.secure=uk(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(bY,"wsParse");function wY(t){if((t.port===(uk(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}a(wY,"wsSerialize");function kY(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(_Y);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=lk(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(kY,"urnParse");function SY(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=lk(o);s&&(t=s.serialize(t,e));let i=t,c=t.nss;return i.path=`${n||e.nid}:${c}`,e.skipEscape=!0,i}a(SY,"urnSerialize");function $Y(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!yY(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a($Y,"urnuuidParse");function EY(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(EY,"urnuuidSerialize");var rZ={scheme:"http",domainHost:!0,parse:eZ,serialize:tZ},NY={scheme:"https",domainHost:rZ.domainHost,parse:eZ,serialize:tZ},hm={scheme:"ws",domainHost:!0,parse:bY,serialize:wY},TY={scheme:"wss",domainHost:hm.domainHost,parse:hm.parse,serialize:hm.serialize},zY={scheme:"urn",parse:kY,serialize:SY,skipNormalize:!0},OY={scheme:"urn:uuid",parse:$Y,serialize:EY,skipNormalize:!0},gm={http:rZ,https:NY,ws:hm,wss:TY,urn:zY,"urn:uuid":OY};Object.setPrototypeOf(gm,null);function lk(t){return t&&(gm[t]||gm[t.toLowerCase()])||void 0}a(lk,"getSchemeHandler");nZ.exports={wsIsSecure:uk,SCHEMES:gm,isValidSchemeName:vY,getSchemeHandler:lk}});var uZ=Z((d2e,xm)=>{"use strict";var{normalizeIPv6:PY,removeDotSegments:yl,recomposeAuthority:IY,normalizePercentEncoding:CY,normalizePathEncoding:RY,escapePreservingEscapes:AY,reescapeHostDelimiters:jY,isIPv4:MY,nonSimpleDomain:DY}=ck(),{SCHEMES:ZY,getSchemeHandler:aZ}=oZ();function LY(t,e){return typeof t=="string"?t=GY(t,e):typeof t=="object"&&(t=_m(zs(t,e),e)),t}a(LY,"normalize");function FY(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:o,malformedAuthorityOrPort:s}=ym(t,n),{parsed:i,malformedAuthorityOrPort:c}=ym(e,n);if(s||c)throw new Error(o.error||i.error||"URI is malformed.");let u=iZ(o,i,n,!0);return n.skipEscape=!0,zs(u,n)}a(FY,"resolve");function iZ(t,e,r,n){let o={};return n||(t=_m(zs(t,r),r),e=_m(zs(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=yl(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=yl(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=yl(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=yl(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}a(iZ,"resolveComponent");function UY(t,e,r){let n=sZ(t,r),o=sZ(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(UY,"equal");function zs(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=aZ(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=CY(r.path):(r.path=AY(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let i=IY(r);if(i!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(i),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(c=yl(c)),i===void 0&&c[0]==="/"&&c[1]==="/"&&(c="/%2F"+c.slice(2)),o.push(c)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}a(zs,"serialize");var qY=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,VY=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,HY=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function BY(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}a(BY,"getParseError");function ym(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(VY);i!==null&&i[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let c=t.match(HY);if(c!==null){let l=c[1],d=l.replace(/[\t\n\r]/g,"");d.length>=2&&(d.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",o=!0):l.length!==d.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",o=!0))}let u=t.match(qY);if(u){n.scheme=u[1],n.userinfo=u[3],n.host=u[4],n.port=parseInt(u[5],10),n.path=u[6]||"",n.query=u[7],n.fragment=u[8],isNaN(n.port)&&(n.port=u[5]);let l=BY(n,u);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(MY(n.host)===!1){let h=PY(n.host);n.host=h.host.toLowerCase(),s=h.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let d=aZ(r.scheme||n.scheme);if(!r.unicodeSupport&&(!d||!d.unicodeSupport)&&n.host&&(r.domainHost||d&&d.domainHost)&&s===!1&&DY(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(m){n.error=n.error||"Host's domain name can not be converted to ASCII: "+m}if((!d||d&&!d.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=jY(unescape(n.host),s))),n.path&&(n.path=RY(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}d&&d.parse&&d.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}a(ym,"parseWithStatus");function _m(t,e){return ym(t,e).parsed}a(_m,"parse");function GY(t,e){return cZ(t,e).normalized}a(GY,"normalizeString");function cZ(t,e){let{parsed:r,malformedAuthorityOrPort:n}=ym(t,e);return{normalized:n?t:zs(r,e),malformedAuthorityOrPort:n}}a(cZ,"normalizeStringWithStatus");function sZ(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=cZ(t,e);return n?void 0:r}if(typeof t=="object")return zs(t,e)}a(sZ,"normalizeComparableURI");var dk={SCHEMES:ZY,normalize:LY,resolve:FY,resolveComponent:iZ,equal:UY,serialize:zs,parse:_m};xm.exports=dk;xm.exports.default=dk;xm.exports.fastUri=dk});var dZ=Z(pk=>{"use strict";Object.defineProperty(pk,"__esModule",{value:!0});var lZ=uZ();lZ.code='require("ajv/dist/runtime/uri").default';pk.default=lZ});var xZ=Z(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.CodeGen=ut.Name=ut.nil=ut.stringify=ut.str=ut._=ut.KeywordCxt=void 0;var JY=hl();Object.defineProperty(ut,"KeywordCxt",{enumerable:!0,get:function(){return JY.KeywordCxt}});var Si=le();Object.defineProperty(ut,"_",{enumerable:!0,get:function(){return Si._}});Object.defineProperty(ut,"str",{enumerable:!0,get:function(){return Si.str}});Object.defineProperty(ut,"stringify",{enumerable:!0,get:function(){return Si.stringify}});Object.defineProperty(ut,"nil",{enumerable:!0,get:function(){return Si.nil}});Object.defineProperty(ut,"Name",{enumerable:!0,get:function(){return Si.Name}});Object.defineProperty(ut,"CodeGen",{enumerable:!0,get:function(){return Si.CodeGen}});var WY=pm(),gZ=gl(),KY=j0(),_l=mm(),YY=le(),xl=pl(),vm=dl(),mk=be(),pZ=G2(),XY=dZ(),yZ=a((t,e)=>new RegExp(t,e),"defaultRegExp");yZ.code="new RegExp";var QY=["removeAdditional","useDefaults","coerceTypes"],eX=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),tX={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},rX={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},fZ=200;function nX(t){var e,r,n,o,s,i,c,u,l,d,m,h,f,g,v,y,x,k,w,b,E,A,O,B,q;let C=t.strict,K=(e=t.code)===null||e===void 0?void 0:e.optimize,ae=K===!0||K===void 0?1:K||0,pt=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:yZ,ze=(o=t.uriResolver)!==null&&o!==void 0?o:XY.default;return{strictSchema:(i=(s=t.strictSchema)!==null&&s!==void 0?s:C)!==null&&i!==void 0?i:!0,strictNumbers:(u=(c=t.strictNumbers)!==null&&c!==void 0?c:C)!==null&&u!==void 0?u:!0,strictTypes:(d=(l=t.strictTypes)!==null&&l!==void 0?l:C)!==null&&d!==void 0?d:"log",strictTuples:(h=(m=t.strictTuples)!==null&&m!==void 0?m:C)!==null&&h!==void 0?h:"log",strictRequired:(g=(f=t.strictRequired)!==null&&f!==void 0?f:C)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:ae,regExp:pt}:{optimize:ae,regExp:pt},loopRequired:(v=t.loopRequired)!==null&&v!==void 0?v:fZ,loopEnum:(y=t.loopEnum)!==null&&y!==void 0?y:fZ,meta:(x=t.meta)!==null&&x!==void 0?x:!0,messages:(k=t.messages)!==null&&k!==void 0?k:!0,inlineRefs:(w=t.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(b=t.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(E=t.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(A=t.validateSchema)!==null&&A!==void 0?A:!0,validateFormats:(O=t.validateFormats)!==null&&O!==void 0?O:!0,unicodeRegExp:(B=t.unicodeRegExp)!==null&&B!==void 0?B:!0,int32range:(q=t.int32range)!==null&&q!==void 0?q:!0,uriResolver:ze}}a(nX,"requiredOptions");var hk=class hk{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...nX(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new YY.ValueScope({scope:{},prefixes:eX,es5:r,lines:n}),this.logger=uX(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,KY.getRules)(),mZ.call(this,tX,e,"NOT SUPPORTED"),mZ.call(this,rX,e,"DEPRECATED","warn"),this._metaOpts=iX.call(this),e.formats&&sX.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&aX.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),oX.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=pZ;n==="id"&&(o={...pZ},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(d,m){await s.call(this,d.$schema);let h=this._addSchema(d,m);return h.validate||i.call(this,h)}async function s(d){d&&!this.getSchema(d)&&await o.call(this,{$ref:d},!0)}async function i(d){try{return this._compileSchemaEnv(d)}catch(m){if(!(m instanceof gZ.default))throw m;return c.call(this,m),await u.call(this,m.missingSchema),i.call(this,d)}}function c({missingSchema:d,missingRef:m}){if(this.refs[d])throw new Error(`AnySchema ${d} is loaded but ${m} cannot be resolved`)}async function u(d){let m=await l.call(this,d);this.refs[d]||await s.call(this,m.$schema),this.refs[d]||this.addSchema(m,d,r)}async function l(d){let m=this._loading[d];if(m)return m;try{return await(this._loading[d]=n(d))}finally{delete this._loading[d]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=(0,xl.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=hZ.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new _l.SchemaEnv({schema:{},schemaId:n});if(r=_l.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=hZ.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,xl.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(dX.call(this,n,r),!r)return(0,mk.eachItem)(n,s=>fk.call(this,s)),this;fX.call(this,r);let o={...r,type:(0,vm.getJSONTypes)(r.type),schemaType:(0,vm.getJSONTypes)(r.schemaType)};return(0,mk.eachItem)(n,o.type.length===0?s=>fk.call(this,s,o):s=>o.type.forEach(i=>fk.call(this,s,o,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),i=e;for(let c of s)i=i[c];for(let c in n){let u=n[c];if(typeof u!="object")continue;let{$data:l}=u.definition,d=i[c];l&&d&&(i[c]=_Z(d))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:c}=this.opts;if(typeof e=="object")i=e[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;n=(0,xl.normalizeId)(i||n);let l=xl.getSchemaRefs.call(this,e,n);return u=new _l.SchemaEnv({schema:e,schemaId:c,meta:r,baseId:n,localRefs:l}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),o&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):_l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{_l.compileSchema.call(this,e)}finally{this.opts=r}}};a(hk,"Ajv");var vl=hk;vl.ValidationError=WY.default;vl.MissingRefError=gZ.default;ut.default=vl;function mZ(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}a(mZ,"checkOptions");function hZ(t){return t=(0,xl.normalizeId)(t),this.schemas[t]||this.refs[t]}a(hZ,"getSchEnv");function oX(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}a(oX,"addInitialSchemas");function sX(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(sX,"addInitialFormats");function aX(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}a(aX,"addInitialKeywords");function iX(){let t={...this.opts};for(let e of QY)delete t[e];return t}a(iX,"getMetaSchemaOptions");var cX={log(){},warn(){},error(){}};function uX(t){if(t===!1)return cX;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}a(uX,"getLogger");var lX=/^[a-z_$][a-z0-9_$:-]*$/i;function dX(t,e){let{RULES:r}=this;if((0,mk.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!lX.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}a(dX,"checkKeyword");function fk(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=o?s.post:s.rules.find(({type:u})=>u===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[t]=!0,!e)return;let c={keyword:t,definition:{...e,type:(0,vm.getJSONTypes)(e.type),schemaType:(0,vm.getJSONTypes)(e.schemaType)}};e.before?pX.call(this,i,c,e.before):i.rules.push(c),s.all[t]=c,(n=e.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}a(fk,"addRule");function pX(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}a(pX,"addBeforeRule");function fX(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=_Z(e)),t.validateSchema=this.compile(e,!0))}a(fX,"keywordMetaschema");var mX={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function _Z(t){return{anyOf:[t,mX]}}a(_Z,"schemaOrData")});var vZ=Z(gk=>{"use strict";Object.defineProperty(gk,"__esModule",{value:!0});var hX={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};gk.default=hX});var SZ=Z(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.callRef=Os.getValidate=void 0;var gX=gl(),bZ=_r(),jt=le(),$i=Fn(),wZ=mm(),bm=be(),yX={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:i,opts:c,self:u}=n,{root:l}=s;if((r==="#"||r==="#/")&&o===l.baseId)return m();let d=wZ.resolveRef.call(u,l,o,r);if(d===void 0)throw new gX.default(n.opts.uriResolver,o,r);if(d instanceof wZ.SchemaEnv)return h(d);return f(d);function m(){if(s===l)return wm(t,i,s,s.$async);let g=e.scopeValue("root",{ref:l});return wm(t,(0,jt._)`${g}.validate`,l,l.$async)}function h(g){let v=kZ(t,g);wm(t,v,g,g.$async)}function f(g){let v=e.scopeValue("schema",c.code.source===!0?{ref:g,code:(0,jt.stringify)(g)}:{ref:g}),y=e.name("valid"),x=t.subschema({schema:g,dataTypes:[],schemaPath:jt.nil,topSchemaRef:v,errSchemaPath:r},y);t.mergeEvaluated(x),t.ok(y)}}};function kZ(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,jt._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(kZ,"getValidate");Os.getValidate=kZ;function wm(t,e,r,n){let{gen:o,it:s}=t,{allErrors:i,schemaEnv:c,opts:u}=s,l=u.passContext?$i.default.this:jt.nil;n?d():m();function d(){if(!c.$async)throw new Error("async schema referenced by sync schema");let g=o.let("valid");o.try(()=>{o.code((0,jt._)`await ${(0,bZ.callValidateCode)(t,e,l)}`),f(e),i||o.assign(g,!0)},v=>{o.if((0,jt._)`!(${v} instanceof ${s.ValidationError})`,()=>o.throw(v)),h(v),i||o.assign(g,!1)}),t.ok(g)}a(d,"callAsyncRef");function m(){t.result((0,bZ.callValidateCode)(t,e,l),()=>f(e),()=>h(e))}a(m,"callSyncRef");function h(g){let v=(0,jt._)`${g}.errors`;o.assign($i.default.vErrors,(0,jt._)`${$i.default.vErrors} === null ? ${v} : ${$i.default.vErrors}.concat(${v})`),o.assign($i.default.errors,(0,jt._)`${$i.default.vErrors}.length`)}a(h,"addErrorsFrom");function f(g){var v;if(!s.opts.unevaluated)return;let y=(v=r?.validate)===null||v===void 0?void 0:v.evaluated;if(s.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(s.props=bm.mergeEvaluated.props(o,y.props,s.props));else{let x=o.var("props",(0,jt._)`${g}.evaluated.props`);s.props=bm.mergeEvaluated.props(o,x,s.props,jt.Name)}if(s.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(s.items=bm.mergeEvaluated.items(o,y.items,s.items));else{let x=o.var("items",(0,jt._)`${g}.evaluated.items`);s.items=bm.mergeEvaluated.items(o,x,s.items,jt.Name)}}a(f,"addEvaluatedFrom")}a(wm,"callRef");Os.callRef=wm;Os.default=yX});var $Z=Z(yk=>{"use strict";Object.defineProperty(yk,"__esModule",{value:!0});var _X=vZ(),xX=SZ(),vX=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",_X.default,xX.default];yk.default=vX});var EZ=Z(_k=>{"use strict";Object.defineProperty(_k,"__esModule",{value:!0});var km=le(),zo=km.operators,Sm={maximum:{okStr:"<=",ok:zo.LTE,fail:zo.GT},minimum:{okStr:">=",ok:zo.GTE,fail:zo.LT},exclusiveMaximum:{okStr:"<",ok:zo.LT,fail:zo.GTE},exclusiveMinimum:{okStr:">",ok:zo.GT,fail:zo.LTE}},bX={message:({keyword:t,schemaCode:e})=>(0,km.str)`must be ${Sm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,km._)`{comparison: ${Sm[t].okStr}, limit: ${e}}`},wX={keyword:Object.keys(Sm),type:"number",schemaType:"number",$data:!0,error:bX,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,km._)`${r} ${Sm[e].fail} ${n} || isNaN(${r})`)}};_k.default=wX});var NZ=Z(xk=>{"use strict";Object.defineProperty(xk,"__esModule",{value:!0});var bl=le(),kX={message:({schemaCode:t})=>(0,bl.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,bl._)`{multipleOf: ${t}}`},SX={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:kX,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,i=e.let("res"),c=s?(0,bl._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,bl._)`${i} !== parseInt(${i})`;t.fail$data((0,bl._)`(${n} === 0 || (${i} = ${r}/${n}, ${c}))`)}};xk.default=SX});var zZ=Z(vk=>{"use strict";Object.defineProperty(vk,"__esModule",{value:!0});function TZ(t){let e=t.length,r=0,n=0,o;for(;n<e;)r++,o=t.charCodeAt(n++),o>=55296&&o<=56319&&n<e&&(o=t.charCodeAt(n),(o&64512)===56320&&n++);return r}a(TZ,"ucs2length");vk.default=TZ;TZ.code='require("ajv/dist/runtime/ucs2length").default'});var OZ=Z(bk=>{"use strict";Object.defineProperty(bk,"__esModule",{value:!0});var Ps=le(),$X=be(),EX=zZ(),NX={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Ps.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Ps._)`{limit: ${t}}`},TX={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:NX,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?Ps.operators.GT:Ps.operators.LT,i=o.opts.unicode===!1?(0,Ps._)`${r}.length`:(0,Ps._)`${(0,$X.useFunc)(t.gen,EX.default)}(${r})`;t.fail$data((0,Ps._)`${i} ${s} ${n}`)}};bk.default=TX});var PZ=Z(wk=>{"use strict";Object.defineProperty(wk,"__esModule",{value:!0});var zX=_r(),OX=be(),Ei=le(),PX={message:({schemaCode:t})=>(0,Ei.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Ei._)`{pattern: ${t}}`},IX={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:PX,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t,c=i.opts.unicodeRegExp?"u":"";if(n){let{regExp:u}=i.opts.code,l=u.code==="new RegExp"?(0,Ei._)`new RegExp`:(0,OX.useFunc)(e,u),d=e.let("valid");e.try(()=>e.assign(d,(0,Ei._)`${l}(${s}, ${c}).test(${r})`),()=>e.assign(d,!1)),t.fail$data((0,Ei._)`!${d}`)}else{let u=(0,zX.usePattern)(t,o);t.fail$data((0,Ei._)`!${u}.test(${r})`)}}};wk.default=IX});var IZ=Z(kk=>{"use strict";Object.defineProperty(kk,"__esModule",{value:!0});var wl=le(),CX={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,wl.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,wl._)`{limit: ${t}}`},RX={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:CX,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?wl.operators.GT:wl.operators.LT;t.fail$data((0,wl._)`Object.keys(${r}).length ${o} ${n}`)}};kk.default=RX});var CZ=Z(Sk=>{"use strict";Object.defineProperty(Sk,"__esModule",{value:!0});var kl=_r(),Sl=le(),AX=be(),jX={message:({params:{missingProperty:t}})=>(0,Sl.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Sl._)`{missingProperty: ${t}}`},MX={keyword:"required",type:"object",schemaType:"array",$data:!0,error:jX,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:i}=t,{opts:c}=i;if(!s&&r.length===0)return;let u=r.length>=c.loopRequired;if(i.allErrors?l():d(),c.strictRequired){let f=t.parentSchema.properties,{definedProperties:g}=t.it;for(let v of r)if(f?.[v]===void 0&&!g.has(v)){let y=i.schemaEnv.baseId+i.errSchemaPath,x=`required property "${v}" is not defined at "${y}" (strictRequired)`;(0,AX.checkStrictMode)(i,x,i.opts.strictRequired)}}function l(){if(u||s)t.block$data(Sl.nil,m);else for(let f of r)(0,kl.checkReportMissingProp)(t,f)}a(l,"allErrorsMode");function d(){let f=e.let("missing");if(u||s){let g=e.let("valid",!0);t.block$data(g,()=>h(f,g)),t.ok(g)}else e.if((0,kl.checkMissingProp)(t,r,f)),(0,kl.reportMissingProp)(t,f),e.else()}a(d,"exitOnErrorMode");function m(){e.forOf("prop",n,f=>{t.setParams({missingProperty:f}),e.if((0,kl.noPropertyInData)(e,o,f,c.ownProperties),()=>t.error())})}a(m,"loopAllRequired");function h(f,g){t.setParams({missingProperty:f}),e.forOf(f,n,()=>{e.assign(g,(0,kl.propertyInData)(e,o,f,c.ownProperties)),e.if((0,Sl.not)(g),()=>{t.error(),e.break()})},Sl.nil)}a(h,"loopUntilMissing")}};Sk.default=MX});var RZ=Z($k=>{"use strict";Object.defineProperty($k,"__esModule",{value:!0});var $l=le(),DX={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,$l.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,$l._)`{limit: ${t}}`},ZX={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:DX,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?$l.operators.GT:$l.operators.LT;t.fail$data((0,$l._)`${r}.length ${o} ${n}`)}};$k.default=ZX});var $m=Z(Ek=>{"use strict";Object.defineProperty(Ek,"__esModule",{value:!0});var AZ=V0();AZ.code='require("ajv/dist/runtime/equal").default';Ek.default=AZ});var jZ=Z(Tk=>{"use strict";Object.defineProperty(Tk,"__esModule",{value:!0});var Nk=dl(),lt=le(),LX=be(),FX=$m(),UX={message:({params:{i:t,j:e}})=>(0,lt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,lt._)`{i: ${t}, j: ${e}}`},qX={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:UX,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:i,it:c}=t;if(!n&&!o)return;let u=e.let("valid"),l=s.items?(0,Nk.getSchemaTypes)(s.items):[];t.block$data(u,d,(0,lt._)`${i} === false`),t.ok(u);function d(){let g=e.let("i",(0,lt._)`${r}.length`),v=e.let("j");t.setParams({i:g,j:v}),e.assign(u,!0),e.if((0,lt._)`${g} > 1`,()=>(m()?h:f)(g,v))}a(d,"validateUniqueItems");function m(){return l.length>0&&!l.some(g=>g==="object"||g==="array")}a(m,"canOptimize");function h(g,v){let y=e.name("item"),x=(0,Nk.checkDataTypes)(l,y,c.opts.strictNumbers,Nk.DataType.Wrong),k=e.const("indices",(0,lt._)`{}`);e.for((0,lt._)`;${g}--;`,()=>{e.let(y,(0,lt._)`${r}[${g}]`),e.if(x,(0,lt._)`continue`),l.length>1&&e.if((0,lt._)`typeof ${y} == "string"`,(0,lt._)`${y} += "_"`),e.if((0,lt._)`typeof ${k}[${y}] == "number"`,()=>{e.assign(v,(0,lt._)`${k}[${y}]`),t.error(),e.assign(u,!1).break()}).code((0,lt._)`${k}[${y}] = ${g}`)})}a(h,"loopN");function f(g,v){let y=(0,LX.useFunc)(e,FX.default),x=e.name("outer");e.label(x).for((0,lt._)`;${g}--;`,()=>e.for((0,lt._)`${v} = ${g}; ${v}--;`,()=>e.if((0,lt._)`${y}(${r}[${g}], ${r}[${v}])`,()=>{t.error(),e.assign(u,!1).break(x)})))}a(f,"loopN2")}};Tk.default=qX});var MZ=Z(Ok=>{"use strict";Object.defineProperty(Ok,"__esModule",{value:!0});var zk=le(),VX=be(),HX=$m(),BX={message:"must be equal to constant",params:({schemaCode:t})=>(0,zk._)`{allowedValue: ${t}}`},GX={keyword:"const",$data:!0,error:BX,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,zk._)`!${(0,VX.useFunc)(e,HX.default)}(${r}, ${o})`):t.fail((0,zk._)`${s} !== ${r}`)}};Ok.default=GX});var DZ=Z(Pk=>{"use strict";Object.defineProperty(Pk,"__esModule",{value:!0});var El=le(),JX=be(),WX=$m(),KX={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,El._)`{allowedValues: ${t}}`},YX={keyword:"enum",schemaType:"array",$data:!0,error:KX,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let c=o.length>=i.opts.loopEnum,u,l=a(()=>u??(u=(0,JX.useFunc)(e,WX.default)),"getEql"),d;if(c||n)d=e.let("valid"),t.block$data(d,m);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let f=e.const("vSchema",s);d=(0,El.or)(...o.map((g,v)=>h(f,v)))}t.pass(d);function m(){e.assign(d,!1),e.forOf("v",s,f=>e.if((0,El._)`${l()}(${r}, ${f})`,()=>e.assign(d,!0).break()))}a(m,"loopEnum");function h(f,g){let v=o[g];return typeof v=="object"&&v!==null?(0,El._)`${l()}(${r}, ${f}[${g}])`:(0,El._)`${r} === ${v}`}a(h,"equalCode")}};Pk.default=YX});var ZZ=Z(Ik=>{"use strict";Object.defineProperty(Ik,"__esModule",{value:!0});var XX=EZ(),QX=NZ(),eQ=OZ(),tQ=PZ(),rQ=IZ(),nQ=CZ(),oQ=RZ(),sQ=jZ(),aQ=MZ(),iQ=DZ(),cQ=[XX.default,QX.default,eQ.default,tQ.default,rQ.default,nQ.default,oQ.default,sQ.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},aQ.default,iQ.default];Ik.default=cQ});var Rk=Z(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.validateAdditionalItems=void 0;var Is=le(),Ck=be(),uQ={message:({params:{len:t}})=>(0,Is.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Is._)`{limit: ${t}}`},lQ={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:uQ,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Ck.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}LZ(t,n)}};function LZ(t,e){let{gen:r,schema:n,data:o,keyword:s,it:i}=t;i.items=!0;let c=r.const("len",(0,Is._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Is._)`${c} <= ${e.length}`);else if(typeof n=="object"&&!(0,Ck.alwaysValidSchema)(i,n)){let l=r.var("valid",(0,Is._)`${c} <= ${e.length}`);r.if((0,Is.not)(l),()=>u(l)),t.ok(l)}function u(l){r.forRange("i",e.length,c,d=>{t.subschema({keyword:s,dataProp:d,dataPropType:Ck.Type.Num},l),i.allErrors||r.if((0,Is.not)(l),()=>r.break())})}a(u,"validateItems")}a(LZ,"validateAdditionalItems");Nl.validateAdditionalItems=LZ;Nl.default=lQ});var Ak=Z(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.validateTuple=void 0;var FZ=le(),Em=be(),dQ=_r(),pQ={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return UZ(t,"additionalItems",e);r.items=!0,!(0,Em.alwaysValidSchema)(r,e)&&t.ok((0,dQ.validateArray)(t))}};function UZ(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:i,it:c}=t;d(o),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=Em.mergeEvaluated.items(n,r.length,c.items));let u=n.name("valid"),l=n.const("len",(0,FZ._)`${s}.length`);r.forEach((m,h)=>{(0,Em.alwaysValidSchema)(c,m)||(n.if((0,FZ._)`${l} > ${h}`,()=>t.subschema({keyword:i,schemaProp:h,dataProp:h},u)),t.ok(u))});function d(m){let{opts:h,errSchemaPath:f}=c,g=r.length,v=g===m.minItems&&(g===m.maxItems||m[e]===!1);if(h.strictTuples&&!v){let y=`"${i}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${f}"`;(0,Em.checkStrictMode)(c,y,h.strictTuples)}}a(d,"checkStrictTuple")}a(UZ,"validateTuple");Tl.validateTuple=UZ;Tl.default=pQ});var qZ=Z(jk=>{"use strict";Object.defineProperty(jk,"__esModule",{value:!0});var fQ=Ak(),mQ={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,fQ.validateTuple)(t,"items")};jk.default=mQ});var HZ=Z(Mk=>{"use strict";Object.defineProperty(Mk,"__esModule",{value:!0});var VZ=le(),hQ=be(),gQ=_r(),yQ=Rk(),_Q={message:({params:{len:t}})=>(0,VZ.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,VZ._)`{limit: ${t}}`},xQ={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:_Q,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,hQ.alwaysValidSchema)(n,e)&&(o?(0,yQ.validateAdditionalItems)(t,o):t.ok((0,gQ.validateArray)(t)))}};Mk.default=xQ});var BZ=Z(Dk=>{"use strict";Object.defineProperty(Dk,"__esModule",{value:!0});var vr=le(),Nm=be(),vQ={message:({params:{min:t,max:e}})=>e===void 0?(0,vr.str)`must contain at least ${t} valid item(s)`:(0,vr.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,vr._)`{minContains: ${t}}`:(0,vr._)`{minContains: ${t}, maxContains: ${e}}`},bQ={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:vQ,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,i,c,{minContains:u,maxContains:l}=n;s.opts.next?(i=u===void 0?1:u,c=l):i=1;let d=e.const("len",(0,vr._)`${o}.length`);if(t.setParams({min:i,max:c}),c===void 0&&i===0){(0,Nm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&i>c){(0,Nm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Nm.alwaysValidSchema)(s,r)){let v=(0,vr._)`${d} >= ${i}`;c!==void 0&&(v=(0,vr._)`${v} && ${d} <= ${c}`),t.pass(v);return}s.items=!0;let m=e.name("valid");c===void 0&&i===1?f(m,()=>e.if(m,()=>e.break())):i===0?(e.let(m,!0),c!==void 0&&e.if((0,vr._)`${o}.length > 0`,h)):(e.let(m,!1),h()),t.result(m,()=>t.reset());function h(){let v=e.name("_valid"),y=e.let("count",0);f(v,()=>e.if(v,()=>g(y)))}a(h,"validateItemsWithCount");function f(v,y){e.forRange("i",0,d,x=>{t.subschema({keyword:"contains",dataProp:x,dataPropType:Nm.Type.Num,compositeRule:!0},v),y()})}a(f,"validateItems");function g(v){e.code((0,vr._)`${v}++`),c===void 0?e.if((0,vr._)`${v} >= ${i}`,()=>e.assign(m,!0).break()):(e.if((0,vr._)`${v} > ${c}`,()=>e.assign(m,!1).break()),i===1?e.assign(m,!0):e.if((0,vr._)`${v} >= ${i}`,()=>e.assign(m,!0)))}a(g,"checkLimits")}};Dk.default=bQ});var WZ=Z(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.validateSchemaDeps=rn.validatePropertyDeps=rn.error=void 0;var Zk=le(),wQ=be(),zl=_r();rn.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Zk.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Zk._)`{property: ${t},
165
+ missingProperty: ${n},
166
+ depsCount: ${e},
167
+ deps: ${r}}`};var kQ={keyword:"dependencies",type:"object",schemaType:"object",error:rn.error,code(t){let[e,r]=SQ(t);GZ(t,e),JZ(t,r)}};function SQ({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n]}return[e,r]}a(SQ,"splitDependencies");function GZ(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let i in e){let c=e[i];if(c.length===0)continue;let u=(0,zl.propertyInData)(r,n,i,o.opts.ownProperties);t.setParams({property:i,depsCount:c.length,deps:c.join(", ")}),o.allErrors?r.if(u,()=>{for(let l of c)(0,zl.checkReportMissingProp)(t,l)}):(r.if((0,Zk._)`${u} && (${(0,zl.checkMissingProp)(t,c,s)})`),(0,zl.reportMissingProp)(t,s),r.else())}}a(GZ,"validatePropertyDeps");rn.validatePropertyDeps=GZ;function JZ(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,i=r.name("valid");for(let c in e)(0,wQ.alwaysValidSchema)(s,e[c])||(r.if((0,zl.propertyInData)(r,n,c,s.opts.ownProperties),()=>{let u=t.subschema({keyword:o,schemaProp:c},i);t.mergeValidEvaluated(u,i)},()=>r.var(i,!0)),t.ok(i))}a(JZ,"validateSchemaDeps");rn.validateSchemaDeps=JZ;rn.default=kQ});var YZ=Z(Lk=>{"use strict";Object.defineProperty(Lk,"__esModule",{value:!0});var KZ=le(),$Q=be(),EQ={message:"property name must be valid",params:({params:t})=>(0,KZ._)`{propertyName: ${t.propertyName}}`},NQ={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:EQ,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,$Q.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if((0,KZ.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Lk.default=NQ});var Uk=Z(Fk=>{"use strict";Object.defineProperty(Fk,"__esModule",{value:!0});var Tm=_r(),Mr=le(),TQ=Fn(),zm=be(),zQ={message:"must NOT have additional properties",params:({params:t})=>(0,Mr._)`{additionalProperty: ${t.additionalProperty}}`},OQ={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:zQ,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:c,opts:u}=i;if(i.props=!0,u.removeAdditional!=="all"&&(0,zm.alwaysValidSchema)(i,r))return;let l=(0,Tm.allSchemaProperties)(n.properties),d=(0,Tm.allSchemaProperties)(n.patternProperties);m(),t.ok((0,Mr._)`${s} === ${TQ.default.errors}`);function m(){e.forIn("key",o,y=>{!l.length&&!d.length?g(y):e.if(h(y),()=>g(y))})}a(m,"checkAdditionalProperties");function h(y){let x;if(l.length>8){let k=(0,zm.schemaRefOrVal)(i,n.properties,"properties");x=(0,Tm.isOwnProperty)(e,k,y)}else l.length?x=(0,Mr.or)(...l.map(k=>(0,Mr._)`${y} === ${k}`)):x=Mr.nil;return d.length&&(x=(0,Mr.or)(x,...d.map(k=>(0,Mr._)`${(0,Tm.usePattern)(t,k)}.test(${y})`))),(0,Mr.not)(x)}a(h,"isAdditional");function f(y){e.code((0,Mr._)`delete ${o}[${y}]`)}a(f,"deleteAdditional");function g(y){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){f(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),c||e.break();return}if(typeof r=="object"&&!(0,zm.alwaysValidSchema)(i,r)){let x=e.name("valid");u.removeAdditional==="failing"?(v(y,x,!1),e.if((0,Mr.not)(x),()=>{t.reset(),f(y)})):(v(y,x),c||e.if((0,Mr.not)(x),()=>e.break()))}}a(g,"additionalPropertyCode");function v(y,x,k){let w={keyword:"additionalProperties",dataProp:y,dataPropType:zm.Type.Str};k===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(w,x)}a(v,"applyAdditionalSchema")}};Fk.default=OQ});var e4=Z(Vk=>{"use strict";Object.defineProperty(Vk,"__esModule",{value:!0});var PQ=hl(),XZ=_r(),qk=be(),QZ=Uk(),IQ={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&QZ.default.code(new PQ.KeywordCxt(s,QZ.default,"additionalProperties"));let i=(0,XZ.allSchemaProperties)(r);for(let m of i)s.definedProperties.add(m);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=qk.mergeEvaluated.props(e,(0,qk.toHash)(i),s.props));let c=i.filter(m=>!(0,qk.alwaysValidSchema)(s,r[m]));if(c.length===0)return;let u=e.name("valid");for(let m of c)l(m)?d(m):(e.if((0,XZ.propertyInData)(e,o,m,s.opts.ownProperties)),d(m),s.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(m),t.ok(u);function l(m){return s.opts.useDefaults&&!s.compositeRule&&r[m].default!==void 0}a(l,"hasDefault");function d(m){t.subschema({keyword:"properties",schemaProp:m,dataProp:m},u)}a(d,"applyPropertySchema")}};Vk.default=IQ});var o4=Z(Hk=>{"use strict";Object.defineProperty(Hk,"__esModule",{value:!0});var t4=_r(),Om=le(),r4=be(),n4=be(),CQ={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:i}=s,c=(0,t4.allSchemaProperties)(r),u=c.filter(v=>(0,r4.alwaysValidSchema)(s,r[v]));if(c.length===0||u.length===c.length&&(!s.opts.unevaluated||s.props===!0))return;let l=i.strictSchema&&!i.allowMatchingProperties&&o.properties,d=e.name("valid");s.props!==!0&&!(s.props instanceof Om.Name)&&(s.props=(0,n4.evaluatedPropsToName)(e,s.props));let{props:m}=s;h();function h(){for(let v of c)l&&f(v),s.allErrors?g(v):(e.var(d,!0),g(v),e.if(d))}a(h,"validatePatternProperties");function f(v){for(let y in l)new RegExp(v).test(y)&&(0,r4.checkStrictMode)(s,`property ${y} matches pattern ${v} (use allowMatchingProperties)`)}a(f,"checkMatchingProperties");function g(v){e.forIn("key",n,y=>{e.if((0,Om._)`${(0,t4.usePattern)(t,v)}.test(${y})`,()=>{let x=u.includes(v);x||t.subschema({keyword:"patternProperties",schemaProp:v,dataProp:y,dataPropType:n4.Type.Str},d),s.opts.unevaluated&&m!==!0?e.assign((0,Om._)`${m}[${y}]`,!0):!x&&!s.allErrors&&e.if((0,Om.not)(d),()=>e.break())})})}a(g,"validateProperties")}};Hk.default=CQ});var s4=Z(Bk=>{"use strict";Object.defineProperty(Bk,"__esModule",{value:!0});var RQ=be(),AQ={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,RQ.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Bk.default=AQ});var a4=Z(Gk=>{"use strict";Object.defineProperty(Gk,"__esModule",{value:!0});var jQ=_r(),MQ={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:jQ.validateUnion,error:{message:"must match a schema in anyOf"}};Gk.default=MQ});var i4=Z(Jk=>{"use strict";Object.defineProperty(Jk,"__esModule",{value:!0});var Pm=le(),DQ=be(),ZQ={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Pm._)`{passingSchemas: ${t.passing}}`},LQ={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:ZQ,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,i=e.let("valid",!1),c=e.let("passing",null),u=e.name("_valid");t.setParams({passing:c}),e.block(l),t.result(i,()=>t.reset(),()=>t.error(!0));function l(){s.forEach((d,m)=>{let h;(0,DQ.alwaysValidSchema)(o,d)?e.var(u,!0):h=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},u),m>0&&e.if((0,Pm._)`${u} && ${i}`).assign(i,!1).assign(c,(0,Pm._)`[${c}, ${m}]`).else(),e.if(u,()=>{e.assign(i,!0),e.assign(c,m),h&&t.mergeEvaluated(h,Pm.Name)})})}a(l,"validateOneOf")}};Jk.default=LQ});var c4=Z(Wk=>{"use strict";Object.defineProperty(Wk,"__esModule",{value:!0});var FQ=be(),UQ={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,i)=>{if((0,FQ.alwaysValidSchema)(n,s))return;let c=t.subschema({keyword:"allOf",schemaProp:i},o);t.ok(o),t.mergeEvaluated(c)})}};Wk.default=UQ});var d4=Z(Kk=>{"use strict";Object.defineProperty(Kk,"__esModule",{value:!0});var Im=le(),l4=be(),qQ={message:({params:t})=>(0,Im.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Im._)`{failingKeyword: ${t.ifClause}}`},VQ={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:qQ,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,l4.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=u4(n,"then"),s=u4(n,"else");if(!o&&!s)return;let i=e.let("valid",!0),c=e.name("_valid");if(u(),t.reset(),o&&s){let d=e.let("ifClause");t.setParams({ifClause:d}),e.if(c,l("then",d),l("else",d))}else o?e.if(c,l("then")):e.if((0,Im.not)(c),l("else"));t.pass(i,()=>t.error(!0));function u(){let d=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);t.mergeEvaluated(d)}a(u,"validateIf");function l(d,m){return()=>{let h=t.subschema({keyword:d},c);e.assign(i,c),t.mergeValidEvaluated(h,i),m?e.assign(m,(0,Im._)`${d}`):t.setParams({ifClause:d})}}a(l,"validateClause")}};function u4(t,e){let r=t.schema[e];return r!==void 0&&!(0,l4.alwaysValidSchema)(t,r)}a(u4,"hasSchema");Kk.default=VQ});var p4=Z(Yk=>{"use strict";Object.defineProperty(Yk,"__esModule",{value:!0});var HQ=be(),BQ={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,HQ.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Yk.default=BQ});var f4=Z(Xk=>{"use strict";Object.defineProperty(Xk,"__esModule",{value:!0});var GQ=Rk(),JQ=qZ(),WQ=Ak(),KQ=HZ(),YQ=BZ(),XQ=WZ(),QQ=YZ(),eee=Uk(),tee=e4(),ree=o4(),nee=s4(),oee=a4(),see=i4(),aee=c4(),iee=d4(),cee=p4();function uee(t=!1){let e=[nee.default,oee.default,see.default,aee.default,iee.default,cee.default,QQ.default,eee.default,XQ.default,tee.default,ree.default];return t?e.push(JQ.default,KQ.default):e.push(GQ.default,WQ.default),e.push(YQ.default),e}a(uee,"getApplicator");Xk.default=uee});var m4=Z(Qk=>{"use strict";Object.defineProperty(Qk,"__esModule",{value:!0});var Ke=le(),lee={message:({schemaCode:t})=>(0,Ke.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Ke._)`{format: ${t}}`},dee={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:lee,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:i,it:c}=t,{opts:u,errSchemaPath:l,schemaEnv:d,self:m}=c;if(!u.validateFormats)return;o?h():f();function h(){let g=r.scopeValue("formats",{ref:m.formats,code:u.code.formats}),v=r.const("fDef",(0,Ke._)`${g}[${i}]`),y=r.let("fType"),x=r.let("format");r.if((0,Ke._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>r.assign(y,(0,Ke._)`${v}.type || "string"`).assign(x,(0,Ke._)`${v}.validate`),()=>r.assign(y,(0,Ke._)`"string"`).assign(x,v)),t.fail$data((0,Ke.or)(k(),w()));function k(){return u.strictSchema===!1?Ke.nil:(0,Ke._)`${i} && !${x}`}a(k,"unknownFmt");function w(){let b=d.$async?(0,Ke._)`(${v}.async ? await ${x}(${n}) : ${x}(${n}))`:(0,Ke._)`${x}(${n})`,E=(0,Ke._)`(typeof ${x} == "function" ? ${b} : ${x}.test(${n}))`;return(0,Ke._)`${x} && ${x} !== true && ${y} === ${e} && !${E}`}a(w,"invalidFmt")}a(h,"validate$DataFormat");function f(){let g=m.formats[s];if(!g){k();return}if(g===!0)return;let[v,y,x]=w(g);v===e&&t.pass(b());function k(){if(u.strictSchema===!1){m.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${s}" ignored in schema at path "${l}"`}}a(k,"unknownFormat");function w(E){let A=E instanceof RegExp?(0,Ke.regexpCode)(E):u.code.formats?(0,Ke._)`${u.code.formats}${(0,Ke.getProperty)(s)}`:void 0,O=r.scopeValue("formats",{key:s,ref:E,code:A});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,Ke._)`${O}.validate`]:["string",E,O]}a(w,"getFormat");function b(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!d.$async)throw new Error("async format in sync schema");return(0,Ke._)`await ${x}(${n})`}return typeof y=="function"?(0,Ke._)`${x}(${n})`:(0,Ke._)`${x}.test(${n})`}a(b,"validCondition")}a(f,"validateFormat")}};Qk.default=dee});var h4=Z(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});var pee=m4(),fee=[pee.default];eS.default=fee});var g4=Z(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.contentVocabulary=Ni.metadataVocabulary=void 0;Ni.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ni.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var _4=Z(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});var mee=$Z(),hee=ZZ(),gee=f4(),yee=h4(),y4=g4(),_ee=[mee.default,hee.default,(0,gee.default)(),yee.default,y4.metadataVocabulary,y4.contentVocabulary];tS.default=_ee});var v4=Z(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.DiscrError=void 0;var x4;(function(t){t.Tag="tag",t.Mapping="mapping"})(x4||(Cm.DiscrError=x4={}))});var w4=Z(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});var Ti=le(),rS=v4(),b4=mm(),xee=gl(),vee=be(),bee={message:({params:{discrError:t,tagName:e}})=>t===rS.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Ti._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},wee={keyword:"discriminator",type:"object",schemaType:"object",error:bee,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:i}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=n.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),l=e.const("tag",(0,Ti._)`${r}${(0,Ti.getProperty)(c)}`);e.if((0,Ti._)`typeof ${l} == "string"`,()=>d(),()=>t.error(!1,{discrError:rS.DiscrError.Tag,tag:l,tagName:c})),t.ok(u);function d(){let f=h();e.if(!1);for(let g in f)e.elseIf((0,Ti._)`${l} === ${g}`),e.assign(u,m(f[g]));e.else(),t.error(!1,{discrError:rS.DiscrError.Mapping,tag:l,tagName:c}),e.endIf()}a(d,"validateMapping");function m(f){let g=e.name("valid"),v=t.subschema({keyword:"oneOf",schemaProp:f},g);return t.mergeEvaluated(v,Ti.Name),g}a(m,"applyTagSchema");function h(){var f;let g={},v=x(o),y=!0;for(let b=0;b<i.length;b++){let E=i[b];if(E?.$ref&&!(0,vee.schemaHasRulesButRef)(E,s.self.RULES)){let O=E.$ref;if(E=b4.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,O),E instanceof b4.SchemaEnv&&(E=E.schema),E===void 0)throw new xee.default(s.opts.uriResolver,s.baseId,O)}let A=(f=E?.properties)===null||f===void 0?void 0:f[c];if(typeof A!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);y=y&&(v||x(E)),k(A,b)}if(!y)throw new Error(`discriminator: "${c}" must be required`);return g;function x({required:b}){return Array.isArray(b)&&b.includes(c)}function k(b,E){if(b.const)w(b.const,E);else if(b.enum)for(let A of b.enum)w(A,E);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function w(b,E){if(typeof b!="string"||b in g)throw new Error(`discriminator: "${c}" values must be unique strings`);g[b]=E}}a(h,"getMapping")}};nS.default=wee});var k4=Z((_Ze,kee)=>{kee.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var aS=Z((Le,oS)=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.MissingRefError=Le.ValidationError=Le.CodeGen=Le.Name=Le.nil=Le.stringify=Le.str=Le._=Le.KeywordCxt=Le.Ajv=void 0;var See=xZ(),$ee=_4(),Eee=w4(),S4=k4(),Nee=["/properties"],Rm="http://json-schema.org/draft-07/schema",sS=class sS extends See.default{_addVocabularies(){super._addVocabularies(),$ee.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Eee.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(S4,Nee):S4;this.addMetaSchema(e,Rm,!1),this.refs["http://json-schema.org/schema"]=Rm}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Rm)?Rm:void 0)}};a(sS,"Ajv");var zi=sS;Le.Ajv=zi;oS.exports=Le=zi;oS.exports.Ajv=zi;Object.defineProperty(Le,"__esModule",{value:!0});Le.default=zi;var Tee=hl();Object.defineProperty(Le,"KeywordCxt",{enumerable:!0,get:function(){return Tee.KeywordCxt}});var Oi=le();Object.defineProperty(Le,"_",{enumerable:!0,get:function(){return Oi._}});Object.defineProperty(Le,"str",{enumerable:!0,get:function(){return Oi.str}});Object.defineProperty(Le,"stringify",{enumerable:!0,get:function(){return Oi.stringify}});Object.defineProperty(Le,"nil",{enumerable:!0,get:function(){return Oi.nil}});Object.defineProperty(Le,"Name",{enumerable:!0,get:function(){return Oi.Name}});Object.defineProperty(Le,"CodeGen",{enumerable:!0,get:function(){return Oi.CodeGen}});var zee=pm();Object.defineProperty(Le,"ValidationError",{enumerable:!0,get:function(){return zee.default}});var Oee=gl();Object.defineProperty(Le,"MissingRefError",{enumerable:!0,get:function(){return Oee.default}})});var I4=Z(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.formatNames=on.fastFormats=on.fullFormats=void 0;function nn(t,e){return{validate:t,compare:e}}a(nn,"fmtDef");on.fullFormats={date:nn(T4,lS),time:nn(cS(!0),dS),"date-time":nn($4(!0),O4),"iso-time":nn(cS(),z4),"iso-date-time":nn($4(),P4),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:jee,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:qee,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:Mee,int32:{type:"number",validate:Lee},int64:{type:"number",validate:Fee},float:{type:"number",validate:N4},double:{type:"number",validate:N4},password:!0,binary:!0};on.fastFormats={...on.fullFormats,date:nn(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,lS),time:nn(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,dS),"date-time":nn(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,O4),"iso-time":nn(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,z4),"iso-date-time":nn(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,P4),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};on.formatNames=Object.keys(on.fullFormats);function Pee(t){return t%4===0&&(t%100!==0||t%400===0)}a(Pee,"isLeapYear");var Iee=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Cee=[0,31,28,31,30,31,30,31,31,30,31,30,31];function T4(t){let e=Iee.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&Pee(r)?29:Cee[n])}a(T4,"date");function lS(t,e){if(t&&e)return t>e?1:t<e?-1:0}a(lS,"compareDate");var iS=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function cS(t){return a(function(r){let n=iS.exec(r);if(!n)return!1;let o=+n[1],s=+n[2],i=+n[3],c=n[4],u=n[5]==="-"?-1:1,l=+(n[6]||0),d=+(n[7]||0);if(l>23||d>59||t&&!c)return!1;if(o<=23&&s<=59&&i<60)return!0;let m=s-d*u,h=o-l*u-(m<0?1:0);return(h===23||h===-1)&&(m===59||m===-1)&&i<61},"time")}a(cS,"getTime");function dS(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}a(dS,"compareTime");function z4(t,e){if(!(t&&e))return;let r=iS.exec(t),n=iS.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}a(z4,"compareIsoTime");var uS=/t|\s/i;function $4(t){let e=cS(t);return a(function(n){let o=n.split(uS);return o.length===2&&T4(o[0])&&e(o[1])},"date_time")}a($4,"getDateTime");function O4(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}a(O4,"compareDateTime");function P4(t,e){if(!(t&&e))return;let[r,n]=t.split(uS),[o,s]=e.split(uS),i=lS(r,o);if(i!==void 0)return i||dS(n,s)}a(P4,"compareIsoDateTime");var Ree=/\/|:/,Aee=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function jee(t){return Ree.test(t)&&Aee.test(t)}a(jee,"uri");var E4=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function Mee(t){return E4.lastIndex=0,E4.test(t)}a(Mee,"byte");var Dee=-(2**31),Zee=2**31-1;function Lee(t){return Number.isInteger(t)&&t<=Zee&&t>=Dee}a(Lee,"validateInt32");function Fee(t){return Number.isInteger(t)}a(Fee,"validateInt64");function N4(){return!0}a(N4,"validateNumber");var Uee=/[^\\]\\Z/;function qee(t){if(Uee.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(qee,"regex")});var C4=Z(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.formatLimitDefinition=void 0;var Vee=aS(),Dr=le(),Oo=Dr.operators,Am={formatMaximum:{okStr:"<=",ok:Oo.LTE,fail:Oo.GT},formatMinimum:{okStr:">=",ok:Oo.GTE,fail:Oo.LT},formatExclusiveMaximum:{okStr:"<",ok:Oo.LT,fail:Oo.GTE},formatExclusiveMinimum:{okStr:">",ok:Oo.GT,fail:Oo.LTE}},Hee={message:({keyword:t,schemaCode:e})=>(0,Dr.str)`should be ${Am[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Dr._)`{comparison: ${Am[t].okStr}, limit: ${e}}`};Pi.formatLimitDefinition={keyword:Object.keys(Am),type:"string",schemaType:"string",$data:!0,error:Hee,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:i,self:c}=s;if(!i.validateFormats)return;let u=new Vee.KeywordCxt(s,c.RULES.all.format.definition,"format");u.$data?l():d();function l(){let h=e.scopeValue("formats",{ref:c.formats,code:i.code.formats}),f=e.const("fmt",(0,Dr._)`${h}[${u.schemaCode}]`);t.fail$data((0,Dr.or)((0,Dr._)`typeof ${f} != "object"`,(0,Dr._)`${f} instanceof RegExp`,(0,Dr._)`typeof ${f}.compare != "function"`,m(f)))}a(l,"validate$DataFormat");function d(){let h=u.schema,f=c.formats[h];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw new Error(`"${o}": format "${h}" does not define "compare" function`);let g=e.scopeValue("formats",{key:h,ref:f,code:i.code.formats?(0,Dr._)`${i.code.formats}${(0,Dr.getProperty)(h)}`:void 0});t.fail$data(m(g))}a(d,"validateFormat");function m(h){return(0,Dr._)`${h}.compare(${r}, ${n}) ${Am[o].fail} 0`}a(m,"compareCode")},dependencies:["format"]};var Bee=a(t=>(t.addKeyword(Pi.formatLimitDefinition),t),"formatLimitPlugin");Pi.default=Bee});var M4=Z((Ol,j4)=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});var Ii=I4(),Gee=C4(),pS=le(),R4=new pS.Name("fullFormats"),Jee=new pS.Name("fastFormats"),fS=a((t,e={keywords:!0})=>{if(Array.isArray(e))return A4(t,e,Ii.fullFormats,R4),t;let[r,n]=e.mode==="fast"?[Ii.fastFormats,Jee]:[Ii.fullFormats,R4],o=e.formats||Ii.formatNames;return A4(t,o,r,n),e.keywords&&(0,Gee.default)(t),t},"formatsPlugin");fS.get=(t,e="full")=>{let n=(e==="fast"?Ii.fastFormats:Ii.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function A4(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,pS._)`require("ajv-formats/dist/formats").${n}`);for(let i of e)t.addFormat(i,r[i])}a(A4,"addFormats");j4.exports=Ol=fS;Object.defineProperty(Ol,"__esModule",{value:!0});Ol.default=fS});import{readFileSync as fre}from"fs";import{resolve as mre,dirname as hre}from"path";import{fileURLToPath as gre}from"url";import{resolve as O6}from"path";import{existsSync as _L}from"fs";import{resolve as xL}from"path";function rh(t){return!(!t||typeof t!="string"||!/^(?![@._])[a-z0-9@._-]{1,214}$/.test(t)||t.startsWith(".")||t.startsWith("_")||["node_modules","favicon.ico"].includes(t.toLowerCase()))}a(rh,"isValidProjectName");function nh(t){return _L(xL(t))}a(nh,"projectExists");function oh(t){return t?t.startsWith(".")?"Project name cannot start with a dot (.)":t.startsWith("_")?"Project name cannot start with an underscore (_)":t!==t.toLowerCase()?"Project name must be lowercase":t.includes(" ")?"Project name cannot contain spaces":t.length>214?"Project name must be less than 214 characters":["node_modules","favicon.ico"].includes(t.toLowerCase())?`Project name "${t}" is reserved`:"Project name contains invalid characters. Use only lowercase letters, numbers, hyphens, and underscores":"Project name is required"}a(oh,"getValidationError");bc();import{mkdirSync as k6,writeFileSync as fP,readFileSync as S6,existsSync as mP}from"fs";import{resolve as Xd,dirname as Fy,join as Xn}from"path";import{fileURLToPath as $6}from"url";var E6=$6(import.meta.url),N6=Fy(E6);function Qd(t){let e=Xd(t);mP(e)||k6(e,{recursive:!0})}a(Qd,"createDirectory");function T6(t){let e=Xd(t),r=Fy(e);Qd(r),fP(e,"","utf8")}a(T6,"writeEmptyFile");function z6(t,e){let r=t;for(let[n,o]of Object.entries(e)){let s=new RegExp(`{{${n}}}`,"g");r=r.replace(s,o)}return r}a(z6,"replaceVariables");function Yd(t,e,r={}){let n=Xd(N6,"templates"),o=Xn(n,t),s=Xd(e);if(!mP(o))throw new Error(`Template file not found: ${t}`);let i=S6(o,"utf8"),c=z6(i,r),u=Fy(s);Qd(u),fP(s,c,"utf8")}a(Yd,"copyTemplate");function hP(t,e,r={}){let n={PROJECT_NAME:t,FRAMEWORK:r.framework||"vue",CLI_VERSION:r.cliVersion||"0.0.8"};Qd(e),Qd(Xn(e,"src","assets")),Yd("package.json.template",Xn(e,"package.json"),n),Yd("jucie.config.js.template",Xn(e,"jucie.config.js"),n),Yd(".gitignore.template",Xn(e,".gitignore"),n),Yd("index.html.template",Xn(e,"index.html"),n),Ly(Xn(e,"src","sceneGraph")),T6(Xn(e,"src","assets",".gitkeep"))}a(hP,"scaffoldProject");async function Uy(t,e={}){if(!rh(t)){let o=oh(t);console.error(`
168
+ \u274C Error: ${o}
169
+ `),process.exit(1)}let r=["vue","react","preact"];e.framework&&!r.includes(e.framework)&&(console.error(`
170
+ \u274C Error: Unknown framework "${e.framework}". Use one of: ${r.join(", ")}
171
+ `),process.exit(1));let n=O6(process.cwd(),t);nh(n)&&(console.error(`
172
+ \u274C Error: Directory "${t}" already exists
173
+ `),process.exit(1));try{console.log(`
174
+ \u{1F680} Creating Jucie project: ${t}...
175
+ `),hP(t,n,{framework:e.framework,cliVersion:e.cliVersion}),console.log(`\u2713 Created Jucie project: ${t}
176
+ `),console.log("Get started:"),console.log(` cd ${t}`),console.log(" npm install"),console.log(` npm run design
177
+ `),console.log(`This will start the Jucie dev server and open Studio.
178
+ `)}catch(o){console.error(`
179
+ \u274C Error creating project: ${o.message}
180
+ `),e.verbose&&console.error(o.stack),process.exit(1)}}a(Uy,"createCommand");import{resolve as HP,join as Bq,isAbsolute as BP}from"path";bc();tp();Hy();import{Engine as Rq}from"@jucie.io/engine";import{State as Aq}from"@jucie.io/state";import{Matcher as jq}from"@jucie.io/state-matcher";import{EsBuild as Mq}from"@jucie.io/engine-esbuild";import{ServiceProvider as eq}from"@jucie.io/engine";var tq=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong","Helvetica","Arial","Arial Black","Verdana","Tahoma","Trebuchet MS","Impact","Gill Sans","Times New Roman","Georgia","Palatino","Baskerville","Andal\xE9 Mono","Courier","Courier New","Lucida","Lucida Console","Lucida Sans","Monaco","Bradley Hand","Brush Script MT","Luminari","Comic Sans MS","Segoe UI","Roboto","Helvetica Neue","-apple-system","BlinkMacSystemFont","SF Pro","SF Mono","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"]),rq=new Set([...tq].map(t=>t.toLowerCase()));function eo(t){return rq.has(t.toLowerCase().trim())}a(eo,"isSystemFont");function Ea(t){return!t||typeof t!="string"?[]:t.includes("var(")?[]:t.split(",").map(e=>e.trim().replace(/^['"]|['"]$/g,"")).filter(Boolean).map(nq)}a(Ea,"parseFontFamily");function nq(t){let e=t.indexOf("@");if(e===-1){let o=t.trim();return{name:o,source:eo(o)?"system":null}}let r=t.slice(0,e).trim(),n=t.slice(e+1).trim();return n==="google"?{name:r,source:"google"}:n==="local"?{name:r,source:"local"}:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("/")?{name:r,source:"url",url:n}:{name:r,source:n}}a(nq,"parseSourceDescriptor");function oq(t){return!t||typeof t!="string"||t.includes("var(")?t:t.split(",").map(e=>{let r=e.trim().replace(/^['"]|['"]$/g,""),n=r.indexOf("@"),o=n===-1?r:r.slice(0,n).trim();return o.includes(" ")?`"${o}"`:o}).join(", ")}a(oq,"cleanFontFamily");var sq={thin:"100",hairline:"100","extra-light":"200","ultra-light":"200",light:"300",normal:"400",regular:"400",medium:"500","semi-bold":"600","demi-bold":"600",bold:"700","extra-bold":"800","ultra-bold":"800",black:"900",heavy:"900"};function aq(t){if(!t)return"400";let e=String(t).toLowerCase().trim();return sq[e]??e}a(aq,"normalizeWeight");function iq(t){if(!t)return"0";let e=String(t).toLowerCase().trim();return e==="italic"||e==="oblique"?"1":"0"}a(iq,"normalizeStyle");function op(t,e){return`${iq(e)},${aq(t)}`}a(op,"toVariant");function cq(t){if(!t||t.size===0)return"";let e=[],r=vP(t);r&&e.push('<link rel="preconnect" href="https://fonts.googleapis.com">','<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>',`<link href="${r}" rel="stylesheet">`);let n=bP(t);return n&&e.push(`<style>
181
+ ${n}</style>`),e.join(`
182
+ `)}a(cq,"buildFontLinks");function vP(t){let e=[];for(let[r,n]of t){if(n.source!=="google")continue;let o=[...n.variants].sort();if(o.some(i=>i.startsWith("1,")))e.push(`family=${r.replace(/ /g,"+")}:ital,wght@${o.join(";")}`);else{let i=o.map(c=>c.split(",")[1]).sort((c,u)=>Number(c)-Number(u));e.push(`family=${r.replace(/ /g,"+")}:wght@${i.join(";")}`)}}return e.length===0?null:`https://fonts.googleapis.com/css2?${e.join("&")}&display=swap`}a(vP,"buildGoogleUrl");function bP(t){let e=[];for(let[r,n]of t){if(n.source==="google"||!n.url)continue;let o=n.url.split(".").pop()?.toLowerCase(),s={woff2:"woff2",woff:"woff",ttf:"truetype",otf:"opentype"}[o]||"woff2";for(let i of n.variants){let[c,u]=i.split(","),l=c==="1"?"italic":"normal";e.push(` @font-face {
183
+ font-family: "${r}";
184
+ src: url("${n.url}") format("${s}");
185
+ font-weight: ${u};
186
+ font-style: ${l};
187
+ font-display: swap;
188
+ }`)}}return e.length>0?e.join(`
189
+ `):""}a(bP,"buildFontFaceBlock");function By(t){return t["font-family"]||t.fontFamily||null}a(By,"getFamily");function sp(t){return t["font-weight"]||t.fontWeight||null}a(sp,"getWeight");function ap(t){return t["font-style"]||t.fontStyle||null}a(ap,"getStyle");var vt,zt,Tr,zr,ur,ip,wP,cp,kP,up,SP,lp,$P,Nc,Gy,dp,EP,pp,NP,fp,TP,kn,Wo,mp,zP,hp,OP,Tc,Jy,zc,Wy,gp=class gp extends eq{constructor(){super(...arguments);j(this,ip);j(this,cp);j(this,up);j(this,lp);j(this,Nc);j(this,dp);j(this,pp);j(this,fp);j(this,kn);j(this,mp);j(this,hp);j(this,Tc);j(this,zc);j(this,vt,new Map);j(this,zt,null);j(this,Tr,null);j(this,zr,null);j(this,ur,null)}initialize(){oe(this,vt,new Map),Y(this,Tc,Jy).call(this)}actions(){return{resolve:(r,n,o)=>Y(this,ip,wP).call(this,r,n,o),requestFont:(r,n,o)=>Y(this,mp,zP).call(this,r,n,o),hasFont:r=>Y(this,hp,OP).call(this,r),getFonts:()=>_(this,vt),buildLinks:()=>Y(this,cp,kP).call(this)}}getters(){return{contextPaths:()=>[]}}};vt=new WeakMap,zt=new WeakMap,Tr=new WeakMap,zr=new WeakMap,ur=new WeakMap,ip=new WeakSet,wP=a(function(r,n="400",o="normal"){if(!r||typeof r!="string")return r;let s=Ea(r),i=!1;for(let{name:c,source:u,url:l}of s)u==="system"||eo(c)||Y(this,kn,Wo).call(this,c,n,o,u||"google",l)&&(i=!0);return i&&Y(this,zc,Wy).call(this),oq(r)},"#resolve"),cp=new WeakSet,kP=a(function(){return cq(Y(this,up,SP).call(this))},"#buildLinks"),up=new WeakSet,SP=a(function(){oe(this,vt,new Map);let r=this.inject("state");Y(this,lp,$P).call(this,r);let n=r.get(["nodes"]);return n?.app&&Y(this,Nc,Gy).call(this,"app",n,null),_(this,vt)},"#scanFonts"),lp=new WeakSet,$P=a(function(r){let n=r.get(["tokens"]);if(n){for(let[,o]of Object.entries(n))if(!(!o||o.$type!=="fontFamily"))for(let{name:s,source:i,url:c}of Ea(o.$value))i==="system"||eo(s)||Y(this,kn,Wo).call(this,s,"400","normal",i||"google",c)}},"#scanTokens"),Nc=new WeakSet,Gy=a(function(r,n,o){let s=n[r];if(!s)return;let{families:i}=Y(this,fp,TP).call(this,s),c=o;if(i.size>0){for(let[l,d]of i)if(d.variants.size>0)for(let m of d.variants){let[,h]=m.split(","),f=m.startsWith("1,")?"italic":"normal";Y(this,kn,Wo).call(this,l,h,f,d.source,d.url)}else Y(this,kn,Wo).call(this,l,"400","normal",d.source,d.url);c=Y(this,dp,EP).call(this,s)||[...i.keys()][0]}else if(c)for(let u of Y(this,pp,NP).call(this,s)){let l=_(this,vt).get(c),[,d]=u.split(","),m=u.startsWith("1,")?"italic":"normal";Y(this,kn,Wo).call(this,c,d,m,l?.source||"google",l?.url)}if(Array.isArray(s.children))for(let u of s.children)Y(this,Nc,Gy).call(this,u,n,c)},"#walkNode"),dp=new WeakSet,EP=a(function(r){let n=r?.style?.default;if(!n)return null;let o=By(n);return o&&Ea(o).find(i=>i.source!=="system"&&!eo(i.name))?.name||null},"#getDefaultFamily"),pp=new WeakSet,NP=a(function(r){if(!r?.style)return[];let n=new Set;for(let[,o]of Object.entries(r.style)){if(!o||typeof o!="object")continue;let s=sp(o),i=ap(o);(s||i)&&n.add(op(s||"400",i||"normal"));for(let[c,u]of Object.entries(o))if((c.startsWith(":")||c.startsWith("&"))&&u&&typeof u=="object"){let l=sp(u),d=ap(u);(l||d)&&n.add(op(l||"400",d||"normal"))}}return[...n]},"#extractVariantsOnly"),fp=new WeakSet,TP=a(function(r){let n=new Map;if(!r?.style)return{families:n};function o(s,i,c){if(!s)return;let u=Ea(s).find(l=>l.source!=="system"&&!eo(l.name));u&&(n.has(u.name)||n.set(u.name,{source:u.source||"google",url:u.url,variants:new Set}),(i||c)&&n.get(u.name).variants.add(op(i||"400",c||"normal")))}a(o,"record");for(let[,s]of Object.entries(r.style))if(!(!s||typeof s!="object")){o(By(s),sp(s),ap(s));for(let[i,c]of Object.entries(s))(i.startsWith(":")||i.startsWith("&"))&&c&&typeof c=="object"&&o(By(c),sp(c),ap(c))}return{families:n}},"#extractNodeFonts"),kn=new WeakSet,Wo=a(function(r,n="400",o="normal",s="google",i){if(!r||eo(r))return!1;let c=op(n,o),u=!1;_(this,vt).has(r)||(_(this,vt).set(r,{source:s||"google",url:i,variants:new Set}),u=!0,console.log("[FontResolver] registered new font:",r,"@"+s));let l=_(this,vt).get(r);return l.variants.has(c)||(l.variants.add(c),u=!0),u},"#registerFont"),mp=new WeakSet,zP=a(function(r,n="400",o="normal"){if(!r||typeof r!="string")return;let s=!1;for(let{name:i,source:c,url:u}of Ea(r))c==="system"||eo(i)||Y(this,kn,Wo).call(this,i,n,o,c||"google",u)&&(s=!0);s&&Y(this,zc,Wy).call(this)},"#requestFont"),hp=new WeakSet,OP=a(function(r){if(!r||typeof r!="string")return!1;let n=Ea(r);return n.length===0?_(this,vt).has(r):n.some(({name:o,source:s})=>s!=="system"&&!eo(o)&&_(this,vt).has(o))},"#hasFont"),Tc=new WeakSet,Jy=a(function(){typeof document>"u"||(_(this,zr)||(oe(this,zr,document.getElementById("jucie-fonts-preconnect-googleapis")),_(this,zr)||(oe(this,zr,document.createElement("link")),_(this,zr).id="jucie-fonts-preconnect-googleapis",_(this,zr).rel="preconnect",_(this,zr).href="https://fonts.googleapis.com",document.head.appendChild(_(this,zr)))),_(this,ur)||(oe(this,ur,document.getElementById("jucie-fonts-preconnect-gstatic")),_(this,ur)||(oe(this,ur,document.createElement("link")),_(this,ur).id="jucie-fonts-preconnect-gstatic",_(this,ur).rel="preconnect",_(this,ur).href="https://fonts.gstatic.com",_(this,ur).crossOrigin="",document.head.appendChild(_(this,ur)))),_(this,zt)||(oe(this,zt,document.getElementById("jucie-fonts")),_(this,zt)||(oe(this,zt,document.createElement("link")),_(this,zt).id="jucie-fonts",_(this,zt).rel="stylesheet",document.head.appendChild(_(this,zt)))),_(this,Tr)||(oe(this,Tr,document.getElementById("jucie-fonts-custom")),_(this,Tr)||(oe(this,Tr,document.createElement("style")),_(this,Tr).id="jucie-fonts-custom",document.head.appendChild(_(this,Tr)))))},"#ensureLinkElements"),zc=new WeakSet,Wy=a(function(){if(typeof document>"u")return;Y(this,Tc,Jy).call(this);let r=vP(_(this,vt));r?_(this,zt).href!==r&&(_(this,zt).href=r):_(this,zt)&&_(this,zt).removeAttribute("href");let n=bP(_(this,vt));_(this,Tr)&&(_(this,Tr).textContent=n)},"#updateFontLinks"),a(gp,"FontResolver"),Qe(gp,"manifest",{name:"FontResolver",namespace:"fontResolver"});var Ec=gp;no();no();no();no();no();import{defineEsConfig as zq}from"@jucie.io/engine-esbuild";import{dirname as Oq,join as Pq}from"path";import{fileURLToPath as Iq}from"url";var Cq=a(()=>{let t=Iq(import.meta.url);return Oq(t)},"getBundleDir"),FP=zq("productionConfig",(t,e)=>({entryPoints:[{in:Pq(Cq(),"entry.js"),out:"main"}],bundle:!0,format:"esm",platform:"browser",sourcemap:e.sourcemap??!1,sourcesContent:!!e.sourcemap,minify:e.minify??!0,target:["es2020"],outdir:e.outdir,jsx:"automatic",jsxImportSource:e.framework==="preact"?"preact":e.framework==="vue"?"vue":"react",loader:{".js":"jsx",".ts":"ts",".tsx":"tsx",".d.ts":"ts"},define:{"process.env.NODE_ENV":JSON.stringify(process.env.NODE_ENV||"production"),"process.env.BASE_URL":JSON.stringify("/"),"process.env.JUCIE_FRAMEWORK":JSON.stringify(e.framework||"react")},treeShaking:!0,splitting:!0,chunkNames:"chunks/[name]-[hash]",assetNames:"assets/[name]-[hash]",external:["fs","path","crypto","stream","http","https","url","querystring","child_process","os","util","zlib","node:crypto","node:http","node:util","node:fs","node:path","firebase-admin","@google-cloud/*","@fastify/*","google-auth-library","google-gax","gtoken","gcp-metadata","teeny-request","jwks-rsa","agent-base","@aws-sdk/client-s3"],outExtension:{".js":".js",".css":".css"}}));import{rmSync as Dq,mkdirSync as Zq,existsSync as UP,statSync as Lq}from"fs";import{join as Fq}from"path";async function qP(t={}){try{t.outdir&&UP(t.outdir)&&Dq(t.outdir,{recursive:!0,force:!0}),t.outdir&&Zq(t.outdir,{recursive:!0});let e=Aq.create().install(jq),r=Rq.create({state:e}).install(gn.configure(t),vn.configure(t),Mq.configure({...t.esbuild??{},outdir:t.outdir,minify:t.minify??!0,sourcemap:t.sourcemap??!1}),Jo.configure(t),Ec.configure(t));r.esBuild.use(FP,to,Yo,ro,Ko,Pc),r.cache.set(["jucieConfig"],{...t,view:"production",mode:"production"}),await r.cas.loadScene(),await r.storeParser.build();let n=r.fontResolver.buildLinks(),o=r.state.get(),s=Object.keys(o.nodes||{}).length,i=Object.keys(o.stores||{}).length;await r.esBuild.build();let c=await r.staticAssets.build({fontLinks:n});r.storeParser.stopWatching();let u="unknown";try{let l=Fq(t.outdir,"main.js");UP(l)&&(u=`${(Lq(l).size/1024).toFixed(2)} KB`)}catch{}return{success:!0,outdir:t.outdir,stats:{nodeCount:s,storeCount:i,bundleSize:u,assetCount:c.assets.fileCount}}}catch(e){throw console.error(`
190
+ \u274C Build failed:`,e),e}}a(qP,"buildForProduction");import{resolve as VP}from"path";import{pathToFileURL as Hq}from"url";import{resolve as Ut,dirname as Uq}from"path";function r_(t,e){if(!t)throw new Error("Config object is required");if(!t.name||typeof t.name!="string")throw new Error('Config must have a "name" field (string)');if(!t.version||typeof t.version!="string")throw new Error('Config must have a "version" field (string)');if(!t.sceneGraph||typeof t.sceneGraph!="string")throw new Error('Config must have a "sceneGraph" field (string path)');if(!t.assets||typeof t.assets!="string")throw new Error('Config must have an "assets" field (string path)');let r=e?Uq(e):process.cwd(),n=t.framework??"vue",o={name:t.name,version:t.version,port:t.port??4e3,_studioUrl:t._studioUrl,sceneGraph:t.sceneGraph?Ut(r,t.sceneGraph):Ut(r,"./src/sceneGraph"),assets:t.assets?Ut(r,t.assets):Ut(r,"./src/assets"),stores:t.stores?Ut(r,t.stores):Ut(r,"./src/stores"),components:qq(t.components,r),libraries:Vq(t.libraries??t.metadata?.libraries??[],r),metadata:{platform:t.metadata?.platform??n},socket:t.socket??{cors:{},options:{},auth:null},projectRoot:r,framework:n,outdir:Ut(r,t.dist||"dist"),esbuild:t.esbuild??{}};if(typeof o.port!="number"||o.port<1||o.port>65535)throw new Error('Config "port" must be a number between 1 and 65535');if(typeof o.metadata.platform!="string")throw new Error('Config "metadata.platform" must be a string');if(!Array.isArray(o.libraries))throw new Error('Config "libraries" must be an array');return o}a(r_,"defineConfig");function qq(t,e){let r=Ut(e,"./src/components");return t?typeof t=="string"?Ut(e,t):Array.isArray(t)?t.map(n=>{if(typeof n=="string")return Ut(e,n);if(n&&typeof n=="object"&&n.name&&n.from){let o=n.from.startsWith(".")?Ut(e,n.from):n.from,s=n.manifest?n.manifest.startsWith(".")?Ut(e,n.manifest):n.manifest:null;return{...n,from:o,manifest:s}}return n}):r:r}a(qq,"resolveComponents");function Vq(t,e){return Array.isArray(t)?t.map(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"&&r.path){let n=r.path.startsWith(".")?Ut(e,r.path):r.path;return{...r,path:n}}return r}):[]}a(Vq,"resolveLibraries");async function Xo(t){let e;t?e=VP(process.cwd(),t):e=VP(process.cwd(),"jucie.config.js");try{let o=(await import(Hq(e).href)).default;if(!o)throw new Error("Config file must export a default object");return r_(o,e)}catch(r){throw r.code==="ERR_MODULE_NOT_FOUND"||r.code==="ENOENT"?new Error(`Config file not found: ${e}`):r.message.includes("Config must")||r.message.includes('Config "')?r:new Error(`Failed to load config: ${r.message}`)}}a(Xo,"loadConfig");async function n_(t={},e={}){try{console.log(`
191
+ \u{1F528} Building Jucie project for production...
192
+ `);let r=t.config||process.env.JUCIE_CONFIG||"jucie.config.js",n=await Xo(r),o=t.outdir||t.o,s=o?BP(o)?o:HP(process.cwd(),o):n.outdir,i=t.htmlTemplate,c=i?BP(i)?i:HP(process.cwd(),i):Bq(n.projectRoot,"index.html"),u={...n,outdir:s,minify:t.minify??!0,sourcemap:t.sourcemap??!1,analyze:t.analyze??!1,branch:t.branch||t.b||"main",htmlTemplate:c,view:"production",mode:"production"};e.verbose&&(console.log("Build configuration:",u),console.log(""));let l=await qP(u);return l.success&&(console.log(`
193
+ \u2705 Build complete!
194
+ `),console.log(`\u{1F4E6} Output directory: ${l.outdir}`),console.log(`\u{1F4CA} Bundle size: ${l.stats.bundleSize}`),console.log(`\u{1F3AF} Nodes compiled: ${l.stats.nodeCount}`),console.log(`\u{1F4C1} Stores: ${l.stats.storeCount}`),console.log(`\u{1F5BC}\uFE0F Assets copied: ${l.stats.assetCount}`),console.log(`
195
+ \u{1F4A1} Deploy the dist/ folder to your hosting provider
196
+ `)),l}catch(r){console.error(`
197
+ \u274C Build failed: ${r.message}
198
+ `),e.verbose&&console.error(r.stack),process.exit(1)}}a(n_,"buildCommand");import{exec as Gq}from"child_process";import{platform as GP}from"os";function Ic(t){let e=GP()==="win32"?`start ${t}`:GP()==="darwin"?`open ${t}`:`xdg-open ${t}`;Gq(e)}a(Ic,"openURL");async function y_(t={},e={}){try{console.log(`
199
+ \u{1F680} Starting Jucie dev server...
200
+ `);let r=t.config||process.env.JUCIE_CONFIG||"jucie.config.js",n=await Xo(r);e.verbose&&(console.log("Config file path:",r),console.log("Configuration:",n),console.log(""));let{createPreviewServer:o}=await Promise.resolve().then(()=>(vI(),xI)),s=await o({...n,view:"preview",mode:"preview"});return s&&(console.log(`\u2728 Preview server running at: ${s.src}`),console.log(`Open this URL in your browser to preview your app.
201
+ `)),s}catch(r){console.error(`
202
+ \u274C Dev server failed: ${r.message}
203
+ `),e.verbose&&console.error(r.stack),process.exit(1)}}a(y_,"devCommand");import{resolve as yB,join as _B,dirname as xB}from"path";import{existsSync as vB}from"fs";import{fileURLToPath as bB}from"url";function Ra(t){let e=t.length;for(;--e>=0;)t[e]=0}a(Ra,"zero$1");var c3=0,iC=1,u3=2,l3=3,d3=258,F_=29,Kc=256,qc=Kc+1+F_,Oa=30,U_=19,cC=2*qc+1,rs=15,__=16,p3=7,q_=256,uC=16,lC=17,dC=18,I_=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),$p=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),f3=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),pC=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),m3=512,Nn=new Array((qc+2)*2);Ra(Nn);var Lc=new Array(Oa*2);Ra(Lc);var Vc=new Array(m3);Ra(Vc);var Hc=new Array(d3-l3+1);Ra(Hc);var V_=new Array(F_);Ra(V_);var Ep=new Array(Oa);Ra(Ep);function x_(t,e,r,n,o){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=t&&t.length}a(x_,"StaticTreeDesc");var fC,mC,hC;function v_(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}a(v_,"TreeDesc");var gC=a(t=>t<256?Vc[t]:Vc[256+(t>>>7)],"d_code"),Bc=a((t,e)=>{t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255},"put_short"),Pt=a((t,e,r)=>{t.bi_valid>__-r?(t.bi_buf|=e<<t.bi_valid&65535,Bc(t,t.bi_buf),t.bi_buf=e>>__-t.bi_valid,t.bi_valid+=r-__):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},"send_bits"),Gr=a((t,e,r)=>{Pt(t,r[e*2],r[e*2+1])},"send_code"),yC=a((t,e)=>{let r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1},"bi_reverse"),h3=a(t=>{t.bi_valid===16?(Bc(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)},"bi_flush"),g3=a((t,e)=>{let r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,i=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,u=e.stat_desc.max_length,l,d,m,h,f,g,v=0;for(h=0;h<=rs;h++)t.bl_count[h]=0;for(r[t.heap[t.heap_max]*2+1]=0,l=t.heap_max+1;l<cC;l++)d=t.heap[l],h=r[r[d*2+1]*2+1]+1,h>u&&(h=u,v++),r[d*2+1]=h,!(d>n)&&(t.bl_count[h]++,f=0,d>=c&&(f=i[d-c]),g=r[d*2],t.opt_len+=g*(h+f),s&&(t.static_len+=g*(o[d*2+1]+f)));if(v!==0){do{for(h=u-1;t.bl_count[h]===0;)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[u]--,v-=2}while(v>0);for(h=u;h!==0;h--)for(d=t.bl_count[h];d!==0;)m=t.heap[--l],!(m>n)&&(r[m*2+1]!==h&&(t.opt_len+=(h-r[m*2+1])*r[m*2],r[m*2+1]=h),d--)}},"gen_bitlen"),_C=a((t,e,r)=>{let n=new Array(rs+1),o=0,s,i;for(s=1;s<=rs;s++)o=o+r[s-1]<<1,n[s]=o;for(i=0;i<=e;i++){let c=t[i*2+1];c!==0&&(t[i*2]=yC(n[c]++,c))}},"gen_codes"),y3=a(()=>{let t,e,r,n,o,s=new Array(rs+1);for(r=0,n=0;n<F_-1;n++)for(V_[n]=r,t=0;t<1<<I_[n];t++)Hc[r++]=n;for(Hc[r-1]=n,o=0,n=0;n<16;n++)for(Ep[n]=o,t=0;t<1<<$p[n];t++)Vc[o++]=n;for(o>>=7;n<Oa;n++)for(Ep[n]=o<<7,t=0;t<1<<$p[n]-7;t++)Vc[256+o++]=n;for(e=0;e<=rs;e++)s[e]=0;for(t=0;t<=143;)Nn[t*2+1]=8,t++,s[8]++;for(;t<=255;)Nn[t*2+1]=9,t++,s[9]++;for(;t<=279;)Nn[t*2+1]=7,t++,s[7]++;for(;t<=287;)Nn[t*2+1]=8,t++,s[8]++;for(_C(Nn,qc+1,s),t=0;t<Oa;t++)Lc[t*2+1]=5,Lc[t*2]=yC(t,5);fC=new x_(Nn,I_,Kc+1,qc,rs),mC=new x_(Lc,$p,0,Oa,rs),hC=new x_(new Array(0),f3,0,U_,p3)},"tr_static_init"),xC=a(t=>{let e;for(e=0;e<qc;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Oa;e++)t.dyn_dtree[e*2]=0;for(e=0;e<U_;e++)t.bl_tree[e*2]=0;t.dyn_ltree[q_*2]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},"init_block"),vC=a(t=>{t.bi_valid>8?Bc(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},"bi_windup"),bI=a((t,e,r,n)=>{let o=e*2,s=r*2;return t[o]<t[s]||t[o]===t[s]&&n[e]<=n[r]},"smaller"),b_=a((t,e,r)=>{let n=t.heap[r],o=r<<1;for(;o<=t.heap_len&&(o<t.heap_len&&bI(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!bI(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n},"pqdownheap"),wI=a((t,e,r)=>{let n,o,s=0,i,c;if(t.sym_next!==0)do n=t.pending_buf[t.sym_buf+s++]&255,n+=(t.pending_buf[t.sym_buf+s++]&255)<<8,o=t.pending_buf[t.sym_buf+s++],n===0?Gr(t,o,e):(i=Hc[o],Gr(t,i+Kc+1,e),c=I_[i],c!==0&&(o-=V_[i],Pt(t,o,c)),n--,i=gC(n),Gr(t,i,r),c=$p[i],c!==0&&(n-=Ep[i],Pt(t,n,c)));while(s<t.sym_next);Gr(t,q_,e)},"compress_block"),C_=a((t,e)=>{let r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.elems,i,c,u=-1,l;for(t.heap_len=0,t.heap_max=cC,i=0;i<s;i++)r[i*2]!==0?(t.heap[++t.heap_len]=u=i,t.depth[i]=0):r[i*2+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=u<2?++u:0,r[l*2]=1,t.depth[l]=0,t.opt_len--,o&&(t.static_len-=n[l*2+1]);for(e.max_code=u,i=t.heap_len>>1;i>=1;i--)b_(t,r,i);l=s;do i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],b_(t,r,1),c=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=c,r[l*2]=r[i*2]+r[c*2],t.depth[l]=(t.depth[i]>=t.depth[c]?t.depth[i]:t.depth[c])+1,r[i*2+1]=r[c*2+1]=l,t.heap[1]=l++,b_(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],g3(t,e),_C(r,u,t.bl_count)},"build_tree"),kI=a((t,e,r)=>{let n,o=-1,s,i=e[0*2+1],c=0,u=7,l=4;for(i===0&&(u=138,l=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=e[(n+1)*2+1],!(++c<u&&s===i)&&(c<l?t.bl_tree[s*2]+=c:s!==0?(s!==o&&t.bl_tree[s*2]++,t.bl_tree[uC*2]++):c<=10?t.bl_tree[lC*2]++:t.bl_tree[dC*2]++,c=0,o=s,i===0?(u=138,l=3):s===i?(u=6,l=3):(u=7,l=4))},"scan_tree"),SI=a((t,e,r)=>{let n,o=-1,s,i=e[0*2+1],c=0,u=7,l=4;for(i===0&&(u=138,l=3),n=0;n<=r;n++)if(s=i,i=e[(n+1)*2+1],!(++c<u&&s===i)){if(c<l)do Gr(t,s,t.bl_tree);while(--c!==0);else s!==0?(s!==o&&(Gr(t,s,t.bl_tree),c--),Gr(t,uC,t.bl_tree),Pt(t,c-3,2)):c<=10?(Gr(t,lC,t.bl_tree),Pt(t,c-3,3)):(Gr(t,dC,t.bl_tree),Pt(t,c-11,7));c=0,o=s,i===0?(u=138,l=3):s===i?(u=6,l=3):(u=7,l=4)}},"send_tree"),_3=a(t=>{let e;for(kI(t,t.dyn_ltree,t.l_desc.max_code),kI(t,t.dyn_dtree,t.d_desc.max_code),C_(t,t.bl_desc),e=U_-1;e>=3&&t.bl_tree[pC[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e},"build_bl_tree"),x3=a((t,e,r,n)=>{let o;for(Pt(t,e-257,5),Pt(t,r-1,5),Pt(t,n-4,4),o=0;o<n;o++)Pt(t,t.bl_tree[pC[o]*2+1],3);SI(t,t.dyn_ltree,e-1),SI(t,t.dyn_dtree,r-1)},"send_all_trees"),v3=a(t=>{let e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return 0;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return 1;for(r=32;r<Kc;r++)if(t.dyn_ltree[r*2]!==0)return 1;return 0},"detect_data_type"),$I=!1,b3=a(t=>{$I||(y3(),$I=!0),t.l_desc=new v_(t.dyn_ltree,fC),t.d_desc=new v_(t.dyn_dtree,mC),t.bl_desc=new v_(t.bl_tree,hC),t.bi_buf=0,t.bi_valid=0,xC(t)},"_tr_init$1"),bC=a((t,e,r,n)=>{Pt(t,(c3<<1)+(n?1:0),3),vC(t),Bc(t,r),Bc(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},"_tr_stored_block$1"),w3=a(t=>{Pt(t,iC<<1,3),Gr(t,q_,Nn),h3(t)},"_tr_align$1"),k3=a((t,e,r,n)=>{let o,s,i=0;t.level>0?(t.strm.data_type===2&&(t.strm.data_type=v3(t)),C_(t,t.l_desc),C_(t,t.d_desc),i=_3(t),o=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&e!==-1?bC(t,e,r,n):t.strategy===4||s===o?(Pt(t,(iC<<1)+(n?1:0),3),wI(t,Nn,Lc)):(Pt(t,(u3<<1)+(n?1:0),3),x3(t,t.l_desc.max_code+1,t.d_desc.max_code+1,i+1),wI(t,t.dyn_ltree,t.dyn_dtree)),xC(t),n&&vC(t)},"_tr_flush_block$1"),S3=a((t,e,r)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Hc[r]+Kc+1)*2]++,t.dyn_dtree[gC(e)*2]++),t.sym_next===t.sym_end),"_tr_tally$1"),$3=b3,E3=bC,N3=k3,T3=S3,z3=w3,O3={_tr_init:$3,_tr_stored_block:E3,_tr_flush_block:N3,_tr_tally:T3,_tr_align:z3},P3=a((t,e,r,n)=>{let o=t&65535|0,s=t>>>16&65535|0,i=0;for(;r!==0;){i=r>2e3?2e3:r,r-=i;do o=o+e[n++]|0,s=s+o|0;while(--i);o%=65521,s%=65521}return o|s<<16|0},"adler32"),Gc=P3,I3=a(()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},"makeTable"),C3=new Uint32Array(I3()),R3=a((t,e,r,n)=>{let o=C3,s=n+r;t^=-1;for(let i=n;i<s;i++)t=t>>>8^o[(t^e[i])&255];return t^-1},"crc32"),et=R3,ss={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},us={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:A3,_tr_stored_block:R_,_tr_flush_block:j3,_tr_tally:io,_tr_align:M3}=O3,{Z_NO_FLUSH:co,Z_PARTIAL_FLUSH:D3,Z_FULL_FLUSH:Z3,Z_FINISH:dr,Z_BLOCK:EI,Z_OK:at,Z_STREAM_END:NI,Z_STREAM_ERROR:Jr,Z_DATA_ERROR:L3,Z_BUF_ERROR:w_,Z_DEFAULT_COMPRESSION:F3,Z_FILTERED:U3,Z_HUFFMAN_ONLY:vp,Z_RLE:q3,Z_FIXED:V3,Z_DEFAULT_STRATEGY:H3,Z_UNKNOWN:B3,Z_DEFLATED:zp}=us,G3=9,J3=15,W3=8,K3=29,Y3=256,A_=Y3+1+K3,X3=30,Q3=19,eV=2*A_+1,tV=15,Se=3,ao=258,Wr=ao+Se+1,rV=32,Ia=42,H_=57,j_=69,M_=73,D_=91,Z_=103,ns=113,Dc=666,bt=1,Aa=2,as=3,ja=4,nV=3,os=a((t,e)=>(t.msg=ss[e],e),"err"),TI=a(t=>t*2-(t>4?9:0),"rank"),so=a(t=>{let e=t.length;for(;--e>=0;)t[e]=0},"zero"),oV=a(t=>{let e,r,n,o=t.w_size;e=t.hash_size,n=e;do r=t.head[--n],t.head[n]=r>=o?r-o:0;while(--e);e=o,n=e;do r=t.prev[--n],t.prev[n]=r>=o?r-o:0;while(--e)},"slide_hash"),B_=a((t,e,r)=>(e<<t.hash_shift^r)&t.hash_mask,"HASH"),is=a((t,e)=>{let r;if(t.legacy_hash)r=t.ins_h=B_(t,t.ins_h,t.window[e+Se-1]);else{let o=t.window,s=o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24;r=t.ins_h=Math.imul(s,66521)+66521>>>16&t.hash_mask}let n=t.prev[e&t.w_mask]=t.head[r];return t.head[r]=e,n},"INSERT_STRING"),qt=a(t=>{let e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))},"flush_pending"),Vt=a((t,e)=>{j3(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,qt(t.strm)},"flush_block_only"),Ee=a((t,e)=>{t.pending_buf[t.pending++]=e},"put_byte"),Mc=a((t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255},"putShortMSB"),L_=a((t,e,r,n)=>{let o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,e.set(t.input.subarray(t.next_in,t.next_in+o),r),t.state.wrap===1?t.adler=Gc(t.adler,e,o,r):t.state.wrap===2&&(t.adler=et(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)},"read_buf"),wC=a((t,e)=>{let r=t.max_chain_length,n=t.strstart,o,s,i=t.prev_length,c=t.nice_match,u=t.strstart>t.w_size-Wr?t.strstart-(t.w_size-Wr):0,l=t.window,d=t.w_mask,m=t.prev,h=t.strstart+ao,f=l[n+i-1],g=l[n+i];t.prev_length>=t.good_match&&(r>>=2),c>t.lookahead&&(c=t.lookahead);do if(o=e,!(l[o+i]!==g||l[o+i-1]!==f||l[o]!==l[n]||l[++o]!==l[n+1])){n+=2,o++;do;while(l[++n]===l[++o]&&l[++n]===l[++o]&&l[++n]===l[++o]&&l[++n]===l[++o]&&l[++n]===l[++o]&&l[++n]===l[++o]&&l[++n]===l[++o]&&l[++n]===l[++o]&&n<h);if(s=ao-(h-n),n=h-ao,s>i){if(t.match_start=e,i=s,s>=c)break;f=l[n+i-1],g=l[n+i]}}while((e=m[e&d])>u&&--r!==0);return i<=t.lookahead?i:t.lookahead},"longest_match"),Ca=a(t=>{let e=t.w_size,r,n,o;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Wr)&&(t.window.set(t.window.subarray(e,e+e-n),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),oV(t),n+=e),t.strm.avail_in===0)break;if(r=L_(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=r,t.legacy_hash){if(t.lookahead+t.insert>=Se)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=B_(t,t.ins_h,t.window[o+1]);t.insert&&(is(t,o),o++,t.insert--,!(t.lookahead+t.insert<Se)););}else if(t.lookahead+t.insert>Se)for(o=t.strstart-t.insert;t.insert&&(is(t,o),o++,t.insert--,!(t.lookahead+t.insert<=Se)););}while(t.lookahead<Wr&&t.strm.avail_in!==0)},"fill_window"),kC=a((t,e)=>{let r=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n,o,s,i=0,c=t.strm.avail_in;do{if(n=65535,s=t.bi_valid+42>>3,t.strm.avail_out<s||(s=t.strm.avail_out-s,o=t.strstart-t.block_start,n>o+t.strm.avail_in&&(n=o+t.strm.avail_in),n>s&&(n=s),n<r&&(n===0&&e!==dr||e===co||n!==o+t.strm.avail_in)))break;i=e===dr&&n===o+t.strm.avail_in?1:0,R_(t,0,0,i),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,qt(t.strm),o&&(o>n&&(o=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+o),t.strm.next_out),t.strm.next_out+=o,t.strm.avail_out-=o,t.strm.total_out+=o,t.block_start+=o,n-=o),n&&(L_(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(i===0);return c-=t.strm.avail_in,c&&(c>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=c&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-c,t.strm.next_in),t.strstart),t.strstart+=c,t.insert+=c>t.w_size-t.insert?t.w_size-t.insert:c),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),i?ja:e!==co&&e!==dr&&t.strm.avail_in===0&&t.strstart===t.block_start?Aa:(s=t.window_size-t.strstart,t.strm.avail_in>s&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,s+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),s>t.strm.avail_in&&(s=t.strm.avail_in),s&&(L_(t.strm,t.window,t.strstart,s),t.strstart+=s,t.insert+=s>t.w_size-t.insert?t.w_size-t.insert:s),t.high_water<t.strstart&&(t.high_water=t.strstart),s=t.bi_valid+42>>3,s=t.pending_buf_size-s>65535?65535:t.pending_buf_size-s,r=s>t.w_size?t.w_size:s,o=t.strstart-t.block_start,(o>=r||(o||e===dr)&&e!==co&&t.strm.avail_in===0&&o<=s)&&(n=o>s?s:o,i=e===dr&&t.strm.avail_in===0&&n===o?1:0,R_(t,t.block_start,n,i),t.block_start+=n,qt(t.strm)),i?as:bt)},"deflate_stored"),k_=a((t,e)=>{let r,n;for(;;){if(t.lookahead<Wr){if(Ca(t),t.lookahead<Wr&&e===co)return bt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Se&&(r=is(t,t.strstart)),r!==0&&t.strstart-r<=t.w_size-Wr&&(t.match_length=wC(t,r)),t.match_length>=Se)if(n=io(t,t.strstart-t.match_start,t.match_length-Se),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Se){t.match_length--;do t.strstart++,r=is(t,t.strstart);while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.legacy_hash&&(t.ins_h=t.window[t.strstart],t.ins_h=B_(t,t.ins_h,t.window[t.strstart+1]));else n=io(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Vt(t,!1),t.strm.avail_out===0))return bt}return t.insert=t.strstart<Se-1?t.strstart:Se-1,e===dr?(Vt(t,!0),t.strm.avail_out===0?as:ja):t.sym_next&&(Vt(t,!1),t.strm.avail_out===0)?bt:Aa},"deflate_fast"),Ta=a((t,e)=>{let r,n,o;for(;;){if(t.lookahead<Wr){if(Ca(t),t.lookahead<Wr&&e===co)return bt;if(t.lookahead===0)break}if(r=0,t.lookahead>=Se&&(r=is(t,t.strstart)),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Se-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Wr&&(t.match_length=wC(t,r),t.match_length<=5&&(t.strategy===U3||t.match_length===Se&&t.strstart-t.match_start>4096)&&(t.match_length=Se-1)),t.prev_length>=Se&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-Se,n=io(t,t.strstart-1-t.prev_match,t.prev_length-Se),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=o&&(r=is(t,t.strstart));while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Se-1,t.strstart++,n&&(Vt(t,!1),t.strm.avail_out===0))return bt}else if(t.match_available){if(n=io(t,0,t.window[t.strstart-1]),n&&Vt(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return bt}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=io(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Se-1?t.strstart:Se-1,e===dr?(Vt(t,!0),t.strm.avail_out===0?as:ja):t.sym_next&&(Vt(t,!1),t.strm.avail_out===0)?bt:Aa},"deflate_slow"),sV=a((t,e)=>{let r,n,o,s,i=t.window;for(;;){if(t.lookahead<=ao){if(Ca(t),t.lookahead<=ao&&e===co)return bt;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Se&&t.strstart>0&&(o=t.strstart-1,n=i[o],n===i[++o]&&n===i[++o]&&n===i[++o])){s=t.strstart+ao;do;while(n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&o<s);t.match_length=ao-(s-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Se?(r=io(t,1,t.match_length-Se),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=io(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Vt(t,!1),t.strm.avail_out===0))return bt}return t.insert=0,e===dr?(Vt(t,!0),t.strm.avail_out===0?as:ja):t.sym_next&&(Vt(t,!1),t.strm.avail_out===0)?bt:Aa},"deflate_rle"),aV=a((t,e)=>{let r;for(;;){if(t.lookahead===0&&(Ca(t),t.lookahead===0)){if(e===co)return bt;break}if(t.match_length=0,r=io(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Vt(t,!1),t.strm.avail_out===0))return bt}return t.insert=0,e===dr?(Vt(t,!0),t.strm.avail_out===0?as:ja):t.sym_next&&(Vt(t,!1),t.strm.avail_out===0)?bt:Aa},"deflate_huff");function Hr(t,e,r,n,o){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=o}a(Hr,"Config");var Zc=[new Hr(0,0,0,0,kC),new Hr(4,4,8,4,k_),new Hr(4,5,16,8,k_),new Hr(4,6,32,32,k_),new Hr(4,4,16,16,Ta),new Hr(8,16,32,32,Ta),new Hr(8,16,128,128,Ta),new Hr(8,32,128,256,Ta),new Hr(32,128,258,1024,Ta),new Hr(32,258,258,4096,Ta)],iV=a(t=>{t.window_size=2*t.w_size,so(t.head),t.max_lazy_match=Zc[t.level].max_lazy,t.good_match=Zc[t.level].good_length,t.nice_match=Zc[t.level].nice_length,t.max_chain_length=Zc[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Se-1,t.match_available=0,t.ins_h=0},"lm_init");function cV(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=zp,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(eV*2),this.dyn_dtree=new Uint16Array((2*X3+1)*2),this.bl_tree=new Uint16Array((2*Q3+1)*2),so(this.dyn_ltree),so(this.dyn_dtree),so(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(tV+1),this.heap=new Uint16Array(2*A_+1),so(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*A_+1),so(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}a(cV,"DeflateState");var Yc=a(t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.status!==Ia&&e.status!==H_&&e.status!==j_&&e.status!==M_&&e.status!==D_&&e.status!==Z_&&e.status!==ns&&e.status!==Dc?1:0},"deflateStateCheck"),SC=a(t=>{if(Yc(t))return os(t,Jr);t.total_in=t.total_out=0,t.data_type=B3;let e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?H_:e.wrap?Ia:ns,t.adler=e.wrap===2?0:1,e.last_flush=-2,A3(e),at},"deflateResetKeep"),$C=a(t=>{let e=SC(t);return e===at&&iV(t.state),e},"deflateReset"),uV=a((t,e)=>Yc(t)||t.state.wrap!==2?Jr:(t.state.gzhead=e,at),"deflateSetHeader"),EC=a((t,e,r,n,o,s,i)=>{if(!t)return Jr;let c=1;if(e===F3&&(e=6),n<0?(c=0,n=-n):n>15&&(c=2,n-=16),o<1||o>G3||r!==zp||n<8||n>15||e<0||e>9||s<0||s>V3||n===8&&c!==1)return os(t,Jr);n===8&&(n=9);let u=new cV;return t.state=u,u.strm=t,u.status=Ia,u.wrap=c,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.legacy_hash=i?1:0,u.hash_bits=o+7,!u.legacy_hash&&u.hash_bits<15&&(u.hash_bits=15),u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+Se-1)/Se),u.window=new Uint8Array(u.w_size*2),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=u.lit_bufsize*4,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=(u.lit_bufsize-1)*3,u.level=e,u.strategy=s,u.method=r,$C(t)},"deflateInit2"),lV=a((t,e)=>EC(t,e,zp,J3,W3,H3),"deflateInit"),dV=a((t,e)=>{if(Yc(t)||e>EI||e<0)return t?os(t,Jr):Jr;let r=t.state;if(!t.output||t.avail_in!==0&&!t.input||r.status===Dc&&e!==dr)return os(t,t.avail_out===0?w_:Jr);let n=r.last_flush;if(r.last_flush=e,r.pending!==0){if(qt(t),t.avail_out===0)return r.last_flush=-1,at}else if(t.avail_in===0&&TI(e)<=TI(n)&&e!==dr)return os(t,w_);if(r.status===Dc&&t.avail_in!==0)return os(t,w_);if(r.status===Ia&&r.wrap===0&&(r.status=ns),r.status===Ia){let o=zp+(r.w_bits-8<<4)<<8,s=-1;if(r.strategy>=vp||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,o|=s<<6,r.strstart!==0&&(o|=rV),o+=31-o%31,Mc(r,o),r.strstart!==0&&(Mc(r,t.adler>>>16),Mc(r,t.adler&65535)),t.adler=1,r.status=ns,qt(t),r.pending!==0)return r.last_flush=-1,at}if(r.status===H_){if(t.adler=0,Ee(r,31),Ee(r,139),Ee(r,8),r.gzhead)Ee(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Ee(r,r.gzhead.time&255),Ee(r,r.gzhead.time>>8&255),Ee(r,r.gzhead.time>>16&255),Ee(r,r.gzhead.time>>24&255),Ee(r,r.level===9?2:r.strategy>=vp||r.level<2?4:0),Ee(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(Ee(r,r.gzhead.extra.length&255),Ee(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=et(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=j_;else if(Ee(r,0),Ee(r,0),Ee(r,0),Ee(r,0),Ee(r,0),Ee(r,r.level===9?2:r.strategy>=vp||r.level<2?4:0),Ee(r,nV),r.status=ns,qt(t),r.pending!==0)return r.last_flush=-1,at}if(r.status===j_){if(r.gzhead.extra){let o=r.pending,s=(r.gzhead.extra.length&65535)-r.gzindex;for(;r.pending+s>r.pending_buf_size;){let c=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+c),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>o&&(t.adler=et(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex+=c,qt(t),r.pending!==0)return r.last_flush=-1,at;o=0,s-=c}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending+=s,r.gzhead.hcrc&&r.pending>o&&(t.adler=et(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex=0}r.status=M_}if(r.status===M_){if(r.gzhead.name){let o=r.pending,s;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>o&&(t.adler=et(t.adler,r.pending_buf,r.pending-o,o)),qt(t),r.pending!==0)return r.last_flush=-1,at;o=0}r.gzindex<r.gzhead.name.length?s=r.gzhead.name.charCodeAt(r.gzindex++)&255:s=0,Ee(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>o&&(t.adler=et(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex=0}r.status=D_}if(r.status===D_){if(r.gzhead.comment){let o=r.pending,s;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>o&&(t.adler=et(t.adler,r.pending_buf,r.pending-o,o)),qt(t),r.pending!==0)return r.last_flush=-1,at;o=0}r.gzindex<r.gzhead.comment.length?s=r.gzhead.comment.charCodeAt(r.gzindex++)&255:s=0,Ee(r,s)}while(s!==0);r.gzhead.hcrc&&r.pending>o&&(t.adler=et(t.adler,r.pending_buf,r.pending-o,o))}r.status=Z_}if(r.status===Z_){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(qt(t),r.pending!==0))return r.last_flush=-1,at;Ee(r,t.adler&255),Ee(r,t.adler>>8&255),t.adler=0}if(r.status=ns,qt(t),r.pending!==0)return r.last_flush=-1,at}if(t.avail_in!==0||r.lookahead!==0||e!==co&&r.status!==Dc){let o=r.level===0?kC(r,e):r.strategy===vp?aV(r,e):r.strategy===q3?sV(r,e):Zc[r.level].func(r,e);if((o===as||o===ja)&&(r.status=Dc),o===bt||o===as)return t.avail_out===0&&(r.last_flush=-1),at;if(o===Aa&&(e===D3?M3(r):e!==EI&&(R_(r,0,0,!1),e===Z3&&(so(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),qt(t),t.avail_out===0))return r.last_flush=-1,at}return e!==dr?at:r.wrap<=0?NI:(r.wrap===2?(Ee(r,t.adler&255),Ee(r,t.adler>>8&255),Ee(r,t.adler>>16&255),Ee(r,t.adler>>24&255),Ee(r,t.total_in&255),Ee(r,t.total_in>>8&255),Ee(r,t.total_in>>16&255),Ee(r,t.total_in>>24&255)):(Mc(r,t.adler>>>16),Mc(r,t.adler&65535)),qt(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?at:NI)},"deflate$2"),pV=a(t=>{if(Yc(t))return Jr;let e=t.state.status;return t.state=null,e===ns?os(t,L3):at},"deflateEnd"),fV=a((t,e)=>{let r=e.length;if(Yc(t))return Jr;let n=t.state,o=n.wrap;if(o===2||o===1&&n.status!==Ia||n.lookahead)return Jr;if(o===1&&(t.adler=Gc(t.adler,e,r,0)),n.wrap=0,r>=n.w_size){o===0&&(so(n.head),n.strstart=0,n.block_start=0,n.insert=0);let u=new Uint8Array(n.w_size);u.set(e.subarray(r-n.w_size,r),0),e=u,r=n.w_size}let s=t.avail_in,i=t.next_in,c=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Ca(n);n.lookahead>=Se;){let u=n.strstart,l=n.lookahead-(Se-1);do is(n,u),u++;while(--l);n.strstart=u,n.lookahead=Se-1,Ca(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Se-1,n.match_available=0,t.next_in=i,t.input=c,t.avail_in=s,n.wrap=o,at},"deflateSetDictionary"),mV=lV,hV=EC,gV=$C,yV=SC,_V=uV,xV=dV,vV=pV,bV=fV,wV="pako deflate (from Nodeca project)",Fc={deflateInit:mV,deflateInit2:hV,deflateReset:gV,deflateResetKeep:yV,deflateSetHeader:_V,deflate:xV,deflateEnd:vV,deflateSetDictionary:bV,deflateInfo:wV},kV=a((t,e)=>Object.prototype.hasOwnProperty.call(t,e),"_has"),SV=a(function(t){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(let n in r)kV(r,n)&&(t[n]=r[n])}}return t},"assign"),$V=a(t=>{let e=0;for(let n=0,o=t.length;n<o;n++)e+=t[n].length;let r=new Uint8Array(e);for(let n=0,o=0,s=t.length;n<s;n++){let i=t[n];r.set(i,o),o+=i.length}return r},"flattenChunks"),Op={assign:SV,flattenChunks:$V},NC=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{NC=!1}var Jc=new Uint8Array(256);for(let t=0;t<256;t++)Jc[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Jc[254]=Jc[255]=1;var EV=a(t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,o,s,i=t.length,c=0;for(o=0;o<i;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),c+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(c),s=0,o=0;s<c;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e},"string2buf"),NV=a((t,e)=>{if(e<65534&&t.subarray&&NC)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r},"buf2binstring"),TV=a((t,e)=>{let r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,o,s=new Array(r*2);for(o=0,n=0;n<r;){let i=t[n++];if(i<128){s[o++]=i;continue}let c=Jc[i];if(c>4){s[o++]=65533,n+=c-1;continue}for(i&=c===2?31:c===3?15:7;c>1&&n<r;)i=i<<6|t[n++]&63,c--;if(c>1){s[o++]=65533;continue}i<65536?s[o++]=i:(i-=65536,s[o++]=55296|i>>10&1023,s[o++]=56320|i&1023)}return NV(s,o)},"buf2string"),zV=a((t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Jc[t[r]]>e?r:e},"utf8border"),Wc={string2buf:EV,buf2string:TV,utf8border:zV};function OV(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}a(OV,"ZStream");var TC=OV,zC=Object.prototype.toString,{Z_NO_FLUSH:PV,Z_SYNC_FLUSH:IV,Z_FULL_FLUSH:CV,Z_FINISH:RV,Z_OK:Np,Z_STREAM_END:AV,Z_DEFAULT_COMPRESSION:jV,Z_DEFAULT_STRATEGY:MV,Z_DEFLATED:DV}=us,ZV={level:jV,method:DV,chunkSize:16384,windowBits:15,memLevel:8,strategy:MV,legacyHash:!0};function Xc(t){this.options=Op.assign({},ZV,t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new TC,this.strm.avail_out=0;let r=Fc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy,e.legacyHash);if(r!==Np)throw new Error(ss[r]);if(e.header&&Fc.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Wc.string2buf(e.dictionary):zC.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=Fc.deflateSetDictionary(this.strm,n),r!==Np)throw new Error(ss[r]);this._dict_set=!0}}a(Xc,"Deflate$1");Xc.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,o,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?RV:PV,typeof t=="string"?r.input=Wc.string2buf(t):zC.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){if(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(s===IV||s===CV)&&r.avail_out<=6){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(o=Fc.deflate(r,s),o===AV)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),o=Fc.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Np;if(r.avail_out===0){this.onData(r.output);continue}if(s>0&&r.next_out>0){this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;continue}if(r.avail_in===0)break}return!0};Xc.prototype.onData=function(t){this.chunks.push(t)};Xc.prototype.onEnd=function(t){t===Np&&(this.result=Op.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function G_(t,e){let r=new Xc(e);if(r.push(t,!0),r.err)throw r.msg||ss[r.err];return r.result}a(G_,"deflate$1");function LV(t,e){return e=e||{},e.raw=!0,G_(t,e)}a(LV,"deflateRaw$1");function FV(t,e){return e=e||{},e.gzip=!0,G_(t,e)}a(FV,"gzip$1");var UV=Xc,qV=G_,VV=LV,HV=FV,BV=us,GV={Deflate:UV,deflate:qV,deflateRaw:VV,gzip:HV,constants:BV},bp=16209,JV=16191,WV=a(function(e,r){let n,o,s,i,c,u,l,d,m,h,f,g,v,y,x,k,w,b,E,A,O,B,q,C,K=e.state;n=e.next_in,q=e.input,o=n+(e.avail_in-5),s=e.next_out,C=e.output,i=s-(r-e.avail_out),c=s+(e.avail_out-257),u=K.dmax,l=K.wsize,d=K.whave,m=K.wnext,h=K.window,f=K.hold,g=K.bits,v=K.lencode,y=K.distcode,x=(1<<K.lenbits)-1,k=(1<<K.distbits)-1;e:do{g<15&&(f+=q[n++]<<g,g+=8,f+=q[n++]<<g,g+=8),w=v[f&x];t:for(;;){if(b=w>>>24,f>>>=b,g-=b,b=w>>>16&255,b===0)C[s++]=w&65535;else if(b&16){E=w&65535,b&=15,b&&(g<b&&(f+=q[n++]<<g,g+=8),E+=f&(1<<b)-1,f>>>=b,g-=b),g<15&&(f+=q[n++]<<g,g+=8,f+=q[n++]<<g,g+=8),w=y[f&k];r:for(;;){if(b=w>>>24,f>>>=b,g-=b,b=w>>>16&255,b&16){if(A=w&65535,b&=15,g<b&&(f+=q[n++]<<g,g+=8,g<b&&(f+=q[n++]<<g,g+=8)),A+=f&(1<<b)-1,A>u){e.msg="invalid distance too far back",K.mode=bp;break e}if(f>>>=b,g-=b,b=s-i,A>b){if(b=A-b,b>d&&K.sane){e.msg="invalid distance too far back",K.mode=bp;break e}if(O=0,B=h,m===0){if(O+=l-b,b<E){E-=b;do C[s++]=h[O++];while(--b);O=s-A,B=C}}else if(m<b){if(O+=l+m-b,b-=m,b<E){E-=b;do C[s++]=h[O++];while(--b);if(O=0,m<E){b=m,E-=b;do C[s++]=h[O++];while(--b);O=s-A,B=C}}}else if(O+=m-b,b<E){E-=b;do C[s++]=h[O++];while(--b);O=s-A,B=C}for(;E>2;)C[s++]=B[O++],C[s++]=B[O++],C[s++]=B[O++],E-=3;E&&(C[s++]=B[O++],E>1&&(C[s++]=B[O++]))}else{O=s-A;do C[s++]=C[O++],C[s++]=C[O++],C[s++]=C[O++],E-=3;while(E>2);E&&(C[s++]=C[O++],E>1&&(C[s++]=C[O++]))}}else if(b&64){e.msg="invalid distance code",K.mode=bp;break e}else{w=y[(w&65535)+(f&(1<<b)-1)];continue r}break}}else if(b&64)if(b&32){K.mode=JV;break e}else{e.msg="invalid literal/length code",K.mode=bp;break e}else{w=v[(w&65535)+(f&(1<<b)-1)];continue t}break}}while(n<o&&s<c);E=g>>3,n-=E,g-=E<<3,f&=(1<<g)-1,e.next_in=n,e.next_out=s,e.avail_in=n<o?5+(o-n):5-(n-o),e.avail_out=s<c?257+(c-s):257-(s-c),K.hold=f,K.bits=g},"inflate_fast"),za=15,zI=852,OI=592,PI=0,S_=1,II=2,KV=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),YV=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),XV=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),QV=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),e5=a((t,e,r,n,o,s,i,c)=>{let u=c.bits,l=0,d=0,m=0,h=0,f=0,g=0,v=0,y=0,x=0,k=0,w,b,E,A,O,B=null,q,C=new Uint16Array(za+1),K=new Uint16Array(za+1),ae=null,pt,ze,Ye;for(l=0;l<=za;l++)C[l]=0;for(d=0;d<n;d++)C[e[r+d]]++;for(f=u,h=za;h>=1&&C[h]===0;h--);if(f>h&&(f=h),h===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,c.bits=1,0;for(m=1;m<h&&C[m]===0;m++);for(f<m&&(f=m),y=1,l=1;l<=za;l++)if(y<<=1,y-=C[l],y<0)return-1;if(y>0&&(t===PI||h!==1))return-1;for(K[1]=0,l=1;l<za;l++)K[l+1]=K[l]+C[l];for(d=0;d<n;d++)e[r+d]!==0&&(i[K[e[r+d]]++]=d);if(t===PI?(B=ae=i,q=20):t===S_?(B=KV,ae=YV,q=257):(B=XV,ae=QV,q=0),k=0,d=0,l=m,O=s,g=f,v=0,E=-1,x=1<<f,A=x-1,t===S_&&x>zI||t===II&&x>OI)return 1;for(;;){pt=l-v,i[d]+1<q?(ze=0,Ye=i[d]):i[d]>=q?(ze=ae[i[d]-q],Ye=B[i[d]-q]):(ze=96,Ye=0),w=1<<l-v,b=1<<g,m=b;do b-=w,o[O+(k>>v)+b]=pt<<24|ze<<16|Ye|0;while(b!==0);for(w=1<<l-1;k&w;)w>>=1;if(w!==0?(k&=w-1,k+=w):k=0,d++,--C[l]===0){if(l===h)break;l=e[r+i[d]]}if(l>f&&(k&A)!==E){for(v===0&&(v=f),O+=m,g=l-v,y=1<<g;g+v<h&&(y-=C[g+v],!(y<=0));)g++,y<<=1;if(x+=1<<g,t===S_&&x>zI||t===II&&x>OI)return 1;E=k&A,o[E]=f<<24|g<<16|O-s|0}}return k!==0&&(o[O+k]=l-v<<24|64<<16|0),c.bits=f,0},"inflate_table"),Uc=e5,t5=0,OC=1,PC=2,{Z_FINISH:CI,Z_BLOCK:r5,Z_TREES:wp,Z_OK:cs,Z_STREAM_END:n5,Z_NEED_DICT:o5,Z_STREAM_ERROR:pr,Z_DATA_ERROR:IC,Z_MEM_ERROR:CC,Z_BUF_ERROR:s5,Z_DEFLATED:RI}=us,Pp=16180,AI=16181,jI=16182,MI=16183,DI=16184,ZI=16185,LI=16186,FI=16187,UI=16188,qI=16189,Tp=16190,En=16191,$_=16192,VI=16193,E_=16194,HI=16195,BI=16196,GI=16197,JI=16198,kp=16199,Sp=16200,WI=16201,KI=16202,YI=16203,XI=16204,QI=16205,N_=16206,eC=16207,tC=16208,qe=16209,RC=16210,AC=16211,a5=852,i5=592,c5=15,u5=c5,rC=a(t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24),"zswap32");function l5(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}a(l5,"InflateState");var ls=a(t=>{if(!t)return 1;let e=t.state;return!e||e.strm!==t||e.mode<Pp||e.mode>AC?1:0},"inflateStateCheck"),jC=a(t=>{if(ls(t))return pr;let e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Pp,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(a5),e.distcode=e.distdyn=new Int32Array(i5),e.sane=1,e.back=-1,cs},"inflateResetKeep"),MC=a(t=>{if(ls(t))return pr;let e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,jC(t)},"inflateReset"),DC=a((t,e)=>{let r;if(ls(t))return pr;let n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?pr:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,MC(t))},"inflateReset2"),ZC=a((t,e)=>{if(!t)return pr;let r=new l5;t.state=r,r.strm=t,r.window=null,r.mode=Pp;let n=DC(t,e);return n!==cs&&(t.state=null),n},"inflateInit2"),d5=a(t=>ZC(t,u5),"inflateInit"),nC=!0,T_,z_,p5=a(t=>{if(nC){T_=new Int32Array(512),z_=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Uc(OC,t.lens,0,288,T_,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Uc(PC,t.lens,0,32,z_,0,t.work,{bits:5}),nC=!1}t.lencode=T_,t.lenbits=9,t.distcode=z_,t.distbits=5},"fixedtables"),LC=a((t,e,r,n)=>{let o,s=t.state;return s.window===null&&(s.window=new Uint8Array(1<<s.wbits)),s.wsize===0&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0),n>=s.wsize?(s.window.set(e.subarray(r-s.wsize,r),0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>n&&(o=n),s.window.set(e.subarray(r-n,r-n+o),s.wnext),n-=o,n?(s.window.set(e.subarray(r-n,r),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0},"updatewindow"),f5=a((t,e)=>{let r,n,o,s,i,c,u,l,d,m,h,f,g,v,y=0,x,k,w,b,E,A,O,B,q=new Uint8Array(4),C,K,ae=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ls(t)||!t.output||!t.input&&t.avail_in!==0)return pr;r=t.state,r.mode===En&&(r.mode=$_),i=t.next_out,o=t.output,u=t.avail_out,s=t.next_in,n=t.input,c=t.avail_in,l=r.hold,d=r.bits,m=c,h=u,B=cs;e:for(;;)switch(r.mode){case Pp:if(r.wrap===0){r.mode=$_;break}for(;d<16;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}if(r.wrap&2&&l===35615){r.wbits===0&&(r.wbits=15),r.check=0,q[0]=l&255,q[1]=l>>>8&255,r.check=et(r.check,q,2,0),l=0,d=0,r.mode=AI;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){t.msg="incorrect header check",r.mode=qe;break}if((l&15)!==RI){t.msg="unknown compression method",r.mode=qe;break}if(l>>>=4,d-=4,O=(l&15)+8,r.wbits===0&&(r.wbits=O),O>15||O>r.wbits){t.msg="invalid window size",r.mode=qe;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=l&512?qI:En,l=0,d=0;break;case AI:for(;d<16;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}if(r.flags=l,(r.flags&255)!==RI){t.msg="unknown compression method",r.mode=qe;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=qe;break}r.head&&(r.head.text=l>>8&1),r.flags&512&&r.wrap&4&&(q[0]=l&255,q[1]=l>>>8&255,r.check=et(r.check,q,2,0)),l=0,d=0,r.mode=jI;case jI:for(;d<32;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}r.head&&(r.head.time=l),r.flags&512&&r.wrap&4&&(q[0]=l&255,q[1]=l>>>8&255,q[2]=l>>>16&255,q[3]=l>>>24&255,r.check=et(r.check,q,4,0)),l=0,d=0,r.mode=MI;case MI:for(;d<16;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}r.head&&(r.head.xflags=l&255,r.head.os=l>>8),r.flags&512&&r.wrap&4&&(q[0]=l&255,q[1]=l>>>8&255,r.check=et(r.check,q,2,0)),l=0,d=0,r.mode=DI;case DI:if(r.flags&1024){for(;d<16;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}r.length=l,r.head&&(r.head.extra_len=l),r.flags&512&&r.wrap&4&&(q[0]=l&255,q[1]=l>>>8&255,r.check=et(r.check,q,2,0)),l=0,d=0}else r.head&&(r.head.extra=null);r.mode=ZI;case ZI:if(r.flags&1024&&(f=r.length,f>c&&(f=c),f&&(r.head&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(s,s+f),O)),r.flags&512&&r.wrap&4&&(r.check=et(r.check,n,f,s)),c-=f,s+=f,r.length-=f),r.length))break e;r.length=0,r.mode=LI;case LI:if(r.flags&2048){if(c===0)break e;f=0;do O=n[s+f++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O));while(O&&f<c);if(r.flags&512&&r.wrap&4&&(r.check=et(r.check,n,f,s)),c-=f,s+=f,O)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=FI;case FI:if(r.flags&4096){if(c===0)break e;f=0;do O=n[s+f++],r.head&&O&&r.length<65536&&(r.head.comment+=String.fromCharCode(O));while(O&&f<c);if(r.flags&512&&r.wrap&4&&(r.check=et(r.check,n,f,s)),c-=f,s+=f,O)break e}else r.head&&(r.head.comment=null);r.mode=UI;case UI:if(r.flags&512){for(;d<16;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}if(r.wrap&4&&l!==(r.check&65535)){t.msg="header crc mismatch",r.mode=qe;break}l=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=En;break;case qI:for(;d<32;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}t.adler=r.check=rC(l),l=0,d=0,r.mode=Tp;case Tp:if(r.havedict===0)return t.next_out=i,t.avail_out=u,t.next_in=s,t.avail_in=c,r.hold=l,r.bits=d,o5;t.adler=r.check=1,r.mode=En;case En:if(e===r5||e===wp)break e;case $_:if(r.last){l>>>=d&7,d-=d&7,r.mode=N_;break}for(;d<3;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}switch(r.last=l&1,l>>>=1,d-=1,l&3){case 0:r.mode=VI;break;case 1:if(p5(r),r.mode=kp,e===wp){l>>>=2,d-=2;break e}break;case 2:r.mode=BI;break;case 3:t.msg="invalid block type",r.mode=qe}l>>>=2,d-=2;break;case VI:for(l>>>=d&7,d-=d&7;d<32;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}if((l&65535)!==(l>>>16^65535)){t.msg="invalid stored block lengths",r.mode=qe;break}if(r.length=l&65535,l=0,d=0,r.mode=E_,e===wp)break e;case E_:r.mode=HI;case HI:if(f=r.length,f){if(f>c&&(f=c),f>u&&(f=u),f===0)break e;o.set(n.subarray(s,s+f),i),c-=f,s+=f,u-=f,i+=f,r.length-=f;break}r.mode=En;break;case BI:for(;d<14;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}if(r.nlen=(l&31)+257,l>>>=5,d-=5,r.ndist=(l&31)+1,l>>>=5,d-=5,r.ncode=(l&15)+4,l>>>=4,d-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=qe;break}r.have=0,r.mode=GI;case GI:for(;r.have<r.ncode;){for(;d<3;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}r.lens[ae[r.have++]]=l&7,l>>>=3,d-=3}for(;r.have<19;)r.lens[ae[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,C={bits:r.lenbits},B=Uc(t5,r.lens,0,19,r.lencode,0,r.work,C),r.lenbits=C.bits,B){t.msg="invalid code lengths set",r.mode=qe;break}r.have=0,r.mode=JI;case JI:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[l&(1<<r.lenbits)-1],x=y>>>24,k=y>>>16&255,w=y&65535,!(x<=d);){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}if(w<16)l>>>=x,d-=x,r.lens[r.have++]=w;else{if(w===16){for(K=x+2;d<K;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}if(l>>>=x,d-=x,r.have===0){t.msg="invalid bit length repeat",r.mode=qe;break}O=r.lens[r.have-1],f=3+(l&3),l>>>=2,d-=2}else if(w===17){for(K=x+3;d<K;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}l>>>=x,d-=x,O=0,f=3+(l&7),l>>>=3,d-=3}else{for(K=x+7;d<K;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}l>>>=x,d-=x,O=0,f=11+(l&127),l>>>=7,d-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=qe;break}for(;f--;)r.lens[r.have++]=O}}if(r.mode===qe)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=qe;break}if(r.lenbits=9,C={bits:r.lenbits},B=Uc(OC,r.lens,0,r.nlen,r.lencode,0,r.work,C),r.lenbits=C.bits,B){t.msg="invalid literal/lengths set",r.mode=qe;break}if(r.distbits=6,r.distcode=r.distdyn,C={bits:r.distbits},B=Uc(PC,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,C),r.distbits=C.bits,B){t.msg="invalid distances set",r.mode=qe;break}if(r.mode=kp,e===wp)break e;case kp:r.mode=Sp;case Sp:if(c>=6&&u>=258){t.next_out=i,t.avail_out=u,t.next_in=s,t.avail_in=c,r.hold=l,r.bits=d,WV(t,h),i=t.next_out,o=t.output,u=t.avail_out,s=t.next_in,n=t.input,c=t.avail_in,l=r.hold,d=r.bits,r.mode===En&&(r.back=-1);break}for(r.back=0;y=r.lencode[l&(1<<r.lenbits)-1],x=y>>>24,k=y>>>16&255,w=y&65535,!(x<=d);){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}if(k&&!(k&240)){for(b=x,E=k,A=w;y=r.lencode[A+((l&(1<<b+E)-1)>>b)],x=y>>>24,k=y>>>16&255,w=y&65535,!(b+x<=d);){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}l>>>=b,d-=b,r.back+=b}if(l>>>=x,d-=x,r.back+=x,r.length=w,k===0){r.mode=QI;break}if(k&32){r.back=-1,r.mode=En;break}if(k&64){t.msg="invalid literal/length code",r.mode=qe;break}r.extra=k&15,r.mode=WI;case WI:if(r.extra){for(K=r.extra;d<K;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=KI;case KI:for(;y=r.distcode[l&(1<<r.distbits)-1],x=y>>>24,k=y>>>16&255,w=y&65535,!(x<=d);){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}if(!(k&240)){for(b=x,E=k,A=w;y=r.distcode[A+((l&(1<<b+E)-1)>>b)],x=y>>>24,k=y>>>16&255,w=y&65535,!(b+x<=d);){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}l>>>=b,d-=b,r.back+=b}if(l>>>=x,d-=x,r.back+=x,k&64){t.msg="invalid distance code",r.mode=qe;break}r.offset=w,r.extra=k&15,r.mode=YI;case YI:if(r.extra){for(K=r.extra;d<K;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=qe;break}r.mode=XI;case XI:if(u===0)break e;if(f=h-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=qe;break}f>r.wnext?(f-=r.wnext,g=r.wsize-f):g=r.wnext-f,f>r.length&&(f=r.length),v=r.window}else v=o,g=i-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do o[i++]=v[g++];while(--f);r.length===0&&(r.mode=Sp);break;case QI:if(u===0)break e;o[i++]=r.length,u--,r.mode=Sp;break;case N_:if(r.wrap){for(;d<32;){if(c===0)break e;c--,l|=n[s++]<<d,d+=8}if(h-=u,t.total_out+=h,r.total+=h,r.wrap&4&&h&&(t.adler=r.check=r.flags?et(r.check,o,h,i-h):Gc(r.check,o,h,i-h)),h=u,r.wrap&4&&(r.flags?l:rC(l))!==r.check){t.msg="incorrect data check",r.mode=qe;break}l=0,d=0}r.mode=eC;case eC:if(r.wrap&&r.flags){for(;d<32;){if(c===0)break e;c--,l+=n[s++]<<d,d+=8}if(r.wrap&4&&l!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=qe;break}l=0,d=0}r.mode=tC;case tC:B=n5;break e;case qe:B=IC;break e;case RC:return CC;case AC:default:return pr}return t.next_out=i,t.avail_out=u,t.next_in=s,t.avail_in=c,r.hold=l,r.bits=d,(r.wsize||h!==t.avail_out&&r.mode<qe&&(r.mode<N_||e!==CI))&&LC(t,t.output,t.next_out,h-t.avail_out),m-=t.avail_in,h-=t.avail_out,t.total_in+=m,t.total_out+=h,r.total+=h,r.wrap&4&&h&&(t.adler=r.check=r.flags?et(r.check,o,h,t.next_out-h):Gc(r.check,o,h,t.next_out-h)),t.data_type=r.bits+(r.last?64:0)+(r.mode===En?128:0)+(r.mode===kp||r.mode===E_?256:0),(m===0&&h===0||e===CI)&&B===cs&&(B=s5),B},"inflate$2"),m5=a(t=>{if(ls(t))return pr;let e=t.state;return e.window&&(e.window=null),t.state=null,cs},"inflateEnd"),h5=a((t,e)=>{if(ls(t))return pr;let r=t.state;return r.wrap&2?(r.head=e,e.done=!1,cs):pr},"inflateGetHeader"),g5=a((t,e)=>{let r=e.length,n,o,s;return ls(t)||(n=t.state,n.wrap!==0&&n.mode!==Tp)?pr:n.mode===Tp&&(o=1,o=Gc(o,e,r,0),o!==n.check)?IC:(s=LC(t,e,r,r),s?(n.mode=RC,CC):(n.havedict=1,cs))},"inflateSetDictionary"),y5=MC,_5=DC,x5=jC,v5=d5,b5=ZC,w5=f5,k5=m5,S5=h5,$5=g5,E5="pako inflate (from Nodeca project)",Br={inflateReset:y5,inflateReset2:_5,inflateResetKeep:x5,inflateInit:v5,inflateInit2:b5,inflate:w5,inflateEnd:k5,inflateGetHeader:S5,inflateSetDictionary:$5,inflateInfo:E5};function N5(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}a(N5,"GZheader");var T5=N5,FC=Object.prototype.toString,{Z_NO_FLUSH:z5,Z_FINISH:oC,Z_OK:Pa,Z_STREAM_END:O_,Z_NEED_DICT:P_,Z_STREAM_ERROR:O5,Z_DATA_ERROR:sC,Z_MEM_ERROR:P5,Z_BUF_ERROR:aC}=us,I5={chunkSize:1024*64,windowBits:15,to:""};function Qc(t){this.options=Op.assign({},I5,t||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new TC,this.strm.avail_out=0;let r=Br.inflateInit2(this.strm,e.windowBits);if(r!==Pa)throw new Error(ss[r]);if(this.header=new T5,Br.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Wc.string2buf(e.dictionary):FC.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Br.inflateSetDictionary(this.strm,e.dictionary),r!==Pa)))throw new Error(ss[r])}a(Qc,"Inflate$1");Qc.prototype.push=function(t,e){let r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,s,i,c;if(this.ended)return!1;for(e===~~e?i=e:i=e===!0?oC:z5,FC.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),s=Br.inflate(r,i),s===P_&&o&&(s=Br.inflateSetDictionary(r,o),s===Pa?s=Br.inflate(r,i):s===sC&&(s=P_));r.avail_in>0&&s===O_&&r.state.wrap&2&&r.state.flags!==0&&r.input[r.next_in]!==0;)Br.inflateReset(r),s=Br.inflate(r,i);switch(s){case O5:case sC:case P_:case P5:return this.onEnd(s),this.ended=!0,!1}if(c=r.avail_out,r.next_out&&(r.avail_out===0||s===O_||i>0))if(this.options.to==="string"){let u=Wc.utf8border(r.output,r.next_out),l=r.next_out-u,d=Wc.buf2string(r.output,u);r.next_out=l,r.avail_out=n-l,l&&r.output.set(r.output.subarray(u,u+l),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out)),r.avail_out=0,r.next_out=0;if(!((s===Pa||s===aC)&&c===0)){if(s===O_)return s=Br.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(r.avail_in===0){if(i===oC)return s=Br.inflateEnd(this.strm),this.onEnd(s===Pa?aC:s),this.ended=!0,!1;break}}}return!0};Qc.prototype.onData=function(t){this.chunks.push(t)};Qc.prototype.onEnd=function(t){t===Pa&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Op.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function J_(t,e){let r=new Qc(e);if(r.push(t,!0),r.err)throw r.msg||ss[r.err];return r.result}a(J_,"inflate$1");function C5(t,e){return e=e||{},e.raw=!0,J_(t,e)}a(C5,"inflateRaw$1");var R5=Qc,A5=J_,j5=C5,M5=J_,D5=us,Z5={Inflate:R5,inflate:A5,inflateRaw:j5,ungzip:M5,constants:D5},{Deflate:L5,deflate:F5,deflateRaw:U5,gzip:q5}=GV,{Inflate:V5,inflate:H5,inflateRaw:B5,ungzip:G5}=Z5,J5=L5,W5=F5,K5=U5,Y5=q5,X5=V5,Q5=H5,eH=B5,tH=G5,rH=us,UC={Deflate:J5,deflate:W5,deflateRaw:K5,gzip:Y5,Inflate:X5,inflate:Q5,inflateRaw:eH,ungzip:tH,constants:rH};function nH(t){let e="";for(let n=0;n<t.length;n+=32768){let o=t.subarray(n,n+32768);e+=String.fromCharCode(...o)}return e}a(nH,"bytesToBinaryString");function oH(t){let e={...t};e.basePath&&(e.basePath=new URL(e.basePath).toString());let r=Object.keys(e).sort(),n={};for(let o of r)n[o]=e[o];return n}a(oH,"canonicalizeView");function qC(t){let e=oH(t),r=JSON.stringify(e),n=UC.deflate(r),o=nH(n);return btoa(o).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}a(qC,"encodeId");async function sx(t={},e={}){try{console.log(`
204
+ \u{1F3A8} Starting Jucie design mode...
205
+ `);let r=t.config||process.env.JUCIE_CONFIG||"jucie.config.js",n=await Xo(r);e.verbose&&(console.log("Config file path:",r),console.log("Configuration:",n),console.log(""));let{createDesignServer:o}=await Promise.resolve().then(()=>(uA(),cA)),s=_B(xB(bB(import.meta.url)),"stage-bundles"),i=await o({...n,view:"design",mode:"design",stageBundles:vB(s)?s:void 0});if(i){let c=qC(i),u=process.env._JUCIE_STUDIO_URL||n._studioUrl||"https://studio.jucie.app",l=process.env.JUCIE_ELECTRON_APP;if(l){let d=yB(process.env.INIT_CWD||process.cwd(),l);setTimeout(()=>Ic(`-a "${d}" jucie://navigate/${c}`),5e3)}else process.env.JUCIE_ELECTRON?setTimeout(()=>Ic(`jucie://navigate/${c}`),5e3):Ic(`${u}/${c}`);console.log(`\u2728 Design server started on port ${n.port}`),console.log(`\u{1F3A8} Opening Studio at jucie://navigate/${c}
206
+ `)}return i}catch(r){console.error(`
207
+ \u274C Design mode failed: ${r.message}
208
+ `),e.verbose&&console.error(r.stack),process.exit(1)}}a(sx,"designCommand");var ge;(function(t){t.assertEqual=o=>{};function e(o){}a(e,"assertIs"),t.assertIs=e;function r(o){throw new Error}a(r,"assertNever"),t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(c=>typeof o[o[c]]!="number"),i={};for(let c of s)i[c]=o[c];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}a(n,"joinValues"),t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ge||(ge={}));var lA;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(lA||(lA={}));var F=ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),In=a(t=>{switch(typeof t){case"undefined":return F.undefined;case"string":return F.string;case"number":return Number.isNaN(t)?F.nan:F.number;case"boolean":return F.boolean;case"function":return F.function;case"bigint":return F.bigint;case"symbol":return F.symbol;case"object":return Array.isArray(t)?F.array:t===null?F.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?F.promise:typeof Map<"u"&&t instanceof Map?F.map:typeof Set<"u"&&t instanceof Set?F.set:typeof Date<"u"&&t instanceof Date?F.date:F.object;default:return F.unknown}},"getParsedType");var z=ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var Hp=class Hp extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let c=n,u=0;for(;u<i.path.length;){let l=i.path[u];u===i.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(r(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}},"processError");return o(this),n}static assert(e){if(!(e instanceof Hp))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r=Object.create(null),n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};a(Hp,"ZodError");var Bt=Hp;Bt.create=t=>new Bt(t);var wB=a((t,e)=>{let r;switch(t.code){case z.invalid_type:t.received===F.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ge.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:r=`Unrecognized key(s) in object: ${ge.joinValues(t.keys,", ")}`;break;case z.invalid_union:r="Invalid input";break;case z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ge.joinValues(t.options)}`;break;case z.invalid_enum_value:r=`Invalid enum value. Expected ${ge.joinValues(t.options)}, received '${t.received}'`;break;case z.invalid_arguments:r="Invalid function arguments";break;case z.invalid_return_type:r="Invalid function return type";break;case z.invalid_date:r="Invalid date";break;case z.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ge.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case z.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case z.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case z.custom:r="Invalid input";break;case z.invalid_intersection_types:r="Intersection results could not be merged";break;case z.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case z.not_finite:r="Number must be finite";break;default:r=e.defaultError,ge.assertNever(t)}return{message:r}},"errorMap"),po=wB;var kB=po;function iu(){return kB}a(iu,"getErrorMap");var Gp=a(t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let c="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)c=l(i,{data:e,defaultError:c}).message;return{...o,path:s,message:c}},"makeIssue");function D(t,e){let r=iu(),n=Gp({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===po?void 0:po].filter(o=>!!o)});t.common.issues.push(n)}a(D,"addIssueToContext");var Bp=class Bp{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return te;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,i=await o.value;n.push({key:s,value:i})}return Bp.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return te;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}};a(Bp,"ParseStatus");var mt=Bp,te=Object.freeze({status:"aborted"}),La=a(t=>({status:"dirty",value:t}),"DIRTY"),wt=a(t=>({status:"valid",value:t}),"OK"),ax=a(t=>t.status==="aborted","isAborted"),ix=a(t=>t.status==="dirty","isDirty"),fs=a(t=>t.status==="valid","isValid"),cu=a(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");var V;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(V||(V={}));var fx=class fx{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};a(fx,"ParseInputLazyPath");var fr=fx,dA=a((t,e)=>{if(fs(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bt(t.common.issues);return this._error=r,this._error}}},"handleResult");function ie(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:a((i,c)=>{let{message:u}=t;return i.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??n??c.defaultError}:i.code!=="invalid_type"?{message:c.defaultError}:{message:u??r??c.defaultError}},"customMap"),description:o}}a(ie,"processCreateParams");var mx=class mx{get description(){return this._def.description}_getType(e){return In(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:In(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new mt,ctx:{common:e.parent.common,data:e.data,parsedType:In(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(cu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:In(e)},o=this._parseSync({data:e,path:n.path,parent:n});return dA(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:In(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return fs(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>fs(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:In(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(cu(o)?o:Promise.resolve(o));return dA(n,s)}refine(e,r){let n=a(o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r,"getIssueProperties");return this._refinement((o,s)=>{let i=e(o),c=a(()=>s.addIssue({code:z.custom,...n(o)}),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(c(),!1)):i?!0:(c(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new Pr({schema:this,typeName:I.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Or.create(this,this._def)}nullable(){return An.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mo.create(this)}promise(){return hs.create(this,this._def)}or(e){return Ga.create([this,e],this._def)}and(e){return Ja.create(this,e,this._def)}transform(e){return new Pr({...ie(this._def),schema:this,typeName:I.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Qa({...ie(this._def),innerType:this,defaultValue:r,typeName:I.ZodDefault})}brand(){return new Jp({typeName:I.ZodBranded,type:this,...ie(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new ei({...ie(this._def),innerType:this,catchValue:r,typeName:I.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Wp.create(this,e)}readonly(){return ti.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};a(mx,"ZodType");var pe=mx,SB=/^c[^\s-]{8,}$/i,$B=/^[0-9a-z]+$/,EB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,NB=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,TB=/^[a-z0-9_-]{21}$/i,zB=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,OB=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,PB=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,IB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",cx,CB=/^(?:(?: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])$/,RB=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,AB=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jB=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,MB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,DB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pA="((\\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])))",ZB=new RegExp(`^${pA}$`);function fA(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}a(fA,"timeRegexSource");function LB(t){return new RegExp(`^${fA(t)}$`)}a(LB,"timeRegex");function FB(t){let e=`${pA}T${fA(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}a(FB,"datetimeRegex");function UB(t,e){return!!((e==="v4"||!e)&&CB.test(t)||(e==="v6"||!e)&&AB.test(t))}a(UB,"isValidIP");function qB(t,e){if(!zB.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}a(qB,"isValidJWT");function VB(t,e){return!!((e==="v4"||!e)&&RB.test(t)||(e==="v6"||!e)&&jB.test(t))}a(VB,"isValidCidr");var ms=class ms extends pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==F.string){let s=this._getOrReturnCtx(e);return D(s,{code:z.invalid_type,expected:F.string,received:s.parsedType}),te}let n=new mt,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:z.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:z.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,c=e.data.length<s.value;(i||c)&&(o=this._getOrReturnCtx(e,o),i?D(o,{code:z.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&D(o,{code:z.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")PB.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"email",code:z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")cx||(cx=new RegExp(IB,"u")),cx.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"emoji",code:z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")NB.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"uuid",code:z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")TB.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"nanoid",code:z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")SB.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"cuid",code:z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")$B.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"cuid2",code:z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")EB.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"ulid",code:z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),D(o,{validation:"url",code:z.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"regex",code:z.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),D(o,{code:z.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),D(o,{code:z.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),D(o,{code:z.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?FB(s).test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{code:z.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?ZB.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{code:z.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?LB(s).test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{code:z.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?OB.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"duration",code:z.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?UB(e.data,s.version)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"ip",code:z.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?qB(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"jwt",code:z.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?VB(e.data,s.version)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"cidr",code:z.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?MB.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"base64",code:z.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?DB.test(e.data)||(o=this._getOrReturnCtx(e,o),D(o,{validation:"base64url",code:z.invalid_string,message:s.message}),n.dirty()):ge.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:z.invalid_string,...V.errToObj(n)})}_addCheck(e){return new ms({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...V.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...V.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...V.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...V.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...V.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...V.errToObj(r)})}nonempty(e){return this.min(1,V.errToObj(e))}trim(){return new ms({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ms({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ms({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};a(ms,"ZodString");var Va=ms;Va.create=t=>new Va({checks:[],typeName:I.ZodString,coerce:t?.coerce??!1,...ie(t)});function HB(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}a(HB,"floatSafeRemainder");var uu=class uu extends pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==F.number){let s=this._getOrReturnCtx(e);return D(s,{code:z.invalid_type,expected:F.number,received:s.parsedType}),te}let n,o=new mt;for(let s of this._def.checks)s.kind==="int"?ge.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),D(n,{code:z.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),D(n,{code:z.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),D(n,{code:z.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?HB(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),D(n,{code:z.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),D(n,{code:z.not_finite,message:s.message}),o.dirty()):ge.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,n,o){return new uu({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:V.toString(o)}]})}_addCheck(e){return new uu({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ge.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};a(uu,"ZodNumber");var mu=uu;mu.create=t=>new mu({checks:[],typeName:I.ZodNumber,coerce:t?.coerce||!1,...ie(t)});var lu=class lu extends pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==F.bigint)return this._getInvalidInput(e);let n,o=new mt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),D(n,{code:z.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),D(n,{code:z.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),D(n,{code:z.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ge.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return D(r,{code:z.invalid_type,expected:F.bigint,received:r.parsedType}),te}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,n,o){return new lu({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:V.toString(o)}]})}_addCheck(e){return new lu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};a(lu,"ZodBigInt");var hu=lu;hu.create=t=>new hu({checks:[],typeName:I.ZodBigInt,coerce:t?.coerce??!1,...ie(t)});var hx=class hx extends pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==F.boolean){let n=this._getOrReturnCtx(e);return D(n,{code:z.invalid_type,expected:F.boolean,received:n.parsedType}),te}return wt(e.data)}};a(hx,"ZodBoolean");var gu=hx;gu.create=t=>new gu({typeName:I.ZodBoolean,coerce:t?.coerce||!1,...ie(t)});var Kp=class Kp extends pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==F.date){let s=this._getOrReturnCtx(e);return D(s,{code:z.invalid_type,expected:F.date,received:s.parsedType}),te}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return D(s,{code:z.invalid_date}),te}let n=new mt,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:z.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),D(o,{code:z.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):ge.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Kp({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:V.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:V.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};a(Kp,"ZodDate");var yu=Kp;yu.create=t=>new yu({checks:[],coerce:t?.coerce||!1,typeName:I.ZodDate,...ie(t)});var gx=class gx extends pe{_parse(e){if(this._getType(e)!==F.symbol){let n=this._getOrReturnCtx(e);return D(n,{code:z.invalid_type,expected:F.symbol,received:n.parsedType}),te}return wt(e.data)}};a(gx,"ZodSymbol");var _u=gx;_u.create=t=>new _u({typeName:I.ZodSymbol,...ie(t)});var yx=class yx extends pe{_parse(e){if(this._getType(e)!==F.undefined){let n=this._getOrReturnCtx(e);return D(n,{code:z.invalid_type,expected:F.undefined,received:n.parsedType}),te}return wt(e.data)}};a(yx,"ZodUndefined");var Ha=yx;Ha.create=t=>new Ha({typeName:I.ZodUndefined,...ie(t)});var _x=class _x extends pe{_parse(e){if(this._getType(e)!==F.null){let n=this._getOrReturnCtx(e);return D(n,{code:z.invalid_type,expected:F.null,received:n.parsedType}),te}return wt(e.data)}};a(_x,"ZodNull");var Ba=_x;Ba.create=t=>new Ba({typeName:I.ZodNull,...ie(t)});var xx=class xx extends pe{constructor(){super(...arguments),this._any=!0}_parse(e){return wt(e.data)}};a(xx,"ZodAny");var xu=xx;xu.create=t=>new xu({typeName:I.ZodAny,...ie(t)});var vx=class vx extends pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wt(e.data)}};a(vx,"ZodUnknown");var fo=vx;fo.create=t=>new fo({typeName:I.ZodUnknown,...ie(t)});var bx=class bx extends pe{_parse(e){let r=this._getOrReturnCtx(e);return D(r,{code:z.invalid_type,expected:F.never,received:r.parsedType}),te}};a(bx,"ZodNever");var Yr=bx;Yr.create=t=>new Yr({typeName:I.ZodNever,...ie(t)});var wx=class wx extends pe{_parse(e){if(this._getType(e)!==F.undefined){let n=this._getOrReturnCtx(e);return D(n,{code:z.invalid_type,expected:F.void,received:n.parsedType}),te}return wt(e.data)}};a(wx,"ZodVoid");var vu=wx;vu.create=t=>new vu({typeName:I.ZodVoid,...ie(t)});var Ua=class Ua extends pe{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==F.array)return D(r,{code:z.invalid_type,expected:F.array,received:r.parsedType}),te;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,c=r.data.length<o.exactLength.value;(i||c)&&(D(r,{code:i?z.too_big:z.too_small,minimum:c?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(D(r,{code:z.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(D(r,{code:z.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,c)=>o.type._parseAsync(new fr(r,i,r.path,c)))).then(i=>mt.mergeArray(n,i));let s=[...r.data].map((i,c)=>o.type._parseSync(new fr(r,i,r.path,c)));return mt.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Ua({...this._def,minLength:{value:e,message:V.toString(r)}})}max(e,r){return new Ua({...this._def,maxLength:{value:e,message:V.toString(r)}})}length(e,r){return new Ua({...this._def,exactLength:{value:e,message:V.toString(r)}})}nonempty(e){return this.min(1,e)}};a(Ua,"ZodArray");var mo=Ua;mo.create=(t,e)=>new mo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:I.ZodArray,...ie(e)});function Fa(t){if(t instanceof Jt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=Or.create(Fa(n))}return new Jt({...t._def,shape:()=>e})}else return t instanceof mo?new mo({...t._def,type:Fa(t.element)}):t instanceof Or?Or.create(Fa(t.unwrap())):t instanceof An?An.create(Fa(t.unwrap())):t instanceof Rn?Rn.create(t.items.map(e=>Fa(e))):t}a(Fa,"deepPartialify");var Gt=class Gt extends pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ge.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==F.object){let l=this._getOrReturnCtx(e);return D(l,{code:z.invalid_type,expected:F.object,received:l.parsedType}),te}let{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),c=[];if(!(this._def.catchall instanceof Yr&&this._def.unknownKeys==="strip"))for(let l in o.data)i.includes(l)||c.push(l);let u=[];for(let l of i){let d=s[l],m=o.data[l];u.push({key:{status:"valid",value:l},value:d._parse(new fr(o,m,o.path,l)),alwaysSet:l in o.data})}if(this._def.catchall instanceof Yr){let l=this._def.unknownKeys;if(l==="passthrough")for(let d of c)u.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(l==="strict")c.length>0&&(D(o,{code:z.unrecognized_keys,keys:c}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let d of c){let m=o.data[d];u.push({key:{status:"valid",value:d},value:l._parse(new fr(o,m,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let l=[];for(let d of u){let m=await d.key,h=await d.value;l.push({key:m,value:h,alwaysSet:d.alwaysSet})}return l}).then(l=>mt.mergeObjectSync(n,l)):mt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new Gt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:V.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new Gt({...this._def,unknownKeys:"strip"})}passthrough(){return new Gt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Gt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Gt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:I.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Gt({...this._def,catchall:e})}pick(e){let r={};for(let n of ge.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Gt({...this._def,shape:()=>r})}omit(e){let r={};for(let n of ge.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new Gt({...this._def,shape:()=>r})}deepPartial(){return Fa(this)}partial(e){let r={};for(let n of ge.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new Gt({...this._def,shape:()=>r})}required(e){let r={};for(let n of ge.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Or;)s=s._def.innerType;r[n]=s}return new Gt({...this._def,shape:()=>r})}keyof(){return mA(ge.objectKeys(this.shape))}};a(Gt,"ZodObject");var Jt=Gt;Jt.create=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strip",catchall:Yr.create(),typeName:I.ZodObject,...ie(e)});Jt.strictCreate=(t,e)=>new Jt({shape:()=>t,unknownKeys:"strict",catchall:Yr.create(),typeName:I.ZodObject,...ie(e)});Jt.lazycreate=(t,e)=>new Jt({shape:t,unknownKeys:"strip",catchall:Yr.create(),typeName:I.ZodObject,...ie(e)});var kx=class kx extends pe{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let i=s.map(c=>new Bt(c.ctx.common.issues));return D(r,{code:z.invalid_union,unionErrors:i}),te}if(a(o,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},d=u._parseSync({data:r.data,path:r.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let c=i.map(u=>new Bt(u));return D(r,{code:z.invalid_union,unionErrors:c}),te}}get options(){return this._def.options}};a(kx,"ZodUnion");var Ga=kx;Ga.create=(t,e)=>new Ga({options:t,typeName:I.ZodUnion,...ie(e)});var Cn=a(t=>t instanceof Wa?Cn(t.schema):t instanceof Pr?Cn(t.innerType()):t instanceof Ka?[t.value]:t instanceof Ya?t.options:t instanceof Xa?ge.objectValues(t.enum):t instanceof Qa?Cn(t._def.innerType):t instanceof Ha?[void 0]:t instanceof Ba?[null]:t instanceof Or?[void 0,...Cn(t.unwrap())]:t instanceof An?[null,...Cn(t.unwrap())]:t instanceof Jp||t instanceof ti?Cn(t.unwrap()):t instanceof ei?Cn(t._def.innerType):[],"getDiscriminator"),Yp=class Yp extends pe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==F.object)return D(r,{code:z.invalid_type,expected:F.object,received:r.parsedType}),te;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(D(r,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),te)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let i=Cn(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of i){if(o.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);o.set(c,s)}}return new Yp({typeName:I.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...ie(n)})}};a(Yp,"ZodDiscriminatedUnion");var ux=Yp;function lx(t,e){let r=In(t),n=In(e);if(t===e)return{valid:!0,data:t};if(r===F.object&&n===F.object){let o=ge.objectKeys(e),s=ge.objectKeys(t).filter(c=>o.indexOf(c)!==-1),i={...t,...e};for(let c of s){let u=lx(t[c],e[c]);if(!u.valid)return{valid:!1};i[c]=u.data}return{valid:!0,data:i}}else if(r===F.array&&n===F.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],c=e[s],u=lx(i,c);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return r===F.date&&n===F.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}a(lx,"mergeValues");var Sx=class Sx extends pe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,i)=>{if(ax(s)||ax(i))return te;let c=lx(s.value,i.value);return c.valid?((ix(s)||ix(i))&&r.dirty(),{status:r.value,value:c.data}):(D(n,{code:z.invalid_intersection_types}),te)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};a(Sx,"ZodIntersection");var Ja=Sx;Ja.create=(t,e,r)=>new Ja({left:t,right:e,typeName:I.ZodIntersection,...ie(r)});var Xp=class Xp extends pe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.array)return D(n,{code:z.invalid_type,expected:F.array,received:n.parsedType}),te;if(n.data.length<this._def.items.length)return D(n,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),te;!this._def.rest&&n.data.length>this._def.items.length&&(D(n,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new fr(n,i,n.path,c)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>mt.mergeArray(r,i)):mt.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Xp({...this._def,rest:e})}};a(Xp,"ZodTuple");var Rn=Xp;Rn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rn({items:t,typeName:I.ZodTuple,rest:null,...ie(e)})};var du=class du extends pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.object)return D(n,{code:z.invalid_type,expected:F.object,received:n.parsedType}),te;let o=[],s=this._def.keyType,i=this._def.valueType;for(let c in n.data)o.push({key:s._parse(new fr(n,c,n.path,c)),value:i._parse(new fr(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?mt.mergeObjectAsync(r,o):mt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof pe?new du({keyType:e,valueType:r,typeName:I.ZodRecord,...ie(n)}):new du({keyType:Va.create(),valueType:e,typeName:I.ZodRecord,...ie(r)})}};a(du,"ZodRecord");var dx=du,$x=class $x extends pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.map)return D(n,{code:z.invalid_type,expected:F.map,received:n.parsedType}),te;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([c,u],l)=>({key:o._parse(new fr(n,c,n.path,[l,"key"])),value:s._parse(new fr(n,u,n.path,[l,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of i){let l=await u.key,d=await u.value;if(l.status==="aborted"||d.status==="aborted")return te;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),c.set(l.value,d.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let u of i){let l=u.key,d=u.value;if(l.status==="aborted"||d.status==="aborted")return te;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),c.set(l.value,d.value)}return{status:r.value,value:c}}}};a($x,"ZodMap");var bu=$x;bu.create=(t,e,r)=>new bu({valueType:e,keyType:t,typeName:I.ZodMap,...ie(r)});var pu=class pu extends pe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.set)return D(n,{code:z.invalid_type,expected:F.set,received:n.parsedType}),te;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(D(n,{code:z.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(D(n,{code:z.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function i(u){let l=new Set;for(let d of u){if(d.status==="aborted")return te;d.status==="dirty"&&r.dirty(),l.add(d.value)}return{status:r.value,value:l}}a(i,"finalizeSet");let c=[...n.data.values()].map((u,l)=>s._parse(new fr(n,u,n.path,l)));return n.common.async?Promise.all(c).then(u=>i(u)):i(c)}min(e,r){return new pu({...this._def,minSize:{value:e,message:V.toString(r)}})}max(e,r){return new pu({...this._def,maxSize:{value:e,message:V.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};a(pu,"ZodSet");var wu=pu;wu.create=(t,e)=>new wu({valueType:t,minSize:null,maxSize:null,typeName:I.ZodSet,...ie(e)});var qa=class qa extends pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==F.function)return D(r,{code:z.invalid_type,expected:F.function,received:r.parsedType}),te;function n(c,u){return Gp({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,iu(),po].filter(l=>!!l),issueData:{code:z.invalid_arguments,argumentsError:u}})}a(n,"makeArgsIssue");function o(c,u){return Gp({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,iu(),po].filter(l=>!!l),issueData:{code:z.invalid_return_type,returnTypeError:u}})}a(o,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof hs){let c=this;return wt(async function(...u){let l=new Bt([]),d=await c._def.args.parseAsync(u,s).catch(f=>{throw l.addIssue(n(u,f)),l}),m=await Reflect.apply(i,this,d);return await c._def.returns._def.type.parseAsync(m,s).catch(f=>{throw l.addIssue(o(m,f)),l})})}else{let c=this;return wt(function(...u){let l=c._def.args.safeParse(u,s);if(!l.success)throw new Bt([n(u,l.error)]);let d=Reflect.apply(i,this,l.data),m=c._def.returns.safeParse(d,s);if(!m.success)throw new Bt([o(d,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new qa({...this._def,args:Rn.create(e).rest(fo.create())})}returns(e){return new qa({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new qa({args:e||Rn.create([]).rest(fo.create()),returns:r||fo.create(),typeName:I.ZodFunction,...ie(n)})}};a(qa,"ZodFunction");var px=qa,Ex=class Ex extends pe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};a(Ex,"ZodLazy");var Wa=Ex;Wa.create=(t,e)=>new Wa({getter:t,typeName:I.ZodLazy,...ie(e)});var Nx=class Nx extends pe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return D(r,{received:r.data,code:z.invalid_literal,expected:this._def.value}),te}return{status:"valid",value:e.data}}get value(){return this._def.value}};a(Nx,"ZodLiteral");var Ka=Nx;Ka.create=(t,e)=>new Ka({value:t,typeName:I.ZodLiteral,...ie(e)});function mA(t,e){return new Ya({values:t,typeName:I.ZodEnum,...ie(e)})}a(mA,"createZodEnum");var fu=class fu extends pe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return D(r,{expected:ge.joinValues(n),received:r.parsedType,code:z.invalid_type}),te}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return D(r,{received:r.data,code:z.invalid_enum_value,options:n}),te}return wt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return fu.create(e,{...this._def,...r})}exclude(e,r=this._def){return fu.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};a(fu,"ZodEnum");var Ya=fu;Ya.create=mA;var Tx=class Tx extends pe{_parse(e){let r=ge.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==F.string&&n.parsedType!==F.number){let o=ge.objectValues(r);return D(n,{expected:ge.joinValues(o),received:n.parsedType,code:z.invalid_type}),te}if(this._cache||(this._cache=new Set(ge.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=ge.objectValues(r);return D(n,{received:n.data,code:z.invalid_enum_value,options:o}),te}return wt(e.data)}get enum(){return this._def.values}};a(Tx,"ZodNativeEnum");var Xa=Tx;Xa.create=(t,e)=>new Xa({values:t,typeName:I.ZodNativeEnum,...ie(e)});var zx=class zx extends pe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==F.promise&&r.common.async===!1)return D(r,{code:z.invalid_type,expected:F.promise,received:r.parsedType}),te;let n=r.parsedType===F.promise?r.data:Promise.resolve(r.data);return wt(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};a(zx,"ZodPromise");var hs=zx;hs.create=(t,e)=>new hs({type:t,typeName:I.ZodPromise,...ie(e)});var Ox=class Ox extends pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===I.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{D(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async c=>{if(r.value==="aborted")return te;let u=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return u.status==="aborted"?te:u.status==="dirty"?La(u.value):r.value==="dirty"?La(u.value):u});{if(r.value==="aborted")return te;let c=this._def.schema._parseSync({data:i,path:n.path,parent:n});return c.status==="aborted"?te:c.status==="dirty"?La(c.value):r.value==="dirty"?La(c.value):c}}if(o.type==="refinement"){let i=a(c=>{let u=o.refinement(c,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?te:(c.status==="dirty"&&r.dirty(),i(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?te:(c.status==="dirty"&&r.dirty(),i(c.value).then(()=>({status:r.value,value:c.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!fs(i))return te;let c=o.transform(i.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>fs(i)?Promise.resolve(o.transform(i.value,s)).then(c=>({status:r.value,value:c})):te);ge.assertNever(o)}};a(Ox,"ZodEffects");var Pr=Ox;Pr.create=(t,e,r)=>new Pr({schema:t,typeName:I.ZodEffects,effect:e,...ie(r)});Pr.createWithPreprocess=(t,e,r)=>new Pr({schema:e,effect:{type:"preprocess",transform:t},typeName:I.ZodEffects,...ie(r)});var Px=class Px extends pe{_parse(e){return this._getType(e)===F.undefined?wt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(Px,"ZodOptional");var Or=Px;Or.create=(t,e)=>new Or({innerType:t,typeName:I.ZodOptional,...ie(e)});var Ix=class Ix extends pe{_parse(e){return this._getType(e)===F.null?wt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(Ix,"ZodNullable");var An=Ix;An.create=(t,e)=>new An({innerType:t,typeName:I.ZodNullable,...ie(e)});var Cx=class Cx extends pe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===F.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};a(Cx,"ZodDefault");var Qa=Cx;Qa.create=(t,e)=>new Qa({innerType:t,typeName:I.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ie(e)});var Rx=class Rx extends pe{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return cu(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};a(Rx,"ZodCatch");var ei=Rx;ei.create=(t,e)=>new ei({innerType:t,typeName:I.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ie(e)});var Ax=class Ax extends pe{_parse(e){if(this._getType(e)!==F.nan){let n=this._getOrReturnCtx(e);return D(n,{code:z.invalid_type,expected:F.nan,received:n.parsedType}),te}return{status:"valid",value:e.data}}};a(Ax,"ZodNaN");var ku=Ax;ku.create=t=>new ku({typeName:I.ZodNaN,...ie(t)});var GPe=Symbol("zod_brand"),jx=class jx extends pe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};a(jx,"ZodBranded");var Jp=jx,Qp=class Qp extends pe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return a(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?te:s.status==="dirty"?(r.dirty(),La(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?te:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new Qp({in:e,out:r,typeName:I.ZodPipeline})}};a(Qp,"ZodPipeline");var Wp=Qp,Mx=class Mx extends pe{_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(fs(o)&&(o.value=Object.freeze(o.value)),o),"freeze");return cu(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};a(Mx,"ZodReadonly");var ti=Mx;ti.create=(t,e)=>new ti({innerType:t,typeName:I.ZodReadonly,...ie(e)});var JPe={object:Jt.lazycreate},I;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(I||(I={}));var WPe=Va.create,KPe=mu.create,YPe=ku.create,XPe=hu.create,QPe=gu.create,eIe=yu.create,tIe=_u.create,rIe=Ha.create,nIe=Ba.create,oIe=xu.create,sIe=fo.create,aIe=Yr.create,iIe=vu.create,cIe=mo.create,hA=Jt.create,uIe=Jt.strictCreate,lIe=Ga.create,dIe=ux.create,pIe=Ja.create,fIe=Rn.create,mIe=dx.create,hIe=bu.create,gIe=wu.create,yIe=px.create,_Ie=Wa.create,xIe=Ka.create,vIe=Ya.create,bIe=Xa.create,wIe=hs.create,kIe=Pr.create,SIe=Or.create,$Ie=An.create,EIe=Pr.createWithPreprocess,NIe=Wp.create;var gA;function $(t,e,r){function n(u,l){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:l,constr:i,traits:new Set},enumerable:!1}),u._zod.traits.has(t))return;u._zod.traits.add(t),e(u,l);let d=i.prototype,m=Object.keys(d);for(let h=0;h<m.length;h++){let f=m[h];f in u||(u[f]=d[f].bind(u))}}a(n,"init");let o=r?.Parent??Object,c=class c extends o{};a(c,"Definition");let s=c;Object.defineProperty(s,"name",{value:t});function i(u){var l;let d=r?.Parent?new s:this;n(d,u),(l=d._zod).deferred??(l.deferred=[]);for(let m of d._zod.deferred)m();return d}return a(i,"_"),Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:u=>r?.Parent&&u instanceof r.Parent?!0:u?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}a($,"$constructor");var OIe=Symbol("zod_brand"),Zx=class Zx extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};a(Zx,"$ZodAsyncError");var Xr=Zx,Lx=class Lx extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};a(Lx,"$ZodEncodeError");var ri=Lx;(gA=globalThis).__zod_globalConfig??(gA.__zod_globalConfig={});var ni=globalThis.__zod_globalConfig;function Wt(t){return t&&Object.assign(ni,t),ni}a(Wt,"config");var ye={};R(ye,{BIGINT_FORMAT_RANGES:()=>xA,Class:()=>Fx,NUMBER_FORMAT_RANGES:()=>Jx,aborted:()=>yo,allowsEval:()=>Vx,assert:()=>KB,assertEqual:()=>BB,assertIs:()=>JB,assertNever:()=>WB,assertNotEqual:()=>GB,assignProp:()=>ho,base64ToUint8Array:()=>NA,base64urlToUint8Array:()=>i8,cached:()=>si,captureStackTrace:()=>rf,cleanEnum:()=>a8,cleanRegex:()=>Nu,clone:()=>Kt,cloneDef:()=>XB,createTransparentProxy:()=>o8,defineLazy:()=>$e,esc:()=>tf,escapeRegex:()=>Mn,explicitlyAborted:()=>Wx,extend:()=>wA,finalizeIssue:()=>mr,floatSafeRemainder:()=>Ux,getElementAtPath:()=>QB,getEnumValues:()=>$u,getLengthableOrigin:()=>Tu,getParsedType:()=>n8,getSizableOrigin:()=>EA,hexToUint8Array:()=>u8,isObject:()=>gs,isPlainObject:()=>go,issue:()=>ai,joinValues:()=>ef,jsonStringifyReplacer:()=>oi,merge:()=>s8,mergeDefs:()=>jn,normalizeParams:()=>Q,nullish:()=>Eu,numKeys:()=>r8,objectClone:()=>YB,omit:()=>bA,optionalKeys:()=>Gx,parsedType:()=>Kx,partial:()=>SA,pick:()=>vA,prefixIssues:()=>Dn,primitiveTypes:()=>_A,promiseAllObject:()=>e8,propertyKeyTypes:()=>Bx,randomString:()=>t8,required:()=>$A,safeExtend:()=>kA,shallowClone:()=>Hx,slugify:()=>qx,stringifyPrimitive:()=>nf,uint8ArrayToBase64:()=>TA,uint8ArrayToBase64url:()=>c8,uint8ArrayToHex:()=>l8,unwrapMessage:()=>Su});function BB(t){return t}a(BB,"assertEqual");function GB(t){return t}a(GB,"assertNotEqual");function JB(t){}a(JB,"assertIs");function WB(t){throw new Error("Unexpected value in exhaustive check")}a(WB,"assertNever");function KB(t){}a(KB,"assert");function $u(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}a($u,"getEnumValues");function ef(t,e="|"){return t.map(r=>nf(r)).join(e)}a(ef,"joinValues");function oi(t,e){return typeof e=="bigint"?e.toString():e}a(oi,"jsonStringifyReplacer");function si(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(si,"cached");function Eu(t){return t==null}a(Eu,"nullish");function Nu(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(Nu,"cleanRegex");function Ux(t,e){let r=t/e,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}a(Ux,"floatSafeRemainder");var yA=Symbol("evaluating");function $e(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==yA)return n===void 0&&(n=yA,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}a($e,"defineLazy");function YB(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}a(YB,"objectClone");function ho(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(ho,"assignProp");function jn(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}a(jn,"mergeDefs");function XB(t){return jn(t._zod.def)}a(XB,"cloneDef");function QB(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(QB,"getElementAtPath");function e8(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<e.length;s++)o[e[s]]=n[s];return o})}a(e8,"promiseAllObject");function t8(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}a(t8,"randomString");function tf(t){return JSON.stringify(t)}a(tf,"esc");function qx(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}a(qx,"slugify");var rf="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function gs(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(gs,"isObject");var Vx=si(()=>{if(ni.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function go(t){if(gs(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(gs(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(go,"isPlainObject");function Hx(t){return go(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}a(Hx,"shallowClone");function r8(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(r8,"numKeys");var n8=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},"getParsedType"),Bx=new Set(["string","number","symbol"]),_A=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Mn(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Mn,"escapeRegex");function Kt(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(Kt,"clone");function Q(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}a(Q,"normalizeParams");function o8(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}a(o8,"createTransparentProxy");function nf(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(nf,"stringifyPrimitive");function Gx(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(Gx,"optionalKeys");var Jx={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},xA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function vA(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=jn(t._zod.def,{get shape(){let i={};for(let c in e){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);e[c]&&(i[c]=r.shape[c])}return ho(this,"shape",i),i},checks:[]});return Kt(t,s)}a(vA,"pick");function bA(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=jn(t._zod.def,{get shape(){let i={...t._zod.def.shape};for(let c in e){if(!(c in r.shape))throw new Error(`Unrecognized key: "${c}"`);e[c]&&delete i[c]}return ho(this,"shape",i),i},checks:[]});return Kt(t,s)}a(bA,"omit");function wA(t,e){if(!go(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let i in e)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=jn(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return ho(this,"shape",s),s}});return Kt(t,o)}a(wA,"extend");function kA(t,e){if(!go(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=jn(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return ho(this,"shape",n),n}});return Kt(t,r)}a(kA,"safeExtend");function s8(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=jn(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return ho(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Kt(t,r)}a(s8,"merge");function SA(t,e,r){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=jn(e._zod.def,{get shape(){let c=e._zod.def.shape,u={...c};if(r)for(let l in r){if(!(l in c))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(u[l]=t?new t({type:"optional",innerType:c[l]}):c[l])}else for(let l in c)u[l]=t?new t({type:"optional",innerType:c[l]}):c[l];return ho(this,"shape",u),u},checks:[]});return Kt(e,i)}a(SA,"partial");function $A(t,e,r){let n=jn(e._zod.def,{get shape(){let o=e._zod.def.shape,s={...o};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new t({type:"nonoptional",innerType:o[i]}))}else for(let i in o)s[i]=new t({type:"nonoptional",innerType:o[i]});return ho(this,"shape",s),s}});return Kt(e,n)}a($A,"required");function yo(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}a(yo,"aborted");function Wx(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}a(Wx,"explicitlyAborted");function Dn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(Dn,"prefixIssues");function Su(t){return typeof t=="string"?t:t?.message}a(Su,"unwrapMessage");function mr(t,e,r){let n=t.message?t.message:Su(t.inst?._zod.def?.error?.(t))??Su(e?.error?.(t))??Su(r.customError?.(t))??Su(r.localeError?.(t))??"Invalid input",{inst:o,continue:s,input:i,...c}=t;return c.path??(c.path=[]),c.message=n,e?.reportInput&&(c.input=i),c}a(mr,"finalizeIssue");function EA(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(EA,"getSizableOrigin");function Tu(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(Tu,"getLengthableOrigin");function Kx(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}a(Kx,"parsedType");function ai(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(ai,"issue");function a8(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(a8,"cleanEnum");function NA(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}a(NA,"base64ToUint8Array");function TA(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}a(TA,"uint8ArrayToBase64");function i8(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return NA(e+r)}a(i8,"base64urlToUint8Array");function c8(t){return TA(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}a(c8,"uint8ArrayToBase64url");function u8(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}a(u8,"hexToUint8Array");function l8(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}a(l8,"uint8ArrayToHex");var Yx=class Yx{constructor(...e){}};a(Yx,"Class");var Fx=Yx;var zA=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,oi,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},"initializer"),of=$("$ZodError",zA),zu=$("$ZodError",zA,{Parent:Error});function OA(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}a(OA,"flattenError");function PA(t,e=r=>r.message){let r={_errors:[]},n=a((o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(c=>n({issues:c},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let c=[...s,...i.path];if(c.length===0)r._errors.push(e(i));else{let u=r,l=0;for(;l<c.length;){let d=c[l];l===c.length-1?(u[d]=u[d]||{_errors:[]},u[d]._errors.push(e(i))):u[d]=u[d]||{_errors:[]},u=u[d],l++}}}},"processError");return n(t),r}a(PA,"formatError");var Ou=a(t=>(e,r,n,o)=>{let s=n?{...n,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Xr;if(i.issues.length){let c=new(o?.Err??t)(i.issues.map(u=>mr(u,s,Wt())));throw rf(c,o?.callee),c}return i.value},"_parse"),sf=Ou(zu),Pu=a(t=>async(e,r,n,o)=>{let s=n?{...n,async:!0}:{async:!0},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let c=new(o?.Err??t)(i.issues.map(u=>mr(u,s,Wt())));throw rf(c,o?.callee),c}return i.value},"_parseAsync"),af=Pu(zu),Iu=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Xr;return s.issues.length?{success:!1,error:new(t??of)(s.issues.map(i=>mr(i,o,Wt())))}:{success:!0,data:s.value}},"_safeParse"),ys=Iu(zu),Cu=a(t=>async(e,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(i=>mr(i,o,Wt())))}:{success:!0,data:s.value}},"_safeParseAsync"),_s=Cu(zu),IA=a(t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Ou(t)(e,r,o)},"_encode");var CA=a(t=>(e,r,n)=>Ou(t)(e,r,n),"_decode");var RA=a(t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Pu(t)(e,r,o)},"_encodeAsync");var AA=a(t=>async(e,r,n)=>Pu(t)(e,r,n),"_decodeAsync");var jA=a(t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Iu(t)(e,r,o)},"_safeEncode");var MA=a(t=>(e,r,n)=>Iu(t)(e,r,n),"_safeDecode");var DA=a(t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Cu(t)(e,r,o)},"_safeEncodeAsync");var ZA=a(t=>async(e,r,n)=>Cu(t)(e,r,n),"_safeDecodeAsync");var LA=/^[cC][0-9a-z]{6,}$/,FA=/^[0-9a-z]+$/,UA=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qA=/^[0-9a-vA-V]{20}$/,VA=/^[A-Za-z0-9]{27}$/,HA=/^[a-zA-Z0-9_-]{21}$/,BA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var GA=/^([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})$/,Xx=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/,"uuid");var JA=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var p8="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function WA(){return new RegExp(p8,"u")}a(WA,"emoji");var KA=/^(?:(?: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])$/,YA=/^(([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}|:))$/;var XA=/^((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])$/,QA=/^(([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])$/,ej=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qx=/^[A-Za-z0-9_-]*$/;var tj=/^https?$/,rj=/^\+[1-9]\d{6,14}$/,nj="(?:(?:\\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])))",oj=new RegExp(`^${nj}$`);function sj(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(sj,"timeSource");function aj(t){return new RegExp(`^${sj(t)}$`)}a(aj,"time");function ij(t){let e=sj({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${nj}T(?:${n})$`)}a(ij,"datetime");var cj=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string");var uj=/^-?\d+$/,ev=/^-?\d+(?:\.\d+)?$/,lj=/^(?:true|false)$/i,dj=/^null$/i;var pj=/^[^A-Z]*$/,fj=/^[^a-z]*$/;var tt=$("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),mj={number:"number",bigint:"bigint",object:"date"},tv=$("$ZodCheckLessThan",(t,e)=>{tt.init(t,e);let r=mj[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),rv=$("$ZodCheckGreaterThan",(t,e)=>{tt.init(t,e);let r=mj[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),hj=$("$ZodCheckMultipleOf",(t,e)=>{tt.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Ux(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),gj=$("$ZodCheckNumberFormat",(t,e)=>{tt.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=Jx[e.format];t._zod.onattach.push(i=>{let c=i._zod.bag;c.format=e.format,c.minimum=o,c.maximum=s,r&&(c.pattern=uj)}),t._zod.check=i=>{let c=i.value;if(r){if(!Number.isInteger(c)){i.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?i.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):i.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}c<o&&i.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),c>s&&i.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var yj=$("$ZodCheckMaxLength",(t,e)=>{var r;tt.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Eu(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let o=n.value;if(o.length<=e.maximum)return;let i=Tu(o);n.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),_j=$("$ZodCheckMinLength",(t,e)=>{var r;tt.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Eu(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let i=Tu(o);n.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),xj=$("$ZodCheckLengthEquals",(t,e)=>{var r;tt.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Eu(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let i=Tu(o),c=s>e.length;n.issues.push({origin:i,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),Au=$("$ZodCheckStringFormat",(t,e)=>{var r,n;tt.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),vj=$("$ZodCheckRegex",(t,e)=>{Au.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),bj=$("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=pj),Au.init(t,e)}),wj=$("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=fj),Au.init(t,e)}),kj=$("$ZodCheckIncludes",(t,e)=>{tt.init(t,e);let r=Mn(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),Sj=$("$ZodCheckStartsWith",(t,e)=>{tt.init(t,e);let r=new RegExp(`^${Mn(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),$j=$("$ZodCheckEndsWith",(t,e)=>{tt.init(t,e);let r=new RegExp(`.*${Mn(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});var Ej=$("$ZodCheckOverwrite",(t,e)=>{tt.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var nv=class nv{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
209
+ `).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,o.join(`
210
+ `))}};a(nv,"Doc");var cf=nv;var Tj={major:4,minor:4,patch:3};var Pe=$("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Tj;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((i,c,u)=>{let l=yo(i),d;for(let m of c){if(m._zod.def.when){if(Wx(i)||!m._zod.def.when(i))continue}else if(l)continue;let h=i.issues.length,f=m._zod.check(i);if(f instanceof Promise&&u?.async===!1)throw new Xr;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,i.issues.length!==h&&(l||(l=yo(i,h)))});else{if(i.issues.length===h)continue;l||(l=yo(i,h))}}return d?d.then(()=>i):i},"runChecks"),s=a((i,c,u)=>{if(yo(i))return i.aborted=!0,i;let l=o(c,n,u);if(l instanceof Promise){if(u.async===!1)throw new Xr;return l.then(d=>t._zod.parse(d,u))}return t._zod.parse(l,u)},"handleCanaryResult");t._zod.run=(i,c)=>{if(c.skipChecks)return t._zod.parse(i,c);if(c.direction==="backward"){let l=t._zod.parse({value:i.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(d=>s(d,i,c)):s(l,i,c)}let u=t._zod.parse(i,c);if(u instanceof Promise){if(c.async===!1)throw new Xr;return u.then(l=>o(l,n,c))}return o(u,n,c)}}$e(t,"~standard",()=>({validate:o=>{try{let s=ys(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return _s(t,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),ju=$("$ZodString",(t,e)=>{Pe.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??cj(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),je=$("$ZodStringFormat",(t,e)=>{Au.init(t,e),ju.init(t,e)}),sv=$("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=GA),je.init(t,e)}),av=$("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Xx(n))}else e.pattern??(e.pattern=Xx());je.init(t,e)}),iv=$("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=JA),je.init(t,e)}),cv=$("$ZodURL",(t,e)=>{je.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===tj.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let o=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),uv=$("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=WA()),je.init(t,e)}),lv=$("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=HA),je.init(t,e)}),dv=$("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=LA),je.init(t,e)}),pv=$("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=FA),je.init(t,e)}),fv=$("$ZodULID",(t,e)=>{e.pattern??(e.pattern=UA),je.init(t,e)}),mv=$("$ZodXID",(t,e)=>{e.pattern??(e.pattern=qA),je.init(t,e)}),hv=$("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=VA),je.init(t,e)}),Mj=$("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=ij(e)),je.init(t,e)}),Dj=$("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=oj),je.init(t,e)}),Zj=$("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=aj(e)),je.init(t,e)}),Lj=$("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=BA),je.init(t,e)}),gv=$("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=KA),je.init(t,e),t._zod.bag.format="ipv4"}),yv=$("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=YA),je.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}});var _v=$("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=XA),je.init(t,e)}),xv=$("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=QA),je.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[o,s]=n;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Fj(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(Fj,"isValidBase64");var vv=$("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=ej),je.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Fj(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function f8(t){if(!Qx.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Fj(r)}a(f8,"isValidBase64URL");var bv=$("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Qx),je.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{f8(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),wv=$("$ZodE164",(t,e)=>{e.pattern??(e.pattern=rj),je.init(t,e)});function m8(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}a(m8,"isValidJWT");var kv=$("$ZodJWT",(t,e)=>{je.init(t,e),t._zod.check=r=>{m8(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var df=$("$ZodNumber",(t,e)=>{Pe.init(t,e),t._zod.pattern=t._zod.bag.pattern??ev,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),Sv=$("$ZodNumberFormat",(t,e)=>{gj.init(t,e),df.init(t,e)}),$v=$("$ZodBoolean",(t,e)=>{Pe.init(t,e),t._zod.pattern=lj,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}});var Ev=$("$ZodNull",(t,e)=>{Pe.init(t,e),t._zod.pattern=dj,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}});var Nv=$("$ZodUnknown",(t,e)=>{Pe.init(t,e),t._zod.parse=r=>r}),Tv=$("$ZodNever",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function zj(t,e,r){t.issues.length&&e.issues.push(...Dn(r,t.issues)),e.value[r]=t.value}a(zj,"handleArrayResult");var zv=$("$ZodArray",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let c=o[i],u=e.element._zod.run({value:c,issues:[]},n);u instanceof Promise?s.push(u.then(l=>zj(l,r,i))):zj(u,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function lf(t,e,r,n,o,s){let i=r in n;if(t.issues.length){if(o&&s&&!i)return;e.issues.push(...Dn(r,t.issues))}if(!i&&!o){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?i&&(e.value[r]=void 0):e.value[r]=t.value}a(lf,"handlePropertyResult");function Uj(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Gx(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}a(Uj,"normalizeDef");function qj(t,e,r,n,o,s){let i=[],c=o.keySet,u=o.catchall._zod,l=u.def.type,d=u.optin==="optional",m=u.optout==="optional";for(let h in e){if(h==="__proto__"||c.has(h))continue;if(l==="never"){i.push(h);continue}let f=u.run({value:e[h],issues:[]},n);f instanceof Promise?t.push(f.then(g=>lf(g,r,h,e,d,m))):lf(f,r,h,e,d,m)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}a(qj,"handleCatchall");var Ov=$("$ZodObject",(t,e)=>{if(Pe.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let c=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...c};return Object.defineProperty(e,"shape",{value:u}),u}})}let n=si(()=>Uj(e));$e(t._zod,"propValues",()=>{let c=e.shape,u={};for(let l in c){let d=c[l]._zod;if(d.values){u[l]??(u[l]=new Set);for(let m of d.values)u[l].add(m)}}return u});let o=gs,s=e.catchall,i;t._zod.parse=(c,u)=>{i??(i=n.value);let l=c.value;if(!o(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),c;c.value={};let d=[],m=i.shape;for(let h of i.keys){let f=m[h],g=f._zod.optin==="optional",v=f._zod.optout==="optional",y=f._zod.run({value:l[h],issues:[]},u);y instanceof Promise?d.push(y.then(x=>lf(x,c,h,l,g,v))):lf(y,c,h,l,g,v)}return s?qj(d,l,c,u,n.value,t):d.length?Promise.all(d).then(()=>c):c}}),Vj=$("$ZodObjectJIT",(t,e)=>{Ov.init(t,e);let r=t._zod.parse,n=si(()=>Uj(e)),o=a(h=>{let f=new cf(["shape","payload","ctx"]),g=n.value,v=a(w=>{let b=tf(w);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`},"parseStr");f.write("const input = payload.value;");let y=Object.create(null),x=0;for(let w of g.keys)y[w]=`key_${x++}`;f.write("const newResult = {};");for(let w of g.keys){let b=y[w],E=tf(w),A=h[w],O=A?._zod?.optin==="optional",B=A?._zod?.optout==="optional";f.write(`const ${b} = ${v(w)};`),O&&B?f.write(`
211
+ if (${b}.issues.length) {
212
+ if (${E} in input) {
213
+ payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
214
+ ...iss,
215
+ path: iss.path ? [${E}, ...iss.path] : [${E}]
216
+ })));
217
+ }
218
+ }
219
+
220
+ if (${b}.value === undefined) {
221
+ if (${E} in input) {
222
+ newResult[${E}] = undefined;
223
+ }
224
+ } else {
225
+ newResult[${E}] = ${b}.value;
226
+ }
227
+
228
+ `):O?f.write(`
229
+ if (${b}.issues.length) {
230
+ payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
231
+ ...iss,
232
+ path: iss.path ? [${E}, ...iss.path] : [${E}]
233
+ })));
234
+ }
235
+
236
+ if (${b}.value === undefined) {
237
+ if (${E} in input) {
238
+ newResult[${E}] = undefined;
239
+ }
240
+ } else {
241
+ newResult[${E}] = ${b}.value;
242
+ }
243
+
244
+ `):f.write(`
245
+ const ${b}_present = ${E} in input;
246
+ if (${b}.issues.length) {
247
+ payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
248
+ ...iss,
249
+ path: iss.path ? [${E}, ...iss.path] : [${E}]
250
+ })));
251
+ }
252
+ if (!${b}_present && !${b}.issues.length) {
253
+ payload.issues.push({
254
+ code: "invalid_type",
255
+ expected: "nonoptional",
256
+ input: undefined,
257
+ path: [${E}]
258
+ });
259
+ }
260
+
261
+ if (${b}_present) {
262
+ if (${b}.value === undefined) {
263
+ newResult[${E}] = undefined;
264
+ } else {
265
+ newResult[${E}] = ${b}.value;
266
+ }
267
+ }
268
+
269
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");let k=f.compile();return(w,b)=>k(h,w,b)},"generateFastpass"),s,i=gs,c=!ni.jitless,l=c&&Vx.value,d=e.catchall,m;t._zod.parse=(h,f)=>{m??(m=n.value);let g=h.value;return i(g)?c&&l&&f?.async===!1&&f.jitless!==!0?(s||(s=o(e.shape)),h=s(h,f),d?qj([],g,h,f,m,t):h):r(h,f):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),h)}});function Oj(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let o=t.filter(s=>!yo(s));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(i=>mr(i,n,Wt())))}),e)}a(Oj,"handleUnionResults");var pf=$("$ZodUnion",(t,e)=>{Pe.init(t,e),$e(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),$e(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),$e(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),$e(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Nu(o.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,i=[];for(let c of e.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)i.push(u),s=!0;else{if(u.issues.length===0)return u;i.push(u)}}return s?Promise.all(i).then(c=>Oj(c,n,t,o)):Oj(i,n,t,o)}});var Pv=$("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,pf.init(t,e);let r=t._zod.parse;$e(t._zod,"propValues",()=>{let o={};for(let s of e.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[c,u]of Object.entries(i)){o[c]||(o[c]=new Set);for(let l of u)o[c].add(l)}}return o});let n=si(()=>{let o=e.options,s=new Map;for(let i of o){let c=i._zod.propValues?.[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let u of c){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,i)}}return s});t._zod.parse=(o,s)=>{let i=o.value;if(!gs(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),o;let c=n.value.get(i?.[e.discriminator]);return c?c._zod.run(o,s):e.unionFallback||s.direction==="backward"?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:i,path:[e.discriminator],inst:t}),o)}}),Iv=$("$ZodIntersection",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),i=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([u,l])=>Pj(r,u,l)):Pj(r,s,i)}});function ov(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(go(t)&&go(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let i=ov(t[s],e[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let o=t[n],s=e[n],i=ov(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}a(ov,"mergeValues");function Pj(t,e,r){let n=new Map,o;for(let c of e.issues)if(c.code==="unrecognized_keys"){o??(o=c);for(let u of c.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else t.issues.push(c);for(let c of r.issues)if(c.code==="unrecognized_keys")for(let u of c.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else t.issues.push(c);let s=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(s.length&&o&&t.issues.push({...o,keys:s}),yo(t))return t;let i=ov(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}a(Pj,"handleIntersectionResults");var Cv=$("$ZodRecord",(t,e)=>{Pe.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!go(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],i=e.keyType._zod.values;if(i){r.value={};let c=new Set;for(let l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){c.add(typeof l=="number"?l.toString():l);let d=e.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>mr(f,n,Wt())),input:l,path:[l],inst:t});continue}let m=d.value,h=e.valueType._zod.run({value:o[l],issues:[]},n);h instanceof Promise?s.push(h.then(f=>{f.issues.length&&r.issues.push(...Dn(l,f.issues)),r.value[m]=f.value})):(h.issues.length&&r.issues.push(...Dn(l,h.issues)),r.value[m]=h.value)}let u;for(let l in o)c.has(l)||(u=u??[],u.push(l));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:u})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,c))continue;let u=e.keyType._zod.run({value:c,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&ev.test(c)&&u.issues.length){let m=e.keyType._zod.run({value:Number(c),issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(u=m)}if(u.issues.length){e.mode==="loose"?r.value[c]=o[c]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(m=>mr(m,n,Wt())),input:c,path:[c],inst:t});continue}let d=e.valueType._zod.run({value:o[c],issues:[]},n);d instanceof Promise?s.push(d.then(m=>{m.issues.length&&r.issues.push(...Dn(c,m.issues)),r.value[u.value]=m.value})):(d.issues.length&&r.issues.push(...Dn(c,d.issues)),r.value[u.value]=d.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Rv=$("$ZodEnum",(t,e)=>{Pe.init(t,e);let r=$u(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>Bx.has(typeof o)).map(o=>typeof o=="string"?Mn(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:t}),o}}),Av=$("$ZodLiteral",(t,e)=>{if(Pe.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Mn(n):n?Mn(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var jv=$("$ZodTransform",(t,e)=>{Pe.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ri(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r.fallback=!0,r));if(o instanceof Promise)throw new Xr;return r.value=o,r.fallback=!0,r}});function Ij(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}a(Ij,"handleOptionalResult");var ff=$("$ZodOptional",(t,e)=>{Pe.init(t,e),t._zod.optin="optional",t._zod.optout="optional",$e(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),$e(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Nu(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=r.value,s=e.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>Ij(i,o)):Ij(s,o)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),Mv=$("$ZodExactOptional",(t,e)=>{ff.init(t,e),$e(t._zod,"values",()=>e.innerType._zod.values),$e(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),Dv=$("$ZodNullable",(t,e)=>{Pe.init(t,e),$e(t._zod,"optin",()=>e.innerType._zod.optin),$e(t._zod,"optout",()=>e.innerType._zod.optout),$e(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Nu(r.source)}|null)$`):void 0}),$e(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),Zv=$("$ZodDefault",(t,e)=>{Pe.init(t,e),t._zod.optin="optional",$e(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Cj(s,e)):Cj(o,e)}});function Cj(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(Cj,"handleDefaultResult");var Lv=$("$ZodPrefault",(t,e)=>{Pe.init(t,e),t._zod.optin="optional",$e(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),Fv=$("$ZodNonOptional",(t,e)=>{Pe.init(t,e),$e(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Rj(s,t)):Rj(o,t)}});function Rj(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}a(Rj,"handleNonOptionalResult");var Uv=$("$ZodCatch",(t,e)=>{Pe.init(t,e),t._zod.optin="optional",$e(t._zod,"optout",()=>e.innerType._zod.optout),$e(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(i=>mr(i,n,Wt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>mr(s,n,Wt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var mf=$("$ZodPipe",(t,e)=>{Pe.init(t,e),$e(t._zod,"values",()=>e.in._zod.values),$e(t._zod,"optin",()=>e.in._zod.optin),$e(t._zod,"optout",()=>e.out._zod.optout),$e(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(i=>uf(i,e.in,n)):uf(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>uf(s,e.out,n)):uf(o,e.out,n)}});function uf(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}a(uf,"handlePipeResult");var Hj=$("$ZodPreprocess",(t,e)=>{mf.init(t,e)}),qv=$("$ZodReadonly",(t,e)=>{Pe.init(t,e),$e(t._zod,"propValues",()=>e.innerType._zod.propValues),$e(t._zod,"values",()=>e.innerType._zod.values),$e(t._zod,"optin",()=>e.innerType?._zod?.optin),$e(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(Aj):Aj(o)}});function Aj(t){return t.value=Object.freeze(t.value),t}a(Aj,"handleReadonlyResult");var Vv=$("$ZodCustom",(t,e)=>{tt.init(t,e),Pe.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>jj(s,r,n,t));jj(o,r,n,t)}});function jj(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(ai(o))}}a(jj,"handleRefineResult");var h8=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,i=Kx(o.input),c=n[i]??i;return`Invalid input: expected ${s}, received ${c}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${nf(o.values[0])}`:`Invalid option: expected one of ${ef(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",i=e(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",i=e(o.origin);return i?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${ef(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}},"error");function Hv(){return{localeError:h8()}}a(Hv,"default");var Bj,tCe=Symbol("ZodOutput"),rCe=Symbol("ZodInput"),Gv=class Gv{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[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 r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};a(Gv,"$ZodRegistry");var Bv=Gv;function g8(){return new Bv}a(g8,"registry");(Bj=globalThis).__zod_globalRegistry??(Bj.__zod_globalRegistry=g8());var xs=globalThis.__zod_globalRegistry;function Jv(t,e){return new t({type:"string",...Q(e)})}a(Jv,"_string");function Wv(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Q(e)})}a(Wv,"_email");function hf(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Q(e)})}a(hf,"_guid");function Kv(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Q(e)})}a(Kv,"_uuid");function Yv(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Q(e)})}a(Yv,"_uuidv4");function Xv(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Q(e)})}a(Xv,"_uuidv6");function Qv(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Q(e)})}a(Qv,"_uuidv7");function eb(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Q(e)})}a(eb,"_url");function tb(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Q(e)})}a(tb,"_emoji");function rb(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Q(e)})}a(rb,"_nanoid");function nb(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Q(e)})}a(nb,"_cuid");function ob(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Q(e)})}a(ob,"_cuid2");function sb(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Q(e)})}a(sb,"_ulid");function ab(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Q(e)})}a(ab,"_xid");function ib(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Q(e)})}a(ib,"_ksuid");function cb(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Q(e)})}a(cb,"_ipv4");function ub(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Q(e)})}a(ub,"_ipv6");function lb(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Q(e)})}a(lb,"_cidrv4");function db(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Q(e)})}a(db,"_cidrv6");function pb(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Q(e)})}a(pb,"_base64");function fb(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Q(e)})}a(fb,"_base64url");function mb(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Q(e)})}a(mb,"_e164");function hb(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Q(e)})}a(hb,"_jwt");function Gj(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Q(e)})}a(Gj,"_isoDateTime");function Jj(t,e){return new t({type:"string",format:"date",check:"string_format",...Q(e)})}a(Jj,"_isoDate");function Wj(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Q(e)})}a(Wj,"_isoTime");function Kj(t,e){return new t({type:"string",format:"duration",check:"string_format",...Q(e)})}a(Kj,"_isoDuration");function gb(t,e){return new t({type:"number",checks:[],...Q(e)})}a(gb,"_number");function yb(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Q(e)})}a(yb,"_int");function _b(t,e){return new t({type:"boolean",...Q(e)})}a(_b,"_boolean");function xb(t,e){return new t({type:"null",...Q(e)})}a(xb,"_null");function vb(t){return new t({type:"unknown"})}a(vb,"_unknown");function bb(t,e){return new t({type:"never",...Q(e)})}a(bb,"_never");function gf(t,e){return new tv({check:"less_than",...Q(e),value:t,inclusive:!1})}a(gf,"_lt");function Mu(t,e){return new tv({check:"less_than",...Q(e),value:t,inclusive:!0})}a(Mu,"_lte");function yf(t,e){return new rv({check:"greater_than",...Q(e),value:t,inclusive:!1})}a(yf,"_gt");function Du(t,e){return new rv({check:"greater_than",...Q(e),value:t,inclusive:!0})}a(Du,"_gte");function _f(t,e){return new hj({check:"multiple_of",...Q(e),value:t})}a(_f,"_multipleOf");function xf(t,e){return new yj({check:"max_length",...Q(e),maximum:t})}a(xf,"_maxLength");function ii(t,e){return new _j({check:"min_length",...Q(e),minimum:t})}a(ii,"_minLength");function vf(t,e){return new xj({check:"length_equals",...Q(e),length:t})}a(vf,"_length");function wb(t,e){return new vj({check:"string_format",format:"regex",...Q(e),pattern:t})}a(wb,"_regex");function kb(t){return new bj({check:"string_format",format:"lowercase",...Q(t)})}a(kb,"_lowercase");function Sb(t){return new wj({check:"string_format",format:"uppercase",...Q(t)})}a(Sb,"_uppercase");function $b(t,e){return new kj({check:"string_format",format:"includes",...Q(e),includes:t})}a($b,"_includes");function Eb(t,e){return new Sj({check:"string_format",format:"starts_with",...Q(e),prefix:t})}a(Eb,"_startsWith");function Nb(t,e){return new $j({check:"string_format",format:"ends_with",...Q(e),suffix:t})}a(Nb,"_endsWith");function _o(t){return new Ej({check:"overwrite",tx:t})}a(_o,"_overwrite");function Tb(t){return _o(e=>e.normalize(t))}a(Tb,"_normalize");function zb(){return _o(t=>t.trim())}a(zb,"_trim");function Ob(){return _o(t=>t.toLowerCase())}a(Ob,"_toLowerCase");function Pb(){return _o(t=>t.toUpperCase())}a(Pb,"_toUpperCase");function Ib(){return _o(t=>qx(t))}a(Ib,"_slugify");function Yj(t,e,r){return new t({type:"array",element:e,...Q(r)})}a(Yj,"_array");function Cb(t,e,r){let n=Q(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(Cb,"_custom");function Rb(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Q(r)})}a(Rb,"_refine");function Ab(t,e){let r=y8(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(ai(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(ai(s))}},t(n.value,n)),e);return r}a(Ab,"_superRefine");function y8(t,e){let r=new tt({check:"custom",...Q(e)});return r._zod.check=t,r}a(y8,"_check");function Lu(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??xs,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}a(Lu,"initializeContext");function Ie(t,e,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,i);let c=t._zod.toJSONSchema?.();if(c)i.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,i.schema,d);else{let h=i.schema,f=e.processors[o.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);f(t,e,h,d)}let m=t._zod.parent;m&&(i.ref||(i.ref=m),Ie(m,e,d),e.seen.get(m).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(i.schema,u),e.io==="input"&&kt(t)&&(delete i.schema.examples,delete i.schema.default),e.io==="input"&&"_prefault"in i.schema&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,e.seen.get(t).schema}a(Ie,"process");function Fu(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let i of t.seen.entries()){let c=t.metadataRegistry.get(i[0])?.id;if(c){let u=n.get(c);if(u&&u!==i[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,i[0])}}let o=a(i=>{let c=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let m=t.external.registry.get(i[0])?.id,h=t.external.uri??(g=>g);if(m)return{ref:h(m)};let f=i[1].defId??i[1].schema.id??`schema${t.counter++}`;return i[1].defId=f,{defId:f,ref:`${h("__shared")}#/${c}/${f}`}}if(i[1]===r)return{ref:"#"};let l=`#/${c}/`,d=i[1].schema.id??`__schema${t.counter++}`;return{defId:d,ref:l+d}},"makeURI"),s=a(i=>{if(i[1].schema.$ref)return;let c=i[1],{ref:u,defId:l}=o(i);c.def={...c.schema},l&&(c.defId=l);let d=c.schema;for(let m in d)delete d[m];d.$ref=u},"extractToDef");if(t.cycles==="throw")for(let i of t.seen.entries()){let c=i[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
270
+
271
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of t.seen.entries()){let c=i[1];if(e===i[0]){s(i);continue}if(t.external){let l=t.external.registry.get(i[0])?.id;if(e!==i[0]&&l){s(i);continue}}if(t.metadataRegistry.get(i[0])?.id){s(i);continue}if(c.cycle){s(i);continue}if(c.count>1&&t.reused==="ref"){s(i);continue}}}a(Fu,"extractDefs");function Uu(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a(c=>{let u=t.seen.get(c);if(u.ref===null)return;let l=u.def??u.schema,d={...l},m=u.ref;if(u.ref=null,m){n(m);let f=t.seen.get(m),g=f.schema;if(g.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Object.assign(l,g),Object.assign(l,d),c._zod.parent===m)for(let y in l)y==="$ref"||y==="allOf"||y in d||delete l[y];if(g.$ref&&f.def)for(let y in l)y==="$ref"||y==="allOf"||y in f.def&&JSON.stringify(l[y])===JSON.stringify(f.def[y])&&delete l[y]}let h=c._zod.parent;if(h&&h!==m){n(h);let f=t.seen.get(h);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let g in l)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(l[g])===JSON.stringify(f.def[g])&&delete l[g]}t.override({zodSchema:c,jsonSchema:l,path:u.path??[]})},"flattenRef");for(let c of[...t.seen.entries()].reverse())n(c[0]);let o={};if(t.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let c=t.external.registry.get(e)?.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=t.external.uri(c)}Object.assign(o,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&o.id===s&&delete o.id;let i=t.external?.defs??{};for(let c of t.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,i[u.defId]=u.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...e["~standard"],jsonSchema:{input:Zu(e,"input",t.processors),output:Zu(e,"output",t.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}a(Uu,"finalize");function kt(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return kt(n.element,r);if(n.type==="set")return kt(n.valueType,r);if(n.type==="lazy")return kt(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return kt(n.innerType,r);if(n.type==="intersection")return kt(n.left,r)||kt(n.right,r);if(n.type==="record"||n.type==="map")return kt(n.keyType,r)||kt(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:kt(n.in,r)||kt(n.out,r);if(n.type==="object"){for(let o in n.shape)if(kt(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(kt(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(kt(o,r))return!0;return!!(n.rest&&kt(n.rest,r))}return!1}a(kt,"isTransforming");var Xj=a((t,e={})=>r=>{let n=Lu({...r,processors:e});return Ie(t,n),Fu(n,t),Uu(n,t)},"createToJSONSchemaMethod"),Zu=a((t,e,r={})=>n=>{let{libraryOptions:o,target:s}=n??{},i=Lu({...o??{},target:s,io:e,processors:r});return Ie(t,i),Fu(i,t),Uu(i,t)},"createStandardJSONSchemaMethod");var _8={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},jb=a((t,e,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:i,format:c,patterns:u,contentEncoding:l}=t._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),c&&(o.format=_8[c]??c,o.format===""&&delete o.format,c==="time"&&delete o.format),l&&(o.contentEncoding=l),u&&u.size>0){let d=[...u];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(m=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},"stringProcessor"),Mb=a((t,e,r,n)=>{let o=r,{minimum:s,maximum:i,format:c,multipleOf:u,exclusiveMaximum:l,exclusiveMinimum:d}=t._zod.bag;typeof c=="string"&&c.includes("int")?o.type="integer":o.type="number";let m=typeof d=="number"&&d>=(s??Number.NEGATIVE_INFINITY),h=typeof l=="number"&&l<=(i??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";m?f?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d:typeof s=="number"&&(o.minimum=s),h?f?(o.maximum=l,o.exclusiveMaximum=!0):o.exclusiveMaximum=l:typeof i=="number"&&(o.maximum=i),typeof u=="number"&&(o.multipleOf=u)},"numberProcessor"),Db=a((t,e,r,n)=>{r.type="boolean"},"booleanProcessor"),eM=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),tM=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),Zb=a((t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},"nullProcessor"),rM=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),nM=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),Lb=a((t,e,r,n)=>{r.not={}},"neverProcessor"),oM=a((t,e,r,n)=>{},"anyProcessor"),Fb=a((t,e,r,n)=>{},"unknownProcessor"),sM=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),Ub=a((t,e,r,n)=>{let o=t._zod.def,s=$u(o.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},"enumProcessor"),qb=a((t,e,r,n)=>{let o=t._zod.def,s=[];for(let i of o.values)if(i===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s},"literalProcessor"),aM=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),iM=a((t,e,r,n)=>{let o=r,s=t._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=s.source},"templateLiteralProcessor"),cM=a((t,e,r,n)=>{let o=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:c,mime:u}=t._zod.bag;i!==void 0&&(s.minLength=i),c!==void 0&&(s.maxLength=c),u?u.length===1?(s.contentMediaType=u[0],Object.assign(o,s)):(Object.assign(o,s),o.anyOf=u.map(l=>({contentMediaType:l}))):Object.assign(o,s)},"fileProcessor"),uM=a((t,e,r,n)=>{r.type="boolean"},"successProcessor"),Vb=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),lM=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),Hb=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),dM=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),pM=a((t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),Bb=a((t,e,r,n)=>{let o=r,s=t._zod.def,{minimum:i,maximum:c}=t._zod.bag;typeof i=="number"&&(o.minItems=i),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=Ie(s.element,e,{...n,path:[...n.path,"items"]})},"arrayProcessor"),Gb=a((t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object",o.properties={};let i=s.shape;for(let l in i)o.properties[l]=Ie(i[l],e,{...n,path:[...n.path,"properties",l]});let c=new Set(Object.keys(i)),u=new Set([...c].filter(l=>{let d=s.shape[l]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(o.required=Array.from(u)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Ie(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},"objectProcessor"),Jb=a((t,e,r,n)=>{let o=t._zod.def,s=o.inclusive===!1,i=o.options.map((c,u)=>Ie(c,e,{...n,path:[...n.path,s?"oneOf":"anyOf",u]}));s?r.oneOf=i:r.anyOf=i},"unionProcessor"),Wb=a((t,e,r,n)=>{let o=t._zod.def,s=Ie(o.left,e,{...n,path:[...n.path,"allOf",0]}),i=Ie(o.right,e,{...n,path:[...n.path,"allOf",1]}),c=a(l=>"allOf"in l&&Object.keys(l).length===1,"isSimpleIntersection"),u=[...c(s)?s.allOf:[s],...c(i)?i.allOf:[i]];r.allOf=u},"intersectionProcessor"),fM=a((t,e,r,n)=>{let o=r,s=t._zod.def;o.type="array";let i=e.target==="draft-2020-12"?"prefixItems":"items",c=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=s.items.map((h,f)=>Ie(h,e,{...n,path:[...n.path,i,f]})),l=s.rest?Ie(s.rest,e,{...n,path:[...n.path,c,...e.target==="openapi-3.0"?[s.items.length]:[]]}):null;e.target==="draft-2020-12"?(o.prefixItems=u,l&&(o.items=l)):e.target==="openapi-3.0"?(o.items={anyOf:u},l&&o.items.anyOf.push(l),o.minItems=u.length,l||(o.maxItems=u.length)):(o.items=u,l&&(o.additionalItems=l));let{minimum:d,maximum:m}=t._zod.bag;typeof d=="number"&&(o.minItems=d),typeof m=="number"&&(o.maxItems=m)},"tupleProcessor"),Kb=a((t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object";let i=s.keyType,u=i._zod.bag?.patterns;if(s.mode==="loose"&&u&&u.size>0){let d=Ie(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let m of u)o.patternProperties[m.source]=d}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(o.propertyNames=Ie(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=Ie(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let l=i._zod.values;if(l){let d=[...l].filter(m=>typeof m=="string"||typeof m=="number");d.length>0&&(o.required=d)}},"recordProcessor"),Yb=a((t,e,r,n)=>{let o=t._zod.def,s=Ie(o.innerType,e,n),i=e.seen.get(t);e.target==="openapi-3.0"?(i.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},"nullableProcessor"),Xb=a((t,e,r,n)=>{let o=t._zod.def;Ie(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},"nonoptionalProcessor"),Qb=a((t,e,r,n)=>{let o=t._zod.def;Ie(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},"defaultProcessor"),ew=a((t,e,r,n)=>{let o=t._zod.def;Ie(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},"prefaultProcessor"),tw=a((t,e,r,n)=>{let o=t._zod.def;Ie(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},"catchProcessor"),rw=a((t,e,r,n)=>{let o=t._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=e.io==="input"?s?o.out:o.in:o.out;Ie(i,e,n);let c=e.seen.get(t);c.ref=i},"pipeProcessor"),nw=a((t,e,r,n)=>{let o=t._zod.def;Ie(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.readOnly=!0},"readonlyProcessor"),mM=a((t,e,r,n)=>{let o=t._zod.def;Ie(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},"promiseProcessor"),bf=a((t,e,r,n)=>{let o=t._zod.def;Ie(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},"optionalProcessor"),hM=a((t,e,r,n)=>{let o=t._zod.innerType;Ie(o,e,n);let s=e.seen.get(t);s.ref=o},"lazyProcessor"),Qj={string:jb,number:Mb,boolean:Db,bigint:eM,symbol:tM,null:Zb,undefined:rM,void:nM,never:Lb,any:oM,unknown:Fb,date:sM,enum:Ub,literal:qb,nan:aM,template_literal:iM,file:cM,success:uM,custom:Vb,function:lM,transform:Hb,map:dM,set:pM,array:Bb,object:Gb,union:Jb,intersection:Wb,tuple:fM,record:Kb,nullable:Yb,nonoptional:Xb,default:Qb,prefault:ew,catch:tw,pipe:rw,readonly:nw,promise:mM,optional:bf,lazy:hM};function ow(t,e){if("_idmap"in t){let n=t,o=Lu({...e,processors:Qj}),s={};for(let u of n._idmap.entries()){let[l,d]=u;Ie(d,o)}let i={},c={registry:n,uri:e?.uri,defs:s};o.external=c;for(let u of n._idmap.entries()){let[l,d]=u;Fu(o,d),i[l]=Uu(o,d)}if(Object.keys(s).length>0){let u=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[u]:s}}return{schemas:i}}let r=Lu({...e,processors:Qj});return Ie(t,r),Fu(r,t),Uu(r,t)}a(ow,"toJSONSchema");var iG=$("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");Pe.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>sf(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>ys(t,r,n),t.parseAsync=async(r,n)=>af(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>_s(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>Kt(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.apply=r=>r(t)});var cG=$("ZodMiniObject",(t,e)=>{Ov.init(t,e),iG.init(t,e),$e(t,"shape",()=>e.shape)});function sw(t,e){let r={type:"object",shape:t??{},...Q(e)};return new cG(r)}a(sw,"object");function Qr(t){return!!t._zod}a(Qr,"isZ4Schema");function bs(t){let e=Object.values(t);if(e.length===0)return sw({});let r=e.every(Qr),n=e.every(o=>!Qr(o));if(r)return sw(t);if(n)return hA(t);throw new Error("Mixed Zod versions detected in object shape.")}a(bs,"objectFromShape");function xo(t,e){return Qr(t)?ys(t,e):t.safeParse(e)}a(xo,"safeParse");async function wf(t,e){return Qr(t)?await _s(t,e):await t.safeParseAsync(e)}a(wf,"safeParseAsync");function vo(t){if(!t)return;let e;if(Qr(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(vo,"getObjectShape");function ci(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return bs(t)}}if(Qr(t)){let r=t._zod?.def;if(r&&(r.type==="object"||r.shape!==void 0))return t}else if(t.shape!==void 0)return t}}a(ci,"normalizeObjectSchema");function lG(t){return t.length===0?"object root":t.reduce((e,r,n)=>n===0?String(r):typeof r=="number"?`${e}[${r}]`:`${e}.${r}`,"")}a(lG,"getDotPath");function kf(t){if(t&&typeof t=="object"){if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0)return t.issues.map(e=>e.path?.length?`${e.message} at ${lG(e.path)}`:e.message).join(`
272
+ `);if("message"in t&&typeof t.message=="string")return t.message;try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}a(kf,"getParseErrorMessage");function yM(t){return t.description}a(yM,"getSchemaDescription");function _M(t){if(Qr(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}a(_M,"isSchemaOptional");function ui(t){if(Qr(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}a(ui,"getLiteralValue");var qu={};R(qu,{ZodISODate:()=>vM,ZodISODateTime:()=>xM,ZodISODuration:()=>wM,ZodISOTime:()=>bM,date:()=>iw,datetime:()=>aw,duration:()=>uw,time:()=>cw});var xM=$("ZodISODateTime",(t,e)=>{Mj.init(t,e),Ve.init(t,e)});function aw(t){return Gj(xM,t)}a(aw,"datetime");var vM=$("ZodISODate",(t,e)=>{Dj.init(t,e),Ve.init(t,e)});function iw(t){return Jj(vM,t)}a(iw,"date");var bM=$("ZodISOTime",(t,e)=>{Zj.init(t,e),Ve.init(t,e)});function cw(t){return Wj(bM,t)}a(cw,"time");var wM=$("ZodISODuration",(t,e)=>{Lj.init(t,e),Ve.init(t,e)});function uw(t){return Kj(wM,t)}a(uw,"duration");var yG=a((t,e)=>{of.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>PA(t,r)},flatten:{value:r=>OA(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,oi,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,oi,2)}},isEmpty:{get(){return t.issues.length===0}}})},"initializer");var Yt=$("ZodError",yG,{Parent:Error});var kM=Ou(Yt),SM=Pu(Yt),$M=Iu(Yt),EM=Cu(Yt),NM=IA(Yt),TM=CA(Yt),zM=RA(Yt),OM=AA(Yt),PM=jA(Yt),IM=MA(Yt),CM=DA(Yt),RM=ZA(Yt);var AM=new WeakMap;function Vu(t,e,r){let n=Object.getPrototypeOf(t),o=AM.get(n);if(o||(o=new Set,AM.set(n,o)),!o.has(e)){o.add(e);for(let s in r){let i=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let c=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:c}),c},set(c){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:c})}})}}}a(Vu,"_installLazyMethods");var Ge=$("ZodType",(t,e)=>(Pe.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Zu(t,"input"),output:Zu(t,"output")}}),t.toJSONSchema=Xj(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>kM(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>$M(t,r,n),t.parseAsync=async(r,n)=>SM(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>EM(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>NM(t,r,n),t.decode=(r,n)=>TM(t,r,n),t.encodeAsync=async(r,n)=>zM(t,r,n),t.decodeAsync=async(r,n)=>OM(t,r,n),t.safeEncode=(r,n)=>PM(t,r,n),t.safeDecode=(r,n)=>IM(t,r,n),t.safeEncodeAsync=async(r,n)=>CM(t,r,n),t.safeDecodeAsync=async(r,n)=>RM(t,r,n),Vu(t,"ZodType",{check(...r){let n=this.def;return this.clone(ye.mergeDefs(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return Kt(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(iJ(r,n))},superRefine(r,n){return this.check(cJ(r,n))},overwrite(r){return this.check(_o(r))},optional(){return Be(this)},exactOptional(){return WG(this)},nullable(){return ZM(this)},nullish(){return Be(ZM(this))},nonoptional(r){return tJ(this,r)},array(){return _e(this)},or(r){return De([this,r])},and(r){return $f(this,r)},transform(r){return LM(this,BM(r))},default(r){return XG(this,r)},prefault(r){return eJ(this,r)},catch(r){return nJ(this,r)},pipe(r){return LM(this,r)},readonly(){return aJ(this)},describe(r){let n=this.clone();return xs.add(n,{description:r}),n},meta(...r){if(r.length===0)return xs.get(this);let n=this.clone();return xs.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return xs.get(t)?.description},configurable:!0}),t)),FM=$("_ZodString",(t,e)=>{ju.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(n,o,s)=>jb(t,n,o,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Vu(t,"_ZodString",{regex(...n){return this.check(wb(...n))},includes(...n){return this.check($b(...n))},startsWith(...n){return this.check(Eb(...n))},endsWith(...n){return this.check(Nb(...n))},min(...n){return this.check(ii(...n))},max(...n){return this.check(xf(...n))},length(...n){return this.check(vf(...n))},nonempty(...n){return this.check(ii(1,...n))},lowercase(n){return this.check(kb(n))},uppercase(n){return this.check(Sb(n))},trim(){return this.check(zb())},normalize(...n){return this.check(Tb(...n))},toLowerCase(){return this.check(Ob())},toUpperCase(){return this.check(Pb())},slugify(){return this.check(Ib())}})}),xG=$("ZodString",(t,e)=>{ju.init(t,e),FM.init(t,e),t.email=r=>t.check(Wv(vG,r)),t.url=r=>t.check(eb(bG,r)),t.jwt=r=>t.check(hb(jG,r)),t.emoji=r=>t.check(tb(wG,r)),t.guid=r=>t.check(hf(jM,r)),t.uuid=r=>t.check(Kv(Sf,r)),t.uuidv4=r=>t.check(Yv(Sf,r)),t.uuidv6=r=>t.check(Xv(Sf,r)),t.uuidv7=r=>t.check(Qv(Sf,r)),t.nanoid=r=>t.check(rb(kG,r)),t.guid=r=>t.check(hf(jM,r)),t.cuid=r=>t.check(nb(SG,r)),t.cuid2=r=>t.check(ob($G,r)),t.ulid=r=>t.check(sb(EG,r)),t.base64=r=>t.check(pb(CG,r)),t.base64url=r=>t.check(fb(RG,r)),t.xid=r=>t.check(ab(NG,r)),t.ksuid=r=>t.check(ib(TG,r)),t.ipv4=r=>t.check(cb(zG,r)),t.ipv6=r=>t.check(ub(OG,r)),t.cidrv4=r=>t.check(lb(PG,r)),t.cidrv6=r=>t.check(db(IG,r)),t.e164=r=>t.check(mb(AG,r)),t.datetime=r=>t.check(aw(r)),t.date=r=>t.check(iw(r)),t.time=r=>t.check(cw(r)),t.duration=r=>t.check(uw(r))});function S(t){return Jv(xG,t)}a(S,"string");var Ve=$("ZodStringFormat",(t,e)=>{je.init(t,e),FM.init(t,e)}),vG=$("ZodEmail",(t,e)=>{iv.init(t,e),Ve.init(t,e)});var jM=$("ZodGUID",(t,e)=>{sv.init(t,e),Ve.init(t,e)});var Sf=$("ZodUUID",(t,e)=>{av.init(t,e),Ve.init(t,e)});var bG=$("ZodURL",(t,e)=>{cv.init(t,e),Ve.init(t,e)});var wG=$("ZodEmoji",(t,e)=>{uv.init(t,e),Ve.init(t,e)});var kG=$("ZodNanoID",(t,e)=>{lv.init(t,e),Ve.init(t,e)});var SG=$("ZodCUID",(t,e)=>{dv.init(t,e),Ve.init(t,e)});var $G=$("ZodCUID2",(t,e)=>{pv.init(t,e),Ve.init(t,e)});var EG=$("ZodULID",(t,e)=>{fv.init(t,e),Ve.init(t,e)});var NG=$("ZodXID",(t,e)=>{mv.init(t,e),Ve.init(t,e)});var TG=$("ZodKSUID",(t,e)=>{hv.init(t,e),Ve.init(t,e)});var zG=$("ZodIPv4",(t,e)=>{gv.init(t,e),Ve.init(t,e)});var OG=$("ZodIPv6",(t,e)=>{yv.init(t,e),Ve.init(t,e)});var PG=$("ZodCIDRv4",(t,e)=>{_v.init(t,e),Ve.init(t,e)});var IG=$("ZodCIDRv6",(t,e)=>{xv.init(t,e),Ve.init(t,e)});var CG=$("ZodBase64",(t,e)=>{vv.init(t,e),Ve.init(t,e)});var RG=$("ZodBase64URL",(t,e)=>{bv.init(t,e),Ve.init(t,e)});var AG=$("ZodE164",(t,e)=>{wv.init(t,e),Ve.init(t,e)});var jG=$("ZodJWT",(t,e)=>{kv.init(t,e),Ve.init(t,e)});var UM=$("ZodNumber",(t,e)=>{df.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Mb(t,n,o,s),Vu(t,"ZodNumber",{gt(n,o){return this.check(yf(n,o))},gte(n,o){return this.check(Du(n,o))},min(n,o){return this.check(Du(n,o))},lt(n,o){return this.check(gf(n,o))},lte(n,o){return this.check(Mu(n,o))},max(n,o){return this.check(Mu(n,o))},int(n){return this.check(MM(n))},safe(n){return this.check(MM(n))},positive(n){return this.check(yf(0,n))},nonnegative(n){return this.check(Du(0,n))},negative(n){return this.check(gf(0,n))},nonpositive(n){return this.check(Mu(0,n))},multipleOf(n,o){return this.check(_f(n,o))},step(n,o){return this.check(_f(n,o))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function Te(t){return gb(UM,t)}a(Te,"number");var MG=$("ZodNumberFormat",(t,e)=>{Sv.init(t,e),UM.init(t,e)});function MM(t){return yb(MG,t)}a(MM,"int");var DG=$("ZodBoolean",(t,e)=>{$v.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Db(t,r,n,o)});function rt(t){return _b(DG,t)}a(rt,"boolean");var ZG=$("ZodNull",(t,e)=>{Ev.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Zb(t,r,n,o)});function qM(t){return xb(ZG,t)}a(qM,"_null");var LG=$("ZodUnknown",(t,e)=>{Nv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Fb(t,r,n,o)});function He(){return vb(LG)}a(He,"unknown");var FG=$("ZodNever",(t,e)=>{Tv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Lb(t,r,n,o)});function UG(t){return bb(FG,t)}a(UG,"never");var qG=$("ZodArray",(t,e)=>{zv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Bb(t,r,n,o),t.element=e.element,Vu(t,"ZodArray",{min(r,n){return this.check(ii(r,n))},nonempty(r){return this.check(ii(1,r))},max(r,n){return this.check(xf(r,n))},length(r,n){return this.check(vf(r,n))},unwrap(){return this.element}})});function _e(t,e){return Yj(qG,t,e)}a(_e,"array");var VM=$("ZodObject",(t,e)=>{Vj.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Gb(t,r,n,o),ye.defineLazy(t,"shape",()=>e.shape),Vu(t,"ZodObject",{keyof(){return It(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:He()})},loose(){return this.clone({...this._zod.def,catchall:He()})},strict(){return this.clone({...this._zod.def,catchall:UG()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return ye.extend(this,r)},safeExtend(r){return ye.safeExtend(this,r)},merge(r){return ye.merge(this,r)},pick(r){return ye.pick(this,r)},omit(r){return ye.omit(this,r)},partial(...r){return ye.partial(Ef,this,r[0])},required(...r){return ye.required(GM,this,r[0])}})});function U(t,e){let r={type:"object",shape:t??{},...ye.normalizeParams(e)};return new VM(r)}a(U,"object");function St(t,e){return new VM({type:"object",shape:t,catchall:He(),...ye.normalizeParams(e)})}a(St,"looseObject");var HM=$("ZodUnion",(t,e)=>{pf.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Jb(t,r,n,o),t.options=e.options});function De(t,e){return new HM({type:"union",options:t,...ye.normalizeParams(e)})}a(De,"union");var VG=$("ZodDiscriminatedUnion",(t,e)=>{HM.init(t,e),Pv.init(t,e)});function dw(t,e,r){return new VG({type:"union",options:e,discriminator:t,...ye.normalizeParams(r)})}a(dw,"discriminatedUnion");var HG=$("ZodIntersection",(t,e)=>{Iv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Wb(t,r,n,o)});function $f(t,e){return new HG({type:"intersection",left:t,right:e})}a($f,"intersection");var DM=$("ZodRecord",(t,e)=>{Cv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Kb(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function Me(t,e,r){return!e||!e._zod?new DM({type:"record",keyType:S(),valueType:t,...ye.normalizeParams(e)}):new DM({type:"record",keyType:t,valueType:e,...ye.normalizeParams(r)})}a(Me,"record");var lw=$("ZodEnum",(t,e)=>{Rv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Ub(t,n,o,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=e.entries[i];else throw new Error(`Key ${i} not found in enum`);return new lw({...e,checks:[],...ye.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new lw({...e,checks:[],...ye.normalizeParams(o),entries:s})}});function It(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new lw({type:"enum",entries:r,...ye.normalizeParams(e)})}a(It,"_enum");var BG=$("ZodLiteral",(t,e)=>{Av.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>qb(t,r,n,o),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function J(t,e){return new BG({type:"literal",values:Array.isArray(t)?t:[t],...ye.normalizeParams(e)})}a(J,"literal");var GG=$("ZodTransform",(t,e)=>{jv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Hb(t,r,n,o),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ri(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(ye.issue(s,r.value,e));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),r.issues.push(ye.issue(i))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function BM(t){return new GG({type:"transform",transform:t})}a(BM,"transform");var Ef=$("ZodOptional",(t,e)=>{ff.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>bf(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function Be(t){return new Ef({type:"optional",innerType:t})}a(Be,"optional");var JG=$("ZodExactOptional",(t,e)=>{Mv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>bf(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function WG(t){return new JG({type:"optional",innerType:t})}a(WG,"exactOptional");var KG=$("ZodNullable",(t,e)=>{Dv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Yb(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function ZM(t){return new KG({type:"nullable",innerType:t})}a(ZM,"nullable");var YG=$("ZodDefault",(t,e)=>{Zv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Qb(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function XG(t,e){return new YG({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():ye.shallowClone(e)}})}a(XG,"_default");var QG=$("ZodPrefault",(t,e)=>{Lv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ew(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function eJ(t,e){return new QG({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():ye.shallowClone(e)}})}a(eJ,"prefault");var GM=$("ZodNonOptional",(t,e)=>{Fv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Xb(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function tJ(t,e){return new GM({type:"nonoptional",innerType:t,...ye.normalizeParams(e)})}a(tJ,"nonoptional");var rJ=$("ZodCatch",(t,e)=>{Uv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>tw(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function nJ(t,e){return new rJ({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(nJ,"_catch");var JM=$("ZodPipe",(t,e)=>{mf.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>rw(t,r,n,o),t.in=e.in,t.out=e.out});function LM(t,e){return new JM({type:"pipe",in:t,out:e})}a(LM,"pipe");var oJ=$("ZodPreprocess",(t,e)=>{JM.init(t,e),Hj.init(t,e)}),sJ=$("ZodReadonly",(t,e)=>{qv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>nw(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function aJ(t){return new sJ({type:"readonly",innerType:t})}a(aJ,"readonly");var WM=$("ZodCustom",(t,e)=>{Vv.init(t,e),Ge.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Vb(t,r,n,o)});function KM(t,e){return Cb(WM,t??(()=>!0),e)}a(KM,"custom");function iJ(t,e={}){return Rb(WM,t,e)}a(iJ,"refine");function cJ(t,e){return Ab(t,e)}a(cJ,"superRefine");function pw(t,e){return new oJ({type:"pipe",in:BM(t),out:e})}a(pw,"preprocess");Wt(Hv());var mw="2025-11-25";var YM=[mw,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],bo="io.modelcontextprotocol/related-task",zf="2.0",Xe=KM(t=>t!==null&&(typeof t=="object"||typeof t=="function")),XM=De([S(),Te().int()]),QM=S(),vRe=St({ttl:Te().optional(),pollInterval:Te().optional()}),uJ=U({ttl:Te().optional()}),lJ=U({taskId:S()}),hw=St({progressToken:XM.optional(),[bo]:lJ.optional()}),Xt=U({_meta:hw.optional()}),Hu=Xt.extend({task:uJ.optional()}),eD=a(t=>Hu.safeParse(t).success,"isTaskAugmentedRequestParams"),it=U({method:S(),params:Xt.loose().optional()}),hr=U({_meta:hw.optional()}),gr=U({method:S(),params:hr.loose().optional()}),ct=St({_meta:hw.optional()}),Of=De([S(),Te().int()]),tD=U({jsonrpc:J(zf),id:Of,...it.shape}).strict(),gw=a(t=>tD.safeParse(t).success,"isJSONRPCRequest"),rD=U({jsonrpc:J(zf),...gr.shape}).strict(),nD=a(t=>rD.safeParse(t).success,"isJSONRPCNotification"),yw=U({jsonrpc:J(zf),id:Of,result:ct}).strict(),Bu=a(t=>yw.safeParse(t).success,"isJSONRPCResultResponse");var X;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(X||(X={}));var _w=U({jsonrpc:J(zf),id:Of.optional(),error:U({code:Te().int(),message:S(),data:He().optional()})}).strict();var oD=a(t=>_w.safeParse(t).success,"isJSONRPCErrorResponse");var sD=De([tD,rD,yw,_w]),bRe=De([yw,_w]),Pf=ct.strict(),dJ=hr.extend({requestId:Of.optional(),reason:S().optional()}),If=gr.extend({method:J("notifications/cancelled"),params:dJ}),pJ=U({src:S(),mimeType:S().optional(),sizes:_e(S()).optional(),theme:It(["light","dark"]).optional()}),Gu=U({icons:_e(pJ).optional()}),li=U({name:S(),title:S().optional()}),aD=li.extend({...li.shape,...Gu.shape,version:S(),websiteUrl:S().optional(),description:S().optional()}),fJ=$f(U({applyDefaults:rt().optional()}),Me(S(),He())),mJ=pw(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,$f(U({form:fJ.optional(),url:Xe.optional()}),Me(S(),He()).optional())),hJ=St({list:Xe.optional(),cancel:Xe.optional(),requests:St({sampling:St({createMessage:Xe.optional()}).optional(),elicitation:St({create:Xe.optional()}).optional()}).optional()}),gJ=St({list:Xe.optional(),cancel:Xe.optional(),requests:St({tools:St({call:Xe.optional()}).optional()}).optional()}),yJ=U({experimental:Me(S(),Xe).optional(),sampling:U({context:Xe.optional(),tools:Xe.optional()}).optional(),elicitation:mJ.optional(),roots:U({listChanged:rt().optional()}).optional(),tasks:hJ.optional(),extensions:Me(S(),Xe).optional()}),_J=Xt.extend({protocolVersion:S(),capabilities:yJ,clientInfo:aD}),xw=it.extend({method:J("initialize"),params:_J});var xJ=U({experimental:Me(S(),Xe).optional(),logging:Xe.optional(),completions:Xe.optional(),prompts:U({listChanged:rt().optional()}).optional(),resources:U({subscribe:rt().optional(),listChanged:rt().optional()}).optional(),tools:U({listChanged:rt().optional()}).optional(),tasks:gJ.optional(),extensions:Me(S(),Xe).optional()}),vJ=ct.extend({protocolVersion:S(),capabilities:xJ,serverInfo:aD,instructions:S().optional()}),vw=gr.extend({method:J("notifications/initialized"),params:hr.optional()});var Cf=it.extend({method:J("ping"),params:Xt.optional()}),bJ=U({progress:Te(),total:Be(Te()),message:Be(S())}),wJ=U({...hr.shape,...bJ.shape,progressToken:XM}),Rf=gr.extend({method:J("notifications/progress"),params:wJ}),kJ=Xt.extend({cursor:QM.optional()}),Ju=it.extend({params:kJ.optional()}),Wu=ct.extend({nextCursor:QM.optional()}),SJ=It(["working","input_required","completed","failed","cancelled"]),Ku=U({taskId:S(),status:SJ,ttl:De([Te(),qM()]),createdAt:S(),lastUpdatedAt:S(),pollInterval:Be(Te()),statusMessage:Be(S())}),di=ct.extend({task:Ku}),$J=hr.merge(Ku),Yu=gr.extend({method:J("notifications/tasks/status"),params:$J}),Af=it.extend({method:J("tasks/get"),params:Xt.extend({taskId:S()})}),jf=ct.merge(Ku),Mf=it.extend({method:J("tasks/result"),params:Xt.extend({taskId:S()})}),wRe=ct.loose(),Df=Ju.extend({method:J("tasks/list")}),Zf=Wu.extend({tasks:_e(Ku)}),Lf=it.extend({method:J("tasks/cancel"),params:Xt.extend({taskId:S()})}),iD=ct.merge(Ku),cD=U({uri:S(),mimeType:Be(S()),_meta:Me(S(),He()).optional()}),uD=cD.extend({text:S()}),bw=S().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),lD=cD.extend({blob:bw}),Xu=It(["user","assistant"]),pi=U({audience:_e(Xu).optional(),priority:Te().min(0).max(1).optional(),lastModified:qu.datetime({offset:!0}).optional()}),dD=U({...li.shape,...Gu.shape,uri:S(),description:Be(S()),mimeType:Be(S()),size:Be(Te()),annotations:pi.optional(),_meta:Be(St({}))}),EJ=U({...li.shape,...Gu.shape,uriTemplate:S(),description:Be(S()),mimeType:Be(S()),annotations:pi.optional(),_meta:Be(St({}))}),Ff=Ju.extend({method:J("resources/list")}),NJ=Wu.extend({resources:_e(dD)}),Uf=Ju.extend({method:J("resources/templates/list")}),TJ=Wu.extend({resourceTemplates:_e(EJ)}),ww=Xt.extend({uri:S()}),zJ=ww,qf=it.extend({method:J("resources/read"),params:zJ}),OJ=ct.extend({contents:_e(De([uD,lD]))}),PJ=gr.extend({method:J("notifications/resources/list_changed"),params:hr.optional()}),IJ=ww,CJ=it.extend({method:J("resources/subscribe"),params:IJ}),RJ=ww,AJ=it.extend({method:J("resources/unsubscribe"),params:RJ}),jJ=hr.extend({uri:S()}),MJ=gr.extend({method:J("notifications/resources/updated"),params:jJ}),DJ=U({name:S(),description:Be(S()),required:Be(rt())}),ZJ=U({...li.shape,...Gu.shape,description:Be(S()),arguments:Be(_e(DJ)),_meta:Be(St({}))}),Vf=Ju.extend({method:J("prompts/list")}),LJ=Wu.extend({prompts:_e(ZJ)}),FJ=Xt.extend({name:S(),arguments:Me(S(),S()).optional()}),Hf=it.extend({method:J("prompts/get"),params:FJ}),kw=U({type:J("text"),text:S(),annotations:pi.optional(),_meta:Me(S(),He()).optional()}),Sw=U({type:J("image"),data:bw,mimeType:S(),annotations:pi.optional(),_meta:Me(S(),He()).optional()}),$w=U({type:J("audio"),data:bw,mimeType:S(),annotations:pi.optional(),_meta:Me(S(),He()).optional()}),UJ=U({type:J("tool_use"),name:S(),id:S(),input:Me(S(),He()),_meta:Me(S(),He()).optional()}),qJ=U({type:J("resource"),resource:De([uD,lD]),annotations:pi.optional(),_meta:Me(S(),He()).optional()}),VJ=dD.extend({type:J("resource_link")}),Ew=De([kw,Sw,$w,VJ,qJ]),HJ=U({role:Xu,content:Ew}),BJ=ct.extend({description:S().optional(),messages:_e(HJ)}),GJ=gr.extend({method:J("notifications/prompts/list_changed"),params:hr.optional()}),JJ=U({title:S().optional(),readOnlyHint:rt().optional(),destructiveHint:rt().optional(),idempotentHint:rt().optional(),openWorldHint:rt().optional()}),WJ=U({taskSupport:It(["required","optional","forbidden"]).optional()}),pD=U({...li.shape,...Gu.shape,description:S().optional(),inputSchema:U({type:J("object"),properties:Me(S(),Xe).optional(),required:_e(S()).optional()}).catchall(He()),outputSchema:U({type:J("object"),properties:Me(S(),Xe).optional(),required:_e(S()).optional()}).catchall(He()).optional(),annotations:JJ.optional(),execution:WJ.optional(),_meta:Me(S(),He()).optional()}),Bf=Ju.extend({method:J("tools/list")}),KJ=Wu.extend({tools:_e(pD)}),Gf=ct.extend({content:_e(Ew).default([]),structuredContent:Me(S(),He()).optional(),isError:rt().optional()}),kRe=Gf.or(ct.extend({toolResult:He()})),YJ=Hu.extend({name:S(),arguments:Me(S(),He()).optional()}),fi=it.extend({method:J("tools/call"),params:YJ}),XJ=gr.extend({method:J("notifications/tools/list_changed"),params:hr.optional()}),SRe=U({autoRefresh:rt().default(!0),debounceMs:Te().int().nonnegative().default(300)}),Qu=It(["debug","info","notice","warning","error","critical","alert","emergency"]),QJ=Xt.extend({level:Qu}),Nw=it.extend({method:J("logging/setLevel"),params:QJ}),eW=hr.extend({level:Qu,logger:S().optional(),data:He()}),tW=gr.extend({method:J("notifications/message"),params:eW}),rW=U({name:S().optional()}),nW=U({hints:_e(rW).optional(),costPriority:Te().min(0).max(1).optional(),speedPriority:Te().min(0).max(1).optional(),intelligencePriority:Te().min(0).max(1).optional()}),oW=U({mode:It(["auto","required","none"]).optional()}),sW=U({type:J("tool_result"),toolUseId:S().describe("The unique identifier for the corresponding tool call."),content:_e(Ew).default([]),structuredContent:U({}).loose().optional(),isError:rt().optional(),_meta:Me(S(),He()).optional()}),aW=dw("type",[kw,Sw,$w]),Nf=dw("type",[kw,Sw,$w,UJ,sW]),iW=U({role:Xu,content:De([Nf,_e(Nf)]),_meta:Me(S(),He()).optional()}),cW=Hu.extend({messages:_e(iW),modelPreferences:nW.optional(),systemPrompt:S().optional(),includeContext:It(["none","thisServer","allServers"]).optional(),temperature:Te().optional(),maxTokens:Te().int(),stopSequences:_e(S()).optional(),metadata:Xe.optional(),tools:_e(pD).optional(),toolChoice:oW.optional()}),uW=it.extend({method:J("sampling/createMessage"),params:cW}),el=ct.extend({model:S(),stopReason:Be(It(["endTurn","stopSequence","maxTokens"]).or(S())),role:Xu,content:aW}),Tw=ct.extend({model:S(),stopReason:Be(It(["endTurn","stopSequence","maxTokens","toolUse"]).or(S())),role:Xu,content:De([Nf,_e(Nf)])}),lW=U({type:J("boolean"),title:S().optional(),description:S().optional(),default:rt().optional()}),dW=U({type:J("string"),title:S().optional(),description:S().optional(),minLength:Te().optional(),maxLength:Te().optional(),format:It(["email","uri","date","date-time"]).optional(),default:S().optional()}),pW=U({type:It(["number","integer"]),title:S().optional(),description:S().optional(),minimum:Te().optional(),maximum:Te().optional(),default:Te().optional()}),fW=U({type:J("string"),title:S().optional(),description:S().optional(),enum:_e(S()),default:S().optional()}),mW=U({type:J("string"),title:S().optional(),description:S().optional(),oneOf:_e(U({const:S(),title:S()})),default:S().optional()}),hW=U({type:J("string"),title:S().optional(),description:S().optional(),enum:_e(S()),enumNames:_e(S()).optional(),default:S().optional()}),gW=De([fW,mW]),yW=U({type:J("array"),title:S().optional(),description:S().optional(),minItems:Te().optional(),maxItems:Te().optional(),items:U({type:J("string"),enum:_e(S())}),default:_e(S()).optional()}),_W=U({type:J("array"),title:S().optional(),description:S().optional(),minItems:Te().optional(),maxItems:Te().optional(),items:U({anyOf:_e(U({const:S(),title:S()}))}),default:_e(S()).optional()}),xW=De([yW,_W]),vW=De([hW,gW,xW]),bW=De([vW,lW,dW,pW]),wW=Hu.extend({mode:J("form").optional(),message:S(),requestedSchema:U({type:J("object"),properties:Me(S(),bW),required:_e(S()).optional()})}),kW=Hu.extend({mode:J("url"),message:S(),elicitationId:S(),url:S().url()}),SW=De([wW,kW]),$W=it.extend({method:J("elicitation/create"),params:SW}),EW=hr.extend({elicitationId:S()}),NW=gr.extend({method:J("notifications/elicitation/complete"),params:EW}),mi=ct.extend({action:It(["accept","decline","cancel"]),content:pw(t=>t===null?void 0:t,Me(S(),De([S(),Te(),rt(),_e(S())])).optional())}),TW=U({type:J("ref/resource"),uri:S()});var zW=U({type:J("ref/prompt"),name:S()}),OW=Xt.extend({ref:De([zW,TW]),argument:U({name:S(),value:S()}),context:U({arguments:Me(S(),S()).optional()}).optional()}),Jf=it.extend({method:J("completion/complete"),params:OW});function fD(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}a(fD,"assertCompleteRequestPrompt");function mD(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}a(mD,"assertCompleteRequestResourceTemplate");var PW=ct.extend({completion:St({values:_e(S()).max(100),total:Be(Te().int()),hasMore:Be(rt())})}),IW=U({uri:S().startsWith("file://"),name:S().optional(),_meta:Me(S(),He()).optional()}),CW=it.extend({method:J("roots/list"),params:Xt.optional()}),zw=ct.extend({roots:_e(IW)}),RW=gr.extend({method:J("notifications/roots/list_changed"),params:hr.optional()}),$Re=De([Cf,xw,Jf,Nw,Hf,Vf,Ff,Uf,qf,CJ,AJ,fi,Bf,Af,Mf,Df,Lf]),ERe=De([If,Rf,vw,RW,Yu]),NRe=De([Pf,el,Tw,mi,zw,jf,Zf,di]),TRe=De([Cf,uW,$W,CW,Af,Mf,Df,Lf]),zRe=De([If,Rf,tW,MJ,PJ,XJ,GJ,Yu,NW]),ORe=De([Pf,vJ,PW,BJ,LJ,NJ,TJ,OJ,Gf,KJ,jf,Zf,di]),Tf=class Tf extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===X.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new fw(o.elicitations,r)}return new Tf(e,r,n)}};a(Tf,"McpError");var G=Tf,Ow=class Ow extends G{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(X.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(Ow,"UrlElicitationRequiredError");var fw=Ow;function wo(t){return t==="completed"||t==="failed"||t==="cancelled"}a(wo,"isTerminal");var gD=Symbol("Let zodToJsonSchema decide on which parser to use");var hD={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},yD=a(t=>typeof t=="string"?{...hD,name:t}:{...hD,...t},"getDefaultOptions");var _D=a(t=>{let e=yD(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}},"getRefs");function Pw(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}a(Pw,"addErrorMessage");function xe(t,e,r,n,o){t[e]=r,Pw(t,e,n,o)}a(xe,"setResponseValueAndErrors");var Wf=a((t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")},"getRelativePath");function Je(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?Wf(e,t.currentPath):e.join("/")}}a(Je,"parseAnyDef");function xD(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==I.ZodAny&&(r.items=re(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&xe(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&xe(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(xe(r,"minItems",t.exactLength.value,t.exactLength.message,e),xe(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}a(xD,"parseArrayDef");function vD(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?xe(r,"minimum",n.value,n.message,e):xe(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),xe(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?xe(r,"maximum",n.value,n.message,e):xe(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),xe(r,"maximum",n.value,n.message,e));break;case"multipleOf":xe(r,"multipleOf",n.value,n.message,e);break}return r}a(vD,"parseBigintDef");function bD(){return{type:"boolean"}}a(bD,"parseBooleanDef");function Kf(t,e){return re(t.type._def,e)}a(Kf,"parseBrandedDef");var wD=a((t,e)=>re(t.innerType._def,e),"parseCatchDef");function Iw(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>Iw(t,e,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return AW(t,e)}}a(Iw,"parseDateDef");var AW=a((t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":xe(r,"minimum",n.value,n.message,e);break;case"max":xe(r,"maximum",n.value,n.message,e);break}return r},"integerDateParser");function kD(t,e){return{...re(t.innerType._def,e),default:t.defaultValue()}}a(kD,"parseDefaultDef");function SD(t,e){return e.effectStrategy==="input"?re(t.schema._def,e):Je(e)}a(SD,"parseEffectsDef");function $D(t){return{type:"string",enum:Array.from(t.values)}}a($D,"parseEnumDef");var jW=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function ED(t,e){let r=[re(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),re(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(s=>{if(jW(s))o.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:c,...u}=s;i=u}else n=void 0;o.push(i)}}),o.length?{allOf:o,...n}:void 0}a(ED,"parseIntersectionDef");function ND(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}a(ND,"parseLiteralDef");var Cw,Ir={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Cw===void 0&&(Cw=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Cw),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Yf(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":xe(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":xe(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Cr(r,"email",n.message,e);break;case"format:idn-email":Cr(r,"idn-email",n.message,e);break;case"pattern:zod":$t(r,Ir.email,n.message,e);break}break;case"url":Cr(r,"uri",n.message,e);break;case"uuid":Cr(r,"uuid",n.message,e);break;case"regex":$t(r,n.regex,n.message,e);break;case"cuid":$t(r,Ir.cuid,n.message,e);break;case"cuid2":$t(r,Ir.cuid2,n.message,e);break;case"startsWith":$t(r,RegExp(`^${Rw(n.value,e)}`),n.message,e);break;case"endsWith":$t(r,RegExp(`${Rw(n.value,e)}$`),n.message,e);break;case"datetime":Cr(r,"date-time",n.message,e);break;case"date":Cr(r,"date",n.message,e);break;case"time":Cr(r,"time",n.message,e);break;case"duration":Cr(r,"duration",n.message,e);break;case"length":xe(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),xe(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{$t(r,RegExp(Rw(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&Cr(r,"ipv4",n.message,e),n.version!=="v4"&&Cr(r,"ipv6",n.message,e);break}case"base64url":$t(r,Ir.base64url,n.message,e);break;case"jwt":$t(r,Ir.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&$t(r,Ir.ipv4Cidr,n.message,e),n.version!=="v4"&&$t(r,Ir.ipv6Cidr,n.message,e);break}case"emoji":$t(r,Ir.emoji(),n.message,e);break;case"ulid":{$t(r,Ir.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Cr(r,"binary",n.message,e);break}case"contentEncoding:base64":{xe(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{$t(r,Ir.base64,n.message,e);break}}break}case"nanoid":$t(r,Ir.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}a(Yf,"parseStringDef");function Rw(t,e){return e.patternStrategy==="escape"?DW(t):t}a(Rw,"escapeLiteralCheckValue");var MW=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function DW(t){let e="";for(let r=0;r<t.length;r++)MW.has(t[r])||(e+="\\"),e+=t[r];return e}a(DW,"escapeNonAlphaNumeric");function Cr(t,e,r,n){t.format||t.anyOf?.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):xe(t,"format",e,r,n)}a(Cr,"addFormat");function $t(t,e,r,n){t.pattern||t.allOf?.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:TD(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):xe(t,"pattern",TD(e,n),r,n)}a($t,"addPattern");function TD(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,o="",s=!1,i=!1,c=!1;for(let u=0;u<n.length;u++){if(s){o+=n[u],s=!1;continue}if(r.i){if(i){if(n[u].match(/[a-z]/)){c?(o+=n[u],o+=`${n[u-2]}-${n[u]}`.toUpperCase(),c=!1):n[u+1]==="-"&&n[u+2]?.match(/[a-z]/)?(o+=n[u],c=!0):o+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){o+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(r.m){if(n[u]==="^"){o+=`(^|(?<=[\r
273
+ ]))`;continue}else if(n[u]==="$"){o+=`($|(?=[\r
274
+ ]))`;continue}}if(r.s&&n[u]==="."){o+=i?`${n[u]}\r
275
+ `:`[${n[u]}\r
276
+ ]`;continue}o+=n[u],n[u]==="\\"?s=!0:i&&n[u]==="]"?i=!1:!i&&n[u]==="["&&(i=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return o}a(TD,"stringifyRegExpWithFlags");function Xf(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===I.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,o)=>({...n,[o]:re(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??Je(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:re(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===I.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=Yf(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===I.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===I.ZodBranded&&t.keyType._def.type._def.typeName===I.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=Kf(t.keyType._def,e);return{...r,propertyNames:o}}}return r}a(Xf,"parseRecordDef");function zD(t,e){if(e.mapStrategy==="record")return Xf(t,e);let r=re(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Je(e),n=re(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Je(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}a(zD,"parseMapDef");function OD(t){let e=t.values,n=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),o=Array.from(new Set(n.map(s=>typeof s)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}a(OD,"parseNativeEnumDef");function PD(t){return t.target==="openAi"?void 0:{not:Je({...t,currentPath:[...t.currentPath,"not"]})}}a(PD,"parseNeverDef");function ID(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}a(ID,"parseNullDef");var tl={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function RD(t,e){if(e.target==="openApi3")return CD(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in tl&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let i=tl[s._def.typeName];return i&&!o.includes(i)?[...o,i]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...o,i];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(n.length===r.length){let o=n.filter((s,i,c)=>c.indexOf(s)===i);return{type:o.length>1?o:o[0],enum:r.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(s=>!n.includes(s))],[])};return CD(t,e)}a(RD,"parseUnionDef");var CD=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>re(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0},"asAnyOf");function AD(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:tl[t.innerType._def.typeName],nullable:!0}:{type:[tl[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=re(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=re(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}a(AD,"parseNullableDef");function jD(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",Pw(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?xe(r,"minimum",n.value,n.message,e):xe(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),xe(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?xe(r,"maximum",n.value,n.message,e):xe(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),xe(r,"maximum",n.value,n.message,e));break;case"multipleOf":xe(r,"multipleOf",n.value,n.message,e);break}return r}a(jD,"parseNumberDef");function MD(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},o=[],s=t.shape();for(let c in s){let u=s[c];if(u===void 0||u._def===void 0)continue;let l=LW(u);l&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),l=!1);let d=re(u._def,{...e,currentPath:[...e.currentPath,"properties",c],propertyPath:[...e.currentPath,"properties",c]});d!==void 0&&(n.properties[c]=d,l||o.push(c))}o.length&&(n.required=o);let i=ZW(t,e);return i!==void 0&&(n.additionalProperties=i),n}a(MD,"parseObjectDef");function ZW(t,e){if(t.catchall._def.typeName!=="ZodNever")return re(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}a(ZW,"decideAdditionalProperties");function LW(t){try{return t.isOptional()}catch{return!0}}a(LW,"safeIsOptional");var DD=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return re(t.innerType._def,e);let r=re(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Je(e)},r]}:Je(e)},"parseOptionalDef");var ZD=a((t,e)=>{if(e.pipeStrategy==="input")return re(t.in._def,e);if(e.pipeStrategy==="output")return re(t.out._def,e);let r=re(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=re(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"parsePipelineDef");function LD(t,e){return re(t.type._def,e)}a(LD,"parsePromiseDef");function FD(t,e){let n={type:"array",uniqueItems:!0,items:re(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&xe(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&xe(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}a(FD,"parseSetDef");function UD(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>re(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:re(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>re(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}a(UD,"parseTupleDef");function qD(t){return{not:Je(t)}}a(qD,"parseUndefinedDef");function VD(t){return Je(t)}a(VD,"parseUnknownDef");var HD=a((t,e)=>re(t.innerType._def,e),"parseReadonlyDef");var BD=a((t,e,r)=>{switch(e){case I.ZodString:return Yf(t,r);case I.ZodNumber:return jD(t,r);case I.ZodObject:return MD(t,r);case I.ZodBigInt:return vD(t,r);case I.ZodBoolean:return bD();case I.ZodDate:return Iw(t,r);case I.ZodUndefined:return qD(r);case I.ZodNull:return ID(r);case I.ZodArray:return xD(t,r);case I.ZodUnion:case I.ZodDiscriminatedUnion:return RD(t,r);case I.ZodIntersection:return ED(t,r);case I.ZodTuple:return UD(t,r);case I.ZodRecord:return Xf(t,r);case I.ZodLiteral:return ND(t,r);case I.ZodEnum:return $D(t);case I.ZodNativeEnum:return OD(t);case I.ZodNullable:return AD(t,r);case I.ZodOptional:return DD(t,r);case I.ZodMap:return zD(t,r);case I.ZodSet:return FD(t,r);case I.ZodLazy:return()=>t.getter()._def;case I.ZodPromise:return LD(t,r);case I.ZodNaN:case I.ZodNever:return PD(r);case I.ZodEffects:return SD(t,r);case I.ZodAny:return Je(r);case I.ZodUnknown:return VD(r);case I.ZodDefault:return kD(t,r);case I.ZodBranded:return Kf(t,r);case I.ZodReadonly:return HD(t,r);case I.ZodCatch:return wD(t,r);case I.ZodPipeline:return ZD(t,r);case I.ZodFunction:case I.ZodVoid:case I.ZodSymbol:return;default:return(n=>{})(e)}},"selectParser");function re(t,e,r=!1){let n=e.seen.get(t);if(e.override){let c=e.override?.(t,e,n,r);if(c!==gD)return c}if(n&&!r){let c=FW(n,e);if(c!==void 0)return c}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let s=BD(t,t.typeName,e),i=typeof s=="function"?re(s(),e):s;if(i&&UW(t,e,i),e.postProcess){let c=e.postProcess(i,t,e);return o.jsonSchema=i,c}return o.jsonSchema=i,i}a(re,"parseDef");var FW=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Wf(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,n)=>e.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),Je(e)):e.$refStrategy==="seen"?Je(e):void 0}},"get$ref"),UW=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"addMeta");var Aw=a((t,e)=>{let r=_D(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[l,d])=>({...u,[l]:re(d._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??Je(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=re(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??Je(r),i=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;i!==void 0&&(s.title=i),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let c=o===void 0?n?{...s,[r.definitionPath]:n}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:s}};return r.target==="jsonSchema7"?c.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(c.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in c||"oneOf"in c||"allOf"in c||"type"in c&&Array.isArray(c.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),c},"zodToJsonSchema");function qW(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}a(qW,"mapMiniTarget");function jw(t,e){return Qr(t)?ow(t,{target:qW(e?.target),io:e?.pipeStrategy??"input"}):Aw(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}a(jw,"toJsonSchemaCompat");function Mw(t){let r=vo(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=ui(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(Mw,"getMethodLiteral");function Dw(t,e){let r=xo(t,e);if(!r.success)throw r.error;return r.data}a(Dw,"parseWithCompat");var VW=6e4,Zw=class Zw{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(If,r=>{this._oncancel(r)}),this.setNotificationHandler(Rf,r=>{this._onprogress(r)}),this.setRequestHandler(Cf,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Af,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new G(X.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Mf,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(c.type==="response"||c.type==="error"){let u=c.message,l=u.id,d=this._requestResolvers.get(l);if(d)if(this._requestResolvers.delete(l),c.type==="response")d(u);else{let m=u,h=new G(m.error.code,m.error.message,m.error.data);d(h)}else{let m=c.type==="response"?"Response":"Error";this._onerror(new Error(`${m} handler missing for request ${l}`))}continue}await this._transport?.send(c.message,{relatedRequestId:n.requestId})}}let i=await this._taskStore.getTask(s,n.sessionId);if(!i)throw new G(X.InvalidParams,`Task not found: ${s}`);if(!wo(i.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(wo(i.status)){let c=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...c,_meta:{...c._meta,[bo]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(Df,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new G(X.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Lf,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new G(X.InvalidParams,`Task not found: ${r.params.taskId}`);if(wo(o.status))throw new G(X.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new G(X.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof G?o:new G(X.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),G.fromError(X.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{o?.(s,i),Bu(s)||oD(s)?this._onresponse(s):gw(s)?this._onrequest(s,i):nD(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=G.fromError(X.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[bo]?.taskId;if(n===void 0){let d={jsonrpc:"2.0",id:e.id,error:{code:X.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:d,timestamp:Date.now()},o?.sessionId).catch(m=>this._onerror(new Error(`Failed to enqueue error response: ${m}`))):o?.send(d).catch(m=>this._onerror(new Error(`Failed to send an error response: ${m}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let c=eD(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,l={signal:i.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async d=>{if(i.signal.aborted)return;let m={relatedRequestId:e.id};s&&(m.relatedTask={taskId:s}),await this.notification(d,m)},sendRequest:async(d,m,h)=>{if(i.signal.aborted)throw new G(X.ConnectionClosed,"Request was cancelled");let f={...h,relatedRequestId:e.id};s&&!f.relatedTask&&(f.relatedTask={taskId:s});let g=f.relatedTask?.taskId??s;return g&&u&&await u.updateTaskStatus(g,"input_required"),await this.request(d,m,f)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:c?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{c&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,l)).then(async d=>{if(i.signal.aborted)return;let m={result:d,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:m,timestamp:Date.now()},o?.sessionId):await o?.send(m)},async d=>{if(i.signal.aborted)return;let m={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(d.code)?d.code:X.InternalError,message:d.message??"Internal error",...d.data!==void 0&&{data:d.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:m,timestamp:Date.now()},o?.sessionId):await o?.send(m)}).catch(d=>this._onerror(new Error(`Failed to send response: ${d}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===i&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(o),c=this._timeoutInfo.get(o);if(c&&i&&c.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Bu(e))n(e);else{let i=new G(e.error.code,e.error.message,e.error.data);n(i)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(Bu(e)&&e.result&&typeof e.result=="object"){let i=e.result;if(i.task&&typeof i.task=="object"){let c=i.task;typeof c.taskId=="string"&&(s=!0,this._taskProgressTokens.set(c.taskId,r))}}if(s||this._progressHandlers.delete(r),Bu(e))o(e);else{let i=G.fromError(e.error.code,e.error.message,e.error.data);o(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(i){yield{type:"error",error:i instanceof G?i:new G(X.InternalError,String(i))}}return}let s;try{let i=await this.request(e,di,n);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new G(X.InternalError,"Task creation did not return a task");for(;;){let c=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:c},wo(c.status)){c.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:c.status==="failed"?yield{type:"error",error:new G(X.InternalError,`Task ${s} failed`)}:c.status==="cancelled"&&(yield{type:"error",error:new G(X.InternalError,`Task ${s} was cancelled`)});return}if(c.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=c.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,u)),n?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof G?i:new G(X.InternalError,String(i))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i,task:c,relatedTask:u}=n??{};return new Promise((l,d)=>{let m=a(k=>{d(k)},"earlyReject");if(!this._transport){m(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),c&&this.assertTaskCapability(e.method)}catch(k){m(k);return}n?.signal?.throwIfAborted();let h=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:h};n?.onprogress&&(this._progressHandlers.set(h,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:h}}),c&&(f.params={...f.params,task:c}),u&&(f.params={...f.params,_meta:{...f.params?._meta||{},[bo]:u}});let g=a(k=>{this._responseHandlers.delete(h),this._progressHandlers.delete(h),this._cleanupTimeout(h),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(k)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(b=>this._onerror(new Error(`Failed to send cancellation: ${b}`)));let w=k instanceof G?k:new G(X.RequestTimeout,String(k));d(w)},"cancel");this._responseHandlers.set(h,k=>{if(!n?.signal?.aborted){if(k instanceof Error)return d(k);try{let w=xo(r,k.result);w.success?l(w.data):d(w.error)}catch(w){d(w)}}}),n?.signal?.addEventListener("abort",()=>{g(n?.signal?.reason)});let v=n?.timeout??VW,y=a(()=>g(G.fromError(X.RequestTimeout,"Request timed out",{timeout:v})),"timeoutHandler");this._setupTimeout(h,v,n?.maxTotalTimeout,y,n?.resetTimeoutOnProgress??!1);let x=u?.taskId;if(x){let k=a(w=>{let b=this._responseHandlers.get(h);b?b(w):this._onerror(new Error(`Response handler missing for side-channeled request ${h}`))},"responseResolver");this._requestResolvers.set(h,k),this._enqueueTaskMessage(x,{type:"request",message:f,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(h),d(w)})}else this._transport.send(f,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(k=>{this._cleanupTimeout(h),d(k)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},jf,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Zf,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},iD,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let c={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[bo]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:c,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let c={...e,jsonrpc:"2.0"};r?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[bo]:r.relatedTask}}}),this._transport?.send(c,r).catch(u=>this._onerror(u))});return}let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[bo]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let n=Mw(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let i=Dw(e,o);return Promise.resolve(r(i,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=Mw(e);this._notificationHandlers.set(n,o=>{let s=Dw(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&gw(o.message)){let s=o.message.id,i=this._requestResolvers.get(s);i?(i(new G(X.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new G(X.InvalidRequest,"Request cancelled"));return}let i=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(i),s(new G(X.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},getTask:async o=>{let s=await n.getTask(o,r);if(!s)throw new G(X.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(o,s,i)=>{await n.storeTaskResult(o,s,i,r);let c=await n.getTask(o,r);if(c){let u=Yu.parse({method:"notifications/tasks/status",params:c});await this.notification(u),wo(c.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,s,i)=>{let c=await n.getTask(o,r);if(!c)throw new G(X.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(wo(c.status))throw new G(X.InvalidParams,`Cannot update task "${o}" from terminal status "${c.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,i,r);let u=await n.getTask(o,r);if(u){let l=Yu.parse({method:"notifications/tasks/status",params:u});await this.notification(l),wo(u.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};a(Zw,"Protocol");var Qf=Zw;function GD(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(GD,"isPlainObject");function JD(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let i=r[o];GD(i)&&GD(s)?r[o]={...i,...s}:r[o]=s}return r}a(JD,"mergeCapabilities");var D4=t$(aS(),1),Z4=t$(M4(),1);function Wee(){let t=new D4.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Z4.default)(t),t}a(Wee,"createDefaultAjvInstance");var mS=class mS{constructor(e){this._ajv=e??Wee()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};a(mS,"AjvJsonSchemaValidator");var jm=mS;var hS=class hS{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],i=s.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],l=u.some(d=>d.type==="tool_use");if(i){if(s.some(d=>d.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!l)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(l){let d=new Set(u.filter(h=>h.type==="tool_use").map(h=>h.id)),m=new Set(s.filter(h=>h.type==="tool_result").map(h=>h.toolUseId));if(d.size!==m.size||![...d].every(h=>m.has(h)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},el,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),o=e.mode??"form";switch(o){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let s=o==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},mi,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};a(hS,"ExperimentalServerTasks");var Mm=hS;function L4(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}a(L4,"assertToolsCallTaskCapability");function F4(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}a(F4,"assertClientRequestTaskCapability");var gS=class gS extends Qf{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Qu.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(s):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new jm,this.setRequestHandler(xw,n=>this._oninitialize(n)),this.setNotificationHandler(vw,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(Nw,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=n.params,c=Qu.safeParse(i);return c.success&&this._loggingLevels.set(s,c.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Mm(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=JD(this._capabilities,e)}setRequestHandler(e,r){let o=vo(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s=ui(o);if(typeof s!="string")throw new Error("Schema method literal must be a string");if(s==="tools/call"){let c=a(async(u,l)=>{let d=xo(fi,u);if(!d.success){let g=d.error instanceof Error?d.error.message:String(d.error);throw new G(X.InvalidParams,`Invalid tools/call request: ${g}`)}let{params:m}=d.data,h=await Promise.resolve(r(u,l));if(m.task){let g=xo(di,h);if(!g.success){let v=g.error instanceof Error?g.error.message:String(g.error);throw new G(X.InvalidParams,`Invalid task creation result: ${v}`)}return g.data}let f=xo(Gf,h);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new G(X.InvalidParams,`Invalid tools/call result: ${g}`)}return f.data},"wrappedHandler");return super.setRequestHandler(e,c)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){F4(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&L4(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:YM.includes(r)?r:mw,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Pf)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(l=>l.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=i?Array.isArray(i.content)?i.content:[i.content]:[],u=c.some(l=>l.type==="tool_use");if(s){if(o.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let l=new Set(c.filter(m=>m.type==="tool_use").map(m=>m.id)),d=new Set(o.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(l.size!==d.size||![...l].every(m=>d.has(m)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},Tw,r):this.request({method:"sampling/createMessage",params:e},el,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=e;return this.request({method:"elicitation/create",params:o},mi,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=e.mode==="form"?e:{...e,mode:"form"},s=await this.request({method:"elicitation/create",params:o},mi,r);if(s.action==="accept"&&s.content&&o.requestedSchema)try{let c=this._jsonSchemaValidator.getValidator(o.requestedSchema)(s.content);if(!c.valid)throw new G(X.InvalidParams,`Elicitation response content does not match requested schema: ${c.errorMessage}`)}catch(i){throw i instanceof G?i:new G(X.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return s}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},zw,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};a(gS,"Server");var Dm=gS;var q4=Symbol.for("mcp.completable");function yS(t){return!!t&&typeof t=="object"&&q4 in t}a(yS,"isCompletable");function V4(t){return t[q4]?.complete}a(V4,"getCompleter");var U4;(function(t){t.Completable="McpCompletable"})(U4||(U4={}));var Kee=/^[A-Za-z0-9._-]{1,128}$/;function Yee(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!Kee.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,s)=>s.indexOf(n)===o);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}a(Yee,"validateToolName");function Xee(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}a(Xee,"issueToolNameWarning");function _S(t){let e=Yee(t);return Xee(t,e.warnings),e.isValid}a(_S,"validateAndWarnToolName");var xS=class xS{constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw new Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}};a(xS,"ExperimentalMcpServerTasks");var Zm=xS;var bS=class bS{constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new Dm(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new Zm(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(Po(Bf)),this.server.assertCanSetRequestHandler(Po(fi)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(Bf,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let o=ci(r.inputSchema);return o?jw(o,{strictUnions:!0,pipeStrategy:"input"}):Qee})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=ci(r.outputSchema);o&&(n.outputSchema=jw(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(fi,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new G(X.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new G(X.InvalidParams,`Tool ${e.params.name} disabled`);let o=!!e.params.task,s=n.execution?.taskSupport,i="createTask"in n.handler;if((s==="required"||s==="optional")&&!i)throw new G(X.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new G(X.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(s==="optional"&&!o&&i)return await this.handleAutomaticTaskPolling(n,e,r);let c=await this.validateToolInput(n,e.params.arguments,e.params.name),u=await this.executeToolHandler(n,c,r);return o||await this.validateToolOutput(n,u,e.params.name),u}catch(n){if(n instanceof G&&n.code===X.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let s=ci(e.inputSchema)??e.inputSchema,i=await wf(s,r);if(!i.success){let c="error"in i?i.error:"Unknown error",u=kf(c);throw new G(X.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${u}`)}return i.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new G(X.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=ci(e.outputSchema),s=await wf(o,r.structuredContent);if(!s.success){let i="error"in s?s.error:"Unknown error",c=kf(i);throw new G(X.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${c}`)}}async executeToolHandler(e,r,n){let o=e.handler;if("createTask"in o){if(!n.taskStore)throw new Error("No task store provided.");let i={...n,taskStore:n.taskStore};if(e.inputSchema){let c=o;return await Promise.resolve(c.createTask(r,i))}else{let c=o;return await Promise.resolve(c.createTask(i))}}if(e.inputSchema){let i=o;return await Promise.resolve(i(r,n))}else{let i=o;return await Promise.resolve(i(n))}}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw new Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(e,r.params.arguments,r.params.name),s=e.handler,i={...n,taskStore:n.taskStore},c=o?await Promise.resolve(s.createTask(o,i)):await Promise.resolve(s.createTask(i)),u=c.task.taskId,l=c.task,d=l.pollInterval??5e3;for(;l.status!=="completed"&&l.status!=="failed"&&l.status!=="cancelled";){await new Promise(h=>setTimeout(h,d));let m=await n.taskStore.getTask(u);if(!m)throw new G(X.InternalError,`Task ${u} not found during polling`);l=m}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(Po(Jf)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(Jf,async e=>{switch(e.params.ref.type){case"ref/prompt":return fD(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return mD(e),this.handleResourceCompletion(e,e.params.ref);default:throw new G(X.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new G(X.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new G(X.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return Pl;let s=vo(n.argsSchema)?.[e.params.argument.name];if(!yS(s))return Pl;let i=V4(s);if(!i)return Pl;let c=await i(e.params.argument.value,e.params.context);return B4(c)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(i=>i.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return Pl;throw new G(X.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return Pl;let s=await o(e.params.argument.value,e.params.context);return B4(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(Po(Ff)),this.server.assertCanSetRequestHandler(Po(Uf)),this.server.assertCanSetRequestHandler(Po(qf)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(Ff,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([s,i])=>i.enabled).map(([s,i])=>({uri:s,name:i.name,...i.metadata})),o=[];for(let s of Object.values(this._registeredResourceTemplates)){if(!s.resourceTemplate.listCallback)continue;let i=await s.resourceTemplate.listCallback(r);for(let c of i.resources)o.push({...s.metadata,...c})}return{resources:[...n,...o]}}),this.server.setRequestHandler(Uf,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([r,n])=>({name:r,uriTemplate:n.resourceTemplate.uriTemplate.toString(),...n.metadata}))})),this.server.setRequestHandler(qf,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new G(X.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let s of Object.values(this._registeredResourceTemplates)){let i=s.resourceTemplate.uriTemplate.match(n.toString());if(i)return s.readCallback(n,i,r)}throw new G(X.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(Po(Vf)),this.server.assertCanSetRequestHandler(Po(Hf)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(Vf,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?ete(r.argsSchema):void 0}))})),this.server.setRequestHandler(Hf,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new G(X.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new G(X.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=ci(n.argsSchema),s=await wf(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",l=kf(u);throw new G(X.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${l}`)}let i=s.data,c=n.callback;return await Promise.resolve(c(i,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let s=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let i=this._createRegisteredResource(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let i=this._createRegisteredResourceTemplate(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),i}}registerResource(e,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw new Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw new Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,r,n,o,s){let i={name:e,title:r,metadata:o,readCallback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:c=>{typeof c.uri<"u"&&c.uri!==n&&(delete this._registeredResources[n],c.uri&&(this._registeredResources[c.uri]=i)),typeof c.name<"u"&&(i.name=c.name),typeof c.title<"u"&&(i.title=c.title),typeof c.metadata<"u"&&(i.metadata=c.metadata),typeof c.callback<"u"&&(i.readCallback=c.callback),typeof c.enabled<"u"&&(i.enabled=c.enabled),this.sendResourceListChanged()}};return this._registeredResources[n]=i,i}_createRegisteredResourceTemplate(e,r,n,o,s){let i={resourceTemplate:n,title:r,metadata:o,readCallback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredResourceTemplates[e],l.name&&(this._registeredResourceTemplates[l.name]=i)),typeof l.title<"u"&&(i.title=l.title),typeof l.template<"u"&&(i.resourceTemplate=l.template),typeof l.metadata<"u"&&(i.metadata=l.metadata),typeof l.callback<"u"&&(i.readCallback=l.callback),typeof l.enabled<"u"&&(i.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let c=n.uriTemplate.variableNames;return Array.isArray(c)&&c.some(l=>!!n.completeCallback(l))&&this.setCompletionRequestHandler(),i}_createRegisteredPrompt(e,r,n,o,s){let i={title:r,description:n,argsSchema:o===void 0?void 0:bs(o),callback:s,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:c=>{typeof c.name<"u"&&c.name!==e&&(delete this._registeredPrompts[e],c.name&&(this._registeredPrompts[c.name]=i)),typeof c.title<"u"&&(i.title=c.title),typeof c.description<"u"&&(i.description=c.description),typeof c.argsSchema<"u"&&(i.argsSchema=bs(c.argsSchema)),typeof c.callback<"u"&&(i.callback=c.callback),typeof c.enabled<"u"&&(i.enabled=c.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=i,o&&Object.values(o).some(u=>{let l=u instanceof Ef?u._def?.innerType:u;return yS(l)})&&this.setCompletionRequestHandler(),i}_createRegisteredTool(e,r,n,o,s,i,c,u,l){_S(e);let d={title:r,description:n,inputSchema:H4(o),outputSchema:H4(s),annotations:i,execution:c,_meta:u,handler:l,enabled:!0,disable:()=>d.update({enabled:!1}),enable:()=>d.update({enabled:!0}),remove:()=>d.update({name:null}),update:m=>{typeof m.name<"u"&&m.name!==e&&(typeof m.name=="string"&&_S(m.name),delete this._registeredTools[e],m.name&&(this._registeredTools[m.name]=d)),typeof m.title<"u"&&(d.title=m.title),typeof m.description<"u"&&(d.description=m.description),typeof m.paramsSchema<"u"&&(d.inputSchema=bs(m.paramsSchema)),typeof m.outputSchema<"u"&&(d.outputSchema=bs(m.outputSchema)),typeof m.callback<"u"&&(d.handler=m.callback),typeof m.annotations<"u"&&(d.annotations=m.annotations),typeof m._meta<"u"&&(d._meta=m._meta),typeof m.enabled<"u"&&(d.enabled=m.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=d,this.setToolRequestHandlers(),this.sendToolListChanged(),d}tool(e,...r){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let n,o,s,i;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let u=r[0];if(vS(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!vS(r[0])&&(i=r.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(l=>typeof l=="object"&&l!==null))throw new Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);i=r.shift()}}let c=r[0];return this._createRegisteredTool(e,void 0,n,o,s,i,{taskSupport:"forbidden"},void 0,c)}registerTool(e,r,n){if(this._registeredTools[e])throw new Error(`Tool ${e} is already registered`);let{title:o,description:s,inputSchema:i,outputSchema:c,annotations:u,_meta:l}=r;return this._createRegisteredTool(e,o,s,i,c,u,{taskSupport:"forbidden"},l,n)}prompt(e,...r){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let s=r[0],i=this._createRegisteredPrompt(e,void 0,n,o,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),i}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let{title:o,description:s,argsSchema:i}=r,c=this._createRegisteredPrompt(e,o,s,i,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}};a(bS,"McpServer");var Lm=bS;var Qee={type:"object",properties:{}};function G4(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}a(G4,"isZodTypeLike");function J4(t){return"_def"in t||"_zod"in t||G4(t)}a(J4,"isZodSchemaInstance");function vS(t){return typeof t!="object"||t===null||J4(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(G4)}a(vS,"isZodRawShapeCompat");function H4(t){if(t){if(vS(t))return bs(t);if(!J4(t))throw new Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}a(H4,"getZodSchemaObject");function ete(t){let e=vo(t);return e?Object.entries(e).map(([r,n])=>{let o=yM(n),s=_M(n);return{name:r,description:o,required:!s}}):[]}a(ete,"promptArgumentsFromSchema");function Po(t){let r=vo(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=ui(r);if(typeof n=="string")return n;throw new Error("Schema method literal must be a string")}a(Po,"getMethodValue");function B4(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}a(B4,"createCompletionResult");var Pl={completion:{values:[],hasMore:!1}};import K4 from"process";var tte=10*1024*1024,wS=class wS{constructor(e){this._maxBufferSize=e?.maxBufferSize??tte}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
277
+ `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),rte(r)}clear(){this._buffer=void 0}};a(wS,"ReadBuffer");var Fm=wS;function rte(t){return sD.parse(JSON.parse(t))}a(rte,"deserializeMessage");function W4(t){return JSON.stringify(t)+`
278
+ `}a(W4,"serializeMessage");var kS=class kS{constructor(e=K4.stdin,r=K4.stdout,n){this._stdin=e,this._stdout=r,this._started=!1,this._ondata=o=>{try{this._readBuffer.append(o),this.processReadBuffer()}catch(s){this.onerror?.(s),this.close().catch(()=>{})}},this._onerror=o=>{this.onerror?.(o)},this._readBuffer=new Fm({maxBufferSize:n?.maxBufferSize})}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let n=W4(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};a(kS,"StdioServerTransport");var Um=kS;var Fe={};R(Fe,{BRAND:()=>Tte,DIRTY:()=>Cs,EMPTY_PATH:()=>ate,INVALID:()=>ee,NEVER:()=>pre,OK:()=>_t,ParseStatus:()=>dt,Schema:()=>de,ZodAny:()=>Ro,ZodArray:()=>Bn,ZodBigInt:()=>js,ZodBoolean:()=>Ms,ZodBranded:()=>Dl,ZodCatch:()=>Js,ZodDate:()=>Ds,ZodDefault:()=>Gs,ZodDiscriminatedUnion:()=>Gm,ZodEffects:()=>kr,ZodEnum:()=>Hs,ZodError:()=>Mt,ZodFirstPartyTypeKind:()=>ne,ZodFunction:()=>Wm,ZodIntersection:()=>Us,ZodIssueCode:()=>N,ZodLazy:()=>qs,ZodLiteral:()=>Vs,ZodMap:()=>Li,ZodNaN:()=>Ui,ZodNativeEnum:()=>Bs,ZodNever:()=>Zr,ZodNull:()=>Ls,ZodNullable:()=>cn,ZodNumber:()=>As,ZodObject:()=>Dt,ZodOptional:()=>br,ZodParsedType:()=>L,ZodPipeline:()=>Zl,ZodPromise:()=>Ao,ZodReadonly:()=>Ws,ZodRecord:()=>Jm,ZodSchema:()=>de,ZodSet:()=>Fi,ZodString:()=>Co,ZodSymbol:()=>Di,ZodTransformer:()=>kr,ZodTuple:()=>an,ZodType:()=>de,ZodUndefined:()=>Zs,ZodUnion:()=>Fs,ZodUnknown:()=>Hn,ZodVoid:()=>Zi,addIssueToContext:()=>M,any:()=>Mte,array:()=>Fte,bigint:()=>Ite,boolean:()=>iL,coerce:()=>dre,custom:()=>oL,date:()=>Cte,datetimeRegex:()=>rL,defaultErrorMap:()=>qn,discriminatedUnion:()=>Hte,effect:()=>nre,enum:()=>ere,function:()=>Yte,getErrorMap:()=>Ci,getParsedType:()=>sn,instanceof:()=>Ote,intersection:()=>Bte,isAborted:()=>Hm,isAsync:()=>Ri,isDirty:()=>Bm,isValid:()=>Io,late:()=>zte,lazy:()=>Xte,literal:()=>Qte,makeIssue:()=>Il,map:()=>Wte,nan:()=>Pte,nativeEnum:()=>tre,never:()=>Zte,null:()=>jte,nullable:()=>sre,number:()=>aL,object:()=>Ute,objectUtil:()=>SS,oboolean:()=>lre,onumber:()=>ure,optional:()=>ore,ostring:()=>cre,pipeline:()=>ire,preprocess:()=>are,promise:()=>rre,quotelessJson:()=>nte,record:()=>Jte,set:()=>Kte,setErrorMap:()=>ste,strictObject:()=>qte,string:()=>sL,symbol:()=>Rte,transformer:()=>nre,tuple:()=>Gte,undefined:()=>Ate,union:()=>Vte,unknown:()=>Dte,util:()=>he,void:()=>Lte});var he;(function(t){t.assertEqual=o=>{};function e(o){}a(e,"assertIs"),t.assertIs=e;function r(o){throw new Error}a(r,"assertNever"),t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(c=>typeof o[o[c]]!="number"),i={};for(let c of s)i[c]=o[c];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}a(n,"joinValues"),t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(he||(he={}));var SS;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(SS||(SS={}));var L=he.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),sn=a(t=>{switch(typeof t){case"undefined":return L.undefined;case"string":return L.string;case"number":return Number.isNaN(t)?L.nan:L.number;case"boolean":return L.boolean;case"function":return L.function;case"bigint":return L.bigint;case"symbol":return L.symbol;case"object":return Array.isArray(t)?L.array:t===null?L.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?L.promise:typeof Map<"u"&&t instanceof Map?L.map:typeof Set<"u"&&t instanceof Set?L.set:typeof Date<"u"&&t instanceof Date?L.date:L.object;default:return L.unknown}},"getParsedType");var N=he.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),nte=a(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),qm=class qm extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let c=n,u=0;for(;u<i.path.length;){let l=i.path[u];u===i.path.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(r(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}},"processError");return o(this),n}static assert(e){if(!(e instanceof qm))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,he.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};a(qm,"ZodError");var Mt=qm;Mt.create=t=>new Mt(t);var ote=a((t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===L.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,he.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${he.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${he.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${he.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:he.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,he.assertNever(t)}return{message:r}},"errorMap"),qn=ote;var Y4=qn;function ste(t){Y4=t}a(ste,"setErrorMap");function Ci(){return Y4}a(Ci,"getErrorMap");var Il=a(t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let c="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)c=l(i,{data:e,defaultError:c}).message;return{...o,path:s,message:c}},"makeIssue"),ate=[];function M(t,e){let r=Ci(),n=Il({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===qn?void 0:qn].filter(o=>!!o)});t.common.issues.push(n)}a(M,"addIssueToContext");var Vm=class Vm{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return ee;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,i=await o.value;n.push({key:s,value:i})}return Vm.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return ee;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}};a(Vm,"ParseStatus");var dt=Vm,ee=Object.freeze({status:"aborted"}),Cs=a(t=>({status:"dirty",value:t}),"DIRTY"),_t=a(t=>({status:"valid",value:t}),"OK"),Hm=a(t=>t.status==="aborted","isAborted"),Bm=a(t=>t.status==="dirty","isDirty"),Io=a(t=>t.status==="valid","isValid"),Ri=a(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync");var H;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(H||(H={}));var NS=class NS{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};a(NS,"ParseInputLazyPath");var wr=NS,X4=a((t,e)=>{if(Io(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Mt(t.common.issues);return this._error=r,this._error}}},"handleResult");function ce(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:a((i,c)=>{let{message:u}=t;return i.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??n??c.defaultError}:i.code!=="invalid_type"?{message:c.defaultError}:{message:u??r??c.defaultError}},"customMap"),description:o}}a(ce,"processCreateParams");var TS=class TS{get description(){return this._def.description}_getType(e){return sn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new dt,ctx:{common:e.parent.common,data:e.data,parsedType:sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ri(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)},o=this._parseSync({data:e,path:n.path,parent:n});return X4(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return Io(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Io(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Ri(o)?o:Promise.resolve(o));return X4(n,s)}refine(e,r){let n=a(o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r,"getIssueProperties");return this._refinement((o,s)=>{let i=e(o),c=a(()=>s.addIssue({code:N.custom,...n(o)}),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(c(),!1)):i?!0:(c(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new kr({schema:this,typeName:ne.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return br.create(this,this._def)}nullable(){return cn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Bn.create(this)}promise(){return Ao.create(this,this._def)}or(e){return Fs.create([this,e],this._def)}and(e){return Us.create(this,e,this._def)}transform(e){return new kr({...ce(this._def),schema:this,typeName:ne.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Gs({...ce(this._def),innerType:this,defaultValue:r,typeName:ne.ZodDefault})}brand(){return new Dl({typeName:ne.ZodBranded,type:this,...ce(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Js({...ce(this._def),innerType:this,catchValue:r,typeName:ne.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Zl.create(this,e)}readonly(){return Ws.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};a(TS,"ZodType");var de=TS,ite=/^c[^\s-]{8,}$/i,cte=/^[0-9a-z]+$/,ute=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lte=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,dte=/^[a-z0-9_-]{21}$/i,pte=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fte=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,mte=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hte="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",$S,gte=/^(?:(?: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])$/,yte=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,_te=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,xte=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,vte=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,bte=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,eL="((\\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])))",wte=new RegExp(`^${eL}$`);function tL(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}a(tL,"timeRegexSource");function kte(t){return new RegExp(`^${tL(t)}$`)}a(kte,"timeRegex");function rL(t){let e=`${eL}T${tL(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}a(rL,"datetimeRegex");function Ste(t,e){return!!((e==="v4"||!e)&&gte.test(t)||(e==="v6"||!e)&&_te.test(t))}a(Ste,"isValidIP");function $te(t,e){if(!pte.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}a($te,"isValidJWT");function Ete(t,e){return!!((e==="v4"||!e)&&yte.test(t)||(e==="v6"||!e)&&xte.test(t))}a(Ete,"isValidCidr");var Rs=class Rs extends de{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==L.string){let s=this._getOrReturnCtx(e);return M(s,{code:N.invalid_type,expected:L.string,received:s.parsedType}),ee}let n=new dt,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,c=e.data.length<s.value;(i||c)&&(o=this._getOrReturnCtx(e,o),i?M(o,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&M(o,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")mte.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"email",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")$S||($S=new RegExp(hte,"u")),$S.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"emoji",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")lte.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"uuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")dte.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"nanoid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")ite.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"cuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")cte.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"cuid2",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")ute.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"ulid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),M(o,{validation:"url",code:N.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"regex",code:N.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?rL(s).test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?wte.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?kte(s).test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{code:N.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?fte.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"duration",code:N.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Ste(e.data,s.version)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"ip",code:N.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?$te(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"jwt",code:N.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Ete(e.data,s.version)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"cidr",code:N.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?vte.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"base64",code:N.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?bte.test(e.data)||(o=this._getOrReturnCtx(e,o),M(o,{validation:"base64url",code:N.invalid_string,message:s.message}),n.dirty()):he.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:N.invalid_string,...H.errToObj(n)})}_addCheck(e){return new Rs({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...H.errToObj(e)})}url(e){return this._addCheck({kind:"url",...H.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...H.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...H.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...H.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...H.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...H.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...H.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...H.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...H.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...H.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...H.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...H.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...H.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...H.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...H.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...H.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...H.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...H.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...H.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...H.errToObj(r)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new Rs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};a(Rs,"ZodString");var Co=Rs;Co.create=t=>new Co({checks:[],typeName:ne.ZodString,coerce:t?.coerce??!1,...ce(t)});function Nte(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}a(Nte,"floatSafeRemainder");var Cl=class Cl extends de{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==L.number){let s=this._getOrReturnCtx(e);return M(s,{code:N.invalid_type,expected:L.number,received:s.parsedType}),ee}let n,o=new dt;for(let s of this._def.checks)s.kind==="int"?he.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),M(n,{code:N.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:N.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:N.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?Nte(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),M(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),M(n,{code:N.not_finite,message:s.message}),o.dirty()):he.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,H.toString(r))}gt(e,r){return this.setLimit("min",e,!1,H.toString(r))}lte(e,r){return this.setLimit("max",e,!0,H.toString(r))}lt(e,r){return this.setLimit("max",e,!1,H.toString(r))}setLimit(e,r,n,o){return new Cl({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:H.toString(o)}]})}_addCheck(e){return new Cl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:H.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:H.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&he.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};a(Cl,"ZodNumber");var As=Cl;As.create=t=>new As({checks:[],typeName:ne.ZodNumber,coerce:t?.coerce||!1,...ce(t)});var Rl=class Rl extends de{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==L.bigint)return this._getInvalidInput(e);let n,o=new dt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:N.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),M(n,{code:N.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),M(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):he.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return M(r,{code:N.invalid_type,expected:L.bigint,received:r.parsedType}),ee}gte(e,r){return this.setLimit("min",e,!0,H.toString(r))}gt(e,r){return this.setLimit("min",e,!1,H.toString(r))}lte(e,r){return this.setLimit("max",e,!0,H.toString(r))}lt(e,r){return this.setLimit("max",e,!1,H.toString(r))}setLimit(e,r,n,o){return new Rl({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:H.toString(o)}]})}_addCheck(e){return new Rl({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:H.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};a(Rl,"ZodBigInt");var js=Rl;js.create=t=>new js({checks:[],typeName:ne.ZodBigInt,coerce:t?.coerce??!1,...ce(t)});var zS=class zS extends de{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==L.boolean){let n=this._getOrReturnCtx(e);return M(n,{code:N.invalid_type,expected:L.boolean,received:n.parsedType}),ee}return _t(e.data)}};a(zS,"ZodBoolean");var Ms=zS;Ms.create=t=>new Ms({typeName:ne.ZodBoolean,coerce:t?.coerce||!1,...ce(t)});var Km=class Km extends de{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==L.date){let s=this._getOrReturnCtx(e);return M(s,{code:N.invalid_type,expected:L.date,received:s.parsedType}),ee}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return M(s,{code:N.invalid_date}),ee}let n=new dt,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:N.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),M(o,{code:N.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):he.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Km({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:H.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:H.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};a(Km,"ZodDate");var Ds=Km;Ds.create=t=>new Ds({checks:[],coerce:t?.coerce||!1,typeName:ne.ZodDate,...ce(t)});var OS=class OS extends de{_parse(e){if(this._getType(e)!==L.symbol){let n=this._getOrReturnCtx(e);return M(n,{code:N.invalid_type,expected:L.symbol,received:n.parsedType}),ee}return _t(e.data)}};a(OS,"ZodSymbol");var Di=OS;Di.create=t=>new Di({typeName:ne.ZodSymbol,...ce(t)});var PS=class PS extends de{_parse(e){if(this._getType(e)!==L.undefined){let n=this._getOrReturnCtx(e);return M(n,{code:N.invalid_type,expected:L.undefined,received:n.parsedType}),ee}return _t(e.data)}};a(PS,"ZodUndefined");var Zs=PS;Zs.create=t=>new Zs({typeName:ne.ZodUndefined,...ce(t)});var IS=class IS extends de{_parse(e){if(this._getType(e)!==L.null){let n=this._getOrReturnCtx(e);return M(n,{code:N.invalid_type,expected:L.null,received:n.parsedType}),ee}return _t(e.data)}};a(IS,"ZodNull");var Ls=IS;Ls.create=t=>new Ls({typeName:ne.ZodNull,...ce(t)});var CS=class CS extends de{constructor(){super(...arguments),this._any=!0}_parse(e){return _t(e.data)}};a(CS,"ZodAny");var Ro=CS;Ro.create=t=>new Ro({typeName:ne.ZodAny,...ce(t)});var RS=class RS extends de{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _t(e.data)}};a(RS,"ZodUnknown");var Hn=RS;Hn.create=t=>new Hn({typeName:ne.ZodUnknown,...ce(t)});var AS=class AS extends de{_parse(e){let r=this._getOrReturnCtx(e);return M(r,{code:N.invalid_type,expected:L.never,received:r.parsedType}),ee}};a(AS,"ZodNever");var Zr=AS;Zr.create=t=>new Zr({typeName:ne.ZodNever,...ce(t)});var jS=class jS extends de{_parse(e){if(this._getType(e)!==L.undefined){let n=this._getOrReturnCtx(e);return M(n,{code:N.invalid_type,expected:L.void,received:n.parsedType}),ee}return _t(e.data)}};a(jS,"ZodVoid");var Zi=jS;Zi.create=t=>new Zi({typeName:ne.ZodVoid,...ce(t)});var ji=class ji extends de{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==L.array)return M(r,{code:N.invalid_type,expected:L.array,received:r.parsedType}),ee;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,c=r.data.length<o.exactLength.value;(i||c)&&(M(r,{code:i?N.too_big:N.too_small,minimum:c?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(M(r,{code:N.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(M(r,{code:N.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,c)=>o.type._parseAsync(new wr(r,i,r.path,c)))).then(i=>dt.mergeArray(n,i));let s=[...r.data].map((i,c)=>o.type._parseSync(new wr(r,i,r.path,c)));return dt.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new ji({...this._def,minLength:{value:e,message:H.toString(r)}})}max(e,r){return new ji({...this._def,maxLength:{value:e,message:H.toString(r)}})}length(e,r){return new ji({...this._def,exactLength:{value:e,message:H.toString(r)}})}nonempty(e){return this.min(1,e)}};a(ji,"ZodArray");var Bn=ji;Bn.create=(t,e)=>new Bn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ne.ZodArray,...ce(e)});function Ai(t){if(t instanceof Dt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=br.create(Ai(n))}return new Dt({...t._def,shape:()=>e})}else return t instanceof Bn?new Bn({...t._def,type:Ai(t.element)}):t instanceof br?br.create(Ai(t.unwrap())):t instanceof cn?cn.create(Ai(t.unwrap())):t instanceof an?an.create(t.items.map(e=>Ai(e))):t}a(Ai,"deepPartialify");var Qt=class Qt extends de{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=he.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==L.object){let l=this._getOrReturnCtx(e);return M(l,{code:N.invalid_type,expected:L.object,received:l.parsedType}),ee}let{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),c=[];if(!(this._def.catchall instanceof Zr&&this._def.unknownKeys==="strip"))for(let l in o.data)i.includes(l)||c.push(l);let u=[];for(let l of i){let d=s[l],m=o.data[l];u.push({key:{status:"valid",value:l},value:d._parse(new wr(o,m,o.path,l)),alwaysSet:l in o.data})}if(this._def.catchall instanceof Zr){let l=this._def.unknownKeys;if(l==="passthrough")for(let d of c)u.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(l==="strict")c.length>0&&(M(o,{code:N.unrecognized_keys,keys:c}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let d of c){let m=o.data[d];u.push({key:{status:"valid",value:d},value:l._parse(new wr(o,m,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let l=[];for(let d of u){let m=await d.key,h=await d.value;l.push({key:m,value:h,alwaysSet:d.alwaysSet})}return l}).then(l=>dt.mergeObjectSync(n,l)):dt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return H.errToObj,new Qt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:H.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new Qt({...this._def,unknownKeys:"strip"})}passthrough(){return new Qt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ne.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Qt({...this._def,catchall:e})}pick(e){let r={};for(let n of he.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Qt({...this._def,shape:()=>r})}omit(e){let r={};for(let n of he.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new Qt({...this._def,shape:()=>r})}deepPartial(){return Ai(this)}partial(e){let r={};for(let n of he.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new Qt({...this._def,shape:()=>r})}required(e){let r={};for(let n of he.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof br;)s=s._def.innerType;r[n]=s}return new Qt({...this._def,shape:()=>r})}keyof(){return nL(he.objectKeys(this.shape))}};a(Qt,"ZodObject");var Dt=Qt;Dt.create=(t,e)=>new Dt({shape:()=>t,unknownKeys:"strip",catchall:Zr.create(),typeName:ne.ZodObject,...ce(e)});Dt.strictCreate=(t,e)=>new Dt({shape:()=>t,unknownKeys:"strict",catchall:Zr.create(),typeName:ne.ZodObject,...ce(e)});Dt.lazycreate=(t,e)=>new Dt({shape:t,unknownKeys:"strip",catchall:Zr.create(),typeName:ne.ZodObject,...ce(e)});var MS=class MS extends de{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let i=s.map(c=>new Mt(c.ctx.common.issues));return M(r,{code:N.invalid_union,unionErrors:i}),ee}if(a(o,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},d=u._parseSync({data:r.data,path:r.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let c=i.map(u=>new Mt(u));return M(r,{code:N.invalid_union,unionErrors:c}),ee}}get options(){return this._def.options}};a(MS,"ZodUnion");var Fs=MS;Fs.create=(t,e)=>new Fs({options:t,typeName:ne.ZodUnion,...ce(e)});var Vn=a(t=>t instanceof qs?Vn(t.schema):t instanceof kr?Vn(t.innerType()):t instanceof Vs?[t.value]:t instanceof Hs?t.options:t instanceof Bs?he.objectValues(t.enum):t instanceof Gs?Vn(t._def.innerType):t instanceof Zs?[void 0]:t instanceof Ls?[null]:t instanceof br?[void 0,...Vn(t.unwrap())]:t instanceof cn?[null,...Vn(t.unwrap())]:t instanceof Dl||t instanceof Ws?Vn(t.unwrap()):t instanceof Js?Vn(t._def.innerType):[],"getDiscriminator"),Ym=class Ym extends de{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.object)return M(r,{code:N.invalid_type,expected:L.object,received:r.parsedType}),ee;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(M(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let i=Vn(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of i){if(o.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);o.set(c,s)}}return new Ym({typeName:ne.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...ce(n)})}};a(Ym,"ZodDiscriminatedUnion");var Gm=Ym;function ES(t,e){let r=sn(t),n=sn(e);if(t===e)return{valid:!0,data:t};if(r===L.object&&n===L.object){let o=he.objectKeys(e),s=he.objectKeys(t).filter(c=>o.indexOf(c)!==-1),i={...t,...e};for(let c of s){let u=ES(t[c],e[c]);if(!u.valid)return{valid:!1};i[c]=u.data}return{valid:!0,data:i}}else if(r===L.array&&n===L.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],c=e[s],u=ES(i,c);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return r===L.date&&n===L.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}a(ES,"mergeValues");var DS=class DS extends de{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,i)=>{if(Hm(s)||Hm(i))return ee;let c=ES(s.value,i.value);return c.valid?((Bm(s)||Bm(i))&&r.dirty(),{status:r.value,value:c.data}):(M(n,{code:N.invalid_intersection_types}),ee)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};a(DS,"ZodIntersection");var Us=DS;Us.create=(t,e,r)=>new Us({left:t,right:e,typeName:ne.ZodIntersection,...ce(r)});var Xm=class Xm extends de{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.array)return M(n,{code:N.invalid_type,expected:L.array,received:n.parsedType}),ee;if(n.data.length<this._def.items.length)return M(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ee;!this._def.rest&&n.data.length>this._def.items.length&&(M(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new wr(n,i,n.path,c)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>dt.mergeArray(r,i)):dt.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Xm({...this._def,rest:e})}};a(Xm,"ZodTuple");var an=Xm;an.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new an({items:t,typeName:ne.ZodTuple,rest:null,...ce(e)})};var Al=class Al extends de{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.object)return M(n,{code:N.invalid_type,expected:L.object,received:n.parsedType}),ee;let o=[],s=this._def.keyType,i=this._def.valueType;for(let c in n.data)o.push({key:s._parse(new wr(n,c,n.path,c)),value:i._parse(new wr(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?dt.mergeObjectAsync(r,o):dt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof de?new Al({keyType:e,valueType:r,typeName:ne.ZodRecord,...ce(n)}):new Al({keyType:Co.create(),valueType:e,typeName:ne.ZodRecord,...ce(r)})}};a(Al,"ZodRecord");var Jm=Al,ZS=class ZS extends de{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.map)return M(n,{code:N.invalid_type,expected:L.map,received:n.parsedType}),ee;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([c,u],l)=>({key:o._parse(new wr(n,c,n.path,[l,"key"])),value:s._parse(new wr(n,u,n.path,[l,"value"]))}));if(n.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of i){let l=await u.key,d=await u.value;if(l.status==="aborted"||d.status==="aborted")return ee;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),c.set(l.value,d.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let u of i){let l=u.key,d=u.value;if(l.status==="aborted"||d.status==="aborted")return ee;(l.status==="dirty"||d.status==="dirty")&&r.dirty(),c.set(l.value,d.value)}return{status:r.value,value:c}}}};a(ZS,"ZodMap");var Li=ZS;Li.create=(t,e,r)=>new Li({valueType:e,keyType:t,typeName:ne.ZodMap,...ce(r)});var jl=class jl extends de{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.set)return M(n,{code:N.invalid_type,expected:L.set,received:n.parsedType}),ee;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(M(n,{code:N.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(M(n,{code:N.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function i(u){let l=new Set;for(let d of u){if(d.status==="aborted")return ee;d.status==="dirty"&&r.dirty(),l.add(d.value)}return{status:r.value,value:l}}a(i,"finalizeSet");let c=[...n.data.values()].map((u,l)=>s._parse(new wr(n,u,n.path,l)));return n.common.async?Promise.all(c).then(u=>i(u)):i(c)}min(e,r){return new jl({...this._def,minSize:{value:e,message:H.toString(r)}})}max(e,r){return new jl({...this._def,maxSize:{value:e,message:H.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};a(jl,"ZodSet");var Fi=jl;Fi.create=(t,e)=>new Fi({valueType:t,minSize:null,maxSize:null,typeName:ne.ZodSet,...ce(e)});var Mi=class Mi extends de{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.function)return M(r,{code:N.invalid_type,expected:L.function,received:r.parsedType}),ee;function n(c,u){return Il({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ci(),qn].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:u}})}a(n,"makeArgsIssue");function o(c,u){return Il({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ci(),qn].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:u}})}a(o,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Ao){let c=this;return _t(async function(...u){let l=new Mt([]),d=await c._def.args.parseAsync(u,s).catch(f=>{throw l.addIssue(n(u,f)),l}),m=await Reflect.apply(i,this,d);return await c._def.returns._def.type.parseAsync(m,s).catch(f=>{throw l.addIssue(o(m,f)),l})})}else{let c=this;return _t(function(...u){let l=c._def.args.safeParse(u,s);if(!l.success)throw new Mt([n(u,l.error)]);let d=Reflect.apply(i,this,l.data),m=c._def.returns.safeParse(d,s);if(!m.success)throw new Mt([o(d,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Mi({...this._def,args:an.create(e).rest(Hn.create())})}returns(e){return new Mi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Mi({args:e||an.create([]).rest(Hn.create()),returns:r||Hn.create(),typeName:ne.ZodFunction,...ce(n)})}};a(Mi,"ZodFunction");var Wm=Mi,LS=class LS extends de{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};a(LS,"ZodLazy");var qs=LS;qs.create=(t,e)=>new qs({getter:t,typeName:ne.ZodLazy,...ce(e)});var FS=class FS extends de{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return M(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),ee}return{status:"valid",value:e.data}}get value(){return this._def.value}};a(FS,"ZodLiteral");var Vs=FS;Vs.create=(t,e)=>new Vs({value:t,typeName:ne.ZodLiteral,...ce(e)});function nL(t,e){return new Hs({values:t,typeName:ne.ZodEnum,...ce(e)})}a(nL,"createZodEnum");var Ml=class Ml extends de{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return M(r,{expected:he.joinValues(n),received:r.parsedType,code:N.invalid_type}),ee}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return M(r,{received:r.data,code:N.invalid_enum_value,options:n}),ee}return _t(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Ml.create(e,{...this._def,...r})}exclude(e,r=this._def){return Ml.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};a(Ml,"ZodEnum");var Hs=Ml;Hs.create=nL;var US=class US extends de{_parse(e){let r=he.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==L.string&&n.parsedType!==L.number){let o=he.objectValues(r);return M(n,{expected:he.joinValues(o),received:n.parsedType,code:N.invalid_type}),ee}if(this._cache||(this._cache=new Set(he.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=he.objectValues(r);return M(n,{received:n.data,code:N.invalid_enum_value,options:o}),ee}return _t(e.data)}get enum(){return this._def.values}};a(US,"ZodNativeEnum");var Bs=US;Bs.create=(t,e)=>new Bs({values:t,typeName:ne.ZodNativeEnum,...ce(e)});var qS=class qS extends de{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.promise&&r.common.async===!1)return M(r,{code:N.invalid_type,expected:L.promise,received:r.parsedType}),ee;let n=r.parsedType===L.promise?r.data:Promise.resolve(r.data);return _t(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};a(qS,"ZodPromise");var Ao=qS;Ao.create=(t,e)=>new Ao({type:t,typeName:ne.ZodPromise,...ce(e)});var VS=class VS extends de{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{M(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async c=>{if(r.value==="aborted")return ee;let u=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return u.status==="aborted"?ee:u.status==="dirty"?Cs(u.value):r.value==="dirty"?Cs(u.value):u});{if(r.value==="aborted")return ee;let c=this._def.schema._parseSync({data:i,path:n.path,parent:n});return c.status==="aborted"?ee:c.status==="dirty"?Cs(c.value):r.value==="dirty"?Cs(c.value):c}}if(o.type==="refinement"){let i=a(c=>{let u=o.refinement(c,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?ee:(c.status==="dirty"&&r.dirty(),i(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?ee:(c.status==="dirty"&&r.dirty(),i(c.value).then(()=>({status:r.value,value:c.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Io(i))return ee;let c=o.transform(i.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Io(i)?Promise.resolve(o.transform(i.value,s)).then(c=>({status:r.value,value:c})):ee);he.assertNever(o)}};a(VS,"ZodEffects");var kr=VS;kr.create=(t,e,r)=>new kr({schema:t,typeName:ne.ZodEffects,effect:e,...ce(r)});kr.createWithPreprocess=(t,e,r)=>new kr({schema:e,effect:{type:"preprocess",transform:t},typeName:ne.ZodEffects,...ce(r)});var HS=class HS extends de{_parse(e){return this._getType(e)===L.undefined?_t(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(HS,"ZodOptional");var br=HS;br.create=(t,e)=>new br({innerType:t,typeName:ne.ZodOptional,...ce(e)});var BS=class BS extends de{_parse(e){return this._getType(e)===L.null?_t(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(BS,"ZodNullable");var cn=BS;cn.create=(t,e)=>new cn({innerType:t,typeName:ne.ZodNullable,...ce(e)});var GS=class GS extends de{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===L.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};a(GS,"ZodDefault");var Gs=GS;Gs.create=(t,e)=>new Gs({innerType:t,typeName:ne.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ce(e)});var JS=class JS extends de{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ri(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Mt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Mt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};a(JS,"ZodCatch");var Js=JS;Js.create=(t,e)=>new Js({innerType:t,typeName:ne.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ce(e)});var WS=class WS extends de{_parse(e){if(this._getType(e)!==L.nan){let n=this._getOrReturnCtx(e);return M(n,{code:N.invalid_type,expected:L.nan,received:n.parsedType}),ee}return{status:"valid",value:e.data}}};a(WS,"ZodNaN");var Ui=WS;Ui.create=t=>new Ui({typeName:ne.ZodNaN,...ce(t)});var Tte=Symbol("zod_brand"),KS=class KS extends de{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};a(KS,"ZodBranded");var Dl=KS,Qm=class Qm extends de{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return a(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ee:s.status==="dirty"?(r.dirty(),Cs(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ee:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new Qm({in:e,out:r,typeName:ne.ZodPipeline})}};a(Qm,"ZodPipeline");var Zl=Qm,YS=class YS extends de{_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(Io(o)&&(o.value=Object.freeze(o.value)),o),"freeze");return Ri(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};a(YS,"ZodReadonly");var Ws=YS;Ws.create=(t,e)=>new Ws({innerType:t,typeName:ne.ZodReadonly,...ce(e)});function Q4(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}a(Q4,"cleanParams");function oL(t,e={},r){return t?Ro.create().superRefine((n,o)=>{let s=t(n);if(s instanceof Promise)return s.then(i=>{if(!i){let c=Q4(e,n),u=c.fatal??r??!0;o.addIssue({code:"custom",...c,fatal:u})}});if(!s){let i=Q4(e,n),c=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:c})}}):Ro.create()}a(oL,"custom");var zte={object:Dt.lazycreate},ne;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ne||(ne={}));var Ote=a((t,e={message:`Input not instance of ${t.name}`})=>oL(r=>r instanceof t,e),"instanceOfType"),sL=Co.create,aL=As.create,Pte=Ui.create,Ite=js.create,iL=Ms.create,Cte=Ds.create,Rte=Di.create,Ate=Zs.create,jte=Ls.create,Mte=Ro.create,Dte=Hn.create,Zte=Zr.create,Lte=Zi.create,Fte=Bn.create,Ute=Dt.create,qte=Dt.strictCreate,Vte=Fs.create,Hte=Gm.create,Bte=Us.create,Gte=an.create,Jte=Jm.create,Wte=Li.create,Kte=Fi.create,Yte=Wm.create,Xte=qs.create,Qte=Vs.create,ere=Hs.create,tre=Bs.create,rre=Ao.create,nre=kr.create,ore=br.create,sre=cn.create,are=kr.createWithPreprocess,ire=Zl.create,cre=a(()=>sL().optional(),"ostring"),ure=a(()=>aL().optional(),"onumber"),lre=a(()=>iL().optional(),"oboolean"),dre={string:t=>Co.create({...t,coerce:!0}),number:t=>As.create({...t,coerce:!0}),boolean:t=>Ms.create({...t,coerce:!0}),bigint:t=>js.create({...t,coerce:!0}),date:t=>Ds.create({...t,coerce:!0})};var pre=ee;rx();zn();async function cL(t={}){let r=`http://localhost:${t.port??process.env.JUCIE_PORT??"3003"}`;async function n({root:h="app",depth:f}={}){let g=new URLSearchParams({root:h});f!=null&&g.set("depth",String(f));let v=await fetch(`${r}/mcp/scene?${g}`);if(!v.ok)throw new Error(`design server returned ${v.status}`);return v.json()}a(n,"getScene");async function o(h){let f=await fetch(`${r}/mcp/operations`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({operations:h})});if(!f.ok)throw new Error(`design server returned ${f.status}`);return f.json()}a(o,"postOperations");let s={String:()=>Fe.string(),Number:()=>Fe.number(),Boolean:()=>Fe.boolean(),Object:()=>Fe.record(Fe.unknown()),Array:()=>Fe.array(Fe.unknown()),Any:()=>Fe.unknown()};function i(h){let f=Array.isArray(h)?h[0]:null;if(!f||typeof f!="object")return{};let g={};for(let[v,y]of Object.entries(f)){let x=typeof y=="string"&&y.endsWith("?"),k=x?y.slice(0,-1):y,w=(s[k]??s.Any)();x&&(w=w.optional()),g[v]=w}return g}a(i,"toZodShape");function c(h){let f=[h.description];if(h.examples?.length){let g=h.examples[0];f.push(`Example args: ${JSON.stringify(g.args)}`)}return h.returns&&f.push(`Returns: ${h.returns}`),f.filter(Boolean).join(`
279
+ `)}a(c,"buildToolDescription");let u=new Lm({name:"jucie",version:"0.1.0"}),l=a(h=>async f=>{try{return{content:[{type:"text",text:await h(f)}]}}catch(g){return{isError:!0,content:[{type:"text",text:`Error: ${g.message}`}]}}},"tool"),d=Up.map(h=>Tn(h));for(let h of d)for(let f of h.operations)f.mcpName&&u.registerTool(f.mcpName,{description:c(f),inputSchema:i(f.schema)},l(async g=>{let{results:v}=await o([{type:f.fullName,args:g}]);return JSON.stringify(v[0])}));u.registerTool("get_scene",{description:'Read the current scene graph as JSX. Use root="app" for the full tree or a node id for a subtree. depth limits nesting (omit for unlimited).',inputSchema:{root:Fe.string().optional().describe("Root node id (default: app)"),depth:Fe.number().optional().describe("Max depth to expand (omit for full tree)")}},l(async h=>{let f=await n(h);return f.jsx??f.error??JSON.stringify(f)})),u.registerTool("set_route",{description:"Set the route path on a frame node. Use this to configure multi-page navigation. Pass isHome=true to mark it as the home/root route.",inputSchema:{nodeId:Fe.string().describe("Frame node id"),path:Fe.string().optional().describe('Route path, e.g. "/dashboard" or "/users/:id"'),isHome:Fe.boolean().optional().describe("If true, marks this frame as the home route (path becomes /)")}},l(async({nodeId:h,path:f,isHome:g})=>{let v=[];g?v.push({op:"setHomePage",nodeId:h,isHomePage:!0}):f!==void 0&&v.push({op:"updateRoute",nodeId:h,route:{path:f}});let{results:y}=await o(v);return JSON.stringify(y)})),u.registerTool("set_destination",{description:"Set a navigation destination on a link or button node. When the node is clicked it will navigate to the given path.",inputSchema:{nodeId:Fe.string().describe("Target node id (a or button)"),path:Fe.string().describe('Route path to navigate to, e.g. "/sign-up"')}},l(async({nodeId:h,path:f})=>{let{results:g}=await o([{op:"setDestination",nodeId:h,destination:{path:f}}]);return JSON.stringify(g[0])})),u.registerTool("create_instance",{description:"Place an instance of a component into the scene. Use componentId (from add_component) for local components. Use component name + library for external library components.",inputSchema:{component:Fe.string().describe("Component node id (local) or component name string (library)"),parent:Fe.string().describe("Parent node id"),library:Fe.string().optional().describe('Library name for external components (e.g. "my-ui"). Omit for local components.'),name:Fe.string().optional().describe("Display name for the instance")}},l(async({component:h,parent:f,library:g,name:v})=>{let{results:y}=await o([{op:"create",type:"instance",parent:f,props:{component:h,library:g??null,name:v}}]);return JSON.stringify(y[0])})),u.registerTool("batch",{description:X_(d),inputSchema:{operations:Fe.array(Fe.record(Fe.unknown())).describe("Ordered array of operation objects")}},l(async({operations:h})=>{let{results:f}=await o(h);return JSON.stringify(f)})),u.registerTool("screenshot",{description:"Capture a screenshot of every frame (page) in the current design. Returns one labeled image per frame so you can visually verify each page and correlate it with get_scene output by node id.",inputSchema:{}},async()=>{try{let h=await fetch(`${r}/mcp/screenshot`);if(!h.ok)throw new Error(`screenshot failed: ${h.status}`);let{frames:f,error:g}=await h.json();return g?{isError:!0,content:[{type:"text",text:`Error: ${g}`}]}:f?.length?{content:f.flatMap(y=>[{type:"text",text:`Frame: ${y.name} (id: ${y.id})`},{type:"image",data:y.imageData.replace(/^data:image\/\w+;base64,/,""),mimeType:"image/png"}])}:{isError:!0,content:[{type:"text",text:"No frames found in scene"}]}}catch(h){return{isError:!0,content:[{type:"text",text:`Error: ${h.message}`}]}}});let m=new Um;await u.connect(m)}a(cL,"mcpCommand");var yre=gre(import.meta.url),_re=hre(yre),e$=JSON.parse(fre(mre(_re,"../package.json"),"utf8")),er=process.argv.slice(2),XS=er[0],uL=er[1],Ks={help:er.includes("--help")||er.includes("-h"),version:er.includes("--version")||er.includes("-v"),verbose:er.includes("--verbose")};function Ll(t,e){let r=er.indexOf(`--${t}`),n=e?er.indexOf(`-${e}`):-1,o=r!==-1?r:n;if(o!==-1&&er[o+1]&&!er[o+1].startsWith("-"))return er[o+1]}a(Ll,"getOption");function QS(t){return er.includes(`--${t}`)}a(QS,"hasFlag");var eh={config:Ll("config"),outdir:Ll("outdir","o"),branch:Ll("branch","b"),framework:Ll("framework","f"),minify:QS("minify")?!0:void 0,sourcemap:QS("sourcemap"),analyze:QS("analyze")};function lL(){console.log(`
280
+ Jucie CLI v${e$.version}
281
+
282
+ Usage:
283
+ jucie <command> [options]
284
+
285
+ Commands:
286
+ create <project-name> Create a new Jucie project
287
+ design Start design mode (opens Studio for visual editing)
288
+ dev Start dev server (preview mode without Studio)
289
+ build Build project for production
290
+ mcp Start MCP server (bridge for Cursor / Claude Desktop)
291
+
292
+ Options:
293
+ -h, --help Show help
294
+ -v, --version Show version
295
+ --verbose Show verbose output
296
+ --config <path> Specify config file path
297
+ -f, --framework <name> Framework for new project (create command: vue | react | preact, default: vue)
298
+ -o, --outdir <path> Output directory (build command, default: ./dist)
299
+ -b, --branch <name> Branch to build (build command, default: main)
300
+ --minify Minify output (build command, default: true)
301
+ --sourcemap Generate source maps (build command)
302
+ --analyze Analyze bundle size (build command)
303
+
304
+ Examples:
305
+ jucie create my-app
306
+ jucie design
307
+ jucie dev
308
+ jucie build
309
+ jucie build --outdir ./build --branch main --sourcemap
310
+ `)}a(lL,"showHelp");function xre(){console.log(`Jucie CLI v${e$.version}`)}a(xre,"showVersion");async function vre(){Ks.version&&(xre(),process.exit(0)),(Ks.help||!XS)&&(lL(),process.exit(0));try{switch(XS){case"create":uL||(console.error(`
311
+ \u274C Error: Project name is required
312
+ `),console.log(`Usage: jucie create <project-name>
313
+ `),process.exit(1)),await Uy(uL,{...Ks,framework:eh.framework,cliVersion:e$.version});break;case"design":await sx(eh,Ks);break;case"dev":await y_(eh,Ks);break;case"build":await n_(eh,Ks);break;case"mcp":await cL({port:Ll("port","p")});break;default:console.error(`
314
+ \u274C Error: Unknown command "${XS}"
315
+ `),lL(),process.exit(1)}}catch(t){console.trace(`
316
+ \u274C Error unknown: ${t.message}
317
+ `),Ks.verbose&&console.error(t.stack),process.exit(1)}}a(vre,"main");vre();
318
+ /*! Bundled license information:
319
+
320
+ pako/dist/pako.esm.mjs:
321
+ (*! pako 2.2.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)
322
+ */