@highstate/designer 0.19.1 → 0.21.1

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 (557) hide show
  1. package/.output/nitro.json +5 -5
  2. package/.output/public/_nuxt/-OnKOwAh.js +1 -0
  3. package/.output/public/_nuxt/32ctXXKs.js +1 -0
  4. package/.output/public/_nuxt/5X7smno1.js +1 -0
  5. package/.output/public/_nuxt/5gjbd9sK.js +1 -0
  6. package/.output/public/_nuxt/9OHRRPkh.js +1 -0
  7. package/.output/public/_nuxt/B-dJABhs.js +1 -0
  8. package/.output/public/_nuxt/B2SoM2pd.js +2 -0
  9. package/.output/public/_nuxt/B4FDp1sn.js +1 -0
  10. package/.output/public/_nuxt/{CmALWFRB.js → B69Z0Xk1.js} +16 -468
  11. package/.output/public/_nuxt/B7RpoNQl.js +1 -0
  12. package/.output/public/_nuxt/B7c-h3xW.js +1 -0
  13. package/.output/public/_nuxt/BA47KaF1.js +1 -0
  14. package/.output/public/_nuxt/BArXRmKu.js +1 -0
  15. package/.output/public/_nuxt/BBf5iR-q.js +1 -0
  16. package/.output/public/_nuxt/BCJKqJxW.js +1 -0
  17. package/.output/public/_nuxt/{YB_1Ta41.js → BD_Kvn-W.js} +1 -1
  18. package/.output/public/_nuxt/BGHnOYBU.js +1 -0
  19. package/.output/public/_nuxt/BH7IYjvW.js +1 -0
  20. package/.output/public/_nuxt/BIPWeF69.js +1 -0
  21. package/.output/public/_nuxt/BJDFO7_C.js +1 -0
  22. package/.output/public/_nuxt/BKIVPvZX.js +1 -0
  23. package/.output/public/_nuxt/{Xi2tawMN.js → BLmx8bSh.js} +1 -1
  24. package/.output/public/_nuxt/BN7gUcg9.js +1 -0
  25. package/.output/public/_nuxt/{DlfHMoPT.js → BPQ3VLAy.js} +1 -1
  26. package/.output/public/_nuxt/{BBGuKPBd.js → BR5kRUq4.js} +1 -1
  27. package/.output/public/_nuxt/BTd2ZN65.js +1 -0
  28. package/.output/public/_nuxt/BTifaqeh.js +1 -0
  29. package/.output/public/_nuxt/BUw7H-hv.js +1 -0
  30. package/.output/public/_nuxt/{DRprw4p4.js → BVQ-GDCI.js} +1 -1
  31. package/.output/public/_nuxt/BXphdu9w.js +2 -0
  32. package/.output/public/_nuxt/{BbQj0Z2C.js → BYV0-3_D.js} +1 -1
  33. package/.output/public/_nuxt/BYmSxWA_.js +1 -0
  34. package/.output/public/_nuxt/BZvkOJ9d.js +1 -0
  35. package/.output/public/_nuxt/BcVCzyr7.js +1 -0
  36. package/.output/public/_nuxt/BdRuKvw2.js +1 -0
  37. package/.output/public/_nuxt/Bdd5S2WL.js +1 -0
  38. package/.output/public/_nuxt/BeH2EWoN.js +1 -0
  39. package/.output/public/_nuxt/BhozkjGO.js +1 -0
  40. package/.output/public/_nuxt/Bl_Sz9PU.js +1 -0
  41. package/.output/public/_nuxt/Bmn6On1c.js +1 -0
  42. package/.output/public/_nuxt/{BIAuTxu3.js → Br6cN0cg.js} +1 -1
  43. package/.output/public/_nuxt/Bs8TB6Bu.js +1 -0
  44. package/.output/public/_nuxt/BtrNScOx.js +1 -0
  45. package/.output/public/_nuxt/{DcmvOc98.js → Bu1xs0Fv.js} +1 -1
  46. package/.output/public/_nuxt/BupMEc6X.js +6 -0
  47. package/.output/public/_nuxt/Bv_4Rxtq.js +1 -0
  48. package/.output/public/_nuxt/Bv_vOb-Y.js +14 -0
  49. package/.output/public/_nuxt/BvzEVeQv.js +1 -0
  50. package/.output/public/_nuxt/BwKAHWnp.js +1 -0
  51. package/.output/public/_nuxt/BxAss8Tj.js +1 -0
  52. package/.output/public/_nuxt/BxgE0vQu.js +1 -0
  53. package/.output/public/_nuxt/ByE1aAlg.js +2 -0
  54. package/.output/public/_nuxt/{COI20M4I.js → BzTr9Aqm.js} +1 -1
  55. package/.output/public/_nuxt/BzhaMbyl.js +1 -0
  56. package/.output/public/_nuxt/{CXu1NL6O.js → C-HG3fhB.js} +1 -1
  57. package/.output/public/_nuxt/C2zyO9uX.js +1 -0
  58. package/.output/public/_nuxt/C3Wv6jpd.js +1 -0
  59. package/.output/public/_nuxt/C4EeE6gA.js +1 -0
  60. package/.output/public/_nuxt/C4XpvUuq.js +1 -0
  61. package/.output/public/_nuxt/{C-Jbm3Hp.js → C4gqWexZ.js} +1 -1
  62. package/.output/public/_nuxt/C5BYcBs_.js +1 -0
  63. package/.output/public/_nuxt/{DTMYz4Jt.js → C5YyOfLZ.js} +1 -1
  64. package/.output/public/_nuxt/C7zT0LnQ.js +1 -0
  65. package/.output/public/_nuxt/C973_vs5.js +5 -0
  66. package/.output/public/_nuxt/C9dUb6Cb.js +1 -0
  67. package/.output/public/_nuxt/{DS1LvVMU.js → C9oPPf7i.js} +1 -1
  68. package/.output/public/_nuxt/CBIEPWAA.js +1 -0
  69. package/.output/public/_nuxt/CBVcjGJL.js +1 -0
  70. package/.output/public/_nuxt/CENFIVCM.js +1 -0
  71. package/.output/public/_nuxt/{D1uDOp7C.js → CFHQjOhq.js} +1 -1
  72. package/.output/public/_nuxt/{DKzvysjW.js → CH1njM8p.js} +1 -1
  73. package/.output/public/_nuxt/CJN4g-3R.js +1 -0
  74. package/.output/public/_nuxt/CLZrNe3w.js +1 -0
  75. package/.output/public/_nuxt/CMTm3GFP.js +1 -0
  76. package/.output/public/_nuxt/COcwbKMJ.js +1 -0
  77. package/.output/public/_nuxt/CPsHsqGU.js +1 -0
  78. package/.output/public/_nuxt/CTRkBkra.js +1 -0
  79. package/.output/public/_nuxt/{CcyOm34o.js → CVdnzihN.js} +1 -1
  80. package/.output/public/_nuxt/CW8IKDeL.js +1 -0
  81. package/.output/public/_nuxt/{pkIJ47B4.js → CXZktZb0.js} +1 -1
  82. package/.output/public/_nuxt/CYL3VlR9.js +1 -0
  83. package/.output/public/_nuxt/CYpkKp66.js +1 -0
  84. package/.output/public/_nuxt/CYsAdtH9.js +1 -0
  85. package/.output/public/_nuxt/{BUyGWigt.js → CZhp0h8q.js} +1 -1
  86. package/.output/public/_nuxt/CaehGOgh.js +1 -0
  87. package/.output/public/_nuxt/CemiMtCX.js +1 -0
  88. package/.output/public/_nuxt/{oTG82Wo1.js → CenWIFCC.js} +1 -1
  89. package/.output/public/_nuxt/{Dtc2v4kS.js → CgK0fS9t.js} +1 -1
  90. package/.output/public/_nuxt/{BtsDLbAf.js → Cl0AqbOI.js} +1 -1
  91. package/.output/public/_nuxt/{DUSGQflk.js → Cm3UrAx6.js} +1 -1
  92. package/.output/public/_nuxt/{BGHREFWD.js → CmIQRyeF.js} +1 -1
  93. package/.output/public/_nuxt/CmJE87KM.js +1 -0
  94. package/.output/public/_nuxt/Cn-bp-IR.js +1 -0
  95. package/.output/public/_nuxt/{f7oK2omx.js → Cn7AkR1O.js} +1 -1
  96. package/.output/public/_nuxt/CnhVSb6R.js +1 -0
  97. package/.output/public/_nuxt/{JhPuU2gP.js → CnnebwVN.js} +1 -1
  98. package/.output/public/_nuxt/CnsnAmq5.js +1 -0
  99. package/.output/public/_nuxt/CoDkCxhg.js +1 -0
  100. package/.output/public/_nuxt/CpGRan2R.js +1 -0
  101. package/.output/public/_nuxt/{B-hkwWGT.js → CpOuai2O.js} +1 -1
  102. package/.output/public/_nuxt/CqQg8Ldy.js +1 -0
  103. package/.output/public/_nuxt/Cs-GjQ8R.js +1 -0
  104. package/.output/public/_nuxt/CtbC3i8L.js +1 -0
  105. package/.output/public/_nuxt/{BDzgwa52.js → CufHLc7y.js} +1 -1
  106. package/.output/public/_nuxt/CvSiusML.js +1 -0
  107. package/.output/public/_nuxt/CwoSXNpI.js +1 -0
  108. package/.output/public/_nuxt/CxLEBnE3.js +1 -0
  109. package/.output/public/_nuxt/{DNrj_gVY.js → CxbxFI8M.js} +1 -1
  110. package/.output/public/_nuxt/CxoCegAs.js +13 -0
  111. package/.output/public/_nuxt/Cz-197mS.js +1 -0
  112. package/.output/public/_nuxt/Cz2AlsmD.js +1 -0
  113. package/.output/public/_nuxt/D-7HtdRe.js +12 -0
  114. package/.output/public/_nuxt/{NleAzG8P.js → D4_iv3hh.js} +1 -1
  115. package/.output/public/_nuxt/D53aC0YG.js +1 -0
  116. package/.output/public/_nuxt/{Dg5xB15N.js → D82vCrfD.js} +1 -1
  117. package/.output/public/_nuxt/D87Tk5Gz.js +1 -0
  118. package/.output/public/_nuxt/D8_7TLub.js +1 -0
  119. package/.output/public/_nuxt/D8l8udqQ.js +1 -0
  120. package/.output/public/_nuxt/DCK6hB22.js +1 -0
  121. package/.output/public/_nuxt/{Cb0HU5_O.js → DDvzSYfr.js} +1 -1
  122. package/.output/public/_nuxt/DEtIJe2u.js +1 -0
  123. package/.output/public/_nuxt/DEthMvLe.js +1 -0
  124. package/.output/public/_nuxt/DFWUc33u.js +1 -0
  125. package/.output/public/_nuxt/{5bLW0GMw.js → DGP4VlC8.js} +1 -1
  126. package/.output/public/_nuxt/DHJ62FKo.js +2 -0
  127. package/.output/public/_nuxt/{CnK8MTSM.js → DHQR4-dF.js} +1 -1
  128. package/.output/public/_nuxt/DJjDtW9f.js +1 -0
  129. package/.output/public/_nuxt/DKWXhhCy.js +1 -0
  130. package/.output/public/_nuxt/DPOp833l.js +1 -0
  131. package/.output/public/_nuxt/DQyhUUbL.js +1 -0
  132. package/.output/public/_nuxt/DRJZaHtK.js +1 -0
  133. package/.output/public/_nuxt/{DPcUKYIF.js → DRw_LuNl.js} +1 -1
  134. package/.output/public/_nuxt/DSDbyhpJ.js +1 -0
  135. package/.output/public/_nuxt/{B8ROHVmM.js → DSeZwD4N.js} +1 -1
  136. package/.output/public/_nuxt/{GAB5JH5K.js → DSpiceQe.js} +1 -1
  137. package/.output/public/_nuxt/DTPYfUid.js +1 -0
  138. package/.output/public/_nuxt/DUHba1vY.js +1 -0
  139. package/.output/public/_nuxt/DV7GczEv.js +1 -0
  140. package/.output/public/_nuxt/DXyfavJr.js +1 -0
  141. package/.output/public/_nuxt/DYE7WIF3.js +1 -0
  142. package/.output/public/_nuxt/DZf3V79B.js +1 -0
  143. package/.output/public/_nuxt/{BPzJO5Oe.js → DZu-aV2c.js} +1 -1
  144. package/.output/public/_nuxt/D_wY_uke.js +1 -0
  145. package/.output/public/_nuxt/Dahes9VH.js +1 -0
  146. package/.output/public/_nuxt/DdvHdmGh.js +1 -0
  147. package/.output/public/_nuxt/DfvKjH24.js +1 -0
  148. package/.output/public/_nuxt/DgsIRcX7.js +1 -0
  149. package/.output/public/_nuxt/{Cdx7mHEO.js → DhmSosst.js} +1 -1
  150. package/.output/public/_nuxt/{D32k8WzR.js → DjAJT7YJ.js} +1 -1
  151. package/.output/public/_nuxt/Djg8J2AC.js +1 -0
  152. package/.output/public/_nuxt/DkkrdwgN.js +1 -0
  153. package/.output/public/_nuxt/DnpKvmH_.js +1 -0
  154. package/.output/public/_nuxt/{CA7CTBwS.js → Dph4kLrZ.js} +1 -1
  155. package/.output/public/_nuxt/DqQDbK_p.js +1 -0
  156. package/.output/public/_nuxt/DrWe3t51.js +2 -0
  157. package/.output/public/_nuxt/DsG1SoRB.js +1 -0
  158. package/.output/public/_nuxt/Dspwwk_N.js +1 -0
  159. package/.output/public/_nuxt/DsumFeuD.js +1 -0
  160. package/.output/public/_nuxt/DtBrxin9.js +1 -0
  161. package/.output/public/_nuxt/{D7ScPSBf.js → DxNHbxmM.js} +1 -1
  162. package/.output/public/_nuxt/{CLvts2aQ.js → DxSwrfjg.js} +1 -1
  163. package/.output/public/_nuxt/{COEtLSDF.js → Dzze3sRP.js} +1 -1
  164. package/.output/public/_nuxt/EnN6XTXK.js +1 -0
  165. package/.output/public/_nuxt/Fcs-0n6A.js +1 -0
  166. package/.output/public/_nuxt/{B5ZR69Tn.js → FtFNcQmh.js} +1 -1
  167. package/.output/public/_nuxt/GXzlut8R.js +1 -0
  168. package/.output/public/_nuxt/{DkhsQLT2.js → GsRaNv29.js} +1 -1
  169. package/.output/public/_nuxt/IF9eRakj.js +1 -0
  170. package/.output/public/_nuxt/Lks7C8cK.js +3 -0
  171. package/.output/public/_nuxt/M0WOzN-S.js +269 -0
  172. package/.output/public/_nuxt/OuCcJFrZ.js +1 -0
  173. package/.output/public/_nuxt/{SecretValueField.DcyO8gGc.css → SecretValueField.Dy80RlGP.css} +1 -1
  174. package/.output/public/_nuxt/UD_auLNX.js +1 -0
  175. package/.output/public/_nuxt/Ve4PFQV2.js +1 -0
  176. package/.output/public/_nuxt/{CU27uY9n.js → W9tJ9s81.js} +1 -1
  177. package/.output/public/_nuxt/{DeWFVDHI.js → YqXBG_HV.js} +1 -1
  178. package/.output/public/_nuxt/ZpmLW6rw.js +1 -0
  179. package/.output/public/_nuxt/_H4v1dQx.js +1 -0
  180. package/.output/public/_nuxt/_snapshotId_.ChuSNeNY.css +1 -0
  181. package/.output/public/_nuxt/builds/latest.json +1 -1
  182. package/.output/public/_nuxt/builds/meta/d356de5d-6230-4e66-aba2-c48f455ae207.json +1 -0
  183. package/.output/public/_nuxt/builds/meta/ed797280-2bf0-44e6-a601-2ff2462bfbbc.json +1 -0
  184. package/.output/public/_nuxt/c6k-jVO-.js +1 -0
  185. package/.output/public/_nuxt/edge-router-BdPMCV6u.js +1 -0
  186. package/.output/public/_nuxt/{entry.dxugZJXl.css → entry.Bc0aTA0K.css} +1 -1
  187. package/.output/public/_nuxt/eo99z4R2.js +1 -0
  188. package/.output/public/_nuxt/error-404.iOXvqd5J.css +1 -0
  189. package/.output/public/_nuxt/error-500.D0BgXBui.css +1 -0
  190. package/.output/public/_nuxt/{DrZfEa88.js → fKv21gyL.js} +1 -1
  191. package/.output/public/_nuxt/graph-layout-B7wl80r3.js +1 -0
  192. package/.output/public/_nuxt/graph-resolver-E9RSC1Ga.js +180 -0
  193. package/.output/public/_nuxt/hAFXcJ2_.js +1 -0
  194. package/.output/public/_nuxt/{CGqH5EJj.js → hJgmCMqR.js} +1 -1
  195. package/.output/public/_nuxt/{BoKiGodi.js → k_qm7-4y.js} +1 -1
  196. package/.output/public/_nuxt/{IvJ92aGK.js → m17aaUwq.js} +1 -1
  197. package/.output/public/_nuxt/mWjccvbQ.js +1 -0
  198. package/.output/public/_nuxt/{BXY8tDGw.js → mjskCLCv.js} +1 -1
  199. package/.output/public/_nuxt/monaco-editor.DOXZIHvr.css +1 -0
  200. package/.output/public/_nuxt/n2N0HUVH.js +1 -0
  201. package/.output/public/_nuxt/oH_c3LbQ.js +1 -0
  202. package/.output/public/_nuxt/{BHrmToEH.js → qdsjHGoJ.js} +1 -1
  203. package/.output/public/_nuxt/{BbcW6ACK.js → rGO070M0.js} +1 -1
  204. package/.output/public/_nuxt/rZm6bMo-.js +1 -0
  205. package/.output/public/_nuxt/rscZxuQ2.js +1 -0
  206. package/.output/public/_nuxt/sB5TSp0H.js +18 -0
  207. package/.output/public/_nuxt/u5AG7uiY.js +1 -0
  208. package/.output/public/_nuxt/uYugtg8r.js +1 -0
  209. package/.output/public/_nuxt/vuetify.BzdWZaIq.css +1 -0
  210. package/.output/public/_nuxt/wCosSBIO.js +1 -0
  211. package/.output/public/_nuxt/{BMMyXqK5.js → wDzz0qaB.js} +1 -1
  212. package/.output/public/_nuxt/xnReCuE4.js +1 -0
  213. package/.output/public/_nuxt/y0GN4iGv.js +1 -0
  214. package/.output/public/_nuxt/yaml.worker-CYOhFCVP.js +395 -0
  215. package/.output/public/libavoid.wasm +0 -0
  216. package/.output/server/index.mjs +3216 -13095
  217. package/.output/server/index.mjs.map +1 -1
  218. package/.output/server/node_modules/@babel/parser/lib/index.js +428 -441
  219. package/.output/server/node_modules/@babel/parser/package.json +6 -6
  220. package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.cjs +57 -0
  221. package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.mjs +4 -4
  222. package/.output/server/node_modules/@trpc/server/dist/codes-BfZsPdy-.cjs +222 -0
  223. package/.output/server/node_modules/@trpc/server/dist/{utils-CLZnJdb_.mjs → codes-DagpWZLc.mjs} +66 -66
  224. package/.output/server/node_modules/@trpc/server/dist/{contentTypeParsers-SN4WL9ze.mjs → contentTypeParsers-iAFF_pJG.cjs} +7 -2
  225. package/.output/server/node_modules/@trpc/server/dist/getErrorShape-MR4DZeb7.cjs +341 -0
  226. package/.output/server/node_modules/@trpc/server/dist/{getErrorShape-BH60iMC2.mjs → getErrorShape-vC8mUXJD.mjs} +3 -3
  227. package/.output/server/node_modules/@trpc/server/dist/http.cjs +14 -0
  228. package/.output/server/node_modules/@trpc/server/dist/index.cjs +22 -0
  229. package/.output/server/node_modules/@trpc/server/dist/index.mjs +4 -4
  230. package/.output/server/node_modules/@trpc/server/dist/{initTRPC-CB9uBez5.mjs → initTRPC-B1ggxyJl.mjs} +4 -4
  231. package/.output/server/node_modules/@trpc/server/dist/initTRPC-BXPPV9Tx.cjs +416 -0
  232. package/.output/server/node_modules/@trpc/server/dist/observable/index.cjs +13 -0
  233. package/.output/server/node_modules/@trpc/server/dist/observable-B1Nk6r1H.cjs +181 -0
  234. package/.output/server/node_modules/@trpc/server/dist/{observable-CUiPknO-.mjs → observable-BVzLuBs6.cjs} +42 -8
  235. package/.output/server/node_modules/@trpc/server/dist/{parseTRPCMessage-BlZeZ60t.mjs → parseTRPCMessage-7Ltmq-Fb.cjs} +14 -4
  236. package/.output/server/node_modules/@trpc/server/dist/resolveResponse-B0CCg8nq.cjs +2365 -0
  237. package/.output/server/node_modules/@trpc/server/dist/{resolveResponse-DngSgha6.mjs → resolveResponse-C5I6V_wc.mjs} +109 -63
  238. package/.output/server/node_modules/@trpc/server/dist/rpc.cjs +6 -0
  239. package/.output/server/node_modules/@trpc/server/dist/{tracked-Blz8XOf1.mjs → tracked-DiE3uR1B.mjs} +22 -11
  240. package/.output/server/node_modules/@trpc/server/dist/tracked-Dj_dpOJE.cjs +486 -0
  241. package/.output/server/node_modules/@trpc/server/package.json +17 -7
  242. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +129 -107
  243. package/.output/server/node_modules/@vue/compiler-core/package.json +5 -5
  244. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +54 -54
  245. package/.output/server/node_modules/@vue/compiler-dom/package.json +3 -3
  246. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +35 -33
  247. package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
  248. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +134 -53
  249. package/.output/server/node_modules/@vue/reactivity/package.json +2 -2
  250. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +1900 -1771
  251. package/.output/server/node_modules/@vue/runtime-core/package.json +3 -3
  252. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +147 -39
  253. package/.output/server/node_modules/@vue/runtime-dom/package.json +5 -5
  254. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +8 -4
  255. package/.output/server/node_modules/@vue/server-renderer/package.json +4 -4
  256. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +1 -1
  257. package/.output/server/node_modules/@vue/shared/package.json +1 -1
  258. package/.output/server/node_modules/copy-anything/dist/index.js +47 -31
  259. package/.output/server/node_modules/copy-anything/package.json +19 -72
  260. package/.output/server/node_modules/devalue/index.js +1 -0
  261. package/.output/server/node_modules/devalue/package.json +5 -2
  262. package/.output/server/node_modules/devalue/src/base64.js +46 -96
  263. package/.output/server/node_modules/devalue/src/constants.js +1 -0
  264. package/.output/server/node_modules/devalue/src/parse.js +82 -9
  265. package/.output/server/node_modules/devalue/src/stringify.js +108 -34
  266. package/.output/server/node_modules/devalue/src/uneval.js +207 -58
  267. package/.output/server/node_modules/devalue/src/utils.js +38 -8
  268. package/.output/server/node_modules/entities/{lib/decode_codepoint.js → dist/commonjs/decode-codepoint.js} +16 -15
  269. package/.output/server/node_modules/entities/{lib → dist/commonjs}/decode.js +200 -168
  270. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
  271. package/.output/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
  272. package/.output/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
  273. package/.output/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
  274. package/.output/server/node_modules/entities/dist/commonjs/package.json +3 -0
  275. package/.output/server/node_modules/entities/package.json +99 -69
  276. package/.output/server/node_modules/hookable/dist/index.mjs +238 -271
  277. package/.output/server/node_modules/hookable/package.json +33 -29
  278. package/.output/server/node_modules/is-what/dist/getType.js +4 -0
  279. package/.output/server/node_modules/is-what/dist/index.js +43 -171
  280. package/.output/server/node_modules/is-what/dist/isAnyObject.js +8 -0
  281. package/.output/server/node_modules/is-what/dist/isArray.js +5 -0
  282. package/.output/server/node_modules/is-what/dist/isBigInt.js +5 -0
  283. package/.output/server/node_modules/is-what/dist/isBlob.js +5 -0
  284. package/.output/server/node_modules/is-what/dist/isBoolean.js +5 -0
  285. package/.output/server/node_modules/is-what/dist/isDate.js +5 -0
  286. package/.output/server/node_modules/is-what/dist/isEmptyArray.js +5 -0
  287. package/.output/server/node_modules/is-what/dist/isEmptyObject.js +8 -0
  288. package/.output/server/node_modules/is-what/dist/isEmptyString.js +4 -0
  289. package/.output/server/node_modules/is-what/dist/isError.js +5 -0
  290. package/.output/server/node_modules/is-what/dist/isFile.js +5 -0
  291. package/.output/server/node_modules/is-what/dist/isFullArray.js +5 -0
  292. package/.output/server/node_modules/is-what/dist/isFullObject.js +8 -0
  293. package/.output/server/node_modules/is-what/dist/isFullString.js +5 -0
  294. package/.output/server/node_modules/is-what/dist/isFunction.js +4 -0
  295. package/.output/server/node_modules/is-what/dist/isHexDecimal.js +12 -0
  296. package/.output/server/node_modules/is-what/dist/isInstanceOf.js +19 -0
  297. package/.output/server/node_modules/is-what/dist/isInteger.js +5 -0
  298. package/.output/server/node_modules/is-what/dist/isIterable.js +16 -0
  299. package/.output/server/node_modules/is-what/dist/isMap.js +5 -0
  300. package/.output/server/node_modules/is-what/dist/isNaNValue.js +5 -0
  301. package/.output/server/node_modules/is-what/dist/isNegativeInteger.js +5 -0
  302. package/.output/server/node_modules/is-what/dist/isNegativeNumber.js +5 -0
  303. package/.output/server/node_modules/is-what/dist/isNull.js +5 -0
  304. package/.output/server/node_modules/is-what/dist/isNullOrUndefined.js +5 -0
  305. package/.output/server/node_modules/is-what/dist/isNumber.js +9 -0
  306. package/.output/server/node_modules/is-what/dist/isObject.js +8 -0
  307. package/.output/server/node_modules/is-what/dist/isObjectLike.js +11 -0
  308. package/.output/server/node_modules/is-what/dist/isOneOf.js +15 -0
  309. package/.output/server/node_modules/is-what/dist/isPlainObject.js +11 -0
  310. package/.output/server/node_modules/is-what/dist/isPositiveInteger.js +5 -0
  311. package/.output/server/node_modules/is-what/dist/isPositiveNumber.js +5 -0
  312. package/.output/server/node_modules/is-what/dist/isPrimitive.js +21 -0
  313. package/.output/server/node_modules/is-what/dist/isPromise.js +5 -0
  314. package/.output/server/node_modules/is-what/dist/isRegExp.js +5 -0
  315. package/.output/server/node_modules/is-what/dist/isSet.js +5 -0
  316. package/.output/server/node_modules/is-what/dist/isString.js +5 -0
  317. package/.output/server/node_modules/is-what/dist/isSymbol.js +5 -0
  318. package/.output/server/node_modules/is-what/dist/isType.js +20 -0
  319. package/.output/server/node_modules/is-what/dist/isUndefined.js +5 -0
  320. package/.output/server/node_modules/is-what/dist/isWeakMap.js +5 -0
  321. package/.output/server/node_modules/is-what/dist/isWeakSet.js +5 -0
  322. package/.output/server/node_modules/is-what/package.json +23 -88
  323. package/.output/server/node_modules/superjson/dist/index.js +9 -6
  324. package/.output/server/node_modules/superjson/dist/pathstringifier.js +13 -2
  325. package/.output/server/node_modules/superjson/dist/plainer.js +23 -11
  326. package/.output/server/node_modules/superjson/dist/transformer.js +4 -1
  327. package/.output/server/node_modules/superjson/package.json +5 -21
  328. package/.output/server/node_modules/trpc-bun-adapter/dist/index.js +406 -0
  329. package/.output/server/node_modules/trpc-bun-adapter/package.json +44 -0
  330. package/.output/server/node_modules/ufo/dist/index.mjs +16 -9
  331. package/.output/server/node_modules/ufo/package.json +15 -14
  332. package/.output/server/node_modules/unhead/dist/plugins.mjs +4 -4
  333. package/.output/server/node_modules/unhead/dist/server.mjs +4 -6
  334. package/.output/server/node_modules/unhead/dist/shared/{unhead.BpRRHAhY.mjs → unhead.B5FWS6X0.mjs} +35 -22
  335. package/.output/server/node_modules/unhead/dist/shared/{unhead.DZbvapt-.mjs → unhead.CbpEuj3y.mjs} +3 -2
  336. package/.output/server/node_modules/unhead/dist/shared/{unhead.DH45uomy.mjs → unhead.Ct24BOby.mjs} +6 -4
  337. package/.output/server/node_modules/unhead/dist/shared/unhead.D4vSFytZ.mjs +236 -0
  338. package/.output/server/node_modules/unhead/dist/shared/{unhead.Djo8ep_Y.mjs → unhead.TxTMM7cM.mjs} +2 -2
  339. package/.output/server/node_modules/unhead/dist/utils.mjs +2 -2
  340. package/.output/server/node_modules/unhead/package.json +2 -2
  341. package/.output/server/node_modules/vue/dist/vue.cjs.js +1 -1
  342. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +1 -1
  343. package/.output/server/node_modules/vue/package.json +7 -7
  344. package/.output/server/node_modules/zod/package.json +1 -1
  345. package/.output/server/node_modules/zod/v4/classic/checks.js +1 -1
  346. package/.output/server/node_modules/zod/v4/classic/external.js +3 -1
  347. package/.output/server/node_modules/zod/v4/classic/from-json-schema.js +584 -0
  348. package/.output/server/node_modules/zod/v4/classic/schemas.js +121 -4
  349. package/.output/server/node_modules/zod/v4/core/api.js +157 -0
  350. package/.output/server/node_modules/zod/v4/core/checks.js +8 -2
  351. package/.output/server/node_modules/zod/v4/core/core.js +20 -11
  352. package/.output/server/node_modules/zod/v4/core/index.js +2 -0
  353. package/.output/server/node_modules/zod/v4/core/json-schema-generator.js +95 -0
  354. package/.output/server/node_modules/zod/v4/core/json-schema-processors.js +605 -0
  355. package/.output/server/node_modules/zod/v4/core/regexes.js +8 -2
  356. package/.output/server/node_modules/zod/v4/core/registries.js +3 -4
  357. package/.output/server/node_modules/zod/v4/core/schemas.js +204 -66
  358. package/.output/server/node_modules/zod/v4/core/to-json-schema.js +391 -869
  359. package/.output/server/node_modules/zod/v4/core/util.js +58 -8
  360. package/.output/server/node_modules/zod/v4/core/versions.js +2 -2
  361. package/.output/server/node_modules/zod/v4/locales/ar.js +14 -24
  362. package/.output/server/node_modules/zod/v4/locales/az.js +14 -24
  363. package/.output/server/node_modules/zod/v4/locales/be.js +16 -24
  364. package/.output/server/node_modules/zod/v4/locales/bg.js +16 -24
  365. package/.output/server/node_modules/zod/v4/locales/ca.js +14 -25
  366. package/.output/server/node_modules/zod/v4/locales/cs.js +18 -42
  367. package/.output/server/node_modules/zod/v4/locales/da.js +23 -39
  368. package/.output/server/node_modules/zod/v4/locales/de.js +16 -24
  369. package/.output/server/node_modules/zod/v4/locales/en.js +16 -24
  370. package/.output/server/node_modules/zod/v4/locales/eo.js +17 -24
  371. package/.output/server/node_modules/zod/v4/locales/es.js +42 -59
  372. package/.output/server/node_modules/zod/v4/locales/fa.js +16 -24
  373. package/.output/server/node_modules/zod/v4/locales/fi.js +14 -24
  374. package/.output/server/node_modules/zod/v4/locales/fr-CA.js +14 -24
  375. package/.output/server/node_modules/zod/v4/locales/fr.js +16 -24
  376. package/.output/server/node_modules/zod/v4/locales/he.js +175 -78
  377. package/.output/server/node_modules/zod/v4/locales/hu.js +16 -25
  378. package/.output/server/node_modules/zod/v4/locales/hy.js +147 -0
  379. package/.output/server/node_modules/zod/v4/locales/id.js +14 -24
  380. package/.output/server/node_modules/zod/v4/locales/index.js +2 -0
  381. package/.output/server/node_modules/zod/v4/locales/is.js +16 -24
  382. package/.output/server/node_modules/zod/v4/locales/it.js +16 -25
  383. package/.output/server/node_modules/zod/v4/locales/ja.js +16 -24
  384. package/.output/server/node_modules/zod/v4/locales/ka.js +19 -32
  385. package/.output/server/node_modules/zod/v4/locales/km.js +17 -24
  386. package/.output/server/node_modules/zod/v4/locales/ko.js +14 -24
  387. package/.output/server/node_modules/zod/v4/locales/lt.js +27 -54
  388. package/.output/server/node_modules/zod/v4/locales/mk.js +16 -25
  389. package/.output/server/node_modules/zod/v4/locales/ms.js +15 -24
  390. package/.output/server/node_modules/zod/v4/locales/nl.js +25 -32
  391. package/.output/server/node_modules/zod/v4/locales/no.js +16 -24
  392. package/.output/server/node_modules/zod/v4/locales/ota.js +17 -25
  393. package/.output/server/node_modules/zod/v4/locales/pl.js +16 -24
  394. package/.output/server/node_modules/zod/v4/locales/ps.js +16 -24
  395. package/.output/server/node_modules/zod/v4/locales/pt.js +16 -24
  396. package/.output/server/node_modules/zod/v4/locales/ru.js +16 -24
  397. package/.output/server/node_modules/zod/v4/locales/sl.js +16 -24
  398. package/.output/server/node_modules/zod/v4/locales/sv.js +16 -24
  399. package/.output/server/node_modules/zod/v4/locales/ta.js +17 -24
  400. package/.output/server/node_modules/zod/v4/locales/th.js +17 -24
  401. package/.output/server/node_modules/zod/v4/locales/tr.js +14 -24
  402. package/.output/server/node_modules/zod/v4/locales/uk.js +16 -25
  403. package/.output/server/node_modules/zod/v4/locales/ur.js +17 -24
  404. package/.output/server/node_modules/zod/v4/locales/uz.js +109 -0
  405. package/.output/server/node_modules/zod/v4/locales/vi.js +16 -24
  406. package/.output/server/node_modules/zod/v4/locales/yo.js +16 -24
  407. package/.output/server/node_modules/zod/v4/locales/zh-CN.js +17 -24
  408. package/.output/server/node_modules/zod/v4/locales/zh-TW.js +14 -24
  409. package/.output/server/package.json +22 -22
  410. package/package.json +20 -14
  411. package/.output/public/_nuxt/-oaD50UK.js +0 -1
  412. package/.output/public/_nuxt/0ekw3e2V.js +0 -1
  413. package/.output/public/_nuxt/1DNp92w6.js +0 -1
  414. package/.output/public/_nuxt/1f5tAgHw.js +0 -1
  415. package/.output/public/_nuxt/5ggY4uig.js +0 -1
  416. package/.output/public/_nuxt/6nHXG8SA.js +0 -1
  417. package/.output/public/_nuxt/9hmcqHPO.js +0 -1
  418. package/.output/public/_nuxt/BBxmzUt6.js +0 -1
  419. package/.output/public/_nuxt/BE2KfCdU.js +0 -1
  420. package/.output/public/_nuxt/BFNM2w_f.js +0 -1
  421. package/.output/public/_nuxt/BGLu70Yq.js +0 -1
  422. package/.output/public/_nuxt/BIuj43Wh.js +0 -1
  423. package/.output/public/_nuxt/BLsOQd1H.js +0 -280
  424. package/.output/public/_nuxt/BNGfscqk.js +0 -1
  425. package/.output/public/_nuxt/BQvybpQq.js +0 -1
  426. package/.output/public/_nuxt/BU7Cl-8B.js +0 -1
  427. package/.output/public/_nuxt/BUXOnL59.js +0 -1
  428. package/.output/public/_nuxt/Bbwybh3N.js +0 -2
  429. package/.output/public/_nuxt/BczD6j-v.js +0 -1
  430. package/.output/public/_nuxt/BepWV7mh.js +0 -1
  431. package/.output/public/_nuxt/Bh0qehhp.js +0 -1
  432. package/.output/public/_nuxt/Bl2oy6fF.js +0 -1
  433. package/.output/public/_nuxt/BmDdxTjo.js +0 -1
  434. package/.output/public/_nuxt/BqeRdtD4.js +0 -2
  435. package/.output/public/_nuxt/BvAqAH-y.js +0 -1
  436. package/.output/public/_nuxt/BxZD33h1.js +0 -1
  437. package/.output/public/_nuxt/C4zpeTvm.js +0 -1
  438. package/.output/public/_nuxt/C7Pw0Ztw.js +0 -1
  439. package/.output/public/_nuxt/C8-UwF3o.js +0 -1
  440. package/.output/public/_nuxt/CCd08HS_.js +0 -1
  441. package/.output/public/_nuxt/CEYFgC8B.js +0 -1
  442. package/.output/public/_nuxt/CHadp7IV.js +0 -1
  443. package/.output/public/_nuxt/CHh-QcGE.js +0 -1
  444. package/.output/public/_nuxt/CIUZ1G5V.js +0 -1
  445. package/.output/public/_nuxt/CJ6lOLXp.js +0 -1
  446. package/.output/public/_nuxt/CN9dMhDM.js +0 -1
  447. package/.output/public/_nuxt/CQ4fj8p0.js +0 -1
  448. package/.output/public/_nuxt/CTWiQX6C.js +0 -1
  449. package/.output/public/_nuxt/CUEJCptM.js +0 -1
  450. package/.output/public/_nuxt/CXxzV4dz.js +0 -1
  451. package/.output/public/_nuxt/CZlF05X6.js +0 -1
  452. package/.output/public/_nuxt/CatV_12G.js +0 -1
  453. package/.output/public/_nuxt/CeMkeBDb.js +0 -1
  454. package/.output/public/_nuxt/CelvVQyk.js +0 -1
  455. package/.output/public/_nuxt/CfV455SO.js +0 -1
  456. package/.output/public/_nuxt/CfeIJUat.js +0 -1
  457. package/.output/public/_nuxt/CfqrF6sE.js +0 -1
  458. package/.output/public/_nuxt/Cfs9EX91.js +0 -1
  459. package/.output/public/_nuxt/ChH_ziBE.js +0 -1
  460. package/.output/public/_nuxt/ChM1GEGa.js +0 -1
  461. package/.output/public/_nuxt/Cp2bjttb.js +0 -1
  462. package/.output/public/_nuxt/Cu8OsqJL.js +0 -1
  463. package/.output/public/_nuxt/CusJppg0.js +0 -1
  464. package/.output/public/_nuxt/Cv9koXgw.js +0 -1
  465. package/.output/public/_nuxt/CvELRi2k.js +0 -5
  466. package/.output/public/_nuxt/Cw6nGM9K.js +0 -1
  467. package/.output/public/_nuxt/CwUT5n6w.js +0 -1
  468. package/.output/public/_nuxt/D-AHKB2i.js +0 -6
  469. package/.output/public/_nuxt/D-kcn2fr.js +0 -1
  470. package/.output/public/_nuxt/D08WgyRC.js +0 -1
  471. package/.output/public/_nuxt/D1Jbgd7O.js +0 -13
  472. package/.output/public/_nuxt/D1ibY74j.js +0 -1
  473. package/.output/public/_nuxt/D22FLkUw.js +0 -1
  474. package/.output/public/_nuxt/D2CYqzqI.js +0 -1
  475. package/.output/public/_nuxt/D34EmFco.js +0 -1
  476. package/.output/public/_nuxt/D4OhWExI.js +0 -1
  477. package/.output/public/_nuxt/DDHikT5j.js +0 -1
  478. package/.output/public/_nuxt/DDTT3lYc.js +0 -1
  479. package/.output/public/_nuxt/DHLkt8Yr.js +0 -1
  480. package/.output/public/_nuxt/DHuTDtaT.js +0 -12
  481. package/.output/public/_nuxt/DKYwYmdq.js +0 -1
  482. package/.output/public/_nuxt/DMDPKkZ0.js +0 -1
  483. package/.output/public/_nuxt/DNEoBllO.js +0 -1
  484. package/.output/public/_nuxt/DRzH1pOL.js +0 -1
  485. package/.output/public/_nuxt/DSUF3NDE.js +0 -1
  486. package/.output/public/_nuxt/DTAwr92a.js +0 -1
  487. package/.output/public/_nuxt/DWmtspXK.js +0 -1
  488. package/.output/public/_nuxt/DXh9HyqW.js +0 -1
  489. package/.output/public/_nuxt/DXtl0MQI.js +0 -1
  490. package/.output/public/_nuxt/D_zCY0Xl.js +0 -1
  491. package/.output/public/_nuxt/DaZJpzOl.js +0 -1
  492. package/.output/public/_nuxt/Df68jz8_.js +0 -1
  493. package/.output/public/_nuxt/DhQfdAdO.js +0 -1
  494. package/.output/public/_nuxt/DiinP2Uv.js +0 -1
  495. package/.output/public/_nuxt/DljmTZ5-.js +0 -1
  496. package/.output/public/_nuxt/Dm4QKadl.js +0 -26
  497. package/.output/public/_nuxt/DmCK90gL.js +0 -1
  498. package/.output/public/_nuxt/Dn2_MT6a.js +0 -1
  499. package/.output/public/_nuxt/Don94nLk.js +0 -1
  500. package/.output/public/_nuxt/Dr8Zlu6v.js +0 -1
  501. package/.output/public/_nuxt/Drp5UXmf.js +0 -1
  502. package/.output/public/_nuxt/DtFoCuZo.js +0 -1
  503. package/.output/public/_nuxt/Dv7Oe6Be.js +0 -1
  504. package/.output/public/_nuxt/DxuitVdg.js +0 -2
  505. package/.output/public/_nuxt/DyJlTyXw.js +0 -1
  506. package/.output/public/_nuxt/Jep7L2Wt.js +0 -1
  507. package/.output/public/_nuxt/LUl67wzp.js +0 -1
  508. package/.output/public/_nuxt/M2rHlmBj.js +0 -1
  509. package/.output/public/_nuxt/N3RVRbLb.js +0 -1
  510. package/.output/public/_nuxt/NBseiqgx.js +0 -1
  511. package/.output/public/_nuxt/PoHY5YXO.js +0 -1
  512. package/.output/public/_nuxt/SdwduGaY.js +0 -1
  513. package/.output/public/_nuxt/SytC7lKg.js +0 -1
  514. package/.output/public/_nuxt/U3pqMjXV.js +0 -1
  515. package/.output/public/_nuxt/UInuXPgp.js +0 -1
  516. package/.output/public/_nuxt/YXI84j39.js +0 -2
  517. package/.output/public/_nuxt/ZZ6g6dXy.js +0 -2
  518. package/.output/public/_nuxt/builds/meta/033f259e-8ba9-4c82-8824-56febea80b7d.json +0 -1
  519. package/.output/public/_nuxt/dglhsJpM.js +0 -1
  520. package/.output/public/_nuxt/dwrHE3tM.js +0 -14
  521. package/.output/public/_nuxt/edge-router-yEORMNQw.js +0 -4
  522. package/.output/public/_nuxt/error-404.CttAF9VE.css +0 -1
  523. package/.output/public/_nuxt/error-500.DXXd6-x4.css +0 -1
  524. package/.output/public/_nuxt/ga9TZ2z5.js +0 -1
  525. package/.output/public/_nuxt/graph-layout-CFj469YF.js +0 -1
  526. package/.output/public/_nuxt/graph-resolver-eG1ZUsYn.js +0 -166
  527. package/.output/public/_nuxt/monaco-editor.D_J4ItrK.css +0 -1
  528. package/.output/public/_nuxt/ov4D99rA.js +0 -1
  529. package/.output/public/_nuxt/qYU5Tabh.js +0 -1
  530. package/.output/public/_nuxt/qliWkHmV.js +0 -1
  531. package/.output/public/_nuxt/uMbE6_td.js +0 -1
  532. package/.output/public/_nuxt/vuetify.BrkCt9t5.css +0 -5
  533. package/.output/public/_nuxt/yaml.worker-CQ6dFw39.js +0 -405
  534. package/.output/server/node_modules/@trpc/server/dist/adapters/ws.mjs +0 -15
  535. package/.output/server/node_modules/@trpc/server/dist/node-http-8dtdvMrE.mjs +0 -222
  536. package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import-D89CaGtL.mjs +0 -29
  537. package/.output/server/node_modules/@trpc/server/dist/ws-BR20IWki.mjs +0 -420
  538. package/.output/server/node_modules/entities/lib/generated/decode-data-html.js +0 -9
  539. package/.output/server/node_modules/entities/lib/generated/decode-data-xml.js +0 -9
  540. package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +0 -148
  541. package/.output/server/node_modules/ws/lib/buffer-util.js +0 -131
  542. package/.output/server/node_modules/ws/lib/constants.js +0 -18
  543. package/.output/server/node_modules/ws/lib/event-target.js +0 -292
  544. package/.output/server/node_modules/ws/lib/extension.js +0 -203
  545. package/.output/server/node_modules/ws/lib/limiter.js +0 -55
  546. package/.output/server/node_modules/ws/lib/permessage-deflate.js +0 -528
  547. package/.output/server/node_modules/ws/lib/receiver.js +0 -706
  548. package/.output/server/node_modules/ws/lib/sender.js +0 -602
  549. package/.output/server/node_modules/ws/lib/stream.js +0 -161
  550. package/.output/server/node_modules/ws/lib/subprotocol.js +0 -62
  551. package/.output/server/node_modules/ws/lib/validation.js +0 -152
  552. package/.output/server/node_modules/ws/lib/websocket-server.js +0 -550
  553. package/.output/server/node_modules/ws/lib/websocket.js +0 -1388
  554. package/.output/server/node_modules/ws/package.json +0 -69
  555. package/.output/server/node_modules/ws/wrapper.mjs +0 -8
  556. package/LICENSE +0 -21
  557. /package/.output/server/node_modules/@trpc/server/dist/{http-CWyjOa1l.mjs → http-DXy3XyhL.cjs} +0 -0
@@ -0,0 +1,180 @@
1
+ function U(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=o.prototype,h=Object.keys(l);for(let p=0;p<h.length;p++){const d=h[p];d in a||(a[d]=l[d].bind(a))}}const s=n?.Parent??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function o(a){var c;const l=n?.Parent?new i:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const h of l._zod.deferred)h();return l}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class Xt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Oa extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Aa={};function kt(e){return Aa}function Na(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function Ds(e,t){return typeof t=="bigint"?t.toString():t}function Gr(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Vs(e){return e==null}function Ks(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function bu(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const i=n>s?n:s,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}const bi=Symbol("evaluating");function me(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==bi)return r===void 0&&(r=bi,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Mt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ot(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function $i(e){return JSON.stringify(e)}function $u(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ta="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Nn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Su=Gr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function sn(e){if(Nn(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Nn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Pa(e){return sn(e)?{...e}:Array.isArray(e)?[...e]:e}const Eu=new Set(["string","number","symbol"]),ku=new Set(["string","number","bigint","boolean","symbol","undefined"]);function jt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function At(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function te(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Iu(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Ou={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]};function Au(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=Ot(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return Mt(this,"shape",o),o},checks:[]});return At(e,i)}function Nu(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Ot(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return Mt(this,"shape",o),o},checks:[]});return At(e,i)}function Tu(e,t){if(!sn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(i,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ot(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Mt(this,"shape",i),i}});return At(e,s)}function Pu(e,t){if(!sn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ot(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Mt(this,"shape",r),r}});return At(e,n)}function Cu(e,t){const n=Ot(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Mt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return At(e,n)}function xu(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Ot(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return Mt(this,"shape",c),c},checks:[]});return At(t,o)}function Bu(e,t,n){const r=Ot(t._zod.def,{get shape(){const s=t._zod.def.shape,i={...s};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)i[o]=new e({type:"nonoptional",innerType:s[o]});return Mt(this,"shape",i),i}});return At(t,r)}function Ht(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Gt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function jn(e){return typeof e=="string"?e:e?.message}function It(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=jn(e.inst?._zod.def?.error?.(e))??jn(t?.error?.(e))??jn(n.customError?.(e))??jn(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Js(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tn(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Ca=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ds,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},xa=U("$ZodError",Ca),Ba=U("$ZodError",Ca,{Parent:Error});function Du(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function zu(e,t=n=>n.message){const n={_errors:[]},r=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(o=>r({issues:o}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let o=n,a=0;for(;a<i.path.length;){const c=i.path[a];a===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],a++}}};return r(e),n}const Hs=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Xt;if(o.issues.length){const a=new(s?.Err??e)(o.issues.map(c=>It(c,i,kt())));throw Ta(a,s?.callee),a}return o.value},Gs=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(s?.Err??e)(o.issues.map(c=>It(c,i,kt())));throw Ta(a,s?.callee),a}return o.value},Wr=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Xt;return i.issues.length?{success:!1,error:new(e??xa)(i.issues.map(o=>It(o,s,kt())))}:{success:!0,data:i.value}},Ru=Wr(Ba),Yr=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(o=>It(o,s,kt())))}:{success:!0,data:i.value}},ju=Yr(Ba),Fu=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Hs(e)(t,n,s)},Mu=e=>(t,n,r)=>Hs(e)(t,n,r),Uu=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Gs(e)(t,n,s)},Lu=e=>async(t,n,r)=>Gs(e)(t,n,r),qu=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Wr(e)(t,n,s)},Zu=e=>(t,n,r)=>Wr(e)(t,n,r),Vu=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Yr(e)(t,n,s)},Ku=e=>async(t,n,r)=>Yr(e)(t,n,r),Ju=/^[cC][^\s-]{8,}$/,Hu=/^[0-9a-z]+$/,Gu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Wu=/^[0-9a-vA-V]{20}$/,Yu=/^[A-Za-z0-9]{27}$/,Qu=/^[a-zA-Z0-9_-]{21}$/,Xu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,el=/^([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})$/,Si=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,nl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function rl(){return new RegExp(nl,"u")}const sl=/^(?:(?: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])$/,il=/^(([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}|:))$/,ol=/^((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])$/,al=/^(([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])$/,cl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Da=/^[A-Za-z0-9_-]*$/,ul=/^\+[1-9]\d{6,14}$/,za="(?:(?:\\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])))",ll=new RegExp(`^${za}$`);function Ra(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function fl(e){return new RegExp(`^${Ra(e)}$`)}function dl(e){const t=Ra({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${za}T(?:${r})$`)}const hl=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},pl=/^-?\d+$/,ja=/^-?\d+(?:\.\d+)?$/,ml=/^(?:true|false)$/i,gl=/^[^A-Z]*$/,yl=/^[^a-z]*$/,Xe=U("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Fa={number:"number",bigint:"bigint",object:"date"},Ma=U("$ZodCheckLessThan",(e,t)=>{Xe.init(e,t);const n=Fa[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ua=U("$ZodCheckGreaterThan",(e,t)=>{Xe.init(e,t);const n=Fa[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wl=U("$ZodCheckMultipleOf",(e,t)=>{Xe.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):bu(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),vl=U("$ZodCheckNumberFormat",(e,t)=>{Xe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=Ou[t.format];e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,a.minimum=s,a.maximum=i,n&&(a.pattern=pl)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),_l=U("$ZodCheckMaxLength",(e,t)=>{var n;Xe.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Vs(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const o=Js(s);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),bl=U("$ZodCheckMinLength",(e,t)=>{var n;Xe.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Vs(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const o=Js(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),$l=U("$ZodCheckLengthEquals",(e,t)=>{var n;Xe.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!Vs(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,i=s.length;if(i===t.length)return;const o=Js(s),a=i>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Qr=U("$ZodCheckStringFormat",(e,t)=>{var n,r;Xe.init(e,t),e._zod.onattach.push(s=>{const i=s._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Sl=U("$ZodCheckRegex",(e,t)=>{Qr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),El=U("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=gl),Qr.init(e,t)}),kl=U("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=yl),Qr.init(e,t)}),Il=U("$ZodCheckIncludes",(e,t)=>{Xe.init(e,t);const n=jt(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),Ol=U("$ZodCheckStartsWith",(e,t)=>{Xe.init(e,t);const n=new RegExp(`^${jt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Al=U("$ZodCheckEndsWith",(e,t)=>{Xe.init(e,t);const n=new RegExp(`.*${jt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Nl=U("$ZodCheckOverwrite",(e,t)=>{Xe.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Tl{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
2
+ `).filter(o=>o),s=Math.min(...r.map(o=>o.length-o.trimStart().length)),i=r.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of i)this.content.push(o)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,s.join(`
3
+ `))}}const Pl={major:4,minor:3,patch:6},Ee=U("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Pl;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const i of s._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(o,a,c)=>{let l=Ht(o),h;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(l)continue;const d=o.issues.length,m=p._zod.check(o);if(m instanceof Promise&&c?.async===!1)throw new Xt;if(h||m instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await m,o.issues.length!==d&&(l||(l=Ht(o,d)))});else{if(o.issues.length===d)continue;l||(l=Ht(o,d))}}return h?h.then(()=>o):o},i=(o,a,c)=>{if(Ht(o))return o.aborted=!0,o;const l=s(a,r,c);if(l instanceof Promise){if(c.async===!1)throw new Xt;return l.then(h=>e._zod.parse(h,c))}return e._zod.parse(l,c)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if(a.direction==="backward"){const l=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(h=>i(h,o,a)):i(l,o,a)}const c=e._zod.parse(o,a);if(c instanceof Promise){if(a.async===!1)throw new Xt;return c.then(l=>s(l,r,a))}return s(c,r,a)}}me(e,"~standard",()=>({validate:s=>{try{const i=Ru(e,s);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ju(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Ws=U("$ZodString",(e,t)=>{Ee.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??hl(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ae=U("$ZodStringFormat",(e,t)=>{Qr.init(e,t),Ws.init(e,t)}),Cl=U("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=el),Ae.init(e,t)}),xl=U("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Si(r))}else t.pattern??(t.pattern=Si());Ae.init(e,t)}),Bl=U("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tl),Ae.init(e,t)}),Dl=U("$ZodURL",(e,t)=>{Ae.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),zl=U("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=rl()),Ae.init(e,t)}),Rl=U("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Qu),Ae.init(e,t)}),jl=U("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ju),Ae.init(e,t)}),Fl=U("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Hu),Ae.init(e,t)}),Ml=U("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Gu),Ae.init(e,t)}),Ul=U("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Wu),Ae.init(e,t)}),Ll=U("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Yu),Ae.init(e,t)}),ql=U("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=dl(t)),Ae.init(e,t)}),Zl=U("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ll),Ae.init(e,t)}),Vl=U("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=fl(t)),Ae.init(e,t)}),Kl=U("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Xu),Ae.init(e,t)}),Jl=U("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=sl),Ae.init(e,t),e._zod.bag.format="ipv4"}),Hl=U("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=il),Ae.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Gl=U("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ol),Ae.init(e,t)}),Wl=U("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=al),Ae.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,i]=r;if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function La(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Yl=U("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=cl),Ae.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{La(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Ql(e){if(!Da.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return La(n)}const Xl=U("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Da),Ae.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Ql(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),ef=U("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ul),Ae.init(e,t)});function tf(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const nf=U("$ZodJWT",(e,t)=>{Ae.init(e,t),e._zod.check=n=>{tf(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),qa=U("$ZodNumber",(e,t)=>{Ee.init(e,t),e._zod.pattern=e._zod.bag.pattern??ja,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),rf=U("$ZodNumberFormat",(e,t)=>{vl.init(e,t),qa.init(e,t)}),sf=U("$ZodBoolean",(e,t)=>{Ee.init(e,t),e._zod.pattern=ml,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),of=U("$ZodUnknown",(e,t)=>{Ee.init(e,t),e._zod.parse=n=>n}),af=U("$ZodNever",(e,t)=>{Ee.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),cf=U("$ZodDate",(e,t)=>{Ee.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const s=n.value,i=s instanceof Date;return i&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...i?{received:"Invalid Date"}:{},inst:e}),n}});function Ei(e,t,n){e.issues.length&&t.issues.push(...Gt(n,e.issues)),t.value[n]=e.value}const uf=U("$ZodArray",(e,t)=>{Ee.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let o=0;o<s.length;o++){const a=s[o],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?i.push(c.then(l=>Ei(l,n,o))):Ei(c,n,o)}return i.length?Promise.all(i).then(()=>n):n}});function Ur(e,t,n,r,s){if(e.issues.length){if(s&&!(n in r))return;t.issues.push(...Gt(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Za(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Iu(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Va(e,t,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,l=c.def.type,h=c.optout==="optional";for(const p in t){if(a.has(p))continue;if(l==="never"){o.push(p);continue}const d=c.run({value:t[p],issues:[]},r);d instanceof Promise?e.push(d.then(m=>Ur(m,n,p,t,h))):Ur(d,n,p,t,h)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const lf=U("$ZodObject",(e,t)=>{if(Ee.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Gr(()=>Za(t));me(e._zod,"propValues",()=>{const a=t.shape,c={};for(const l in a){const h=a[l]._zod;if(h.values){c[l]??(c[l]=new Set);for(const p of h.values)c[l].add(p)}}return c});const s=Nn,i=t.catchall;let o;e._zod.parse=(a,c)=>{o??(o=r.value);const l=a.value;if(!s(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const h=[],p=o.shape;for(const d of o.keys){const m=p[d],_=m._zod.optout==="optional",g=m._zod.run({value:l[d],issues:[]},c);g instanceof Promise?h.push(g.then(w=>Ur(w,a,d,l,_))):Ur(g,a,d,l,_)}return i?Va(h,l,a,c,r.value,e):h.length?Promise.all(h).then(()=>a):a}}),ff=U("$ZodObjectJIT",(e,t)=>{lf.init(e,t);const n=e._zod.parse,r=Gr(()=>Za(t)),s=d=>{const m=new Tl(["shape","payload","ctx"]),_=r.value,g=b=>{const I=$i(b);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};m.write("const input = payload.value;");const w=Object.create(null);let $=0;for(const b of _.keys)w[b]=`key_${$++}`;m.write("const newResult = {};");for(const b of _.keys){const I=w[b],v=$i(b),A=d[b]?._zod?.optout==="optional";m.write(`const ${I} = ${g(b)};`),A?m.write(`
4
+ if (${I}.issues.length) {
5
+ if (${v} in input) {
6
+ payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
7
+ ...iss,
8
+ path: iss.path ? [${v}, ...iss.path] : [${v}]
9
+ })));
10
+ }
11
+ }
12
+
13
+ if (${I}.value === undefined) {
14
+ if (${v} in input) {
15
+ newResult[${v}] = undefined;
16
+ }
17
+ } else {
18
+ newResult[${v}] = ${I}.value;
19
+ }
20
+
21
+ `):m.write(`
22
+ if (${I}.issues.length) {
23
+ payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
24
+ ...iss,
25
+ path: iss.path ? [${v}, ...iss.path] : [${v}]
26
+ })));
27
+ }
28
+
29
+ if (${I}.value === undefined) {
30
+ if (${v} in input) {
31
+ newResult[${v}] = undefined;
32
+ }
33
+ } else {
34
+ newResult[${v}] = ${I}.value;
35
+ }
36
+
37
+ `)}m.write("payload.value = newResult;"),m.write("return payload;");const y=m.compile();return(b,I)=>y(d,b,I)};let i;const o=Nn,a=!Aa.jitless,l=a&&Su.value,h=t.catchall;let p;e._zod.parse=(d,m)=>{p??(p=r.value);const _=d.value;return o(_)?a&&l&&m?.async===!1&&m.jitless!==!0?(i||(i=s(t.shape)),d=i(d,m),h?Va([],_,d,m,p,e):d):n(d,m):(d.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),d)}});function ki(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!Ht(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>It(o,r,kt())))}),t)}const Ka=U("$ZodUnion",(e,t)=>{Ee.init(e,t),me(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),me(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),me(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),me(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>Ks(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const c of t.options){const l=c._zod.run({value:s.value,issues:[]},i);if(l instanceof Promise)a.push(l),o=!0;else{if(l.issues.length===0)return l;a.push(l)}}return o?Promise.all(a).then(c=>ki(c,s,e,i)):ki(a,s,e,i)}}),df=U("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ka.init(e,t);const n=e._zod.parse;me(e._zod,"propValues",()=>{const s={};for(const i of t.options){const o=i._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[a,c]of Object.entries(o)){s[a]||(s[a]=new Set);for(const l of c)s[a].add(l)}}return s});const r=Gr(()=>{const s=t.options,i=new Map;for(const o of s){const a=o._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,o)}}return i});e._zod.parse=(s,i)=>{const o=s.value;if(!Nn(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const a=r.value.get(o?.[t.discriminator]);return a?a._zod.run(s,i):t.unionFallback?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),hf=U("$ZodIntersection",(e,t)=>{Ee.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),o=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([c,l])=>Ii(n,c,l)):Ii(n,i,o)}});function zs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(sn(e)&&sn(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};for(const i of r){const o=zs(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],o=zs(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ii(e,t,n){const r=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&s&&e.issues.push({...s,keys:i}),Ht(e))return e;const o=zs(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const pf=U("$ZodRecord",(e,t)=>{Ee.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!sn(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const l of o)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);const h=t.valueType._zod.run({value:s[l],issues:[]},r);h instanceof Promise?i.push(h.then(p=>{p.issues.length&&n.issues.push(...Gt(l,p.issues)),n.value[l]=p.value})):(h.issues.length&&n.issues.push(...Gt(l,h.issues)),n.value[l]=h.value)}let c;for(const l in s)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ja.test(a)&&c.issues.length){const p=t.keyType._zod.run({value:Number(a),issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){t.mode==="loose"?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>It(p,r,kt())),input:a,path:[a],inst:e});continue}const h=t.valueType._zod.run({value:s[a],issues:[]},r);h instanceof Promise?i.push(h.then(p=>{p.issues.length&&n.issues.push(...Gt(a,p.issues)),n.value[c.value]=p.value})):(h.issues.length&&n.issues.push(...Gt(a,h.issues)),n.value[c.value]=h.value)}}return i.length?Promise.all(i).then(()=>n):n}}),mf=U("$ZodEnum",(e,t)=>{Ee.init(e,t);const n=Na(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>Eu.has(typeof s)).map(s=>typeof s=="string"?jt(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),gf=U("$ZodLiteral",(e,t)=>{if(Ee.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?jt(r):r?jt(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),yf=U("$ZodTransform",(e,t)=>{Ee.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Oa(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new Xt;return n.value=s,n}});function Oi(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ja=U("$ZodOptional",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",e._zod.optout="optional",me(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),me(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ks(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Oi(i,n.value)):Oi(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),wf=U("$ZodExactOptional",(e,t)=>{Ja.init(e,t),me(e._zod,"values",()=>t.innerType._zod.values),me(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),vf=U("$ZodNullable",(e,t)=>{Ee.init(e,t),me(e._zod,"optin",()=>t.innerType._zod.optin),me(e._zod,"optout",()=>t.innerType._zod.optout),me(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ks(n.source)}|null)$`):void 0}),me(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),_f=U("$ZodDefault",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",me(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Ai(i,t)):Ai(s,t)}});function Ai(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const bf=U("$ZodPrefault",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",me(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),$f=U("$ZodNonOptional",(e,t)=>{Ee.init(e,t),me(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Ni(i,e)):Ni(s,e)}});function Ni(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Sf=U("$ZodCatch",(e,t)=>{Ee.init(e,t),me(e._zod,"optin",()=>t.innerType._zod.optin),me(e._zod,"optout",()=>t.innerType._zod.optout),me(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>It(o,r,kt()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>It(i,r,kt()))},input:n.value}),n.issues=[]),n)}}),Ef=U("$ZodPipe",(e,t)=>{Ee.init(e,t),me(e._zod,"values",()=>t.in._zod.values),me(e._zod,"optin",()=>t.in._zod.optin),me(e._zod,"optout",()=>t.out._zod.optout),me(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>Fn(o,t.in,r)):Fn(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>Fn(i,t.out,r)):Fn(s,t.out,r)}});function Fn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const kf=U("$ZodCodec",(e,t)=>{Ee.init(e,t),me(e._zod,"values",()=>t.in._zod.values),me(e._zod,"optin",()=>t.in._zod.optin),me(e._zod,"optout",()=>t.out._zod.optout),me(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(o=>Mn(o,t,r)):Mn(i,t,r)}else{const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>Mn(o,t,r)):Mn(i,t,r)}}});function Mn(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){const s=t.transform(e.value,e);return s instanceof Promise?s.then(i=>Un(e,i,t.out,n)):Un(e,s,t.out,n)}else{const s=t.reverseTransform(e.value,e);return s instanceof Promise?s.then(i=>Un(e,i,t.in,n)):Un(e,s,t.in,n)}}function Un(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const If=U("$ZodReadonly",(e,t)=>{Ee.init(e,t),me(e._zod,"propValues",()=>t.innerType._zod.propValues),me(e._zod,"values",()=>t.innerType._zod.values),me(e._zod,"optin",()=>t.innerType?._zod?.optin),me(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(Ti):Ti(s)}});function Ti(e){return e.value=Object.freeze(e.value),e}const Of=U("$ZodTemplateLiteral",(e,t)=>{Ee.init(e,t);const n=[];for(const r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);const s=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!s)throw new Error(`Invalid template literal part: ${r._zod.traits}`);const i=s.startsWith("^")?1:0,o=s.endsWith("$")?s.length-1:s.length;n.push(s.slice(i,o))}else if(r===null||ku.has(typeof r))n.push(jt(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,s)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),Af=U("$ZodCustom",(e,t)=>{Xe.init(e,t),Ee.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>Pi(i,n,r,e));Pi(s,n,r,e)}});function Pi(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(Tn(s))}}var Ci;class Nf{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Tf(){return new Nf}(Ci=globalThis).__zod_globalRegistry??(Ci.__zod_globalRegistry=Tf());const En=globalThis.__zod_globalRegistry;function Pf(e,t){return new e({type:"string",...te(t)})}function Cf(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...te(t)})}function xi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...te(t)})}function xf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...te(t)})}function Bf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(t)})}function Df(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(t)})}function zf(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(t)})}function Ha(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...te(t)})}function Rf(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...te(t)})}function jf(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(t)})}function Ff(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...te(t)})}function Ga(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(t)})}function Mf(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...te(t)})}function Uf(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...te(t)})}function Lf(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(t)})}function qf(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(t)})}function Zf(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(t)})}function Vf(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(t)})}function Kf(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(t)})}function Jf(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...te(t)})}function Hf(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...te(t)})}function Gf(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...te(t)})}function Wf(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...te(t)})}function Yf(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(t)})}function Qf(e,t){return new e({type:"string",format:"date",check:"string_format",...te(t)})}function Xf(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...te(t)})}function ed(e,t){return new e({type:"string",format:"duration",check:"string_format",...te(t)})}function td(e,t){return new e({type:"number",checks:[],...te(t)})}function nd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...te(t)})}function rd(e,t){return new e({type:"boolean",...te(t)})}function sd(e,t){return new e({type:"boolean",coerce:!0,...te(t)})}function id(e){return new e({type:"unknown"})}function od(e,t){return new e({type:"never",...te(t)})}function ad(e,t){return new e({type:"date",...te(t)})}function Bi(e,t){return new Ma({check:"less_than",...te(t),value:e,inclusive:!1})}function Br(e,t){return new Ma({check:"less_than",...te(t),value:e,inclusive:!0})}function Di(e,t){return new Ua({check:"greater_than",...te(t),value:e,inclusive:!1})}function Dr(e,t){return new Ua({check:"greater_than",...te(t),value:e,inclusive:!0})}function zi(e,t){return new wl({check:"multiple_of",...te(t),value:e})}function Wa(e,t){return new _l({check:"max_length",...te(t),maximum:e})}function Lr(e,t){return new bl({check:"min_length",...te(t),minimum:e})}function Ya(e,t){return new $l({check:"length_equals",...te(t),length:e})}function cd(e,t){return new Sl({check:"string_format",format:"regex",...te(t),pattern:e})}function ud(e){return new El({check:"string_format",format:"lowercase",...te(e)})}function ld(e){return new kl({check:"string_format",format:"uppercase",...te(e)})}function fd(e,t){return new Il({check:"string_format",format:"includes",...te(t),includes:e})}function dd(e,t){return new Ol({check:"string_format",format:"starts_with",...te(t),prefix:e})}function hd(e,t){return new Al({check:"string_format",format:"ends_with",...te(t),suffix:e})}function cn(e){return new Nl({check:"overwrite",tx:e})}function pd(e){return cn(t=>t.normalize(e))}function md(){return cn(e=>e.trim())}function gd(){return cn(e=>e.toLowerCase())}function yd(){return cn(e=>e.toUpperCase())}function wd(){return cn(e=>$u(e))}function vd(e,t,n){return new e({type:"array",element:t,...te(n)})}function _d(e,t,n){const r=te(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function bd(e,t,n){return new e({type:"custom",check:"custom",fn:t,...te(n)})}function $d(e){const t=Sd(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Tn(r,n.value,t._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(Tn(s))}},e(n.value,n)));return t}function Sd(e,t){const n=new Xe({check:"custom",...te(t)});return n._zod.check=e,n}function Qa(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??En,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ze(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const h={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,h);else{const d=o.schema,m=t.processors[s.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);m(e,t,d,h)}const p=e._zod.parent;p&&(o.ref||(o.ref=p),ze(p,t,h),t.seen.get(p).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io==="input"&&He(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Xa(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const a=e.metadataRegistry.get(o[0])?.id;if(a){const c=r.get(a);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,o[0])}}const s=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(o[0])?.id,d=e.external.uri??(_=>_);if(p)return{ref:d(p)};const m=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=m,{defId:m,ref:`${d("__shared")}#/${a}/${m}`}}if(o[1]===n)return{ref:"#"};const l=`#/${a}/`,h=o[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:l+h}},i=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:c,defId:l}=s(o);a.def={...a.schema},l&&(a.defId=l);const h=a.schema;for(const p in h)delete h[p];h.$ref=c};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
38
+
39
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const a=o[1];if(t===o[0]){i(o);continue}if(e.external){const l=e.external.registry.get(o[0])?.id;if(t!==o[0]&&l){i(o);continue}}if(e.metadataRegistry.get(o[0])?.id){i(o);continue}if(a.cycle){i(o);continue}if(a.count>1&&e.reused==="ref"){i(o);continue}}}function ec(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const a=e.seen.get(o);if(a.ref===null)return;const c=a.def??a.schema,l={...c},h=a.ref;if(a.ref=null,h){r(h);const d=e.seen.get(h),m=d.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,l),o._zod.parent===h)for(const g in c)g==="$ref"||g==="allOf"||g in l||delete c[g];if(m.$ref&&d.def)for(const g in c)g==="$ref"||g==="allOf"||g in d.def&&JSON.stringify(c[g])===JSON.stringify(d.def[g])&&delete c[g]}const p=o._zod.parent;if(p&&p!==h){r(p);const d=e.seen.get(p);if(d?.schema.$ref&&(c.$ref=d.schema.$ref,d.def))for(const m in c)m==="$ref"||m==="allOf"||m in d.def&&JSON.stringify(c[m])===JSON.stringify(d.def[m])&&delete c[m]}e.override({zodSchema:o,jsonSchema:c,path:a.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const o of e.seen.entries()){const a=o[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:qr(t,"input",e.processors),output:qr(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function He(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return He(r.element,n);if(r.type==="set")return He(r.valueType,n);if(r.type==="lazy")return He(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return He(r.innerType,n);if(r.type==="intersection")return He(r.left,n)||He(r.right,n);if(r.type==="record"||r.type==="map")return He(r.keyType,n)||He(r.valueType,n);if(r.type==="pipe")return He(r.in,n)||He(r.out,n);if(r.type==="object"){for(const s in r.shape)if(He(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(He(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(He(s,n))return!0;return!!(r.rest&&He(r.rest,n))}return!1}const Ed=(e,t={})=>n=>{const r=Qa({...n,processors:t});return ze(e,r),Xa(r,e),ec(r,e)},qr=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=Qa({...s??{},target:i,io:t,processors:n});return ze(e,o),Xa(o,e),ec(o,e)},kd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Id=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),a&&(s.format=kd[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),l&&(s.contentEncoding=l),c&&c.size>0){const h=[...c];h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Od=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:h}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=h,s.exclusiveMinimum=!0):s.exclusiveMinimum=h),typeof i=="number"&&(s.minimum=i,typeof h=="number"&&t.target!=="draft-04"&&(h>=i?delete s.minimum:delete s.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=l,s.exclusiveMaximum=!0):s.exclusiveMaximum=l),typeof o=="number"&&(s.maximum=o,typeof l=="number"&&t.target!=="draft-04"&&(l<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},Ad=(e,t,n,r)=>{n.type="boolean"},Nd=(e,t,n,r)=>{n.not={}},Td=(e,t,n,r)=>{},Pd=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Cd=(e,t,n,r)=>{const s=e._zod.def,i=Na(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},xd=(e,t,n,r)=>{const s=e._zod.def,i=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},Bd=(e,t,n,r)=>{const s=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=i.source},Dd=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zd=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Rd=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=ze(i.element,t,{...r,path:[...r.path,"items"]})},jd=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const l in o)s.properties[l]=ze(o[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(l=>{const h=i.shape[l]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));c.size>0&&(s.required=Array.from(c)),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=ze(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},Fd=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((a,c)=>ze(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=o:n.anyOf=o},Md=(e,t,n,r)=>{const s=e._zod.def,i=ze(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=ze(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=c},Ud=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,c=o._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){const h=ze(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const p of c)s.patternProperties[p.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=ze(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=ze(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const l=o._zod.values;if(l){const h=[...l].filter(p=>typeof p=="string"||typeof p=="number");h.length>0&&(s.required=h)}},Ld=(e,t,n,r)=>{const s=e._zod.def,i=ze(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},qd=(e,t,n,r)=>{const s=e._zod.def;ze(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},Zd=(e,t,n,r)=>{const s=e._zod.def;ze(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},Vd=(e,t,n,r)=>{const s=e._zod.def;ze(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Kd=(e,t,n,r)=>{const s=e._zod.def;ze(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},Jd=(e,t,n,r)=>{const s=e._zod.def,i=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;ze(i,t,r);const o=t.seen.get(e);o.ref=i},Hd=(e,t,n,r)=>{const s=e._zod.def;ze(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},tc=(e,t,n,r)=>{const s=e._zod.def;ze(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},Gd=U("ZodISODateTime",(e,t)=>{ql.init(e,t),Ne.init(e,t)});function Wd(e){return Yf(Gd,e)}const Yd=U("ZodISODate",(e,t)=>{Zl.init(e,t),Ne.init(e,t)});function Qd(e){return Qf(Yd,e)}const Xd=U("ZodISOTime",(e,t)=>{Vl.init(e,t),Ne.init(e,t)});function eh(e){return Xf(Xd,e)}const th=U("ZodISODuration",(e,t)=>{Kl.init(e,t),Ne.init(e,t)});function nh(e){return ed(th,e)}const rh=(e,t)=>{xa.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>zu(e,n)},flatten:{value:n=>Du(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ds,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ds,2)}},isEmpty:{get(){return e.issues.length===0}}})},it=U("ZodError",rh,{Parent:Error}),sh=Hs(it),ih=Gs(it),oh=Wr(it),ah=Yr(it),ch=Fu(it),uh=Mu(it),lh=Uu(it),fh=Lu(it),dh=qu(it),hh=Zu(it),ph=Vu(it),mh=Ku(it),ke=U("ZodType",(e,t)=>(Ee.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:qr(e,"input"),output:qr(e,"output")}}),e.toJSONSchema=Ed(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ot(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>At(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>sh(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>oh(e,n,r),e.parseAsync=async(n,r)=>ih(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>ah(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>ch(e,n,r),e.decode=(n,r)=>uh(e,n,r),e.encodeAsync=async(n,r)=>lh(e,n,r),e.decodeAsync=async(n,r)=>fh(e,n,r),e.safeEncode=(n,r)=>dh(e,n,r),e.safeDecode=(n,r)=>hh(e,n,r),e.safeEncodeAsync=async(n,r)=>ph(e,n,r),e.safeDecodeAsync=async(n,r)=>mh(e,n,r),e.refine=(n,r)=>e.check(cp(n,r)),e.superRefine=n=>e.check(up(n)),e.overwrite=n=>e.check(cn(n)),e.optional=()=>Fi(e),e.exactOptional=()=>Hh(e),e.nullable=()=>Mi(e),e.nullish=()=>Fi(Mi(e)),e.nonoptional=n=>ep(e,n),e.array=()=>Ve(e),e.or=n=>Ut([e,n]),e.and=n=>Lh(e,n),e.transform=n=>Ui(e,Kh(n)),e.default=n=>Yh(e,n),e.prefault=n=>Xh(e,n),e.catch=n=>np(e,n),e.pipe=n=>Ui(e,n),e.readonly=()=>op(e),e.describe=n=>{const r=e.clone();return En.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return En.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return En.get(e);const r=e.clone();return En.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),nc=U("_ZodString",(e,t)=>{Ws.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Id(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(cd(...r)),e.includes=(...r)=>e.check(fd(...r)),e.startsWith=(...r)=>e.check(dd(...r)),e.endsWith=(...r)=>e.check(hd(...r)),e.min=(...r)=>e.check(Lr(...r)),e.max=(...r)=>e.check(Wa(...r)),e.length=(...r)=>e.check(Ya(...r)),e.nonempty=(...r)=>e.check(Lr(1,...r)),e.lowercase=r=>e.check(ud(r)),e.uppercase=r=>e.check(ld(r)),e.trim=()=>e.check(md()),e.normalize=(...r)=>e.check(pd(...r)),e.toLowerCase=()=>e.check(gd()),e.toUpperCase=()=>e.check(yd()),e.slugify=()=>e.check(wd())}),gh=U("ZodString",(e,t)=>{Ws.init(e,t),nc.init(e,t),e.email=n=>e.check(Cf(yh,n)),e.url=n=>e.check(Ha(rc,n)),e.jwt=n=>e.check(Wf(Ch,n)),e.emoji=n=>e.check(Rf(vh,n)),e.guid=n=>e.check(xi(Ri,n)),e.uuid=n=>e.check(xf(Ln,n)),e.uuidv4=n=>e.check(Bf(Ln,n)),e.uuidv6=n=>e.check(Df(Ln,n)),e.uuidv7=n=>e.check(zf(Ln,n)),e.nanoid=n=>e.check(jf(_h,n)),e.guid=n=>e.check(xi(Ri,n)),e.cuid=n=>e.check(Ff(bh,n)),e.cuid2=n=>e.check(Ga(sc,n)),e.ulid=n=>e.check(Mf($h,n)),e.base64=n=>e.check(Jf(Nh,n)),e.base64url=n=>e.check(Hf(Th,n)),e.xid=n=>e.check(Uf(Sh,n)),e.ksuid=n=>e.check(Lf(Eh,n)),e.ipv4=n=>e.check(qf(kh,n)),e.ipv6=n=>e.check(Zf(Ih,n)),e.cidrv4=n=>e.check(Vf(Oh,n)),e.cidrv6=n=>e.check(Kf(Ah,n)),e.e164=n=>e.check(Gf(Ph,n)),e.datetime=n=>e.check(Wd(n)),e.date=n=>e.check(Qd(n)),e.time=n=>e.check(eh(n)),e.duration=n=>e.check(nh(n))});function z(e){return Pf(gh,e)}const Ne=U("ZodStringFormat",(e,t)=>{Ae.init(e,t),nc.init(e,t)}),yh=U("ZodEmail",(e,t)=>{Bl.init(e,t),Ne.init(e,t)}),Ri=U("ZodGUID",(e,t)=>{Cl.init(e,t),Ne.init(e,t)}),Ln=U("ZodUUID",(e,t)=>{xl.init(e,t),Ne.init(e,t)}),rc=U("ZodURL",(e,t)=>{Dl.init(e,t),Ne.init(e,t)});function wh(e){return Ha(rc,e)}const vh=U("ZodEmoji",(e,t)=>{zl.init(e,t),Ne.init(e,t)}),_h=U("ZodNanoID",(e,t)=>{Rl.init(e,t),Ne.init(e,t)}),bh=U("ZodCUID",(e,t)=>{jl.init(e,t),Ne.init(e,t)}),sc=U("ZodCUID2",(e,t)=>{Fl.init(e,t),Ne.init(e,t)});function ye(e){return Ga(sc,e)}const $h=U("ZodULID",(e,t)=>{Ml.init(e,t),Ne.init(e,t)}),Sh=U("ZodXID",(e,t)=>{Ul.init(e,t),Ne.init(e,t)}),Eh=U("ZodKSUID",(e,t)=>{Ll.init(e,t),Ne.init(e,t)}),kh=U("ZodIPv4",(e,t)=>{Jl.init(e,t),Ne.init(e,t)}),Ih=U("ZodIPv6",(e,t)=>{Hl.init(e,t),Ne.init(e,t)}),Oh=U("ZodCIDRv4",(e,t)=>{Gl.init(e,t),Ne.init(e,t)}),Ah=U("ZodCIDRv6",(e,t)=>{Wl.init(e,t),Ne.init(e,t)}),Nh=U("ZodBase64",(e,t)=>{Yl.init(e,t),Ne.init(e,t)}),Th=U("ZodBase64URL",(e,t)=>{Xl.init(e,t),Ne.init(e,t)}),Ph=U("ZodE164",(e,t)=>{ef.init(e,t),Ne.init(e,t)}),Ch=U("ZodJWT",(e,t)=>{nf.init(e,t),Ne.init(e,t)}),ic=U("ZodNumber",(e,t)=>{qa.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Od(e,r,s),e.gt=(r,s)=>e.check(Di(r,s)),e.gte=(r,s)=>e.check(Dr(r,s)),e.min=(r,s)=>e.check(Dr(r,s)),e.lt=(r,s)=>e.check(Bi(r,s)),e.lte=(r,s)=>e.check(Br(r,s)),e.max=(r,s)=>e.check(Br(r,s)),e.int=r=>e.check(ji(r)),e.safe=r=>e.check(ji(r)),e.positive=r=>e.check(Di(0,r)),e.nonnegative=r=>e.check(Dr(0,r)),e.negative=r=>e.check(Bi(0,r)),e.nonpositive=r=>e.check(Br(0,r)),e.multipleOf=(r,s)=>e.check(zi(r,s)),e.step=(r,s)=>e.check(zi(r,s)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Qe(e){return td(ic,e)}const xh=U("ZodNumberFormat",(e,t)=>{rf.init(e,t),ic.init(e,t)});function ji(e){return nd(xh,e)}const oc=U("ZodBoolean",(e,t)=>{sf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Ad(e,n,r)});function $e(e){return rd(oc,e)}const Bh=U("ZodUnknown",(e,t)=>{of.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Td()});function wt(){return id(Bh)}const Dh=U("ZodNever",(e,t)=>{af.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Nd(e,n,r)});function zh(e){return od(Dh,e)}const Rh=U("ZodDate",(e,t)=>{cf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Pd(e,r),e.min=(r,s)=>e.check(Dr(r,s)),e.max=(r,s)=>e.check(Br(r,s));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function ve(e){return ad(Rh,e)}const jh=U("ZodArray",(e,t)=>{uf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Rd(e,n,r,s),e.element=t.element,e.min=(n,r)=>e.check(Lr(n,r)),e.nonempty=n=>e.check(Lr(1,n)),e.max=(n,r)=>e.check(Wa(n,r)),e.length=(n,r)=>e.check(Ya(n,r)),e.unwrap=()=>e.element});function Ve(e,t){return vd(jh,e,t)}const Fh=U("ZodObject",(e,t)=>{ff.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>jd(e,n,r,s),me(e,"shape",()=>t.shape),e.keyof=()=>vt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:wt()}),e.loose=()=>e.clone({...e._zod.def,catchall:wt()}),e.strict=()=>e.clone({...e._zod.def,catchall:zh()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Tu(e,n),e.safeExtend=n=>Pu(e,n),e.merge=n=>Cu(e,n),e.pick=n=>Au(e,n),e.omit=n=>Nu(e,n),e.partial=(...n)=>xu(cc,e,n[0]),e.required=(...n)=>Bu(uc,e,n[0])});function K(e,t){const n={type:"object",shape:e??{},...te(t)};return new Fh(n)}const ac=U("ZodUnion",(e,t)=>{Ka.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Fd(e,n,r,s),e.options=t.options});function Ut(e,t){return new ac({type:"union",options:e,...te(t)})}const Mh=U("ZodDiscriminatedUnion",(e,t)=>{ac.init(e,t),df.init(e,t)});function Nt(e,t,n){return new Mh({type:"union",options:t,discriminator:e,...te(n)})}const Uh=U("ZodIntersection",(e,t)=>{hf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Md(e,n,r,s)});function Lh(e,t){return new Uh({type:"intersection",left:e,right:t})}const qh=U("ZodRecord",(e,t)=>{pf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Ud(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function je(e,t,n){return new qh({type:"record",keyType:e,valueType:t,...te(n)})}const Rs=U("ZodEnum",(e,t)=>{mf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Cd(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Rs({...t,checks:[],...te(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new Rs({...t,checks:[],...te(s),entries:i})}});function vt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Rs({type:"enum",entries:n,...te(t)})}const Zh=U("ZodLiteral",(e,t)=>{gf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>xd(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function pe(e,t){return new Zh({type:"literal",values:Array.isArray(e)?e:[e],...te(t)})}const Vh=U("ZodTransform",(e,t)=>{yf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>zd(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Oa(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Tn(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Tn(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function Kh(e){return new Vh({type:"transform",transform:e})}const cc=U("ZodOptional",(e,t)=>{Ja.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>tc(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Fi(e){return new cc({type:"optional",innerType:e})}const Jh=U("ZodExactOptional",(e,t)=>{wf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>tc(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Hh(e){return new Jh({type:"optional",innerType:e})}const Gh=U("ZodNullable",(e,t)=>{vf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Ld(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Mi(e){return new Gh({type:"nullable",innerType:e})}const Wh=U("ZodDefault",(e,t)=>{_f.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Zd(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Yh(e,t){return new Wh({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Pa(t)}})}const Qh=U("ZodPrefault",(e,t)=>{bf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Vd(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Xh(e,t){return new Qh({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Pa(t)}})}const uc=U("ZodNonOptional",(e,t)=>{$f.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>qd(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function ep(e,t){return new uc({type:"nonoptional",innerType:e,...te(t)})}const tp=U("ZodCatch",(e,t)=>{Sf.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Kd(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function np(e,t){return new tp({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const lc=U("ZodPipe",(e,t)=>{Ef.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Jd(e,n,r,s),e.in=t.in,e.out=t.out});function Ui(e,t){return new lc({type:"pipe",in:e,out:t})}const rp=U("ZodCodec",(e,t)=>{lc.init(e,t),kf.init(e,t)});function sp(e,t,n){return new rp({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const ip=U("ZodReadonly",(e,t)=>{If.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Hd(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function op(e){return new ip({type:"readonly",innerType:e})}const ap=U("ZodTemplateLiteral",(e,t)=>{Of.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Bd(e,n,r)});function zr(e,t){return new ap({type:"template_literal",parts:e,...te(t)})}const Ys=U("ZodCustom",(e,t)=>{Af.init(e,t),ke.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Dd(e,n)});function en(e,t){return _d(Ys,(()=>!0),t)}function cp(e,t={}){return bd(Ys,e,t)}function up(e){return $d(e)}function lp(e,t={}){const n=new Ys({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...te(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function fp(e){return sd(oc,e)}function dp(e,t,n){let r=s=>e(s,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function fc(e,t,n){let r=e.length-t.length;if(r===0)return e(...t);if(r===1)return dp(e,t,n);throw Error("Wrong number of arguments")}const dc={done:!1,hasNext:!1};function Li(e,...t){let n=e,r=t.map(i=>"lazy"in i?hp(i):void 0),s=0;for(;s<t.length;){if(r[s]===void 0||!pp(n)){let c=t[s];n=c(n),s+=1;continue}let i=[];for(let c=s;c<t.length;c++){let l=r[c];if(l===void 0||(i.push(l),l.isSingle))break}let o=[];for(let c of n)if(hc(c,o,i))break;let{isSingle:a}=i.at(-1);n=a?o[0]:o,s+=i.length}return n}function hc(e,t,n){if(n.length===0)return t.push(e),!1;let r=e,s=dc,i=!1;for(let[o,a]of n.entries()){let{index:c,items:l}=a;if(l.push(r),s=a(r,c,l),a.index+=1,s.hasNext){if(s.hasMany??!1){for(let h of s.next)if(hc(h,t,n.slice(o+1)))return!0;return i}r=s.next}if(!s.hasNext)break;s.done&&(i=!0)}return s.hasNext&&t.push(r),i}function hp(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function pp(e){return typeof e=="string"||typeof e=="object"&&!!e&&Symbol.iterator in e}function mp(e,t){let n=t.length-e.length;if(n===1){let[r,...s]=t;return Li(r,{lazy:e,lazyArgs:s})}if(n===0){let r={lazy:e,lazyArgs:t};return Object.assign(s=>Li(s,r),r)}throw Error("Wrong number of arguments")}function gp(...e){return fc(Object.fromEntries,e)}function yp(...e){return fc(wp,e)}function wp(e,t){let n={};for(let[r,s]of Object.entries(e))n[r]=t(s,r,e);return n}function vp(...e){return mp(_p,e)}function _p(){let e=new Set;return t=>e.has(t)?dc:(e.add(t),{done:!1,hasNext:!0,next:t})}const Qs=Symbol.for("yaml.alias"),js=Symbol.for("yaml.document"),St=Symbol.for("yaml.map"),pc=Symbol.for("yaml.pair"),ft=Symbol.for("yaml.scalar"),un=Symbol.for("yaml.seq"),st=Symbol.for("yaml.node.type"),Lt=e=>!!e&&typeof e=="object"&&e[st]===Qs,Xr=e=>!!e&&typeof e=="object"&&e[st]===js,Bn=e=>!!e&&typeof e=="object"&&e[st]===St,De=e=>!!e&&typeof e=="object"&&e[st]===pc,Se=e=>!!e&&typeof e=="object"&&e[st]===ft,Dn=e=>!!e&&typeof e=="object"&&e[st]===un;function xe(e){if(e&&typeof e=="object")switch(e[st]){case St:case un:return!0}return!1}function Be(e){if(e&&typeof e=="object")switch(e[st]){case Qs:case St:case ft:case un:return!0}return!1}const mc=e=>(Se(e)||xe(e))&&!!e.anchor,Dt=Symbol("break visit"),bp=Symbol("skip children"),On=Symbol("remove node");function ln(e,t){const n=$p(t);Xr(e)?Wt(null,e.contents,n,Object.freeze([e]))===On&&(e.contents=null):Wt(null,e,n,Object.freeze([]))}ln.BREAK=Dt;ln.SKIP=bp;ln.REMOVE=On;function Wt(e,t,n,r){const s=Sp(e,t,n,r);if(Be(s)||De(s))return Ep(e,r,s),Wt(e,s,n,r);if(typeof s!="symbol"){if(xe(t)){r=Object.freeze(r.concat(t));for(let i=0;i<t.items.length;++i){const o=Wt(i,t.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===Dt)return Dt;o===On&&(t.items.splice(i,1),i-=1)}}}else if(De(t)){r=Object.freeze(r.concat(t));const i=Wt("key",t.key,n,r);if(i===Dt)return Dt;i===On&&(t.key=null);const o=Wt("value",t.value,n,r);if(o===Dt)return Dt;o===On&&(t.value=null)}}return s}function $p(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Sp(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(Bn(t))return n.Map?.(e,t,r);if(Dn(t))return n.Seq?.(e,t,r);if(De(t))return n.Pair?.(e,t,r);if(Se(t))return n.Scalar?.(e,t,r);if(Lt(t))return n.Alias?.(e,t,r)}function Ep(e,t,n){const r=t[t.length-1];if(xe(r))r.items[e]=n;else if(De(r))e==="key"?r.key=n:r.value=n;else if(Xr(r))r.contents=n;else{const s=Lt(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const kp={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ip=e=>e.replace(/[!,[\]{}]/g,t=>kp[t]);class Ge{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ge.defaultYaml,t),this.tags=Object.assign({},Ge.defaultTags,n)}clone(){const t=new Ge(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Ge(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ge.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ge.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Ge.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ge.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,s]=t.match(/^(.*!)([^!]*)$/s);s||n(`The ${t} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return n(String(o)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+Ip(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(t&&r.length>0&&Be(t.contents)){const i={};ln(t.contents,(o,a)=>{Be(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!t||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
40
+ `)}}Ge.defaultYaml={explicit:!1,version:"1.2"};Ge.defaultTags={"!!":"tag:yaml.org,2002:"};function gc(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function yc(e){const t=new Set;return ln(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function wc(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Op(e,t){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=yc(e));const o=wc(t,s);return s.add(o),o},setAnchors:()=>{for(const i of n){const o=r.get(i);if(typeof o=="object"&&o.anchor&&(Se(o.node)||xe(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}function Yt(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){const o=r[s],a=Yt(e,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const i=r.get(s),o=Yt(e,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(const s of Array.from(r)){const i=Yt(e,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(const[s,i]of Object.entries(r)){const o=Yt(e,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return e.call(t,n,r)}function rt(e,t,n){if(Array.isArray(e))return e.map((r,s)=>rt(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!mc(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!n?.keep?Number(e):e}class Xs{constructor(t){Object.defineProperty(this,st,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!Xr(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=rt(this,"",o);if(typeof s=="function")for(const{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?Yt(i,{"":a},"",a):a}}class ei extends Xs{constructor(t){super(Qs),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],ln(t,{Node:(i,o)=>{(Lt(o)||mc(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,o=this.resolve(s,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(rt(o,null,n),a=r.get(o)),a?.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Rr(s,o,r)),a.count*a.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(gc(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}}function Rr(e,t,n){if(Lt(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(xe(t)){let r=0;for(const s of t.items){const i=Rr(e,s,n);i>r&&(r=i)}return r}else if(De(t)){const r=Rr(e,t.key,n),s=Rr(e,t.value,n);return Math.max(r,s)}return 1}const vc=e=>!e||typeof e!="function"&&typeof e!="object";class ce extends Xs{constructor(t){super(ft),this.value=t}toJSON(t,n){return n?.keep?this.value:rt(this.value,t,n)}toString(){return String(this.value)}}ce.BLOCK_FOLDED="BLOCK_FOLDED";ce.BLOCK_LITERAL="BLOCK_LITERAL";ce.PLAIN="PLAIN";ce.QUOTE_DOUBLE="QUOTE_DOUBLE";ce.QUOTE_SINGLE="QUOTE_SINGLE";const Ap="tag:yaml.org,2002:";function Np(e,t,n){if(t){const r=n.filter(i=>i.tag===t),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return n.find(r=>r.identify?.(e)&&!r.format)}function Pn(e,t,n){if(Xr(e)&&(e=e.contents),Be(e))return e;if(De(e)){const p=n.schema[St].createNode?.(n.schema,null,n);return p.items.push(e),p}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n;let c;if(r&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=s(e)),new ei(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=Ap+t.slice(2));let l=Np(e,t,o.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const p=new ce(e);return c&&(c.node=p),p}l=e instanceof Map?o[St]:Symbol.iterator in Object(e)?o[un]:o[St]}i&&(i(l),delete n.onTagObj);const h=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new ce(e);return t?h.tag=t:l.default||(h.tag=l.tag),c&&(c.node=h),h}function Zr(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return Pn(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const kn=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class _c extends Xs{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>Be(r)||De(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(kn(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(xe(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Zr(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(xe(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,i=this.get(r,!0);return s.length===0?!n&&Se(i)?i.value:i:xe(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!De(n))return!1;const r=n.value;return r==null||t&&Se(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return xe(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(xe(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Zr(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const Tp=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function gt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const zt=(e,t,n)=>e.endsWith(`
41
+ `)?gt(n,t):n.includes(`
42
+ `)?`
43
+ `+gt(n,t):(e.endsWith(" ")?"":" ")+n,bc="flow",Fs="block",jr="quoted";function es(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return e;s<i&&(i=0);const c=Math.max(1+i,1+s-t.length);if(e.length<=c)return e;const l=[],h={};let p=s-t.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):p=s-r);let d,m,_=!1,g=-1,w=-1,$=-1;n===Fs&&(g=qi(e,g,t.length),g!==-1&&(p=g+c));for(let b;b=e[g+=1];){if(n===jr&&b==="\\"){switch(w=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}$=g}if(b===`
44
+ `)n===Fs&&(g=qi(e,g,t.length)),p=g+t.length+c,d=void 0;else{if(b===" "&&m&&m!==" "&&m!==`
45
+ `&&m!==" "){const I=e[g+1];I&&I!==" "&&I!==`
46
+ `&&I!==" "&&(d=g)}if(g>=p)if(d)l.push(d),p=d+c,d=void 0;else if(n===jr){for(;m===" "||m===" ";)m=b,b=e[g+=1],_=!0;const I=g>$+1?g-2:w-1;if(h[I])return e;l.push(I),h[I]=!0,p=I+c,d=void 0}else _=!0}m=b}if(_&&a&&a(),l.length===0)return e;o&&o();let y=e.slice(0,l[0]);for(let b=0;b<l.length;++b){const I=l[b],v=l[b+1]||e.length;I===0?y=`
47
+ ${t}${e.slice(0,v)}`:(n===jr&&h[I]&&(y+=`${e[I]}\\`),y+=`
48
+ ${t}${e.slice(I+1,v)}`)}return y}function qi(e,t,n){let r=t,s=t+1,i=e[s];for(;i===" "||i===" ";)if(t<s+n)i=e[++t];else{do i=e[++t];while(i&&i!==`
49
+ `);r=t,s=t+1,i=e[s]}return r}const ts=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ns=e=>/^(%|---|\.\.\.)/m.test(e);function Pp(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(e[i]===`
50
+ `){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function An(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(ns(e)?" ":"");let o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);const h=n.substr(c+2,4);switch(h){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:h.substr(0,2)==="00"?o+="\\x"+h.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<s)c+=1;else{for(o+=n.slice(a,c)+`
51
+
52
+ `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
53
+ `,c+=2;o+=i,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,r?o:es(o,i,jr,ts(t,!1))}function Ms(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
54
+ `)||/[ \t]\n|\n[ \t]/.test(e))return An(e,t);const n=t.indent||(ns(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
55
+ ${n}`)+"'";return t.implicitKey?r:es(r,n,bc,ts(t,!1))}function Qt(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=An;else{const s=e.includes('"'),i=e.includes("'");s&&!i?r=Ms:i&&!s?r=An:r=n?Ms:An}return r(e,t)}let Us;try{Us=new RegExp(`(^|(?<!
56
+ ))
57
+ +(?!
58
+ |$)`,"g")}catch{Us=/\n+(?!\n|$)/g}function Fr({comment:e,type:t,value:n},r,s,i){const{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return Qt(n,r);const l=r.indent||(r.forceBlockIndent||ns(n)?" ":""),h=o==="literal"?!0:o==="folded"||t===ce.BLOCK_FOLDED?!1:t===ce.BLOCK_LITERAL?!0:!Pp(n,c,l.length);if(!n)return h?`|
59
+ `:`>
60
+ `;let p,d;for(d=n.length;d>0;--d){const v=n[d-1];if(v!==`
61
+ `&&v!==" "&&v!==" ")break}let m=n.substring(d);const _=m.indexOf(`
62
+ `);_===-1?p="-":n===m||_!==m.length-1?(p="+",i&&i()):p="",m&&(n=n.slice(0,-m.length),m[m.length-1]===`
63
+ `&&(m=m.slice(0,-1)),m=m.replace(Us,`$&${l}`));let g=!1,w,$=-1;for(w=0;w<n.length;++w){const v=n[w];if(v===" ")g=!0;else if(v===`
64
+ `)$=w;else break}let y=n.substring(0,$<w?$+1:w);y&&(n=n.substring(y.length),y=y.replace(/\n+/g,`$&${l}`));let I=(g?l?"2":"1":"")+p;if(e&&(I+=" "+a(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!h){const v=n.replace(/\n+/g,`
65
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);let k=!1;const A=ts(r,!0);o!=="folded"&&t!==ce.BLOCK_FOLDED&&(A.onOverflow=()=>{k=!0});const T=es(`${y}${v}${m}`,l,Fs,A);if(!k)return`>${I}
66
+ ${l}${T}`}return n=n.replace(/\n+/g,`$&${l}`),`|${I}
67
+ ${l}${y}${n}${m}`}function Cp(e,t,n,r){const{type:s,value:i}=e,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:h}=t;if(a&&i.includes(`
68
+ `)||h&&/[[\]{},]/.test(i))return Qt(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||h||!i.includes(`
69
+ `)?Qt(i,t):Fr(e,t,n,r);if(!a&&!h&&s!==ce.PLAIN&&i.includes(`
70
+ `))return Fr(e,t,n,r);if(ns(i)){if(c==="")return t.forceBlockIndent=!0,Fr(e,t,n,r);if(a&&c===l)return Qt(i,t)}const p=i.replace(/\n+/g,`$&
71
+ ${c}`);if(o){const d=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(p),{compat:m,tags:_}=t.doc.schema;if(_.some(d)||m?.some(d))return Qt(i,t)}return a?p:es(p,c,bc,ts(t,!1))}function ti(e,t,n,r){const{implicitKey:s,inFlow:i}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==ce.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ce.QUOTE_DOUBLE);const c=h=>{switch(h){case ce.BLOCK_FOLDED:case ce.BLOCK_LITERAL:return s||i?Qt(o.value,t):Fr(o,t,n,r);case ce.QUOTE_DOUBLE:return An(o.value,t);case ce.QUOTE_SINGLE:return Ms(o.value,t);case ce.PLAIN:return Cp(o,t,n,r);default:return null}};let l=c(a);if(l===null){const{defaultKeyType:h,defaultStringType:p}=t.options,d=s&&h||p;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}function $c(e,t){const n=Object.assign({blockQuote:!0,commentString:Tp,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function xp(e,t){if(t.tag){const s=e.filter(i=>i.tag===t.tag);if(s.length>0)return s.find(i=>i.format===t.format)??s[0]}let n,r;if(Se(t)){r=t.value;let s=e.filter(i=>i.identify?.(r));if(s.length>1){const i=s.filter(o=>o.test);i.length>0&&(s=i)}n=s.find(i=>i.format===t.format)??s.find(i=>!i.format)}else r=t,n=e.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){const s=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function Bp(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(Se(e)||xe(e))&&e.anchor;i&&gc(i)&&(n.add(i),s.push(`&${i}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}function on(e,t,n,r){if(De(e))return e.toString(t,n,r);if(Lt(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=Be(e)?e:t.doc.createNode(e,{onTagObj:c=>s=c});s??(s=xp(t.doc.schema.tags,i));const o=Bp(i,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof s.stringify=="function"?s.stringify(i,t,n,r):Se(i)?ti(i,t,n,r):i.toString(t,n,r);return o?Se(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
72
+ ${t.indent}${a}`:a}function Dp({key:e,value:t},n,r,s){const{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:h,simpleKeys:p}}=n;let d=Be(e)&&e.comment||null;if(p){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(xe(e)||!Be(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let m=!p&&(!e||d&&t==null&&!n.inFlow||xe(e)||(Se(e)?e.type===ce.BLOCK_FOLDED||e.type===ce.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(p||!i),indent:a+c});let _=!1,g=!1,w=on(e,n,()=>_=!0,()=>g=!0);if(!m&&!n.inFlow&&w.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(i||t==null)return _&&r&&r(),w===""?"?":m?`? ${w}`:w}else if(i&&!p||t==null&&m)return w=`? ${w}`,d&&!_?w+=zt(w,n.indent,l(d)):g&&s&&s(),w;_&&(d=null),m?(d&&(w+=zt(w,n.indent,l(d))),w=`? ${w}
73
+ ${a}:`):(w=`${w}:`,d&&(w+=zt(w,n.indent,l(d))));let $,y,b;Be(t)?($=!!t.spaceBefore,y=t.commentBefore,b=t.comment):($=!1,y=null,b=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!m&&!d&&Se(t)&&(n.indentAtStart=w.length+1),g=!1,!h&&c.length>=2&&!n.inFlow&&!m&&Dn(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let I=!1;const v=on(t,n,()=>I=!0,()=>g=!0);let k=" ";if(d||$||y){if(k=$?`
74
+ `:"",y){const A=l(y);k+=`
75
+ ${gt(A,n.indent)}`}v===""&&!n.inFlow?k===`
76
+ `&&b&&(k=`
77
+
78
+ `):k+=`
79
+ ${n.indent}`}else if(!m&&xe(t)){const A=v[0],T=v.indexOf(`
80
+ `),L=T!==-1,H=n.inFlow??t.flow??t.items.length===0;if(L||!H){let G=!1;if(L&&(A==="&"||A==="!")){let Y=v.indexOf(" ");A==="&"&&Y!==-1&&Y<T&&v[Y+1]==="!"&&(Y=v.indexOf(" ",Y+1)),(Y===-1||T<Y)&&(G=!0)}G||(k=`
81
+ ${n.indent}`)}}else(v===""||v[0]===`
82
+ `)&&(k="");return w+=k+v,n.inFlow?I&&r&&r():b&&!I?w+=zt(w,n.indent,l(b)):g&&s&&s(),w}function Sc(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const qn="<<",yt={identify:e=>e===qn||typeof e=="symbol"&&e.description===qn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ce(Symbol(qn)),{addToJSMap:Ec}),stringify:()=>qn},zp=(e,t)=>(yt.identify(t)||Se(t)&&(!t.type||t.type===ce.PLAIN)&&yt.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===yt.tag&&n.default);function Ec(e,t,n){if(n=e&&Lt(n)?n.resolve(e.doc):n,Dn(n))for(const r of n.items)hs(e,t,r);else if(Array.isArray(n))for(const r of n)hs(e,t,r);else hs(e,t,n)}function hs(e,t,n){const r=e&&Lt(n)?n.resolve(e.doc):n;if(!Bn(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[i,o]of s)t instanceof Map?t.has(i)||t.set(i,o):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function kc(e,t,{key:n,value:r}){if(Be(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(zp(e,n))Ec(e,t,r);else{const s=rt(n,"",e);if(t instanceof Map)t.set(s,rt(r,s,e));else if(t instanceof Set)t.add(s);else{const i=Rp(n,s,e),o=rt(r,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}function Rp(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Be(e)&&n?.doc){const r=$c(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),Sc(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function ni(e,t,n){const r=Pn(e,void 0,n),s=Pn(t,void 0,n);return new We(r,s)}class We{constructor(t,n=null){Object.defineProperty(this,st,{value:pc}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Be(n)&&(n=n.clone(t)),Be(r)&&(r=r.clone(t)),new We(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return kc(n,r,this)}toString(t,n,r){return t?.doc?Dp(this,t,n,r):JSON.stringify(this)}}function Ic(e,t,n){return(t.inFlow??e.flow?Fp:jp)(e,t,n)}function jp({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:l}}=n,h=Object.assign({},n,{indent:i,type:null});let p=!1;const d=[];for(let _=0;_<t.length;++_){const g=t[_];let w=null;if(Be(g))!p&&g.spaceBefore&&d.push(""),Vr(n,d,g.commentBefore,p),g.comment&&(w=g.comment);else if(De(g)){const y=Be(g.key)?g.key:null;y&&(!p&&y.spaceBefore&&d.push(""),Vr(n,d,y.commentBefore,p))}p=!1;let $=on(g,h,()=>w=null,()=>p=!0);w&&($+=zt($,i,l(w))),p&&w&&(p=!1),d.push(r+$)}let m;if(d.length===0)m=s.start+s.end;else{m=d[0];for(let _=1;_<d.length;++_){const g=d[_];m+=g?`
83
+ ${c}${g}`:`
84
+ `}}return e?(m+=`
85
+ `+gt(l(e),c),a&&a()):p&&o&&o(),m}function Fp({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=t;r+=i;const c=Object.assign({},t,{indent:r,inFlow:!0,type:null});let l=!1,h=0;const p=[];for(let _=0;_<e.length;++_){const g=e[_];let w=null;if(Be(g))g.spaceBefore&&p.push(""),Vr(t,p,g.commentBefore,!1),g.comment&&(w=g.comment);else if(De(g)){const y=Be(g.key)?g.key:null;y&&(y.spaceBefore&&p.push(""),Vr(t,p,y.commentBefore,!1),y.comment&&(l=!0));const b=Be(g.value)?g.value:null;b?(b.comment&&(w=b.comment),b.commentBefore&&(l=!0)):g.value==null&&y?.comment&&(w=y.comment)}w&&(l=!0);let $=on(g,c,()=>w=null);l||(l=p.length>h||$.includes(`
86
+ `)),_<e.length-1?$+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=p.reduce((y,b)=>y+b.length+2,2)+($.length+2)>t.options.lineWidth)),l&&($+=",")),w&&($+=zt($,r,a(w))),p.push($),h=p.length}const{start:d,end:m}=n;if(p.length===0)return d+m;if(!l){const _=p.reduce((g,w)=>g+w.length+2,2);l=t.options.lineWidth>0&&_>t.options.lineWidth}if(l){let _=d;for(const g of p)_+=g?`
87
+ ${i}${s}${g}`:`
88
+ `;return`${_}
89
+ ${s}${m}`}else return`${d}${o}${p.join(" ")}${o}${m}`}function Vr({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=gt(t(r),e);n.push(i.trimStart())}}function Rt(e,t){const n=Se(t)?t.value:t;for(const r of e)if(De(r)&&(r.key===t||r.key===n||Se(r.key)&&r.key.value===n))return r}class nt extends _c{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(St,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,o=new this(t),a=(c,l)=>{if(typeof i=="function")l=i.call(n,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(ni(c,l,r))};if(n instanceof Map)for(const[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(const c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;De(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new We(t,t?.value):r=new We(t.key,t.value);const s=Rt(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Se(s.value)&&vc(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=Rt(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=Rt(this.items,t)?.value;return(!n&&Se(s)?s.value:s)??void 0}has(t){return!!Rt(this.items,t)}set(t,n){this.add(new We(t,n),!0)}toJSON(t,n,r){const s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const i of this.items)kc(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!De(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Ic(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const fn={collection:"map",default:!0,nodeClass:nt,tag:"tag:yaml.org,2002:map",resolve(e,t){return Bn(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>nt.from(e,t,n)};class Ft extends _c{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(un,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Zn(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Zn(t);if(typeof r!="number")return;const s=this.items[r];return!n&&Se(s)?s.value:s}has(t){const n=Zn(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Zn(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];Se(s)&&vc(n)?s.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let s=0;for(const i of this.items)r.push(rt(i,String(s++),n));return r}toString(t,n,r){return t?Ic(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){const c=n instanceof Set?a:String(o++);a=s.call(n,c,a)}i.items.push(Pn(a,void 0,r))}}return i}}function Zn(e){let t=Se(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const dn={collection:"seq",default:!0,nodeClass:Ft,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Dn(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ft.from(e,t,n)},rs={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),ti(e,t,n,r)}},ss={identify:e=>e==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ce(null),stringify:({source:e},t)=>typeof e=="string"&&ss.test.test(e)?e:t.options.nullStr},ri={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new ce(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&ri.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function ut({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=t-(i.length-o-1);for(;a-- >0;)i+="0"}return i}const Oc={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ut},Ac={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ut(e)}},Nc={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new ce(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ut},is=e=>typeof e=="bigint"||Number.isInteger(e),si=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Tc(e,t,n){const{value:r}=e;return is(r)&&r>=0?n+r.toString(t):ut(e)}const Pc={identify:e=>is(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>si(e,2,8,n),stringify:e=>Tc(e,8,"0o")},Cc={identify:is,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>si(e,0,10,n),stringify:ut},xc={identify:e=>is(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>si(e,2,16,n),stringify:e=>Tc(e,16,"0x")},Mp=[fn,dn,rs,ss,ri,Pc,Cc,xc,Oc,Ac,Nc];function Zi(e){return typeof e=="bigint"||Number.isInteger(e)}const Vn=({value:e})=>JSON.stringify(e),Up=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Vn},{identify:e=>e==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Vn},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Vn},{identify:Zi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Zi(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Vn}],Lp={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},qp=[fn,dn].concat(Up,Lp),ii={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,s,i){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=ce.BLOCK_LITERAL),t!==ce.QUOTE_DOUBLE){const c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(a.length/c),h=new Array(l);for(let p=0,d=0;p<l;++p,d+=c)h[p]=a.substr(d,c);a=h.join(t===ce.BLOCK_LITERAL?`
90
+ `:" ")}return ti({comment:e,type:t,value:a},r,s,i)}};function Bc(e,t){if(Dn(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!De(r)){if(Bn(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const s=r.items[0]||new We(new ce(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
91
+ ${s.key.commentBefore}`:r.commentBefore),r.comment){const i=s.value??s.key;i.comment=i.comment?`${r.comment}
92
+ ${i.comment}`:r.comment}r=s}e.items[n]=De(r)?r:new We(r)}}else t("Expected a sequence for this tag");return e}function Dc(e,t,n){const{replacer:r}=n,s=new Ft(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(ni(a,c,n))}return s}const oi={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Bc,createNode:Dc};class tn extends Ft{constructor(){super(),this.add=nt.prototype.add.bind(this),this.delete=nt.prototype.delete.bind(this),this.get=nt.prototype.get.bind(this),this.has=nt.prototype.has.bind(this),this.set=nt.prototype.set.bind(this),this.tag=tn.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const s of this.items){let i,o;if(De(s)?(i=rt(s.key,"",n),o=rt(s.value,i,n)):i=rt(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(t,n,r){const s=Dc(t,n,r),i=new this;return i.items=s.items,i}}tn.tag="tag:yaml.org,2002:omap";const ai={collection:"seq",identify:e=>e instanceof Map,nodeClass:tn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Bc(e,t),r=[];for(const{key:s}of n.items)Se(s)&&(r.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new tn,n)},createNode:(e,t,n)=>tn.from(e,t,n)};function zc({value:e,source:t},n){return t&&(e?Rc:jc).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Rc={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ce(!0),stringify:zc},jc={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ce(!1),stringify:zc},Zp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ut},Vp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ut(e)}},Kp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new ce(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:ut},zn=e=>typeof e=="bigint"||Number.isInteger(e);function os(e,t,n,{intAsBigInt:r}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return s==="-"?BigInt(-1)*o:o}const i=parseInt(e,n);return s==="-"?-1*i:i}function ci(e,t,n){const{value:r}=e;if(zn(r)){const s=r.toString(t);return r<0?"-"+n+s.substr(1):n+s}return ut(e)}const Jp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>os(e,2,2,n),stringify:e=>ci(e,2,"0b")},Hp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>os(e,1,8,n),stringify:e=>ci(e,8,"0")},Gp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>os(e,0,10,n),stringify:ut},Wp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>os(e,2,16,n),stringify:e=>ci(e,16,"0x")};class nn extends nt{constructor(t){super(t),this.tag=nn.tag}add(t){let n;De(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new We(t.key,null):n=new We(t,null),Rt(this.items,n.key)||this.items.push(n)}get(t,n){const r=Rt(this.items,t);return!n&&De(r)?Se(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Rt(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new We(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(ni(o,null,r));return i}}nn.tag="tag:yaml.org,2002:set";const ui={collection:"map",identify:e=>e instanceof Set,nodeClass:nn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>nn.from(e,t,n),resolve(e,t){if(Bn(e)){if(e.hasAllNullValues(!0))return Object.assign(new nn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function li(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,s=o=>t?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*i:i}function Fc(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return ut(e);let r="";t<0&&(r="-",t*=n(-1));const s=n(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Mc={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>li(e,n),stringify:Fc},Uc={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>li(e,!1),stringify:Fc},as={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(as.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let l=Date.UTC(n,r-1,s,i||0,o||0,a||0,c);const h=t[8];if(h&&h!=="Z"){let p=li(h,!1);Math.abs(p)<30&&(p*=60),l-=6e4*p}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Vi=[fn,dn,rs,ss,Rc,jc,Jp,Hp,Gp,Wp,Zp,Vp,Kp,ii,yt,ai,oi,ui,Mc,Uc,as],Ki=new Map([["core",Mp],["failsafe",[fn,dn,rs]],["json",qp],["yaml11",Vi],["yaml-1.1",Vi]]),Ji={binary:ii,bool:ri,float:Nc,floatExp:Ac,floatNaN:Oc,floatTime:Uc,int:Cc,intHex:xc,intOct:Pc,intTime:Mc,map:fn,merge:yt,null:ss,omap:ai,pairs:oi,seq:dn,set:ui,timestamp:as},Yp={"tag:yaml.org,2002:binary":ii,"tag:yaml.org,2002:merge":yt,"tag:yaml.org,2002:omap":ai,"tag:yaml.org,2002:pairs":oi,"tag:yaml.org,2002:set":ui,"tag:yaml.org,2002:timestamp":as};function ps(e,t,n){const r=Ki.get(t);if(r&&!e)return n&&!r.includes(yt)?r.concat(yt):r.slice();let s=r;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(Ki.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return n&&(s=s.concat(yt)),s.reduce((i,o)=>{const a=typeof o=="string"?Ji[o]:o;if(!a){const c=JSON.stringify(o),l=Object.keys(Ji).map(h=>JSON.stringify(h)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}const Qp=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class fi{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?ps(t,"compat"):t?ps(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Yp:{},this.tags=ps(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,St,{value:fn}),Object.defineProperty(this,ft,{value:rs}),Object.defineProperty(this,un,{value:dn}),this.sortMapEntries=typeof o=="function"?o:o===!0?Qp:null}clone(){const t=Object.create(fi.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Xp(e,t){const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const s=$c(e,t),{commentString:i}=s.options;if(e.commentBefore){n.length!==1&&n.unshift("");const c=i(e.commentBefore);n.unshift(gt(c,""))}let o=!1,a=null;if(e.contents){if(Be(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const h=i(e.contents.commentBefore);n.push(gt(h,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const c=a?void 0:()=>o=!0;let l=on(e.contents,s,()=>a=null,c);a&&(l+=zt(l,"",i(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(on(e.contents,s));if(e.directives?.docEnd)if(e.comment){const c=i(e.comment);c.includes(`
93
+ `)?(n.push("..."),n.push(gt(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(gt(i(c),"")))}return n.join(`
94
+ `)+`
95
+ `}class cs{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,st,{value:js});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ge({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,s,r)}clone(){const t=Object.create(cs.prototype,{[st]:{value:js}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Be(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){qt(this.contents)&&this.contents.add(t)}addIn(t,n){qt(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=yc(this);t.anchor=!n||r.has(n)?wc(n||"a",r):n}return new ei(t.anchor)}createNode(t,n,r){let s;if(typeof n=="function")t=n.call({"":t},"",t),s=n;else if(Array.isArray(n)){const w=y=>typeof y=="number"||y instanceof String||y instanceof Number,$=n.filter(w).map(String);$.length>0&&(n=n.concat($)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:h}=r??{},{onAnchor:p,setAnchors:d,sourceObjects:m}=Op(this,o||"a"),_={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:p,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:m},g=Pn(t,h,_);return a&&xe(g)&&(g.flow=!0),d(),g}createPair(t,n,r={}){const s=this.createNode(t,null,r),i=this.createNode(n,null,r);return new We(s,i)}delete(t){return qt(this.contents)?this.contents.delete(t):!1}deleteIn(t){return kn(t)?this.contents==null?!1:(this.contents=null,!0):qt(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return xe(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return kn(t)?!n&&Se(this.contents)?this.contents.value:this.contents:xe(this.contents)?this.contents.getIn(t,n):void 0}has(t){return xe(this.contents)?this.contents.has(t):!1}hasIn(t){return kn(t)?this.contents!==void 0:xe(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Zr(this.schema,[t],n):qt(this.contents)&&this.contents.set(t,n)}setIn(t,n){kn(t)?this.contents=n:this.contents==null?this.contents=Zr(this.schema,Array.from(t),n):qt(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ge({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Ge({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new fi(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=rt(this.contents,n??"",a);if(typeof i=="function")for(const{count:l,res:h}of a.anchors.values())i(h,l);return typeof o=="function"?Yt(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Xp(this,t)}}function qt(e){if(xe(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Lc extends Error{constructor(t,n,r,s){super(),this.name=t,this.code=r,this.message=s,this.pos=n}}class In extends Lc{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class em extends Lc{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const Hi=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const a=Math.min(i-39,o.length-79);o="…"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,i))){let a=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
96
+ `),o=a+o}if(/[^ ]/.test(o)){let a=1;const c=n.linePos[1];c?.line===r&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));const l=" ".repeat(i)+"^".repeat(a);n.message+=`:
97
+
98
+ ${o}
99
+ ${l}
100
+ `}};function an(e,{flow:t,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,h=a,p="",d="",m=!1,_=!1,g=null,w=null,$=null,y=null,b=null,I=null,v=null;for(const T of e)switch(_&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&i(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),g&&(l&&T.type!=="comment"&&T.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),T.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&T.source.includes(" ")&&(g=T),h=!0;break;case"comment":{h||i(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=T.source.substring(1)||" ";p?p+=d+L:p=L,d="",l=!1;break}case"newline":l?p?p+=T.source:(!I||n!=="seq-item-ind")&&(c=!0):d+=T.source,l=!0,m=!0,(w||$)&&(y=T),h=!0;break;case"anchor":w&&i(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&i(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=T,v??(v=T.offset),l=!1,h=!1,_=!0;break;case"tag":{$&&i(T,"MULTIPLE_TAGS","A node can have at most one tag"),$=T,v??(v=T.offset),l=!1,h=!1,_=!0;break}case n:(w||$)&&i(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),I&&i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),I=T,l=n==="seq-item-ind"||n==="explicit-key-ind",h=!1;break;case"comma":if(t){b&&i(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=T,l=!1,h=!1;break}default:i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),l=!1,h=!1}const k=e[e.length-1],A=k?k.offset+k.source.length:s;return _&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:I,spaceBefore:c,comment:p,hasNewline:m,anchor:w,tag:$,newlineAfterProp:y,end:A,start:v??A}}function Cn(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
101
+ `))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Cn(t.key)||Cn(t.value))return!0}return!1;default:return!0}}function Ls(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Cn(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function qc(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,o)=>i===o||Se(i)&&Se(o)&&i.value===o.value;return t.some(i=>s(i.key,n))}const Gi="All mapping items must start at the same column";function tm({composeNode:e,composeEmptyNode:t},n,r,s,i){const o=i?.nodeClass??nt,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(const h of r.items){const{start:p,key:d,sep:m,value:_}=h,g=an(p,{indicator:"explicit-key-ind",next:d??m?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),w=!g.found;if(w){if(d&&(d.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==r.indent&&s(c,"BAD_INDENT",Gi)),!g.anchor&&!g.tag&&!m){l=g.end,g.comment&&(a.comment?a.comment+=`
102
+ `+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||Cn(d))&&s(d??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==r.indent&&s(c,"BAD_INDENT",Gi);n.atKey=!0;const $=g.end,y=d?e(n,d,g,s):t(n,$,p,null,g,s);n.schema.compat&&Ls(r.indent,d,s),n.atKey=!1,qc(n,a.items,y)&&s($,"DUPLICATE_KEY","Map keys must be unique");const b=an(m??[],{indicator:"map-value-ind",next:_,offset:y.range[2],onError:s,parentIndent:r.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=b.end,b.found){w&&(_?.type==="block-map"&&!b.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start<b.found.offset-1024&&s(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const I=_?e(n,_,b,s):t(n,c,m,null,b,s);n.schema.compat&&Ls(r.indent,_,s),c=I.range[2];const v=new We(y,I);n.options.keepSourceTokens&&(v.srcToken=h),a.items.push(v)}else{w&&s(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(y.comment?y.comment+=`
103
+ `+b.comment:y.comment=b.comment);const I=new We(y);n.options.keepSourceTokens&&(I.srcToken=h),a.items.push(I)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}function nm({composeNode:e,composeEmptyNode:t},n,r,s,i){const o=i?.nodeClass??Ft,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(const{start:h,value:p}of r.items){const d=an(h,{indicator:"seq-item-ind",next:p,offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||p)p?.type==="block-seq"?s(d.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}const m=p?e(n,p,d,s):t(n,d.end,h,null,d,s);n.schema.compat&&Ls(r.indent,p,s),c=m.range[2],a.items.push(m)}return a.range=[r.offset,c,l??c],a}function Rn(e,t,n,r){let s="";if(e){let i=!1,o="";for(const a of e){const{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const h=c.substring(1)||" ";s?s+=o+h:s=h,o="";break}case"newline":s&&(o+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:s,offset:t}}const ms="Block collections are not allowed within flow collections",gs=e=>e&&(e.type==="block-map"||e.type==="block-seq");function rm({composeNode:e,composeEmptyNode:t},n,r,s,i){const o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?nt:Ft),l=new c(n.schema);l.flow=!0;const h=n.atRoot;h&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let p=r.offset+r.start.source.length;for(let w=0;w<r.items.length;++w){const $=r.items[w],{start:y,key:b,sep:I,value:v}=$,k=an(y,{flow:a,indicator:"explicit-key-ind",next:b??I?.[0],offset:p,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!k.found){if(!k.anchor&&!k.tag&&!I&&!v){w===0&&k.comma?s(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):w<r.items.length-1&&s(k.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),k.comment&&(l.comment?l.comment+=`
104
+ `+k.comment:l.comment=k.comment),p=k.end;continue}!o&&n.options.strict&&Cn(b)&&s(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(w===0)k.comma&&s(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(k.comma||s(k.start,"MISSING_CHAR",`Missing , between ${a} items`),k.comment){let A="";e:for(const T of y)switch(T.type){case"comma":case"space":break;case"comment":A=T.source.substring(1);break e;default:break e}if(A){let T=l.items[l.items.length-1];De(T)&&(T=T.value??T.key),T.comment?T.comment+=`
105
+ `+A:T.comment=A,k.comment=k.comment.substring(A.length+1)}}if(!o&&!I&&!k.found){const A=v?e(n,v,k,s):t(n,k.end,I,null,k,s);l.items.push(A),p=A.range[2],gs(v)&&s(A.range,"BLOCK_IN_FLOW",ms)}else{n.atKey=!0;const A=k.end,T=b?e(n,b,k,s):t(n,A,y,null,k,s);gs(b)&&s(T.range,"BLOCK_IN_FLOW",ms),n.atKey=!1;const L=an(I??[],{flow:a,indicator:"map-value-ind",next:v,offset:T.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(L.found){if(!o&&!k.found&&n.options.strict){if(I)for(const Y of I){if(Y===L.found)break;if(Y.type==="newline"){s(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}k.start<L.found.offset-1024&&s(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else v&&("source"in v&&v.source?.[0]===":"?s(v,"MISSING_CHAR",`Missing space after : in ${a}`):s(L.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const H=v?e(n,v,L,s):L.found?t(n,L.end,I,null,L,s):null;H?gs(v)&&s(H.range,"BLOCK_IN_FLOW",ms):L.comment&&(T.comment?T.comment+=`
106
+ `+L.comment:T.comment=L.comment);const G=new We(T,H);if(n.options.keepSourceTokens&&(G.srcToken=$),o){const Y=l;qc(n,Y.items,T)&&s(A,"DUPLICATE_KEY","Map keys must be unique"),Y.items.push(G)}else{const Y=new nt(n.schema);Y.flow=!0,Y.items.push(G);const se=(H??T).range;Y.range=[T.range[0],se[1],se[2]],l.items.push(Y)}p=H?H.range[2]:L.end}}const d=o?"}":"]",[m,..._]=r.end;let g=p;if(m?.source===d)g=m.offset+m.source.length;else{const w=a[0].toUpperCase()+a.substring(1),$=h?`${w} must end with a ${d}`:`${w} in block collection must be sufficiently indented and end with a ${d}`;s(p,h?"MISSING_CHAR":"BAD_INDENT",$),m&&m.source.length!==1&&_.unshift(m)}if(_.length>0){const w=Rn(_,g,n.options.strict,s);w.comment&&(l.comment?l.comment+=`
107
+ `+w.comment:l.comment=w.comment),l.range=[r.offset,g,w.offset]}else l.range=[r.offset,g,g];return l}function ys(e,t,n,r,s,i){const o=n.type==="block-map"?tm(e,t,n,r,i):n.type==="block-seq"?nm(e,t,n,r,i):rm(e,t,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function sm(e,t,n,r,s){const i=r.tag,o=i?t.directives.tagName(i.source,d=>s(i,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){const{anchor:d,newlineAfterProp:m}=r,_=d&&i?d.offset>i.offset?d:i:d??i;_&&(!m||m.offset<_.offset)&&s(_,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===nt.tagName&&a==="map"||o===Ft.tagName&&a==="seq")return ys(e,t,n,s,o);let c=t.schema.tags.find(d=>d.tag===o&&d.collection===a);if(!c){const d=t.schema.knownTags[o];if(d?.collection===a)t.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?s(i,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),ys(e,t,n,s,o)}const l=ys(e,t,n,s,o,c),h=c.resolve?.(l,d=>s(i,"TAG_RESOLVE_FAILED",d),t.options)??l,p=Be(h)?h:new ce(h);return p.range=l.range,p.tag=o,c?.format&&(p.format=c.format),p}function im(e,t,n){const r=t.offset,s=om(t,e.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?ce.BLOCK_FOLDED:ce.BLOCK_LITERAL,o=t.source?am(t.source):[];let a=o.length;for(let g=o.length-1;g>=0;--g){const w=o[g][1];if(w===""||w==="\r")a=g;else break}if(a===0){const g=s.chomp==="+"&&o.length>0?`
108
+ `.repeat(Math.max(1,o.length-1)):"";let w=r+s.length;return t.source&&(w+=t.source.length),{value:g,type:i,comment:s.comment,range:[r,w,w]}}let c=t.indent+s.indent,l=t.offset+s.length,h=0;for(let g=0;g<a;++g){const[w,$]=o[g];if($===""||$==="\r")s.indent===0&&w.length>c&&(c=w.length);else{w.length<c&&n(l+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=w.length),h=g,c===0&&!e.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=w.length+$.length+1}for(let g=o.length-1;g>=a;--g)o[g][0].length>c&&(a=g+1);let p="",d="",m=!1;for(let g=0;g<h;++g)p+=o[g][0].slice(c)+`
109
+ `;for(let g=h;g<a;++g){let[w,$]=o[g];l+=w.length+$.length+1;const y=$[$.length-1]==="\r";if(y&&($=$.slice(0,-1)),$&&w.length<c){const I=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(l-$.length-(y?2:1),"BAD_INDENT",I),w=""}i===ce.BLOCK_LITERAL?(p+=d+w.slice(c)+$,d=`
110
+ `):w.length>c||$[0]===" "?(d===" "?d=`
111
+ `:!m&&d===`
112
+ `&&(d=`
113
+
114
+ `),p+=d+w.slice(c)+$,d=`
115
+ `,m=!0):$===""?d===`
116
+ `?p+=`
117
+ `:d=`
118
+ `:(p+=d+$,d=" ",m=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)p+=`
119
+ `+o[g][0].slice(c);p[p.length-1]!==`
120
+ `&&(p+=`
121
+ `);break;default:p+=`
122
+ `}const _=r+s.length+t.source.length;return{value:p,type:i,comment:s.comment,range:[r,_,_]}}function om({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],i=s[0];let o=0,a="",c=-1;for(let d=1;d<s.length;++d){const m=s[d];if(!a&&(m==="-"||m==="+"))a=m;else{const _=Number(m);!o&&_?o=_:c===-1&&(c=e+d)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,h="",p=s.length;for(let d=1;d<t.length;++d){const m=t[d];switch(m.type){case"space":l=!0;case"newline":p+=m.source.length;break;case"comment":n&&!l&&r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=m.source.length,h=m.source.substring(1);break;case"error":r(m,"UNEXPECTED_TOKEN",m.message),p+=m.source.length;break;default:{const _=`Unexpected token in block scalar header: ${m.type}`;r(m,"UNEXPECTED_TOKEN",_);const g=m.source;g&&typeof g=="string"&&(p+=g.length)}}}return{mode:i,indent:o,chomp:a,comment:h,length:p}}function am(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)i.push([t[o],t[o+1]]);return i}function cm(e,t,n){const{offset:r,type:s,source:i,end:o}=e;let a,c;const l=(d,m,_)=>n(r+d,m,_);switch(s){case"scalar":a=ce.PLAIN,c=um(i,l);break;case"single-quoted-scalar":a=ce.QUOTE_SINGLE,c=lm(i,l);break;case"double-quoted-scalar":a=ce.QUOTE_DOUBLE,c=fm(i,l);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const h=r+i.length,p=Rn(o,h,t,n);return{value:c,type:a,comment:p.comment,range:[r,h,p.offset]}}function um(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Zc(e)}function lm(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Zc(e.slice(1,-1)).replace(/''/g,"'")}function Zc(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
123
+ `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
124
+ `,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let s=r[1],i=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===""?i===`
125
+ `?s+=i:i=`
126
+ `:(s+=i+r[1],i=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(e),s+i+(r?.[1]??"")}function fm(e,t){let n="";for(let r=1;r<e.length-1;++r){const s=e[r];if(!(s==="\r"&&e[r+1]===`
127
+ `))if(s===`
128
+ `){const{fold:i,offset:o}=dm(e,r);n+=i,r=o}else if(s==="\\"){let i=e[++r];const o=hm[i];if(o)n+=o;else if(i===`
129
+ `)for(i=e[r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="\r"&&e[r+1]===`
130
+ `)for(i=e[++r+1];i===" "||i===" ";)i=e[++r+1];else if(i==="x"||i==="u"||i==="U"){const a={x:2,u:4,U:8}[i];n+=pm(e,r+1,a,t),r+=a}else{const a=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(s===" "||s===" "){const i=r;let o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
131
+ `&&!(o==="\r"&&e[r+2]===`
132
+ `)&&(n+=r>i?e.slice(i,r+1):s)}else n+=s}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function dm(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
133
+ `||r==="\r")&&!(r==="\r"&&e[t+2]!==`
134
+ `);)r===`
135
+ `&&(n+=`
136
+ `),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const hm={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
137
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function pm(e,t,n,r){const s=e.substr(t,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(o)){const a=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function Vc(e,t,n,r){const{value:s,type:i,comment:o,range:a}=t.type==="block-scalar"?im(e,t,r):cm(t,e.options.strict,r),c=n?e.directives.tagName(n.source,p=>r(n,"TAG_RESOLVE_FAILED",p)):null;let l;e.options.stringKeys&&e.atKey?l=e.schema[ft]:c?l=mm(e.schema,s,c,n,r):t.type==="scalar"?l=gm(e,s,t,r):l=e.schema[ft];let h;try{const p=l.resolve(s,d=>r(n??t,"TAG_RESOLVE_FAILED",d),e.options);h=Se(p)?p:new ce(p)}catch(p){const d=p instanceof Error?p.message:String(p);r(n??t,"TAG_RESOLVE_FAILED",d),h=new ce(s)}return h.range=a,h.source=s,i&&(h.type=i),c&&(h.tag=c),l.format&&(h.format=l.format),o&&(h.comment=o),h}function mm(e,t,n,r,s){if(n==="!")return e[ft];const i=[];for(const a of e.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(const a of i)if(a.test?.test(t))return a;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[ft])}function gm({atKey:e,directives:t,schema:n},r,s,i){const o=n.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(r))||n[ft];if(n.compat){const a=n.compat.find(c=>c.default&&c.test?.test(r))??n[ft];if(o.tag!==a.tag){const c=t.tagString(o.tag),l=t.tagString(a.tag),h=`Value may be parsed as either ${c} or ${l}`;i(s,"TAG_RESOLVE_FAILED",h,!0)}}return o}function ym(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let s=t[r];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++r];s?.type==="space";)e+=s.source.length,s=t[++r];break}}return e}const wm={composeNode:Kc,composeEmptyNode:di};function Kc(e,t,n,r){const s=e.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=n;let l,h=!0;switch(t.type){case"alias":l=vm(e,t,r),(a||c)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Vc(e,t,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=sm(wm,e,t,n,r),a&&(l.anchor=a.source.substring(1))}catch(p){const d=p instanceof Error?p.message:String(p);r(t,"RESOURCE_EXHAUSTION",d)}break;default:{const p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",p),h=!1}}return l??(l=di(e,t.offset,void 0,null,n,r)),a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!Se(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&h&&(l.srcToken=t),l}function di(e,t,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){const h={type:"scalar",offset:ym(t,n,r),indent:-1,source:""},p=Vc(e,h,a,l);return o&&(p.anchor=o.source.substring(1),p.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(p.spaceBefore=!0),i&&(p.comment=i,p.range[2]=c),p}function vm({options:e},{offset:t,source:n,end:r},s){const i=new ei(n.substring(1));i.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,a=Rn(r,o,e.strict,s);return i.range=[t,o,a.offset],a.comment&&(i.comment=a.comment),i}function _m(e,t,{offset:n,start:r,value:s,end:i},o){const a=Object.assign({_directives:t},e),c=new cs(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},h=an(r,{indicator:"doc-start",next:s??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});h.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!h.hasNewline&&o(h.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?Kc(l,s,h,o):di(l,h.end,r,null,h,o);const p=c.contents.range[2],d=Rn(i,p,!1,o);return d.comment&&(c.comment=d.comment),c.range=[n,p,d.offset],c}function gn(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Wi(e){let t="",n=!1,r=!1;for(let s=0;s<e.length;++s){const i=e[s];switch(i[0]){case"#":t+=(t===""?"":r?`
138
+
139
+ `:`
140
+ `)+(i.substring(1)||" "),n=!0,r=!1;break;case"%":e[s+1]?.[0]!=="#"&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class bm{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const o=gn(n);i?this.warnings.push(new em(o,r,s)):this.errors.push(new In(o,r,s))},this.directives=new Ge({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:s}=Wi(this.prelude);if(r){const i=t.contents;if(n)t.comment=t.comment?`${t.comment}
141
+ ${r}`:r;else if(s||t.directives.docStart||!i)t.commentBefore=r;else if(xe(i)&&!i.flow&&i.items.length>0){let o=i.items[0];De(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${r}
142
+ ${a}`:r}else{const o=i.commentBefore;i.commentBefore=o?`${r}
143
+ ${o}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Wi(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const s of t)yield*this.next(s);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,s)=>{const i=gn(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=_m(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new In(gn(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new In(gn(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Rn(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
144
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new In(gn(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),s=new cs(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const Jc="\uFEFF",Hc="",Gc="",qs="";function $m(e){switch(e){case Jc:return"byte-order-mark";case Hc:return"doc-mode";case Gc:return"flow-error-end";case qs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
145
+ `:case`\r
146
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ot(e){switch(e){case void 0:case" ":case`
147
+ `:case"\r":case" ":return!0;default:return!1}}const Yi=new Set("0123456789ABCDEFabcdef"),Sm=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Kn=new Set(",[]{}"),Em=new Set(` ,[]{}
148
+ \r `),ws=e=>!e||Em.has(e);class km{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
149
+ `?!0:n==="\r"?this.buffer[t+1]===`
150
+ `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const s=this.buffer[r+t+1];if(s===`
151
+ `||!s&&!this.atEnd)return t+r+1}return n===`
152
+ `||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ot(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
153
+ `,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===Jc&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const i=t[r-1];if(i===" "||i===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const i=t[n-1];if(i===" "||i===" ")n-=1;else break}const s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield Hc,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&ot(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ot(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ot(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ws),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&ot(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield Gc,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ws),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||ot(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let s=r.indexOf(`
154
+ `,this.pos);if(s!==-1){for(;s!==-1;){const i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
155
+ `,i)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ot(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case`
156
+ `:t=i,n=0;break;case"\r":{const o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
157
+ `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(`
158
+ `,i)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let s=t+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
159
+ `;)r=this.buffer[++s];t=s-1}else if(!this.blockScalarKeep)do{let i=t-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);const a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
160
+ `&&i>=this.pos&&i+1+n>a)t=i;else break}while(!0);return yield qs,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(ot(i)||t&&Kn.has(i))break;n=r}else if(ot(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
161
+ `?(r+=1,s=`
162
+ `,i=this.buffer[r+1]):n=r),i==="#"||t&&Kn.has(i))break;if(s===`
163
+ `){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&Kn.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield qs,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(ws))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ot(n)||t&&Kn.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ot(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(Sm.has(n))n=this.buffer[++t];else if(n==="%"&&Yi.has(this.buffer[t+1])&&Yi.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
164
+ `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
165
+ `?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class Im{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const i=n+r>>1;this.lineStarts[i]<t?n=i+1:r=i}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const s=this.lineStarts[n-1];return{line:n,col:t-s+1}}}}function $t(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Qi(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function Wc(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Jn(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Zt(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function Xi(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!$t(t.start,"explicit-key-ind")&&!$t(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,Wc(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class Om{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new km,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=$m(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Xi(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Qi(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Qi(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=Jn(this.peek(2)),r=Zt(n);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
166
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
167
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let i=[];if(s&&n.sep&&!n.value){const o=[];for(let a=0;a<n.sep.length;++a){const c=n.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(i.push(this.sourceToken),t.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if($t(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Wc(n.key)&&!$t(n.sep,"newline")){const o=Zt(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if($t(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Zt(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:i,key:null,sep:[this.sourceToken]}):$t(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);s||n.value?(t.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!$t(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const s=t.items[t.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||$t(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Jn(r),i=Zt(s);Xi(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
168
+ `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
169
+ `,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Jn(t),r=Zt(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Jn(t),r=Zt(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Am(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Im||null,prettyErrors:t}}function Nm(e,t={}){const{lineCounter:n,prettyErrors:r}=Am(t),s=new Om(n?.addNewLine),i=new bm(t);let o=null;for(const a of i.compose(s.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new In(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Hi(e,n)),o.warnings.forEach(Hi(e,n))),o}function Tm(e,t,n){let r;const s=Nm(e,n);if(!s)return null;if(s.warnings.forEach(i=>Sc(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}var Ke=K({title:z().optional(),globalTitle:z().optional(),description:z().optional(),color:z().optional(),icon:z().optional(),iconColor:z().optional(),avatarUrl:z().optional(),secondaryIcon:z().optional(),secondaryIconColor:z().optional()}),Fe=Ke.pick({title:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),Yc=Ke.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),hn=Ke.pick({title:!0,description:!0,avatarUrl:!0,icon:!0,iconColor:!0}).required({title:!0}),Pm=K({createdAt:ve(),updatedAt:ve()}),ct=z().regex(/^[a-z][a-z0-9-.]+$/,"Name must start with a letter and can only contain lowercase letters, numbers, dashes (-) and dots (.)").min(2).max(64),pn=Ut([zr([ct,pe("."),pe("v"),Qe().int().min(1)]),zr([ct,pe("."),ct,pe("."),pe("v"),Qe().int().min(1)]),zr([ct,pe("."),ct,pe("."),ct,pe("."),pe("v"),Qe().int().min(1)])]),Mr=z().regex(/^[a-z][a-zA-Z0-9]+$/,"Field name must start with a letter and be in camelCase format").min(2).max(64),eo=K({type:pn,required:$e(),multiple:$e(),field:z()});K({type:pn,extensions:z().array().optional(),directExtensions:z().array().optional(),inclusions:eo.array().optional(),directInclusions:eo.array().optional(),schema:en(),meta:Ke.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0}),definitionHash:Qe()});var Cm=K({type:pn,identity:z(),references:je(z(),z().array()).optional(),...Ke.pick({title:!0,description:!0,icon:!0,iconColor:!0}).shape});K({$meta:Cm});var Qc=vt(["composite","unit"]),xm=Symbol("runtimeSchema");function yn(e){return e.path?`${e.instanceId}:${e.output}:${e.path}`:`${e.instanceId}:${e.output}`}var Xc=K({x:Qe(),y:Qe()}),Et=zr([pn,":",ct]),rn=K({instanceId:Et,output:z(),path:z().optional()}),Zs=K({hubId:z()}),Bm=K({args:je(z(),wt()).optional(),inputs:je(z(),Ve(rn)).optional(),hubInputs:je(z(),Ve(Zs)).optional(),injectionInputs:Ve(Zs).optional(),position:Xc.optional()}),vs=K({id:Et,kind:Qc,type:pn,name:ct,...Bm.shape,resolvedInputs:je(z(),Ve(rn)).optional(),parentId:Et.optional(),outputs:je(z(),Ve(rn)).optional(),resolvedOutputs:je(z(),Ve(rn)).optional()}),Dm=K({position:Xc.optional(),inputs:Ve(rn).optional(),injectionInputs:Ve(Zs).optional()}),zm=K({id:ye(),...Dm.shape}),Rm;(e=>{e.Artifact="d55c63ac-3174-4756-808f-f778e99af0d1",e.Yaml="c857cac5-caa6-4421-b82c-e561fbce6367",e.Secret="240e5789-6ae4-4b22-b9d8-87169e8b4bab"})(Rm||={});var jm=K({"c857cac5-caa6-4421-b82c-e561fbce6367":pe(!0),value:z()}),Fm=K({name:z(),contentType:z().optional(),size:Qe().optional(),mode:Qe().optional()}),Mm;(e=>{e.Healthy="healthy",e.Degraded="degraded",e.Down="down",e.Warning="warning",e.Progressing="progressing",e.Error="error"})(Mm||={});var Um=Ut([z(),Qe(),$e(),z().array()]);K({name:z(),meta:Ke.pick({title:!0,icon:!0,iconColor:!0}).required({title:!0}),complementaryTo:z().optional(),value:Um.optional()});function Lm(e){const t=K({"240e5789-6ae4-4b22-b9d8-87169e8b4bab":pe(!0),value:e});return sp(Ut([t,e]),t,{decode:n=>typeof n=="object"&&n!==null&&"240e5789-6ae4-4b22-b9d8-87169e8b4bab"in n?n:{"240e5789-6ae4-4b22-b9d8-87169e8b4bab":!0,value:n},encode:n=>n})}var eu=K({schema:en(),[xm]:lp(ke).optional(),required:$e(),meta:Ke.required({title:!0}).pick({title:!0,globalTitle:!0,description:!0,color:!0,icon:!0,iconColor:!0})}),to=K({type:pn,fromInput:Mr.optional(),required:$e(),multiple:$e(),meta:Ke.required({title:!0}).pick({title:!0,description:!0})}),qm=K({type:ct,kind:Qc,args:je(Mr,eu),inputs:je(Mr,to),outputs:je(Mr,to),meta:Ke.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0,secondaryIcon:!0,secondaryIconColor:!0}).extend({category:z().optional(),defaultNamePrefix:z()}),definitionHash:Qe()}),Zm=eu.extend({readonly:$e(),computed:$e()}),Vm=K({package:z(),path:z().optional()});K({...qm.shape,source:Vm,secrets:je(z(),Zm)});function hi(e){return"source"in e}var Km=Ut([K({type:pe("before-destroy")})]);K({name:z(),meta:Ke.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:Km});var Jm=K({name:z()}),Hm=K({...rn.shape}),Gm=K({value:wt(),source:Hm.optional()});K({instanceId:z(),stateId:z(),args:je(z(),wt()),inputs:je(z(),Gm.array()),invokedTriggers:Jm.array(),secretValues:je(z(),wt()),importBasePath:z()});var no=new WeakMap;function Wm(e){const t=jm.safeParse(e);if(!t.success)return e;const n=no.get(e);if(n!==void 0)return n;const r=Tm(t.data.value);return no.set(e,r),r}var Ym;(e=>{e.Config="highstate"})(Ym||={});var Qm=Symbol("unitArtifactId"),Xm=K({"d55c63ac-3174-4756-808f-f778e99af0d1":pe(!0),[Qm]:z().optional(),hash:z(),meta:Fe.optional()}),eg=Ut([K({type:pe("embedded"),isBinary:$e().optional(),value:z()}),K({type:pe("embedded-secret"),isBinary:$e().optional(),value:Lm(z())}),K({type:pe("artifact"),...Xm.shape})]),tu=K({meta:Fm,content:eg}),nu=K({image:z(),command:z().array(),cwd:z().optional(),env:je(z(),z()).optional(),files:je(z(),tu).optional()});K({name:z(),meta:Ke.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:nu});var ru=Ut([K({type:pe("markdown"),content:z()}),K({type:pe("qr"),content:z(),showContent:fp(),language:z().optional()}),K({type:pe("file"),file:tu})]);K({name:z(),meta:Ke.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),content:ru.array()});K({name:z(),image:z(),params:je(z(),wt())});K({projectId:ye(),workerVersionId:ye(),apiUrl:wh(),apiKey:z()});Nt("type",[K({type:pe("host")})]);const tg={id:"q8xbilhwpsn65zjlv5kz44qh"},ng={id:"n0rfvpl9o77iqf29ff4kk5gf"},rg={id:"pmn9y901jeiz2ydh93045l39"},sg={id:"qppfcerovu3h22o0x8rlpc3g"};Nt("type",[K({type:pe("codebase")}),K({type:pe("database")})]);K({name:ct,spaceId:ye().default(tg.id),modelStorageId:ye().default(sg.id),libraryId:ye().default(ng.id),pulumiBackendId:ye().default(rg.id),meta:Fe});K({id:z(),name:ct,meta:Fe,spaceId:ye(),modelStorageId:ye(),libraryId:ye(),pulumiBackendId:ye(),...Pm.shape});const ig=K({encryptedIdentities:Ve(z()),hasPasskey:$e()});Nt("type",[K({type:pe("locked"),unlockSuite:ig.optional()}),K({type:pe("unlocked")})]);Nt("type",[K({type:pe("host")})]);const og=Ke.pick({title:!0,description:!0}).required({title:!0});K({meta:og,recipient:z()});const ag=K({key:z(),order:vt(["asc","desc"])}),_t=K({search:z().optional(),sortBy:Ve(ag).optional(),skip:Qe().int().nonnegative().default(0).optional(),count:Qe().int().positive().max(100).default(20).optional()}),cg=Ke.pick({title:!0,description:!0}).required({title:!0});K({id:ye(),meta:Fe,serviceAccountId:ye(),serviceAccountMeta:hn.nullable(),createdAt:ve()});_t.extend({serviceAccountId:z().optional()});K({id:ye(),hash:z(),size:Qe(),meta:Fe,createdAt:ve(),updatedAt:ve()});_t.extend({stateId:z().optional(),serviceAccountId:z().optional(),terminalId:z().optional(),pageId:z().optional()});K({name:z(),meta:Fe,value:z(),message:z().optional(),order:Qe().min(0).max(100).optional()});K({identity:z().optional(),title:z().optional(),description:z().optional(),icon:z().optional(),iconColor:z().optional()}).passthrough();const ug=K({id:z(),type:z(),identity:z(),meta:Fe,snapshotId:z().optional(),createdAt:ve().optional()});_t.extend({type:z().optional()});const su=K({id:z(),meta:Fe,content:wt(),operationId:z(),stateId:z(),referencedInOutputs:z().array(),exportedInOutputs:z().array(),createdAt:ve()});K({id:z(),meta:Fe,operationId:z(),stateId:z(),createdAt:ve()});K({entity:K({id:z(),type:z(),identity:z()}),snapshot:su});K({...ug.shape,lastSnapshot:su.nullable()});K({id:z(),meta:Fe,group:z(),fromSnapshotId:z(),fromEntityId:z(),fromEntityType:z(),fromEntityIdentity:z(),fromEntityMeta:Fe,toSnapshotId:z(),toEntityId:z(),toEntityType:z(),toEntityIdentity:z(),toEntityMeta:Fe});const lg=K({stateId:ye(),meta:Fe,acquiredAt:ve()});Nt("type",[K({type:pe("locked"),locks:lg.array()}),K({type:pe("unlocked"),stateIds:Ve(z())})]);K({updatedInstances:vs.array().optional(),updatedHubs:zm.array().optional(),updatedVirtualInstances:vs.array().optional(),updatedGhostInstances:vs.array().optional(),deletedInstanceIds:Et.array().optional(),deletedHubIds:z().array().optional(),deletedVirtualInstanceIds:Et.array().optional(),deletedGhostInstanceIds:Et.array().optional()});const fg=vt(["destroy","preview","update","refresh"]),dg=K({id:Et,parentId:z().optional(),message:z()}),hg=K({type:fg,instances:Ve(dg)}),pg=K({forceUpdateDependencies:$e().default(!1),ignoreChangedDependencies:$e().default(!1),ignoreDependencies:$e().default(!1),forceUpdateChildren:$e().default(!1),onlyDestroyGhosts:$e().default(!1),firstDestroyGhosts:$e().default(!1),ignoreGhosts:$e().default(!1),destroyDependentInstances:$e().default(!0),invokeDestroyTriggers:$e().default(!0),deleteUnreachableResources:$e().default(!1),forceDeleteState:$e().default(!1),allowPartialCompositeInstanceUpdate:$e().default(!1),allowPartialCompositeInstanceDestruction:$e().default(!1),refresh:$e().default(!1),debug:$e().default(!1)}).partial(),iu=vt(["update","preview","destroy","recreate","refresh"]),mg=vt(["pending","running","failing","completed","failed","cancelled","cancelling"]),ou=Ke.pick({title:!0,description:!0}).required({title:!0}),gg=K({projectId:z(),type:iu,instanceIds:Ve(Et).min(1),options:pg.partial().optional()});gg.extend({meta:ou,plan:hg.array().optional()});Nt("type",[K({type:pe("updated"),operation:en()}),K({type:pe("deleted"),operationId:z()})]);K({id:ye(),type:iu,status:mg,meta:ou,startedAt:ve(),updatedAt:ve(),finishedAt:ve().nullable()});const yg=K({id:ye(),meta:Fe,name:z().nullable(),stateId:ye().nullable(),serviceAccountId:ye().nullable(),serviceAccountMeta:hn.nullable(),createdAt:ve(),updatedAt:ve()});_t.extend({serviceAccountId:z().optional(),stateId:z().optional(),artifactId:z().optional()});K({...yg.shape,content:Ve(ru)});K({id:ye(),meta:Yc,name:z().nullable(),systemName:z().nullable(),stateId:ye().nullable(),serviceAccountId:ye().nullable(),serviceAccountMeta:hn.nullable(),createdAt:ve(),updatedAt:ve()});_t.extend({serviceAccountId:z().optional(),stateId:z().optional()});K({id:ye(),meta:hn,createdAt:ve(),updatedAt:ve()});_t.extend({artifactId:z().optional()});K({stateId:z(),output:z(),path:z().optional()});Nt("type",[K({type:pe("updated"),state:en()}),K({type:pe("patched"),stateId:z(),patch:en()}),K({type:pe("patched-batch"),patches:Ve(K({stateId:z(),patch:en()}))}),K({type:pe("deleted"),stateId:z()})]);Nt("type",[K({type:pe("registered"),instanceId:z(),params:je(z(),wt())}),K({type:pe("deregistered"),instanceId:z()})]);const wg=vt(["active","unavailable"]);K({id:ye(),terminalId:ye(),meta:Yc,startedAt:ve(),finishedAt:ve().nullable()});const vg=K({id:ye(),name:z().nullable(),meta:Fe,status:wg,stateId:z().nullable(),serviceAccountId:z().nullable(),serviceAccountMeta:hn.nullable(),createdAt:ve(),updatedAt:ve()});_t.extend({serviceAccountId:z().optional(),stateId:z().optional(),artifactId:z().optional()});K({...vg.shape,spec:nu});K({id:ye(),meta:Fe,name:z(),stateId:ye(),createdAt:ve(),updatedAt:ve()});_t.extend({stateId:z().optional()});const au=vt(["password","passkey"]),cu=Ke.pick({title:!0,description:!0}).required({title:!0});K({meta:cu,type:au,encryptedIdentity:z(),recipient:z()});K({id:ye(),type:au,meta:cu,recipient:z(),createdAt:ve(),updatedAt:ve()});const uu=vt(["unknown","starting","running","stopping","stopped","error"]);K({workerVersionId:ye(),status:uu});K({id:ye(),digest:z(),meta:Fe,status:uu,enabled:$e(),apiKeyId:z(),apiKeyMeta:cg,createdAt:ve(),updatedAt:ve()});K({id:ye(),identity:z(),meta:Fe,serviceAccountId:z(),serviceAccountMeta:hn,createdAt:ve()});_t.extend({serviceAccountId:z().optional()});function lu(e){const t=e.visited??new Set,n=e.getInstanceContext(e.input.instanceId);if(!n)return _s({rootType:e.fallbackType,path:e.input.path,entities:void 0,fallbackType:e.fallbackType});const r=n.component.outputs[e.input.output];if(!r)return _s({rootType:e.fallbackType,path:e.input.path,entities:n.entities,fallbackType:e.fallbackType});let s=r.type;if(r.fromInput){const i=`${n.instance.id}:${e.input.output}`;if(!t.has(i)){t.add(i);const o=r.fromInput,a=n.component.inputs[o]?.type??s,c=(n.instance.hubInputs?.[o]?.length??0)>0,l=(n.instance.injectionInputs?.length??0)>0,h=n.instance.inputs?.[o]??[];if(!c&&!l&&h.length===1){const p=h[0];p?s=lu({input:p,fallbackType:a,getInstanceContext:e.getInstanceContext,visited:t}):s=a}else s=a}}return _s({rootType:s,path:e.input.path,entities:n.entities,fallbackType:e.fallbackType})}function _s(e){const{rootType:t,path:n,entities:r,fallbackType:s}=e;if(!n||!r)return _g(t,s,r);let i=t;const o=n.split(".");for(const a of o){const c=r[i];if(!c)return t;const l=c.inclusions?.find(h=>h.field===a);if(!l)return t;i=l.type}return i}function _g(e,t,n){if(!n||e===t)return e;const r=n[e];return!r||r.extensions?.includes(t)?e:r.inclusions?.find(i=>i.type===t)?t:e}class pi{constructor(t,n,r,s){this.nodes=t,this.logger=n,this.outputHandler=r,this.dependentSetHandler=s}nodes;logger;outputHandler;dependentSetHandler;workset=new Set;dependencyMap=new Map;dependentMap=new Map;outputMap=new Map;addToWorkset(t){this.workset.add(t)}addAllNodesToWorkset(){for(const t of this.nodes.keys())this.workset.add(t)}get outputs(){return this.outputMap}get dependents(){return this.dependentMap}requireOutput(t){const n=this.outputMap.get(t);if(!n)throw new Error(`Output for node ${t} is not available`);return n}getDependents(t){const n=this.dependentMap.get(t);return n?Array.from(n):[]}invalidate(t){const n=[t];for(;n.length>0;){const r=n.pop();if(!this.nodes.has(r))continue;this.outputMap.delete(r),this.workset.add(r);const s=this.dependentMap.get(r);if(s)for(const i of s)this.outputMap.has(i)&&n.push(i)}}invalidateSingle(t){this.nodes.has(t)&&(this.outputMap.delete(t),this.workset.add(t))}async process(t){for(;this.workset.size>0;){const n=this.workset.values().next().value,r=[{nodeId:n,resolved:!1,dependencies:[]}];for(;r.length>0;){const s=r[r.length-1],{nodeId:i,resolved:o}=s,a=this.nodes.get(i);if(!a){this.logger.warn({nodeId:i},"node not found in the graph, skipping"),r.pop();continue}if(this.outputMap.has(i)){r.pop();continue}if(!o){s.dependencies=vp(this.getNodeDependencies(a));let p=!1;for(const d of s.dependencies){if(!this.nodes.has(d)){this.logger.warn({depId:d,nodeId:i},"dependency not found in the graph, skipping");continue}this.outputMap.has(d)||(r.push({nodeId:d,resolved:!1,dependencies:[]}),p=!0)}if(p){s.resolved=!0;continue}}const c=await this.processNode(a,this.logger);if(t?.aborted){this.logger.warn({nodeId:i},"processing aborted, skipping output");return}const l=new Set,h=this.dependencyMap.get(i)??[];for(const p of h){const d=this.dependentMap.get(p);d&&(d.delete(i),l.add(p),d.size===0&&this.dependentMap.delete(p))}for(const p of s.dependencies){let d=this.dependentMap.get(p);d||(d=new Set,this.dependentMap.set(p,d)),d.add(i),l.add(p)}if(this.dependentSetHandler)for(const p of l){const d=this.dependentMap.get(p);this.dependentSetHandler(p,d)}this.outputMap.set(i,c),this.outputHandler?.(i,c),this.dependencyMap.set(i,s.dependencies),r.pop()}this.workset.delete(n)}}}class bg extends pi{getNodeDependencies(t){const n=[];if(t.kind==="hub"){for(const r of t.hub.inputs??[])n.push(`instance:${r.instanceId}`);for(const r of t.hub.injectionInputs??[])n.push(`hub:${r.hubId}`);return n}for(const r of Object.values(t.instance.inputs??{}))for(const s of r)n.push(`instance:${s.instanceId}`);for(const r of Object.values(t.instance.hubInputs??{}))for(const s of r)n.push(`hub:${s.hubId}`);for(const r of t.instance.injectionInputs??[])n.push(`hub:${r.hubId}`);return n}resolveOutputTypeForInput(t,n){return lu({input:t,fallbackType:n,getInstanceContext:r=>{const s=this.outputs.get(`instance:${r}`);if(!(!s||s.kind!=="instance"))return{instance:s.instance,component:s.component,entities:s.entities}}})}processNode(t){const n=h=>{const p=this.outputs.get(`hub:${h.hubId}`);if(!p)return{resolvedInputs:[]};if(p.kind!=="hub")throw new Error("Expected hub node");return p},r=h=>{const p=this.outputs.get(`instance:${h.instanceId}`);if(!p)return{component:null,resolvedInputs:[],resolvedOutputs:[]};if(p.kind!=="instance")throw new Error("Expected instance node");return{component:p.component,resolvedInputs:p.resolvedInputs[h.output]??[],resolvedOutputs:p.resolvedOutputs?.[h.output]}};if(t.kind==="hub"){const h=new Map,p=d=>{h.set(yn(d.input),d)};for(const d of t.hub.inputs??[]){const{component:m}=r(d),_=m?.outputs[d.output];if(!_){this.logger.warn({msg:"output not found in the component",input:d,component:m});continue}p({input:d,type:this.resolveOutputTypeForInput(d,_.type)})}for(const d of t.hub.injectionInputs??[]){const{resolvedInputs:m}=n(d);for(const _ of m)p(_)}return{kind:"hub",hub:t.hub,resolvedInputs:Array.from(h.values())}}if(t.instance.resolvedInputs)return{kind:"instance",instance:t.instance,component:t.component,entities:t.entities,resolvedInputs:yp(t.instance.resolvedInputs,(h,p)=>{const d=t.component.inputs[p];return d?h.map(m=>({input:m,type:d.type})):(this.logger.warn({msg:"input not found in the component",inputName:p,component:t.component}),[])}),resolvedOutputs:t.instance.resolvedOutputs??{},resolvedInjectionInputs:[],matchedInjectionInputs:[]};const s=new Map,i=(h,p)=>{let d=s.get(h);d||(d=new Map,s.set(h,d)),d.set(yn(p.input),p)},o=(h,p)=>{const d=t.component.inputs[h];if(!d){this.logger.warn({msg:"input not found in the component",input:p,component:t.component});return}const{component:m,resolvedOutputs:_}=r(p);if(!m){this.logger.warn({instanceId:t.instance.id,input:p},"no output found for the input");return}if(hi(m)){i(h,{input:p,type:this.resolveOutputTypeForInput(p,d.type)});return}if(_)for(const g of _)i(h,{input:{...g,path:p.path??g.path},type:this.resolveOutputTypeForInput({instanceId:p.instanceId,output:p.output,path:p.path??g.path},d.type)});else i(h,{input:p,type:this.resolveOutputTypeForInput(p,d.type)})};for(const[h,p]of Object.entries(t.instance.inputs??{}))for(const d of p)o(h,d);const a=new Map,c=new Map;for(const h of t.instance.injectionInputs??[]){const{resolvedInputs:p}=n(h);for(const d of p)a.set(yn(d.input),d)}for(const[h,p]of Object.entries(t.component.inputs??{})){const d=new Map(a),m=t.instance.hubInputs?.[h]??[];for(const _ of m){const{resolvedInputs:g}=n(_);for(const w of g)d.set(yn(w.input),w)}for(const _ of d.values())if(_.type===p.type){o(h,_.input);const g=yn(_.input);a.has(g)&&c.set(g,_)}}const l=gp(Array.from(s.entries()).map(([h,p])=>[h,Array.from(p.values())]));return{kind:"instance",instance:t.instance,component:t.component,entities:t.entities,resolvedInputs:l,resolvedOutputs:t.instance.resolvedOutputs,resolvedInjectionInputs:Array.from(a.values()),matchedInjectionInputs:Array.from(c.values())}}}function $g(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}const Sg=e=>new TextEncoder().encode(e);typeof Buffer<"u"&&Buffer.from;function Eg(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;n<e.length;)t[n]=e[n],n+=1;return t}return Uint32Array.from(e)}function bs(e){return new kg().update(e).digest()}var kg=(function(){function e(){this.checksum=4294967295}return e.prototype.update=function(t){var n,r;try{for(var s=$g(t),i=s.next();!i.done;i=s.next()){var o=i.value;this.checksum=this.checksum>>>8^Og[(this.checksum^o)&255]}}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e})(),Ig=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],Og=Eg(Ig);function Ag(e){const t=e.length;let n=0,r=0;for(;r<t;){let s=e.charCodeAt(r++);if((s&4294967168)===0){n++;continue}else if((s&4294965248)===0)n+=2;else{if(s>=55296&&s<=56319&&r<t){const i=e.charCodeAt(r);(i&64512)===56320&&(++r,s=((s&1023)<<10)+(i&1023)+65536)}(s&4294901760)===0?n+=3:n+=4}}return n}function Ng(e,t,n){const r=e.length;let s=n,i=0;for(;i<r;){let o=e.charCodeAt(i++);if((o&4294967168)===0){t[s++]=o;continue}else if((o&4294965248)===0)t[s++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&i<r){const a=e.charCodeAt(i);(a&64512)===56320&&(++i,o=((o&1023)<<10)+(a&1023)+65536)}(o&4294901760)===0?(t[s++]=o>>12&15|224,t[s++]=o>>6&63|128):(t[s++]=o>>18&7|240,t[s++]=o>>12&63|128,t[s++]=o>>6&63|128)}t[s++]=o&63|128}}const Tg=new TextEncoder,Pg=50;function Cg(e,t,n){Tg.encodeInto(e,t.subarray(n))}function xg(e,t,n){e.length>Pg?Cg(e,t,n):Ng(e,t,n)}new TextDecoder;class Hn{type;data;constructor(t,n){this.type=t,this.data=n}}class Kr extends Error{constructor(t){super(t);const n=Object.create(Kr.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:Kr.name})}}function Bg(e,t,n){const r=n/4294967296,s=n;e.setUint32(t,r),e.setUint32(t+4,s)}function fu(e,t,n){const r=Math.floor(n/4294967296),s=n;e.setUint32(t,r),e.setUint32(t+4,s)}function Dg(e,t){const n=e.getInt32(t),r=e.getUint32(t+4);return n*4294967296+r}const zg=-1,Rg=4294967296-1,jg=17179869184-1;function Fg({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=jg)if(t===0&&e<=Rg){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e),n}else{const n=e/4294967296,r=e&4294967295,s=new Uint8Array(8),i=new DataView(s.buffer);return i.setUint32(0,t<<2|n&3),i.setUint32(4,r),s}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,t),fu(r,4,e),n}}function Mg(e){const t=e.getTime(),n=Math.floor(t/1e3),r=(t-n*1e3)*1e6,s=Math.floor(r/1e9);return{sec:n+s,nsec:r-s*1e9}}function Ug(e){if(e instanceof Date){const t=Mg(e);return Fg(t)}else return null}function Lg(e){const t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{const n=t.getUint32(0),r=t.getUint32(4),s=(n&3)*4294967296+r,i=n>>>2;return{sec:s,nsec:i}}case 12:{const n=Dg(t,4),r=t.getUint32(0);return{sec:n,nsec:r}}default:throw new Kr(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}function qg(e){const t=Lg(e);return new Date(t.sec*1e3+t.nsec/1e6)}const Zg={type:zg,encode:Ug,decode:qg};class mi{static defaultCodec=new mi;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(Zg)}register({type:t,encode:n,decode:r}){if(t>=0)this.encoders[t]=n,this.decoders[t]=r;else{const s=-1-t;this.builtInEncoders[s]=n,this.builtInDecoders[s]=r}}tryToEncode(t,n){for(let r=0;r<this.builtInEncoders.length;r++){const s=this.builtInEncoders[r];if(s!=null){const i=s(t,n);if(i!=null){const o=-1-r;return new Hn(o,i)}}}for(let r=0;r<this.encoders.length;r++){const s=this.encoders[r];if(s!=null){const i=s(t,n);if(i!=null){const o=r;return new Hn(o,i)}}}return t instanceof Hn?t:null}decode(t,n,r){const s=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return s?s(t,n,r):new Hn(n,t)}}function Vg(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function Kg(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Vg(e)?new Uint8Array(e):Uint8Array.from(e)}const Jg=100,Hg=2048;class gi{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(t){this.extensionCodec=t?.extensionCodec??mi.defaultCodec,this.context=t?.context,this.useBigInt64=t?.useBigInt64??!1,this.maxDepth=t?.maxDepth??Jg,this.initialBufferSize=t?.initialBufferSize??Hg,this.sortKeys=t?.sortKeys??!1,this.forceFloat32=t?.forceFloat32??!1,this.ignoreUndefined=t?.ignoreUndefined??!1,this.forceIntegerToFloat=t?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new gi({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(t){if(this.entered)return this.clone().encodeSharedRef(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(t){if(this.entered)return this.clone().encode(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(t,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);t==null?this.encodeNil():typeof t=="boolean"?this.encodeBoolean(t):typeof t=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(t):this.encodeNumber(t):typeof t=="string"?this.encodeString(t):this.useBigInt64&&typeof t=="bigint"?this.encodeBigInt64(t):this.encodeObject(t,n)}ensureBufferSizeToWrite(t){const n=this.pos+t;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(t){const n=new ArrayBuffer(t),r=new Uint8Array(n),s=new DataView(n);r.set(this.bytes),this.view=s,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(t){t===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(t){!this.forceIntegerToFloat&&Number.isSafeInteger(t)?t>=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(211),this.writeI64(t)):this.encodeNumberAsFloat(t)}encodeNumberAsFloat(t){this.forceFloat32?(this.writeU8(202),this.writeF32(t)):(this.writeU8(203),this.writeF64(t))}encodeBigInt64(t){t>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(t)):(this.writeU8(211),this.writeBigInt64(t))}writeStringHeader(t){if(t<32)this.writeU8(160+t);else if(t<256)this.writeU8(217),this.writeU8(t);else if(t<65536)this.writeU8(218),this.writeU16(t);else if(t<4294967296)this.writeU8(219),this.writeU32(t);else throw new Error(`Too long string: ${t} bytes in UTF-8`)}encodeString(t){const r=Ag(t);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),xg(t,this.bytes,this.pos),this.pos+=r}encodeObject(t,n){const r=this.extensionCodec.tryToEncode(t,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(t))this.encodeArray(t,n);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else if(typeof t=="object")this.encodeMap(t,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(t)}`)}encodeBinary(t){const n=t.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=Kg(t);this.writeU8a(r)}encodeArray(t,n){const r=t.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const s of t)this.doEncode(s,n+1)}countWithoutUndefined(t,n){let r=0;for(const s of n)t[s]!==void 0&&r++;return r}encodeMap(t,n){const r=Object.keys(t);this.sortKeys&&r.sort();const s=this.ignoreUndefined?this.countWithoutUndefined(t,r):r.length;if(s<16)this.writeU8(128+s);else if(s<65536)this.writeU8(222),this.writeU16(s);else if(s<4294967296)this.writeU8(223),this.writeU32(s);else throw new Error(`Too large map object: ${s}`);for(const i of r){const o=t[i];this.ignoreUndefined&&o===void 0||(this.encodeString(i),this.doEncode(o,n+1))}}encodeExtension(t){if(typeof t.data=="function"){const r=t.data(this.pos+6),s=r.length;if(s>=4294967296)throw new Error(`Too large extension object: ${s}`);this.writeU8(201),this.writeU32(s),this.writeI8(t.type),this.writeU8a(r);return}const n=t.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(t.type),this.writeU8a(t.data)}writeU8(t){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,t),this.pos++}writeU8a(t){const n=t.length;this.ensureBufferSizeToWrite(n),this.bytes.set(t,this.pos),this.pos+=n}writeI8(t){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,t),this.pos++}writeU16(t){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,t),this.pos+=2}writeI16(t){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,t),this.pos+=2}writeU32(t){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,t),this.pos+=4}writeI32(t){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,t),this.pos+=4}writeF32(t){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,t),this.pos+=4}writeF64(t){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,t),this.pos+=8}writeU64(t){this.ensureBufferSizeToWrite(8),Bg(this.view,this.pos,t),this.pos+=8}writeI64(t){this.ensureBufferSizeToWrite(8),fu(this.view,this.pos,t),this.pos+=8}writeBigUint64(t){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,t),this.pos+=8}writeBigInt64(t){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,t),this.pos+=8}}function Gg(e,t){return new gi(t).encodeSharedRef(e)}var $s={},wn={},ro;function Wg(){if(ro)return wn;ro=1,wn.byteLength=a,wn.toByteArray=l,wn.fromByteArray=d;for(var e=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,i=r.length;s<i;++s)e[s]=r[s],t[r.charCodeAt(s)]=s;t[45]=62,t[95]=63;function o(m){var _=m.length;if(_%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=m.indexOf("=");g===-1&&(g=_);var w=g===_?0:4-g%4;return[g,w]}function a(m){var _=o(m),g=_[0],w=_[1];return(g+w)*3/4-w}function c(m,_,g){return(_+g)*3/4-g}function l(m){var _,g=o(m),w=g[0],$=g[1],y=new n(c(m,w,$)),b=0,I=$>0?w-4:w,v;for(v=0;v<I;v+=4)_=t[m.charCodeAt(v)]<<18|t[m.charCodeAt(v+1)]<<12|t[m.charCodeAt(v+2)]<<6|t[m.charCodeAt(v+3)],y[b++]=_>>16&255,y[b++]=_>>8&255,y[b++]=_&255;return $===2&&(_=t[m.charCodeAt(v)]<<2|t[m.charCodeAt(v+1)]>>4,y[b++]=_&255),$===1&&(_=t[m.charCodeAt(v)]<<10|t[m.charCodeAt(v+1)]<<4|t[m.charCodeAt(v+2)]>>2,y[b++]=_>>8&255,y[b++]=_&255),y}function h(m){return e[m>>18&63]+e[m>>12&63]+e[m>>6&63]+e[m&63]}function p(m,_,g){for(var w,$=[],y=_;y<g;y+=3)w=(m[y]<<16&16711680)+(m[y+1]<<8&65280)+(m[y+2]&255),$.push(h(w));return $.join("")}function d(m){for(var _,g=m.length,w=g%3,$=[],y=16383,b=0,I=g-w;b<I;b+=y)$.push(p(m,b,b+y>I?I:b+y));return w===1?(_=m[g-1],$.push(e[_>>2]+e[_<<4&63]+"==")):w===2&&(_=(m[g-2]<<8)+m[g-1],$.push(e[_>>10]+e[_>>4&63]+e[_<<2&63]+"=")),$.join("")}return wn}var Gn={};var so;function Yg(){return so||(so=1,Gn.read=function(e,t,n,r,s){var i,o,a=s*8-r-1,c=(1<<a)-1,l=c>>1,h=-7,p=n?s-1:0,d=n?-1:1,m=e[t+p];for(p+=d,i=m&(1<<-h)-1,m>>=-h,h+=a;h>0;i=i*256+e[t+p],p+=d,h-=8);for(o=i&(1<<-h)-1,i>>=-h,h+=r;h>0;o=o*256+e[t+p],p+=d,h-=8);if(i===0)i=1-l;else{if(i===c)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-l}return(m?-1:1)*o*Math.pow(2,i-r)},Gn.write=function(e,t,n,r,s,i){var o,a,c,l=i*8-s-1,h=(1<<l)-1,p=h>>1,d=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,_=r?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=h):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+p>=1?t+=d/c:t+=d*Math.pow(2,1-p),t*c>=2&&(o++,c/=2),o+p>=h?(a=0,o=h):o+p>=1?(a=(t*c-1)*Math.pow(2,s),o=o+p):(a=t*Math.pow(2,p-1)*Math.pow(2,s),o=0));s>=8;e[n+m]=a&255,m+=_,a/=256,s-=8);for(o=o<<s|a,l+=s;l>0;e[n+m]=o&255,m+=_,o/=256,l-=8);e[n+m-_]|=g*128}),Gn}var io;function Qg(){return io||(io=1,(function(e){const t=Wg(),n=Yg(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50;const s=2147483647;e.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const S=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(S,u),S.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(S){if(S>s)throw new RangeError('The value "'+S+'" is invalid for option "size"');const u=new Uint8Array(S);return Object.setPrototypeOf(u,a.prototype),u}function a(S,u,f){if(typeof S=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(S)}return c(S,u,f)}a.poolSize=8192;function c(S,u,f){if(typeof S=="string")return d(S,u);if(ArrayBuffer.isView(S))return _(S);if(S==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S);if(Ue(S,ArrayBuffer)||S&&Ue(S.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ue(S,SharedArrayBuffer)||S&&Ue(S.buffer,SharedArrayBuffer)))return g(S,u,f);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const O=S.valueOf&&S.valueOf();if(O!=null&&O!==S)return a.from(O,u,f);const C=w(S);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return a.from(S[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S)}a.from=function(S,u,f){return c(S,u,f)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(S){if(typeof S!="number")throw new TypeError('"size" argument must be of type number');if(S<0)throw new RangeError('The value "'+S+'" is invalid for option "size"')}function h(S,u,f){return l(S),S<=0?o(S):u!==void 0?typeof f=="string"?o(S).fill(u,f):o(S).fill(u):o(S)}a.alloc=function(S,u,f){return h(S,u,f)};function p(S){return l(S),o(S<0?0:$(S)|0)}a.allocUnsafe=function(S){return p(S)},a.allocUnsafeSlow=function(S){return p(S)};function d(S,u){if((typeof u!="string"||u==="")&&(u="utf8"),!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const f=b(S,u)|0;let O=o(f);const C=O.write(S,u);return C!==f&&(O=O.slice(0,C)),O}function m(S){const u=S.length<0?0:$(S.length)|0,f=o(u);for(let O=0;O<u;O+=1)f[O]=S[O]&255;return f}function _(S){if(Ue(S,Uint8Array)){const u=new Uint8Array(S);return g(u.buffer,u.byteOffset,u.byteLength)}return m(S)}function g(S,u,f){if(u<0||S.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(S.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let O;return u===void 0&&f===void 0?O=new Uint8Array(S):f===void 0?O=new Uint8Array(S,u):O=new Uint8Array(S,u,f),Object.setPrototypeOf(O,a.prototype),O}function w(S){if(a.isBuffer(S)){const u=$(S.length)|0,f=o(u);return f.length===0||S.copy(f,0,0,u),f}if(S.length!==void 0)return typeof S.length!="number"||Ze(S.length)?o(0):m(S);if(S.type==="Buffer"&&Array.isArray(S.data))return m(S.data)}function $(S){if(S>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return S|0}function y(S){return+S!=S&&(S=0),a.alloc(+S)}a.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==a.prototype},a.compare=function(u,f){if(Ue(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),Ue(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(u)||!a.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===f)return 0;let O=u.length,C=f.length;for(let R=0,Z=Math.min(O,C);R<Z;++R)if(u[R]!==f[R]){O=u[R],C=f[R];break}return O<C?-1:C<O?1:0},a.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(u,f){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return a.alloc(0);let O;if(f===void 0)for(f=0,O=0;O<u.length;++O)f+=u[O].length;const C=a.allocUnsafe(f);let R=0;for(O=0;O<u.length;++O){let Z=u[O];if(Ue(Z,Uint8Array))R+Z.length>C.length?(a.isBuffer(Z)||(Z=a.from(Z)),Z.copy(C,R)):Uint8Array.prototype.set.call(C,Z,R);else if(a.isBuffer(Z))Z.copy(C,R);else throw new TypeError('"list" argument must be an Array of Buffers');R+=Z.length}return C};function b(S,u){if(a.isBuffer(S))return S.length;if(ArrayBuffer.isView(S)||Ue(S,ArrayBuffer))return S.byteLength;if(typeof S!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof S);const f=S.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&f===0)return 0;let C=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return _e(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Me(S).length;default:if(C)return O?-1:_e(S).length;u=(""+u).toLowerCase(),C=!0}}a.byteLength=b;function I(S,u,f){let O=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,u>>>=0,f<=u))return"";for(S||(S="utf8");;)switch(S){case"hex":return oe(this,u,f);case"utf8":case"utf-8":return le(this,u,f);case"ascii":return re(this,u,f);case"latin1":case"binary":return ne(this,u,f);case"base64":return se(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,u,f);default:if(O)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),O=!0}}a.prototype._isBuffer=!0;function v(S,u,f){const O=S[u];S[u]=S[f],S[f]=O}a.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<u;f+=2)v(this,f,f+1);return this},a.prototype.swap32=function(){const u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<u;f+=4)v(this,f,f+3),v(this,f+1,f+2);return this},a.prototype.swap64=function(){const u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<u;f+=8)v(this,f,f+7),v(this,f+1,f+6),v(this,f+2,f+5),v(this,f+3,f+4);return this},a.prototype.toString=function(){const u=this.length;return u===0?"":arguments.length===0?le(this,0,u):I.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(u){if(!a.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:a.compare(this,u)===0},a.prototype.inspect=function(){let u="";const f=e.INSPECT_MAX_BYTES;return u=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(u+=" ... "),"<Buffer "+u+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(u,f,O,C,R){if(Ue(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),!a.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(f===void 0&&(f=0),O===void 0&&(O=u?u.length:0),C===void 0&&(C=0),R===void 0&&(R=this.length),f<0||O>u.length||C<0||R>this.length)throw new RangeError("out of range index");if(C>=R&&f>=O)return 0;if(C>=R)return-1;if(f>=O)return 1;if(f>>>=0,O>>>=0,C>>>=0,R>>>=0,this===u)return 0;let Z=R-C,de=O-f;const Pe=Math.min(Z,de),Ie=this.slice(C,R),Ce=u.slice(f,O);for(let be=0;be<Pe;++be)if(Ie[be]!==Ce[be]){Z=Ie[be],de=Ce[be];break}return Z<de?-1:de<Z?1:0};function k(S,u,f,O,C){if(S.length===0)return-1;if(typeof f=="string"?(O=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Ze(f)&&(f=C?0:S.length-1),f<0&&(f=S.length+f),f>=S.length){if(C)return-1;f=S.length-1}else if(f<0)if(C)f=0;else return-1;if(typeof u=="string"&&(u=a.from(u,O)),a.isBuffer(u))return u.length===0?-1:A(S,u,f,O,C);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?C?Uint8Array.prototype.indexOf.call(S,u,f):Uint8Array.prototype.lastIndexOf.call(S,u,f):A(S,[u],f,O,C);throw new TypeError("val must be string, number or Buffer")}function A(S,u,f,O,C){let R=1,Z=S.length,de=u.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(S.length<2||u.length<2)return-1;R=2,Z/=2,de/=2,f/=2}function Pe(Ce,be){return R===1?Ce[be]:Ce.readUInt16BE(be*R)}let Ie;if(C){let Ce=-1;for(Ie=f;Ie<Z;Ie++)if(Pe(S,Ie)===Pe(u,Ce===-1?0:Ie-Ce)){if(Ce===-1&&(Ce=Ie),Ie-Ce+1===de)return Ce*R}else Ce!==-1&&(Ie-=Ie-Ce),Ce=-1}else for(f+de>Z&&(f=Z-de),Ie=f;Ie>=0;Ie--){let Ce=!0;for(let be=0;be<de;be++)if(Pe(S,Ie+be)!==Pe(u,be)){Ce=!1;break}if(Ce)return Ie}return-1}a.prototype.includes=function(u,f,O){return this.indexOf(u,f,O)!==-1},a.prototype.indexOf=function(u,f,O){return k(this,u,f,O,!0)},a.prototype.lastIndexOf=function(u,f,O){return k(this,u,f,O,!1)};function T(S,u,f,O){f=Number(f)||0;const C=S.length-f;O?(O=Number(O),O>C&&(O=C)):O=C;const R=u.length;O>R/2&&(O=R/2);let Z;for(Z=0;Z<O;++Z){const de=parseInt(u.substr(Z*2,2),16);if(Ze(de))return Z;S[f+Z]=de}return Z}function L(S,u,f,O){return Te(_e(u,S.length-f),S,f,O)}function H(S,u,f,O){return Te(Re(u),S,f,O)}function G(S,u,f,O){return Te(Me(u),S,f,O)}function Y(S,u,f,O){return Te(qe(u,S.length-f),S,f,O)}a.prototype.write=function(u,f,O,C){if(f===void 0)C="utf8",O=this.length,f=0;else if(O===void 0&&typeof f=="string")C=f,O=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(O)?(O=O>>>0,C===void 0&&(C="utf8")):(C=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const R=this.length-f;if((O===void 0||O>R)&&(O=R),u.length>0&&(O<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");C||(C="utf8");let Z=!1;for(;;)switch(C){case"hex":return T(this,u,f,O);case"utf8":case"utf-8":return L(this,u,f,O);case"ascii":case"latin1":case"binary":return H(this,u,f,O);case"base64":return G(this,u,f,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,u,f,O);default:if(Z)throw new TypeError("Unknown encoding: "+C);C=(""+C).toLowerCase(),Z=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(S,u,f){return u===0&&f===S.length?t.fromByteArray(S):t.fromByteArray(S.slice(u,f))}function le(S,u,f){f=Math.min(S.length,f);const O=[];let C=u;for(;C<f;){const R=S[C];let Z=null,de=R>239?4:R>223?3:R>191?2:1;if(C+de<=f){let Pe,Ie,Ce,be;switch(de){case 1:R<128&&(Z=R);break;case 2:Pe=S[C+1],(Pe&192)===128&&(be=(R&31)<<6|Pe&63,be>127&&(Z=be));break;case 3:Pe=S[C+1],Ie=S[C+2],(Pe&192)===128&&(Ie&192)===128&&(be=(R&15)<<12|(Pe&63)<<6|Ie&63,be>2047&&(be<55296||be>57343)&&(Z=be));break;case 4:Pe=S[C+1],Ie=S[C+2],Ce=S[C+3],(Pe&192)===128&&(Ie&192)===128&&(Ce&192)===128&&(be=(R&15)<<18|(Pe&63)<<12|(Ie&63)<<6|Ce&63,be>65535&&be<1114112&&(Z=be))}}Z===null?(Z=65533,de=1):Z>65535&&(Z-=65536,O.push(Z>>>10&1023|55296),Z=56320|Z&1023),O.push(Z),C+=de}return W(O)}const M=4096;function W(S){const u=S.length;if(u<=M)return String.fromCharCode.apply(String,S);let f="",O=0;for(;O<u;)f+=String.fromCharCode.apply(String,S.slice(O,O+=M));return f}function re(S,u,f){let O="";f=Math.min(S.length,f);for(let C=u;C<f;++C)O+=String.fromCharCode(S[C]&127);return O}function ne(S,u,f){let O="";f=Math.min(S.length,f);for(let C=u;C<f;++C)O+=String.fromCharCode(S[C]);return O}function oe(S,u,f){const O=S.length;(!u||u<0)&&(u=0),(!f||f<0||f>O)&&(f=O);let C="";for(let R=u;R<f;++R)C+=mn[S[R]];return C}function V(S,u,f){const O=S.slice(u,f);let C="";for(let R=0;R<O.length-1;R+=2)C+=String.fromCharCode(O[R]+O[R+1]*256);return C}a.prototype.slice=function(u,f){const O=this.length;u=~~u,f=f===void 0?O:~~f,u<0?(u+=O,u<0&&(u=0)):u>O&&(u=O),f<0?(f+=O,f<0&&(f=0)):f>O&&(f=O),f<u&&(f=u);const C=this.subarray(u,f);return Object.setPrototypeOf(C,a.prototype),C};function P(S,u,f){if(S%1!==0||S<0)throw new RangeError("offset is not uint");if(S+u>f)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(u,f,O){u=u>>>0,f=f>>>0,O||P(u,f,this.length);let C=this[u],R=1,Z=0;for(;++Z<f&&(R*=256);)C+=this[u+Z]*R;return C},a.prototype.readUintBE=a.prototype.readUIntBE=function(u,f,O){u=u>>>0,f=f>>>0,O||P(u,f,this.length);let C=this[u+--f],R=1;for(;f>0&&(R*=256);)C+=this[u+--f]*R;return C},a.prototype.readUint8=a.prototype.readUInt8=function(u,f){return u=u>>>0,f||P(u,1,this.length),this[u]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(u,f){return u=u>>>0,f||P(u,2,this.length),this[u]|this[u+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(u,f){return u=u>>>0,f||P(u,2,this.length),this[u]<<8|this[u+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(u,f){return u=u>>>0,f||P(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(u,f){return u=u>>>0,f||P(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},a.prototype.readBigUInt64LE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],O=this[u+7];(f===void 0||O===void 0)&&J(u,this.length-8);const C=f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,R=this[++u]+this[++u]*2**8+this[++u]*2**16+O*2**24;return BigInt(C)+(BigInt(R)<<BigInt(32))}),a.prototype.readBigUInt64BE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],O=this[u+7];(f===void 0||O===void 0)&&J(u,this.length-8);const C=f*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],R=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+O;return(BigInt(C)<<BigInt(32))+BigInt(R)}),a.prototype.readIntLE=function(u,f,O){u=u>>>0,f=f>>>0,O||P(u,f,this.length);let C=this[u],R=1,Z=0;for(;++Z<f&&(R*=256);)C+=this[u+Z]*R;return R*=128,C>=R&&(C-=Math.pow(2,8*f)),C},a.prototype.readIntBE=function(u,f,O){u=u>>>0,f=f>>>0,O||P(u,f,this.length);let C=f,R=1,Z=this[u+--C];for(;C>0&&(R*=256);)Z+=this[u+--C]*R;return R*=128,Z>=R&&(Z-=Math.pow(2,8*f)),Z},a.prototype.readInt8=function(u,f){return u=u>>>0,f||P(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},a.prototype.readInt16LE=function(u,f){u=u>>>0,f||P(u,2,this.length);const O=this[u]|this[u+1]<<8;return O&32768?O|4294901760:O},a.prototype.readInt16BE=function(u,f){u=u>>>0,f||P(u,2,this.length);const O=this[u+1]|this[u]<<8;return O&32768?O|4294901760:O},a.prototype.readInt32LE=function(u,f){return u=u>>>0,f||P(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},a.prototype.readInt32BE=function(u,f){return u=u>>>0,f||P(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},a.prototype.readBigInt64LE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],O=this[u+7];(f===void 0||O===void 0)&&J(u,this.length-8);const C=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(O<<24);return(BigInt(C)<<BigInt(32))+BigInt(f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),a.prototype.readBigInt64BE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],O=this[u+7];(f===void 0||O===void 0)&&J(u,this.length-8);const C=(f<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(C)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+O)}),a.prototype.readFloatLE=function(u,f){return u=u>>>0,f||P(u,4,this.length),n.read(this,u,!0,23,4)},a.prototype.readFloatBE=function(u,f){return u=u>>>0,f||P(u,4,this.length),n.read(this,u,!1,23,4)},a.prototype.readDoubleLE=function(u,f){return u=u>>>0,f||P(u,8,this.length),n.read(this,u,!0,52,8)},a.prototype.readDoubleBE=function(u,f){return u=u>>>0,f||P(u,8,this.length),n.read(this,u,!1,52,8)};function j(S,u,f,O,C,R){if(!a.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>C||u<R)throw new RangeError('"value" argument is out of bounds');if(f+O>S.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(u,f,O,C){if(u=+u,f=f>>>0,O=O>>>0,!C){const de=Math.pow(2,8*O)-1;j(this,u,f,O,de,0)}let R=1,Z=0;for(this[f]=u&255;++Z<O&&(R*=256);)this[f+Z]=u/R&255;return f+O},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(u,f,O,C){if(u=+u,f=f>>>0,O=O>>>0,!C){const de=Math.pow(2,8*O)-1;j(this,u,f,O,de,0)}let R=O-1,Z=1;for(this[f+R]=u&255;--R>=0&&(Z*=256);)this[f+R]=u/Z&255;return f+O},a.prototype.writeUint8=a.prototype.writeUInt8=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,1,255,0),this[f]=u&255,f+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,2,65535,0),this[f]=u&255,this[f+1]=u>>>8,f+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,2,65535,0),this[f]=u>>>8,this[f+1]=u&255,f+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,4,4294967295,0),this[f+3]=u>>>24,this[f+2]=u>>>16,this[f+1]=u>>>8,this[f]=u&255,f+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,4,4294967295,0),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4};function B(S,u,f,O,C){D(u,O,C,S,f,7);let R=Number(u&BigInt(4294967295));S[f++]=R,R=R>>8,S[f++]=R,R=R>>8,S[f++]=R,R=R>>8,S[f++]=R;let Z=Number(u>>BigInt(32)&BigInt(4294967295));return S[f++]=Z,Z=Z>>8,S[f++]=Z,Z=Z>>8,S[f++]=Z,Z=Z>>8,S[f++]=Z,f}function E(S,u,f,O,C){D(u,O,C,S,f,7);let R=Number(u&BigInt(4294967295));S[f+7]=R,R=R>>8,S[f+6]=R,R=R>>8,S[f+5]=R,R=R>>8,S[f+4]=R;let Z=Number(u>>BigInt(32)&BigInt(4294967295));return S[f+3]=Z,Z=Z>>8,S[f+2]=Z,Z=Z>>8,S[f+1]=Z,Z=Z>>8,S[f]=Z,f+8}a.prototype.writeBigUInt64LE=tt(function(u,f=0){return B(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=tt(function(u,f=0){return E(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(u,f,O,C){if(u=+u,f=f>>>0,!C){const Pe=Math.pow(2,8*O-1);j(this,u,f,O,Pe-1,-Pe)}let R=0,Z=1,de=0;for(this[f]=u&255;++R<O&&(Z*=256);)u<0&&de===0&&this[f+R-1]!==0&&(de=1),this[f+R]=(u/Z>>0)-de&255;return f+O},a.prototype.writeIntBE=function(u,f,O,C){if(u=+u,f=f>>>0,!C){const Pe=Math.pow(2,8*O-1);j(this,u,f,O,Pe-1,-Pe)}let R=O-1,Z=1,de=0;for(this[f+R]=u&255;--R>=0&&(Z*=256);)u<0&&de===0&&this[f+R+1]!==0&&(de=1),this[f+R]=(u/Z>>0)-de&255;return f+O},a.prototype.writeInt8=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,1,127,-128),u<0&&(u=255+u+1),this[f]=u&255,f+1},a.prototype.writeInt16LE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,2,32767,-32768),this[f]=u&255,this[f+1]=u>>>8,f+2},a.prototype.writeInt16BE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,2,32767,-32768),this[f]=u>>>8,this[f+1]=u&255,f+2},a.prototype.writeInt32LE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,4,2147483647,-2147483648),this[f]=u&255,this[f+1]=u>>>8,this[f+2]=u>>>16,this[f+3]=u>>>24,f+4},a.prototype.writeInt32BE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4},a.prototype.writeBigInt64LE=tt(function(u,f=0){return B(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=tt(function(u,f=0){return E(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function N(S,u,f,O,C,R){if(f+O>S.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function F(S,u,f,O,C){return u=+u,f=f>>>0,C||N(S,u,f,4),n.write(S,u,f,O,23,4),f+4}a.prototype.writeFloatLE=function(u,f,O){return F(this,u,f,!0,O)},a.prototype.writeFloatBE=function(u,f,O){return F(this,u,f,!1,O)};function X(S,u,f,O,C){return u=+u,f=f>>>0,C||N(S,u,f,8),n.write(S,u,f,O,52,8),f+8}a.prototype.writeDoubleLE=function(u,f,O){return X(this,u,f,!0,O)},a.prototype.writeDoubleBE=function(u,f,O){return X(this,u,f,!1,O)},a.prototype.copy=function(u,f,O,C){if(!a.isBuffer(u))throw new TypeError("argument should be a Buffer");if(O||(O=0),!C&&C!==0&&(C=this.length),f>=u.length&&(f=u.length),f||(f=0),C>0&&C<O&&(C=O),C===O||u.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("sourceEnd out of bounds");C>this.length&&(C=this.length),u.length-f<C-O&&(C=u.length-f+O);const R=C-O;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,O,C):Uint8Array.prototype.set.call(u,this.subarray(O,C),f),R},a.prototype.fill=function(u,f,O,C){if(typeof u=="string"){if(typeof f=="string"?(C=f,f=0,O=this.length):typeof O=="string"&&(C=O,O=this.length),C!==void 0&&typeof C!="string")throw new TypeError("encoding must be a string");if(typeof C=="string"&&!a.isEncoding(C))throw new TypeError("Unknown encoding: "+C);if(u.length===1){const Z=u.charCodeAt(0);(C==="utf8"&&Z<128||C==="latin1")&&(u=Z)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(f<0||this.length<f||this.length<O)throw new RangeError("Out of range index");if(O<=f)return this;f=f>>>0,O=O===void 0?this.length:O>>>0,u||(u=0);let R;if(typeof u=="number")for(R=f;R<O;++R)this[R]=u;else{const Z=a.isBuffer(u)?u:a.from(u,C),de=Z.length;if(de===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(R=0;R<O-f;++R)this[R+f]=Z[R%de]}return this};const Q={};function fe(S,u,f){Q[S]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${S}]`,this.stack,delete this.name}get code(){return S}set code(C){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:C,writable:!0})}toString(){return`${this.name} [${S}]: ${this.message}`}}}fe("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),fe("ERR_INVALID_ARG_TYPE",function(S,u){return`The "${S}" argument must be of type number. Received type ${typeof u}`},TypeError),fe("ERR_OUT_OF_RANGE",function(S,u,f){let O=`The value of "${S}" is out of range.`,C=f;return Number.isInteger(f)&&Math.abs(f)>2**32?C=ie(String(f)):typeof f=="bigint"&&(C=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(C=ie(C)),C+="n"),O+=` It must be ${u}. Received ${C}`,O},RangeError);function ie(S){let u="",f=S.length;const O=S[0]==="-"?1:0;for(;f>=O+4;f-=3)u=`_${S.slice(f-3,f)}${u}`;return`${S.slice(0,f)}${u}`}function x(S,u,f){q(u,"offset"),(S[u]===void 0||S[u+f]===void 0)&&J(u,S.length-(f+1))}function D(S,u,f,O,C,R){if(S>f||S<u){const Z=typeof u=="bigint"?"n":"";let de;throw u===0||u===BigInt(0)?de=`>= 0${Z} and < 2${Z} ** ${(R+1)*8}${Z}`:de=`>= -(2${Z} ** ${(R+1)*8-1}${Z}) and < 2 ** ${(R+1)*8-1}${Z}`,new Q.ERR_OUT_OF_RANGE("value",de,S)}x(O,C,R)}function q(S,u){if(typeof S!="number")throw new Q.ERR_INVALID_ARG_TYPE(u,"number",S)}function J(S,u,f){throw Math.floor(S)!==S?(q(S,f),new Q.ERR_OUT_OF_RANGE("offset","an integer",S)):u<0?new Q.ERR_BUFFER_OUT_OF_BOUNDS:new Q.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,S)}const ee=/[^+/0-9A-Za-z-_]/g;function ae(S){if(S=S.split("=")[0],S=S.trim().replace(ee,""),S.length<2)return"";for(;S.length%4!==0;)S=S+"=";return S}function _e(S,u){u=u||1/0;let f;const O=S.length;let C=null;const R=[];for(let Z=0;Z<O;++Z){if(f=S.charCodeAt(Z),f>55295&&f<57344){if(!C){if(f>56319){(u-=3)>-1&&R.push(239,191,189);continue}else if(Z+1===O){(u-=3)>-1&&R.push(239,191,189);continue}C=f;continue}if(f<56320){(u-=3)>-1&&R.push(239,191,189),C=f;continue}f=(C-55296<<10|f-56320)+65536}else C&&(u-=3)>-1&&R.push(239,191,189);if(C=null,f<128){if((u-=1)<0)break;R.push(f)}else if(f<2048){if((u-=2)<0)break;R.push(f>>6|192,f&63|128)}else if(f<65536){if((u-=3)<0)break;R.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((u-=4)<0)break;R.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return R}function Re(S){const u=[];for(let f=0;f<S.length;++f)u.push(S.charCodeAt(f)&255);return u}function qe(S,u){let f,O,C;const R=[];for(let Z=0;Z<S.length&&!((u-=2)<0);++Z)f=S.charCodeAt(Z),O=f>>8,C=f%256,R.push(C),R.push(O);return R}function Me(S){return t.toByteArray(ae(S))}function Te(S,u,f,O){let C;for(C=0;C<O&&!(C+f>=u.length||C>=S.length);++C)u[C+f]=S[C];return C}function Ue(S,u){return S instanceof u||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===u.name}function Ze(S){return S!==S}const mn=(function(){const S="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){const O=f*16;for(let C=0;C<16;++C)u[O+C]=S[f]+S[C]}return u})();function tt(S){return typeof BigInt>"u"?Pt:S}function Pt(){throw new Error("BigInt not supported")}})($s)),$s}var vn=Qg();function Vt(e){const t=new ArrayBuffer(4);return new DataView(t).setInt32(0,e,!0),new Uint8Array(t)}class Xg extends pi{getNodeDependencies({resolvedInputs:t}){const n=[];for(const r of Object.values(t??{}))for(const s of r)n.push(s.input.instanceId);return n}processNode({instance:t,component:n,resolvedInputs:r,sourceHash:s,state:i}){const o=[];o.push(vn.Buffer.from(t.id)),o.push(Vt(n.definitionHash)),i?.inputHashNonce&&o.push(Vt(i.inputHashNonce)),t.args&&o.push(Gg(t.args)),s?o.push(Vt(s)):hi(n)&&this.logger.warn({instanceId:t.id},"missing source hash for unit model, this may lead to incorrect input hash");const a=[...o],c=Object.entries(r).sort(([d],[m])=>d.localeCompare(m)),l=new Set;for(const[d,m]of c){if(Object.keys(m).length===0)continue;a.push(vn.Buffer.from(d));const _=m.map(g=>g.input.instanceId).sort();for(const g of _){const w=this.outputs.get(g);if(!w){this.logger.warn({instanceId:g,dependentInstanceId:t.id},"missing dependency when calculating input hash, this may lead to incorrect input hash");continue}a.push(Vt(w.inputHash)),a.push(Vt(w.outputHash)),l.add(g)}}const h=[],p=Array.from(l).sort();for(const d of p){const m=this.outputs.get(d);if(!m){this.logger.warn({instanceId:d,dependentInstanceId:t.id},"missing dependency when calculating dependency output hash, this may lead to incorrect input hash");continue}h.push(Vt(m.outputHash))}return{selfHash:bs(vn.Buffer.concat(o)),inputHash:bs(vn.Buffer.concat(a)),dependencyOutputHash:bs(vn.Buffer.concat(h)),outputHash:i?.outputHash??0}}}var Wn={exports:{}},Ss={},dt={},Ct={},Es={},ks={},Is={},oo;function Jr(){return oo||(oo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(y){if(super(),!e.IDENTIFIER.test(y))throw new Error("CodeGen: name must be a valid identifier");this.str=y}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(y){super(),this._items=typeof y=="string"?[y]:y}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const y=this._items[0];return y===""||y==='""'}get str(){var y;return(y=this._str)!==null&&y!==void 0?y:this._str=this._items.reduce((b,I)=>`${b}${I}`,"")}get names(){var y;return(y=this._names)!==null&&y!==void 0?y:this._names=this._items.reduce((b,I)=>(I instanceof n&&(b[I.str]=(b[I.str]||0)+1),b),{})}}e._Code=r,e.nil=new r("");function s($,...y){const b=[$[0]];let I=0;for(;I<y.length;)a(b,y[I]),b.push($[++I]);return new r(b)}e._=s;const i=new r("+");function o($,...y){const b=[m($[0])];let I=0;for(;I<y.length;)b.push(i),a(b,y[I]),b.push(i,m($[++I]));return c(b),new r(b)}e.str=o;function a($,y){y instanceof r?$.push(...y._items):y instanceof n?$.push(y):$.push(p(y))}e.addCodeArg=a;function c($){let y=1;for(;y<$.length-1;){if($[y]===i){const b=l($[y-1],$[y+1]);if(b!==void 0){$.splice(y-1,3,b);continue}$[y++]="+"}y++}}function l($,y){if(y==='""')return $;if($==='""')return y;if(typeof $=="string")return y instanceof n||$[$.length-1]!=='"'?void 0:typeof y!="string"?`${$.slice(0,-1)}${y}"`:y[0]==='"'?$.slice(0,-1)+y.slice(1):void 0;if(typeof y=="string"&&y[0]==='"'&&!($ instanceof n))return`"${$}${y.slice(1)}`}function h($,y){return y.emptyStr()?$:$.emptyStr()?y:o`${$}${y}`}e.strConcat=h;function p($){return typeof $=="number"||typeof $=="boolean"||$===null?$:m(Array.isArray($)?$.join(","):$)}function d($){return new r(m($))}e.stringify=d;function m($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=m;function _($){return typeof $=="string"&&e.IDENTIFIER.test($)?new r(`.${$}`):s`[${$}]`}e.getProperty=_;function g($){if(typeof $=="string"&&e.IDENTIFIER.test($))return new r(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}e.getEsmExportName=g;function w($){return new r($.toString())}e.regexpCode=w})(Is)),Is}var Os={},ao;function co(){return ao||(ao=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Jr();class n extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var r;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:l,parent:h}={}){this._names={},this._prefixes=l,this._parent=h}toName(l){return l instanceof t.Name?l:this.name(l)}name(l){return new t.Name(this._newName(l))}_newName(l){const h=this._names[l]||this._nameGroup(l);return`${l}${h.index++}`}_nameGroup(l){var h,p;if(!((p=(h=this._parent)===null||h===void 0?void 0:h._prefixes)===null||p===void 0)&&p.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}e.Scope=s;class i extends t.Name{constructor(l,h){super(h),this.prefix=l}setValue(l,{property:h,itemIndex:p}){this.value=l,this.scopePath=(0,t._)`.${new t.Name(h)}[${p}]`}}e.ValueScopeName=i;const o=(0,t._)`\n`;class a extends s{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?o:t.nil}}get(){return this._scope}name(l){return new i(l,this._newName(l))}value(l,h){var p;if(h.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const d=this.toName(l),{prefix:m}=d,_=(p=h.key)!==null&&p!==void 0?p:h.ref;let g=this._values[m];if(g){const y=g.get(_);if(y)return y}else g=this._values[m]=new Map;g.set(_,d);const w=this._scope[m]||(this._scope[m]=[]),$=w.length;return w[$]=h.ref,d.setValue(h,{property:m,itemIndex:$}),d}getValue(l,h){const p=this._values[l];if(p)return p.get(h)}scopeRefs(l,h=this._values){return this._reduceValues(h,p=>{if(p.scopePath===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return(0,t._)`${l}${p.scopePath}`})}scopeCode(l=this._values,h,p){return this._reduceValues(l,d=>{if(d.value===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return d.value.code},h,p)}_reduceValues(l,h,p={},d){let m=t.nil;for(const _ in l){const g=l[_];if(!g)continue;const w=p[_]=p[_]||new Map;g.forEach($=>{if(w.has($))return;w.set($,r.Started);let y=h($);if(y){const b=this.opts.es5?e.varKinds.var:e.varKinds.const;m=(0,t._)`${m}${b} ${$} = ${y};${this.opts._n}`}else if(y=d?.($))m=(0,t._)`${m}${y}${this.opts._n}`;else throw new n($);w.set($,r.Completed)})}return m}}e.ValueScope=a})(Os)),Os}var uo;function he(){return uo||(uo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Jr(),n=co();var r=Jr();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var s=co();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(E,N){return this}}class o extends i{constructor(E,N,F){super(),this.varKind=E,this.name=N,this.rhs=F}render({es5:E,_n:N}){const F=E?n.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${F} ${this.name}${X};`+N}optimizeNames(E,N){if(E[this.name.str])return this.rhs&&(this.rhs=le(this.rhs,E,N)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(E,N,F){super(),this.lhs=E,this.rhs=N,this.sideEffects=F}render({_n:E}){return`${this.lhs} = ${this.rhs};`+E}optimizeNames(E,N){if(!(this.lhs instanceof t.Name&&!E[this.lhs.str]&&!this.sideEffects))return this.rhs=le(this.rhs,E,N),this}get names(){const E=this.lhs instanceof t.Name?{}:{...this.lhs.names};return se(E,this.rhs)}}class c extends a{constructor(E,N,F,X){super(E,F,X),this.op=N}render({_n:E}){return`${this.lhs} ${this.op}= ${this.rhs};`+E}}class l extends i{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`${this.label}:`+E}}class h extends i{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`break${this.label?` ${this.label}`:""};`+E}}class p extends i{constructor(E){super(),this.error=E}render({_n:E}){return`throw ${this.error};`+E}get names(){return this.error.names}}class d extends i{constructor(E){super(),this.code=E}render({_n:E}){return`${this.code};`+E}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(E,N){return this.code=le(this.code,E,N),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class m extends i{constructor(E=[]){super(),this.nodes=E}render(E){return this.nodes.reduce((N,F)=>N+F.render(E),"")}optimizeNodes(){const{nodes:E}=this;let N=E.length;for(;N--;){const F=E[N].optimizeNodes();Array.isArray(F)?E.splice(N,1,...F):F?E[N]=F:E.splice(N,1)}return E.length>0?this:void 0}optimizeNames(E,N){const{nodes:F}=this;let X=F.length;for(;X--;){const Q=F[X];Q.optimizeNames(E,N)||(M(E,Q.names),F.splice(X,1))}return F.length>0?this:void 0}get names(){return this.nodes.reduce((E,N)=>Y(E,N.names),{})}}class _ extends m{render(E){return"{"+E._n+super.render(E)+"}"+E._n}}class g extends m{}class w extends _{}w.kind="else";class $ extends _{constructor(E,N){super(N),this.condition=E}render(E){let N=`if(${this.condition})`+super.render(E);return this.else&&(N+="else "+this.else.render(E)),N}optimizeNodes(){super.optimizeNodes();const E=this.condition;if(E===!0)return this.nodes;let N=this.else;if(N){const F=N.optimizeNodes();N=this.else=Array.isArray(F)?new w(F):F}if(N)return E===!1?N instanceof $?N:N.nodes:this.nodes.length?this:new $(W(E),N instanceof $?[N]:N.nodes);if(!(E===!1||!this.nodes.length))return this}optimizeNames(E,N){var F;if(this.else=(F=this.else)===null||F===void 0?void 0:F.optimizeNames(E,N),!!(super.optimizeNames(E,N)||this.else))return this.condition=le(this.condition,E,N),this}get names(){const E=super.names;return se(E,this.condition),this.else&&Y(E,this.else.names),E}}$.kind="if";class y extends _{}y.kind="for";class b extends y{constructor(E){super(),this.iteration=E}render(E){return`for(${this.iteration})`+super.render(E)}optimizeNames(E,N){if(super.optimizeNames(E,N))return this.iteration=le(this.iteration,E,N),this}get names(){return Y(super.names,this.iteration.names)}}class I extends y{constructor(E,N,F,X){super(),this.varKind=E,this.name=N,this.from=F,this.to=X}render(E){const N=E.es5?n.varKinds.var:this.varKind,{name:F,from:X,to:Q}=this;return`for(${N} ${F}=${X}; ${F}<${Q}; ${F}++)`+super.render(E)}get names(){const E=se(super.names,this.from);return se(E,this.to)}}class v extends y{constructor(E,N,F,X){super(),this.loop=E,this.varKind=N,this.name=F,this.iterable=X}render(E){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(E)}optimizeNames(E,N){if(super.optimizeNames(E,N))return this.iterable=le(this.iterable,E,N),this}get names(){return Y(super.names,this.iterable.names)}}class k extends _{constructor(E,N,F){super(),this.name=E,this.args=N,this.async=F}render(E){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(E)}}k.kind="func";class A extends m{render(E){return"return "+super.render(E)}}A.kind="return";class T extends _{render(E){let N="try"+super.render(E);return this.catch&&(N+=this.catch.render(E)),this.finally&&(N+=this.finally.render(E)),N}optimizeNodes(){var E,N;return super.optimizeNodes(),(E=this.catch)===null||E===void 0||E.optimizeNodes(),(N=this.finally)===null||N===void 0||N.optimizeNodes(),this}optimizeNames(E,N){var F,X;return super.optimizeNames(E,N),(F=this.catch)===null||F===void 0||F.optimizeNames(E,N),(X=this.finally)===null||X===void 0||X.optimizeNames(E,N),this}get names(){const E=super.names;return this.catch&&Y(E,this.catch.names),this.finally&&Y(E,this.finally.names),E}}class L extends _{constructor(E){super(),this.error=E}render(E){return`catch(${this.error})`+super.render(E)}}L.kind="catch";class H extends _{render(E){return"finally"+super.render(E)}}H.kind="finally";class G{constructor(E,N={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...N,_n:N.lines?`
170
+ `:""},this._extScope=E,this._scope=new n.Scope({parent:E}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(E){return this._scope.name(E)}scopeName(E){return this._extScope.name(E)}scopeValue(E,N){const F=this._extScope.value(E,N);return(this._values[F.prefix]||(this._values[F.prefix]=new Set)).add(F),F}getScopeValue(E,N){return this._extScope.getValue(E,N)}scopeRefs(E){return this._extScope.scopeRefs(E,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(E,N,F,X){const Q=this._scope.toName(N);return F!==void 0&&X&&(this._constants[Q.str]=F),this._leafNode(new o(E,Q,F)),Q}const(E,N,F){return this._def(n.varKinds.const,E,N,F)}let(E,N,F){return this._def(n.varKinds.let,E,N,F)}var(E,N,F){return this._def(n.varKinds.var,E,N,F)}assign(E,N,F){return this._leafNode(new a(E,N,F))}add(E,N){return this._leafNode(new c(E,e.operators.ADD,N))}code(E){return typeof E=="function"?E():E!==t.nil&&this._leafNode(new d(E)),this}object(...E){const N=["{"];for(const[F,X]of E)N.length>1&&N.push(","),N.push(F),(F!==X||this.opts.es5)&&(N.push(":"),(0,t.addCodeArg)(N,X));return N.push("}"),new t._Code(N)}if(E,N,F){if(this._blockNode(new $(E)),N&&F)this.code(N).else().code(F).endIf();else if(N)this.code(N).endIf();else if(F)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(E){return this._elseNode(new $(E))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode($,w)}_for(E,N){return this._blockNode(E),N&&this.code(N).endFor(),this}for(E,N){return this._for(new b(E),N)}forRange(E,N,F,X,Q=this.opts.es5?n.varKinds.var:n.varKinds.let){const fe=this._scope.toName(E);return this._for(new I(Q,fe,N,F),()=>X(fe))}forOf(E,N,F,X=n.varKinds.const){const Q=this._scope.toName(E);if(this.opts.es5){const fe=N instanceof t.Name?N:this.var("_arr",N);return this.forRange("_i",0,(0,t._)`${fe}.length`,ie=>{this.var(Q,(0,t._)`${fe}[${ie}]`),F(Q)})}return this._for(new v("of",X,Q,N),()=>F(Q))}forIn(E,N,F,X=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(E,(0,t._)`Object.keys(${N})`,F);const Q=this._scope.toName(E);return this._for(new v("in",X,Q,N),()=>F(Q))}endFor(){return this._endBlockNode(y)}label(E){return this._leafNode(new l(E))}break(E){return this._leafNode(new h(E))}return(E){const N=new A;if(this._blockNode(N),this.code(E),N.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(A)}try(E,N,F){if(!N&&!F)throw new Error('CodeGen: "try" without "catch" and "finally"');const X=new T;if(this._blockNode(X),this.code(E),N){const Q=this.name("e");this._currNode=X.catch=new L(Q),N(Q)}return F&&(this._currNode=X.finally=new H,this.code(F)),this._endBlockNode(L,H)}throw(E){return this._leafNode(new p(E))}block(E,N){return this._blockStarts.push(this._nodes.length),E&&this.code(E).endBlock(N),this}endBlock(E){const N=this._blockStarts.pop();if(N===void 0)throw new Error("CodeGen: not in self-balancing block");const F=this._nodes.length-N;if(F<0||E!==void 0&&F!==E)throw new Error(`CodeGen: wrong number of nodes: ${F} vs ${E} expected`);return this._nodes.length=N,this}func(E,N=t.nil,F,X){return this._blockNode(new k(E,N,F)),X&&this.code(X).endFunc(),this}endFunc(){return this._endBlockNode(k)}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,N){const F=this._currNode;if(F instanceof E||N&&F instanceof N)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${N?`${E.kind}/${N.kind}`:E.kind}"`)}_elseNode(E){const N=this._currNode;if(!(N instanceof $))throw new Error('CodeGen: "else" without "if"');return this._currNode=N.else=E,this}get _root(){return this._nodes[0]}get _currNode(){const E=this._nodes;return E[E.length-1]}set _currNode(E){const N=this._nodes;N[N.length-1]=E}}e.CodeGen=G;function Y(B,E){for(const N in E)B[N]=(B[N]||0)+(E[N]||0);return B}function se(B,E){return E instanceof t._CodeOrName?Y(B,E.names):B}function le(B,E,N){if(B instanceof t.Name)return F(B);if(!X(B))return B;return new t._Code(B._items.reduce((Q,fe)=>(fe instanceof t.Name&&(fe=F(fe)),fe instanceof t._Code?Q.push(...fe._items):Q.push(fe),Q),[]));function F(Q){const fe=N[Q.str];return fe===void 0||E[Q.str]!==1?Q:(delete E[Q.str],fe)}function X(Q){return Q instanceof t._Code&&Q._items.some(fe=>fe instanceof t.Name&&E[fe.str]===1&&N[fe.str]!==void 0)}}function M(B,E){for(const N in E)B[N]=(B[N]||0)-(E[N]||0)}function W(B){return typeof B=="boolean"||typeof B=="number"||B===null?!B:(0,t._)`!${j(B)}`}e.not=W;const re=P(e.operators.AND);function ne(...B){return B.reduce(re)}e.and=ne;const oe=P(e.operators.OR);function V(...B){return B.reduce(oe)}e.or=V;function P(B){return(E,N)=>E===t.nil?N:N===t.nil?E:(0,t._)`${j(E)} ${B} ${j(N)}`}function j(B){return B instanceof t.Name?B:(0,t._)`(${B})`}})(ks)),ks}var ue={},lo;function ge(){if(lo)return ue;lo=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.checkStrictMode=ue.getErrorPath=ue.Type=ue.useFunc=ue.setEvaluated=ue.evaluatedPropsToName=ue.mergeEvaluated=ue.eachItem=ue.unescapeJsonPointer=ue.escapeJsonPointer=ue.escapeFragment=ue.unescapeFragment=ue.schemaRefOrVal=ue.schemaHasRulesButRef=ue.schemaHasRules=ue.checkUnknownRules=ue.alwaysValidSchema=ue.toHash=void 0;const e=he(),t=Jr();function n(v){const k={};for(const A of v)k[A]=!0;return k}ue.toHash=n;function r(v,k){return typeof k=="boolean"?k:Object.keys(k).length===0?!0:(s(v,k),!i(k,v.self.RULES.all))}ue.alwaysValidSchema=r;function s(v,k=v.schema){const{opts:A,self:T}=v;if(!A.strictSchema||typeof k=="boolean")return;const L=T.RULES.keywords;for(const H in k)L[H]||I(v,`unknown keyword: "${H}"`)}ue.checkUnknownRules=s;function i(v,k){if(typeof v=="boolean")return!v;for(const A in v)if(k[A])return!0;return!1}ue.schemaHasRules=i;function o(v,k){if(typeof v=="boolean")return!v;for(const A in v)if(A!=="$ref"&&k.all[A])return!0;return!1}ue.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:k},A,T,L){if(!L){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return(0,e._)`${A}`}return(0,e._)`${v}${k}${(0,e.getProperty)(T)}`}ue.schemaRefOrVal=a;function c(v){return p(decodeURIComponent(v))}ue.unescapeFragment=c;function l(v){return encodeURIComponent(h(v))}ue.escapeFragment=l;function h(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=h;function p(v){return v.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=p;function d(v,k){if(Array.isArray(v))for(const A of v)k(A);else k(v)}ue.eachItem=d;function m({mergeNames:v,mergeToName:k,mergeValues:A,resultToName:T}){return(L,H,G,Y)=>{const se=G===void 0?H:G instanceof e.Name?(H instanceof e.Name?v(L,H,G):k(L,H,G),G):H instanceof e.Name?(k(L,G,H),H):A(H,G);return Y===e.Name&&!(se instanceof e.Name)?T(L,se):se}}ue.mergeEvaluated={props:m({mergeNames:(v,k,A)=>v.if((0,e._)`${A} !== true && ${k} !== undefined`,()=>{v.if((0,e._)`${k} === true`,()=>v.assign(A,!0),()=>v.assign(A,(0,e._)`${A} || {}`).code((0,e._)`Object.assign(${A}, ${k})`))}),mergeToName:(v,k,A)=>v.if((0,e._)`${A} !== true`,()=>{k===!0?v.assign(A,!0):(v.assign(A,(0,e._)`${A} || {}`),g(v,A,k))}),mergeValues:(v,k)=>v===!0?!0:{...v,...k},resultToName:_}),items:m({mergeNames:(v,k,A)=>v.if((0,e._)`${A} !== true && ${k} !== undefined`,()=>v.assign(A,(0,e._)`${k} === true ? true : ${A} > ${k} ? ${A} : ${k}`)),mergeToName:(v,k,A)=>v.if((0,e._)`${A} !== true`,()=>v.assign(A,k===!0?!0:(0,e._)`${A} > ${k} ? ${A} : ${k}`)),mergeValues:(v,k)=>v===!0?!0:Math.max(v,k),resultToName:(v,k)=>v.var("items",k)})};function _(v,k){if(k===!0)return v.var("props",!0);const A=v.var("props",(0,e._)`{}`);return k!==void 0&&g(v,A,k),A}ue.evaluatedPropsToName=_;function g(v,k,A){Object.keys(A).forEach(T=>v.assign((0,e._)`${k}${(0,e.getProperty)(T)}`,!0))}ue.setEvaluated=g;const w={};function $(v,k){return v.scopeValue("func",{ref:k,code:w[k.code]||(w[k.code]=new t._Code(k.code))})}ue.useFunc=$;var y;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(y||(ue.Type=y={}));function b(v,k,A){if(v instanceof e.Name){const T=k===y.Num;return A?T?(0,e._)`"[" + ${v} + "]"`:(0,e._)`"['" + ${v} + "']"`:T?(0,e._)`"/" + ${v}`:(0,e._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,e.getProperty)(v).toString():"/"+h(v)}ue.getErrorPath=b;function I(v,k,A=v.opts.strictSchema){if(A){if(k=`strict mode: ${k}`,A===!0)throw new Error(k);v.self.logger.warn(k)}}return ue.checkStrictMode=I,ue}var Yn={},fo;function Tt(){if(fo)return Yn;fo=1,Object.defineProperty(Yn,"__esModule",{value:!0});const e=he(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Yn.default=t,Yn}var ho;function us(){return ho||(ho=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=he(),n=ge(),r=Tt();e.keywordError={message:({keyword:w})=>(0,t.str)`must pass "${w}" keyword validation`},e.keyword$DataError={message:({keyword:w,schemaType:$})=>$?(0,t.str)`"${w}" keyword must be ${$} ($data)`:(0,t.str)`"${w}" keyword is invalid ($data)`};function s(w,$=e.keywordError,y,b){const{it:I}=w,{gen:v,compositeRule:k,allErrors:A}=I,T=p(w,$,y);b??(k||A)?c(v,T):l(I,(0,t._)`[${T}]`)}e.reportError=s;function i(w,$=e.keywordError,y){const{it:b}=w,{gen:I,compositeRule:v,allErrors:k}=b,A=p(w,$,y);c(I,A),v||k||l(b,r.default.vErrors)}e.reportExtraError=i;function o(w,$){w.assign(r.default.errors,$),w.if((0,t._)`${r.default.vErrors} !== null`,()=>w.if($,()=>w.assign((0,t._)`${r.default.vErrors}.length`,$),()=>w.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function a({gen:w,keyword:$,schemaValue:y,data:b,errsCount:I,it:v}){if(I===void 0)throw new Error("ajv implementation error");const k=w.name("err");w.forRange("i",I,r.default.errors,A=>{w.const(k,(0,t._)`${r.default.vErrors}[${A}]`),w.if((0,t._)`${k}.instancePath === undefined`,()=>w.assign((0,t._)`${k}.instancePath`,(0,t.strConcat)(r.default.instancePath,v.errorPath))),w.assign((0,t._)`${k}.schemaPath`,(0,t.str)`${v.errSchemaPath}/${$}`),v.opts.verbose&&(w.assign((0,t._)`${k}.schema`,y),w.assign((0,t._)`${k}.data`,b))})}e.extendErrors=a;function c(w,$){const y=w.const("err",$);w.if((0,t._)`${r.default.vErrors} === null`,()=>w.assign(r.default.vErrors,(0,t._)`[${y}]`),(0,t._)`${r.default.vErrors}.push(${y})`),w.code((0,t._)`${r.default.errors}++`)}function l(w,$){const{gen:y,validateName:b,schemaEnv:I}=w;I.$async?y.throw((0,t._)`new ${w.ValidationError}(${$})`):(y.assign((0,t._)`${b}.errors`,$),y.return(!1))}const h={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function p(w,$,y){const{createErrors:b}=w.it;return b===!1?(0,t._)`{}`:d(w,$,y)}function d(w,$,y={}){const{gen:b,it:I}=w,v=[m(I,y),_(w,y)];return g(w,$,v),b.object(...v)}function m({errorPath:w},{instancePath:$}){const y=$?(0,t.str)`${w}${(0,n.getErrorPath)($,n.Type.Str)}`:w;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,y)]}function _({keyword:w,it:{errSchemaPath:$}},{schemaPath:y,parentSchema:b}){let I=b?$:(0,t.str)`${$}/${w}`;return y&&(I=(0,t.str)`${I}${(0,n.getErrorPath)(y,n.Type.Str)}`),[h.schemaPath,I]}function g(w,{params:$,message:y},b){const{keyword:I,data:v,schemaValue:k,it:A}=w,{opts:T,propertyName:L,topSchemaRef:H,schemaPath:G}=A;b.push([h.keyword,I],[h.params,typeof $=="function"?$(w):$||(0,t._)`{}`]),T.messages&&b.push([h.message,typeof y=="function"?y(w):y]),T.verbose&&b.push([h.schema,k],[h.parentSchema,(0,t._)`${H}${G}`],[r.default.data,v]),L&&b.push([h.propertyName,L])}})(Es)),Es}var po;function ey(){if(po)return Ct;po=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.boolOrEmptySchema=Ct.topBoolOrEmptySchema=void 0;const e=us(),t=he(),n=Tt(),r={message:"boolean schema is false"};function s(a){const{gen:c,schema:l,validateName:h}=a;l===!1?o(a,!1):typeof l=="object"&&l.$async===!0?c.return(n.default.data):(c.assign((0,t._)`${h}.errors`,null),c.return(!0))}Ct.topBoolOrEmptySchema=s;function i(a,c){const{gen:l,schema:h}=a;h===!1?(l.var(c,!1),o(a)):l.var(c,!0)}Ct.boolOrEmptySchema=i;function o(a,c){const{gen:l,data:h}=a,p={gen:l,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(p,r,void 0,c)}return Ct}var Le={},xt={},mo;function du(){if(mo)return xt;mo=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.getRules=xt.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(s){return typeof s=="string"&&t.has(s)}xt.isJSONType=n;function r(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return xt.getRules=r,xt}var ht={},go;function hu(){if(go)return ht;go=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.shouldUseRule=ht.shouldUseGroup=ht.schemaHasRulesForType=void 0;function e({schema:r,self:s},i){const o=s.RULES.types[i];return o&&o!==!0&&t(r,o)}ht.schemaHasRulesForType=e;function t(r,s){return s.rules.some(i=>n(r,i))}ht.shouldUseGroup=t;function n(r,s){var i;return r[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(o=>r[o]!==void 0))}return ht.shouldUseRule=n,ht}var yo;function Hr(){if(yo)return Le;yo=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.reportTypeError=Le.checkDataTypes=Le.checkDataType=Le.coerceAndCheckDataType=Le.getJSONTypes=Le.getSchemaTypes=Le.DataType=void 0;const e=du(),t=hu(),n=us(),r=he(),s=ge();var i;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(i||(Le.DataType=i={}));function o(y){const b=a(y.type);if(b.includes("null")){if(y.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!b.length&&y.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');y.nullable===!0&&b.push("null")}return b}Le.getSchemaTypes=o;function a(y){const b=Array.isArray(y)?y:y?[y]:[];if(b.every(e.isJSONType))return b;throw new Error("type must be JSONType or JSONType[]: "+b.join(","))}Le.getJSONTypes=a;function c(y,b){const{gen:I,data:v,opts:k}=y,A=h(b,k.coerceTypes),T=b.length>0&&!(A.length===0&&b.length===1&&(0,t.schemaHasRulesForType)(y,b[0]));if(T){const L=_(b,v,k.strictNumbers,i.Wrong);I.if(L,()=>{A.length?p(y,b,A):w(y)})}return T}Le.coerceAndCheckDataType=c;const l=new Set(["string","number","integer","boolean","null"]);function h(y,b){return b?y.filter(I=>l.has(I)||b==="array"&&I==="array"):[]}function p(y,b,I){const{gen:v,data:k,opts:A}=y,T=v.let("dataType",(0,r._)`typeof ${k}`),L=v.let("coerced",(0,r._)`undefined`);A.coerceTypes==="array"&&v.if((0,r._)`${T} == 'object' && Array.isArray(${k}) && ${k}.length == 1`,()=>v.assign(k,(0,r._)`${k}[0]`).assign(T,(0,r._)`typeof ${k}`).if(_(b,k,A.strictNumbers),()=>v.assign(L,k))),v.if((0,r._)`${L} !== undefined`);for(const G of I)(l.has(G)||G==="array"&&A.coerceTypes==="array")&&H(G);v.else(),w(y),v.endIf(),v.if((0,r._)`${L} !== undefined`,()=>{v.assign(k,L),d(y,L)});function H(G){switch(G){case"string":v.elseIf((0,r._)`${T} == "number" || ${T} == "boolean"`).assign(L,(0,r._)`"" + ${k}`).elseIf((0,r._)`${k} === null`).assign(L,(0,r._)`""`);return;case"number":v.elseIf((0,r._)`${T} == "boolean" || ${k} === null
171
+ || (${T} == "string" && ${k} && ${k} == +${k})`).assign(L,(0,r._)`+${k}`);return;case"integer":v.elseIf((0,r._)`${T} === "boolean" || ${k} === null
172
+ || (${T} === "string" && ${k} && ${k} == +${k} && !(${k} % 1))`).assign(L,(0,r._)`+${k}`);return;case"boolean":v.elseIf((0,r._)`${k} === "false" || ${k} === 0 || ${k} === null`).assign(L,!1).elseIf((0,r._)`${k} === "true" || ${k} === 1`).assign(L,!0);return;case"null":v.elseIf((0,r._)`${k} === "" || ${k} === 0 || ${k} === false`),v.assign(L,null);return;case"array":v.elseIf((0,r._)`${T} === "string" || ${T} === "number"
173
+ || ${T} === "boolean" || ${k} === null`).assign(L,(0,r._)`[${k}]`)}}}function d({gen:y,parentData:b,parentDataProperty:I},v){y.if((0,r._)`${b} !== undefined`,()=>y.assign((0,r._)`${b}[${I}]`,v))}function m(y,b,I,v=i.Correct){const k=v===i.Correct?r.operators.EQ:r.operators.NEQ;let A;switch(y){case"null":return(0,r._)`${b} ${k} null`;case"array":A=(0,r._)`Array.isArray(${b})`;break;case"object":A=(0,r._)`${b} && typeof ${b} == "object" && !Array.isArray(${b})`;break;case"integer":A=T((0,r._)`!(${b} % 1) && !isNaN(${b})`);break;case"number":A=T();break;default:return(0,r._)`typeof ${b} ${k} ${y}`}return v===i.Correct?A:(0,r.not)(A);function T(L=r.nil){return(0,r.and)((0,r._)`typeof ${b} == "number"`,L,I?(0,r._)`isFinite(${b})`:r.nil)}}Le.checkDataType=m;function _(y,b,I,v){if(y.length===1)return m(y[0],b,I,v);let k;const A=(0,s.toHash)(y);if(A.array&&A.object){const T=(0,r._)`typeof ${b} != "object"`;k=A.null?T:(0,r._)`!${b} || ${T}`,delete A.null,delete A.array,delete A.object}else k=r.nil;A.number&&delete A.integer;for(const T in A)k=(0,r.and)(k,m(T,b,I,v));return k}Le.checkDataTypes=_;const g={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:b})=>typeof y=="string"?(0,r._)`{type: ${y}}`:(0,r._)`{type: ${b}}`};function w(y){const b=$(y);(0,n.reportError)(b,g)}Le.reportTypeError=w;function $(y){const{gen:b,data:I,schema:v}=y,k=(0,s.schemaRefOrVal)(y,v,"type");return{gen:b,keyword:"type",data:I,schema:v.type,schemaCode:k,schemaValue:k,parentSchema:v,params:{},it:y}}return Le}var _n={},wo;function ty(){if(wo)return _n;wo=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.assignDefaults=void 0;const e=he(),t=ge();function n(s,i){const{properties:o,items:a}=s.schema;if(i==="object"&&o)for(const c in o)r(s,c,o[c].default);else i==="array"&&Array.isArray(a)&&a.forEach((c,l)=>r(s,l,c.default))}_n.assignDefaults=n;function r(s,i,o){const{gen:a,compositeRule:c,data:l,opts:h}=s;if(o===void 0)return;const p=(0,e._)`${l}${(0,e.getProperty)(i)}`;if(c){(0,t.checkStrictMode)(s,`default is ignored for: ${p}`);return}let d=(0,e._)`${p} === undefined`;h.useDefaults==="empty"&&(d=(0,e._)`${d} || ${p} === null || ${p} === ""`),a.if(d,(0,e._)`${p} = ${(0,e.stringify)(o)}`)}return _n}var at={},we={},vo;function lt(){if(vo)return we;vo=1,Object.defineProperty(we,"__esModule",{value:!0}),we.validateUnion=we.validateArray=we.usePattern=we.callValidateCode=we.schemaProperties=we.allSchemaProperties=we.noPropertyInData=we.propertyInData=we.isOwnProperty=we.hasPropFunc=we.reportMissingProp=we.checkMissingProp=we.checkReportMissingProp=void 0;const e=he(),t=ge(),n=Tt(),r=ge();function s(y,b){const{gen:I,data:v,it:k}=y;I.if(h(I,v,b,k.opts.ownProperties),()=>{y.setParams({missingProperty:(0,e._)`${b}`},!0),y.error()})}we.checkReportMissingProp=s;function i({gen:y,data:b,it:{opts:I}},v,k){return(0,e.or)(...v.map(A=>(0,e.and)(h(y,b,A,I.ownProperties),(0,e._)`${k} = ${A}`)))}we.checkMissingProp=i;function o(y,b){y.setParams({missingProperty:b},!0),y.error()}we.reportMissingProp=o;function a(y){return y.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}we.hasPropFunc=a;function c(y,b,I){return(0,e._)`${a(y)}.call(${b}, ${I})`}we.isOwnProperty=c;function l(y,b,I,v){const k=(0,e._)`${b}${(0,e.getProperty)(I)} !== undefined`;return v?(0,e._)`${k} && ${c(y,b,I)}`:k}we.propertyInData=l;function h(y,b,I,v){const k=(0,e._)`${b}${(0,e.getProperty)(I)} === undefined`;return v?(0,e.or)(k,(0,e.not)(c(y,b,I))):k}we.noPropertyInData=h;function p(y){return y?Object.keys(y).filter(b=>b!=="__proto__"):[]}we.allSchemaProperties=p;function d(y,b){return p(b).filter(I=>!(0,t.alwaysValidSchema)(y,b[I]))}we.schemaProperties=d;function m({schemaCode:y,data:b,it:{gen:I,topSchemaRef:v,schemaPath:k,errorPath:A},it:T},L,H,G){const Y=G?(0,e._)`${y}, ${b}, ${v}${k}`:b,se=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,A)],[n.default.parentData,T.parentData],[n.default.parentDataProperty,T.parentDataProperty],[n.default.rootData,n.default.rootData]];T.opts.dynamicRef&&se.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const le=(0,e._)`${Y}, ${I.object(...se)}`;return H!==e.nil?(0,e._)`${L}.call(${H}, ${le})`:(0,e._)`${L}(${le})`}we.callValidateCode=m;const _=(0,e._)`new RegExp`;function g({gen:y,it:{opts:b}},I){const v=b.unicodeRegExp?"u":"",{regExp:k}=b.code,A=k(I,v);return y.scopeValue("pattern",{key:A.toString(),ref:A,code:(0,e._)`${k.code==="new RegExp"?_:(0,r.useFunc)(y,k)}(${I}, ${v})`})}we.usePattern=g;function w(y){const{gen:b,data:I,keyword:v,it:k}=y,A=b.name("valid");if(k.allErrors){const L=b.let("valid",!0);return T(()=>b.assign(L,!1)),L}return b.var(A,!0),T(()=>b.break()),A;function T(L){const H=b.const("len",(0,e._)`${I}.length`);b.forRange("i",0,H,G=>{y.subschema({keyword:v,dataProp:G,dataPropType:t.Type.Num},A),b.if((0,e.not)(A),L)})}}we.validateArray=w;function $(y){const{gen:b,schema:I,keyword:v,it:k}=y;if(!Array.isArray(I))throw new Error("ajv implementation error");if(I.some(H=>(0,t.alwaysValidSchema)(k,H))&&!k.opts.unevaluated)return;const T=b.let("valid",!1),L=b.name("_valid");b.block(()=>I.forEach((H,G)=>{const Y=y.subschema({keyword:v,schemaProp:G,compositeRule:!0},L);b.assign(T,(0,e._)`${T} || ${L}`),y.mergeValidEvaluated(Y,L)||b.if((0,e.not)(T))})),y.result(T,()=>y.reset(),()=>y.error(!0))}return we.validateUnion=$,we}var _o;function ny(){if(_o)return at;_o=1,Object.defineProperty(at,"__esModule",{value:!0}),at.validateKeywordUsage=at.validSchemaType=at.funcKeywordCode=at.macroKeywordCode=void 0;const e=he(),t=Tt(),n=lt(),r=us();function s(d,m){const{gen:_,keyword:g,schema:w,parentSchema:$,it:y}=d,b=m.macro.call(y.self,w,$,y),I=l(_,g,b);y.opts.validateSchema!==!1&&y.self.validateSchema(b,!0);const v=_.name("valid");d.subschema({schema:b,schemaPath:e.nil,errSchemaPath:`${y.errSchemaPath}/${g}`,topSchemaRef:I,compositeRule:!0},v),d.pass(v,()=>d.error(!0))}at.macroKeywordCode=s;function i(d,m){var _;const{gen:g,keyword:w,schema:$,parentSchema:y,$data:b,it:I}=d;c(I,m);const v=!b&&m.compile?m.compile.call(I.self,$,y,I):m.validate,k=l(g,w,v),A=g.let("valid");d.block$data(A,T),d.ok((_=m.valid)!==null&&_!==void 0?_:A);function T(){if(m.errors===!1)G(),m.modifying&&o(d),Y(()=>d.error());else{const se=m.async?L():H();m.modifying&&o(d),Y(()=>a(d,se))}}function L(){const se=g.let("ruleErrs",null);return g.try(()=>G((0,e._)`await `),le=>g.assign(A,!1).if((0,e._)`${le} instanceof ${I.ValidationError}`,()=>g.assign(se,(0,e._)`${le}.errors`),()=>g.throw(le))),se}function H(){const se=(0,e._)`${k}.errors`;return g.assign(se,null),G(e.nil),se}function G(se=m.async?(0,e._)`await `:e.nil){const le=I.opts.passContext?t.default.this:t.default.self,M=!("compile"in m&&!b||m.schema===!1);g.assign(A,(0,e._)`${se}${(0,n.callValidateCode)(d,k,le,M)}`,m.modifying)}function Y(se){var le;g.if((0,e.not)((le=m.valid)!==null&&le!==void 0?le:A),se)}}at.funcKeywordCode=i;function o(d){const{gen:m,data:_,it:g}=d;m.if(g.parentData,()=>m.assign(_,(0,e._)`${g.parentData}[${g.parentDataProperty}]`))}function a(d,m){const{gen:_}=d;_.if((0,e._)`Array.isArray(${m})`,()=>{_.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${m} : ${t.default.vErrors}.concat(${m})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(d)},()=>d.error())}function c({schemaEnv:d},m){if(m.async&&!d.$async)throw new Error("async keyword in sync schema")}function l(d,m,_){if(_===void 0)throw new Error(`keyword "${m}" failed to compile`);return d.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,e.stringify)(_)})}function h(d,m,_=!1){return!m.length||m.some(g=>g==="array"?Array.isArray(d):g==="object"?d&&typeof d=="object"&&!Array.isArray(d):typeof d==g||_&&typeof d>"u")}at.validSchemaType=h;function p({schema:d,opts:m,self:_,errSchemaPath:g},w,$){if(Array.isArray(w.keyword)?!w.keyword.includes($):w.keyword!==$)throw new Error("ajv implementation error");const y=w.dependencies;if(y?.some(b=>!Object.prototype.hasOwnProperty.call(d,b)))throw new Error(`parent schema must have dependencies of ${$}: ${y.join(",")}`);if(w.validateSchema&&!w.validateSchema(d[$])){const I=`keyword "${$}" value is invalid at path "${g}": `+_.errorsText(w.validateSchema.errors);if(m.validateSchema==="log")_.logger.error(I);else throw new Error(I)}}return at.validateKeywordUsage=p,at}var pt={},bo;function ry(){if(bo)return pt;bo=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.extendSubschemaMode=pt.extendSubschemaData=pt.getSubschema=void 0;const e=he(),t=ge();function n(i,{keyword:o,schemaProp:a,schema:c,schemaPath:l,errSchemaPath:h,topSchemaRef:p}){if(o!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const d=i.schema[o];return a===void 0?{schema:d,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${o}`}:{schema:d[a],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(o)}${(0,e.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${o}/${(0,t.escapeFragment)(a)}`}}if(c!==void 0){if(l===void 0||h===void 0||p===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:l,topSchemaRef:p,errSchemaPath:h}}throw new Error('either "keyword" or "schema" must be passed')}pt.getSubschema=n;function r(i,o,{dataProp:a,dataPropType:c,data:l,dataTypes:h,propertyName:p}){if(l!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:d}=o;if(a!==void 0){const{errorPath:_,dataPathArr:g,opts:w}=o,$=d.let("data",(0,e._)`${o.data}${(0,e.getProperty)(a)}`,!0);m($),i.errorPath=(0,e.str)`${_}${(0,t.getErrorPath)(a,c,w.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${a}`,i.dataPathArr=[...g,i.parentDataProperty]}if(l!==void 0){const _=l instanceof e.Name?l:d.let("data",l,!0);m(_),p!==void 0&&(i.propertyName=p)}h&&(i.dataTypes=h);function m(_){i.data=_,i.dataLevel=o.dataLevel+1,i.dataTypes=[],o.definedProperties=new Set,i.parentData=o.data,i.dataNames=[...o.dataNames,_]}}pt.extendSubschemaData=r;function s(i,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:c,createErrors:l,allErrors:h}){c!==void 0&&(i.compositeRule=c),l!==void 0&&(i.createErrors=l),h!==void 0&&(i.allErrors=h),i.jtdDiscriminator=o,i.jtdMetadata=a}return pt.extendSubschemaMode=s,pt}var Je={},As,$o;function pu(){return $o||($o=1,As=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),As}var Ns={exports:{}},So;function sy(){if(So)return Ns.exports;So=1;var e=Ns.exports=function(r,s,i){typeof s=="function"&&(i=s,s={}),i=s.cb||i;var o=typeof i=="function"?i:i.pre||function(){},a=i.post||function(){};t(s,o,a,r,"",r)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.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 t(r,s,i,o,a,c,l,h,p,d){if(o&&typeof o=="object"&&!Array.isArray(o)){s(o,a,c,l,h,p,d);for(var m in o){var _=o[m];if(Array.isArray(_)){if(m in e.arrayKeywords)for(var g=0;g<_.length;g++)t(r,s,i,_[g],a+"/"+m+"/"+g,c,a,m,o,g)}else if(m in e.propsKeywords){if(_&&typeof _=="object")for(var w in _)t(r,s,i,_[w],a+"/"+m+"/"+n(w),c,a,m,o,w)}else(m in e.keywords||r.allKeys&&!(m in e.skipKeywords))&&t(r,s,i,_,a+"/"+m,c,a,m,o)}i(o,a,c,l,h,p,d)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return Ns.exports}var Eo;function ls(){if(Eo)return Je;Eo=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.getSchemaRefs=Je.resolveUrl=Je.normalizeId=Je._getFullPath=Je.getFullPath=Je.inlineRef=void 0;const e=ge(),t=pu(),n=sy(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(g,w=!0){return typeof g=="boolean"?!0:w===!0?!o(g):w?a(g)<=w:!1}Je.inlineRef=s;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(g){for(const w in g){if(i.has(w))return!0;const $=g[w];if(Array.isArray($)&&$.some(o)||typeof $=="object"&&o($))return!0}return!1}function a(g){let w=0;for(const $ in g){if($==="$ref")return 1/0;if(w++,!r.has($)&&(typeof g[$]=="object"&&(0,e.eachItem)(g[$],y=>w+=a(y)),w===1/0))return 1/0}return w}function c(g,w="",$){$!==!1&&(w=p(w));const y=g.parse(w);return l(g,y)}Je.getFullPath=c;function l(g,w){return g.serialize(w).split("#")[0]+"#"}Je._getFullPath=l;const h=/#\/?$/;function p(g){return g?g.replace(h,""):""}Je.normalizeId=p;function d(g,w,$){return $=p($),g.resolve(w,$)}Je.resolveUrl=d;const m=/^[a-z_][-a-z0-9._]*$/i;function _(g,w){if(typeof g=="boolean")return{};const{schemaId:$,uriResolver:y}=this.opts,b=p(g[$]||w),I={"":b},v=c(y,b,!1),k={},A=new Set;return n(g,{allKeys:!0},(H,G,Y,se)=>{if(se===void 0)return;const le=v+G;let M=I[se];typeof H[$]=="string"&&(M=W.call(this,H[$])),re.call(this,H.$anchor),re.call(this,H.$dynamicAnchor),I[G]=M;function W(ne){const oe=this.opts.uriResolver.resolve;if(ne=p(M?oe(M,ne):ne),A.has(ne))throw L(ne);A.add(ne);let V=this.refs[ne];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?T(H,V.schema,ne):ne!==p(le)&&(ne[0]==="#"?(T(H,k[ne],ne),k[ne]=H):this.refs[ne]=le),ne}function re(ne){if(typeof ne=="string"){if(!m.test(ne))throw new Error(`invalid anchor "${ne}"`);W.call(this,`#${ne}`)}}}),k;function T(H,G,Y){if(G!==void 0&&!t(H,G))throw L(Y)}function L(H){return new Error(`reference "${H}" resolves to more than one schema`)}}return Je.getSchemaRefs=_,Je}var ko;function fs(){if(ko)return dt;ko=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.getData=dt.KeywordCxt=dt.validateFunctionCode=void 0;const e=ey(),t=Hr(),n=hu(),r=Hr(),s=ty(),i=ny(),o=ry(),a=he(),c=Tt(),l=ls(),h=ge(),p=us();function d(x){if(v(x)&&(A(x),I(x))){w(x);return}m(x,()=>(0,e.topBoolOrEmptySchema)(x))}dt.validateFunctionCode=d;function m({gen:x,validateName:D,schema:q,schemaEnv:J,opts:ee},ae){ee.code.es5?x.func(D,(0,a._)`${c.default.data}, ${c.default.valCxt}`,J.$async,()=>{x.code((0,a._)`"use strict"; ${y(q,ee)}`),g(x,ee),x.code(ae)}):x.func(D,(0,a._)`${c.default.data}, ${_(ee)}`,J.$async,()=>x.code(y(q,ee)).code(ae))}function _(x){return(0,a._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${x.dynamicRef?(0,a._)`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}function g(x,D){x.if(c.default.valCxt,()=>{x.var(c.default.instancePath,(0,a._)`${c.default.valCxt}.${c.default.instancePath}`),x.var(c.default.parentData,(0,a._)`${c.default.valCxt}.${c.default.parentData}`),x.var(c.default.parentDataProperty,(0,a._)`${c.default.valCxt}.${c.default.parentDataProperty}`),x.var(c.default.rootData,(0,a._)`${c.default.valCxt}.${c.default.rootData}`),D.dynamicRef&&x.var(c.default.dynamicAnchors,(0,a._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{x.var(c.default.instancePath,(0,a._)`""`),x.var(c.default.parentData,(0,a._)`undefined`),x.var(c.default.parentDataProperty,(0,a._)`undefined`),x.var(c.default.rootData,c.default.data),D.dynamicRef&&x.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function w(x){const{schema:D,opts:q,gen:J}=x;m(x,()=>{q.$comment&&D.$comment&&se(x),H(x),J.let(c.default.vErrors,null),J.let(c.default.errors,0),q.unevaluated&&$(x),T(x),le(x)})}function $(x){const{gen:D,validateName:q}=x;x.evaluated=D.const("evaluated",(0,a._)`${q}.evaluated`),D.if((0,a._)`${x.evaluated}.dynamicProps`,()=>D.assign((0,a._)`${x.evaluated}.props`,(0,a._)`undefined`)),D.if((0,a._)`${x.evaluated}.dynamicItems`,()=>D.assign((0,a._)`${x.evaluated}.items`,(0,a._)`undefined`))}function y(x,D){const q=typeof x=="object"&&x[D.schemaId];return q&&(D.code.source||D.code.process)?(0,a._)`/*# sourceURL=${q} */`:a.nil}function b(x,D){if(v(x)&&(A(x),I(x))){k(x,D);return}(0,e.boolOrEmptySchema)(x,D)}function I({schema:x,self:D}){if(typeof x=="boolean")return!x;for(const q in x)if(D.RULES.all[q])return!0;return!1}function v(x){return typeof x.schema!="boolean"}function k(x,D){const{schema:q,gen:J,opts:ee}=x;ee.$comment&&q.$comment&&se(x),G(x),Y(x);const ae=J.const("_errs",c.default.errors);T(x,ae),J.var(D,(0,a._)`${ae} === ${c.default.errors}`)}function A(x){(0,h.checkUnknownRules)(x),L(x)}function T(x,D){if(x.opts.jtd)return W(x,[],!1,D);const q=(0,t.getSchemaTypes)(x.schema),J=(0,t.coerceAndCheckDataType)(x,q);W(x,q,!J,D)}function L(x){const{schema:D,errSchemaPath:q,opts:J,self:ee}=x;D.$ref&&J.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(D,ee.RULES)&&ee.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function H(x){const{schema:D,opts:q}=x;D.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,h.checkStrictMode)(x,"default is ignored in the schema root")}function G(x){const D=x.schema[x.opts.schemaId];D&&(x.baseId=(0,l.resolveUrl)(x.opts.uriResolver,x.baseId,D))}function Y(x){if(x.schema.$async&&!x.schemaEnv.$async)throw new Error("async schema in sync schema")}function se({gen:x,schemaEnv:D,schema:q,errSchemaPath:J,opts:ee}){const ae=q.$comment;if(ee.$comment===!0)x.code((0,a._)`${c.default.self}.logger.log(${ae})`);else if(typeof ee.$comment=="function"){const _e=(0,a.str)`${J}/$comment`,Re=x.scopeValue("root",{ref:D.root});x.code((0,a._)`${c.default.self}.opts.$comment(${ae}, ${_e}, ${Re}.schema)`)}}function le(x){const{gen:D,schemaEnv:q,validateName:J,ValidationError:ee,opts:ae}=x;q.$async?D.if((0,a._)`${c.default.errors} === 0`,()=>D.return(c.default.data),()=>D.throw((0,a._)`new ${ee}(${c.default.vErrors})`)):(D.assign((0,a._)`${J}.errors`,c.default.vErrors),ae.unevaluated&&M(x),D.return((0,a._)`${c.default.errors} === 0`))}function M({gen:x,evaluated:D,props:q,items:J}){q instanceof a.Name&&x.assign((0,a._)`${D}.props`,q),J instanceof a.Name&&x.assign((0,a._)`${D}.items`,J)}function W(x,D,q,J){const{gen:ee,schema:ae,data:_e,allErrors:Re,opts:qe,self:Me}=x,{RULES:Te}=Me;if(ae.$ref&&(qe.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(ae,Te))){ee.block(()=>X(x,"$ref",Te.all.$ref.definition));return}qe.jtd||ne(x,D),ee.block(()=>{for(const Ze of Te.rules)Ue(Ze);Ue(Te.post)});function Ue(Ze){(0,n.shouldUseGroup)(ae,Ze)&&(Ze.type?(ee.if((0,r.checkDataType)(Ze.type,_e,qe.strictNumbers)),re(x,Ze),D.length===1&&D[0]===Ze.type&&q&&(ee.else(),(0,r.reportTypeError)(x)),ee.endIf()):re(x,Ze),Re||ee.if((0,a._)`${c.default.errors} === ${J||0}`))}}function re(x,D){const{gen:q,schema:J,opts:{useDefaults:ee}}=x;ee&&(0,s.assignDefaults)(x,D.type),q.block(()=>{for(const ae of D.rules)(0,n.shouldUseRule)(J,ae)&&X(x,ae.keyword,ae.definition,D.type)})}function ne(x,D){x.schemaEnv.meta||!x.opts.strictTypes||(oe(x,D),x.opts.allowUnionTypes||V(x,D),P(x,x.dataTypes))}function oe(x,D){if(D.length){if(!x.dataTypes.length){x.dataTypes=D;return}D.forEach(q=>{B(x.dataTypes,q)||N(x,`type "${q}" not allowed by context "${x.dataTypes.join(",")}"`)}),E(x,D)}}function V(x,D){D.length>1&&!(D.length===2&&D.includes("null"))&&N(x,"use allowUnionTypes to allow union type keyword")}function P(x,D){const q=x.self.RULES.all;for(const J in q){const ee=q[J];if(typeof ee=="object"&&(0,n.shouldUseRule)(x.schema,ee)){const{type:ae}=ee.definition;ae.length&&!ae.some(_e=>j(D,_e))&&N(x,`missing type "${ae.join(",")}" for keyword "${J}"`)}}}function j(x,D){return x.includes(D)||D==="number"&&x.includes("integer")}function B(x,D){return x.includes(D)||D==="integer"&&x.includes("number")}function E(x,D){const q=[];for(const J of x.dataTypes)B(D,J)?q.push(J):D.includes("integer")&&J==="number"&&q.push("integer");x.dataTypes=q}function N(x,D){const q=x.schemaEnv.baseId+x.errSchemaPath;D+=` at "${q}" (strictTypes)`,(0,h.checkStrictMode)(x,D,x.opts.strictTypes)}class F{constructor(D,q,J){if((0,i.validateKeywordUsage)(D,q,J),this.gen=D.gen,this.allErrors=D.allErrors,this.keyword=J,this.data=D.data,this.schema=D.schema[J],this.$data=q.$data&&D.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(D,this.schema,J,this.$data),this.schemaType=q.schemaType,this.parentSchema=D.schema,this.params={},this.it=D,this.def=q,this.$data)this.schemaCode=D.gen.const("vSchema",ie(this.$data,D));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${J} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=D.gen.const("_errs",c.default.errors))}result(D,q,J){this.failResult((0,a.not)(D),q,J)}failResult(D,q,J){this.gen.if(D),J?J():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(D,q){this.failResult((0,a.not)(D),void 0,q)}fail(D){if(D===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(D),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(D){if(!this.$data)return this.fail(D);const{schemaCode:q}=this;this.fail((0,a._)`${q} !== undefined && (${(0,a.or)(this.invalid$data(),D)})`)}error(D,q,J){if(q){this.setParams(q),this._error(D,J),this.setParams({});return}this._error(D,J)}_error(D,q){(D?p.reportExtraError:p.reportError)(this,this.def.error,q)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(D){this.allErrors||this.gen.if(D)}setParams(D,q){q?Object.assign(this.params,D):this.params=D}block$data(D,q,J=a.nil){this.gen.block(()=>{this.check$data(D,J),q()})}check$data(D=a.nil,q=a.nil){if(!this.$data)return;const{gen:J,schemaCode:ee,schemaType:ae,def:_e}=this;J.if((0,a.or)((0,a._)`${ee} === undefined`,q)),D!==a.nil&&J.assign(D,!0),(ae.length||_e.validateSchema)&&(J.elseIf(this.invalid$data()),this.$dataError(),D!==a.nil&&J.assign(D,!1)),J.else()}invalid$data(){const{gen:D,schemaCode:q,schemaType:J,def:ee,it:ae}=this;return(0,a.or)(_e(),Re());function _e(){if(J.length){if(!(q instanceof a.Name))throw new Error("ajv implementation error");const qe=Array.isArray(J)?J:[J];return(0,a._)`${(0,r.checkDataTypes)(qe,q,ae.opts.strictNumbers,r.DataType.Wrong)}`}return a.nil}function Re(){if(ee.validateSchema){const qe=D.scopeValue("validate$data",{ref:ee.validateSchema});return(0,a._)`!${qe}(${q})`}return a.nil}}subschema(D,q){const J=(0,o.getSubschema)(this.it,D);(0,o.extendSubschemaData)(J,this.it,D),(0,o.extendSubschemaMode)(J,D);const ee={...this.it,...J,items:void 0,props:void 0};return b(ee,q),ee}mergeEvaluated(D,q){const{it:J,gen:ee}=this;J.opts.unevaluated&&(J.props!==!0&&D.props!==void 0&&(J.props=h.mergeEvaluated.props(ee,D.props,J.props,q)),J.items!==!0&&D.items!==void 0&&(J.items=h.mergeEvaluated.items(ee,D.items,J.items,q)))}mergeValidEvaluated(D,q){const{it:J,gen:ee}=this;if(J.opts.unevaluated&&(J.props!==!0||J.items!==!0))return ee.if(q,()=>this.mergeEvaluated(D,a.Name)),!0}}dt.KeywordCxt=F;function X(x,D,q,J){const ee=new F(x,q,D);"code"in q?q.code(ee,J):ee.$data&&q.validate?(0,i.funcKeywordCode)(ee,q):"macro"in q?(0,i.macroKeywordCode)(ee,q):(q.compile||q.validate)&&(0,i.funcKeywordCode)(ee,q)}const Q=/^\/(?:[^~]|~0|~1)*$/,fe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ie(x,{dataLevel:D,dataNames:q,dataPathArr:J}){let ee,ae;if(x==="")return c.default.rootData;if(x[0]==="/"){if(!Q.test(x))throw new Error(`Invalid JSON-pointer: ${x}`);ee=x,ae=c.default.rootData}else{const Me=fe.exec(x);if(!Me)throw new Error(`Invalid JSON-pointer: ${x}`);const Te=+Me[1];if(ee=Me[2],ee==="#"){if(Te>=D)throw new Error(qe("property/index",Te));return J[D-Te]}if(Te>D)throw new Error(qe("data",Te));if(ae=q[D-Te],!ee)return ae}let _e=ae;const Re=ee.split("/");for(const Me of Re)Me&&(ae=(0,a._)`${ae}${(0,a.getProperty)((0,h.unescapeJsonPointer)(Me))}`,_e=(0,a._)`${_e} && ${ae}`);return _e;function qe(Me,Te){return`Cannot access ${Me} ${Te} levels up, current level is ${D}`}}return dt.getData=ie,dt}var Qn={},Io;function yi(){if(Io)return Qn;Io=1,Object.defineProperty(Qn,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Qn.default=e,Qn}var Xn={},Oo;function ds(){if(Oo)return Xn;Oo=1,Object.defineProperty(Xn,"__esModule",{value:!0});const e=ls();class t extends Error{constructor(r,s,i,o){super(o||`can't resolve reference ${i} from id ${s}`),this.missingRef=(0,e.resolveUrl)(r,s,i),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}return Xn.default=t,Xn}var et={},Ao;function wi(){if(Ao)return et;Ao=1,Object.defineProperty(et,"__esModule",{value:!0}),et.resolveSchema=et.getCompilingSchema=et.resolveRef=et.compileSchema=et.SchemaEnv=void 0;const e=he(),t=yi(),n=Tt(),r=ls(),s=ge(),i=fs();class o{constructor($){var y;this.refs={},this.dynamicAnchors={};let b;typeof $.schema=="object"&&(b=$.schema),this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(y=$.baseId)!==null&&y!==void 0?y:(0,r.normalizeId)(b?.[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=b?.$async,this.refs={}}}et.SchemaEnv=o;function a(w){const $=h.call(this,w);if($)return $;const y=(0,r.getFullPath)(this.opts.uriResolver,w.root.baseId),{es5:b,lines:I}=this.opts.code,{ownProperties:v}=this.opts,k=new e.CodeGen(this.scope,{es5:b,lines:I,ownProperties:v});let A;w.$async&&(A=k.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const T=k.scopeName("validate");w.validateName=T;const L={gen:k,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:k.scopeValue("schema",this.opts.code.source===!0?{ref:w.schema,code:(0,e.stringify)(w.schema)}:{ref:w.schema}),validateName:T,ValidationError:A,schema:w.schema,schemaEnv:w,rootId:y,baseId:w.baseId||y,schemaPath:e.nil,errSchemaPath:w.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let H;try{this._compilations.add(w),(0,i.validateFunctionCode)(L),k.optimize(this.opts.code.optimize);const G=k.toString();H=`${k.scopeRefs(n.default.scope)}return ${G}`,this.opts.code.process&&(H=this.opts.code.process(H,w));const se=new Function(`${n.default.self}`,`${n.default.scope}`,H)(this,this.scope.get());if(this.scope.value(T,{ref:se}),se.errors=null,se.schema=w.schema,se.schemaEnv=w,w.$async&&(se.$async=!0),this.opts.code.source===!0&&(se.source={validateName:T,validateCode:G,scopeValues:k._values}),this.opts.unevaluated){const{props:le,items:M}=L;se.evaluated={props:le instanceof e.Name?void 0:le,items:M instanceof e.Name?void 0:M,dynamicProps:le instanceof e.Name,dynamicItems:M instanceof e.Name},se.source&&(se.source.evaluated=(0,e.stringify)(se.evaluated))}return w.validate=se,w}catch(G){throw delete w.validate,delete w.validateName,H&&this.logger.error("Error compiling schema, function code:",H),G}finally{this._compilations.delete(w)}}et.compileSchema=a;function c(w,$,y){var b;y=(0,r.resolveUrl)(this.opts.uriResolver,$,y);const I=w.refs[y];if(I)return I;let v=d.call(this,w,y);if(v===void 0){const k=(b=w.localRefs)===null||b===void 0?void 0:b[y],{schemaId:A}=this.opts;k&&(v=new o({schema:k,schemaId:A,root:w,baseId:$}))}if(v!==void 0)return w.refs[y]=l.call(this,v)}et.resolveRef=c;function l(w){return(0,r.inlineRef)(w.schema,this.opts.inlineRefs)?w.schema:w.validate?w:a.call(this,w)}function h(w){for(const $ of this._compilations)if(p($,w))return $}et.getCompilingSchema=h;function p(w,$){return w.schema===$.schema&&w.root===$.root&&w.baseId===$.baseId}function d(w,$){let y;for(;typeof(y=this.refs[$])=="string";)$=y;return y||this.schemas[$]||m.call(this,w,$)}function m(w,$){const y=this.opts.uriResolver.parse($),b=(0,r._getFullPath)(this.opts.uriResolver,y);let I=(0,r.getFullPath)(this.opts.uriResolver,w.baseId,void 0);if(Object.keys(w.schema).length>0&&b===I)return g.call(this,y,w);const v=(0,r.normalizeId)(b),k=this.refs[v]||this.schemas[v];if(typeof k=="string"){const A=m.call(this,w,k);return typeof A?.schema!="object"?void 0:g.call(this,y,A)}if(typeof k?.schema=="object"){if(k.validate||a.call(this,k),v===(0,r.normalizeId)($)){const{schema:A}=k,{schemaId:T}=this.opts,L=A[T];return L&&(I=(0,r.resolveUrl)(this.opts.uriResolver,I,L)),new o({schema:A,schemaId:T,root:w,baseId:I})}return g.call(this,y,k)}}et.resolveSchema=m;const _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(w,{baseId:$,schema:y,root:b}){var I;if(((I=w.fragment)===null||I===void 0?void 0:I[0])!=="/")return;for(const A of w.fragment.slice(1).split("/")){if(typeof y=="boolean")return;const T=y[(0,s.unescapeFragment)(A)];if(T===void 0)return;y=T;const L=typeof y=="object"&&y[this.opts.schemaId];!_.has(A)&&L&&($=(0,r.resolveUrl)(this.opts.uriResolver,$,L))}let v;if(typeof y!="boolean"&&y.$ref&&!(0,s.schemaHasRulesButRef)(y,this.RULES)){const A=(0,r.resolveUrl)(this.opts.uriResolver,$,y.$ref);v=m.call(this,b,A)}const{schemaId:k}=this.opts;if(v=v||new o({schema:y,schemaId:k,root:b,baseId:$}),v.schema!==v.root.schema)return v}return et}const iy="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",oy="Meta-schema for $data reference (JSON AnySchema extension proposal)",ay="object",cy=["$data"],uy={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ly=!1;var fy={$id:iy,description:oy,type:ay,required:cy,properties:uy,additionalProperties:ly},er={},bn={exports:{}},Ts,No;function mu(){if(No)return Ts;No=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=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);function n(d){let m="",_=0,g=0;for(g=0;g<d.length;g++)if(_=d[g].charCodeAt(0),_!==48){if(!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";m+=d[g];break}for(g+=1;g<d.length;g++){if(_=d[g].charCodeAt(0),!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";m+=d[g]}return m}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(d){return d.length=0,!0}function i(d,m,_){if(d.length){const g=n(d);if(g!=="")m.push(g);else return _.error=!0,!1;d.length=0}return!0}function o(d){let m=0;const _={error:!1,address:"",zone:""},g=[],w=[];let $=!1,y=!1,b=i;for(let I=0;I<d.length;I++){const v=d[I];if(!(v==="["||v==="]"))if(v===":"){if($===!0&&(y=!0),!b(w,g,_))break;if(++m>7){_.error=!0;break}I>0&&d[I-1]===":"&&($=!0),g.push(":");continue}else if(v==="%"){if(!b(w,g,_))break;b=s}else{w.push(v);continue}}return w.length&&(b===s?_.zone=w.join(""):y?g.push(w.join("")):g.push(n(w))),_.address=g.join(""),_}function a(d){if(c(d,":")<2)return{host:d,isIPV6:!1};const m=o(d);if(m.error)return{host:d,isIPV6:!1};{let _=m.address,g=m.address;return m.zone&&(_+="%"+m.zone,g+="%25"+m.zone),{host:_,isIPV6:!0,escapedHost:g}}}function c(d,m){let _=0;for(let g=0;g<d.length;g++)d[g]===m&&_++;return _}function l(d){let m=d;const _=[];let g=-1,w=0;for(;w=m.length;){if(w===1){if(m===".")break;if(m==="/"){_.push("/");break}else{_.push(m);break}}else if(w===2){if(m[0]==="."){if(m[1]===".")break;if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&(m[1]==="."||m[1]==="/")){_.push("/");break}}else if(w===3&&m==="/.."){_.length!==0&&_.pop(),_.push("/");break}if(m[0]==="."){if(m[1]==="."){if(m[2]==="/"){m=m.slice(3);continue}}else if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&m[1]==="."){if(m[2]==="/"){m=m.slice(2);continue}else if(m[2]==="."&&m[3]==="/"){m=m.slice(3),_.length!==0&&_.pop();continue}}if((g=m.indexOf("/",1))===-1){_.push(m);break}else _.push(m.slice(0,g)),m=m.slice(g)}return _.join("")}function h(d,m){const _=m!==!0?escape:unescape;return d.scheme!==void 0&&(d.scheme=_(d.scheme)),d.userinfo!==void 0&&(d.userinfo=_(d.userinfo)),d.host!==void 0&&(d.host=_(d.host)),d.path!==void 0&&(d.path=_(d.path)),d.query!==void 0&&(d.query=_(d.query)),d.fragment!==void 0&&(d.fragment=_(d.fragment)),d}function p(d){const m=[];if(d.userinfo!==void 0&&(m.push(d.userinfo),m.push("@")),d.host!==void 0){let _=unescape(d.host);if(!t(_)){const g=a(_);g.isIPV6===!0?_=`[${g.escapedHost}]`:_=d.host}m.push(_)}return(typeof d.port=="number"||typeof d.port=="string")&&(m.push(":"),m.push(String(d.port))),m.length?m.join(""):void 0}return Ts={nonSimpleDomain:r,recomposeAuthority:p,normalizeComponentEncoding:h,removeDotSegments:l,isIPv4:t,isUUID:e,normalizeIPv6:a,stringArrayToHexStripped:n},Ts}var Ps,To;function dy(){if(To)return Ps;To=1;const{isUUID:e}=mu(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(v){return n.indexOf(v)!==-1}function s(v){return v.secure===!0?!0:v.secure===!1?!1:v.scheme?v.scheme.length===3&&(v.scheme[0]==="w"||v.scheme[0]==="W")&&(v.scheme[1]==="s"||v.scheme[1]==="S")&&(v.scheme[2]==="s"||v.scheme[2]==="S"):!1}function i(v){return v.host||(v.error=v.error||"HTTP URIs must have a host."),v}function o(v){const k=String(v.scheme).toLowerCase()==="https";return(v.port===(k?443:80)||v.port==="")&&(v.port=void 0),v.path||(v.path="/"),v}function a(v){return v.secure=s(v),v.resourceName=(v.path||"/")+(v.query?"?"+v.query:""),v.path=void 0,v.query=void 0,v}function c(v){if((v.port===(s(v)?443:80)||v.port==="")&&(v.port=void 0),typeof v.secure=="boolean"&&(v.scheme=v.secure?"wss":"ws",v.secure=void 0),v.resourceName){const[k,A]=v.resourceName.split("?");v.path=k&&k!=="/"?k:void 0,v.query=A,v.resourceName=void 0}return v.fragment=void 0,v}function l(v,k){if(!v.path)return v.error="URN can not be parsed",v;const A=v.path.match(t);if(A){const T=k.scheme||v.scheme||"urn";v.nid=A[1].toLowerCase(),v.nss=A[2];const L=`${T}:${k.nid||v.nid}`,H=I(L);v.path=void 0,H&&(v=H.parse(v,k))}else v.error=v.error||"URN can not be parsed.";return v}function h(v,k){if(v.nid===void 0)throw new Error("URN without nid cannot be serialized");const A=k.scheme||v.scheme||"urn",T=v.nid.toLowerCase(),L=`${A}:${k.nid||T}`,H=I(L);H&&(v=H.serialize(v,k));const G=v,Y=v.nss;return G.path=`${T||k.nid}:${Y}`,k.skipEscape=!0,G}function p(v,k){const A=v;return A.uuid=A.nss,A.nss=void 0,!k.tolerant&&(!A.uuid||!e(A.uuid))&&(A.error=A.error||"UUID is not valid."),A}function d(v){const k=v;return k.nss=(v.uuid||"").toLowerCase(),k}const m={scheme:"http",domainHost:!0,parse:i,serialize:o},_={scheme:"https",domainHost:m.domainHost,parse:i,serialize:o},g={scheme:"ws",domainHost:!0,parse:a,serialize:c},w={scheme:"wss",domainHost:g.domainHost,parse:g.parse,serialize:g.serialize},b={http:m,https:_,ws:g,wss:w,urn:{scheme:"urn",parse:l,serialize:h,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:p,serialize:d,skipNormalize:!0}};Object.setPrototypeOf(b,null);function I(v){return v&&(b[v]||b[v.toLowerCase()])||void 0}return Ps={wsIsSecure:s,SCHEMES:b,isValidSchemeName:r,getSchemeHandler:I},Ps}var Po;function hy(){if(Po)return bn.exports;Po=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:s,nonSimpleDomain:i}=mu(),{SCHEMES:o,getSchemeHandler:a}=dy();function c(w,$){return typeof w=="string"?w=d(_(w,$),$):typeof w=="object"&&(w=_(d(w,$),$)),w}function l(w,$,y){const b=y?Object.assign({scheme:"null"},y):{scheme:"null"},I=h(_(w,b),_($,b),b,!0);return b.skipEscape=!0,d(I,b)}function h(w,$,y,b){const I={};return b||(w=_(d(w,y),y),$=_(d($,y),y)),y=y||{},!y.tolerant&&$.scheme?(I.scheme=$.scheme,I.userinfo=$.userinfo,I.host=$.host,I.port=$.port,I.path=t($.path||""),I.query=$.query):($.userinfo!==void 0||$.host!==void 0||$.port!==void 0?(I.userinfo=$.userinfo,I.host=$.host,I.port=$.port,I.path=t($.path||""),I.query=$.query):($.path?($.path[0]==="/"?I.path=t($.path):((w.userinfo!==void 0||w.host!==void 0||w.port!==void 0)&&!w.path?I.path="/"+$.path:w.path?I.path=w.path.slice(0,w.path.lastIndexOf("/")+1)+$.path:I.path=$.path,I.path=t(I.path)),I.query=$.query):(I.path=w.path,$.query!==void 0?I.query=$.query:I.query=w.query),I.userinfo=w.userinfo,I.host=w.host,I.port=w.port),I.scheme=w.scheme),I.fragment=$.fragment,I}function p(w,$,y){return typeof w=="string"?(w=unescape(w),w=d(r(_(w,y),!0),{...y,skipEscape:!0})):typeof w=="object"&&(w=d(r(w,!0),{...y,skipEscape:!0})),typeof $=="string"?($=unescape($),$=d(r(_($,y),!0),{...y,skipEscape:!0})):typeof $=="object"&&($=d(r($,!0),{...y,skipEscape:!0})),w.toLowerCase()===$.toLowerCase()}function d(w,$){const y={host:w.host,scheme:w.scheme,userinfo:w.userinfo,port:w.port,path:w.path,query:w.query,nid:w.nid,nss:w.nss,uuid:w.uuid,fragment:w.fragment,reference:w.reference,resourceName:w.resourceName,secure:w.secure,error:""},b=Object.assign({},$),I=[],v=a(b.scheme||y.scheme);v&&v.serialize&&v.serialize(y,b),y.path!==void 0&&(b.skipEscape?y.path=unescape(y.path):(y.path=escape(y.path),y.scheme!==void 0&&(y.path=y.path.split("%3A").join(":")))),b.reference!=="suffix"&&y.scheme&&I.push(y.scheme,":");const k=n(y);if(k!==void 0&&(b.reference!=="suffix"&&I.push("//"),I.push(k),y.path&&y.path[0]!=="/"&&I.push("/")),y.path!==void 0){let A=y.path;!b.absolutePath&&(!v||!v.absolutePath)&&(A=t(A)),k===void 0&&A[0]==="/"&&A[1]==="/"&&(A="/%2F"+A.slice(2)),I.push(A)}return y.query!==void 0&&I.push("?",y.query),y.fragment!==void 0&&I.push("#",y.fragment),I.join("")}const m=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _(w,$){const y=Object.assign({},$),b={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let I=!1;y.reference==="suffix"&&(y.scheme?w=y.scheme+":"+w:w="//"+w);const v=w.match(m);if(v){if(b.scheme=v[1],b.userinfo=v[3],b.host=v[4],b.port=parseInt(v[5],10),b.path=v[6]||"",b.query=v[7],b.fragment=v[8],isNaN(b.port)&&(b.port=v[5]),b.host)if(s(b.host)===!1){const T=e(b.host);b.host=T.host.toLowerCase(),I=T.isIPV6}else I=!0;b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&b.query===void 0&&!b.path?b.reference="same-document":b.scheme===void 0?b.reference="relative":b.fragment===void 0?b.reference="absolute":b.reference="uri",y.reference&&y.reference!=="suffix"&&y.reference!==b.reference&&(b.error=b.error||"URI is not a "+y.reference+" reference.");const k=a(y.scheme||b.scheme);if(!y.unicodeSupport&&(!k||!k.unicodeSupport)&&b.host&&(y.domainHost||k&&k.domainHost)&&I===!1&&i(b.host))try{b.host=URL.domainToASCII(b.host.toLowerCase())}catch(A){b.error=b.error||"Host's domain name can not be converted to ASCII: "+A}(!k||k&&!k.skipNormalize)&&(w.indexOf("%")!==-1&&(b.scheme!==void 0&&(b.scheme=unescape(b.scheme)),b.host!==void 0&&(b.host=unescape(b.host))),b.path&&(b.path=escape(unescape(b.path))),b.fragment&&(b.fragment=encodeURI(decodeURIComponent(b.fragment)))),k&&k.parse&&k.parse(b,y)}else b.error=b.error||"URI can not be parsed.";return b}const g={SCHEMES:o,normalize:c,resolve:l,resolveComponent:h,equal:p,serialize:d,parse:_};return bn.exports=g,bn.exports.default=g,bn.exports.fastUri=g,bn.exports}var Co;function py(){if(Co)return er;Co=1,Object.defineProperty(er,"__esModule",{value:!0});const e=hy();return e.code='require("ajv/dist/runtime/uri").default',er.default=e,er}var xo;function my(){return xo||(xo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=fs();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=he();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=yi(),s=ds(),i=du(),o=wi(),a=he(),c=ls(),l=Hr(),h=ge(),p=fy,d=py(),m=(V,P)=>new RegExp(V,P);m.code="new RegExp";const _=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={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."},$={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},y=200;function b(V){var P,j,B,E,N,F,X,Q,fe,ie,x,D,q,J,ee,ae,_e,Re,qe,Me,Te,Ue,Ze,mn,tt;const Pt=V.strict,S=(P=V.code)===null||P===void 0?void 0:P.optimize,u=S===!0||S===void 0?1:S||0,f=(B=(j=V.code)===null||j===void 0?void 0:j.regExp)!==null&&B!==void 0?B:m,O=(E=V.uriResolver)!==null&&E!==void 0?E:d.default;return{strictSchema:(F=(N=V.strictSchema)!==null&&N!==void 0?N:Pt)!==null&&F!==void 0?F:!0,strictNumbers:(Q=(X=V.strictNumbers)!==null&&X!==void 0?X:Pt)!==null&&Q!==void 0?Q:!0,strictTypes:(ie=(fe=V.strictTypes)!==null&&fe!==void 0?fe:Pt)!==null&&ie!==void 0?ie:"log",strictTuples:(D=(x=V.strictTuples)!==null&&x!==void 0?x:Pt)!==null&&D!==void 0?D:"log",strictRequired:(J=(q=V.strictRequired)!==null&&q!==void 0?q:Pt)!==null&&J!==void 0?J:!1,code:V.code?{...V.code,optimize:u,regExp:f}:{optimize:u,regExp:f},loopRequired:(ee=V.loopRequired)!==null&&ee!==void 0?ee:y,loopEnum:(ae=V.loopEnum)!==null&&ae!==void 0?ae:y,meta:(_e=V.meta)!==null&&_e!==void 0?_e:!0,messages:(Re=V.messages)!==null&&Re!==void 0?Re:!0,inlineRefs:(qe=V.inlineRefs)!==null&&qe!==void 0?qe:!0,schemaId:(Me=V.schemaId)!==null&&Me!==void 0?Me:"$id",addUsedSchema:(Te=V.addUsedSchema)!==null&&Te!==void 0?Te:!0,validateSchema:(Ue=V.validateSchema)!==null&&Ue!==void 0?Ue:!0,validateFormats:(Ze=V.validateFormats)!==null&&Ze!==void 0?Ze:!0,unicodeRegExp:(mn=V.unicodeRegExp)!==null&&mn!==void 0?mn:!0,int32range:(tt=V.int32range)!==null&&tt!==void 0?tt:!0,uriResolver:O}}class I{constructor(P={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,P=this.opts={...P,...b(P)};const{es5:j,lines:B}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:g,es5:j,lines:B}),this.logger=Y(P.logger);const E=P.validateFormats;P.validateFormats=!1,this.RULES=(0,i.getRules)(),v.call(this,w,P,"NOT SUPPORTED"),v.call(this,$,P,"DEPRECATED","warn"),this._metaOpts=H.call(this),P.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),P.keywords&&L.call(this,P.keywords),typeof P.meta=="object"&&this.addMetaSchema(P.meta),A.call(this),P.validateFormats=E}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:P,meta:j,schemaId:B}=this.opts;let E=p;B==="id"&&(E={...p},E.id=E.$id,delete E.$id),j&&P&&this.addMetaSchema(E,E[B],!1)}defaultMeta(){const{meta:P,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof P=="object"?P[j]||P:void 0}validate(P,j){let B;if(typeof P=="string"){if(B=this.getSchema(P),!B)throw new Error(`no schema with key or ref "${P}"`)}else B=this.compile(P);const E=B(j);return"$async"in B||(this.errors=B.errors),E}compile(P,j){const B=this._addSchema(P,j);return B.validate||this._compileSchemaEnv(B)}compileAsync(P,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:B}=this.opts;return E.call(this,P,j);async function E(ie,x){await N.call(this,ie.$schema);const D=this._addSchema(ie,x);return D.validate||F.call(this,D)}async function N(ie){ie&&!this.getSchema(ie)&&await E.call(this,{$ref:ie},!0)}async function F(ie){try{return this._compileSchemaEnv(ie)}catch(x){if(!(x instanceof s.default))throw x;return X.call(this,x),await Q.call(this,x.missingSchema),F.call(this,ie)}}function X({missingSchema:ie,missingRef:x}){if(this.refs[ie])throw new Error(`AnySchema ${ie} is loaded but ${x} cannot be resolved`)}async function Q(ie){const x=await fe.call(this,ie);this.refs[ie]||await N.call(this,x.$schema),this.refs[ie]||this.addSchema(x,ie,j)}async function fe(ie){const x=this._loading[ie];if(x)return x;try{return await(this._loading[ie]=B(ie))}finally{delete this._loading[ie]}}}addSchema(P,j,B,E=this.opts.validateSchema){if(Array.isArray(P)){for(const F of P)this.addSchema(F,void 0,B,E);return this}let N;if(typeof P=="object"){const{schemaId:F}=this.opts;if(N=P[F],N!==void 0&&typeof N!="string")throw new Error(`schema ${F} must be string`)}return j=(0,c.normalizeId)(j||N),this._checkUnique(j),this.schemas[j]=this._addSchema(P,B,j,E,!0),this}addMetaSchema(P,j,B=this.opts.validateSchema){return this.addSchema(P,j,!0,B),this}validateSchema(P,j){if(typeof P=="boolean")return!0;let B;if(B=P.$schema,B!==void 0&&typeof B!="string")throw new Error("$schema must be a string");if(B=B||this.opts.defaultMeta||this.defaultMeta(),!B)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const E=this.validate(B,P);if(!E&&j){const N="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(N);else throw new Error(N)}return E}getSchema(P){let j;for(;typeof(j=k.call(this,P))=="string";)P=j;if(j===void 0){const{schemaId:B}=this.opts,E=new o.SchemaEnv({schema:{},schemaId:B});if(j=o.resolveSchema.call(this,E,P),!j)return;this.refs[P]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(P){if(P instanceof RegExp)return this._removeAllSchemas(this.schemas,P),this._removeAllSchemas(this.refs,P),this;switch(typeof P){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const j=k.call(this,P);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[P],delete this.refs[P],this}case"object":{const j=P;this._cache.delete(j);let B=P[this.opts.schemaId];return B&&(B=(0,c.normalizeId)(B),delete this.schemas[B],delete this.refs[B]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(P){for(const j of P)this.addKeyword(j);return this}addKeyword(P,j){let B;if(typeof P=="string")B=P,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=B);else if(typeof P=="object"&&j===void 0){if(j=P,B=j.keyword,Array.isArray(B)&&!B.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(le.call(this,B,j),!j)return(0,h.eachItem)(B,N=>M.call(this,N)),this;re.call(this,j);const E={...j,type:(0,l.getJSONTypes)(j.type),schemaType:(0,l.getJSONTypes)(j.schemaType)};return(0,h.eachItem)(B,E.type.length===0?N=>M.call(this,N,E):N=>E.type.forEach(F=>M.call(this,N,E,F))),this}getKeyword(P){const j=this.RULES.all[P];return typeof j=="object"?j.definition:!!j}removeKeyword(P){const{RULES:j}=this;delete j.keywords[P],delete j.all[P];for(const B of j.rules){const E=B.rules.findIndex(N=>N.keyword===P);E>=0&&B.rules.splice(E,1)}return this}addFormat(P,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[P]=j,this}errorsText(P=this.errors,{separator:j=", ",dataVar:B="data"}={}){return!P||P.length===0?"No errors":P.map(E=>`${B}${E.instancePath} ${E.message}`).reduce((E,N)=>E+j+N)}$dataMetaSchema(P,j){const B=this.RULES.all;P=JSON.parse(JSON.stringify(P));for(const E of j){const N=E.split("/").slice(1);let F=P;for(const X of N)F=F[X];for(const X in B){const Q=B[X];if(typeof Q!="object")continue;const{$data:fe}=Q.definition,ie=F[X];fe&&ie&&(F[X]=oe(ie))}}return P}_removeAllSchemas(P,j){for(const B in P){const E=P[B];(!j||j.test(B))&&(typeof E=="string"?delete P[B]:E&&!E.meta&&(this._cache.delete(E.schema),delete P[B]))}}_addSchema(P,j,B,E=this.opts.validateSchema,N=this.opts.addUsedSchema){let F;const{schemaId:X}=this.opts;if(typeof P=="object")F=P[X];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof P!="boolean")throw new Error("schema must be object or boolean")}let Q=this._cache.get(P);if(Q!==void 0)return Q;B=(0,c.normalizeId)(F||B);const fe=c.getSchemaRefs.call(this,P,B);return Q=new o.SchemaEnv({schema:P,schemaId:X,meta:j,baseId:B,localRefs:fe}),this._cache.set(Q.schema,Q),N&&!B.startsWith("#")&&(B&&this._checkUnique(B),this.refs[B]=Q),E&&this.validateSchema(P,!0),Q}_checkUnique(P){if(this.schemas[P]||this.refs[P])throw new Error(`schema with key or id "${P}" already exists`)}_compileSchemaEnv(P){if(P.meta?this._compileMetaSchema(P):o.compileSchema.call(this,P),!P.validate)throw new Error("ajv implementation error");return P.validate}_compileMetaSchema(P){const j=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,P)}finally{this.opts=j}}}I.ValidationError=r.default,I.MissingRefError=s.default,e.default=I;function v(V,P,j,B="error"){for(const E in V){const N=E;N in P&&this.logger[B](`${j}: option ${E}. ${V[N]}`)}}function k(V){return V=(0,c.normalizeId)(V),this.schemas[V]||this.refs[V]}function A(){const V=this.opts.schemas;if(V)if(Array.isArray(V))this.addSchema(V);else for(const P in V)this.addSchema(V[P],P)}function T(){for(const V in this.opts.formats){const P=this.opts.formats[V];P&&this.addFormat(V,P)}}function L(V){if(Array.isArray(V)){this.addVocabulary(V);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const P in V){const j=V[P];j.keyword||(j.keyword=P),this.addKeyword(j)}}function H(){const V={...this.opts};for(const P of _)delete V[P];return V}const G={log(){},warn(){},error(){}};function Y(V){if(V===!1)return G;if(V===void 0)return console;if(V.log&&V.warn&&V.error)return V;throw new Error("logger must implement log, warn and error methods")}const se=/^[a-z_$][a-z0-9_$:-]*$/i;function le(V,P){const{RULES:j}=this;if((0,h.eachItem)(V,B=>{if(j.keywords[B])throw new Error(`Keyword ${B} is already defined`);if(!se.test(B))throw new Error(`Keyword ${B} has invalid name`)}),!!P&&P.$data&&!("code"in P||"validate"in P))throw new Error('$data keyword must have "code" or "validate" function')}function M(V,P,j){var B;const E=P?.post;if(j&&E)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:N}=this;let F=E?N.post:N.rules.find(({type:Q})=>Q===j);if(F||(F={type:j,rules:[]},N.rules.push(F)),N.keywords[V]=!0,!P)return;const X={keyword:V,definition:{...P,type:(0,l.getJSONTypes)(P.type),schemaType:(0,l.getJSONTypes)(P.schemaType)}};P.before?W.call(this,F,X,P.before):F.rules.push(X),N.all[V]=X,(B=P.implements)===null||B===void 0||B.forEach(Q=>this.addKeyword(Q))}function W(V,P,j){const B=V.rules.findIndex(E=>E.keyword===j);B>=0?V.rules.splice(B,0,P):(V.rules.push(P),this.logger.warn(`rule ${j} is not defined`))}function re(V){let{metaSchema:P}=V;P!==void 0&&(V.$data&&this.opts.$data&&(P=oe(P)),V.validateSchema=this.compile(P,!0))}const ne={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function oe(V){return{anyOf:[V,ne]}}})(Ss)),Ss}var tr={},nr={},rr={},Bo;function gy(){if(Bo)return rr;Bo=1,Object.defineProperty(rr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return rr.default=e,rr}var bt={},Do;function yy(){if(Do)return bt;Do=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.callRef=bt.getValidate=void 0;const e=ds(),t=lt(),n=he(),r=Tt(),s=wi(),i=ge(),o={keyword:"$ref",schemaType:"string",code(l){const{gen:h,schema:p,it:d}=l,{baseId:m,schemaEnv:_,validateName:g,opts:w,self:$}=d,{root:y}=_;if((p==="#"||p==="#/")&&m===y.baseId)return I();const b=s.resolveRef.call($,y,m,p);if(b===void 0)throw new e.default(d.opts.uriResolver,m,p);if(b instanceof s.SchemaEnv)return v(b);return k(b);function I(){if(_===y)return c(l,g,_,_.$async);const A=h.scopeValue("root",{ref:y});return c(l,(0,n._)`${A}.validate`,y,y.$async)}function v(A){const T=a(l,A);c(l,T,A,A.$async)}function k(A){const T=h.scopeValue("schema",w.code.source===!0?{ref:A,code:(0,n.stringify)(A)}:{ref:A}),L=h.name("valid"),H=l.subschema({schema:A,dataTypes:[],schemaPath:n.nil,topSchemaRef:T,errSchemaPath:p},L);l.mergeEvaluated(H),l.ok(L)}}};function a(l,h){const{gen:p}=l;return h.validate?p.scopeValue("validate",{ref:h.validate}):(0,n._)`${p.scopeValue("wrapper",{ref:h})}.validate`}bt.getValidate=a;function c(l,h,p,d){const{gen:m,it:_}=l,{allErrors:g,schemaEnv:w,opts:$}=_,y=$.passContext?r.default.this:n.nil;d?b():I();function b(){if(!w.$async)throw new Error("async schema referenced by sync schema");const A=m.let("valid");m.try(()=>{m.code((0,n._)`await ${(0,t.callValidateCode)(l,h,y)}`),k(h),g||m.assign(A,!0)},T=>{m.if((0,n._)`!(${T} instanceof ${_.ValidationError})`,()=>m.throw(T)),v(T),g||m.assign(A,!1)}),l.ok(A)}function I(){l.result((0,t.callValidateCode)(l,h,y),()=>k(h),()=>v(h))}function v(A){const T=(0,n._)`${A}.errors`;m.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${T} : ${r.default.vErrors}.concat(${T})`),m.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function k(A){var T;if(!_.opts.unevaluated)return;const L=(T=p?.validate)===null||T===void 0?void 0:T.evaluated;if(_.props!==!0)if(L&&!L.dynamicProps)L.props!==void 0&&(_.props=i.mergeEvaluated.props(m,L.props,_.props));else{const H=m.var("props",(0,n._)`${A}.evaluated.props`);_.props=i.mergeEvaluated.props(m,H,_.props,n.Name)}if(_.items!==!0)if(L&&!L.dynamicItems)L.items!==void 0&&(_.items=i.mergeEvaluated.items(m,L.items,_.items));else{const H=m.var("items",(0,n._)`${A}.evaluated.items`);_.items=i.mergeEvaluated.items(m,H,_.items,n.Name)}}}return bt.callRef=c,bt.default=o,bt}var zo;function wy(){if(zo)return nr;zo=1,Object.defineProperty(nr,"__esModule",{value:!0});const e=gy(),t=yy(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return nr.default=n,nr}var sr={},ir={},Ro;function vy(){if(Ro)return ir;Ro=1,Object.defineProperty(ir,"__esModule",{value:!0});const e=he(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},r={message:({keyword:i,schemaCode:o})=>(0,e.str)`must be ${n[i].okStr} ${o}`,params:({keyword:i,schemaCode:o})=>(0,e._)`{comparison: ${n[i].okStr}, limit: ${o}}`},s={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(i){const{keyword:o,data:a,schemaCode:c}=i;i.fail$data((0,e._)`${a} ${n[o].fail} ${c} || isNaN(${a})`)}};return ir.default=s,ir}var or={},jo;function _y(){if(jo)return or;jo=1,Object.defineProperty(or,"__esModule",{value:!0});const e=he(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:s,data:i,schemaCode:o,it:a}=r,c=a.opts.multipleOfPrecision,l=s.let("res"),h=c?(0,e._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:(0,e._)`${l} !== parseInt(${l})`;r.fail$data((0,e._)`(${o} === 0 || (${l} = ${i}/${o}, ${h}))`)}};return or.default=n,or}var ar={},cr={},Fo;function by(){if(Fo)return cr;Fo=1,Object.defineProperty(cr,"__esModule",{value:!0});function e(t){const n=t.length;let r=0,s=0,i;for(;s<n;)r++,i=t.charCodeAt(s++),i>=55296&&i<=56319&&s<n&&(i=t.charCodeAt(s),(i&64512)===56320&&s++);return r}return cr.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',cr}var Mo;function $y(){if(Mo)return ar;Mo=1,Object.defineProperty(ar,"__esModule",{value:!0});const e=he(),t=ge(),n=by(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:o}){const a=i==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:o,data:a,schemaCode:c,it:l}=i,h=o==="maxLength"?e.operators.GT:e.operators.LT,p=l.opts.unicode===!1?(0,e._)`${a}.length`:(0,e._)`${(0,t.useFunc)(i.gen,n.default)}(${a})`;i.fail$data((0,e._)`${p} ${h} ${c}`)}};return ar.default=s,ar}var ur={},Uo;function Sy(){if(Uo)return ur;Uo=1,Object.defineProperty(ur,"__esModule",{value:!0});const e=lt(),t=ge(),n=he(),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,n.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,n._)`{pattern: ${i}}`},code(i){const{gen:o,data:a,$data:c,schema:l,schemaCode:h,it:p}=i,d=p.opts.unicodeRegExp?"u":"";if(c){const{regExp:m}=p.opts.code,_=m.code==="new RegExp"?(0,n._)`new RegExp`:(0,t.useFunc)(o,m),g=o.let("valid");o.try(()=>o.assign(g,(0,n._)`${_}(${h}, ${d}).test(${a})`),()=>o.assign(g,!1)),i.fail$data((0,n._)`!${g}`)}else{const m=(0,e.usePattern)(i,l);i.fail$data((0,n._)`!${m}.test(${a})`)}}};return ur.default=s,ur}var lr={},Lo;function Ey(){if(Lo)return lr;Lo=1,Object.defineProperty(lr,"__esModule",{value:!0});const e=he(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:s}){const i=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${s} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:s,data:i,schemaCode:o}=r,a=s==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${i}).length ${a} ${o}`)}};return lr.default=n,lr}var fr={},qo;function ky(){if(qo)return fr;qo=1,Object.defineProperty(fr,"__esModule",{value:!0});const e=lt(),t=he(),n=ge(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,t.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,t._)`{missingProperty: ${i}}`},code(i){const{gen:o,schema:a,schemaCode:c,data:l,$data:h,it:p}=i,{opts:d}=p;if(!h&&a.length===0)return;const m=a.length>=d.loopRequired;if(p.allErrors?_():g(),d.strictRequired){const y=i.parentSchema.properties,{definedProperties:b}=i.it;for(const I of a)if(y?.[I]===void 0&&!b.has(I)){const v=p.schemaEnv.baseId+p.errSchemaPath,k=`required property "${I}" is not defined at "${v}" (strictRequired)`;(0,n.checkStrictMode)(p,k,p.opts.strictRequired)}}function _(){if(m||h)i.block$data(t.nil,w);else for(const y of a)(0,e.checkReportMissingProp)(i,y)}function g(){const y=o.let("missing");if(m||h){const b=o.let("valid",!0);i.block$data(b,()=>$(y,b)),i.ok(b)}else o.if((0,e.checkMissingProp)(i,a,y)),(0,e.reportMissingProp)(i,y),o.else()}function w(){o.forOf("prop",c,y=>{i.setParams({missingProperty:y}),o.if((0,e.noPropertyInData)(o,l,y,d.ownProperties),()=>i.error())})}function $(y,b){i.setParams({missingProperty:y}),o.forOf(y,c,()=>{o.assign(b,(0,e.propertyInData)(o,l,y,d.ownProperties)),o.if((0,t.not)(b),()=>{i.error(),o.break()})},t.nil)}}};return fr.default=s,fr}var dr={},Zo;function Iy(){if(Zo)return dr;Zo=1,Object.defineProperty(dr,"__esModule",{value:!0});const e=he(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:s}){const i=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${s} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:s,data:i,schemaCode:o}=r,a=s==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${i}.length ${a} ${o}`)}};return dr.default=n,dr}var hr={},pr={},Vo;function vi(){if(Vo)return pr;Vo=1,Object.defineProperty(pr,"__esModule",{value:!0});const e=pu();return e.code='require("ajv/dist/runtime/equal").default',pr.default=e,pr}var Ko;function Oy(){if(Ko)return hr;Ko=1,Object.defineProperty(hr,"__esModule",{value:!0});const e=Hr(),t=he(),n=ge(),r=vi(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,j:a}})=>(0,t.str)`must NOT have duplicate items (items ## ${a} and ${o} are identical)`,params:({params:{i:o,j:a}})=>(0,t._)`{i: ${o}, j: ${a}}`},code(o){const{gen:a,data:c,$data:l,schema:h,parentSchema:p,schemaCode:d,it:m}=o;if(!l&&!h)return;const _=a.let("valid"),g=p.items?(0,e.getSchemaTypes)(p.items):[];o.block$data(_,w,(0,t._)`${d} === false`),o.ok(_);function w(){const I=a.let("i",(0,t._)`${c}.length`),v=a.let("j");o.setParams({i:I,j:v}),a.assign(_,!0),a.if((0,t._)`${I} > 1`,()=>($()?y:b)(I,v))}function $(){return g.length>0&&!g.some(I=>I==="object"||I==="array")}function y(I,v){const k=a.name("item"),A=(0,e.checkDataTypes)(g,k,m.opts.strictNumbers,e.DataType.Wrong),T=a.const("indices",(0,t._)`{}`);a.for((0,t._)`;${I}--;`,()=>{a.let(k,(0,t._)`${c}[${I}]`),a.if(A,(0,t._)`continue`),g.length>1&&a.if((0,t._)`typeof ${k} == "string"`,(0,t._)`${k} += "_"`),a.if((0,t._)`typeof ${T}[${k}] == "number"`,()=>{a.assign(v,(0,t._)`${T}[${k}]`),o.error(),a.assign(_,!1).break()}).code((0,t._)`${T}[${k}] = ${I}`)})}function b(I,v){const k=(0,n.useFunc)(a,r.default),A=a.name("outer");a.label(A).for((0,t._)`;${I}--;`,()=>a.for((0,t._)`${v} = ${I}; ${v}--;`,()=>a.if((0,t._)`${k}(${c}[${I}], ${c}[${v}])`,()=>{o.error(),a.assign(_,!1).break(A)})))}}};return hr.default=i,hr}var mr={},Jo;function Ay(){if(Jo)return mr;Jo=1,Object.defineProperty(mr,"__esModule",{value:!0});const e=he(),t=ge(),n=vi(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,e._)`{allowedValue: ${i}}`},code(i){const{gen:o,data:a,$data:c,schemaCode:l,schema:h}=i;c||h&&typeof h=="object"?i.fail$data((0,e._)`!${(0,t.useFunc)(o,n.default)}(${a}, ${l})`):i.fail((0,e._)`${h} !== ${a}`)}};return mr.default=s,mr}var gr={},Ho;function Ny(){if(Ho)return gr;Ho=1,Object.defineProperty(gr,"__esModule",{value:!0});const e=he(),t=ge(),n=vi(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,e._)`{allowedValues: ${i}}`},code(i){const{gen:o,data:a,$data:c,schema:l,schemaCode:h,it:p}=i;if(!c&&l.length===0)throw new Error("enum must have non-empty array");const d=l.length>=p.opts.loopEnum;let m;const _=()=>m??(m=(0,t.useFunc)(o,n.default));let g;if(d||c)g=o.let("valid"),i.block$data(g,w);else{if(!Array.isArray(l))throw new Error("ajv implementation error");const y=o.const("vSchema",h);g=(0,e.or)(...l.map((b,I)=>$(y,I)))}i.pass(g);function w(){o.assign(g,!1),o.forOf("v",h,y=>o.if((0,e._)`${_()}(${a}, ${y})`,()=>o.assign(g,!0).break()))}function $(y,b){const I=l[b];return typeof I=="object"&&I!==null?(0,e._)`${_()}(${a}, ${y}[${b}])`:(0,e._)`${a} === ${I}`}}};return gr.default=s,gr}var Go;function Ty(){if(Go)return sr;Go=1,Object.defineProperty(sr,"__esModule",{value:!0});const e=vy(),t=_y(),n=$y(),r=Sy(),s=Ey(),i=ky(),o=Iy(),a=Oy(),c=Ay(),l=Ny(),h=[e.default,t.default,n.default,r.default,s.default,i.default,o.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return sr.default=h,sr}var yr={},Kt={},Wo;function gu(){if(Wo)return Kt;Wo=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.validateAdditionalItems=void 0;const e=he(),t=ge(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{parentSchema:o,it:a}=i,{items:c}=o;if(!Array.isArray(c)){(0,t.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(i,c)}};function s(i,o){const{gen:a,schema:c,data:l,keyword:h,it:p}=i;p.items=!0;const d=a.const("len",(0,e._)`${l}.length`);if(c===!1)i.setParams({len:o.length}),i.pass((0,e._)`${d} <= ${o.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(p,c)){const _=a.var("valid",(0,e._)`${d} <= ${o.length}`);a.if((0,e.not)(_),()=>m(_)),i.ok(_)}function m(_){a.forRange("i",o.length,d,g=>{i.subschema({keyword:h,dataProp:g,dataPropType:t.Type.Num},_),p.allErrors||a.if((0,e.not)(_),()=>a.break())})}}return Kt.validateAdditionalItems=s,Kt.default=r,Kt}var wr={},Jt={},Yo;function yu(){if(Yo)return Jt;Yo=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.validateTuple=void 0;const e=he(),t=ge(),n=lt(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:o,it:a}=i;if(Array.isArray(o))return s(i,"additionalItems",o);a.items=!0,!(0,t.alwaysValidSchema)(a,o)&&i.ok((0,n.validateArray)(i))}};function s(i,o,a=i.schema){const{gen:c,parentSchema:l,data:h,keyword:p,it:d}=i;g(l),d.opts.unevaluated&&a.length&&d.items!==!0&&(d.items=t.mergeEvaluated.items(c,a.length,d.items));const m=c.name("valid"),_=c.const("len",(0,e._)`${h}.length`);a.forEach((w,$)=>{(0,t.alwaysValidSchema)(d,w)||(c.if((0,e._)`${_} > ${$}`,()=>i.subschema({keyword:p,schemaProp:$,dataProp:$},m)),i.ok(m))});function g(w){const{opts:$,errSchemaPath:y}=d,b=a.length,I=b===w.minItems&&(b===w.maxItems||w[o]===!1);if($.strictTuples&&!I){const v=`"${p}" is ${b}-tuple, but minItems or maxItems/${o} are not specified or different at path "${y}"`;(0,t.checkStrictMode)(d,v,$.strictTuples)}}}return Jt.validateTuple=s,Jt.default=r,Jt}var Qo;function Py(){if(Qo)return wr;Qo=1,Object.defineProperty(wr,"__esModule",{value:!0});const e=yu(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return wr.default=t,wr}var vr={},Xo;function Cy(){if(Xo)return vr;Xo=1,Object.defineProperty(vr,"__esModule",{value:!0});const e=he(),t=ge(),n=lt(),r=gu(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{schema:a,parentSchema:c,it:l}=o,{prefixItems:h}=c;l.items=!0,!(0,t.alwaysValidSchema)(l,a)&&(h?(0,r.validateAdditionalItems)(o,h):o.ok((0,n.validateArray)(o)))}};return vr.default=i,vr}var _r={},ea;function xy(){if(ea)return _r;ea=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=he(),t=ge(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:i}})=>i===void 0?(0,e.str)`must contain at least ${s} valid item(s)`:(0,e.str)`must contain at least ${s} and no more than ${i} valid item(s)`,params:({params:{min:s,max:i}})=>i===void 0?(0,e._)`{minContains: ${s}}`:(0,e._)`{minContains: ${s}, maxContains: ${i}}`},code(s){const{gen:i,schema:o,parentSchema:a,data:c,it:l}=s;let h,p;const{minContains:d,maxContains:m}=a;l.opts.next?(h=d===void 0?1:d,p=m):h=1;const _=i.const("len",(0,e._)`${c}.length`);if(s.setParams({min:h,max:p}),p===void 0&&h===0){(0,t.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(p!==void 0&&h>p){(0,t.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,t.alwaysValidSchema)(l,o)){let b=(0,e._)`${_} >= ${h}`;p!==void 0&&(b=(0,e._)`${b} && ${_} <= ${p}`),s.pass(b);return}l.items=!0;const g=i.name("valid");p===void 0&&h===1?$(g,()=>i.if(g,()=>i.break())):h===0?(i.let(g,!0),p!==void 0&&i.if((0,e._)`${c}.length > 0`,w)):(i.let(g,!1),w()),s.result(g,()=>s.reset());function w(){const b=i.name("_valid"),I=i.let("count",0);$(b,()=>i.if(b,()=>y(I)))}function $(b,I){i.forRange("i",0,_,v=>{s.subschema({keyword:"contains",dataProp:v,dataPropType:t.Type.Num,compositeRule:!0},b),I()})}function y(b){i.code((0,e._)`${b}++`),p===void 0?i.if((0,e._)`${b} >= ${h}`,()=>i.assign(g,!0).break()):(i.if((0,e._)`${b} > ${p}`,()=>i.assign(g,!1).break()),h===1?i.assign(g,!0):i.if((0,e._)`${b} >= ${h}`,()=>i.assign(g,!0)))}}};return _r.default=r,_r}var Cs={},ta;function By(){return ta||(ta=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=he(),n=ge(),r=lt();e.error={message:({params:{property:c,depsCount:l,deps:h}})=>{const p=l===1?"property":"properties";return(0,t.str)`must have ${p} ${h} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:h,missingProperty:p}})=>(0,t._)`{property: ${c},
174
+ missingProperty: ${p},
175
+ depsCount: ${l},
176
+ deps: ${h}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[l,h]=i(c);o(c,l),a(c,h)}};function i({schema:c}){const l={},h={};for(const p in c){if(p==="__proto__")continue;const d=Array.isArray(c[p])?l:h;d[p]=c[p]}return[l,h]}function o(c,l=c.schema){const{gen:h,data:p,it:d}=c;if(Object.keys(l).length===0)return;const m=h.let("missing");for(const _ in l){const g=l[_];if(g.length===0)continue;const w=(0,r.propertyInData)(h,p,_,d.opts.ownProperties);c.setParams({property:_,depsCount:g.length,deps:g.join(", ")}),d.allErrors?h.if(w,()=>{for(const $ of g)(0,r.checkReportMissingProp)(c,$)}):(h.if((0,t._)`${w} && (${(0,r.checkMissingProp)(c,g,m)})`),(0,r.reportMissingProp)(c,m),h.else())}}e.validatePropertyDeps=o;function a(c,l=c.schema){const{gen:h,data:p,keyword:d,it:m}=c,_=h.name("valid");for(const g in l)(0,n.alwaysValidSchema)(m,l[g])||(h.if((0,r.propertyInData)(h,p,g,m.opts.ownProperties),()=>{const w=c.subschema({keyword:d,schemaProp:g},_);c.mergeValidEvaluated(w,_)},()=>h.var(_,!0)),c.ok(_))}e.validateSchemaDeps=a,e.default=s})(Cs)),Cs}var br={},na;function Dy(){if(na)return br;na=1,Object.defineProperty(br,"__esModule",{value:!0});const e=he(),t=ge(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,e._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:i,schema:o,data:a,it:c}=s;if((0,t.alwaysValidSchema)(c,o))return;const l=i.name("valid");i.forIn("key",a,h=>{s.setParams({propertyName:h}),s.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},l),i.if((0,e.not)(l),()=>{s.error(!0),c.allErrors||i.break()})}),s.ok(l)}};return br.default=r,br}var $r={},ra;function wu(){if(ra)return $r;ra=1,Object.defineProperty($r,"__esModule",{value:!0});const e=lt(),t=he(),n=Tt(),r=ge(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:o})=>(0,t._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:a,schema:c,parentSchema:l,data:h,errsCount:p,it:d}=o;if(!p)throw new Error("ajv implementation error");const{allErrors:m,opts:_}=d;if(d.props=!0,_.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(d,c))return;const g=(0,e.allSchemaProperties)(l.properties),w=(0,e.allSchemaProperties)(l.patternProperties);$(),o.ok((0,t._)`${p} === ${n.default.errors}`);function $(){a.forIn("key",h,k=>{!g.length&&!w.length?I(k):a.if(y(k),()=>I(k))})}function y(k){let A;if(g.length>8){const T=(0,r.schemaRefOrVal)(d,l.properties,"properties");A=(0,e.isOwnProperty)(a,T,k)}else g.length?A=(0,t.or)(...g.map(T=>(0,t._)`${k} === ${T}`)):A=t.nil;return w.length&&(A=(0,t.or)(A,...w.map(T=>(0,t._)`${(0,e.usePattern)(o,T)}.test(${k})`))),(0,t.not)(A)}function b(k){a.code((0,t._)`delete ${h}[${k}]`)}function I(k){if(_.removeAdditional==="all"||_.removeAdditional&&c===!1){b(k);return}if(c===!1){o.setParams({additionalProperty:k}),o.error(),m||a.break();return}if(typeof c=="object"&&!(0,r.alwaysValidSchema)(d,c)){const A=a.name("valid");_.removeAdditional==="failing"?(v(k,A,!1),a.if((0,t.not)(A),()=>{o.reset(),b(k)})):(v(k,A),m||a.if((0,t.not)(A),()=>a.break()))}}function v(k,A,T){const L={keyword:"additionalProperties",dataProp:k,dataPropType:r.Type.Str};T===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(L,A)}}};return $r.default=i,$r}var Sr={},sa;function zy(){if(sa)return Sr;sa=1,Object.defineProperty(Sr,"__esModule",{value:!0});const e=fs(),t=lt(),n=ge(),r=wu(),s={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,parentSchema:c,data:l,it:h}=i;h.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(h,r.default,"additionalProperties"));const p=(0,t.allSchemaProperties)(a);for(const w of p)h.definedProperties.add(w);h.opts.unevaluated&&p.length&&h.props!==!0&&(h.props=n.mergeEvaluated.props(o,(0,n.toHash)(p),h.props));const d=p.filter(w=>!(0,n.alwaysValidSchema)(h,a[w]));if(d.length===0)return;const m=o.name("valid");for(const w of d)_(w)?g(w):(o.if((0,t.propertyInData)(o,l,w,h.opts.ownProperties)),g(w),h.allErrors||o.else().var(m,!0),o.endIf()),i.it.definedProperties.add(w),i.ok(m);function _(w){return h.opts.useDefaults&&!h.compositeRule&&a[w].default!==void 0}function g(w){i.subschema({keyword:"properties",schemaProp:w,dataProp:w},m)}}};return Sr.default=s,Sr}var Er={},ia;function Ry(){if(ia)return Er;ia=1,Object.defineProperty(Er,"__esModule",{value:!0});const e=lt(),t=he(),n=ge(),r=ge(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,data:c,parentSchema:l,it:h}=i,{opts:p}=h,d=(0,e.allSchemaProperties)(a),m=d.filter(I=>(0,n.alwaysValidSchema)(h,a[I]));if(d.length===0||m.length===d.length&&(!h.opts.unevaluated||h.props===!0))return;const _=p.strictSchema&&!p.allowMatchingProperties&&l.properties,g=o.name("valid");h.props!==!0&&!(h.props instanceof t.Name)&&(h.props=(0,r.evaluatedPropsToName)(o,h.props));const{props:w}=h;$();function $(){for(const I of d)_&&y(I),h.allErrors?b(I):(o.var(g,!0),b(I),o.if(g))}function y(I){for(const v in _)new RegExp(I).test(v)&&(0,n.checkStrictMode)(h,`property ${v} matches pattern ${I} (use allowMatchingProperties)`)}function b(I){o.forIn("key",c,v=>{o.if((0,t._)`${(0,e.usePattern)(i,I)}.test(${v})`,()=>{const k=m.includes(I);k||i.subschema({keyword:"patternProperties",schemaProp:I,dataProp:v,dataPropType:r.Type.Str},g),h.opts.unevaluated&&w!==!0?o.assign((0,t._)`${w}[${v}]`,!0):!k&&!h.allErrors&&o.if((0,t.not)(g),()=>o.break())})})}}};return Er.default=s,Er}var kr={},oa;function jy(){if(oa)return kr;oa=1,Object.defineProperty(kr,"__esModule",{value:!0});const e=ge(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:s,it:i}=n;if((0,e.alwaysValidSchema)(i,s)){n.fail();return}const o=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),n.failResult(o,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return kr.default=t,kr}var Ir={},aa;function Fy(){if(aa)return Ir;aa=1,Object.defineProperty(Ir,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:lt().validateUnion,error:{message:"must match a schema in anyOf"}};return Ir.default=t,Ir}var Or={},ca;function My(){if(ca)return Or;ca=1,Object.defineProperty(Or,"__esModule",{value:!0});const e=he(),t=ge(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,e._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:i,schema:o,parentSchema:a,it:c}=s;if(!Array.isArray(o))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;const l=o,h=i.let("valid",!1),p=i.let("passing",null),d=i.name("_valid");s.setParams({passing:p}),i.block(m),s.result(h,()=>s.reset(),()=>s.error(!0));function m(){l.forEach((_,g)=>{let w;(0,t.alwaysValidSchema)(c,_)?i.var(d,!0):w=s.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},d),g>0&&i.if((0,e._)`${d} && ${h}`).assign(h,!1).assign(p,(0,e._)`[${p}, ${g}]`).else(),i.if(d,()=>{i.assign(h,!0),i.assign(p,g),w&&s.mergeEvaluated(w,e.Name)})})}}};return Or.default=r,Or}var Ar={},ua;function Uy(){if(ua)return Ar;ua=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=ge(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:s,it:i}=n;if(!Array.isArray(s))throw new Error("ajv implementation error");const o=r.name("valid");s.forEach((a,c)=>{if((0,e.alwaysValidSchema)(i,a))return;const l=n.subschema({keyword:"allOf",schemaProp:c},o);n.ok(o),n.mergeEvaluated(l)})}};return Ar.default=t,Ar}var Nr={},la;function Ly(){if(la)return Nr;la=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=he(),t=ge(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,e.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,e._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:o,parentSchema:a,it:c}=i;a.then===void 0&&a.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=s(c,"then"),h=s(c,"else");if(!l&&!h)return;const p=o.let("valid",!0),d=o.name("_valid");if(m(),i.reset(),l&&h){const g=o.let("ifClause");i.setParams({ifClause:g}),o.if(d,_("then",g),_("else",g))}else l?o.if(d,_("then")):o.if((0,e.not)(d),_("else"));i.pass(p,()=>i.error(!0));function m(){const g=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},d);i.mergeEvaluated(g)}function _(g,w){return()=>{const $=i.subschema({keyword:g},d);o.assign(p,d),i.mergeValidEvaluated($,p),w?o.assign(w,(0,e._)`${g}`):i.setParams({ifClause:g})}}}};function s(i,o){const a=i.schema[o];return a!==void 0&&!(0,t.alwaysValidSchema)(i,a)}return Nr.default=r,Nr}var Tr={},fa;function qy(){if(fa)return Tr;fa=1,Object.defineProperty(Tr,"__esModule",{value:!0});const e=ge(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:s}){r.if===void 0&&(0,e.checkStrictMode)(s,`"${n}" without "if" is ignored`)}};return Tr.default=t,Tr}var da;function Zy(){if(da)return yr;da=1,Object.defineProperty(yr,"__esModule",{value:!0});const e=gu(),t=Py(),n=yu(),r=Cy(),s=xy(),i=By(),o=Dy(),a=wu(),c=zy(),l=Ry(),h=jy(),p=Fy(),d=My(),m=Uy(),_=Ly(),g=qy();function w($=!1){const y=[h.default,p.default,d.default,m.default,_.default,g.default,o.default,a.default,i.default,c.default,l.default];return $?y.push(t.default,r.default):y.push(e.default,n.default),y.push(s.default),y}return yr.default=w,yr}var Pr={},Cr={},ha;function Vy(){if(ha)return Cr;ha=1,Object.defineProperty(Cr,"__esModule",{value:!0});const e=he(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,s){const{gen:i,data:o,$data:a,schema:c,schemaCode:l,it:h}=r,{opts:p,errSchemaPath:d,schemaEnv:m,self:_}=h;if(!p.validateFormats)return;a?g():w();function g(){const $=i.scopeValue("formats",{ref:_.formats,code:p.code.formats}),y=i.const("fDef",(0,e._)`${$}[${l}]`),b=i.let("fType"),I=i.let("format");i.if((0,e._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>i.assign(b,(0,e._)`${y}.type || "string"`).assign(I,(0,e._)`${y}.validate`),()=>i.assign(b,(0,e._)`"string"`).assign(I,y)),r.fail$data((0,e.or)(v(),k()));function v(){return p.strictSchema===!1?e.nil:(0,e._)`${l} && !${I}`}function k(){const A=m.$async?(0,e._)`(${y}.async ? await ${I}(${o}) : ${I}(${o}))`:(0,e._)`${I}(${o})`,T=(0,e._)`(typeof ${I} == "function" ? ${A} : ${I}.test(${o}))`;return(0,e._)`${I} && ${I} !== true && ${b} === ${s} && !${T}`}}function w(){const $=_.formats[c];if(!$){v();return}if($===!0)return;const[y,b,I]=k($);y===s&&r.pass(A());function v(){if(p.strictSchema===!1){_.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${c}" ignored in schema at path "${d}"`}}function k(T){const L=T instanceof RegExp?(0,e.regexpCode)(T):p.code.formats?(0,e._)`${p.code.formats}${(0,e.getProperty)(c)}`:void 0,H=i.scopeValue("formats",{key:c,ref:T,code:L});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,e._)`${H}.validate`]:["string",T,H]}function A(){if(typeof $=="object"&&!($ instanceof RegExp)&&$.async){if(!m.$async)throw new Error("async format in sync schema");return(0,e._)`await ${I}(${o})`}return typeof b=="function"?(0,e._)`${I}(${o})`:(0,e._)`${I}.test(${o})`}}}};return Cr.default=n,Cr}var pa;function Ky(){if(pa)return Pr;pa=1,Object.defineProperty(Pr,"__esModule",{value:!0});const t=[Vy().default];return Pr.default=t,Pr}var Bt={},ma;function Jy(){return ma||(ma=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.contentVocabulary=Bt.metadataVocabulary=void 0,Bt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Bt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Bt}var ga;function Hy(){if(ga)return tr;ga=1,Object.defineProperty(tr,"__esModule",{value:!0});const e=wy(),t=Ty(),n=Zy(),r=Ky(),s=Jy(),i=[e.default,t.default,(0,n.default)(),r.default,s.metadataVocabulary,s.contentVocabulary];return tr.default=i,tr}var xr={},$n={},ya;function Gy(){if(ya)return $n;ya=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||($n.DiscrError=e={})),$n}var wa;function Wy(){if(wa)return xr;wa=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=he(),t=Gy(),n=wi(),r=ds(),s=ge(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:l}})=>(0,e._)`{error: ${a}, tag: ${l}, tagValue: ${c}}`},code(a){const{gen:c,data:l,schema:h,parentSchema:p,it:d}=a,{oneOf:m}=p;if(!d.opts.discriminator)throw new Error("discriminator: requires discriminator option");const _=h.propertyName;if(typeof _!="string")throw new Error("discriminator: requires propertyName");if(h.mapping)throw new Error("discriminator: mapping is not supported");if(!m)throw new Error("discriminator: requires oneOf keyword");const g=c.let("valid",!1),w=c.const("tag",(0,e._)`${l}${(0,e.getProperty)(_)}`);c.if((0,e._)`typeof ${w} == "string"`,()=>$(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:w,tagName:_})),a.ok(g);function $(){const I=b();c.if(!1);for(const v in I)c.elseIf((0,e._)`${w} === ${v}`),c.assign(g,y(I[v]));c.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:w,tagName:_}),c.endIf()}function y(I){const v=c.name("valid"),k=a.subschema({keyword:"oneOf",schemaProp:I},v);return a.mergeEvaluated(k,e.Name),v}function b(){var I;const v={},k=T(p);let A=!0;for(let G=0;G<m.length;G++){let Y=m[G];if(Y?.$ref&&!(0,s.schemaHasRulesButRef)(Y,d.self.RULES)){const le=Y.$ref;if(Y=n.resolveRef.call(d.self,d.schemaEnv.root,d.baseId,le),Y instanceof n.SchemaEnv&&(Y=Y.schema),Y===void 0)throw new r.default(d.opts.uriResolver,d.baseId,le)}const se=(I=Y?.properties)===null||I===void 0?void 0:I[_];if(typeof se!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${_}"`);A=A&&(k||T(Y)),L(se,G)}if(!A)throw new Error(`discriminator: "${_}" must be required`);return v;function T({required:G}){return Array.isArray(G)&&G.includes(_)}function L(G,Y){if(G.const)H(G.const,Y);else if(G.enum)for(const se of G.enum)H(se,Y);else throw new Error(`discriminator: "properties/${_}" must have "const" or "enum"`)}function H(G,Y){if(typeof G!="string"||G in v)throw new Error(`discriminator: "${_}" values must be unique strings`);v[G]=Y}}}};return xr.default=o,xr}const Yy="http://json-schema.org/draft-07/schema#",Qy="http://json-schema.org/draft-07/schema#",Xy="Core schema meta-schema",e0={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:[]}},t0=["object","boolean"],n0={$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:"#"}};var r0={$schema:Yy,$id:Qy,title:Xy,definitions:e0,type:t0,properties:n0,default:!0},va;function s0(){return va||(va=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=my(),r=Hy(),s=Wy(),i=r0,o=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const _=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(_,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var l=fs();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var h=he();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var p=yi();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var d=ds();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})(Wn,Wn.exports)),Wn.exports}var i0=s0();const xs=10,_a=(e=0)=>t=>`\x1B[${t+e}m`,ba=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,$a=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,Oe={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Oe.modifier);const o0=Object.keys(Oe.color),a0=Object.keys(Oe.bgColor);[...o0,...a0];function c0(){const e=new Map;for(const[t,n]of Object.entries(Oe)){for(const[r,s]of Object.entries(n))Oe[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[r]=Oe[r],e.set(s[0],s[1]);Object.defineProperty(Oe,t,{value:n,enumerable:!1})}return Object.defineProperty(Oe,"codes",{value:e,enumerable:!1}),Oe.color.close="\x1B[39m",Oe.bgColor.close="\x1B[49m",Oe.color.ansi=_a(),Oe.color.ansi256=ba(),Oe.color.ansi16m=$a(),Oe.bgColor.ansi=_a(xs),Oe.bgColor.ansi256=ba(xs),Oe.bgColor.ansi16m=$a(xs),Object.defineProperties(Oe,{rgbToAnsi256:{value(t,n,r){return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){const n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(i=>i+i).join(""));const s=Number.parseInt(r,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>Oe.rgbToAnsi256(...Oe.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,s;if(t>=232)n=((t-232)*10+8)/255,r=n,s=n;else{t-=16;const a=t%36;n=Math.floor(t/36)/5,r=Math.floor(a/6)/5,s=a%6/5}const i=Math.max(n,r,s)*2;if(i===0)return 30;let o=30+(Math.round(s)<<2|Math.round(r)<<1|Math.round(n));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,n,r)=>Oe.ansi256ToAnsi(Oe.rgbToAnsi256(t,n,r)),enumerable:!1},hexToAnsi:{value:t=>Oe.ansi256ToAnsi(Oe.hexToAnsi256(t)),enumerable:!1}}),Oe}const Ye=c0();class u0 extends pi{getNodeDependencies({resolvedInputs:t}){const n=[];for(const r of Object.values(t))for(const s of r)n.push(s.input.instanceId);return n}processNode({instance:t,component:n,state:r,resolvedInputs:s}){const i=new i0.Ajv({strict:!1});this.logger.debug({instanceId:t.id},"validating instance");const o=[];for(const[l,h]of Object.entries(n.args))try{const p=Wm(t.args?.[l]);if(!h.required&&p===void 0)continue;i.validate(h.schema,p)||(this.logger.debug({instanceId:t.id,argumentName:l},"invalid argument"),o.push(`Invalid argument "${Ye.blueBright.open}${l}${Ye.reset.close}": `+i.errorsText()))}catch(p){this.logger.debug({instanceId:t.id,argumentName:l,error:p},"failed to validate argument"),o.push(`Failed to validate argument "${Ye.blueBright.open}${l}${Ye.reset.close}": `+(p instanceof Error?p.message:String(p)))}if(hi(n))for(const[l,h]of Object.entries(n.secrets))h.required&&!r?.secretNames?.includes(l)&&o.push(`Missing required secret "${Ye.blueBright.open}${l}${Ye.reset.close}"`);for(const[l,h]of Object.entries(s))for(const p of h)this.outputs.get(p.input.instanceId)?.status!=="ok"&&o.push(`Invalid input "${Ye.blueBright.open}${l}${Ye.reset.close}":
177
+ "${Ye.blueBright.open}${p.input.instanceId}${Ye.reset.close}" has validation errors`);for(const[l,h]of Object.entries(n.inputs))h.required&&(!s[l]||!s[l].length)&&o.push(`Missing required input "${Ye.blueBright.open}${l}${Ye.reset.close}" of type "${Ye.greenBright.open}${h.type}${Ye.reset.close}"`);if(o.length===0)return{status:"ok"};const a=(o.length+1).toString().length+2;return{status:"error",errorText:o.map((l,h)=>{const p=l.split(`
178
+ `),d=`${h+1}. `;return p.map((m,_)=>`${_===0?d:" ".repeat(a)}${m}`).join(`\r
179
+ `)}).join(`\r
180
+ `)}}}const l0={InputResolver:bg,InputHashResolver:Xg,ValidationResolver:u0};var Sn={exports:{}},Bs,Sa;function f0(){if(Sa)return Bs;Sa=1;function e(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}Bs=t;function t(n,r,s){var i=s&&s.stringify||e,o=1;if(typeof n=="object"&&n!==null){var a=r.length+o;if(a===1)return n;var c=new Array(a);c[0]=i(n);for(var l=1;l<a;l++)c[l]=i(r[l]);return c.join(" ")}if(typeof n!="string")return n;var h=r.length;if(h===0)return n;for(var p="",d=1-o,m=-1,_=n&&n.length||0,g=0;g<_;){if(n.charCodeAt(g)===37&&g+1<_){switch(m=m>-1?m:0,n.charCodeAt(g+1)){case 100:case 102:if(d>=h||r[d]==null)break;m<g&&(p+=n.slice(m,g)),p+=Number(r[d]),m=g+2,g++;break;case 105:if(d>=h||r[d]==null)break;m<g&&(p+=n.slice(m,g)),p+=Math.floor(Number(r[d])),m=g+2,g++;break;case 79:case 111:case 106:if(d>=h||r[d]===void 0)break;m<g&&(p+=n.slice(m,g));var w=typeof r[d];if(w==="string"){p+="'"+r[d]+"'",m=g+2,g++;break}if(w==="function"){p+=r[d].name||"<anonymous>",m=g+2,g++;break}p+=i(r[d]),m=g+2,g++;break;case 115:if(d>=h)break;m<g&&(p+=n.slice(m,g)),p+=String(r[d]),m=g+2,g++;break;case 37:m<g&&(p+=n.slice(m,g)),p+="%",m=g+2,g++,d--;break}++d}++g}return m===-1?n:(m<_&&(p+=n.slice(m)),p)}return Bs}var Ea;function d0(){if(Ea)return Sn.exports;Ea=1;const e=f0();Sn.exports=h;const t=le().console||{},n={mapHttpRequest:A,mapHttpResponse:A,wrapRequestSerializer:T,wrapResponseSerializer:T,wrapErrorSerializer:T,req:A,res:A,err:v,errWithCause:v};function r(M,W){return M==="silent"?1/0:W.levels.values[M]}const s=Symbol("pino.logFuncs"),i=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function a(M,W){const re={logger:W,parent:M[i]};W[i]=re}function c(M,W,re){const ne={};W.forEach(oe=>{ne[oe]=re[oe]?re[oe]:t[oe]||t[o[oe]||"log"]||L}),M[s]=ne}function l(M,W){return Array.isArray(M)?M.filter(function(ne){return ne!=="!stdSerializers.err"}):M===!0?Object.keys(W):!1}function h(M){M=M||{},M.browser=M.browser||{};const W=M.browser.transmit;if(W&&typeof W.send!="function")throw Error("pino: transmit option must have a send function");const re=M.browser.write||t;M.browser.write&&(M.browser.asObject=!0);const ne=M.serializers||{},oe=l(M.browser.serialize,ne);let V=M.browser.serialize;Array.isArray(M.browser.serialize)&&M.browser.serialize.indexOf("!stdSerializers.err")>-1&&(V=!1);const P=Object.keys(M.customLevels||{}),j=["error","fatal","warn","info","debug","trace"].concat(P);typeof re=="function"&&j.forEach(function(ie){re[ie]=re}),(M.enabled===!1||M.browser.disabled)&&(M.level="silent");const B=M.level||"info",E=Object.create(re);E.log||(E.log=L),c(E,j,re),a({},E),Object.defineProperty(E,"levelVal",{get:F}),Object.defineProperty(E,"level",{get:X,set:Q});const N={transmit:W,serialize:oe,asObject:M.browser.asObject,asObjectBindingsOnly:M.browser.asObjectBindingsOnly,formatters:M.browser.formatters,levels:j,timestamp:k(M),messageKey:M.messageKey||"msg",onChild:M.onChild||L};E.levels=p(M),E.level=B,E.isLevelEnabled=function(ie){return this.levels.values[ie]?this.levels.values[ie]>=this.levels.values[this.level]:!1},E.setMaxListeners=E.getMaxListeners=E.emit=E.addListener=E.on=E.prependListener=E.once=E.prependOnceListener=E.removeListener=E.removeAllListeners=E.listeners=E.listenerCount=E.eventNames=E.write=E.flush=L,E.serializers=ne,E._serialize=oe,E._stdErrSerialize=V,E.child=function(...ie){return fe.call(this,N,...ie)},W&&(E._logEvent=I());function F(){return r(this.level,this)}function X(){return this._level}function Q(ie){if(ie!=="silent"&&!this.levels.values[ie])throw Error("unknown level "+ie);this._level=ie,_(this,N,E,"error"),_(this,N,E,"fatal"),_(this,N,E,"warn"),_(this,N,E,"info"),_(this,N,E,"debug"),_(this,N,E,"trace"),P.forEach(x=>{_(this,N,E,x)})}function fe(ie,x,D){if(!x)throw new Error("missing bindings for child Pino");D=D||{},oe&&x.serializers&&(D.serializers=x.serializers);const q=D.serializers;if(oe&&q){var J=Object.assign({},ne,q),ee=M.browser.serialize===!0?Object.keys(J):oe;delete x.serializers,y([x],ee,J,this._stdErrSerialize)}function ae(Re){this._childLevel=(Re._childLevel|0)+1,this.bindings=x,J&&(this.serializers=J,this._serialize=ee),W&&(this._logEvent=I([].concat(Re._logEvent.bindings,x)))}ae.prototype=this;const _e=new ae(this);return a(this,_e),_e.child=function(...Re){return fe.call(this,ie,...Re)},_e.level=D.level||this.level,ie.onChild(_e),_e}return E}function p(M){const W=M.customLevels||{},re=Object.assign({},h.levels.values,W),ne=Object.assign({},h.levels.labels,d(W));return{values:re,labels:ne}}function d(M){const W={};return Object.keys(M).forEach(function(re){W[M[re]]=re}),W}h.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},h.stdSerializers=n,h.stdTimeFunctions=Object.assign({},{nullTime:H,epochTime:G,unixTime:Y,isoTime:se});function m(M){const W=[];M.bindings&&W.push(M.bindings);let re=M[i];for(;re.parent;)re=re.parent,re.logger.bindings&&W.push(re.logger.bindings);return W.reverse()}function _(M,W,re,ne){if(Object.defineProperty(M,ne,{value:r(M.level,re)>r(ne,re)?L:re[s][ne],writable:!0,enumerable:!0,configurable:!0}),M[ne]===L){if(!W.transmit)return;const V=W.transmit.level||M.level,P=r(V,re);if(r(ne,re)<P)return}M[ne]=w(M,W,re,ne);const oe=m(M);oe.length!==0&&(M[ne]=g(oe,M[ne]))}function g(M,W){return function(){return W.apply(this,[...M,...arguments])}}function w(M,W,re,ne){return(function(oe){return function(){const P=W.timestamp(),j=new Array(arguments.length),B=Object.getPrototypeOf&&Object.getPrototypeOf(this)===t?t:this;for(var E=0;E<j.length;E++)j[E]=arguments[E];var N=!1;if(W.serialize&&(y(j,this._serialize,this.serializers,this._stdErrSerialize),N=!0),W.asObject||W.formatters?oe.call(B,...$(this,ne,j,P,W)):oe.apply(B,j),W.transmit){const F=W.transmit.level||M._level,X=r(F,re),Q=r(ne,re);if(Q<X)return;b(this,{ts:P,methodLevel:ne,methodValue:Q,transmitValue:re.levels.values[W.transmit.level||M._level],send:W.transmit.send,val:r(M._level,re)},j,N)}}})(M[s][ne])}function $(M,W,re,ne,oe){const{level:V,log:P=F=>F}=oe.formatters||{},j=re.slice();let B=j[0];const E={};let N=(M._childLevel|0)+1;if(N<1&&(N=1),ne&&(E.time=ne),V){const F=V(W,M.levels.values[W]);Object.assign(E,F)}else E.level=M.levels.values[W];if(oe.asObjectBindingsOnly){if(B!==null&&typeof B=="object")for(;N--&&typeof j[0]=="object";)Object.assign(E,j.shift());return[P(E),...j]}else{if(B!==null&&typeof B=="object"){for(;N--&&typeof j[0]=="object";)Object.assign(E,j.shift());B=j.length?e(j.shift(),j):void 0}else typeof B=="string"&&(B=e(j.shift(),j));return B!==void 0&&(E[oe.messageKey]=B),[P(E)]}}function y(M,W,re,ne){for(const oe in M)if(ne&&M[oe]instanceof Error)M[oe]=h.stdSerializers.err(M[oe]);else if(typeof M[oe]=="object"&&!Array.isArray(M[oe])&&W)for(const V in M[oe])W.indexOf(V)>-1&&V in re&&(M[oe][V]=re[V](M[oe][V]))}function b(M,W,re,ne=!1){const oe=W.send,V=W.ts,P=W.methodLevel,j=W.methodValue,B=W.val,E=M._logEvent.bindings;ne||y(re,M._serialize||Object.keys(M.serializers),M.serializers,M._stdErrSerialize===void 0?!0:M._stdErrSerialize),M._logEvent.ts=V,M._logEvent.messages=re.filter(function(N){return E.indexOf(N)===-1}),M._logEvent.level.label=P,M._logEvent.level.value=j,oe(P,M._logEvent,B),M._logEvent=I(E)}function I(M){return{ts:0,messages:[],bindings:M||[],level:{label:"",value:0}}}function v(M){const W={type:M.constructor.name,msg:M.message,stack:M.stack};for(const re in M)W[re]===void 0&&(W[re]=M[re]);return W}function k(M){return typeof M.timestamp=="function"?M.timestamp:M.timestamp===!1?H:G}function A(){return{}}function T(M){return M}function L(){}function H(){return!1}function G(){return Date.now()}function Y(){return Math.round(Date.now()/1e3)}function se(){return new Date(Date.now()).toISOString()}function le(){function M(W){return typeof W<"u"&&W}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return M(self)||M(window)||M(this)||{}}}return Sn.exports.default=h,Sn.exports.pino=h,Sn.exports}var h0=d0();const xn=(e,t)=>{e.postMessage(t)},mt=new Map,ka=128,vu=(e,t,n)=>{if(n.pendingOutputs.size===0)return;const r=Array.from(n.pendingOutputs.values());n.pendingOutputs.clear();for(let s=0;s<r.length;s+=ka)xn(e,{type:"outputs",resolverId:t,items:r.slice(s,s+ka)})},Ia=(e,t,n)=>{n.flushTimer||(n.flushTimer=setTimeout(()=>{if(n.flushTimer=null,vu(e,t,n),n.pendingDependentSets.size>0){const r=Array.from(n.pendingDependentSets.entries()).map(([s,i])=>({nodeId:s,dependents:i}));xn(e,{type:"dependent-set-batch",resolverId:t,items:r}),n.pendingDependentSets.clear()}},0))},_i=(e,t)=>{if(t.isProcessing){t.processRequested=!0;return}t.isProcessing=!0;const n=t.abortController.signal;t.resolver.process(n).catch(r=>{t.logger.error({error:r},"failed to process resolver updates")}).finally(()=>{t.isProcessing=!1,t.processRequested&&(t.processRequested=!1,_i(e,t))})},p0=async(e,t,n,r,s=!1)=>{if(mt.has(n)){console.warn(`state with id "${n}" already exists`);return}const i=h0.pino({level:"info"}).child({resolverId:n,resolverType:r}),o=(h,p)=>{const d=mt.get(n);d&&(d.pendingOutputs.set(h,{nodeId:h,output:p}),Ia(e,n,d))};let a;s&&(a=(h,p)=>{const d=mt.get(n);d&&(d.pendingDependentSets.set(h,p&&Array.from(p)),Ia(e,n,d))});const c=new l0[r](t,i,o,a);mt.set(n,{nodes:t,resolver:c,logger:i,abortController:new AbortController,isProcessing:!1,processRequested:!1,pendingOutputs:new Map,pendingDependentSets:new Map,flushTimer:null}),c.addAllNodesToWorkset(),await c.process();const l=mt.get(n);if(l&&(l.flushTimer&&(clearTimeout(l.flushTimer),l.flushTimer=null),vu(e,n,l),l.pendingDependentSets.size>0)){const h=Array.from(l.pendingDependentSets.entries()).map(([p,d])=>({nodeId:p,dependents:d}));xn(e,{type:"dependent-set-batch",resolverId:n,items:h}),l.pendingDependentSets.clear()}xn(e,{type:"resolver-ready",resolverId:n})},_u=(e,t,n)=>{e.abortController.abort(),e.abortController=new AbortController,e.nodes.set(t,n),e.resolver.invalidate(t)},m0=(e,t,n,r)=>{const s=mt.get(t);if(!s)throw new Error(`Unknown state: ${t}`);_u(s,n,r),_i(e,s)},g0=(e,t,n)=>{const r=mt.get(t);if(!r)throw new Error(`Unknown state: ${t}`);_u(r,n,void 0),_i(e,r)},y0=e=>{const t=mt.get(e);t?.flushTimer&&clearTimeout(t.flushTimer),mt.delete(e)};self.onconnect=e=>{const t=e.ports[0];t.onmessage=n=>{const r=n.data;switch(r.type){case"create-resolver":{const s=new Map(Object.entries(r.nodes));p0(t,s,r.resolverId,r.resolverType,r.syncDependentMap);break}case"update-input":{m0(t,r.resolverId,r.nodeId,r.node);break}case"delete-input":{g0(t,r.resolverId,r.nodeId);break}case"dispose-resolver":{y0(r.resolverId);break}}},xn(t,{type:"ready"})};