@testmuai/kane-cli 0.10.0 → 0.10.2
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.
- package/dist/ChatSurface-FIYDTZSI.js +2 -0
- package/dist/{ChromeProfilePicker-FWPUDKD6.js → ChromeProfilePicker-Q6FIGVYU.js} +1 -1
- package/dist/{CliFeedbackPrompt-D5L2DO6A.js → CliFeedbackPrompt-2NV2G65E.js} +1 -1
- package/dist/{CliUploadProgress-HQX57WE6.js → CliUploadProgress-JZ5FXODE.js} +1 -1
- package/dist/{ConfigView-DGQXKEON.js → ConfigView-TZ4YINOE.js} +1 -1
- package/dist/EvidenceViewOffer-LKPN5BHX.js +2 -0
- package/dist/FolderPicker-H5K74PCH.js +2 -0
- package/dist/InfoBox-DNSOAK5L.js +2 -0
- package/dist/{LinksBox-WZ4RAMSH.js → LinksBox-32TZOANP.js} +1 -1
- package/dist/{ProfilesView-AGRNPGSW.js → ProfilesView-UC4MPM54.js} +1 -1
- package/dist/ProjectPicker-ZJ5RW6XL.js +2 -0
- package/dist/SaveSessionPrompt-F327WC7A.js +2 -0
- package/dist/SingleShotApp-OMLRYOSI.js +2 -0
- package/dist/{SummaryBox-XQJUZBAN.js → SummaryBox-XGFO5X76.js} +1 -1
- package/dist/TestMdRunView-ZZ77QTAQ.js +2 -0
- package/dist/TestrunEvidenceTable-G7MPF55X.js +2 -0
- package/dist/{WhoamiView-JQCURK2M.js → WhoamiView-4XIJXMTU.js} +1 -1
- package/dist/{app-download-OU6AGH2X.js → app-download-XEDO3EMV.js} +1 -1
- package/dist/{assurance-job-ZI3L6I4F.js → assurance-job-MD65GQLC.js} +1 -1
- package/dist/{auth-7Z54TMQQ.js → auth-WBIEHHDS.js} +1 -1
- package/dist/{binary-S5YL5GJD.js → binary-NVYLR36K.js} +1 -1
- package/dist/{bind-LIV72SEZ.js → bind-H3ALI2NG.js} +1 -1
- package/dist/{bootstrap-3V6TOO6I.js → bootstrap-JEVSVPQ2.js} +1 -1
- package/dist/bridge-2UHJOVLX.js +2 -0
- package/dist/{catalog-I3PC6LT6.js → catalog-5UYBWA4W.js} +1 -1
- package/dist/{catalog-client-WKYG3JN6.js → catalog-client-VVKV4JKW.js} +1 -1
- package/dist/{changelog-IHNWFYWY.js → changelog-FPWJXERY.js} +1 -1
- package/dist/chat-committer-ZKEKJA2R.js +2 -0
- package/dist/chat-controller-FXRJXUG3.js +2 -0
- package/dist/child-JHYENXE7.js +2 -0
- package/dist/{chunk-URAYFJGM.js → chunk-226AGYHB.js} +1 -1
- package/dist/{chunk-ZTAZ2R5Z.js → chunk-23DKB2MT.js} +1 -1
- package/dist/{chunk-JGLADDRH.js → chunk-2COXO5LQ.js} +1 -1
- package/dist/{chunk-TZVPDGJD.js → chunk-2GEAKFAV.js} +1 -1
- package/dist/{chunk-45URQUAK.js → chunk-2QKBXRLI.js} +1 -1
- package/dist/{chunk-AG5XJWEV.js → chunk-2ULYGALF.js} +1 -1
- package/dist/{chunk-G3J4XY3Z.js → chunk-32HED7X2.js} +1 -1
- package/dist/{chunk-GRURFGBP.js → chunk-32MFECUA.js} +1 -1
- package/dist/{chunk-N3KTLWJL.js → chunk-35BG2EMW.js} +1 -1
- package/dist/{chunk-KDR662D2.js → chunk-3KY7HHQU.js} +1 -1
- package/dist/{chunk-ZGQM6KWN.js → chunk-3V4J65GN.js} +1 -1
- package/dist/{chunk-DBTMKBHU.js → chunk-3YIA3DSL.js} +1 -1
- package/dist/{chunk-VVCZRCRD.js → chunk-44SIFDNY.js} +1 -1
- package/dist/{chunk-Z5BFCTHI.js → chunk-45NM23EQ.js} +2 -2
- package/dist/{chunk-I2MC6VVX.js → chunk-4C7WVQOD.js} +1 -1
- package/dist/{chunk-3UHPVQLU.js → chunk-4HARMERK.js} +1 -1
- package/dist/{chunk-A3TCFSCK.js → chunk-4HYPMGDF.js} +1 -1
- package/dist/{chunk-7KX2BHKG.js → chunk-4KCYNP2K.js} +1 -1
- package/dist/{chunk-FVYIV36L.js → chunk-4LGQHTXM.js} +1 -1
- package/dist/{chunk-WKZLK57W.js → chunk-4NEPHIAO.js} +1 -1
- package/dist/{chunk-YYVBE6W2.js → chunk-54NJJVG5.js} +1 -1
- package/dist/{chunk-3OVFKUXV.js → chunk-5F44KH3R.js} +1 -1
- package/dist/{chunk-WERIGVOH.js → chunk-5F5IVART.js} +1 -1
- package/dist/{chunk-FBQ7PQJV.js → chunk-5KJU4MG4.js} +1 -1
- package/dist/{chunk-D6CS62O7.js → chunk-5MFPQYW3.js} +1 -1
- package/dist/{chunk-ZI3X7DI2.js → chunk-5WLXAQ4H.js} +1 -1
- package/dist/{chunk-RFEON5GN.js → chunk-5XVWT6UK.js} +1 -1
- package/dist/{chunk-5IO5ZC4S.js → chunk-6CS23F3E.js} +1 -1
- package/dist/{chunk-DTYT6KBO.js → chunk-6JUS2ULI.js} +1 -1
- package/dist/{chunk-HMQ5M4JJ.js → chunk-6LEHGRRG.js} +1 -1
- package/dist/{chunk-5R3ODQHH.js → chunk-6SD4XTYC.js} +1 -1
- package/dist/{chunk-Y3YULFCK.js → chunk-6SWHEBPR.js} +1 -1
- package/dist/{chunk-BY2B4YJN.js → chunk-6YBH3WUW.js} +1 -1
- package/dist/{chunk-X3J4CC27.js → chunk-73HMW2WA.js} +1 -1
- package/dist/{chunk-PQXYHI5W.js → chunk-75FF7J5R.js} +1 -1
- package/dist/{chunk-JTJ7IPNI.js → chunk-7DLDADQR.js} +1 -1
- package/dist/{chunk-J4LQAT5P.js → chunk-7LYLJ75Z.js} +1 -1
- package/dist/{chunk-XLQ4F6BI.js → chunk-7O2FIZB7.js} +2 -2
- package/dist/{chunk-UUWSULIM.js → chunk-7PCLHURF.js} +3 -3
- package/dist/{chunk-FLOQ5NZL.js → chunk-7XJNYLQW.js} +1 -1
- package/dist/{chunk-3ZPEQDXZ.js → chunk-7ZR5CQY3.js} +1 -1
- package/dist/{chunk-CJQUVHHS.js → chunk-A474TUCE.js} +1 -1
- package/dist/chunk-A4ZV2SHL.js +5 -0
- package/dist/{chunk-RDH3E25Q.js → chunk-A7IMHUFY.js} +2 -2
- package/dist/{chunk-EVZLINBN.js → chunk-ABMM37L2.js} +1 -1
- package/dist/{chunk-QECTIQAC.js → chunk-AUSLHNXQ.js} +1 -1
- package/dist/{chunk-4MNSP4EO.js → chunk-B226SFOV.js} +1 -1
- package/dist/{chunk-2L3A5NKZ.js → chunk-B57ZRHEQ.js} +1 -1
- package/dist/{chunk-2PZKMT3I.js → chunk-BHQIH2FE.js} +1 -1
- package/dist/{chunk-4SJAOAYY.js → chunk-BJT6PZXL.js} +1 -1
- package/dist/{chunk-YKOEABP2.js → chunk-C6P6YUCR.js} +1 -1
- package/dist/chunk-CB344EDO.js +2 -0
- package/dist/chunk-CCOD4GQJ.js +2 -0
- package/dist/{chunk-CJE7PKRV.js → chunk-CQDCNP7V.js} +1 -1
- package/dist/{chunk-EPJ5SJL2.js → chunk-D4QXYAYA.js} +2 -2
- package/dist/{chunk-CBVHP7JB.js → chunk-DLP5S3TO.js} +1 -1
- package/dist/{chunk-EH43VWVR.js → chunk-DXIQVBMI.js} +1 -1
- package/dist/chunk-DXLZCJH5.js +7 -0
- package/dist/{chunk-WZLDFEWR.js → chunk-E4GIGM5V.js} +1 -1
- package/dist/{chunk-JOCEZK2M.js → chunk-EAWU2TOG.js} +1 -1
- package/dist/{chunk-G3CYFCSR.js → chunk-EEOAU43D.js} +1 -1
- package/dist/{chunk-MYZHOBS4.js → chunk-EHB55V23.js} +1 -1
- package/dist/{chunk-OR2B6T3B.js → chunk-ENRFXGID.js} +1 -1
- package/dist/{chunk-JT6WLJSV.js → chunk-ET5EK2CM.js} +1 -1
- package/dist/{chunk-HGVM2OZU.js → chunk-EZMRWXRT.js} +1 -1
- package/dist/{chunk-QMOGBKJM.js → chunk-FAMQ4DHU.js} +1 -1
- package/dist/{chunk-GGV336P5.js → chunk-FI2DVNRT.js} +1 -1
- package/dist/{chunk-AUJSC7PU.js → chunk-FNUGDPTS.js} +1 -1
- package/dist/{chunk-MPEIMWQI.js → chunk-FOLUB336.js} +1 -1
- package/dist/{chunk-4JWJH6TB.js → chunk-FYPIF3BE.js} +1 -1
- package/dist/{chunk-HHW6MRU3.js → chunk-G4K3TP2I.js} +1 -1
- package/dist/{chunk-P2ZQDQDB.js → chunk-GAKBHNC4.js} +1 -1
- package/dist/{chunk-DPGOAFKF.js → chunk-GBQ4K25P.js} +1 -1
- package/dist/{chunk-PCDIEYV6.js → chunk-GEZVC4S3.js} +1 -1
- package/dist/{chunk-UX2CDUPE.js → chunk-GJ7MO2FW.js} +2 -2
- package/dist/{chunk-PL3SG3M2.js → chunk-GJXO6FF7.js} +1 -1
- package/dist/{chunk-252GEI3H.js → chunk-GLM5UGTF.js} +1 -1
- package/dist/{chunk-JCSVBD4F.js → chunk-GQARXS6F.js} +1 -1
- package/dist/{chunk-NTXFPNAP.js → chunk-GT3JDX5H.js} +1 -1
- package/dist/{chunk-RARD6TC6.js → chunk-GZQAETB2.js} +1 -1
- package/dist/{chunk-TLOYTGVT.js → chunk-H4TIVILC.js} +1 -1
- package/dist/{chunk-7C4IEL5V.js → chunk-HG2ILWCE.js} +1 -1
- package/dist/{chunk-2SY2NCOP.js → chunk-HHOVANJ7.js} +1 -1
- package/dist/{chunk-DHYGCHKB.js → chunk-HM6LZ2KM.js} +1 -1
- package/dist/{chunk-NJCN6LP5.js → chunk-HNF3PWF3.js} +6 -6
- package/dist/{chunk-P2LDAW3C.js → chunk-HVOXMCKE.js} +1 -1
- package/dist/{chunk-JSLKCCD2.js → chunk-HWPWCCEV.js} +1 -1
- package/dist/{chunk-XMALVGH7.js → chunk-HX5OLRKU.js} +2 -2
- package/dist/{chunk-4I7YN6YY.js → chunk-HYJVYYAZ.js} +2 -2
- package/dist/{chunk-2N75WO7Y.js → chunk-I52NWH4U.js} +1 -1
- package/dist/{chunk-3T2TYDPT.js → chunk-IB5WG5YY.js} +1 -1
- package/dist/{chunk-6DZ7LVOG.js → chunk-IH73ZCBB.js} +1 -1
- package/dist/{chunk-SBR6D6GS.js → chunk-IT5JVCZN.js} +1 -1
- package/dist/{chunk-GGS3ATPB.js → chunk-IZ66FKPC.js} +1 -1
- package/dist/{chunk-EX6ORR7P.js → chunk-JNPFEBUR.js} +1 -1
- package/dist/{chunk-AU26ZZTX.js → chunk-JTNEF5ZP.js} +1 -1
- package/dist/{chunk-K2PLULJD.js → chunk-JUVY6PHY.js} +1 -1
- package/dist/{chunk-JQ7ZZQXC.js → chunk-K4K2BGQC.js} +3 -3
- package/dist/{chunk-VZA7BPCK.js → chunk-K75WIRI5.js} +1 -1
- package/dist/{chunk-4R4YUOVY.js → chunk-KKLCXRW6.js} +1 -1
- package/dist/{chunk-YGMQXS2J.js → chunk-KN7GZWKK.js} +1 -1
- package/dist/{chunk-I2VU2DTS.js → chunk-L3BUPFAQ.js} +4 -4
- package/dist/{chunk-2GE5X2A5.js → chunk-LLQWEGXD.js} +1 -1
- package/dist/chunk-LTPOMMAB.js +2 -0
- package/dist/{chunk-AUBSLPJZ.js → chunk-LWCP4GLY.js} +1 -1
- package/dist/{chunk-VQZOKTJ2.js → chunk-LXCTV75T.js} +1 -1
- package/dist/{chunk-YH4VZVHJ.js → chunk-LZGAFKYH.js} +1 -1
- package/dist/{chunk-3QICDXY5.js → chunk-LZPYIFHZ.js} +1 -1
- package/dist/{chunk-WQR2GYP7.js → chunk-M3TFOFUQ.js} +1 -1
- package/dist/{chunk-MKPDF26Q.js → chunk-M7Y5GGVJ.js} +1 -1
- package/dist/{chunk-52VCA4K2.js → chunk-MEMXFTLD.js} +1 -1
- package/dist/{chunk-U7NRZBB5.js → chunk-MINDIQET.js} +1 -1
- package/dist/{chunk-JX5NVKTV.js → chunk-MP6NCJFE.js} +1 -1
- package/dist/{chunk-VA3BSIUQ.js → chunk-MSYRAPDK.js} +1 -1
- package/dist/{chunk-HJLMH7ZM.js → chunk-MUX2A37P.js} +1 -1
- package/dist/{chunk-EQWMOGLO.js → chunk-NCP54AIQ.js} +2 -2
- package/dist/{chunk-QQI6N3FO.js → chunk-NVD2MXHQ.js} +1 -1
- package/dist/{chunk-2EVP636F.js → chunk-O2Y46A3G.js} +3 -3
- package/dist/{chunk-ONZ2CSTZ.js → chunk-O3TXAMFW.js} +1 -1
- package/dist/{chunk-YI4ESDAX.js → chunk-O5KTMDTH.js} +1 -1
- package/dist/{chunk-HBVHIEPB.js → chunk-OK6NLITG.js} +1 -1
- package/dist/{chunk-JFBEHCJN.js → chunk-OKA6FPJM.js} +1 -1
- package/dist/{chunk-65BG6GAE.js → chunk-OVNTCBNS.js} +1 -1
- package/dist/{chunk-4523YDTG.js → chunk-P4VFC6HO.js} +1 -1
- package/dist/{chunk-ULGBK4NS.js → chunk-PC22QRIY.js} +1 -1
- package/dist/{chunk-B2WFW74J.js → chunk-PEUIHME2.js} +1 -1
- package/dist/{chunk-Z777GGHB.js → chunk-PI7OXS62.js} +1 -1
- package/dist/{chunk-MHB6DMKZ.js → chunk-POA336CU.js} +1 -1
- package/dist/{chunk-ZZNQIFFI.js → chunk-PR5EGLEI.js} +1 -1
- package/dist/{chunk-MW2WNYJO.js → chunk-PRBWZXFA.js} +2 -2
- package/dist/{chunk-4BUEOKFV.js → chunk-PWNYTIVA.js} +1 -1
- package/dist/{chunk-FYCD765R.js → chunk-Q4JV4U65.js} +58 -58
- package/dist/{chunk-BRVIK3BU.js → chunk-Q5AKIQIE.js} +1 -1
- package/dist/{chunk-EC5IP5HZ.js → chunk-QB77LRF4.js} +1 -1
- package/dist/{chunk-AGXAJ2II.js → chunk-QUNIY6NN.js} +1 -1
- package/dist/{chunk-LHQUCRCH.js → chunk-QVMXL675.js} +1 -1
- package/dist/{chunk-FPPVNF53.js → chunk-R6TFRAMZ.js} +1 -1
- package/dist/{chunk-567D5ZTO.js → chunk-RAVAJZV2.js} +7 -7
- package/dist/{chunk-7ZJWUWSN.js → chunk-RDAIOJCR.js} +1 -1
- package/dist/{chunk-PBWYQR5I.js → chunk-RRKYHUOD.js} +1 -1
- package/dist/{chunk-GXMD23XB.js → chunk-S7XCOBYD.js} +1 -1
- package/dist/{chunk-32Y6QVFG.js → chunk-SALZ6WSF.js} +1 -1
- package/dist/{chunk-4NUSW4A2.js → chunk-SIHX5FW5.js} +1 -1
- package/dist/{chunk-USJ3LUAL.js → chunk-SSOUYKVG.js} +1 -1
- package/dist/{chunk-2B75UL7Y.js → chunk-SVIIUKJ2.js} +1 -1
- package/dist/{chunk-QVP4FSKT.js → chunk-T77LTLAD.js} +1 -1
- package/dist/{chunk-KRRZCY7U.js → chunk-TAY7J5VS.js} +1 -1
- package/dist/chunk-TD6GCEIK.js +2 -0
- package/dist/{chunk-ZY65IZJR.js → chunk-TM6VLC6V.js} +1 -1
- package/dist/{chunk-YKL5H4K6.js → chunk-TMH4TPMB.js} +1 -1
- package/dist/{chunk-COJINPOK.js → chunk-TU2KPOW2.js} +2 -2
- package/dist/{chunk-3BSYOCSW.js → chunk-U2VYTVKV.js} +1 -1
- package/dist/{chunk-W3NWHWK2.js → chunk-UCVP7ZY4.js} +1 -1
- package/dist/{chunk-436FZ4KG.js → chunk-UICJ2KLJ.js} +1 -1
- package/dist/{chunk-QWZJ5QDO.js → chunk-UMNCM4RJ.js} +1 -1
- package/dist/{chunk-LNHBZEDC.js → chunk-UWPG5MWM.js} +1 -1
- package/dist/{chunk-MJKRJGER.js → chunk-V3OZJO7Y.js} +1 -1
- package/dist/{chunk-ZKPY3AXW.js → chunk-VE4HLIGA.js} +1 -1
- package/dist/{chunk-K3OSK6PB.js → chunk-W2HRX3DR.js} +1 -1
- package/dist/{chunk-B7JLM3IX.js → chunk-W54BX6HC.js} +1 -1
- package/dist/{chunk-IZ65ZPWY.js → chunk-W5HFUBXD.js} +1 -1
- package/dist/{chunk-GRO6DLN3.js → chunk-WEJR2V7R.js} +1 -1
- package/dist/{chunk-A4BB6GLN.js → chunk-X3A4QPA3.js} +1 -1
- package/dist/{chunk-G2KTWFMU.js → chunk-X52YIWGG.js} +1 -1
- package/dist/{chunk-UEPJ26X2.js → chunk-X6FCXBXU.js} +1 -1
- package/dist/{chunk-LXM7VHYN.js → chunk-X7S7IGCV.js} +1 -1
- package/dist/{chunk-UNWPBMVM.js → chunk-XCUF5AVM.js} +1 -1
- package/dist/{chunk-FPVGA6XT.js → chunk-XHFU5TGS.js} +1 -1
- package/dist/{chunk-ZRDX2ARO.js → chunk-XNXJXGVB.js} +2 -2
- package/dist/{chunk-JRSEAXFE.js → chunk-XZ6J3Y2W.js} +1 -1
- package/dist/{chunk-JGRXMTME.js → chunk-YDB72F4K.js} +1 -1
- package/dist/{chunk-7DFBOVUB.js → chunk-YJAQZMJT.js} +1 -1
- package/dist/{chunk-GYDJO32R.js → chunk-YO6SNXBJ.js} +1 -1
- package/dist/{chunk-RLOJH5O6.js → chunk-Z24SD2EJ.js} +1 -1
- package/dist/{chunk-ENG2UTMX.js → chunk-Z36KVIRR.js} +1 -1
- package/dist/{chunk-PTISAIZW.js → chunk-Z6SI7YNV.js} +1 -1
- package/dist/{chunk-6NFOH4AC.js → chunk-ZAQGIC33.js} +1 -1
- package/dist/{chunk-AIGQCMGY.js → chunk-ZCL7XIVS.js} +1 -1
- package/dist/{chunk-ORNVIEUA.js → chunk-ZDCXWEQG.js} +1 -1
- package/dist/{chunk-WX4VGH5Q.js → chunk-ZDQYGLCZ.js} +1 -1
- package/dist/{chunk-6TNLITJO.js → chunk-ZHAMVLQZ.js} +1 -1
- package/dist/{chunk-H4KPNGY4.js → chunk-ZMWTRXFH.js} +1 -1
- package/dist/{chunk-GET4DINR.js → chunk-ZO3ZAMUU.js} +1 -1
- package/dist/{chunk-GI2JPIX5.js → chunk-ZZZGTDYE.js} +1 -1
- package/dist/commands-R5AYK6XM.js +2 -0
- package/dist/{committer-26UZDYSA.js → committer-UO3B3S5Y.js} +1 -1
- package/dist/{config-B472DZSR.js → config-YMHI3H3Y.js} +1 -1
- package/dist/cover-cmd-DVQIGFDY.js +2 -0
- package/dist/{credentials-TLT3RQOO.js → credentials-BCR73VGS.js} +1 -1
- package/dist/{deps-bundle-CMTIWBS5.js → deps-bundle-6WLX44OA.js} +1 -1
- package/dist/{deps-resolve-XLFZK74A.js → deps-resolve-DSAKPZ3T.js} +1 -1
- package/dist/{design-chat-I7X3QDDY.js → design-chat-YUI2JPO6.js} +1 -1
- package/dist/design-committer-7YIPFKMO.js +2 -0
- package/dist/design-headless-KIP6R7UV.js +2 -0
- package/dist/{design-remote-UDC5FP45.js → design-remote-XMSHDDUX.js} +2 -2
- package/dist/device-env-K7J5NN66.js +2 -0
- package/dist/dispatch-BV6XMCN3.js +2 -0
- package/dist/{doctor-UHFCIM4B.js → doctor-PGTNOMSP.js} +1 -1
- package/dist/{docx-convert-N4KMLLKO.js → docx-convert-DO5AQYD3.js} +1 -1
- package/dist/{dossier-6KMKEIXV.js → dossier-5XKNAK6Q.js} +1 -1
- package/dist/evidence-RO3RDZXO.js +2 -0
- package/dist/evidence-presentation-LSFOZGLH.js +2 -0
- package/dist/evolve-cmd-U2ALVGMT.js +2 -0
- package/dist/evolve-remote-K2MCCVMM.js +2 -0
- package/dist/{explain-cmd-R67B4YR3.js → explain-cmd-KNDORU2D.js} +1 -1
- package/dist/{explain-cmd-235TY7QX.js → explain-cmd-UWK5YVXG.js} +1 -1
- package/dist/explore-S2BGQUIF.js +2 -0
- package/dist/{explore-context-tty-YXEFT32U.js → explore-context-tty-WJHUSP3A.js} +1 -1
- package/dist/{explore-entry-V6L5FSP4.js → explore-entry-3EX2T3NS.js} +4 -4
- package/dist/{explore-live-N5VBLBUI.js → explore-live-TRY5A2ME.js} +1 -1
- package/dist/{explore-run-tty-ZZQ33GNA.js → explore-run-tty-ZV5XFKZA.js} +2 -2
- package/dist/{extract-bind-BTINHHE5.js → extract-bind-TXUBMK3T.js} +3 -3
- package/dist/extract-chat-VPYDGQKO.js +2 -0
- package/dist/{extract-cmd-45OZETCM.js → extract-cmd-YUOYMVF5.js} +2 -2
- package/dist/extract-headless-UWTAPOET.js +2 -0
- package/dist/{feeder-L55TH2NC.js → feeder-NGWIPZ26.js} +1 -1
- package/dist/folder-flags-WV7UV3JG.js +2 -0
- package/dist/gaps-cmd-PFV3FZCM.js +3 -0
- package/dist/gate-7ALXLCNB.js +2 -0
- package/dist/gate-NB5CJMTN.js +2 -0
- package/dist/{generate-headless-DAH3HHRQ.js → generate-headless-KMBBZTLS.js} +2 -2
- package/dist/hold-passthrough-JGHWMYDM.js +2 -0
- package/dist/{impact-cmd-3VFJAKYK.js → impact-cmd-PW33L5RF.js} +2 -2
- package/dist/index.js +4154 -190
- package/dist/ingest-ZHHHBUXR.js +2 -0
- package/dist/{ingest-cmd-YSEH5EPU.js → ingest-cmd-MXYILQLV.js} +3 -3
- package/dist/ingest-remote-2EEJP6ML.js +2 -0
- package/dist/install-7J34AYB6.js +2 -0
- package/dist/{interactive-bind-P3GTFIZM.js → interactive-bind-FDWJUTI6.js} +4 -4
- package/dist/{interactive-remote-PBRQHTAF.js → interactive-remote-O2Q2FNOH.js} +1 -1
- package/dist/lane-CNGO7LH5.js +2 -0
- package/dist/lattice-auth-TXNDLHM6.js +2 -0
- package/dist/{lifecycle-cmd-PUNFWKV5.js → lifecycle-cmd-GFHDBRXX.js} +1 -1
- package/dist/{list-cmd-RD7YBF4S.js → list-cmd-RR75PMPE.js} +1 -1
- package/dist/{list-commands-UZELZAB3.js → list-commands-3QGZWJ5P.js} +1 -1
- package/dist/{list-remote-KGKXPCQA.js → list-remote-AA3VSWOI.js} +1 -1
- package/dist/{locks-cmd-LXZ6I4QG.js → locks-cmd-AZKCSGHI.js} +1 -1
- package/dist/{logical-ids-D5PFYY4C.js → logical-ids-74PLU3VR.js} +1 -1
- package/dist/login-flow-ZQ6UFTS2.js +2 -0
- package/dist/{maintenance-cmd-WRWBCP3R.js → maintenance-cmd-OHGVARQ2.js} +1 -1
- package/dist/{mobile-prompts-Z7NQHRGP.js → mobile-prompts-FZRKLLTN.js} +1 -1
- package/dist/{objective-variable-gate-3Z7DNVVC.js → objective-variable-gate-V5HHFOUS.js} +1 -1
- package/dist/{onboarding-ZP4XDYEO.js → onboarding-NXGMV3VG.js} +1 -1
- package/dist/open-provider-XDJKT3W3.js +2 -0
- package/dist/pdf-convert-YB6PJFMI.js +2 -0
- package/dist/persist-recorded-session-INFN4JZT.js +3 -0
- package/dist/phase-seed-ZZSJME7M.js +2 -0
- package/dist/pipeline-MVZRI6YZ.js +2 -0
- package/dist/{policy-commands-TY6WOR73.js → policy-commands-3YJ6YCDN.js} +1 -1
- package/dist/{prepare-target-EVL2QSXA.js → prepare-target-DII5WZCX.js} +1 -1
- package/dist/{pull-cmd-QJQANBAW.js → pull-cmd-XZN53XFZ.js} +1 -1
- package/dist/{pull-route-AIOTLA3D.js → pull-route-R33BVADE.js} +1 -1
- package/dist/readmodel-TRV4E3MW.js +2 -0
- package/dist/real-device-run-DGENHGUV.js +2 -0
- package/dist/{reconcile-cmd-IJTQAJZX.js → reconcile-cmd-KFPRCCJB.js} +4 -4
- package/dist/reconcile-deps-UDQBWSLE.js +2 -0
- package/dist/{reconcile-remote-23D6SXXT.js → reconcile-remote-6WISFGRG.js} +2 -2
- package/dist/{recording-banner-MNRMMEX4.js → recording-banner-XOX2CDCF.js} +1 -1
- package/dist/registry-NV3EMDMK.js +2 -0
- package/dist/remote-entry-BCTFT643.js +2 -0
- package/dist/{remote-mode-AFNCN6EE.js → remote-mode-4HN27MD4.js} +1 -1
- package/dist/{remote-words-RCNFI2TQ.js → remote-words-LFDYKIZ7.js} +1 -1
- package/dist/{require-project-folder-7UH43GHI.js → require-project-folder-ZK4JJCDB.js} +1 -1
- package/dist/{resolve-run-intent-XEWFYMGN.js → resolve-run-intent-LYLVNNDZ.js} +1 -1
- package/dist/{resolver-QMPX6RBR.js → resolver-RMHGGYRP.js} +1 -1
- package/dist/revert-QKHPCRT6.js +2 -0
- package/dist/{review-cmd-2OECKNL5.js → review-cmd-UGF2FC5Y.js} +1 -1
- package/dist/run-CSYGVV3D.js +2 -0
- package/dist/run-YUHHD54J.js +2 -0
- package/dist/{run-channel-63SVP5OI.js → run-channel-IIIYXOIW.js} +1 -1
- package/dist/run-remote-BGKQDAOA.js +2 -0
- package/dist/{run-startup-gate-USQFSW47.js → run-startup-gate-4XE73OON.js} +1 -1
- package/dist/run-test-md-G6U3RU2Q.js +19 -0
- package/dist/session-worker.js +2 -2
- package/dist/{sessions-CFV7FOIT.js → sessions-NH2EG7BP.js} +1 -1
- package/dist/{sessions-cmd-LQ2LZQOC.js → sessions-cmd-CABAX7BO.js} +2 -2
- package/dist/{sessions-remote-H7CQST42.js → sessions-remote-Y4FTZL7Y.js} +1 -1
- package/dist/{skill-installer-LKYY6XFJ.js → skill-installer-FS2AV7GX.js} +1 -1
- package/dist/spawner-MQ4XEHIX.js +2 -0
- package/dist/{store-KM5MG3XB.js → store-PLKJZTGC.js} +1 -1
- package/dist/store-choice-UAB6Z4AL.js +2 -0
- package/dist/{store-guard-34GG2TW2.js → store-guard-DUN2X3SR.js} +1 -1
- package/dist/{store-site-ZSFINU6C.js → store-site-K5NHLI7D.js} +1 -1
- package/dist/stream-warnings-GM7YEOVG.js +2 -0
- package/dist/sync-cmd-AGTOGPYM.js +2 -0
- package/dist/{sync-setup-QQXYO6R4.js → sync-setup-4KIY3PDO.js} +1 -1
- package/dist/tcg-generate-CUY4AZ2V.js +2 -0
- package/dist/testmd-actions-UD6PAWUX.js +2 -0
- package/dist/{testmd-sync-PQ4GFKHB.js → testmd-sync-EEJ7GPLR.js} +1 -1
- package/dist/token-refresh-K6PVBBFE.js +2 -0
- package/dist/{trust-gate-AT2XBWN4.js → trust-gate-674C2NZS.js} +1 -1
- package/dist/{turn-preflight-LHYLRL7G.js → turn-preflight-R4PU6NYY.js} +1 -1
- package/dist/{use-case-ref-NA3IXGQW.js → use-case-ref-44BPIP4N.js} +1 -1
- package/dist/{validate-basic-3DX3MMC7.js → validate-basic-3JZRZL45.js} +1 -1
- package/dist/{variable-receipt-BXSZO36E.js → variable-receipt-7PRKDTRJ.js} +1 -1
- package/dist/verdicts-PVB7TV5S.js +2 -0
- package/dist/{version-check-OV6AOVED.js → version-check-IY3YSQIP.js} +1 -1
- package/dist/{view-cmd-QDKBBNIU.js → view-cmd-WUIGTRFX.js} +1 -1
- package/dist/{walk-session-BAYYPIKN.js → walk-session-EH7227WR.js} +1 -1
- package/dist/with-telemetry-7JMZUBUZ.js +2 -0
- package/package.json +16 -16
- package/dist/ChatSurface-XUV3EQPZ.js +0 -2
- package/dist/EvidenceViewOffer-EIANIYN7.js +0 -2
- package/dist/FolderPicker-XOA7FTHF.js +0 -2
- package/dist/InfoBox-OBH7SUGC.js +0 -2
- package/dist/ProjectPicker-6KRLKV4U.js +0 -2
- package/dist/SaveSessionPrompt-J2OPDEOO.js +0 -2
- package/dist/SingleShotApp-QI4B2TSL.js +0 -2
- package/dist/TestMdRunView-I4MV54FB.js +0 -2
- package/dist/TestrunEvidenceTable-WEIUSW3E.js +0 -2
- package/dist/bridge-SDEP7Y33.js +0 -2
- package/dist/chat-committer-FM5NG46O.js +0 -2
- package/dist/chat-controller-FWFQVZTB.js +0 -2
- package/dist/child-H2YSDFCG.js +0 -2
- package/dist/chunk-34R7BNZ2.js +0 -2
- package/dist/chunk-5T6II7VN.js +0 -7
- package/dist/chunk-KF4DKXSS.js +0 -2
- package/dist/chunk-NOFJXCYP.js +0 -5
- package/dist/chunk-SB6P5EQH.js +0 -2
- package/dist/commands-QOORPTSI.js +0 -2
- package/dist/cover-cmd-3VO6QC5Y.js +0 -2
- package/dist/design-committer-Y7R56RFZ.js +0 -2
- package/dist/design-headless-HUQOXLZB.js +0 -2
- package/dist/device-env-MMGISNHN.js +0 -2
- package/dist/dispatch-P2445PUU.js +0 -2
- package/dist/evidence-M3JTOJNL.js +0 -2
- package/dist/evidence-presentation-DV3DRB4S.js +0 -2
- package/dist/evolve-cmd-K3JXACMN.js +0 -2
- package/dist/evolve-remote-CUDVV2O2.js +0 -2
- package/dist/explore-UDD5FHXW.js +0 -2
- package/dist/extract-chat-ABZ5S7UU.js +0 -2
- package/dist/extract-headless-ALEFAMVS.js +0 -2
- package/dist/folder-flags-HTKJCXKB.js +0 -2
- package/dist/gaps-cmd-ROGQWK5X.js +0 -3
- package/dist/gate-QA5J7UZA.js +0 -2
- package/dist/gate-XFFFX5ZF.js +0 -2
- package/dist/hold-passthrough-K5PP26CP.js +0 -2
- package/dist/ingest-S5R736ZV.js +0 -2
- package/dist/ingest-remote-C6AP2Q7E.js +0 -2
- package/dist/install-B26Y2NU4.js +0 -2
- package/dist/lane-7IEAE6AC.js +0 -2
- package/dist/lattice-auth-7EL4ET3P.js +0 -2
- package/dist/login-flow-CHLGQGHK.js +0 -2
- package/dist/open-provider-U26BBVUE.js +0 -2
- package/dist/pdf-convert-LMKOKLXT.js +0 -2
- package/dist/persist-recorded-session-4IRYG5CJ.js +0 -3
- package/dist/phase-seed-2H6OXZXT.js +0 -2
- package/dist/pipeline-U7D25NST.js +0 -2
- package/dist/readmodel-KXCFPL2M.js +0 -2
- package/dist/real-device-run-QODMDUXF.js +0 -2
- package/dist/reconcile-deps-2CTIFXDR.js +0 -2
- package/dist/registry-MZYBLEW2.js +0 -2
- package/dist/remote-entry-DW2J56N4.js +0 -2
- package/dist/revert-37346WLE.js +0 -2
- package/dist/run-JWOHNWA3.js +0 -2
- package/dist/run-QFJ6ZRVD.js +0 -2
- package/dist/run-remote-66QTUQ2M.js +0 -2
- package/dist/run-test-md-7DRWCSQE.js +0 -19
- package/dist/spawner-C7NLLM4F.js +0 -2
- package/dist/store-choice-4J2NN6OQ.js +0 -2
- package/dist/stream-warnings-N4KVVWXV.js +0 -2
- package/dist/sync-cmd-3CHSWWWW.js +0 -2
- package/dist/tcg-generate-IPD5FQUW.js +0 -2
- package/dist/testmd-actions-V7P7BMKE.js +0 -2
- package/dist/token-refresh-LR33BKAB.js +0 -2
- package/dist/verdicts-7GKZEDHV.js +0 -2
- package/dist/with-telemetry-62LW4VFI.js +0 -2
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as cp}from"./chunk-34R7BNZ2.js";import{a as V,b as Me,c as w,d as fw,e as ap,f as dw}from"./chunk-UR6MHSHU.js";var Mt=w(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.PROFILES=Je.Codes=Je.DEFAULT_PROFILE=Je.CONTRACT_VERSION=void 0;Je.profileChain=pw;Je.CONTRACT_VERSION="0.1";Je.DEFAULT_PROFILE="L0";Je.Codes={MANIFEST_MISSING:"manifest.missing",MANIFEST_PARSE:"manifest.parse",RESULT_MISSING:"result.missing",RESULT_PARSE:"result.parse",VERSION_UNSUPPORTED:"version.unsupported",SCHEMA:"schema.invalid",TEST_ID_MISMATCH:"test.id_mismatch",DEFINITION_MISSING:"definition.missing",DEFINITION_PATH_ESCAPE:"definition.path_escape",ORDINAL_COLLISION:"ordinal.collision",ORDINAL_NOT_INCREASING:"ordinal.not_increasing",ENDED_BEFORE_STARTED:"ended.before_started",TOTALS_MISMATCH:"totals.mismatch",HASH_MISSING:"definition.hash_missing",HASH_MISMATCH:"definition.hash_mismatch",STATUS_DISAGREES:"status.disagrees_with_steps",L1_LOGS_MISSING:"l1.logs.missing",L1_LOGS_META_MISSING:"l1.logs.meta_missing",L1_LOGS_META_INVALID:"l1.logs.meta_invalid",L1_LOG_FILE_MISSING:"l1.logs.file_missing",L1_LOG_PATH_ESCAPE:"l1.logs.path_escape",L1_STEPS_MISSING:"l1.steps.missing",L1_STEPS_MALFORMED:"l1.steps.malformed_name",L1_STEPS_UNMATCHED:"l1.steps.unmatched",L1_STEPS_SCREENSHOT_MISSING:"l1.steps.screenshot_missing",L1_COVERAGE_MISSING:"l1.coverage.missing",L1_VIDEO_INVALID:"l1.video.invalid",L1_FAILURE_INVALID:"l1.failure.invalid",L1_FAILURE_UNMATCHED:"l1.failure.unmatched",L1_FAILURE_REF_ESCAPE:"l1.failure.ref_escape",L1_FAILURE_REF_MISSING:"l1.failure.ref_missing",L1_FAILURE_STATUS_DISAGREES:"l1.failure.status_disagrees",L1_FAILURE_MISSING:"l1.failure.missing",L1_FAILURE_INDEX_MISSING:"l1.failure_index.missing",L1_FAILURE_INDEX_INVALID:"l1.failure_index.invalid",L1_FAILURE_INDEX_DANGLING:"l1.failure_index.dangling",L1_FAILURE_INDEX_INCOMPLETE:"l1.failure_index.incomplete",CATALOG_MISSING:"catalog.missing",CATALOG_HASH_MISMATCH:"catalog.hash_mismatch",CATALOG_IDENTITY_MISMATCH:"catalog.identity_mismatch",CATALOG_UNREFERENCED:"catalog.unreferenced"};Je.PROFILES={L0:["L0"],L1:["L0","L1"]};function pw(r){return Je.PROFILES[r]??null}});var jt=w(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.err=hw;Ni.warn=mw;function hw(r,e,t){return{code:r,severity:"error",location:e,message:t}}function mw(r,e,t){return{code:r,severity:"warning",location:e,message:t}}});var Ja=w((wj,lp)=>{"use strict";lp.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Ii=w(fp=>{"use strict";var up={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function yw(r){return function(...e){return e.length&&(r=r.replace(/\{(\d)\}/g,(t,n)=>e[n]||"")),new Error("ADM-ZIP: "+r)}}for(let r of Object.keys(up))fp[r]=yw(up[r])});var yp=w(($j,mp)=>{"use strict";var gw=V("fs"),he=V("path"),dp=Ja(),_w=Ii(),vw=typeof process=="object"&&process.platform==="win32",pp=r=>typeof r=="object"&&r!==null,hp=new Uint32Array(256).map((r,e)=>{for(let t=0;t<8;t++)(e&1)!==0?e=3988292384^e>>>1:e>>>=1;return e>>>0});function ae(r){this.sep=he.sep,this.fs=gw,pp(r)&&pp(r.fs)&&typeof r.fs.statSync=="function"&&(this.fs=r.fs)}mp.exports=ae;ae.prototype.makeDir=function(r){let e=this;function t(n){let s=n.split(e.sep)[0];n.split(e.sep).forEach(function(i){if(!(!i||i.substr(-1,1)===":")){s+=e.sep+i;var o;try{o=e.fs.statSync(s)}catch(a){if(a.message&&a.message.startsWith("ENOENT"))e.fs.mkdirSync(s);else throw a}if(o&&o.isFile())throw _w.FILE_IN_THE_WAY(`"${s}"`)}})}t(r)};ae.prototype.writeFileTo=function(r,e,t,n){let s=this;if(s.fs.existsSync(r)){if(!t)return!1;var i=s.fs.statSync(r);if(i.isDirectory())return!1}var o=he.dirname(r);s.fs.existsSync(o)||s.makeDir(o);var a;try{a=s.fs.openSync(r,"w",438)}catch{s.fs.chmodSync(r,438),a=s.fs.openSync(r,"w",438)}if(a)try{s.fs.writeSync(a,e,0,e.length,0)}finally{s.fs.closeSync(a)}return s.fs.chmodSync(r,n||438),!0};ae.prototype.writeFileToAsync=function(r,e,t,n,s){typeof n=="function"&&(s=n,n=void 0);let i=this;i.fs.exists(r,function(o){if(o&&!t)return s(!1);i.fs.stat(r,function(a,c){if(o&&c.isDirectory())return s(!1);var l=he.dirname(r);i.fs.exists(l,function(h){h||i.makeDir(l),i.fs.open(r,"w",438,function(f,d){f?i.fs.chmod(r,438,function(){i.fs.open(r,"w",438,function(p,y){i.fs.write(y,e,0,e.length,0,function(){i.fs.close(y,function(){i.fs.chmod(r,n||438,function(){s(!0)})})})})}):d?i.fs.write(d,e,0,e.length,0,function(){i.fs.close(d,function(){i.fs.chmod(r,n||438,function(){s(!0)})})}):i.fs.chmod(r,n||438,function(){s(!0)})})})})})};ae.prototype.findFiles=function(r){let e=this;function t(n,s,i){typeof s=="boolean"&&(i=s,s=void 0);let o=[];return e.fs.readdirSync(n).forEach(function(a){let c=he.join(n,a),l=e.fs.statSync(c);(!s||s.test(c))&&o.push(he.normalize(c)+(l.isDirectory()?e.sep:"")),l.isDirectory()&&i&&(o=o.concat(t(c,s,i)))}),o}return t(r,void 0,!0)};ae.prototype.findFilesAsync=function(r,e){let t=this,n=[];t.fs.readdir(r,function(s,i){if(s)return e(s);let o=i.length;if(!o)return e(null,n);i.forEach(function(a){a=he.join(r,a),t.fs.stat(a,function(c,l){if(c)return e(c);l&&(n.push(he.normalize(a)+(l.isDirectory()?t.sep:"")),l.isDirectory()?t.findFilesAsync(a,function(h,f){if(h)return e(h);n=n.concat(f),--o||e(null,n)}):--o||e(null,n))})})})};ae.prototype.getAttributes=function(){};ae.prototype.setAttributes=function(){};ae.crc32update=function(r,e){return hp[(r^e)&255]^r>>>8};ae.crc32=function(r){typeof r=="string"&&(r=Buffer.from(r,"utf8"));let e=r.length,t=-1;for(let n=0;n<e;)t=ae.crc32update(t,r[n++]);return~t>>>0};ae.methodToString=function(r){switch(r){case dp.STORED:return"STORED ("+r+")";case dp.DEFLATED:return"DEFLATED ("+r+")";default:return"UNSUPPORTED ("+r+")"}};ae.canonical=function(r){if(!r)return"";let e=he.posix.normalize("/"+r.split("\\").join("/"));return he.join(".",e)};ae.zipnamefix=function(r){if(!r)return"";let e=he.posix.normalize("/"+r.split("\\").join("/"));return he.posix.join(".",e)};ae.findLast=function(r,e){if(!Array.isArray(r))throw new TypeError("arr is not array");let t=r.length>>>0;for(let n=t-1;n>=0;n--)if(e(r[n],n,r))return r[n]};ae.sanitize=function(r,e){r=he.resolve(he.normalize(r));for(var t=e.split("/"),n=0,s=t.length;n<s;n++){var i=he.normalize(he.join(r,t.slice(n,s).join(he.sep)));if(i===r||i.startsWith(r+he.sep))return i}return he.normalize(he.join(r,he.basename(e)))};ae.toBuffer=function(e,t){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?t(e):Buffer.alloc(0)};ae.readBigUInt64LE=function(r,e){let t=r.readUInt32LE(e);return r.readUInt32LE(e+4)*4294967296+t};ae.writeBigUInt64LE=function(r,e,t){let n=e>>>0,s=Math.floor(e/4294967296)>>>0;r.writeUInt32LE(n,t),r.writeUInt32LE(s,t+4)};ae.fromDOS2Date=function(r){return new Date((r>>25&127)+1980,Math.max((r>>21&15)-1,0),Math.max(r>>16&31,1),r>>11&31,r>>5&63,(r&31)<<1)};ae.fromDate2DOS=function(r){let e=0,t=0;return r.getFullYear()>1979&&(e=(r.getFullYear()-1980&127)<<9|r.getMonth()+1<<5|r.getDate(),t=r.getHours()<<11|r.getMinutes()<<5|r.getSeconds()>>1),e<<16|t};ae.isWin=vw;ae.crcTable=hp});var _p=w((Sj,gp)=>{"use strict";var bw=V("path");gp.exports=function(r,{fs:e}){var t=r||"",n=i(),s=null;function i(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return t&&e.existsSync(t)?(s=e.statSync(t),n.directory=s.isDirectory(),n.mtime=s.mtime,n.atime=s.atime,n.executable=(73&s.mode)!==0,n.readonly=(128&s.mode)===0,n.hidden=bw.basename(t)[0]==="."):console.warn("Invalid path: "+t),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:t,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var bp=w((Tj,vp)=>{"use strict";vp.exports={efs:!0,encode:r=>Buffer.from(r,"utf8"),decode:r=>r.toString("utf8")}});var Qr=w((Oj,Xr)=>{"use strict";Xr.exports=yp();Xr.exports.Constants=Ja();Xr.exports.Errors=Ii();Xr.exports.FileAttr=_p();Xr.exports.decoder=bp()});var Ep=w((Nj,wp)=>{"use strict";var Jt=Qr(),N=Jt.Constants;wp.exports=function(){var r=20,e=10,t=0,n=0,s=0,i=0,o=0,a=0,c=0,l=0,h=0,f=0,d=0,p=0,y=0;r|=Jt.isWin?2560:768,t|=N.FLG_EFS;let u={extraLen:0},m=g=>Math.max(0,g)>>>0,_=g=>Math.max(0,g)&65535,v=g=>Math.max(0,g)&255;return s=Jt.fromDate2DOS(new Date),{get made(){return r},set made(g){r=g},get version(){return e},set version(g){e=g},get flags(){return t},set flags(g){t=g},get flags_efs(){return(t&N.FLG_EFS)>0},set flags_efs(g){g?t|=N.FLG_EFS:t&=~N.FLG_EFS},get flags_desc(){return(t&N.FLG_DESC)>0},set flags_desc(g){g?t|=N.FLG_DESC:t&=~N.FLG_DESC},get method(){return n},set method(g){switch(g){case N.STORED:this.version=10;break;case N.DEFLATED:default:this.version=20}n=g},get time(){return Jt.fromDOS2Date(this.timeval)},set time(g){g=new Date(g),this.timeval=Jt.fromDate2DOS(g)},get timeval(){return s},set timeval(g){s=m(g)},get timeHighByte(){return v(s>>>8)},get crc(){return i},set crc(g){i=m(g)},get compressedSize(){return o},set compressedSize(g){o=m(g)},get size(){return a},set size(g){a=m(g)},get fileNameLength(){return c},set fileNameLength(g){c=g},get extraLength(){return l},set extraLength(g){l=g},get extraLocalLength(){return u.extraLen},set extraLocalLength(g){u.extraLen=g},get commentLength(){return h},set commentLength(g){h=g},get diskNumStart(){return f},set diskNumStart(g){f=m(g)},get inAttr(){return d},set inAttr(g){d=m(g)},get attr(){return p},set attr(g){p=m(g)},get fileAttr(){return(p||0)>>16&4095},get offset(){return y},set offset(g){y=m(g)},get encrypted(){return(t&N.FLG_ENC)===N.FLG_ENC},get centralHeaderSize(){return N.CENHDR+c+l+h},get realDataOffset(){return y+N.LOCHDR+u.fnameLen+u.extraLen},get localHeader(){return u},loadLocalHeaderFromBinary:function(g){var b=g.slice(y,y+N.LOCHDR);if(b.readUInt32LE(0)!==N.LOCSIG)throw Jt.Errors.INVALID_LOC();u.version=b.readUInt16LE(N.LOCVER),u.flags=b.readUInt16LE(N.LOCFLG),u.flags_desc=(u.flags&N.FLG_DESC)>0,u.method=b.readUInt16LE(N.LOCHOW),u.time=b.readUInt32LE(N.LOCTIM),u.crc=b.readUInt32LE(N.LOCCRC),u.compressedSize=b.readUInt32LE(N.LOCSIZ),u.size=b.readUInt32LE(N.LOCLEN),u.fnameLen=b.readUInt16LE(N.LOCNAM),u.extraLen=b.readUInt16LE(N.LOCEXT);let E=y+N.LOCHDR+u.fnameLen,$=E+u.extraLen;return g.slice(E,$)},loadFromBinary:function(g){if(g.length!==N.CENHDR||g.readUInt32LE(0)!==N.CENSIG)throw Jt.Errors.INVALID_CEN();r=g.readUInt16LE(N.CENVEM),e=g.readUInt16LE(N.CENVER),t=g.readUInt16LE(N.CENFLG),n=g.readUInt16LE(N.CENHOW),s=g.readUInt32LE(N.CENTIM),i=g.readUInt32LE(N.CENCRC),o=g.readUInt32LE(N.CENSIZ),a=g.readUInt32LE(N.CENLEN),c=g.readUInt16LE(N.CENNAM),l=g.readUInt16LE(N.CENEXT),h=g.readUInt16LE(N.CENCOM),f=g.readUInt16LE(N.CENDSK),d=g.readUInt16LE(N.CENATT),p=g.readUInt32LE(N.CENATX),y=g.readUInt32LE(N.CENOFF)},localHeaderToBinary:function(){var g=Buffer.alloc(N.LOCHDR);return g.writeUInt32LE(N.LOCSIG,0),g.writeUInt16LE(e,N.LOCVER),g.writeUInt16LE(t&~N.FLG_DESC,N.LOCFLG),g.writeUInt16LE(n,N.LOCHOW),g.writeUInt32LE(s,N.LOCTIM),g.writeUInt32LE(i,N.LOCCRC),g.writeUInt32LE(o,N.LOCSIZ),g.writeUInt32LE(a,N.LOCLEN),g.writeUInt16LE(c,N.LOCNAM),g.writeUInt16LE(u.extraLen,N.LOCEXT),g},centralHeaderToBinary:function(){var g=Buffer.alloc(N.CENHDR+c+l+h);return g.writeUInt32LE(N.CENSIG,0),g.writeUInt16LE(r,N.CENVEM),g.writeUInt16LE(e,N.CENVER),g.writeUInt16LE(t&~N.FLG_DESC,N.CENFLG),g.writeUInt16LE(n,N.CENHOW),g.writeUInt32LE(s,N.CENTIM),g.writeUInt32LE(i,N.CENCRC),g.writeUInt32LE(o,N.CENSIZ),g.writeUInt32LE(a,N.CENLEN),g.writeUInt16LE(c,N.CENNAM),g.writeUInt16LE(l,N.CENEXT),g.writeUInt16LE(h,N.CENCOM),g.writeUInt16LE(f,N.CENDSK),g.writeUInt16LE(d,N.CENATT),g.writeUInt32LE(p,N.CENATX),g.writeUInt32LE(y,N.CENOFF),g},toJSON:function(){let g=function(b){return b+" bytes"};return{made:r,version:e,flags:t,method:Jt.methodToString(n),time:this.time,crc:"0x"+i.toString(16).toUpperCase(),compressedSize:g(o),size:g(a),fileNameLength:g(c),extraLength:g(l),commentLength:g(h),diskNumStart:f,inAttr:d,attr:p,offset:y,centralHeaderSize:g(N.CENHDR+c+l+h)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Sp=w((Ij,$p)=>{"use strict";var We=Qr(),k=We.Constants;$p.exports=function(){var r=0,e=0,t=0,n=0,s=0;let i=()=>r>k.EF_ZIP64_OR_16||e>k.EF_ZIP64_OR_16||t>k.EF_ZIP64_OR_32||n>k.EF_ZIP64_OR_32;return{get diskEntries(){return r},set diskEntries(o){r=e=o},get totalEntries(){return e},set totalEntries(o){e=r=o},get size(){return t},set size(o){t=o},get offset(){return n},set offset(o){n=o},get commentLength(){return s},set commentLength(o){s=o},get mainHeaderSize(){return(i()?k.ZIP64HDR+k.END64HDR:0)+k.ENDHDR+s},loadFromBinary:function(o){if((o.length!==k.ENDHDR||o.readUInt32LE(0)!==k.ENDSIG)&&(o.length<k.ZIP64HDR||o.readUInt32LE(0)!==k.ZIP64SIG))throw We.Errors.INVALID_END();o.readUInt32LE(0)===k.ENDSIG?(r=o.readUInt16LE(k.ENDSUB),e=o.readUInt16LE(k.ENDTOT),t=o.readUInt32LE(k.ENDSIZ),n=o.readUInt32LE(k.ENDOFF),s=o.readUInt16LE(k.ENDCOM)):(r=We.readBigUInt64LE(o,k.ZIP64SUB),e=We.readBigUInt64LE(o,k.ZIP64TOT),t=We.readBigUInt64LE(o,k.ZIP64SIZB),n=We.readBigUInt64LE(o,k.ZIP64OFF),s=0)},toBinary:function(){if(!i()){var o=Buffer.alloc(k.ENDHDR+s);return o.writeUInt32LE(k.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(r,k.ENDSUB),o.writeUInt16LE(e,k.ENDTOT),o.writeUInt32LE(t,k.ENDSIZ),o.writeUInt32LE(n,k.ENDOFF),o.writeUInt16LE(s,k.ENDCOM),o.fill(" ",k.ENDHDR),o}var o=Buffer.alloc(this.mainHeaderSize);let a=0;o.writeUInt32LE(k.ZIP64SIG,a),We.writeBigUInt64LE(o,k.ZIP64HDR-k.ZIP64LEAD,a+k.ZIP64SIZE),o.writeUInt16LE(45,a+k.ZIP64VEM),o.writeUInt16LE(45,a+k.ZIP64VER),o.writeUInt32LE(0,a+k.ZIP64DSK),o.writeUInt32LE(0,a+k.ZIP64DSKDIR),We.writeBigUInt64LE(o,r,a+k.ZIP64SUB),We.writeBigUInt64LE(o,e,a+k.ZIP64TOT),We.writeBigUInt64LE(o,t,a+k.ZIP64SIZB),We.writeBigUInt64LE(o,n,a+k.ZIP64OFF);let c=n+t;return a+=k.ZIP64HDR,o.writeUInt32LE(k.END64SIG,a),o.writeUInt32LE(0,a+k.END64START),We.writeBigUInt64LE(o,c,a+k.END64OFF),o.writeUInt32LE(1,a+k.END64NUMDISKS),a+=k.END64HDR,o.writeUInt32LE(k.ENDSIG,a),o.writeUInt32LE(0,a+4),o.writeUInt16LE(Math.min(r,k.EF_ZIP64_OR_16),a+k.ENDSUB),o.writeUInt16LE(Math.min(e,k.EF_ZIP64_OR_16),a+k.ENDTOT),o.writeUInt32LE(Math.min(t,k.EF_ZIP64_OR_32),a+k.ENDSIZ),o.writeUInt32LE(Math.min(n,k.EF_ZIP64_OR_32),a+k.ENDOFF),o.writeUInt16LE(s,a+k.ENDCOM),o.fill(" ",a+k.ENDHDR),o},toJSON:function(){let o=function(a,c){let l=a.toString(16).toUpperCase();for(;l.length<c;)l="0"+l;return"0x"+l};return{diskEntries:r,totalEntries:e,size:t+" bytes",offset:o(n,4),commentLength:s}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Xa=w(Wa=>{"use strict";Wa.EntryHeader=Ep();Wa.MainHeader=Sp()});var Op=w((Pj,Tp)=>{"use strict";Tp.exports=function(r){var e=V("zlib"),t={chunkSize:(parseInt(r.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(r,t)},deflateAsync:function(n){var s=e.createDeflateRaw(t),i=[],o=0;s.on("data",function(a){i.push(a),o+=a.length}),s.on("end",function(){var a=Buffer.alloc(o),c=0;a.fill(0);for(var l=0;l<i.length;l++){var h=i[l];h.copy(a,c),c+=h.length}n&&n(a)}),s.end(r)}}}});var Ip=w((kj,Np)=>{"use strict";var ww=+(process?.versions?.node??"").split(".")[0]||0;Np.exports=function(r,e){var t=V("zlib");let n=ww>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return t.inflateRawSync(r,n)},inflateAsync:function(s){var i=t.createInflateRaw(n),o=[],a=0;i.on("data",function(c){o.push(c),a+=c.length}),i.on("end",function(){var c=Buffer.alloc(a),l=0;c.fill(0);for(var h=0;h<o.length;h++){var f=o[h];f.copy(c,l),l+=f.length}s&&s(c)}),i.end(r)}}}});var Lp=w((Cj,Cp)=>{"use strict";var{randomFillSync:Ap}=V("crypto"),Ew=Ii(),$w=new Uint32Array(256).map((r,e)=>{for(let t=0;t<8;t++)(e&1)!==0?e=e>>>1^3988292384:e>>>=1;return e>>>0}),kp=(r,e)=>Math.imul(r,e)>>>0,Pp=(r,e)=>$w[(r^e)&255]^r>>>8,Qn=()=>typeof Ap=="function"?Ap(Buffer.alloc(12)):Qn.node();Qn.node=()=>{let r=Buffer.alloc(12),e=r.length;for(let t=0;t<e;t++)r[t]=Math.random()*256&255;return r};var Ai={genSalt:Qn};function Pi(r){let e=Buffer.isBuffer(r)?r:Buffer.from(r);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let t=0;t<e.length;t++)this.updateKeys(e[t])}Pi.prototype.updateKeys=function(r){let e=this.keys;return e[0]=Pp(e[0],r),e[1]+=e[0]&255,e[1]=kp(e[1],134775813)+1,e[2]=Pp(e[2],e[1]>>>24),r};Pi.prototype.next=function(){let r=(this.keys[2]|2)>>>0;return kp(r,r^1)>>8&255};function Sw(r){let e=new Pi(r);return function(t){let n=Buffer.alloc(t.length),s=0;for(let i of t)n[s++]=e.updateKeys(i^e.next());return n}}function Tw(r){let e=new Pi(r);return function(t,n,s=0){n||(n=Buffer.alloc(t.length));for(let i of t){let o=e.next();n[s++]=i^o,e.updateKeys(i)}return n}}function Ow(r,e,t){if(!r||!Buffer.isBuffer(r)||r.length<12)return Buffer.alloc(0);let n=Sw(t),s=n(r.slice(0,12)),i=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(s[11]!==i)throw Ew.WRONG_PASSWORD();return n(r.slice(12))}function Nw(r){Buffer.isBuffer(r)&&r.length>=12?Ai.genSalt=function(){return r.slice(0,12)}:r==="node"?Ai.genSalt=Qn.node:Ai.genSalt=Qn}function Iw(r,e,t,n=!1){r==null&&(r=Buffer.alloc(0)),Buffer.isBuffer(r)||(r=Buffer.from(r.toString()));let s=Tw(t),i=Ai.genSalt();i[11]=e.crc>>>24&255,n&&(i[10]=e.crc>>>16&255);let o=Buffer.alloc(r.length+12);return s(i,o),s(r,o,12)}Cp.exports={decrypt:Ow,encrypt:Iw,_salter:Nw}});var Dp=w(ki=>{"use strict";ki.Deflater=Op();ki.Inflater=Ip();ki.ZipCrypto=Lp()});var ec=w((Dj,qp)=>{"use strict";var Y=Qr(),Aw=Xa(),ue=Y.Constants,Qa=Dp();qp.exports=function(r,e){var t=new Aw.EntryHeader,n=Buffer.alloc(0),s=Buffer.alloc(0),i=!1,o=null,a=Buffer.alloc(0),c=Buffer.alloc(0),l=!0;let h=r,f=typeof h.decoder=="object"?h.decoder:Y.decoder;l=f.hasOwnProperty("efs")?f.efs:!1;function d(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(c=t.loadLocalHeaderFromBinary(e),e.slice(t.realDataOffset,t.realDataOffset+t.compressedSize))}function p(g){if(!t.flags_desc&&!t.localHeader.flags_desc){if(Y.crc32(g)!==t.localHeader.crc)return!1}else{let b={},E=t.realDataOffset+t.compressedSize;if(e.readUInt32LE(E)==ue.LOCSIG||e.readUInt32LE(E)==ue.CENSIG)throw Y.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(E)==ue.EXTSIG)b.crc=e.readUInt32LE(E+ue.EXTCRC),b.compressedSize=e.readUInt32LE(E+ue.EXTSIZ),b.size=e.readUInt32LE(E+ue.EXTLEN);else if(e.readUInt16LE(E+12)===19280)b.crc=e.readUInt32LE(E+ue.EXTCRC-4),b.compressedSize=e.readUInt32LE(E+ue.EXTSIZ-4),b.size=e.readUInt32LE(E+ue.EXTLEN-4);else throw Y.Errors.DESCRIPTOR_UNKNOWN();if(b.compressedSize!==t.compressedSize||b.size!==t.size||b.crc!==t.crc)throw Y.Errors.DESCRIPTOR_FAULTY();if(Y.crc32(g)!==b.crc)return!1}return!0}function y(g,b,E){if(typeof b>"u"&&typeof g=="string"&&(E=g,g=void 0),i)return g&&b&&b(Buffer.alloc(0),Y.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=d();if($.length===0)return g&&b&&b($),$;if(t.encrypted){if(typeof E!="string"&&!Buffer.isBuffer(E))throw Y.Errors.INVALID_PASS_PARAM();$=Qa.ZipCrypto.decrypt($,t,E)}var S=Buffer.alloc(t.size);switch(t.method){case Y.Constants.STORED:if($.copy(S),p(S))return g&&b&&b(S),S;throw g&&b&&b(S,Y.Errors.BAD_CRC()),Y.Errors.BAD_CRC();case Y.Constants.DEFLATED:var O=new Qa.Inflater($,t.size);if(g)O.inflateAsync(function(A){A.copy(A,0),b&&(p(A)?b(A):b(A,Y.Errors.BAD_CRC()))});else{if(O.inflate(S).copy(S,0),!p(S))throw Y.Errors.BAD_CRC(`"${f.decode(n)}"`);return S}break;default:throw g&&b&&b(Buffer.alloc(0),Y.Errors.UNKNOWN_METHOD()),Y.Errors.UNKNOWN_METHOD()}}function u(g,b){if((!o||!o.length)&&Buffer.isBuffer(e))return g&&b&&b(d()),d();if(o.length&&!i){var E;switch(t.method){case Y.Constants.STORED:return t.compressedSize=t.size,E=Buffer.alloc(o.length),o.copy(E),g&&b&&b(E),E;default:case Y.Constants.DEFLATED:var $=new Qa.Deflater(o);if(g)$.deflateAsync(function(O){E=Buffer.alloc(O.length),t.compressedSize=O.length,O.copy(E),b&&b(E)});else{var S=$.deflate();return t.compressedSize=S.length,S}$=null;break}}else if(g&&b)b(Buffer.alloc(0));else return Buffer.alloc(0)}function m(g,b){return Y.readBigUInt64LE(g,b)}function _(g){try{for(var b=0,E,$,S;b+4<g.length;)E=g.readUInt16LE(b),b+=2,$=g.readUInt16LE(b),b+=2,S=g.slice(b,b+$),b+=$,ue.ID_ZIP64===E&&v(S)}catch{throw Y.Errors.EXTRA_FIELD_PARSE_ERROR()}}function v(g){var b,E,$,S;g.length>=ue.EF_ZIP64_SCOMP&&(b=m(g,ue.EF_ZIP64_SUNCOMP),t.size===ue.EF_ZIP64_OR_32&&(t.size=b)),g.length>=ue.EF_ZIP64_RHO&&(E=m(g,ue.EF_ZIP64_SCOMP),t.compressedSize===ue.EF_ZIP64_OR_32&&(t.compressedSize=E)),g.length>=ue.EF_ZIP64_DSN&&($=m(g,ue.EF_ZIP64_RHO),t.offset===ue.EF_ZIP64_OR_32&&(t.offset=$)),g.length>=ue.EF_ZIP64_DSN+4&&(S=g.readUInt32LE(ue.EF_ZIP64_DSN),t.diskNumStart===ue.EF_ZIP64_OR_16&&(t.diskNumStart=S))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(g){n=Y.toBuffer(g,f.encode);var b=n[n.length-1];i=b===47||b===92,t.fileNameLength=n.length},get efs(){return typeof l=="function"?l(this.entryName):l},get extra(){return a},set extra(g){a=g,t.extraLength=g.length,_(g)},get comment(){return f.decode(s)},set comment(g){if(s=Y.toBuffer(g,f.encode),t.commentLength=s.length,s.length>65535)throw Y.Errors.COMMENT_TOO_LONG()},get name(){var g=f.decode(n);return i?g.substr(g.length-1).split("/").pop():g.split("/").pop()},get isDirectory(){return i},getCompressedData:function(){return u(!1,null)},getCompressedDataAsync:function(g){u(!0,g)},setData:function(g){o=Y.toBuffer(g,Y.decoder.encode),!i&&o.length?(t.size=o.length,t.method=Y.Constants.DEFLATED,t.crc=Y.crc32(g),t.changed=!0):t.method=Y.Constants.STORED},getData:function(g){return t.changed?o:y(!1,null,g)},getDataAsync:function(g,b){t.changed?g(o):y(!0,g,b)},set attr(g){t.attr=g},get attr(){return t.attr},set header(g){t.loadFromBinary(g)},get header(){return t},packCentralHeader:function(){t.flags_efs=this.efs,t.extraLength=a.length;var g=t.centralHeaderToBinary(),b=Y.Constants.CENHDR;return n.copy(g,b),b+=n.length,a.copy(g,b),b+=t.extraLength,s.copy(g,b),g},packLocalHeader:function(){let g=0;t.flags_efs=this.efs,t.extraLocalLength=c.length;let b=t.localHeaderToBinary(),E=Buffer.alloc(b.length+n.length+t.extraLocalLength);return b.copy(E,g),g+=b.length,n.copy(E,g),g+=n.length,c.copy(E,g),g+=c.length,E},toJSON:function(){let g=function(b){return"<"+(b&&b.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:t.toJSON(),compressedData:g(e),data:g(o)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Rp=w((qj,jp)=>{"use strict";var Mp=ec(),Pw=Xa(),Ae=Qr();jp.exports=function(r,e){var t=[],n={},s=Buffer.alloc(0),i=new Pw.MainHeader,o=!1,a=null;let c=new Set,l=e,{noSort:h,decoder:f}=l;r?y(l.readEntries):o=!0;function d(){let m=new Set;for(let _ of Object.keys(n)){let v=_.split("/");if(v.pop(),!!v.length)for(let g=0;g<v.length;g++){let b=v.slice(0,g+1).join("/")+"/";m.add(b)}}for(let _ of m)if(!(_ in n)){let v=new Mp(l);v.entryName=_,v.attr=16,v.temporary=!0,t.push(v),n[v.entryName]=v,c.add(v)}}function p(){if(o=!0,n={},i.diskEntries>(r.length-i.offset)/Ae.Constants.CENHDR)throw Ae.Errors.DISK_ENTRY_TOO_LARGE();t=new Array(i.diskEntries);for(var m=i.offset,_=0;_<t.length;_++){var v=m,g=new Mp(l,r);g.header=r.slice(v,v+=Ae.Constants.CENHDR),g.entryName=r.slice(v,v+=g.header.fileNameLength),g.header.extraLength&&(g.extra=r.slice(v,v+=g.header.extraLength)),g.header.commentLength&&(g.comment=r.slice(v,v+g.header.commentLength)),m+=g.header.centralHeaderSize,t[_]=g,n[g.entryName]=g}c.clear(),d()}function y(m){var _=r.length-Ae.Constants.ENDHDR,v=Math.max(0,_-65535),g=v,b=r.length,E=-1,$=0;for(typeof l.trailingSpace=="boolean"&&l.trailingSpace&&(v=0),_;_>=g;_--)if(r[_]===80){if(r.readUInt32LE(_)===Ae.Constants.ENDSIG){E=_,$=_,b=_+Ae.Constants.ENDHDR,g=_-Ae.Constants.END64HDR;continue}if(r.readUInt32LE(_)===Ae.Constants.END64SIG){g=v;continue}if(r.readUInt32LE(_)===Ae.Constants.ZIP64SIG){E=_,b=_+Ae.readBigUInt64LE(r,_+Ae.Constants.ZIP64SIZE)+Ae.Constants.ZIP64LEAD;break}}if(E==-1)throw Ae.Errors.INVALID_FORMAT();i.loadFromBinary(r.slice(E,b)),i.commentLength&&(s=r.slice($+Ae.Constants.ENDHDR)),m&&p()}function u(){t.length>1&&!h&&t.sort((m,_)=>m.entryName.toLowerCase().localeCompare(_.entryName.toLowerCase()))}return{get entries(){return o||p(),t.filter(m=>!c.has(m))},get comment(){return f.decode(s)},set comment(m){s=Ae.toBuffer(m,f.encode),i.commentLength=s.length},getEntryCount:function(){return o?t.length:i.diskEntries},forEach:function(m){this.entries.forEach(m)},getEntry:function(m){return o||p(),n[m]||null},setEntry:function(m){o||p(),t.push(m),n[m.entryName]=m,i.totalEntries=t.length},deleteFile:function(m,_=!0){o||p();let v=n[m];this.getEntryChildren(v,_).map(b=>b.entryName).forEach(this.deleteEntry)},deleteEntry:function(m){o||p();let _=n[m],v=t.indexOf(_);v>=0&&(t.splice(v,1),delete n[m],i.totalEntries=t.length)},getEntryChildren:function(m,_=!0){if(o||p(),typeof m=="object")if(m.isDirectory&&_){let v=[],g=m.entryName;for(let b of t)b.entryName.startsWith(g)&&v.push(b);return v}else return[m];return[]},getChildCount:function(m){if(m&&m.isDirectory){let _=this.getEntryChildren(m);return _.includes(m)?_.length-1:_.length}return 0},compressToBuffer:function(){o||p(),u();let m=[],_=[],v=0,g=0;i.size=0,i.offset=0;let b=0;for(let S of this.entries){let O=S.getCompressedData();S.header.offset=g;let A=S.packLocalHeader(),x=A.length+O.length;g+=x,m.push(A),m.push(O);let j=S.packCentralHeader();_.push(j),i.size+=j.length,v+=x+j.length,b++}v+=i.mainHeaderSize,i.offset=g,i.totalEntries=b,g=0;let E=Buffer.alloc(v);for(let S of m)S.copy(E,g),g+=S.length;for(let S of _)S.copy(E,g),g+=S.length;let $=i.toBinary();return s&&s.copy($,$.length-s.length),$.copy(E,g),r=E,o=!1,E},toAsyncBuffer:function(m,_,v,g){try{o||p(),u();let b=[],E=[],$=0,S=0,O=0;i.size=0,i.offset=0;let A=function(x){if(x.length>0){let j=x.shift(),B=j.entryName+j.extra.toString();v&&v(B),j.getCompressedDataAsync(function(de){g&&g(B),j.header.offset=S;let Wr=j.packLocalHeader(),op=Wr.length+de.length;S+=op,b.push(Wr),b.push(de);let Za=j.packCentralHeader();E.push(Za),i.size+=Za.length,$+=op+Za.length,O++,A(x)})}else{$+=i.mainHeaderSize,i.offset=S,i.totalEntries=O,S=0;let j=Buffer.alloc($);b.forEach(function(de){de.copy(j,S),S+=de.length}),E.forEach(function(de){de.copy(j,S),S+=de.length});let B=i.toBinary();s&&s.copy(B,B.length-s.length),B.copy(j,S),r=j,o=!1,m(j)}};A(Array.from(this.entries))}catch(b){_(b)}}}}});var tc=w((Mj,Fp)=>{"use strict";var le=Qr(),ce=V("path"),kw=ec(),Cw=Rp(),br=(...r)=>le.findLast(r,e=>typeof e=="boolean"),xp=(...r)=>le.findLast(r,e=>typeof e=="string"),Lw=(...r)=>le.findLast(r,e=>typeof e=="function"),Dw={noSort:!1,readEntries:!1,method:le.Constants.NONE,fs:null};Fp.exports=function(r,e){let t=null,n=Object.assign(Object.create(null),Dw);r&&typeof r=="object"&&(r instanceof Uint8Array||(Object.assign(n,r),r=n.input?n.input:void 0,n.input&&delete n.input),Buffer.isBuffer(r)&&(t=r,n.method=le.Constants.BUFFER,r=void 0)),Object.assign(n,e);let s=new le(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=le.decoder),r&&typeof r=="string")if(s.fs.existsSync(r))n.method=le.Constants.FILE,n.filename=r,t=s.fs.readFileSync(r);else throw le.Errors.INVALID_FILENAME();let i=new Cw(t,n),{canonical:o,sanitize:a,zipnamefix:c}=le;function l(p){if(p&&i){var y;if(typeof p=="string"&&(y=i.getEntry(ce.posix.normalize(p))),typeof p=="object"&&typeof p.entryName<"u"&&typeof p.header<"u"&&(y=i.getEntry(p.entryName)),y)return y}return null}function h(p){let{join:y,normalize:u,sep:m}=ce.posix;return y(ce.isAbsolute(p)?"/":".",u(m+p.split("\\").join(m)+m))}function f(p){return p instanceof RegExp?(function(y){return function(u){return y.test(u)}})(p):typeof p!="function"?()=>!0:p}let d=(p,y)=>{let u=y.slice(-1);return u=u===s.sep?s.sep:"",ce.relative(p,y)+u};return{readFile:function(p,y){var u=l(p);return u&&u.getData(y)||null},childCount:function(p){let y=l(p);if(y)return i.getChildCount(y)},readFileAsync:function(p,y){var u=l(p);u?u.getDataAsync(y):y(null,"getEntry failed for:"+p)},readAsText:function(p,y){var u=l(p);if(u){var m=u.getData();if(m&&m.length)return m.toString(y||"utf8")}return""},readAsTextAsync:function(p,y,u){var m=l(p);m?m.getDataAsync(function(_,v){if(v){y(_,v);return}_&&_.length?y(_.toString(u||"utf8")):y("")}):y("")},deleteFile:function(p,y=!0){var u=l(p);u&&i.deleteFile(u.entryName,y)},deleteEntry:function(p){var y=l(p);y&&i.deleteEntry(y.entryName)},addZipComment:function(p){i.comment=p},getZipComment:function(){return i.comment||""},addZipEntryComment:function(p,y){var u=l(p);u&&(u.comment=y)},getZipEntryComment:function(p){var y=l(p);return y&&y.comment||""},updateFile:function(p,y){var u=l(p);u&&u.setData(y)},addLocalFile:function(p,y,u,m){if(s.fs.existsSync(p)){y=y?h(y):"";let _=ce.win32.basename(ce.win32.normalize(p));y+=u||_;let v=s.fs.statSync(p),g=v.isFile()?s.fs.readFileSync(p):Buffer.alloc(0);v.isDirectory()&&(y+=s.sep),this.addFile(y,g,m,v)}else throw le.Errors.FILE_NOT_FOUND(p)},addLocalFileAsync:function(p,y){p=typeof p=="object"?p:{localPath:p};let u=ce.resolve(p.localPath),{comment:m}=p,{zipPath:_,zipName:v}=p,g=this;s.fs.stat(u,function(b,E){if(b)return y(b,!1);_=_?h(_):"";let $=ce.win32.basename(ce.win32.normalize(u));if(_+=v||$,E.isFile())s.fs.readFile(u,function(S,O){return S?y(S,!1):(g.addFile(_,O,m,E),setImmediate(y,void 0,!0))});else if(E.isDirectory())return _+=s.sep,g.addFile(_,Buffer.alloc(0),m,E),setImmediate(y,void 0,!0)})},addLocalFolder:function(p,y,u){if(u=f(u),y=y?h(y):"",p=ce.normalize(p),s.fs.existsSync(p)){let m=s.findFiles(p),_=this;if(m.length)for(let v of m){let g=ce.join(y,d(p,v));u(g)&&_.addLocalFile(v,ce.dirname(g))}}else throw le.Errors.FILE_NOT_FOUND(p)},addLocalFolderAsync:function(p,y,u,m){m=f(m),u=u?h(u):"",p=ce.normalize(p);var _=this;s.fs.open(p,"r",function(v){if(v&&v.code==="ENOENT")y(void 0,le.Errors.FILE_NOT_FOUND(p));else if(v)y(void 0,v);else{var g=s.findFiles(p),b=-1,E=function(){if(b+=1,b<g.length){var $=g[b],S=d(p,$).split("\\").join("/");S=S.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),m(S)?s.fs.stat($,function(O,A){O&&y(void 0,O),A.isFile()?s.fs.readFile($,function(x,j){x?y(void 0,x):(_.addFile(u+S,j,"",A),E())}):(_.addFile(u+S+"/",Buffer.alloc(0),"",A),E())}):process.nextTick(()=>{E()})}else y(!0,void 0)};E()}})},addLocalFolderAsync2:function(p,y){let u=this;p=typeof p=="object"?p:{localPath:p};let m=ce.resolve(h(p.localPath)),{zipPath:_,filter:v,namefix:g}=p;v instanceof RegExp?v=(function($){return function(S){return $.test(S)}})(v):typeof v!="function"&&(v=function(){return!0}),_=_?h(_):"",g==="latin1"&&(g=$=>$.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof g!="function"&&(g=$=>$);let b=$=>ce.join(_,g(d(m,$))),E=$=>ce.win32.basename(ce.win32.normalize(g($)));s.fs.open(m,"r",function($){$&&$.code==="ENOENT"?y(void 0,le.Errors.FILE_NOT_FOUND(m)):$?y(void 0,$):s.findFilesAsync(m,function(S,O){if(S)return y(S);O=O.filter(A=>v(b(A))),O.length||y(void 0,!1),setImmediate(O.reverse().reduce(function(A,x){return function(j,B){if(j||B===!1)return setImmediate(A,j,!1);u.addLocalFileAsync({localPath:x,zipPath:ce.dirname(b(x)),zipName:E(x)},A)}},y))})})},addLocalFolderPromise:function(p,y){return new Promise((u,m)=>{this.addLocalFolderAsync2(Object.assign({localPath:p},y),(_,v)=>{_&&m(_),v&&u(this)})})},addFile:function(p,y,u,m){p=c(p);let _=l(p),v=_!=null;v||(_=new kw(n),_.entryName=p),_.comment=u||"";let g=typeof m=="object"&&m instanceof s.fs.Stats;g&&(_.header.time=m.mtime);var b=_.isDirectory?16:0;let E=_.isDirectory?16384:32768;return g?E|=4095&m.mode:typeof m=="number"?E|=4095&m:E|=_.isDirectory?493:420,b=(b|E<<16)>>>0,_.attr=b,_.setData(y),v||i.setEntry(_),_},getEntries:function(p){return i.password=p,i?i.entries:[]},getEntry:function(p){return l(p)},getEntryCount:function(){return i.getEntryCount()},forEach:function(p){return i.forEach(p)},extractEntryTo:function(p,y,u,m,_,v){m=br(!1,m),_=br(!1,_),u=br(!0,u),v=xp(_,v);var g=l(p);if(!g)throw le.Errors.NO_ENTRY();var b=o(g.entryName),E=a(y,v&&!g.isDirectory?o(v):u?b:ce.basename(b));if(g.isDirectory){var $=i.getEntryChildren(g);return $.forEach(function(A){if(A.isDirectory)return;var x=A.getData();if(!x)throw le.Errors.CANT_EXTRACT_FILE();var j=o(A.entryName),B=a(y,u?j:ce.basename(j));let de=_?A.header.fileAttr:void 0;s.writeFileTo(B,x,m,de)}),!0}var S=g.getData(i.password);if(!S)throw le.Errors.CANT_EXTRACT_FILE();if(s.fs.existsSync(E)&&!m)throw le.Errors.CANT_OVERRIDE();let O=_?p.header.fileAttr:void 0;return s.writeFileTo(E,S,m,O),!0},test:function(p){if(!i)return!1;for(var y of i.entries)try{if(y.isDirectory)continue;var u=i.entries[y].getData(p);if(!u)return!1}catch{return!1}return!0},extractAllTo:function(p,y,u,m){if(u=br(!1,u),m=xp(u,m),y=br(!1,y),!i)throw le.Errors.NO_ZIP();i.entries.forEach(function(_){var v=a(p,o(_.entryName));if(_.isDirectory){s.makeDir(v);return}var g=_.getData(m);if(!g)throw le.Errors.CANT_EXTRACT_FILE();let b=u?_.header.fileAttr:void 0;s.writeFileTo(v,g,y,b);try{s.fs.utimesSync(v,_.header.time,_.header.time)}catch{throw le.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(p,y,u,m){if(m=Lw(y,u,m),u=br(!1,u),y=br(!1,y),!m)return new Promise((E,$)=>{this.extractAllToAsync(p,y,u,function(S){S?$(S):E(this)})});if(!i){m(le.Errors.NO_ZIP());return}p=ce.resolve(p);let _=E=>a(p,ce.normalize(o(E.entryName))),v=(E,$)=>new Error(E+': "'+$+'"'),g=[],b=[];i.entries.forEach(E=>{E.isDirectory?g.push(E):b.push(E)});for(let E of g){let $=_(E),S=u?E.header.fileAttr:void 0;try{s.makeDir($),S&&s.fs.chmodSync($,S),s.fs.utimesSync($,E.header.time,E.header.time)}catch{m(v("Unable to create folder",$))}}b.reverse().reduce(function(E,$){return function(S){if(S)E(S);else{let O=ce.normalize(o($.entryName)),A=a(p,O);$.getDataAsync(function(x,j){if(j)E(j);else if(!x)E(le.Errors.CANT_EXTRACT_FILE());else{let B=u?$.header.fileAttr:void 0;s.writeFileToAsync(A,x,y,B,function(de){de||E(v("Unable to write file",A)),s.fs.utimes(A,$.header.time,$.header.time,function(Wr){Wr?E(v("Unable to set times",A)):E()})})}})}}},m)()},writeZip:function(p,y){if(arguments.length===1&&typeof p=="function"&&(y=p,p=""),!p&&n.filename&&(p=n.filename),!!p){var u=i.compressToBuffer();if(u){var m=s.writeFileTo(p,u,!0);typeof y=="function"&&y(m?null:new Error("failed"),"")}}},writeZipPromise:function(p,y){let{overwrite:u,perm:m}=Object.assign({overwrite:!0},y);return new Promise((_,v)=>{!p&&n.filename&&(p=n.filename),p||v("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(g=>{let b=E=>E?_(E):v("ADM-ZIP: Wasn't able to write zip file");s.writeFileToAsync(p,g,u,m,b)},v)})},toBufferPromise:function(){return new Promise((p,y)=>{i.toAsyncBuffer(p,y)})},toBuffer:function(p,y,u,m){return typeof p=="function"?(i.toAsyncBuffer(p,y,u,m),null):i.compressToBuffer()}}}});var es=w(Pe=>{"use strict";var qw=Pe&&Pe.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Mw=Pe&&Pe.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),jw=Pe&&Pe.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&qw(t,e,n[s]);return Mw(t,e),t}})(),Rw=Pe&&Pe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.ZipContainer=Pe.DirectoryContainer=void 0;Pe.openContainer=Fw;var Rt=V("fs"),Xe=jw(V("path")),xw=Rw(tc());function Up(r){return r.replace(/\.evidence$/,"")}var Ci=class{root;kind="directory";constructor(e){this.root=e}get name(){return Up(Xe.basename(this.root))}async readManifest(){return rc(Xe.join(this.root,"run.yaml"))}async listTestIds(){try{return(await Rt.promises.readdir(Xe.join(this.root,"tests"),{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).sort()}catch{return[]}}async readResult(e){return rc(Xe.join(this.root,"tests",e,"result.yaml"))}async fileExists(e,t){try{return await Rt.promises.access(Xe.join(this.root,"tests",e,t)),!0}catch{return!1}}async readBytes(e,t){try{return await Rt.promises.readFile(Xe.join(this.root,"tests",e,t))}catch{return null}}async exists(e){try{return await Rt.promises.access(Xe.join(this.root,e)),!0}catch{return!1}}async isDir(e){try{return(await Rt.promises.stat(Xe.join(this.root,e))).isDirectory()}catch{return!1}}async listDir(e){try{return(await Rt.promises.readdir(Xe.join(this.root,e),{withFileTypes:!0})).map(n=>({name:n.name,isDir:n.isDirectory()})).sort((n,s)=>n.name.localeCompare(s.name))}catch{return[]}}async readText(e){return rc(Xe.join(this.root,e))}async readFileBytes(e){try{return await Rt.promises.readFile(Xe.join(this.root,e))}catch{return null}}};Pe.DirectoryContainer=Ci;var Li=class{file;kind="zip";zip;constructor(e){this.file=e,this.zip=new xw.default(e)}get name(){return Up(Xe.basename(this.file))}readEntry(e){let t=this.zip.getEntry(e);return t?t.getData().toString("utf8"):null}async readManifest(){return this.readEntry("run.yaml")}async listTestIds(){let e=new Set;for(let t of this.zip.getEntries()){let n=t.entryName.match(/^tests\/([^/]+)\//);n&&e.add(n[1])}return[...e].sort()}async readResult(e){return this.readEntry(`tests/${e}/result.yaml`)}async fileExists(e,t){return this.zip.getEntry(`tests/${e}/${t}`)!=null}async readBytes(e,t){let n=this.zip.getEntry(`tests/${e}/${t}`);return n?n.getData():null}hasPrefix(e){let t=e.endsWith("/")?e:`${e}/`;return this.zip.getEntries().some(n=>n.entryName.startsWith(t))}async exists(e){return this.zip.getEntry(e)!=null||this.hasPrefix(e)}async isDir(e){return this.hasPrefix(e)}async listDir(e){let t=e===""?"":e.endsWith("/")?e:`${e}/`,n=new Map;for(let s of this.zip.getEntries()){if(!s.entryName.startsWith(t))continue;let i=s.entryName.slice(t.length);if(i==="")continue;let o=i.indexOf("/");o===-1?n.has(i)||n.set(i,!1):n.set(i.slice(0,o),!0)}return[...n.entries()].map(([s,i])=>({name:s,isDir:i})).sort((s,i)=>s.name.localeCompare(i.name))}async readText(e){let t=this.zip.getEntry(e);return t?t.getData().toString("utf8"):null}async readFileBytes(e){let t=this.zip.getEntry(e);return t?t.getData():null}};Pe.ZipContainer=Li;async function Fw(r){return(await Rt.promises.stat(r)).isDirectory()?new Ci(r):new Li(r)}async function rc(r){try{return await Rt.promises.readFile(r,"utf8")}catch{return null}}});var ns=w(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.regexpCode=G.getEsmExportName=G.getProperty=G.safeStringify=G.stringify=G.strConcat=G.addCodeArg=G.str=G._=G.nil=G._Code=G.Name=G.IDENTIFIER=G._CodeOrName=void 0;var ts=class{};G._CodeOrName=ts;G.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var wr=class extends ts{constructor(e){if(super(),!G.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};G.Name=wr;var Qe=class extends ts{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>(n instanceof wr&&(t[n.str]=(t[n.str]||0)+1),t),{})}};G._Code=Qe;G.nil=new Qe("");function Bp(r,...e){let t=[r[0]],n=0;for(;n<e.length;)sc(t,e[n]),t.push(r[++n]);return new Qe(t)}G._=Bp;var nc=new Qe("+");function Vp(r,...e){let t=[rs(r[0])],n=0;for(;n<e.length;)t.push(nc),sc(t,e[n]),t.push(nc,rs(r[++n]));return Uw(t),new Qe(t)}G.str=Vp;function sc(r,e){e instanceof Qe?r.push(...e._items):e instanceof wr?r.push(e):r.push(zw(e))}G.addCodeArg=sc;function Uw(r){let e=1;for(;e<r.length-1;){if(r[e]===nc){let t=Bw(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function Bw(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof wr||r[r.length-1]!=='"'?void 0:typeof e!="string"?`${r.slice(0,-1)}${e}"`:e[0]==='"'?r.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(r instanceof wr))return`"${r}${e.slice(1)}`}function Vw(r,e){return e.emptyStr()?r:r.emptyStr()?e:Vp`${r}${e}`}G.strConcat=Vw;function zw(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:rs(Array.isArray(r)?r.join(","):r)}function Kw(r){return new Qe(rs(r))}G.stringify=Kw;function rs(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}G.safeStringify=rs;function Hw(r){return typeof r=="string"&&G.IDENTIFIER.test(r)?new Qe(`.${r}`):Bp`[${r}]`}G.getProperty=Hw;function Gw(r){if(typeof r=="string"&&G.IDENTIFIER.test(r))return new Qe(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}G.getEsmExportName=Gw;function Yw(r){return new Qe(r.toString())}G.regexpCode=Yw});var ac=w(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.ValueScope=Re.ValueScopeName=Re.Scope=Re.varKinds=Re.UsedValueState=void 0;var je=ns(),ic=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Di;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(Di||(Re.UsedValueState=Di={}));Re.varKinds={const:new je.Name("const"),let:new je.Name("let"),var:new je.Name("var")};var qi=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof je.Name?e:this.name(e)}name(e){return new je.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Re.Scope=qi;var Mi=class extends je.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=(0,je._)`.${new je.Name(t)}[${n}]`}};Re.ValueScopeName=Mi;var Zw=(0,je._)`\n`,oc=class extends qi{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Zw:je.nil}}get(){return this._scope}name(e){return new Mi(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=t.key)!==null&&n!==void 0?n:t.ref,a=this._values[i];if(a){let h=a.get(o);if(h)return h}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=t.ref,s.setValue(t,{property:i,itemIndex:l}),s}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,je._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},t,n)}_reduceValues(e,t,n={},s){let i=je.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Di.Started);let h=t(l);if(h){let f=this.opts.es5?Re.varKinds.var:Re.varKinds.const;i=(0,je._)`${i}${f} ${l} = ${h};${this.opts._n}`}else if(h=s?.(l))i=(0,je._)`${i}${h}${this.opts._n}`;else throw new ic(l);c.set(l,Di.Completed)})}return i}};Re.ValueScope=oc});var q=w(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.or=R.and=R.not=R.CodeGen=R.operators=R.varKinds=R.ValueScopeName=R.ValueScope=R.Scope=R.Name=R.regexpCode=R.stringify=R.getProperty=R.nil=R.strConcat=R.str=R._=void 0;var z=ns(),at=ac(),Wt=ns();Object.defineProperty(R,"_",{enumerable:!0,get:function(){return Wt._}});Object.defineProperty(R,"str",{enumerable:!0,get:function(){return Wt.str}});Object.defineProperty(R,"strConcat",{enumerable:!0,get:function(){return Wt.strConcat}});Object.defineProperty(R,"nil",{enumerable:!0,get:function(){return Wt.nil}});Object.defineProperty(R,"getProperty",{enumerable:!0,get:function(){return Wt.getProperty}});Object.defineProperty(R,"stringify",{enumerable:!0,get:function(){return Wt.stringify}});Object.defineProperty(R,"regexpCode",{enumerable:!0,get:function(){return Wt.regexpCode}});Object.defineProperty(R,"Name",{enumerable:!0,get:function(){return Wt.Name}});var Fi=ac();Object.defineProperty(R,"Scope",{enumerable:!0,get:function(){return Fi.Scope}});Object.defineProperty(R,"ValueScope",{enumerable:!0,get:function(){return Fi.ValueScope}});Object.defineProperty(R,"ValueScopeName",{enumerable:!0,get:function(){return Fi.ValueScopeName}});Object.defineProperty(R,"varKinds",{enumerable:!0,get:function(){return Fi.varKinds}});R.operators={GT:new z._Code(">"),GTE:new z._Code(">="),LT:new z._Code("<"),LTE:new z._Code("<="),EQ:new z._Code("==="),NEQ:new z._Code("!=="),NOT:new z._Code("!"),OR:new z._Code("||"),AND:new z._Code("&&"),ADD:new z._Code("+")};var xt=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},cc=class extends xt{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?at.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=tn(this.rhs,e,t)),this}get names(){return this.rhs instanceof z._CodeOrName?this.rhs.names:{}}},ji=class extends xt{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof z.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=tn(this.rhs,e,t),this}get names(){let e=this.lhs instanceof z.Name?{}:{...this.lhs.names};return xi(e,this.rhs)}},lc=class extends ji{constructor(e,t,n,s){super(e,n,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},uc=class extends xt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},fc=class extends xt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},dc=class extends xt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},pc=class extends xt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=tn(this.code,e,t),this}get names(){return this.code instanceof z._CodeOrName?this.code.names:{}}},ss=class extends xt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,t)||(Jw(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Sr(e,t.names),{})}},Ft=class extends ss{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},hc=class extends ss{},en=class extends Ft{};en.kind="else";var Er=class r extends Ft{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new en(n):n}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(zp(e),t instanceof r?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=tn(this.condition,e,t),this}get names(){let e=super.names;return xi(e,this.condition),this.else&&Sr(e,this.else.names),e}};Er.kind="if";var $r=class extends Ft{};$r.kind="for";var mc=class extends $r{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=tn(this.iteration,e,t),this}get names(){return Sr(super.names,this.iteration.names)}},yc=class extends $r{constructor(e,t,n,s){super(),this.varKind=e,this.name=t,this.from=n,this.to=s}render(e){let t=e.es5?at.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${t} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=xi(super.names,this.from);return xi(e,this.to)}},Ri=class extends $r{constructor(e,t,n,s){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=tn(this.iterable,e,t),this}get names(){return Sr(super.names,this.iterable.names)}},is=class extends Ft{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};is.kind="func";var os=class extends ss{render(e){return"return "+super.render(e)}};os.kind="return";var gc=class extends Ft{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,s;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(s=this.finally)===null||s===void 0||s.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&Sr(e,this.catch.names),this.finally&&Sr(e,this.finally.names),e}},as=class extends Ft{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};as.kind="catch";var cs=class extends Ft{render(e){return"finally"+super.render(e)}};cs.kind="finally";var _c=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
3
|
-
`:""},this._extScope=e,this._scope=new at.Scope({parent:e}),this._nodes=[new hc]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,s){let i=this._scope.toName(t);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new cc(e,i,n)),i}const(e,t,n){return this._def(at.varKinds.const,e,t,n)}let(e,t,n){return this._def(at.varKinds.let,e,t,n)}var(e,t,n){return this._def(at.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new ji(e,t,n))}add(e,t){return this._leafNode(new lc(e,R.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==z.nil&&this._leafNode(new pc(e)),this}object(...e){let t=["{"];for(let[n,s]of e)t.length>1&&t.push(","),t.push(n),(n!==s||this.opts.es5)&&(t.push(":"),(0,z.addCodeArg)(t,s));return t.push("}"),new z._Code(t)}if(e,t,n){if(this._blockNode(new Er(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Er(e))}else(){return this._elseNode(new en)}endIf(){return this._endBlockNode(Er,en)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new mc(e),t)}forRange(e,t,n,s,i=this.opts.es5?at.varKinds.var:at.varKinds.let){let o=this._scope.toName(e);return this._for(new yc(i,o,t,n),()=>s(o))}forOf(e,t,n,s=at.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=t instanceof z.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,z._)`${o}.length`,a=>{this.var(i,(0,z._)`${o}[${a}]`),n(i)})}return this._for(new Ri("of",s,i,t),()=>n(i))}forIn(e,t,n,s=this.opts.es5?at.varKinds.var:at.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,z._)`Object.keys(${t})`,n);let i=this._scope.toName(e);return this._for(new Ri("in",s,i,t),()=>n(i))}endFor(){return this._endBlockNode($r)}label(e){return this._leafNode(new uc(e))}break(e){return this._leafNode(new fc(e))}return(e){let t=new os;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(os)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new gc;if(this._blockNode(s),this.code(e),t){let i=this.name("e");this._currNode=s.catch=new as(i),t(i)}return n&&(this._currNode=s.finally=new cs,this.code(n)),this._endBlockNode(as,cs)}throw(e){return this._leafNode(new dc(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=z.nil,n,s){return this._blockNode(new is(e,t,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(is)}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,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Er))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};R.CodeGen=_c;function Sr(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function xi(r,e){return e instanceof z._CodeOrName?Sr(r,e.names):r}function tn(r,e,t){if(r instanceof z.Name)return n(r);if(!s(r))return r;return new z._Code(r._items.reduce((i,o)=>(o instanceof z.Name&&(o=n(o)),o instanceof z._Code?i.push(...o._items):i.push(o),i),[]));function n(i){let o=t[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof z._Code&&i._items.some(o=>o instanceof z.Name&&e[o.str]===1&&t[o.str]!==void 0)}}function Jw(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function zp(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,z._)`!${vc(r)}`}R.not=zp;var Ww=Kp(R.operators.AND);function Xw(...r){return r.reduce(Ww)}R.and=Xw;var Qw=Kp(R.operators.OR);function eE(...r){return r.reduce(Qw)}R.or=eE;function Kp(r){return(e,t)=>e===z.nil?t:t===z.nil?e:(0,z._)`${vc(e)} ${r} ${vc(t)}`}function vc(r){return r instanceof z.Name?r:(0,z._)`(${r})`}});var U=w(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.checkStrictMode=F.getErrorPath=F.Type=F.useFunc=F.setEvaluated=F.evaluatedPropsToName=F.mergeEvaluated=F.eachItem=F.unescapeJsonPointer=F.escapeJsonPointer=F.escapeFragment=F.unescapeFragment=F.schemaRefOrVal=F.schemaHasRulesButRef=F.schemaHasRules=F.checkUnknownRules=F.alwaysValidSchema=F.toHash=void 0;var Q=q(),tE=ns();function rE(r){let e={};for(let t of r)e[t]=!0;return e}F.toHash=rE;function nE(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Yp(r,e),!Zp(e,r.self.RULES.all))}F.alwaysValidSchema=nE;function Yp(r,e=r.schema){let{opts:t,self:n}=r;if(!t.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||Xp(r,`unknown keyword: "${i}"`)}F.checkUnknownRules=Yp;function Zp(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(e[t])return!0;return!1}F.schemaHasRules=Zp;function sE(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(t!=="$ref"&&e.all[t])return!0;return!1}F.schemaHasRulesButRef=sE;function iE({topSchemaRef:r,schemaPath:e},t,n,s){if(!s){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Q._)`${t}`}return(0,Q._)`${r}${e}${(0,Q.getProperty)(n)}`}F.schemaRefOrVal=iE;function oE(r){return Jp(decodeURIComponent(r))}F.unescapeFragment=oE;function aE(r){return encodeURIComponent(wc(r))}F.escapeFragment=aE;function wc(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}F.escapeJsonPointer=wc;function Jp(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}F.unescapeJsonPointer=Jp;function cE(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}F.eachItem=cE;function Hp({mergeNames:r,mergeToName:e,mergeValues:t,resultToName:n}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof Q.Name?(i instanceof Q.Name?r(s,i,o):e(s,i,o),o):i instanceof Q.Name?(e(s,o,i),i):t(i,o);return a===Q.Name&&!(c instanceof Q.Name)?n(s,c):c}}F.mergeEvaluated={props:Hp({mergeNames:(r,e,t)=>r.if((0,Q._)`${t} !== true && ${e} !== undefined`,()=>{r.if((0,Q._)`${e} === true`,()=>r.assign(t,!0),()=>r.assign(t,(0,Q._)`${t} || {}`).code((0,Q._)`Object.assign(${t}, ${e})`))}),mergeToName:(r,e,t)=>r.if((0,Q._)`${t} !== true`,()=>{e===!0?r.assign(t,!0):(r.assign(t,(0,Q._)`${t} || {}`),Ec(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:Wp}),items:Hp({mergeNames:(r,e,t)=>r.if((0,Q._)`${t} !== true && ${e} !== undefined`,()=>r.assign(t,(0,Q._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(r,e,t)=>r.if((0,Q._)`${t} !== true`,()=>r.assign(t,e===!0?!0:(0,Q._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(r,e)=>r===!0?!0:Math.max(r,e),resultToName:(r,e)=>r.var("items",e)})};function Wp(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,Q._)`{}`);return e!==void 0&&Ec(r,t,e),t}F.evaluatedPropsToName=Wp;function Ec(r,e,t){Object.keys(t).forEach(n=>r.assign((0,Q._)`${e}${(0,Q.getProperty)(n)}`,!0))}F.setEvaluated=Ec;var Gp={};function lE(r,e){return r.scopeValue("func",{ref:e,code:Gp[e.code]||(Gp[e.code]=new tE._Code(e.code))})}F.useFunc=lE;var bc;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(bc||(F.Type=bc={}));function uE(r,e,t){if(r instanceof Q.Name){let n=e===bc.Num;return t?n?(0,Q._)`"[" + ${r} + "]"`:(0,Q._)`"['" + ${r} + "']"`:n?(0,Q._)`"/" + ${r}`:(0,Q._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Q.getProperty)(r).toString():"/"+wc(r)}F.getErrorPath=uE;function Xp(r,e,t=r.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);r.self.logger.warn(e)}}F.checkStrictMode=Xp});var et=w($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});var Te=q(),fE={data:new Te.Name("data"),valCxt:new Te.Name("valCxt"),instancePath:new Te.Name("instancePath"),parentData:new Te.Name("parentData"),parentDataProperty:new Te.Name("parentDataProperty"),rootData:new Te.Name("rootData"),dynamicAnchors:new Te.Name("dynamicAnchors"),vErrors:new Te.Name("vErrors"),errors:new Te.Name("errors"),this:new Te.Name("this"),self:new Te.Name("self"),scope:new Te.Name("scope"),json:new Te.Name("json"),jsonPos:new Te.Name("jsonPos"),jsonLen:new Te.Name("jsonLen"),jsonPart:new Te.Name("jsonPart")};$c.default=fE});var ls=w(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.extendErrors=Oe.resetErrorsCount=Oe.reportExtraError=Oe.reportError=Oe.keyword$DataError=Oe.keywordError=void 0;var K=q(),Ui=U(),ke=et();Oe.keywordError={message:({keyword:r})=>(0,K.str)`must pass "${r}" keyword validation`};Oe.keyword$DataError={message:({keyword:r,schemaType:e})=>e?(0,K.str)`"${r}" keyword must be ${e} ($data)`:(0,K.str)`"${r}" keyword is invalid ($data)`};function dE(r,e=Oe.keywordError,t,n){let{it:s}=r,{gen:i,compositeRule:o,allErrors:a}=s,c=th(r,e,t);n??(o||a)?Qp(i,c):eh(s,(0,K._)`[${c}]`)}Oe.reportError=dE;function pE(r,e=Oe.keywordError,t){let{it:n}=r,{gen:s,compositeRule:i,allErrors:o}=n,a=th(r,e,t);Qp(s,a),i||o||eh(n,ke.default.vErrors)}Oe.reportExtraError=pE;function hE(r,e){r.assign(ke.default.errors,e),r.if((0,K._)`${ke.default.vErrors} !== null`,()=>r.if(e,()=>r.assign((0,K._)`${ke.default.vErrors}.length`,e),()=>r.assign(ke.default.vErrors,null)))}Oe.resetErrorsCount=hE;function mE({gen:r,keyword:e,schemaValue:t,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=r.name("err");r.forRange("i",s,ke.default.errors,a=>{r.const(o,(0,K._)`${ke.default.vErrors}[${a}]`),r.if((0,K._)`${o}.instancePath === undefined`,()=>r.assign((0,K._)`${o}.instancePath`,(0,K.strConcat)(ke.default.instancePath,i.errorPath))),r.assign((0,K._)`${o}.schemaPath`,(0,K.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(r.assign((0,K._)`${o}.schema`,t),r.assign((0,K._)`${o}.data`,n))})}Oe.extendErrors=mE;function Qp(r,e){let t=r.const("err",e);r.if((0,K._)`${ke.default.vErrors} === null`,()=>r.assign(ke.default.vErrors,(0,K._)`[${t}]`),(0,K._)`${ke.default.vErrors}.push(${t})`),r.code((0,K._)`${ke.default.errors}++`)}function eh(r,e){let{gen:t,validateName:n,schemaEnv:s}=r;s.$async?t.throw((0,K._)`new ${r.ValidationError}(${e})`):(t.assign((0,K._)`${n}.errors`,e),t.return(!1))}var Tr={keyword:new K.Name("keyword"),schemaPath:new K.Name("schemaPath"),params:new K.Name("params"),propertyName:new K.Name("propertyName"),message:new K.Name("message"),schema:new K.Name("schema"),parentSchema:new K.Name("parentSchema")};function th(r,e,t){let{createErrors:n}=r.it;return n===!1?(0,K._)`{}`:yE(r,e,t)}function yE(r,e,t={}){let{gen:n,it:s}=r,i=[gE(s,t),_E(r,t)];return vE(r,e,i),n.object(...i)}function gE({errorPath:r},{instancePath:e}){let t=e?(0,K.str)`${r}${(0,Ui.getErrorPath)(e,Ui.Type.Str)}`:r;return[ke.default.instancePath,(0,K.strConcat)(ke.default.instancePath,t)]}function _E({keyword:r,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:n}){let s=n?e:(0,K.str)`${e}/${r}`;return t&&(s=(0,K.str)`${s}${(0,Ui.getErrorPath)(t,Ui.Type.Str)}`),[Tr.schemaPath,s]}function vE(r,{params:e,message:t},n){let{keyword:s,data:i,schemaValue:o,it:a}=r,{opts:c,propertyName:l,topSchemaRef:h,schemaPath:f}=a;n.push([Tr.keyword,s],[Tr.params,typeof e=="function"?e(r):e||(0,K._)`{}`]),c.messages&&n.push([Tr.message,typeof t=="function"?t(r):t]),c.verbose&&n.push([Tr.schema,o],[Tr.parentSchema,(0,K._)`${h}${f}`],[ke.default.data,i]),l&&n.push([Tr.propertyName,l])}});var nh=w(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.boolOrEmptySchema=rn.topBoolOrEmptySchema=void 0;var bE=ls(),wE=q(),EE=et(),$E={message:"boolean schema is false"};function SE(r){let{gen:e,schema:t,validateName:n}=r;t===!1?rh(r,!1):typeof t=="object"&&t.$async===!0?e.return(EE.default.data):(e.assign((0,wE._)`${n}.errors`,null),e.return(!0))}rn.topBoolOrEmptySchema=SE;function TE(r,e){let{gen:t,schema:n}=r;n===!1?(t.var(e,!1),rh(r)):t.var(e,!0)}rn.boolOrEmptySchema=TE;function rh(r,e){let{gen:t,data:n}=r,s={gen:t,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,bE.reportError)(s,$E,void 0,e)}});var Sc=w(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.getRules=nn.isJSONType=void 0;var OE=["string","number","integer","boolean","null","object","array"],NE=new Set(OE);function IE(r){return typeof r=="string"&&NE.has(r)}nn.isJSONType=IE;function AE(){let r={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...r,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},r.number,r.string,r.array,r.object],post:{rules:[]},all:{},keywords:{}}}nn.getRules=AE});var Tc=w(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.shouldUseRule=Xt.shouldUseGroup=Xt.schemaHasRulesForType=void 0;function PE({schema:r,self:e},t){let n=e.RULES.types[t];return n&&n!==!0&&sh(r,n)}Xt.schemaHasRulesForType=PE;function sh(r,e){return e.rules.some(t=>ih(r,t))}Xt.shouldUseGroup=sh;function ih(r,e){var t;return r[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(n=>r[n]!==void 0))}Xt.shouldUseRule=ih});var us=w(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.reportTypeError=Ne.checkDataTypes=Ne.checkDataType=Ne.coerceAndCheckDataType=Ne.getJSONTypes=Ne.getSchemaTypes=Ne.DataType=void 0;var kE=Sc(),CE=Tc(),LE=ls(),M=q(),oh=U(),sn;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(sn||(Ne.DataType=sn={}));function DE(r){let e=ah(r.type);if(e.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&e.push("null")}return e}Ne.getSchemaTypes=DE;function ah(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(kE.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Ne.getJSONTypes=ah;function qE(r,e){let{gen:t,data:n,opts:s}=r,i=ME(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,CE.schemaHasRulesForType)(r,e[0]));if(o){let a=Nc(e,n,s.strictNumbers,sn.Wrong);t.if(a,()=>{i.length?jE(r,e,i):Ic(r)})}return o}Ne.coerceAndCheckDataType=qE;var ch=new Set(["string","number","integer","boolean","null"]);function ME(r,e){return e?r.filter(t=>ch.has(t)||e==="array"&&t==="array"):[]}function jE(r,e,t){let{gen:n,data:s,opts:i}=r,o=n.let("dataType",(0,M._)`typeof ${s}`),a=n.let("coerced",(0,M._)`undefined`);i.coerceTypes==="array"&&n.if((0,M._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,M._)`${s}[0]`).assign(o,(0,M._)`typeof ${s}`).if(Nc(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,M._)`${a} !== undefined`);for(let l of t)(ch.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);n.else(),Ic(r),n.endIf(),n.if((0,M._)`${a} !== undefined`,()=>{n.assign(s,a),RE(r,a)});function c(l){switch(l){case"string":n.elseIf((0,M._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,M._)`"" + ${s}`).elseIf((0,M._)`${s} === null`).assign(a,(0,M._)`""`);return;case"number":n.elseIf((0,M._)`${o} == "boolean" || ${s} === null
|
|
2
|
+
import{a as V,b as Me,c as w,d as uw,e as ap,f as fw}from"./chunk-UR6MHSHU.js";var Mt=w(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.PROFILES=Je.Codes=Je.DEFAULT_PROFILE=Je.CONTRACT_VERSION=void 0;Je.profileChain=dw;Je.CONTRACT_VERSION="0.1";Je.DEFAULT_PROFILE="L0";Je.Codes={MANIFEST_MISSING:"manifest.missing",MANIFEST_PARSE:"manifest.parse",RESULT_MISSING:"result.missing",RESULT_PARSE:"result.parse",VERSION_UNSUPPORTED:"version.unsupported",SCHEMA:"schema.invalid",TEST_ID_MISMATCH:"test.id_mismatch",DEFINITION_MISSING:"definition.missing",DEFINITION_PATH_ESCAPE:"definition.path_escape",ORDINAL_COLLISION:"ordinal.collision",ORDINAL_NOT_INCREASING:"ordinal.not_increasing",ENDED_BEFORE_STARTED:"ended.before_started",TOTALS_MISMATCH:"totals.mismatch",HASH_MISSING:"definition.hash_missing",HASH_MISMATCH:"definition.hash_mismatch",STATUS_DISAGREES:"status.disagrees_with_steps",L1_LOGS_MISSING:"l1.logs.missing",L1_LOGS_META_MISSING:"l1.logs.meta_missing",L1_LOGS_META_INVALID:"l1.logs.meta_invalid",L1_LOG_FILE_MISSING:"l1.logs.file_missing",L1_LOG_PATH_ESCAPE:"l1.logs.path_escape",L1_STEPS_MISSING:"l1.steps.missing",L1_STEPS_MALFORMED:"l1.steps.malformed_name",L1_STEPS_UNMATCHED:"l1.steps.unmatched",L1_STEPS_SCREENSHOT_MISSING:"l1.steps.screenshot_missing",L1_COVERAGE_MISSING:"l1.coverage.missing",L1_VIDEO_INVALID:"l1.video.invalid",L1_FAILURE_INVALID:"l1.failure.invalid",L1_FAILURE_UNMATCHED:"l1.failure.unmatched",L1_FAILURE_REF_ESCAPE:"l1.failure.ref_escape",L1_FAILURE_REF_MISSING:"l1.failure.ref_missing",L1_FAILURE_STATUS_DISAGREES:"l1.failure.status_disagrees",L1_FAILURE_MISSING:"l1.failure.missing",L1_FAILURE_INDEX_MISSING:"l1.failure_index.missing",L1_FAILURE_INDEX_INVALID:"l1.failure_index.invalid",L1_FAILURE_INDEX_DANGLING:"l1.failure_index.dangling",L1_FAILURE_INDEX_INCOMPLETE:"l1.failure_index.incomplete",CATALOG_MISSING:"catalog.missing",CATALOG_HASH_MISMATCH:"catalog.hash_mismatch",CATALOG_IDENTITY_MISMATCH:"catalog.identity_mismatch",CATALOG_UNREFERENCED:"catalog.unreferenced"};Je.PROFILES={L0:["L0"],L1:["L0","L1"]};function dw(r){return Je.PROFILES[r]??null}});var jt=w(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.err=pw;Ni.warn=hw;function pw(r,e,t){return{code:r,severity:"error",location:e,message:t}}function hw(r,e,t){return{code:r,severity:"warning",location:e,message:t}}});var Ja=w((bj,cp)=>{"use strict";cp.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Ii=w(up=>{"use strict";var lp={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function mw(r){return function(...e){return e.length&&(r=r.replace(/\{(\d)\}/g,(t,n)=>e[n]||"")),new Error("ADM-ZIP: "+r)}}for(let r of Object.keys(lp))up[r]=mw(lp[r])});var mp=w((Ej,hp)=>{"use strict";var yw=V("fs"),he=V("path"),fp=Ja(),gw=Ii(),_w=typeof process=="object"&&process.platform==="win32",dp=r=>typeof r=="object"&&r!==null,pp=new Uint32Array(256).map((r,e)=>{for(let t=0;t<8;t++)(e&1)!==0?e=3988292384^e>>>1:e>>>=1;return e>>>0});function ae(r){this.sep=he.sep,this.fs=yw,dp(r)&&dp(r.fs)&&typeof r.fs.statSync=="function"&&(this.fs=r.fs)}hp.exports=ae;ae.prototype.makeDir=function(r){let e=this;function t(n){let s=n.split(e.sep)[0];n.split(e.sep).forEach(function(i){if(!(!i||i.substr(-1,1)===":")){s+=e.sep+i;var o;try{o=e.fs.statSync(s)}catch(a){if(a.message&&a.message.startsWith("ENOENT"))e.fs.mkdirSync(s);else throw a}if(o&&o.isFile())throw gw.FILE_IN_THE_WAY(`"${s}"`)}})}t(r)};ae.prototype.writeFileTo=function(r,e,t,n){let s=this;if(s.fs.existsSync(r)){if(!t)return!1;var i=s.fs.statSync(r);if(i.isDirectory())return!1}var o=he.dirname(r);s.fs.existsSync(o)||s.makeDir(o);var a;try{a=s.fs.openSync(r,"w",438)}catch{s.fs.chmodSync(r,438),a=s.fs.openSync(r,"w",438)}if(a)try{s.fs.writeSync(a,e,0,e.length,0)}finally{s.fs.closeSync(a)}return s.fs.chmodSync(r,n||438),!0};ae.prototype.writeFileToAsync=function(r,e,t,n,s){typeof n=="function"&&(s=n,n=void 0);let i=this;i.fs.exists(r,function(o){if(o&&!t)return s(!1);i.fs.stat(r,function(a,c){if(o&&c.isDirectory())return s(!1);var l=he.dirname(r);i.fs.exists(l,function(h){h||i.makeDir(l),i.fs.open(r,"w",438,function(f,d){f?i.fs.chmod(r,438,function(){i.fs.open(r,"w",438,function(p,y){i.fs.write(y,e,0,e.length,0,function(){i.fs.close(y,function(){i.fs.chmod(r,n||438,function(){s(!0)})})})})}):d?i.fs.write(d,e,0,e.length,0,function(){i.fs.close(d,function(){i.fs.chmod(r,n||438,function(){s(!0)})})}):i.fs.chmod(r,n||438,function(){s(!0)})})})})})};ae.prototype.findFiles=function(r){let e=this;function t(n,s,i){typeof s=="boolean"&&(i=s,s=void 0);let o=[];return e.fs.readdirSync(n).forEach(function(a){let c=he.join(n,a),l=e.fs.statSync(c);(!s||s.test(c))&&o.push(he.normalize(c)+(l.isDirectory()?e.sep:"")),l.isDirectory()&&i&&(o=o.concat(t(c,s,i)))}),o}return t(r,void 0,!0)};ae.prototype.findFilesAsync=function(r,e){let t=this,n=[];t.fs.readdir(r,function(s,i){if(s)return e(s);let o=i.length;if(!o)return e(null,n);i.forEach(function(a){a=he.join(r,a),t.fs.stat(a,function(c,l){if(c)return e(c);l&&(n.push(he.normalize(a)+(l.isDirectory()?t.sep:"")),l.isDirectory()?t.findFilesAsync(a,function(h,f){if(h)return e(h);n=n.concat(f),--o||e(null,n)}):--o||e(null,n))})})})};ae.prototype.getAttributes=function(){};ae.prototype.setAttributes=function(){};ae.crc32update=function(r,e){return pp[(r^e)&255]^r>>>8};ae.crc32=function(r){typeof r=="string"&&(r=Buffer.from(r,"utf8"));let e=r.length,t=-1;for(let n=0;n<e;)t=ae.crc32update(t,r[n++]);return~t>>>0};ae.methodToString=function(r){switch(r){case fp.STORED:return"STORED ("+r+")";case fp.DEFLATED:return"DEFLATED ("+r+")";default:return"UNSUPPORTED ("+r+")"}};ae.canonical=function(r){if(!r)return"";let e=he.posix.normalize("/"+r.split("\\").join("/"));return he.join(".",e)};ae.zipnamefix=function(r){if(!r)return"";let e=he.posix.normalize("/"+r.split("\\").join("/"));return he.posix.join(".",e)};ae.findLast=function(r,e){if(!Array.isArray(r))throw new TypeError("arr is not array");let t=r.length>>>0;for(let n=t-1;n>=0;n--)if(e(r[n],n,r))return r[n]};ae.sanitize=function(r,e){r=he.resolve(he.normalize(r));for(var t=e.split("/"),n=0,s=t.length;n<s;n++){var i=he.normalize(he.join(r,t.slice(n,s).join(he.sep)));if(i===r||i.startsWith(r+he.sep))return i}return he.normalize(he.join(r,he.basename(e)))};ae.toBuffer=function(e,t){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?t(e):Buffer.alloc(0)};ae.readBigUInt64LE=function(r,e){let t=r.readUInt32LE(e);return r.readUInt32LE(e+4)*4294967296+t};ae.writeBigUInt64LE=function(r,e,t){let n=e>>>0,s=Math.floor(e/4294967296)>>>0;r.writeUInt32LE(n,t),r.writeUInt32LE(s,t+4)};ae.fromDOS2Date=function(r){return new Date((r>>25&127)+1980,Math.max((r>>21&15)-1,0),Math.max(r>>16&31,1),r>>11&31,r>>5&63,(r&31)<<1)};ae.fromDate2DOS=function(r){let e=0,t=0;return r.getFullYear()>1979&&(e=(r.getFullYear()-1980&127)<<9|r.getMonth()+1<<5|r.getDate(),t=r.getHours()<<11|r.getMinutes()<<5|r.getSeconds()>>1),e<<16|t};ae.isWin=_w;ae.crcTable=pp});var gp=w(($j,yp)=>{"use strict";var vw=V("path");yp.exports=function(r,{fs:e}){var t=r||"",n=i(),s=null;function i(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return t&&e.existsSync(t)?(s=e.statSync(t),n.directory=s.isDirectory(),n.mtime=s.mtime,n.atime=s.atime,n.executable=(73&s.mode)!==0,n.readonly=(128&s.mode)===0,n.hidden=vw.basename(t)[0]==="."):console.warn("Invalid path: "+t),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:t,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var vp=w((Sj,_p)=>{"use strict";_p.exports={efs:!0,encode:r=>Buffer.from(r,"utf8"),decode:r=>r.toString("utf8")}});var Qr=w((Tj,Xr)=>{"use strict";Xr.exports=mp();Xr.exports.Constants=Ja();Xr.exports.Errors=Ii();Xr.exports.FileAttr=gp();Xr.exports.decoder=vp()});var wp=w((Oj,bp)=>{"use strict";var Jt=Qr(),N=Jt.Constants;bp.exports=function(){var r=20,e=10,t=0,n=0,s=0,i=0,o=0,a=0,c=0,l=0,h=0,f=0,d=0,p=0,y=0;r|=Jt.isWin?2560:768,t|=N.FLG_EFS;let u={extraLen:0},m=g=>Math.max(0,g)>>>0,_=g=>Math.max(0,g)&65535,v=g=>Math.max(0,g)&255;return s=Jt.fromDate2DOS(new Date),{get made(){return r},set made(g){r=g},get version(){return e},set version(g){e=g},get flags(){return t},set flags(g){t=g},get flags_efs(){return(t&N.FLG_EFS)>0},set flags_efs(g){g?t|=N.FLG_EFS:t&=~N.FLG_EFS},get flags_desc(){return(t&N.FLG_DESC)>0},set flags_desc(g){g?t|=N.FLG_DESC:t&=~N.FLG_DESC},get method(){return n},set method(g){switch(g){case N.STORED:this.version=10;break;case N.DEFLATED:default:this.version=20}n=g},get time(){return Jt.fromDOS2Date(this.timeval)},set time(g){g=new Date(g),this.timeval=Jt.fromDate2DOS(g)},get timeval(){return s},set timeval(g){s=m(g)},get timeHighByte(){return v(s>>>8)},get crc(){return i},set crc(g){i=m(g)},get compressedSize(){return o},set compressedSize(g){o=m(g)},get size(){return a},set size(g){a=m(g)},get fileNameLength(){return c},set fileNameLength(g){c=g},get extraLength(){return l},set extraLength(g){l=g},get extraLocalLength(){return u.extraLen},set extraLocalLength(g){u.extraLen=g},get commentLength(){return h},set commentLength(g){h=g},get diskNumStart(){return f},set diskNumStart(g){f=m(g)},get inAttr(){return d},set inAttr(g){d=m(g)},get attr(){return p},set attr(g){p=m(g)},get fileAttr(){return(p||0)>>16&4095},get offset(){return y},set offset(g){y=m(g)},get encrypted(){return(t&N.FLG_ENC)===N.FLG_ENC},get centralHeaderSize(){return N.CENHDR+c+l+h},get realDataOffset(){return y+N.LOCHDR+u.fnameLen+u.extraLen},get localHeader(){return u},loadLocalHeaderFromBinary:function(g){var b=g.slice(y,y+N.LOCHDR);if(b.readUInt32LE(0)!==N.LOCSIG)throw Jt.Errors.INVALID_LOC();u.version=b.readUInt16LE(N.LOCVER),u.flags=b.readUInt16LE(N.LOCFLG),u.flags_desc=(u.flags&N.FLG_DESC)>0,u.method=b.readUInt16LE(N.LOCHOW),u.time=b.readUInt32LE(N.LOCTIM),u.crc=b.readUInt32LE(N.LOCCRC),u.compressedSize=b.readUInt32LE(N.LOCSIZ),u.size=b.readUInt32LE(N.LOCLEN),u.fnameLen=b.readUInt16LE(N.LOCNAM),u.extraLen=b.readUInt16LE(N.LOCEXT);let E=y+N.LOCHDR+u.fnameLen,$=E+u.extraLen;return g.slice(E,$)},loadFromBinary:function(g){if(g.length!==N.CENHDR||g.readUInt32LE(0)!==N.CENSIG)throw Jt.Errors.INVALID_CEN();r=g.readUInt16LE(N.CENVEM),e=g.readUInt16LE(N.CENVER),t=g.readUInt16LE(N.CENFLG),n=g.readUInt16LE(N.CENHOW),s=g.readUInt32LE(N.CENTIM),i=g.readUInt32LE(N.CENCRC),o=g.readUInt32LE(N.CENSIZ),a=g.readUInt32LE(N.CENLEN),c=g.readUInt16LE(N.CENNAM),l=g.readUInt16LE(N.CENEXT),h=g.readUInt16LE(N.CENCOM),f=g.readUInt16LE(N.CENDSK),d=g.readUInt16LE(N.CENATT),p=g.readUInt32LE(N.CENATX),y=g.readUInt32LE(N.CENOFF)},localHeaderToBinary:function(){var g=Buffer.alloc(N.LOCHDR);return g.writeUInt32LE(N.LOCSIG,0),g.writeUInt16LE(e,N.LOCVER),g.writeUInt16LE(t&~N.FLG_DESC,N.LOCFLG),g.writeUInt16LE(n,N.LOCHOW),g.writeUInt32LE(s,N.LOCTIM),g.writeUInt32LE(i,N.LOCCRC),g.writeUInt32LE(o,N.LOCSIZ),g.writeUInt32LE(a,N.LOCLEN),g.writeUInt16LE(c,N.LOCNAM),g.writeUInt16LE(u.extraLen,N.LOCEXT),g},centralHeaderToBinary:function(){var g=Buffer.alloc(N.CENHDR+c+l+h);return g.writeUInt32LE(N.CENSIG,0),g.writeUInt16LE(r,N.CENVEM),g.writeUInt16LE(e,N.CENVER),g.writeUInt16LE(t&~N.FLG_DESC,N.CENFLG),g.writeUInt16LE(n,N.CENHOW),g.writeUInt32LE(s,N.CENTIM),g.writeUInt32LE(i,N.CENCRC),g.writeUInt32LE(o,N.CENSIZ),g.writeUInt32LE(a,N.CENLEN),g.writeUInt16LE(c,N.CENNAM),g.writeUInt16LE(l,N.CENEXT),g.writeUInt16LE(h,N.CENCOM),g.writeUInt16LE(f,N.CENDSK),g.writeUInt16LE(d,N.CENATT),g.writeUInt32LE(p,N.CENATX),g.writeUInt32LE(y,N.CENOFF),g},toJSON:function(){let g=function(b){return b+" bytes"};return{made:r,version:e,flags:t,method:Jt.methodToString(n),time:this.time,crc:"0x"+i.toString(16).toUpperCase(),compressedSize:g(o),size:g(a),fileNameLength:g(c),extraLength:g(l),commentLength:g(h),diskNumStart:f,inAttr:d,attr:p,offset:y,centralHeaderSize:g(N.CENHDR+c+l+h)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var $p=w((Nj,Ep)=>{"use strict";var We=Qr(),k=We.Constants;Ep.exports=function(){var r=0,e=0,t=0,n=0,s=0;let i=()=>r>k.EF_ZIP64_OR_16||e>k.EF_ZIP64_OR_16||t>k.EF_ZIP64_OR_32||n>k.EF_ZIP64_OR_32;return{get diskEntries(){return r},set diskEntries(o){r=e=o},get totalEntries(){return e},set totalEntries(o){e=r=o},get size(){return t},set size(o){t=o},get offset(){return n},set offset(o){n=o},get commentLength(){return s},set commentLength(o){s=o},get mainHeaderSize(){return(i()?k.ZIP64HDR+k.END64HDR:0)+k.ENDHDR+s},loadFromBinary:function(o){if((o.length!==k.ENDHDR||o.readUInt32LE(0)!==k.ENDSIG)&&(o.length<k.ZIP64HDR||o.readUInt32LE(0)!==k.ZIP64SIG))throw We.Errors.INVALID_END();o.readUInt32LE(0)===k.ENDSIG?(r=o.readUInt16LE(k.ENDSUB),e=o.readUInt16LE(k.ENDTOT),t=o.readUInt32LE(k.ENDSIZ),n=o.readUInt32LE(k.ENDOFF),s=o.readUInt16LE(k.ENDCOM)):(r=We.readBigUInt64LE(o,k.ZIP64SUB),e=We.readBigUInt64LE(o,k.ZIP64TOT),t=We.readBigUInt64LE(o,k.ZIP64SIZB),n=We.readBigUInt64LE(o,k.ZIP64OFF),s=0)},toBinary:function(){if(!i()){var o=Buffer.alloc(k.ENDHDR+s);return o.writeUInt32LE(k.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(r,k.ENDSUB),o.writeUInt16LE(e,k.ENDTOT),o.writeUInt32LE(t,k.ENDSIZ),o.writeUInt32LE(n,k.ENDOFF),o.writeUInt16LE(s,k.ENDCOM),o.fill(" ",k.ENDHDR),o}var o=Buffer.alloc(this.mainHeaderSize);let a=0;o.writeUInt32LE(k.ZIP64SIG,a),We.writeBigUInt64LE(o,k.ZIP64HDR-k.ZIP64LEAD,a+k.ZIP64SIZE),o.writeUInt16LE(45,a+k.ZIP64VEM),o.writeUInt16LE(45,a+k.ZIP64VER),o.writeUInt32LE(0,a+k.ZIP64DSK),o.writeUInt32LE(0,a+k.ZIP64DSKDIR),We.writeBigUInt64LE(o,r,a+k.ZIP64SUB),We.writeBigUInt64LE(o,e,a+k.ZIP64TOT),We.writeBigUInt64LE(o,t,a+k.ZIP64SIZB),We.writeBigUInt64LE(o,n,a+k.ZIP64OFF);let c=n+t;return a+=k.ZIP64HDR,o.writeUInt32LE(k.END64SIG,a),o.writeUInt32LE(0,a+k.END64START),We.writeBigUInt64LE(o,c,a+k.END64OFF),o.writeUInt32LE(1,a+k.END64NUMDISKS),a+=k.END64HDR,o.writeUInt32LE(k.ENDSIG,a),o.writeUInt32LE(0,a+4),o.writeUInt16LE(Math.min(r,k.EF_ZIP64_OR_16),a+k.ENDSUB),o.writeUInt16LE(Math.min(e,k.EF_ZIP64_OR_16),a+k.ENDTOT),o.writeUInt32LE(Math.min(t,k.EF_ZIP64_OR_32),a+k.ENDSIZ),o.writeUInt32LE(Math.min(n,k.EF_ZIP64_OR_32),a+k.ENDOFF),o.writeUInt16LE(s,a+k.ENDCOM),o.fill(" ",a+k.ENDHDR),o},toJSON:function(){let o=function(a,c){let l=a.toString(16).toUpperCase();for(;l.length<c;)l="0"+l;return"0x"+l};return{diskEntries:r,totalEntries:e,size:t+" bytes",offset:o(n,4),commentLength:s}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Xa=w(Wa=>{"use strict";Wa.EntryHeader=wp();Wa.MainHeader=$p()});var Tp=w((Aj,Sp)=>{"use strict";Sp.exports=function(r){var e=V("zlib"),t={chunkSize:(parseInt(r.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(r,t)},deflateAsync:function(n){var s=e.createDeflateRaw(t),i=[],o=0;s.on("data",function(a){i.push(a),o+=a.length}),s.on("end",function(){var a=Buffer.alloc(o),c=0;a.fill(0);for(var l=0;l<i.length;l++){var h=i[l];h.copy(a,c),c+=h.length}n&&n(a)}),s.end(r)}}}});var Np=w((Pj,Op)=>{"use strict";var bw=+(process?.versions?.node??"").split(".")[0]||0;Op.exports=function(r,e){var t=V("zlib");let n=bw>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return t.inflateRawSync(r,n)},inflateAsync:function(s){var i=t.createInflateRaw(n),o=[],a=0;i.on("data",function(c){o.push(c),a+=c.length}),i.on("end",function(){var c=Buffer.alloc(a),l=0;c.fill(0);for(var h=0;h<o.length;h++){var f=o[h];f.copy(c,l),l+=f.length}s&&s(c)}),i.end(r)}}}});var Cp=w((kj,kp)=>{"use strict";var{randomFillSync:Ip}=V("crypto"),ww=Ii(),Ew=new Uint32Array(256).map((r,e)=>{for(let t=0;t<8;t++)(e&1)!==0?e=e>>>1^3988292384:e>>>=1;return e>>>0}),Pp=(r,e)=>Math.imul(r,e)>>>0,Ap=(r,e)=>Ew[(r^e)&255]^r>>>8,Qn=()=>typeof Ip=="function"?Ip(Buffer.alloc(12)):Qn.node();Qn.node=()=>{let r=Buffer.alloc(12),e=r.length;for(let t=0;t<e;t++)r[t]=Math.random()*256&255;return r};var Ai={genSalt:Qn};function Pi(r){let e=Buffer.isBuffer(r)?r:Buffer.from(r);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let t=0;t<e.length;t++)this.updateKeys(e[t])}Pi.prototype.updateKeys=function(r){let e=this.keys;return e[0]=Ap(e[0],r),e[1]+=e[0]&255,e[1]=Pp(e[1],134775813)+1,e[2]=Ap(e[2],e[1]>>>24),r};Pi.prototype.next=function(){let r=(this.keys[2]|2)>>>0;return Pp(r,r^1)>>8&255};function $w(r){let e=new Pi(r);return function(t){let n=Buffer.alloc(t.length),s=0;for(let i of t)n[s++]=e.updateKeys(i^e.next());return n}}function Sw(r){let e=new Pi(r);return function(t,n,s=0){n||(n=Buffer.alloc(t.length));for(let i of t){let o=e.next();n[s++]=i^o,e.updateKeys(i)}return n}}function Tw(r,e,t){if(!r||!Buffer.isBuffer(r)||r.length<12)return Buffer.alloc(0);let n=$w(t),s=n(r.slice(0,12)),i=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(s[11]!==i)throw ww.WRONG_PASSWORD();return n(r.slice(12))}function Ow(r){Buffer.isBuffer(r)&&r.length>=12?Ai.genSalt=function(){return r.slice(0,12)}:r==="node"?Ai.genSalt=Qn.node:Ai.genSalt=Qn}function Nw(r,e,t,n=!1){r==null&&(r=Buffer.alloc(0)),Buffer.isBuffer(r)||(r=Buffer.from(r.toString()));let s=Sw(t),i=Ai.genSalt();i[11]=e.crc>>>24&255,n&&(i[10]=e.crc>>>16&255);let o=Buffer.alloc(r.length+12);return s(i,o),s(r,o,12)}kp.exports={decrypt:Tw,encrypt:Nw,_salter:Ow}});var Lp=w(ki=>{"use strict";ki.Deflater=Tp();ki.Inflater=Np();ki.ZipCrypto=Cp()});var ec=w((Lj,Dp)=>{"use strict";var Y=Qr(),Iw=Xa(),ue=Y.Constants,Qa=Lp();Dp.exports=function(r,e){var t=new Iw.EntryHeader,n=Buffer.alloc(0),s=Buffer.alloc(0),i=!1,o=null,a=Buffer.alloc(0),c=Buffer.alloc(0),l=!0;let h=r,f=typeof h.decoder=="object"?h.decoder:Y.decoder;l=f.hasOwnProperty("efs")?f.efs:!1;function d(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(c=t.loadLocalHeaderFromBinary(e),e.slice(t.realDataOffset,t.realDataOffset+t.compressedSize))}function p(g){if(!t.flags_desc&&!t.localHeader.flags_desc){if(Y.crc32(g)!==t.localHeader.crc)return!1}else{let b={},E=t.realDataOffset+t.compressedSize;if(e.readUInt32LE(E)==ue.LOCSIG||e.readUInt32LE(E)==ue.CENSIG)throw Y.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(E)==ue.EXTSIG)b.crc=e.readUInt32LE(E+ue.EXTCRC),b.compressedSize=e.readUInt32LE(E+ue.EXTSIZ),b.size=e.readUInt32LE(E+ue.EXTLEN);else if(e.readUInt16LE(E+12)===19280)b.crc=e.readUInt32LE(E+ue.EXTCRC-4),b.compressedSize=e.readUInt32LE(E+ue.EXTSIZ-4),b.size=e.readUInt32LE(E+ue.EXTLEN-4);else throw Y.Errors.DESCRIPTOR_UNKNOWN();if(b.compressedSize!==t.compressedSize||b.size!==t.size||b.crc!==t.crc)throw Y.Errors.DESCRIPTOR_FAULTY();if(Y.crc32(g)!==b.crc)return!1}return!0}function y(g,b,E){if(typeof b>"u"&&typeof g=="string"&&(E=g,g=void 0),i)return g&&b&&b(Buffer.alloc(0),Y.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=d();if($.length===0)return g&&b&&b($),$;if(t.encrypted){if(typeof E!="string"&&!Buffer.isBuffer(E))throw Y.Errors.INVALID_PASS_PARAM();$=Qa.ZipCrypto.decrypt($,t,E)}var S=Buffer.alloc(t.size);switch(t.method){case Y.Constants.STORED:if($.copy(S),p(S))return g&&b&&b(S),S;throw g&&b&&b(S,Y.Errors.BAD_CRC()),Y.Errors.BAD_CRC();case Y.Constants.DEFLATED:var O=new Qa.Inflater($,t.size);if(g)O.inflateAsync(function(A){A.copy(A,0),b&&(p(A)?b(A):b(A,Y.Errors.BAD_CRC()))});else{if(O.inflate(S).copy(S,0),!p(S))throw Y.Errors.BAD_CRC(`"${f.decode(n)}"`);return S}break;default:throw g&&b&&b(Buffer.alloc(0),Y.Errors.UNKNOWN_METHOD()),Y.Errors.UNKNOWN_METHOD()}}function u(g,b){if((!o||!o.length)&&Buffer.isBuffer(e))return g&&b&&b(d()),d();if(o.length&&!i){var E;switch(t.method){case Y.Constants.STORED:return t.compressedSize=t.size,E=Buffer.alloc(o.length),o.copy(E),g&&b&&b(E),E;default:case Y.Constants.DEFLATED:var $=new Qa.Deflater(o);if(g)$.deflateAsync(function(O){E=Buffer.alloc(O.length),t.compressedSize=O.length,O.copy(E),b&&b(E)});else{var S=$.deflate();return t.compressedSize=S.length,S}$=null;break}}else if(g&&b)b(Buffer.alloc(0));else return Buffer.alloc(0)}function m(g,b){return Y.readBigUInt64LE(g,b)}function _(g){try{for(var b=0,E,$,S;b+4<g.length;)E=g.readUInt16LE(b),b+=2,$=g.readUInt16LE(b),b+=2,S=g.slice(b,b+$),b+=$,ue.ID_ZIP64===E&&v(S)}catch{throw Y.Errors.EXTRA_FIELD_PARSE_ERROR()}}function v(g){var b,E,$,S;g.length>=ue.EF_ZIP64_SCOMP&&(b=m(g,ue.EF_ZIP64_SUNCOMP),t.size===ue.EF_ZIP64_OR_32&&(t.size=b)),g.length>=ue.EF_ZIP64_RHO&&(E=m(g,ue.EF_ZIP64_SCOMP),t.compressedSize===ue.EF_ZIP64_OR_32&&(t.compressedSize=E)),g.length>=ue.EF_ZIP64_DSN&&($=m(g,ue.EF_ZIP64_RHO),t.offset===ue.EF_ZIP64_OR_32&&(t.offset=$)),g.length>=ue.EF_ZIP64_DSN+4&&(S=g.readUInt32LE(ue.EF_ZIP64_DSN),t.diskNumStart===ue.EF_ZIP64_OR_16&&(t.diskNumStart=S))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(g){n=Y.toBuffer(g,f.encode);var b=n[n.length-1];i=b===47||b===92,t.fileNameLength=n.length},get efs(){return typeof l=="function"?l(this.entryName):l},get extra(){return a},set extra(g){a=g,t.extraLength=g.length,_(g)},get comment(){return f.decode(s)},set comment(g){if(s=Y.toBuffer(g,f.encode),t.commentLength=s.length,s.length>65535)throw Y.Errors.COMMENT_TOO_LONG()},get name(){var g=f.decode(n);return i?g.substr(g.length-1).split("/").pop():g.split("/").pop()},get isDirectory(){return i},getCompressedData:function(){return u(!1,null)},getCompressedDataAsync:function(g){u(!0,g)},setData:function(g){o=Y.toBuffer(g,Y.decoder.encode),!i&&o.length?(t.size=o.length,t.method=Y.Constants.DEFLATED,t.crc=Y.crc32(g),t.changed=!0):t.method=Y.Constants.STORED},getData:function(g){return t.changed?o:y(!1,null,g)},getDataAsync:function(g,b){t.changed?g(o):y(!0,g,b)},set attr(g){t.attr=g},get attr(){return t.attr},set header(g){t.loadFromBinary(g)},get header(){return t},packCentralHeader:function(){t.flags_efs=this.efs,t.extraLength=a.length;var g=t.centralHeaderToBinary(),b=Y.Constants.CENHDR;return n.copy(g,b),b+=n.length,a.copy(g,b),b+=t.extraLength,s.copy(g,b),g},packLocalHeader:function(){let g=0;t.flags_efs=this.efs,t.extraLocalLength=c.length;let b=t.localHeaderToBinary(),E=Buffer.alloc(b.length+n.length+t.extraLocalLength);return b.copy(E,g),g+=b.length,n.copy(E,g),g+=n.length,c.copy(E,g),g+=c.length,E},toJSON:function(){let g=function(b){return"<"+(b&&b.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:t.toJSON(),compressedData:g(e),data:g(o)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var jp=w((Dj,Mp)=>{"use strict";var qp=ec(),Aw=Xa(),Ae=Qr();Mp.exports=function(r,e){var t=[],n={},s=Buffer.alloc(0),i=new Aw.MainHeader,o=!1,a=null;let c=new Set,l=e,{noSort:h,decoder:f}=l;r?y(l.readEntries):o=!0;function d(){let m=new Set;for(let _ of Object.keys(n)){let v=_.split("/");if(v.pop(),!!v.length)for(let g=0;g<v.length;g++){let b=v.slice(0,g+1).join("/")+"/";m.add(b)}}for(let _ of m)if(!(_ in n)){let v=new qp(l);v.entryName=_,v.attr=16,v.temporary=!0,t.push(v),n[v.entryName]=v,c.add(v)}}function p(){if(o=!0,n={},i.diskEntries>(r.length-i.offset)/Ae.Constants.CENHDR)throw Ae.Errors.DISK_ENTRY_TOO_LARGE();t=new Array(i.diskEntries);for(var m=i.offset,_=0;_<t.length;_++){var v=m,g=new qp(l,r);g.header=r.slice(v,v+=Ae.Constants.CENHDR),g.entryName=r.slice(v,v+=g.header.fileNameLength),g.header.extraLength&&(g.extra=r.slice(v,v+=g.header.extraLength)),g.header.commentLength&&(g.comment=r.slice(v,v+g.header.commentLength)),m+=g.header.centralHeaderSize,t[_]=g,n[g.entryName]=g}c.clear(),d()}function y(m){var _=r.length-Ae.Constants.ENDHDR,v=Math.max(0,_-65535),g=v,b=r.length,E=-1,$=0;for(typeof l.trailingSpace=="boolean"&&l.trailingSpace&&(v=0),_;_>=g;_--)if(r[_]===80){if(r.readUInt32LE(_)===Ae.Constants.ENDSIG){E=_,$=_,b=_+Ae.Constants.ENDHDR,g=_-Ae.Constants.END64HDR;continue}if(r.readUInt32LE(_)===Ae.Constants.END64SIG){g=v;continue}if(r.readUInt32LE(_)===Ae.Constants.ZIP64SIG){E=_,b=_+Ae.readBigUInt64LE(r,_+Ae.Constants.ZIP64SIZE)+Ae.Constants.ZIP64LEAD;break}}if(E==-1)throw Ae.Errors.INVALID_FORMAT();i.loadFromBinary(r.slice(E,b)),i.commentLength&&(s=r.slice($+Ae.Constants.ENDHDR)),m&&p()}function u(){t.length>1&&!h&&t.sort((m,_)=>m.entryName.toLowerCase().localeCompare(_.entryName.toLowerCase()))}return{get entries(){return o||p(),t.filter(m=>!c.has(m))},get comment(){return f.decode(s)},set comment(m){s=Ae.toBuffer(m,f.encode),i.commentLength=s.length},getEntryCount:function(){return o?t.length:i.diskEntries},forEach:function(m){this.entries.forEach(m)},getEntry:function(m){return o||p(),n[m]||null},setEntry:function(m){o||p(),t.push(m),n[m.entryName]=m,i.totalEntries=t.length},deleteFile:function(m,_=!0){o||p();let v=n[m];this.getEntryChildren(v,_).map(b=>b.entryName).forEach(this.deleteEntry)},deleteEntry:function(m){o||p();let _=n[m],v=t.indexOf(_);v>=0&&(t.splice(v,1),delete n[m],i.totalEntries=t.length)},getEntryChildren:function(m,_=!0){if(o||p(),typeof m=="object")if(m.isDirectory&&_){let v=[],g=m.entryName;for(let b of t)b.entryName.startsWith(g)&&v.push(b);return v}else return[m];return[]},getChildCount:function(m){if(m&&m.isDirectory){let _=this.getEntryChildren(m);return _.includes(m)?_.length-1:_.length}return 0},compressToBuffer:function(){o||p(),u();let m=[],_=[],v=0,g=0;i.size=0,i.offset=0;let b=0;for(let S of this.entries){let O=S.getCompressedData();S.header.offset=g;let A=S.packLocalHeader(),x=A.length+O.length;g+=x,m.push(A),m.push(O);let j=S.packCentralHeader();_.push(j),i.size+=j.length,v+=x+j.length,b++}v+=i.mainHeaderSize,i.offset=g,i.totalEntries=b,g=0;let E=Buffer.alloc(v);for(let S of m)S.copy(E,g),g+=S.length;for(let S of _)S.copy(E,g),g+=S.length;let $=i.toBinary();return s&&s.copy($,$.length-s.length),$.copy(E,g),r=E,o=!1,E},toAsyncBuffer:function(m,_,v,g){try{o||p(),u();let b=[],E=[],$=0,S=0,O=0;i.size=0,i.offset=0;let A=function(x){if(x.length>0){let j=x.shift(),B=j.entryName+j.extra.toString();v&&v(B),j.getCompressedDataAsync(function(de){g&&g(B),j.header.offset=S;let Wr=j.packLocalHeader(),op=Wr.length+de.length;S+=op,b.push(Wr),b.push(de);let Za=j.packCentralHeader();E.push(Za),i.size+=Za.length,$+=op+Za.length,O++,A(x)})}else{$+=i.mainHeaderSize,i.offset=S,i.totalEntries=O,S=0;let j=Buffer.alloc($);b.forEach(function(de){de.copy(j,S),S+=de.length}),E.forEach(function(de){de.copy(j,S),S+=de.length});let B=i.toBinary();s&&s.copy(B,B.length-s.length),B.copy(j,S),r=j,o=!1,m(j)}};A(Array.from(this.entries))}catch(b){_(b)}}}}});var tc=w((qj,xp)=>{"use strict";var le=Qr(),ce=V("path"),Pw=ec(),kw=jp(),br=(...r)=>le.findLast(r,e=>typeof e=="boolean"),Rp=(...r)=>le.findLast(r,e=>typeof e=="string"),Cw=(...r)=>le.findLast(r,e=>typeof e=="function"),Lw={noSort:!1,readEntries:!1,method:le.Constants.NONE,fs:null};xp.exports=function(r,e){let t=null,n=Object.assign(Object.create(null),Lw);r&&typeof r=="object"&&(r instanceof Uint8Array||(Object.assign(n,r),r=n.input?n.input:void 0,n.input&&delete n.input),Buffer.isBuffer(r)&&(t=r,n.method=le.Constants.BUFFER,r=void 0)),Object.assign(n,e);let s=new le(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=le.decoder),r&&typeof r=="string")if(s.fs.existsSync(r))n.method=le.Constants.FILE,n.filename=r,t=s.fs.readFileSync(r);else throw le.Errors.INVALID_FILENAME();let i=new kw(t,n),{canonical:o,sanitize:a,zipnamefix:c}=le;function l(p){if(p&&i){var y;if(typeof p=="string"&&(y=i.getEntry(ce.posix.normalize(p))),typeof p=="object"&&typeof p.entryName<"u"&&typeof p.header<"u"&&(y=i.getEntry(p.entryName)),y)return y}return null}function h(p){let{join:y,normalize:u,sep:m}=ce.posix;return y(ce.isAbsolute(p)?"/":".",u(m+p.split("\\").join(m)+m))}function f(p){return p instanceof RegExp?(function(y){return function(u){return y.test(u)}})(p):typeof p!="function"?()=>!0:p}let d=(p,y)=>{let u=y.slice(-1);return u=u===s.sep?s.sep:"",ce.relative(p,y)+u};return{readFile:function(p,y){var u=l(p);return u&&u.getData(y)||null},childCount:function(p){let y=l(p);if(y)return i.getChildCount(y)},readFileAsync:function(p,y){var u=l(p);u?u.getDataAsync(y):y(null,"getEntry failed for:"+p)},readAsText:function(p,y){var u=l(p);if(u){var m=u.getData();if(m&&m.length)return m.toString(y||"utf8")}return""},readAsTextAsync:function(p,y,u){var m=l(p);m?m.getDataAsync(function(_,v){if(v){y(_,v);return}_&&_.length?y(_.toString(u||"utf8")):y("")}):y("")},deleteFile:function(p,y=!0){var u=l(p);u&&i.deleteFile(u.entryName,y)},deleteEntry:function(p){var y=l(p);y&&i.deleteEntry(y.entryName)},addZipComment:function(p){i.comment=p},getZipComment:function(){return i.comment||""},addZipEntryComment:function(p,y){var u=l(p);u&&(u.comment=y)},getZipEntryComment:function(p){var y=l(p);return y&&y.comment||""},updateFile:function(p,y){var u=l(p);u&&u.setData(y)},addLocalFile:function(p,y,u,m){if(s.fs.existsSync(p)){y=y?h(y):"";let _=ce.win32.basename(ce.win32.normalize(p));y+=u||_;let v=s.fs.statSync(p),g=v.isFile()?s.fs.readFileSync(p):Buffer.alloc(0);v.isDirectory()&&(y+=s.sep),this.addFile(y,g,m,v)}else throw le.Errors.FILE_NOT_FOUND(p)},addLocalFileAsync:function(p,y){p=typeof p=="object"?p:{localPath:p};let u=ce.resolve(p.localPath),{comment:m}=p,{zipPath:_,zipName:v}=p,g=this;s.fs.stat(u,function(b,E){if(b)return y(b,!1);_=_?h(_):"";let $=ce.win32.basename(ce.win32.normalize(u));if(_+=v||$,E.isFile())s.fs.readFile(u,function(S,O){return S?y(S,!1):(g.addFile(_,O,m,E),setImmediate(y,void 0,!0))});else if(E.isDirectory())return _+=s.sep,g.addFile(_,Buffer.alloc(0),m,E),setImmediate(y,void 0,!0)})},addLocalFolder:function(p,y,u){if(u=f(u),y=y?h(y):"",p=ce.normalize(p),s.fs.existsSync(p)){let m=s.findFiles(p),_=this;if(m.length)for(let v of m){let g=ce.join(y,d(p,v));u(g)&&_.addLocalFile(v,ce.dirname(g))}}else throw le.Errors.FILE_NOT_FOUND(p)},addLocalFolderAsync:function(p,y,u,m){m=f(m),u=u?h(u):"",p=ce.normalize(p);var _=this;s.fs.open(p,"r",function(v){if(v&&v.code==="ENOENT")y(void 0,le.Errors.FILE_NOT_FOUND(p));else if(v)y(void 0,v);else{var g=s.findFiles(p),b=-1,E=function(){if(b+=1,b<g.length){var $=g[b],S=d(p,$).split("\\").join("/");S=S.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),m(S)?s.fs.stat($,function(O,A){O&&y(void 0,O),A.isFile()?s.fs.readFile($,function(x,j){x?y(void 0,x):(_.addFile(u+S,j,"",A),E())}):(_.addFile(u+S+"/",Buffer.alloc(0),"",A),E())}):process.nextTick(()=>{E()})}else y(!0,void 0)};E()}})},addLocalFolderAsync2:function(p,y){let u=this;p=typeof p=="object"?p:{localPath:p};let m=ce.resolve(h(p.localPath)),{zipPath:_,filter:v,namefix:g}=p;v instanceof RegExp?v=(function($){return function(S){return $.test(S)}})(v):typeof v!="function"&&(v=function(){return!0}),_=_?h(_):"",g==="latin1"&&(g=$=>$.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof g!="function"&&(g=$=>$);let b=$=>ce.join(_,g(d(m,$))),E=$=>ce.win32.basename(ce.win32.normalize(g($)));s.fs.open(m,"r",function($){$&&$.code==="ENOENT"?y(void 0,le.Errors.FILE_NOT_FOUND(m)):$?y(void 0,$):s.findFilesAsync(m,function(S,O){if(S)return y(S);O=O.filter(A=>v(b(A))),O.length||y(void 0,!1),setImmediate(O.reverse().reduce(function(A,x){return function(j,B){if(j||B===!1)return setImmediate(A,j,!1);u.addLocalFileAsync({localPath:x,zipPath:ce.dirname(b(x)),zipName:E(x)},A)}},y))})})},addLocalFolderPromise:function(p,y){return new Promise((u,m)=>{this.addLocalFolderAsync2(Object.assign({localPath:p},y),(_,v)=>{_&&m(_),v&&u(this)})})},addFile:function(p,y,u,m){p=c(p);let _=l(p),v=_!=null;v||(_=new Pw(n),_.entryName=p),_.comment=u||"";let g=typeof m=="object"&&m instanceof s.fs.Stats;g&&(_.header.time=m.mtime);var b=_.isDirectory?16:0;let E=_.isDirectory?16384:32768;return g?E|=4095&m.mode:typeof m=="number"?E|=4095&m:E|=_.isDirectory?493:420,b=(b|E<<16)>>>0,_.attr=b,_.setData(y),v||i.setEntry(_),_},getEntries:function(p){return i.password=p,i?i.entries:[]},getEntry:function(p){return l(p)},getEntryCount:function(){return i.getEntryCount()},forEach:function(p){return i.forEach(p)},extractEntryTo:function(p,y,u,m,_,v){m=br(!1,m),_=br(!1,_),u=br(!0,u),v=Rp(_,v);var g=l(p);if(!g)throw le.Errors.NO_ENTRY();var b=o(g.entryName),E=a(y,v&&!g.isDirectory?o(v):u?b:ce.basename(b));if(g.isDirectory){var $=i.getEntryChildren(g);return $.forEach(function(A){if(A.isDirectory)return;var x=A.getData();if(!x)throw le.Errors.CANT_EXTRACT_FILE();var j=o(A.entryName),B=a(y,u?j:ce.basename(j));let de=_?A.header.fileAttr:void 0;s.writeFileTo(B,x,m,de)}),!0}var S=g.getData(i.password);if(!S)throw le.Errors.CANT_EXTRACT_FILE();if(s.fs.existsSync(E)&&!m)throw le.Errors.CANT_OVERRIDE();let O=_?p.header.fileAttr:void 0;return s.writeFileTo(E,S,m,O),!0},test:function(p){if(!i)return!1;for(var y of i.entries)try{if(y.isDirectory)continue;var u=i.entries[y].getData(p);if(!u)return!1}catch{return!1}return!0},extractAllTo:function(p,y,u,m){if(u=br(!1,u),m=Rp(u,m),y=br(!1,y),!i)throw le.Errors.NO_ZIP();i.entries.forEach(function(_){var v=a(p,o(_.entryName));if(_.isDirectory){s.makeDir(v);return}var g=_.getData(m);if(!g)throw le.Errors.CANT_EXTRACT_FILE();let b=u?_.header.fileAttr:void 0;s.writeFileTo(v,g,y,b);try{s.fs.utimesSync(v,_.header.time,_.header.time)}catch{throw le.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(p,y,u,m){if(m=Cw(y,u,m),u=br(!1,u),y=br(!1,y),!m)return new Promise((E,$)=>{this.extractAllToAsync(p,y,u,function(S){S?$(S):E(this)})});if(!i){m(le.Errors.NO_ZIP());return}p=ce.resolve(p);let _=E=>a(p,ce.normalize(o(E.entryName))),v=(E,$)=>new Error(E+': "'+$+'"'),g=[],b=[];i.entries.forEach(E=>{E.isDirectory?g.push(E):b.push(E)});for(let E of g){let $=_(E),S=u?E.header.fileAttr:void 0;try{s.makeDir($),S&&s.fs.chmodSync($,S),s.fs.utimesSync($,E.header.time,E.header.time)}catch{m(v("Unable to create folder",$))}}b.reverse().reduce(function(E,$){return function(S){if(S)E(S);else{let O=ce.normalize(o($.entryName)),A=a(p,O);$.getDataAsync(function(x,j){if(j)E(j);else if(!x)E(le.Errors.CANT_EXTRACT_FILE());else{let B=u?$.header.fileAttr:void 0;s.writeFileToAsync(A,x,y,B,function(de){de||E(v("Unable to write file",A)),s.fs.utimes(A,$.header.time,$.header.time,function(Wr){Wr?E(v("Unable to set times",A)):E()})})}})}}},m)()},writeZip:function(p,y){if(arguments.length===1&&typeof p=="function"&&(y=p,p=""),!p&&n.filename&&(p=n.filename),!!p){var u=i.compressToBuffer();if(u){var m=s.writeFileTo(p,u,!0);typeof y=="function"&&y(m?null:new Error("failed"),"")}}},writeZipPromise:function(p,y){let{overwrite:u,perm:m}=Object.assign({overwrite:!0},y);return new Promise((_,v)=>{!p&&n.filename&&(p=n.filename),p||v("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(g=>{let b=E=>E?_(E):v("ADM-ZIP: Wasn't able to write zip file");s.writeFileToAsync(p,g,u,m,b)},v)})},toBufferPromise:function(){return new Promise((p,y)=>{i.toAsyncBuffer(p,y)})},toBuffer:function(p,y,u,m){return typeof p=="function"?(i.toAsyncBuffer(p,y,u,m),null):i.compressToBuffer()}}}});var es=w(Pe=>{"use strict";var Dw=Pe&&Pe.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),qw=Pe&&Pe.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Mw=Pe&&Pe.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&Dw(t,e,n[s]);return qw(t,e),t}})(),jw=Pe&&Pe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.ZipContainer=Pe.DirectoryContainer=void 0;Pe.openContainer=xw;var Rt=V("fs"),Xe=Mw(V("path")),Rw=jw(tc());function Fp(r){return r.replace(/\.evidence$/,"")}var Ci=class{root;kind="directory";constructor(e){this.root=e}get name(){return Fp(Xe.basename(this.root))}async readManifest(){return rc(Xe.join(this.root,"run.yaml"))}async listTestIds(){try{return(await Rt.promises.readdir(Xe.join(this.root,"tests"),{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).sort()}catch{return[]}}async readResult(e){return rc(Xe.join(this.root,"tests",e,"result.yaml"))}async fileExists(e,t){try{return await Rt.promises.access(Xe.join(this.root,"tests",e,t)),!0}catch{return!1}}async readBytes(e,t){try{return await Rt.promises.readFile(Xe.join(this.root,"tests",e,t))}catch{return null}}async exists(e){try{return await Rt.promises.access(Xe.join(this.root,e)),!0}catch{return!1}}async isDir(e){try{return(await Rt.promises.stat(Xe.join(this.root,e))).isDirectory()}catch{return!1}}async listDir(e){try{return(await Rt.promises.readdir(Xe.join(this.root,e),{withFileTypes:!0})).map(n=>({name:n.name,isDir:n.isDirectory()})).sort((n,s)=>n.name.localeCompare(s.name))}catch{return[]}}async readText(e){return rc(Xe.join(this.root,e))}async readFileBytes(e){try{return await Rt.promises.readFile(Xe.join(this.root,e))}catch{return null}}};Pe.DirectoryContainer=Ci;var Li=class{file;kind="zip";zip;constructor(e){this.file=e,this.zip=new Rw.default(e)}get name(){return Fp(Xe.basename(this.file))}readEntry(e){let t=this.zip.getEntry(e);return t?t.getData().toString("utf8"):null}async readManifest(){return this.readEntry("run.yaml")}async listTestIds(){let e=new Set;for(let t of this.zip.getEntries()){let n=t.entryName.match(/^tests\/([^/]+)\//);n&&e.add(n[1])}return[...e].sort()}async readResult(e){return this.readEntry(`tests/${e}/result.yaml`)}async fileExists(e,t){return this.zip.getEntry(`tests/${e}/${t}`)!=null}async readBytes(e,t){let n=this.zip.getEntry(`tests/${e}/${t}`);return n?n.getData():null}hasPrefix(e){let t=e.endsWith("/")?e:`${e}/`;return this.zip.getEntries().some(n=>n.entryName.startsWith(t))}async exists(e){return this.zip.getEntry(e)!=null||this.hasPrefix(e)}async isDir(e){return this.hasPrefix(e)}async listDir(e){let t=e===""?"":e.endsWith("/")?e:`${e}/`,n=new Map;for(let s of this.zip.getEntries()){if(!s.entryName.startsWith(t))continue;let i=s.entryName.slice(t.length);if(i==="")continue;let o=i.indexOf("/");o===-1?n.has(i)||n.set(i,!1):n.set(i.slice(0,o),!0)}return[...n.entries()].map(([s,i])=>({name:s,isDir:i})).sort((s,i)=>s.name.localeCompare(i.name))}async readText(e){let t=this.zip.getEntry(e);return t?t.getData().toString("utf8"):null}async readFileBytes(e){let t=this.zip.getEntry(e);return t?t.getData():null}};Pe.ZipContainer=Li;async function xw(r){return(await Rt.promises.stat(r)).isDirectory()?new Ci(r):new Li(r)}async function rc(r){try{return await Rt.promises.readFile(r,"utf8")}catch{return null}}});var ns=w(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.regexpCode=G.getEsmExportName=G.getProperty=G.safeStringify=G.stringify=G.strConcat=G.addCodeArg=G.str=G._=G.nil=G._Code=G.Name=G.IDENTIFIER=G._CodeOrName=void 0;var ts=class{};G._CodeOrName=ts;G.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var wr=class extends ts{constructor(e){if(super(),!G.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};G.Name=wr;var Qe=class extends ts{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>(n instanceof wr&&(t[n.str]=(t[n.str]||0)+1),t),{})}};G._Code=Qe;G.nil=new Qe("");function Up(r,...e){let t=[r[0]],n=0;for(;n<e.length;)sc(t,e[n]),t.push(r[++n]);return new Qe(t)}G._=Up;var nc=new Qe("+");function Bp(r,...e){let t=[rs(r[0])],n=0;for(;n<e.length;)t.push(nc),sc(t,e[n]),t.push(nc,rs(r[++n]));return Fw(t),new Qe(t)}G.str=Bp;function sc(r,e){e instanceof Qe?r.push(...e._items):e instanceof wr?r.push(e):r.push(Vw(e))}G.addCodeArg=sc;function Fw(r){let e=1;for(;e<r.length-1;){if(r[e]===nc){let t=Uw(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function Uw(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof wr||r[r.length-1]!=='"'?void 0:typeof e!="string"?`${r.slice(0,-1)}${e}"`:e[0]==='"'?r.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(r instanceof wr))return`"${r}${e.slice(1)}`}function Bw(r,e){return e.emptyStr()?r:r.emptyStr()?e:Bp`${r}${e}`}G.strConcat=Bw;function Vw(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:rs(Array.isArray(r)?r.join(","):r)}function zw(r){return new Qe(rs(r))}G.stringify=zw;function rs(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}G.safeStringify=rs;function Kw(r){return typeof r=="string"&&G.IDENTIFIER.test(r)?new Qe(`.${r}`):Up`[${r}]`}G.getProperty=Kw;function Hw(r){if(typeof r=="string"&&G.IDENTIFIER.test(r))return new Qe(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}G.getEsmExportName=Hw;function Gw(r){return new Qe(r.toString())}G.regexpCode=Gw});var ac=w(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.ValueScope=Re.ValueScopeName=Re.Scope=Re.varKinds=Re.UsedValueState=void 0;var je=ns(),ic=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Di;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(Di||(Re.UsedValueState=Di={}));Re.varKinds={const:new je.Name("const"),let:new je.Name("let"),var:new je.Name("var")};var qi=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof je.Name?e:this.name(e)}name(e){return new je.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Re.Scope=qi;var Mi=class extends je.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=(0,je._)`.${new je.Name(t)}[${n}]`}};Re.ValueScopeName=Mi;var Yw=(0,je._)`\n`,oc=class extends qi{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Yw:je.nil}}get(){return this._scope}name(e){return new Mi(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let s=this.toName(e),{prefix:i}=s,o=(n=t.key)!==null&&n!==void 0?n:t.ref,a=this._values[i];if(a){let h=a.get(o);if(h)return h}else a=this._values[i]=new Map;a.set(o,s);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=t.ref,s.setValue(t,{property:i,itemIndex:l}),s}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,je._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,s=>{if(s.value===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return s.value.code},t,n)}_reduceValues(e,t,n={},s){let i=je.nil;for(let o in e){let a=e[o];if(!a)continue;let c=n[o]=n[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,Di.Started);let h=t(l);if(h){let f=this.opts.es5?Re.varKinds.var:Re.varKinds.const;i=(0,je._)`${i}${f} ${l} = ${h};${this.opts._n}`}else if(h=s?.(l))i=(0,je._)`${i}${h}${this.opts._n}`;else throw new ic(l);c.set(l,Di.Completed)})}return i}};Re.ValueScope=oc});var q=w(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.or=R.and=R.not=R.CodeGen=R.operators=R.varKinds=R.ValueScopeName=R.ValueScope=R.Scope=R.Name=R.regexpCode=R.stringify=R.getProperty=R.nil=R.strConcat=R.str=R._=void 0;var z=ns(),at=ac(),Wt=ns();Object.defineProperty(R,"_",{enumerable:!0,get:function(){return Wt._}});Object.defineProperty(R,"str",{enumerable:!0,get:function(){return Wt.str}});Object.defineProperty(R,"strConcat",{enumerable:!0,get:function(){return Wt.strConcat}});Object.defineProperty(R,"nil",{enumerable:!0,get:function(){return Wt.nil}});Object.defineProperty(R,"getProperty",{enumerable:!0,get:function(){return Wt.getProperty}});Object.defineProperty(R,"stringify",{enumerable:!0,get:function(){return Wt.stringify}});Object.defineProperty(R,"regexpCode",{enumerable:!0,get:function(){return Wt.regexpCode}});Object.defineProperty(R,"Name",{enumerable:!0,get:function(){return Wt.Name}});var Fi=ac();Object.defineProperty(R,"Scope",{enumerable:!0,get:function(){return Fi.Scope}});Object.defineProperty(R,"ValueScope",{enumerable:!0,get:function(){return Fi.ValueScope}});Object.defineProperty(R,"ValueScopeName",{enumerable:!0,get:function(){return Fi.ValueScopeName}});Object.defineProperty(R,"varKinds",{enumerable:!0,get:function(){return Fi.varKinds}});R.operators={GT:new z._Code(">"),GTE:new z._Code(">="),LT:new z._Code("<"),LTE:new z._Code("<="),EQ:new z._Code("==="),NEQ:new z._Code("!=="),NOT:new z._Code("!"),OR:new z._Code("||"),AND:new z._Code("&&"),ADD:new z._Code("+")};var xt=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},cc=class extends xt{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?at.varKinds.var:this.varKind,s=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${s};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=tn(this.rhs,e,t)),this}get names(){return this.rhs instanceof z._CodeOrName?this.rhs.names:{}}},ji=class extends xt{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof z.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=tn(this.rhs,e,t),this}get names(){let e=this.lhs instanceof z.Name?{}:{...this.lhs.names};return xi(e,this.rhs)}},lc=class extends ji{constructor(e,t,n,s){super(e,n,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},uc=class extends xt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},fc=class extends xt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},dc=class extends xt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},pc=class extends xt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=tn(this.code,e,t),this}get names(){return this.code instanceof z._CodeOrName?this.code.names:{}}},ss=class extends xt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,s=n.length;for(;s--;){let i=n[s];i.optimizeNames(e,t)||(Zw(e,i.names),n.splice(s,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Sr(e,t.names),{})}},Ft=class extends ss{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},hc=class extends ss{},en=class extends Ft{};en.kind="else";var Er=class r extends Ft{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new en(n):n}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(Vp(e),t instanceof r?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=tn(this.condition,e,t),this}get names(){let e=super.names;return xi(e,this.condition),this.else&&Sr(e,this.else.names),e}};Er.kind="if";var $r=class extends Ft{};$r.kind="for";var mc=class extends $r{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=tn(this.iteration,e,t),this}get names(){return Sr(super.names,this.iteration.names)}},yc=class extends $r{constructor(e,t,n,s){super(),this.varKind=e,this.name=t,this.from=n,this.to=s}render(e){let t=e.es5?at.varKinds.var:this.varKind,{name:n,from:s,to:i}=this;return`for(${t} ${n}=${s}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){let e=xi(super.names,this.from);return xi(e,this.to)}},Ri=class extends $r{constructor(e,t,n,s){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=tn(this.iterable,e,t),this}get names(){return Sr(super.names,this.iterable.names)}},is=class extends Ft{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};is.kind="func";var os=class extends ss{render(e){return"return "+super.render(e)}};os.kind="return";var gc=class extends Ft{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,s;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(s=this.finally)===null||s===void 0||s.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&Sr(e,this.catch.names),this.finally&&Sr(e,this.finally.names),e}},as=class extends Ft{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};as.kind="catch";var cs=class extends Ft{render(e){return"finally"+super.render(e)}};cs.kind="finally";var _c=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
3
|
+
`:""},this._extScope=e,this._scope=new at.Scope({parent:e}),this._nodes=[new hc]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,s){let i=this._scope.toName(t);return n!==void 0&&s&&(this._constants[i.str]=n),this._leafNode(new cc(e,i,n)),i}const(e,t,n){return this._def(at.varKinds.const,e,t,n)}let(e,t,n){return this._def(at.varKinds.let,e,t,n)}var(e,t,n){return this._def(at.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new ji(e,t,n))}add(e,t){return this._leafNode(new lc(e,R.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==z.nil&&this._leafNode(new pc(e)),this}object(...e){let t=["{"];for(let[n,s]of e)t.length>1&&t.push(","),t.push(n),(n!==s||this.opts.es5)&&(t.push(":"),(0,z.addCodeArg)(t,s));return t.push("}"),new z._Code(t)}if(e,t,n){if(this._blockNode(new Er(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Er(e))}else(){return this._elseNode(new en)}endIf(){return this._endBlockNode(Er,en)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new mc(e),t)}forRange(e,t,n,s,i=this.opts.es5?at.varKinds.var:at.varKinds.let){let o=this._scope.toName(e);return this._for(new yc(i,o,t,n),()=>s(o))}forOf(e,t,n,s=at.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=t instanceof z.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,z._)`${o}.length`,a=>{this.var(i,(0,z._)`${o}[${a}]`),n(i)})}return this._for(new Ri("of",s,i,t),()=>n(i))}forIn(e,t,n,s=this.opts.es5?at.varKinds.var:at.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,z._)`Object.keys(${t})`,n);let i=this._scope.toName(e);return this._for(new Ri("in",s,i,t),()=>n(i))}endFor(){return this._endBlockNode($r)}label(e){return this._leafNode(new uc(e))}break(e){return this._leafNode(new fc(e))}return(e){let t=new os;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(os)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let s=new gc;if(this._blockNode(s),this.code(e),t){let i=this.name("e");this._currNode=s.catch=new as(i),t(i)}return n&&(this._currNode=s.finally=new cs,this.code(n)),this._endBlockNode(as,cs)}throw(e){return this._leafNode(new dc(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=z.nil,n,s){return this._blockNode(new is(e,t,n)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(is)}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,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Er))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};R.CodeGen=_c;function Sr(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function xi(r,e){return e instanceof z._CodeOrName?Sr(r,e.names):r}function tn(r,e,t){if(r instanceof z.Name)return n(r);if(!s(r))return r;return new z._Code(r._items.reduce((i,o)=>(o instanceof z.Name&&(o=n(o)),o instanceof z._Code?i.push(...o._items):i.push(o),i),[]));function n(i){let o=t[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function s(i){return i instanceof z._Code&&i._items.some(o=>o instanceof z.Name&&e[o.str]===1&&t[o.str]!==void 0)}}function Zw(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function Vp(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,z._)`!${vc(r)}`}R.not=Vp;var Jw=zp(R.operators.AND);function Ww(...r){return r.reduce(Jw)}R.and=Ww;var Xw=zp(R.operators.OR);function Qw(...r){return r.reduce(Xw)}R.or=Qw;function zp(r){return(e,t)=>e===z.nil?t:t===z.nil?e:(0,z._)`${vc(e)} ${r} ${vc(t)}`}function vc(r){return r instanceof z.Name?r:(0,z._)`(${r})`}});var U=w(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.checkStrictMode=F.getErrorPath=F.Type=F.useFunc=F.setEvaluated=F.evaluatedPropsToName=F.mergeEvaluated=F.eachItem=F.unescapeJsonPointer=F.escapeJsonPointer=F.escapeFragment=F.unescapeFragment=F.schemaRefOrVal=F.schemaHasRulesButRef=F.schemaHasRules=F.checkUnknownRules=F.alwaysValidSchema=F.toHash=void 0;var Q=q(),eE=ns();function tE(r){let e={};for(let t of r)e[t]=!0;return e}F.toHash=tE;function rE(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Gp(r,e),!Yp(e,r.self.RULES.all))}F.alwaysValidSchema=rE;function Gp(r,e=r.schema){let{opts:t,self:n}=r;if(!t.strictSchema||typeof e=="boolean")return;let s=n.RULES.keywords;for(let i in e)s[i]||Wp(r,`unknown keyword: "${i}"`)}F.checkUnknownRules=Gp;function Yp(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(e[t])return!0;return!1}F.schemaHasRules=Yp;function nE(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(t!=="$ref"&&e.all[t])return!0;return!1}F.schemaHasRulesButRef=nE;function sE({topSchemaRef:r,schemaPath:e},t,n,s){if(!s){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Q._)`${t}`}return(0,Q._)`${r}${e}${(0,Q.getProperty)(n)}`}F.schemaRefOrVal=sE;function iE(r){return Zp(decodeURIComponent(r))}F.unescapeFragment=iE;function oE(r){return encodeURIComponent(wc(r))}F.escapeFragment=oE;function wc(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}F.escapeJsonPointer=wc;function Zp(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}F.unescapeJsonPointer=Zp;function aE(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}F.eachItem=aE;function Kp({mergeNames:r,mergeToName:e,mergeValues:t,resultToName:n}){return(s,i,o,a)=>{let c=o===void 0?i:o instanceof Q.Name?(i instanceof Q.Name?r(s,i,o):e(s,i,o),o):i instanceof Q.Name?(e(s,o,i),i):t(i,o);return a===Q.Name&&!(c instanceof Q.Name)?n(s,c):c}}F.mergeEvaluated={props:Kp({mergeNames:(r,e,t)=>r.if((0,Q._)`${t} !== true && ${e} !== undefined`,()=>{r.if((0,Q._)`${e} === true`,()=>r.assign(t,!0),()=>r.assign(t,(0,Q._)`${t} || {}`).code((0,Q._)`Object.assign(${t}, ${e})`))}),mergeToName:(r,e,t)=>r.if((0,Q._)`${t} !== true`,()=>{e===!0?r.assign(t,!0):(r.assign(t,(0,Q._)`${t} || {}`),Ec(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:Jp}),items:Kp({mergeNames:(r,e,t)=>r.if((0,Q._)`${t} !== true && ${e} !== undefined`,()=>r.assign(t,(0,Q._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(r,e,t)=>r.if((0,Q._)`${t} !== true`,()=>r.assign(t,e===!0?!0:(0,Q._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(r,e)=>r===!0?!0:Math.max(r,e),resultToName:(r,e)=>r.var("items",e)})};function Jp(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,Q._)`{}`);return e!==void 0&&Ec(r,t,e),t}F.evaluatedPropsToName=Jp;function Ec(r,e,t){Object.keys(t).forEach(n=>r.assign((0,Q._)`${e}${(0,Q.getProperty)(n)}`,!0))}F.setEvaluated=Ec;var Hp={};function cE(r,e){return r.scopeValue("func",{ref:e,code:Hp[e.code]||(Hp[e.code]=new eE._Code(e.code))})}F.useFunc=cE;var bc;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(bc||(F.Type=bc={}));function lE(r,e,t){if(r instanceof Q.Name){let n=e===bc.Num;return t?n?(0,Q._)`"[" + ${r} + "]"`:(0,Q._)`"['" + ${r} + "']"`:n?(0,Q._)`"/" + ${r}`:(0,Q._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Q.getProperty)(r).toString():"/"+wc(r)}F.getErrorPath=lE;function Wp(r,e,t=r.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);r.self.logger.warn(e)}}F.checkStrictMode=Wp});var et=w($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});var Te=q(),uE={data:new Te.Name("data"),valCxt:new Te.Name("valCxt"),instancePath:new Te.Name("instancePath"),parentData:new Te.Name("parentData"),parentDataProperty:new Te.Name("parentDataProperty"),rootData:new Te.Name("rootData"),dynamicAnchors:new Te.Name("dynamicAnchors"),vErrors:new Te.Name("vErrors"),errors:new Te.Name("errors"),this:new Te.Name("this"),self:new Te.Name("self"),scope:new Te.Name("scope"),json:new Te.Name("json"),jsonPos:new Te.Name("jsonPos"),jsonLen:new Te.Name("jsonLen"),jsonPart:new Te.Name("jsonPart")};$c.default=uE});var ls=w(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.extendErrors=Oe.resetErrorsCount=Oe.reportExtraError=Oe.reportError=Oe.keyword$DataError=Oe.keywordError=void 0;var K=q(),Ui=U(),ke=et();Oe.keywordError={message:({keyword:r})=>(0,K.str)`must pass "${r}" keyword validation`};Oe.keyword$DataError={message:({keyword:r,schemaType:e})=>e?(0,K.str)`"${r}" keyword must be ${e} ($data)`:(0,K.str)`"${r}" keyword is invalid ($data)`};function fE(r,e=Oe.keywordError,t,n){let{it:s}=r,{gen:i,compositeRule:o,allErrors:a}=s,c=eh(r,e,t);n??(o||a)?Xp(i,c):Qp(s,(0,K._)`[${c}]`)}Oe.reportError=fE;function dE(r,e=Oe.keywordError,t){let{it:n}=r,{gen:s,compositeRule:i,allErrors:o}=n,a=eh(r,e,t);Xp(s,a),i||o||Qp(n,ke.default.vErrors)}Oe.reportExtraError=dE;function pE(r,e){r.assign(ke.default.errors,e),r.if((0,K._)`${ke.default.vErrors} !== null`,()=>r.if(e,()=>r.assign((0,K._)`${ke.default.vErrors}.length`,e),()=>r.assign(ke.default.vErrors,null)))}Oe.resetErrorsCount=pE;function hE({gen:r,keyword:e,schemaValue:t,data:n,errsCount:s,it:i}){if(s===void 0)throw new Error("ajv implementation error");let o=r.name("err");r.forRange("i",s,ke.default.errors,a=>{r.const(o,(0,K._)`${ke.default.vErrors}[${a}]`),r.if((0,K._)`${o}.instancePath === undefined`,()=>r.assign((0,K._)`${o}.instancePath`,(0,K.strConcat)(ke.default.instancePath,i.errorPath))),r.assign((0,K._)`${o}.schemaPath`,(0,K.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(r.assign((0,K._)`${o}.schema`,t),r.assign((0,K._)`${o}.data`,n))})}Oe.extendErrors=hE;function Xp(r,e){let t=r.const("err",e);r.if((0,K._)`${ke.default.vErrors} === null`,()=>r.assign(ke.default.vErrors,(0,K._)`[${t}]`),(0,K._)`${ke.default.vErrors}.push(${t})`),r.code((0,K._)`${ke.default.errors}++`)}function Qp(r,e){let{gen:t,validateName:n,schemaEnv:s}=r;s.$async?t.throw((0,K._)`new ${r.ValidationError}(${e})`):(t.assign((0,K._)`${n}.errors`,e),t.return(!1))}var Tr={keyword:new K.Name("keyword"),schemaPath:new K.Name("schemaPath"),params:new K.Name("params"),propertyName:new K.Name("propertyName"),message:new K.Name("message"),schema:new K.Name("schema"),parentSchema:new K.Name("parentSchema")};function eh(r,e,t){let{createErrors:n}=r.it;return n===!1?(0,K._)`{}`:mE(r,e,t)}function mE(r,e,t={}){let{gen:n,it:s}=r,i=[yE(s,t),gE(r,t)];return _E(r,e,i),n.object(...i)}function yE({errorPath:r},{instancePath:e}){let t=e?(0,K.str)`${r}${(0,Ui.getErrorPath)(e,Ui.Type.Str)}`:r;return[ke.default.instancePath,(0,K.strConcat)(ke.default.instancePath,t)]}function gE({keyword:r,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:n}){let s=n?e:(0,K.str)`${e}/${r}`;return t&&(s=(0,K.str)`${s}${(0,Ui.getErrorPath)(t,Ui.Type.Str)}`),[Tr.schemaPath,s]}function _E(r,{params:e,message:t},n){let{keyword:s,data:i,schemaValue:o,it:a}=r,{opts:c,propertyName:l,topSchemaRef:h,schemaPath:f}=a;n.push([Tr.keyword,s],[Tr.params,typeof e=="function"?e(r):e||(0,K._)`{}`]),c.messages&&n.push([Tr.message,typeof t=="function"?t(r):t]),c.verbose&&n.push([Tr.schema,o],[Tr.parentSchema,(0,K._)`${h}${f}`],[ke.default.data,i]),l&&n.push([Tr.propertyName,l])}});var rh=w(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.boolOrEmptySchema=rn.topBoolOrEmptySchema=void 0;var vE=ls(),bE=q(),wE=et(),EE={message:"boolean schema is false"};function $E(r){let{gen:e,schema:t,validateName:n}=r;t===!1?th(r,!1):typeof t=="object"&&t.$async===!0?e.return(wE.default.data):(e.assign((0,bE._)`${n}.errors`,null),e.return(!0))}rn.topBoolOrEmptySchema=$E;function SE(r,e){let{gen:t,schema:n}=r;n===!1?(t.var(e,!1),th(r)):t.var(e,!0)}rn.boolOrEmptySchema=SE;function th(r,e){let{gen:t,data:n}=r,s={gen:t,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,vE.reportError)(s,EE,void 0,e)}});var Sc=w(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.getRules=nn.isJSONType=void 0;var TE=["string","number","integer","boolean","null","object","array"],OE=new Set(TE);function NE(r){return typeof r=="string"&&OE.has(r)}nn.isJSONType=NE;function IE(){let r={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...r,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},r.number,r.string,r.array,r.object],post:{rules:[]},all:{},keywords:{}}}nn.getRules=IE});var Tc=w(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.shouldUseRule=Xt.shouldUseGroup=Xt.schemaHasRulesForType=void 0;function AE({schema:r,self:e},t){let n=e.RULES.types[t];return n&&n!==!0&&nh(r,n)}Xt.schemaHasRulesForType=AE;function nh(r,e){return e.rules.some(t=>sh(r,t))}Xt.shouldUseGroup=nh;function sh(r,e){var t;return r[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(n=>r[n]!==void 0))}Xt.shouldUseRule=sh});var us=w(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.reportTypeError=Ne.checkDataTypes=Ne.checkDataType=Ne.coerceAndCheckDataType=Ne.getJSONTypes=Ne.getSchemaTypes=Ne.DataType=void 0;var PE=Sc(),kE=Tc(),CE=ls(),M=q(),ih=U(),sn;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(sn||(Ne.DataType=sn={}));function LE(r){let e=oh(r.type);if(e.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&e.push("null")}return e}Ne.getSchemaTypes=LE;function oh(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(PE.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Ne.getJSONTypes=oh;function DE(r,e){let{gen:t,data:n,opts:s}=r,i=qE(e,s.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,kE.schemaHasRulesForType)(r,e[0]));if(o){let a=Nc(e,n,s.strictNumbers,sn.Wrong);t.if(a,()=>{i.length?ME(r,e,i):Ic(r)})}return o}Ne.coerceAndCheckDataType=DE;var ah=new Set(["string","number","integer","boolean","null"]);function qE(r,e){return e?r.filter(t=>ah.has(t)||e==="array"&&t==="array"):[]}function ME(r,e,t){let{gen:n,data:s,opts:i}=r,o=n.let("dataType",(0,M._)`typeof ${s}`),a=n.let("coerced",(0,M._)`undefined`);i.coerceTypes==="array"&&n.if((0,M._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,M._)`${s}[0]`).assign(o,(0,M._)`typeof ${s}`).if(Nc(e,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,M._)`${a} !== undefined`);for(let l of t)(ah.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);n.else(),Ic(r),n.endIf(),n.if((0,M._)`${a} !== undefined`,()=>{n.assign(s,a),jE(r,a)});function c(l){switch(l){case"string":n.elseIf((0,M._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,M._)`"" + ${s}`).elseIf((0,M._)`${s} === null`).assign(a,(0,M._)`""`);return;case"number":n.elseIf((0,M._)`${o} == "boolean" || ${s} === null
|
|
4
4
|
|| (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,M._)`+${s}`);return;case"integer":n.elseIf((0,M._)`${o} === "boolean" || ${s} === null
|
|
5
5
|
|| (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,M._)`+${s}`);return;case"boolean":n.elseIf((0,M._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,M._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,M._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,M._)`${o} === "string" || ${o} === "number"
|
|
6
|
-
|| ${o} === "boolean" || ${s} === null`).assign(a,(0,M._)`[${s}]`)}}}function RE({gen:r,parentData:e,parentDataProperty:t},n){r.if((0,M._)`${e} !== undefined`,()=>r.assign((0,M._)`${e}[${t}]`,n))}function Oc(r,e,t,n=sn.Correct){let s=n===sn.Correct?M.operators.EQ:M.operators.NEQ,i;switch(r){case"null":return(0,M._)`${e} ${s} null`;case"array":i=(0,M._)`Array.isArray(${e})`;break;case"object":i=(0,M._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,M._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,M._)`typeof ${e} ${s} ${r}`}return n===sn.Correct?i:(0,M.not)(i);function o(a=M.nil){return(0,M.and)((0,M._)`typeof ${e} == "number"`,a,t?(0,M._)`isFinite(${e})`:M.nil)}}Ne.checkDataType=Oc;function Nc(r,e,t,n){if(r.length===1)return Oc(r[0],e,t,n);let s,i=(0,oh.toHash)(r);if(i.array&&i.object){let o=(0,M._)`typeof ${e} != "object"`;s=i.null?o:(0,M._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=M.nil;i.number&&delete i.integer;for(let o in i)s=(0,M.and)(s,Oc(o,e,t,n));return s}Ne.checkDataTypes=Nc;var xE={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,M._)`{type: ${r}}`:(0,M._)`{type: ${e}}`};function Ic(r){let e=FE(r);(0,LE.reportError)(e,xE)}Ne.reportTypeError=Ic;function FE(r){let{gen:e,data:t,schema:n}=r,s=(0,oh.schemaRefOrVal)(r,n,"type");return{gen:e,keyword:"type",data:t,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:r}}});var uh=w(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.assignDefaults=void 0;var on=q(),UE=U();function BE(r,e){let{properties:t,items:n}=r.schema;if(e==="object"&&t)for(let s in t)lh(r,s,t[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>lh(r,i,s.default))}Bi.assignDefaults=BE;function lh(r,e,t){let{gen:n,compositeRule:s,data:i,opts:o}=r;if(t===void 0)return;let a=(0,on._)`${i}${(0,on.getProperty)(e)}`;if(s){(0,UE.checkStrictMode)(r,`default is ignored for: ${a}`);return}let c=(0,on._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,on._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,on._)`${a} = ${(0,on.stringify)(t)}`)}});var tt=w(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;var ne=q(),Ac=U(),Qt=et(),VE=U();function zE(r,e){let{gen:t,data:n,it:s}=r;t.if(kc(t,n,e,s.opts.ownProperties),()=>{r.setParams({missingProperty:(0,ne._)`${e}`},!0),r.error()})}X.checkReportMissingProp=zE;function KE({gen:r,data:e,it:{opts:t}},n,s){return(0,ne.or)(...n.map(i=>(0,ne.and)(kc(r,e,i,t.ownProperties),(0,ne._)`${s} = ${i}`)))}X.checkMissingProp=KE;function HE(r,e){r.setParams({missingProperty:e},!0),r.error()}X.reportMissingProp=HE;function fh(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ne._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=fh;function Pc(r,e,t){return(0,ne._)`${fh(r)}.call(${e}, ${t})`}X.isOwnProperty=Pc;function GE(r,e,t,n){let s=(0,ne._)`${e}${(0,ne.getProperty)(t)} !== undefined`;return n?(0,ne._)`${s} && ${Pc(r,e,t)}`:s}X.propertyInData=GE;function kc(r,e,t,n){let s=(0,ne._)`${e}${(0,ne.getProperty)(t)} === undefined`;return n?(0,ne.or)(s,(0,ne.not)(Pc(r,e,t))):s}X.noPropertyInData=kc;function dh(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}X.allSchemaProperties=dh;function YE(r,e){return dh(e).filter(t=>!(0,Ac.alwaysValidSchema)(r,e[t]))}X.schemaProperties=YE;function ZE({schemaCode:r,data:e,it:{gen:t,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,c,l){let h=l?(0,ne._)`${r}, ${e}, ${n}${s}`:e,f=[[Qt.default.instancePath,(0,ne.strConcat)(Qt.default.instancePath,i)],[Qt.default.parentData,o.parentData],[Qt.default.parentDataProperty,o.parentDataProperty],[Qt.default.rootData,Qt.default.rootData]];o.opts.dynamicRef&&f.push([Qt.default.dynamicAnchors,Qt.default.dynamicAnchors]);let d=(0,ne._)`${h}, ${t.object(...f)}`;return c!==ne.nil?(0,ne._)`${a}.call(${c}, ${d})`:(0,ne._)`${a}(${d})`}X.callValidateCode=ZE;var JE=(0,ne._)`new RegExp`;function WE({gen:r,it:{opts:e}},t){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(t,n);return r.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ne._)`${s.code==="new RegExp"?JE:(0,VE.useFunc)(r,s)}(${t}, ${n})`})}X.usePattern=WE;function XE(r){let{gen:e,data:t,keyword:n,it:s}=r,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,ne._)`${t}.length`);e.forRange("i",0,c,l=>{r.subschema({keyword:n,dataProp:l,dataPropType:Ac.Type.Num},i),e.if((0,ne.not)(i),a)})}}X.validateArray=XE;function QE(r){let{gen:e,schema:t,keyword:n,it:s}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(c=>(0,Ac.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((c,l)=>{let h=r.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,ne._)`${o} || ${a}`),r.mergeValidEvaluated(h,a)||e.if((0,ne.not)(o))})),r.result(o,()=>r.reset(),()=>r.error(!0))}X.validateUnion=QE});var mh=w($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.validateKeywordUsage=$t.validSchemaType=$t.funcKeywordCode=$t.macroKeywordCode=void 0;var Ce=q(),Or=et(),e$=tt(),t$=ls();function r$(r,e){let{gen:t,keyword:n,schema:s,parentSchema:i,it:o}=r,a=e.macro.call(o.self,s,i,o),c=hh(t,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=t.name("valid");r.subschema({schema:a,schemaPath:Ce.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),r.pass(l,()=>r.error(!0))}$t.macroKeywordCode=r$;function n$(r,e){var t;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=r;i$(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,h=hh(n,s,l),f=n.let("valid");r.block$data(f,d),r.ok((t=e.valid)!==null&&t!==void 0?t:f);function d(){if(e.errors===!1)u(),e.modifying&&ph(r),m(()=>r.error());else{let _=e.async?p():y();e.modifying&&ph(r),m(()=>s$(r,_))}}function p(){let _=n.let("ruleErrs",null);return n.try(()=>u((0,Ce._)`await `),v=>n.assign(f,!1).if((0,Ce._)`${v} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,Ce._)`${v}.errors`),()=>n.throw(v))),_}function y(){let _=(0,Ce._)`${h}.errors`;return n.assign(_,null),u(Ce.nil),_}function u(_=e.async?(0,Ce._)`await `:Ce.nil){let v=c.opts.passContext?Or.default.this:Or.default.self,g=!("compile"in e&&!a||e.schema===!1);n.assign(f,(0,Ce._)`${_}${(0,e$.callValidateCode)(r,h,v,g)}`,e.modifying)}function m(_){var v;n.if((0,Ce.not)((v=e.valid)!==null&&v!==void 0?v:f),_)}}$t.funcKeywordCode=n$;function ph(r){let{gen:e,data:t,it:n}=r;e.if(n.parentData,()=>e.assign(t,(0,Ce._)`${n.parentData}[${n.parentDataProperty}]`))}function s$(r,e){let{gen:t}=r;t.if((0,Ce._)`Array.isArray(${e})`,()=>{t.assign(Or.default.vErrors,(0,Ce._)`${Or.default.vErrors} === null ? ${e} : ${Or.default.vErrors}.concat(${e})`).assign(Or.default.errors,(0,Ce._)`${Or.default.vErrors}.length`),(0,t$.extendErrors)(r)},()=>r.error())}function i$({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function hh(r,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return r.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,Ce.stringify)(t)})}function o$(r,e,t=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(r):n==="object"?r&&typeof r=="object"&&!Array.isArray(r):typeof r==n||t&&typeof r>"u")}$t.validSchemaType=o$;function a$({schema:r,opts:e,self:t,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(r,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(r[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+t.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(c);else throw new Error(c)}}$t.validateKeywordUsage=a$});var gh=w(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.extendSubschemaMode=er.extendSubschemaData=er.getSubschema=void 0;var St=q(),yh=U();function c$(r,{keyword:e,schemaProp:t,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=r.schema[e];return t===void 0?{schema:a,schemaPath:(0,St._)`${r.schemaPath}${(0,St.getProperty)(e)}`,errSchemaPath:`${r.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,St._)`${r.schemaPath}${(0,St.getProperty)(e)}${(0,St.getProperty)(t)}`,errSchemaPath:`${r.errSchemaPath}/${e}/${(0,yh.escapeFragment)(t)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}er.getSubschema=c$;function l$(r,e,{dataProp:t,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(t!==void 0){let{errorPath:l,dataPathArr:h,opts:f}=e,d=a.let("data",(0,St._)`${e.data}${(0,St.getProperty)(t)}`,!0);c(d),r.errorPath=(0,St.str)`${l}${(0,yh.getErrorPath)(t,n,f.jsPropertySyntax)}`,r.parentDataProperty=(0,St._)`${t}`,r.dataPathArr=[...h,r.parentDataProperty]}if(s!==void 0){let l=s instanceof St.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(r.propertyName=o)}i&&(r.dataTypes=i);function c(l){r.data=l,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,l]}}er.extendSubschemaData=l$;function u$(r,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(r.compositeRule=n),s!==void 0&&(r.createErrors=s),i!==void 0&&(r.allErrors=i),r.jtdDiscriminator=e,r.jtdMetadata=t}er.extendSubschemaMode=u$});var Cc=w((Xj,_h)=>{"use strict";_h.exports=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!r(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!r(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var bh=w((Qj,vh)=>{"use strict";var tr=vh.exports=function(r,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var n=typeof t=="function"?t:t.pre||function(){},s=t.post||function(){};Vi(e,n,s,r,"",r)};tr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};tr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};tr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};tr.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 Vi(r,e,t,n,s,i,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,o,a,c,l);for(var h in n){var f=n[h];if(Array.isArray(f)){if(h in tr.arrayKeywords)for(var d=0;d<f.length;d++)Vi(r,e,t,f[d],s+"/"+h+"/"+d,i,s,h,n,d)}else if(h in tr.propsKeywords){if(f&&typeof f=="object")for(var p in f)Vi(r,e,t,f[p],s+"/"+h+"/"+f$(p),i,s,h,n,p)}else(h in tr.keywords||r.allKeys&&!(h in tr.skipKeywords))&&Vi(r,e,t,f,s+"/"+h,i,s,h,n)}t(n,s,i,o,a,c,l)}}function f$(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var fs=w(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.getSchemaRefs=xe.resolveUrl=xe.normalizeId=xe._getFullPath=xe.getFullPath=xe.inlineRef=void 0;var d$=U(),p$=Cc(),h$=bh(),m$=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function y$(r,e=!0){return typeof r=="boolean"?!0:e===!0?!Lc(r):e?wh(r)<=e:!1}xe.inlineRef=y$;var g$=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Lc(r){for(let e in r){if(g$.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(Lc)||typeof t=="object"&&Lc(t))return!0}return!1}function wh(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!m$.has(t)&&(typeof r[t]=="object"&&(0,d$.eachItem)(r[t],n=>e+=wh(n)),e===1/0))return 1/0}return e}function Eh(r,e="",t){t!==!1&&(e=an(e));let n=r.parse(e);return $h(r,n)}xe.getFullPath=Eh;function $h(r,e){return r.serialize(e).split("#")[0]+"#"}xe._getFullPath=$h;var _$=/#\/?$/;function an(r){return r?r.replace(_$,""):""}xe.normalizeId=an;function v$(r,e,t){return t=an(t),r.resolve(e,t)}xe.resolveUrl=v$;var b$=/^[a-z_][-a-z0-9._]*$/i;function w$(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:n}=this.opts,s=an(r[t]||e),i={"":s},o=Eh(n,s,!1),a={},c=new Set;return h$(r,{allKeys:!0},(f,d,p,y)=>{if(y===void 0)return;let u=o+d,m=i[y];typeof f[t]=="string"&&(m=_.call(this,f[t])),v.call(this,f.$anchor),v.call(this,f.$dynamicAnchor),i[d]=m;function _(g){let b=this.opts.uriResolver.resolve;if(g=an(m?b(m,g):g),c.has(g))throw h(g);c.add(g);let E=this.refs[g];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?l(f,E.schema,g):g!==an(u)&&(g[0]==="#"?(l(f,a[g],g),a[g]=f):this.refs[g]=u),g}function v(g){if(typeof g=="string"){if(!b$.test(g))throw new Error(`invalid anchor "${g}"`);_.call(this,`#${g}`)}}}),a;function l(f,d,p){if(d!==void 0&&!p$(f,d))throw h(p)}function h(f){return new Error(`reference "${f}" resolves to more than one schema`)}}xe.getSchemaRefs=w$});var cn=w(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.getData=rr.KeywordCxt=rr.validateFunctionCode=void 0;var Ih=nh(),Sh=us(),qc=Tc(),zi=us(),E$=uh(),ps=mh(),Dc=gh(),C=q(),D=et(),$$=fs(),Ut=U(),ds=ls();function S$(r){if(kh(r)&&(Ch(r),Ph(r))){N$(r);return}Ah(r,()=>(0,Ih.topBoolOrEmptySchema)(r))}rr.validateFunctionCode=S$;function Ah({gen:r,validateName:e,schema:t,schemaEnv:n,opts:s},i){s.code.es5?r.func(e,(0,C._)`${D.default.data}, ${D.default.valCxt}`,n.$async,()=>{r.code((0,C._)`"use strict"; ${Th(t,s)}`),O$(r,s),r.code(i)}):r.func(e,(0,C._)`${D.default.data}, ${T$(s)}`,n.$async,()=>r.code(Th(t,s)).code(i))}function T$(r){return(0,C._)`{${D.default.instancePath}="", ${D.default.parentData}, ${D.default.parentDataProperty}, ${D.default.rootData}=${D.default.data}${r.dynamicRef?(0,C._)`, ${D.default.dynamicAnchors}={}`:C.nil}}={}`}function O$(r,e){r.if(D.default.valCxt,()=>{r.var(D.default.instancePath,(0,C._)`${D.default.valCxt}.${D.default.instancePath}`),r.var(D.default.parentData,(0,C._)`${D.default.valCxt}.${D.default.parentData}`),r.var(D.default.parentDataProperty,(0,C._)`${D.default.valCxt}.${D.default.parentDataProperty}`),r.var(D.default.rootData,(0,C._)`${D.default.valCxt}.${D.default.rootData}`),e.dynamicRef&&r.var(D.default.dynamicAnchors,(0,C._)`${D.default.valCxt}.${D.default.dynamicAnchors}`)},()=>{r.var(D.default.instancePath,(0,C._)`""`),r.var(D.default.parentData,(0,C._)`undefined`),r.var(D.default.parentDataProperty,(0,C._)`undefined`),r.var(D.default.rootData,D.default.data),e.dynamicRef&&r.var(D.default.dynamicAnchors,(0,C._)`{}`)})}function N$(r){let{schema:e,opts:t,gen:n}=r;Ah(r,()=>{t.$comment&&e.$comment&&Dh(r),C$(r),n.let(D.default.vErrors,null),n.let(D.default.errors,0),t.unevaluated&&I$(r),Lh(r),q$(r)})}function I$(r){let{gen:e,validateName:t}=r;r.evaluated=e.const("evaluated",(0,C._)`${t}.evaluated`),e.if((0,C._)`${r.evaluated}.dynamicProps`,()=>e.assign((0,C._)`${r.evaluated}.props`,(0,C._)`undefined`)),e.if((0,C._)`${r.evaluated}.dynamicItems`,()=>e.assign((0,C._)`${r.evaluated}.items`,(0,C._)`undefined`))}function Th(r,e){let t=typeof r=="object"&&r[e.schemaId];return t&&(e.code.source||e.code.process)?(0,C._)`/*# sourceURL=${t} */`:C.nil}function A$(r,e){if(kh(r)&&(Ch(r),Ph(r))){P$(r,e);return}(0,Ih.boolOrEmptySchema)(r,e)}function Ph({schema:r,self:e}){if(typeof r=="boolean")return!r;for(let t in r)if(e.RULES.all[t])return!0;return!1}function kh(r){return typeof r.schema!="boolean"}function P$(r,e){let{schema:t,gen:n,opts:s}=r;s.$comment&&t.$comment&&Dh(r),L$(r),D$(r);let i=n.const("_errs",D.default.errors);Lh(r,i),n.var(e,(0,C._)`${i} === ${D.default.errors}`)}function Ch(r){(0,Ut.checkUnknownRules)(r),k$(r)}function Lh(r,e){if(r.opts.jtd)return Oh(r,[],!1,e);let t=(0,Sh.getSchemaTypes)(r.schema),n=(0,Sh.coerceAndCheckDataType)(r,t);Oh(r,t,!n,e)}function k$(r){let{schema:e,errSchemaPath:t,opts:n,self:s}=r;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ut.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function C$(r){let{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,Ut.checkStrictMode)(r,"default is ignored in the schema root")}function L$(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,$$.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function D$(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function Dh({gen:r,schemaEnv:e,schema:t,errSchemaPath:n,opts:s}){let i=t.$comment;if(s.$comment===!0)r.code((0,C._)`${D.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,C.str)`${n}/$comment`,a=r.scopeValue("root",{ref:e.root});r.code((0,C._)`${D.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function q$(r){let{gen:e,schemaEnv:t,validateName:n,ValidationError:s,opts:i}=r;t.$async?e.if((0,C._)`${D.default.errors} === 0`,()=>e.return(D.default.data),()=>e.throw((0,C._)`new ${s}(${D.default.vErrors})`)):(e.assign((0,C._)`${n}.errors`,D.default.vErrors),i.unevaluated&&M$(r),e.return((0,C._)`${D.default.errors} === 0`))}function M$({gen:r,evaluated:e,props:t,items:n}){t instanceof C.Name&&r.assign((0,C._)`${e}.props`,t),n instanceof C.Name&&r.assign((0,C._)`${e}.items`,n)}function Oh(r,e,t,n){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=r,{RULES:h}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Ut.schemaHasRulesButRef)(i,h))){s.block(()=>Mh(r,"$ref",h.all.$ref.definition));return}c.jtd||j$(r,e),s.block(()=>{for(let d of h.rules)f(d);f(h.post)});function f(d){(0,qc.shouldUseGroup)(i,d)&&(d.type?(s.if((0,zi.checkDataType)(d.type,o,c.strictNumbers)),Nh(r,d),e.length===1&&e[0]===d.type&&t&&(s.else(),(0,zi.reportTypeError)(r)),s.endIf()):Nh(r,d),a||s.if((0,C._)`${D.default.errors} === ${n||0}`))}}function Nh(r,e){let{gen:t,schema:n,opts:{useDefaults:s}}=r;s&&(0,E$.assignDefaults)(r,e.type),t.block(()=>{for(let i of e.rules)(0,qc.shouldUseRule)(n,i)&&Mh(r,i.keyword,i.definition,e.type)})}function j$(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(R$(r,e),r.opts.allowUnionTypes||x$(r,e),F$(r,r.dataTypes))}function R$(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{qh(r.dataTypes,t)||Mc(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),B$(r,e)}}function x$(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Mc(r,"use allowUnionTypes to allow union type keyword")}function F$(r,e){let t=r.self.RULES.all;for(let n in t){let s=t[n];if(typeof s=="object"&&(0,qc.shouldUseRule)(r.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>U$(e,o))&&Mc(r,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function U$(r,e){return r.includes(e)||e==="number"&&r.includes("integer")}function qh(r,e){return r.includes(e)||e==="integer"&&r.includes("number")}function B$(r,e){let t=[];for(let n of r.dataTypes)qh(e,n)?t.push(n):e.includes("integer")&&n==="number"&&t.push("integer");r.dataTypes=t}function Mc(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,Ut.checkStrictMode)(r,e,r.opts.strictTypes)}var Ki=class{constructor(e,t,n){if((0,ps.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ut.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",jh(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ps.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",D.default.errors))}result(e,t,n){this.failResult((0,C.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,C.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,C._)`${t} !== undefined && (${(0,C.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?ds.reportExtraError:ds.reportError)(this,this.def.error,t)}$dataError(){(0,ds.reportError)(this,this.def.$dataError||ds.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ds.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=C.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=C.nil,t=C.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,C.or)((0,C._)`${s} === undefined`,t)),e!==C.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==C.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:s,it:i}=this;return(0,C.or)(o(),a());function o(){if(n.length){if(!(t instanceof C.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,C._)`${(0,zi.checkDataTypes)(c,t,i.opts.strictNumbers,zi.DataType.Wrong)}`}return C.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,C._)`!${c}(${t})`}return C.nil}}subschema(e,t){let n=(0,Dc.getSubschema)(this.it,e);(0,Dc.extendSubschemaData)(n,this.it,e),(0,Dc.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return A$(s,t),s}mergeEvaluated(e,t){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ut.mergeEvaluated.props(s,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=Ut.mergeEvaluated.items(s,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(t,()=>this.mergeEvaluated(e,C.Name)),!0}};rr.KeywordCxt=Ki;function Mh(r,e,t,n){let s=new Ki(r,t,e);"code"in t?t.code(s,n):s.$data&&t.validate?(0,ps.funcKeywordCode)(s,t):"macro"in t?(0,ps.macroKeywordCode)(s,t):(t.compile||t.validate)&&(0,ps.funcKeywordCode)(s,t)}var V$=/^\/(?:[^~]|~0|~1)*$/,z$=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function jh(r,{dataLevel:e,dataNames:t,dataPathArr:n}){let s,i;if(r==="")return D.default.rootData;if(r[0]==="/"){if(!V$.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);s=r,i=D.default.rootData}else{let l=z$.exec(r);if(!l)throw new Error(`Invalid JSON-pointer: ${r}`);let h=+l[1];if(s=l[2],s==="#"){if(h>=e)throw new Error(c("property/index",h));return n[e-h]}if(h>e)throw new Error(c("data",h));if(i=t[e-h],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,C._)`${i}${(0,C.getProperty)((0,Ut.unescapeJsonPointer)(l))}`,o=(0,C._)`${o} && ${i}`);return o;function c(l,h){return`Cannot access ${l} ${h} levels up, current level is ${e}`}}rr.getData=jh});var hs=w(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});var jc=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Rc.default=jc});var ln=w(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});var xc=fs(),Fc=class extends Error{constructor(e,t,n,s){super(s||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,xc.resolveUrl)(e,t,n),this.missingSchema=(0,xc.normalizeId)((0,xc.getFullPath)(e,this.missingRef))}};Uc.default=Fc});var ms=w(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.resolveSchema=rt.getCompilingSchema=rt.resolveRef=rt.compileSchema=rt.SchemaEnv=void 0;var ct=q(),K$=hs(),Nr=et(),lt=fs(),Rh=U(),H$=cn(),un=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,lt.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};rt.SchemaEnv=un;function Vc(r){let e=xh.call(this,r);if(e)return e;let t=(0,lt.getFullPath)(this.opts.uriResolver,r.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new ct.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;r.$async&&(a=o.scopeValue("Error",{ref:K$.default,code:(0,ct._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");r.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:Nr.default.data,parentData:Nr.default.parentData,parentDataProperty:Nr.default.parentDataProperty,dataNames:[Nr.default.data],dataPathArr:[ct.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:r.schema,code:(0,ct.stringify)(r.schema)}:{ref:r.schema}),validateName:c,ValidationError:a,schema:r.schema,schemaEnv:r,rootId:t,baseId:r.baseId||t,schemaPath:ct.nil,errSchemaPath:r.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ct._)`""`,opts:this.opts,self:this},h;try{this._compilations.add(r),(0,H$.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let f=o.toString();h=`${o.scopeRefs(Nr.default.scope)}return ${f}`,this.opts.code.process&&(h=this.opts.code.process(h,r));let p=new Function(`${Nr.default.self}`,`${Nr.default.scope}`,h)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=r.schema,p.schemaEnv=r,r.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){let{props:y,items:u}=l;p.evaluated={props:y instanceof ct.Name?void 0:y,items:u instanceof ct.Name?void 0:u,dynamicProps:y instanceof ct.Name,dynamicItems:u instanceof ct.Name},p.source&&(p.source.evaluated=(0,ct.stringify)(p.evaluated))}return r.validate=p,r}catch(f){throw delete r.validate,delete r.validateName,h&&this.logger.error("Error compiling schema, function code:",h),f}finally{this._compilations.delete(r)}}rt.compileSchema=Vc;function G$(r,e,t){var n;t=(0,lt.resolveUrl)(this.opts.uriResolver,e,t);let s=r.refs[t];if(s)return s;let i=J$.call(this,r,t);if(i===void 0){let o=(n=r.localRefs)===null||n===void 0?void 0:n[t],{schemaId:a}=this.opts;o&&(i=new un({schema:o,schemaId:a,root:r,baseId:e}))}if(i!==void 0)return r.refs[t]=Y$.call(this,i)}rt.resolveRef=G$;function Y$(r){return(0,lt.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:Vc.call(this,r)}function xh(r){for(let e of this._compilations)if(Z$(e,r))return e}rt.getCompilingSchema=xh;function Z$(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function J$(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||Hi.call(this,r,e)}function Hi(r,e){let t=this.opts.uriResolver.parse(e),n=(0,lt._getFullPath)(this.opts.uriResolver,t),s=(0,lt.getFullPath)(this.opts.uriResolver,r.baseId,void 0);if(Object.keys(r.schema).length>0&&n===s)return Bc.call(this,t,r);let i=(0,lt.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Hi.call(this,r,o);return typeof a?.schema!="object"?void 0:Bc.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||Vc.call(this,o),i===(0,lt.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,lt.resolveUrl)(this.opts.uriResolver,s,l)),new un({schema:a,schemaId:c,root:r,baseId:s})}return Bc.call(this,t,o)}}rt.resolveSchema=Hi;var W$=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Bc(r,{baseId:e,schema:t,root:n}){var s;if(((s=r.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of r.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let c=t[(0,Rh.unescapeFragment)(a)];if(c===void 0)return;t=c;let l=typeof t=="object"&&t[this.opts.schemaId];!W$.has(a)&&l&&(e=(0,lt.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof t!="boolean"&&t.$ref&&!(0,Rh.schemaHasRulesButRef)(t,this.RULES)){let a=(0,lt.resolveUrl)(this.opts.uriResolver,e,t.$ref);i=Hi.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new un({schema:t,schemaId:o,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var Fh=w((iR,X$)=>{X$.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Hc=w((oR,Hh)=>{"use strict";var Q$=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Bh=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),zc=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Vh=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),eS=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Kc(r){let e="",t=0,n=0;for(n=0;n<r.length;n++)if(t=r[n].charCodeAt(0),t!==48){if(!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[n];break}for(n+=1;n<r.length;n++){if(t=r[n].charCodeAt(0),!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[n]}return e}var tS=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Uh(r){return r.length=0,!0}function rS(r,e,t){if(r.length){let n=Kc(r);if(n!=="")e.push(n);else return t.error=!0,!1;r.length=0}return!0}function nS(r){let e=0,t={error:!1,address:"",zone:""},n=[],s=[],i=!1,o=!1,a=rS;for(let c=0;c<r.length;c++){let l=r[c];if(!(l==="["||l==="]"))if(l===":"){if(i===!0&&(o=!0),!a(s,n,t))break;if(++e>7){t.error=!0;break}c>0&&r[c-1]===":"&&(i=!0),n.push(":");continue}else if(l==="%"){if(!a(s,n,t))break;a=Uh}else{s.push(l);continue}}return s.length&&(a===Uh?t.zone=s.join(""):o?n.push(s.join("")):n.push(Kc(s))),t.address=n.join(""),t}function zh(r){if(sS(r,":")<2)return{host:r,isIPV6:!1};let e=nS(r);if(e.error)return{host:r,isIPV6:!1};{let t=e.address,n=e.address;return e.zone&&(t+="%"+e.zone,n+="%25"+e.zone),{host:t,isIPV6:!0,escapedHost:n}}}function sS(r,e){let t=0;for(let n=0;n<r.length;n++)r[n]===e&&t++;return t}function iS(r){let e=r,t=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){t.push("/");break}else{t.push(e);break}}else if(s===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){t.push("/");break}}else if(s===3&&e==="/.."){t.length!==0&&t.pop(),t.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),t.length!==0&&t.pop();continue}}if((n=e.indexOf("/",1))===-1){t.push(e);break}else t.push(e.slice(0,n)),e=e.slice(n)}return t.join("")}var oS={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},aS=/[@/?#:]/g,cS=/[@/?#]/g;function Kh(r,e){let t=e?cS:aS;return t.lastIndex=0,r.replace(t,n=>oS[n])}function lS(r,e=!1){if(r.indexOf("%")===-1)return r;let t="";for(let n=0;n<r.length;n++){if(r[n]==="%"&&n+2<r.length){let s=r.slice(n+1,n+3);if(zc(s)){let i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));e&&Vh(o)?t+=o:t+="%"+i,n+=2;continue}}t+=r[n]}return t}function uS(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let n=r.slice(t+1,t+3);if(zc(n)){let s=n.toUpperCase(),i=String.fromCharCode(parseInt(s,16));i!=="."&&Vh(i)?e+=i:e+="%"+s,t+=2;continue}}eS(r[t])?e+=r[t]:e+=escape(r[t])}return e}function fS(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let n=r.slice(t+1,t+3);if(zc(n)){e+="%"+n.toUpperCase(),t+=2;continue}}e+=escape(r[t])}return e}function dS(r){let e=[];if(r.userinfo!==void 0&&(e.push(r.userinfo),e.push("@")),r.host!==void 0){let t=unescape(r.host);if(!Bh(t)){let n=zh(t);n.isIPV6===!0?t=`[${n.escapedHost}]`:t=Kh(t,!1)}e.push(t)}return(typeof r.port=="number"||typeof r.port=="string")&&(e.push(":"),e.push(String(r.port))),e.length?e.join(""):void 0}Hh.exports={nonSimpleDomain:tS,recomposeAuthority:dS,reescapeHostDelimiters:Kh,normalizePercentEncoding:lS,normalizePathEncoding:uS,escapePreservingEscapes:fS,removeDotSegments:iS,isIPv4:Bh,isUUID:Q$,normalizeIPv6:zh,stringArrayToHexStripped:Kc}});var Wh=w((aR,Jh)=>{"use strict";var{isUUID:pS}=Hc(),hS=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,mS=["http","https","ws","wss","urn","urn:uuid"];function yS(r){return mS.indexOf(r)!==-1}function Gc(r){return r.secure===!0?!0:r.secure===!1?!1:r.scheme?r.scheme.length===3&&(r.scheme[0]==="w"||r.scheme[0]==="W")&&(r.scheme[1]==="s"||r.scheme[1]==="S")&&(r.scheme[2]==="s"||r.scheme[2]==="S"):!1}function Gh(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function Yh(r){let e=String(r.scheme).toLowerCase()==="https";return(r.port===(e?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function gS(r){return r.secure=Gc(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function _S(r){if((r.port===(Gc(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){let[e,t]=r.resourceName.split("?");r.path=e&&e!=="/"?e:void 0,r.query=t,r.resourceName=void 0}return r.fragment=void 0,r}function vS(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(hS);if(t){let n=e.scheme||r.scheme||"urn";r.nid=t[1].toLowerCase(),r.nss=t[2];let s=`${n}:${e.nid||r.nid}`,i=Yc(s);r.path=void 0,i&&(r=i.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r}function bS(r,e){if(r.nid===void 0)throw new Error("URN without nid cannot be serialized");let t=e.scheme||r.scheme||"urn",n=r.nid.toLowerCase(),s=`${t}:${e.nid||n}`,i=Yc(s);i&&(r=i.serialize(r,e));let o=r,a=r.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function wS(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!pS(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function ES(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var Zh={scheme:"http",domainHost:!0,parse:Gh,serialize:Yh},$S={scheme:"https",domainHost:Zh.domainHost,parse:Gh,serialize:Yh},Gi={scheme:"ws",domainHost:!0,parse:gS,serialize:_S},SS={scheme:"wss",domainHost:Gi.domainHost,parse:Gi.parse,serialize:Gi.serialize},TS={scheme:"urn",parse:vS,serialize:bS,skipNormalize:!0},OS={scheme:"urn:uuid",parse:wS,serialize:ES,skipNormalize:!0},Yi={http:Zh,https:$S,ws:Gi,wss:SS,urn:TS,"urn:uuid":OS};Object.setPrototypeOf(Yi,null);function Yc(r){return r&&(Yi[r]||Yi[r.toLowerCase()])||void 0}Jh.exports={wsIsSecure:Gc,SCHEMES:Yi,isValidSchemeName:yS,getSchemeHandler:Yc}});var nm=w((cR,Zi)=>{"use strict";var{normalizeIPv6:NS,removeDotSegments:ys,recomposeAuthority:IS,normalizePercentEncoding:AS,normalizePathEncoding:PS,escapePreservingEscapes:kS,reescapeHostDelimiters:CS,isIPv4:LS,nonSimpleDomain:DS}=Hc(),{SCHEMES:qS,getSchemeHandler:Qh}=Wh();function MS(r,e){return typeof r=="string"?r=US(r,e):typeof r=="object"&&(r=fn(Ir(r,e),e)),r}function jS(r,e,t){let n=t?Object.assign({scheme:"null"},t):{scheme:"null"},s=em(fn(r,n),fn(e,n),n,!0);return n.skipEscape=!0,Ir(s,n)}function em(r,e,t,n){let s={};return n||(r=fn(Ir(r,t),t),e=fn(Ir(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ys(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ys(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=ys(e.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?s.path="/"+e.path:r.path?s.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=ys(s.path)),s.query=e.query):(s.path=r.path,e.query!==void 0?s.query=e.query:s.query=r.query),s.userinfo=r.userinfo,s.host=r.host,s.port=r.port),s.scheme=r.scheme),s.fragment=e.fragment,s}function RS(r,e,t){let n=Xh(r,t),s=Xh(e,t);return n!==void 0&&s!==void 0&&n.toLowerCase()===s.toLowerCase()}function Ir(r,e){let t={host:r.host,scheme:r.scheme,userinfo:r.userinfo,port:r.port,path:r.path,query:r.query,nid:r.nid,nss:r.nss,uuid:r.uuid,fragment:r.fragment,reference:r.reference,resourceName:r.resourceName,secure:r.secure,error:""},n=Object.assign({},e),s=[],i=Qh(n.scheme||t.scheme);i&&i.serialize&&i.serialize(t,n),t.path!==void 0&&(n.skipEscape?t.path=AS(t.path):(t.path=kS(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),n.reference!=="suffix"&&t.scheme&&s.push(t.scheme,":");let o=IS(t);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),t.path&&t.path[0]!=="/"&&s.push("/")),t.path!==void 0){let a=t.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=ys(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),s.push(a)}return t.query!==void 0&&s.push("?",t.query),t.fragment!==void 0&&s.push("#",t.fragment),s.join("")}var xS=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function FS(r,e){if(e[2]!==void 0&&r.path&&r.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof r.port=="number"&&(r.port<0||r.port>65535))return"URI port is malformed."}function tm(r,e){let t=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1,i=!1;t.reference==="suffix"&&(t.scheme?r=t.scheme+":"+r:r="//"+r);let o=r.match(xS);if(o){n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]);let a=FS(n,o);if(a!==void 0&&(n.error=n.error||a,s=!0),n.host)if(LS(n.host)===!1){let h=NS(n.host);n.host=h.host.toLowerCase(),i=h.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");let c=Qh(t.scheme||n.scheme);if(!t.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(t.domainHost||c&&c.domainHost)&&i===!1&&DS(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}if((!c||c&&!c.skipNormalize)&&(r.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=CS(unescape(n.host),i))),n.path&&(n.path=PS(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:s}}function fn(r,e){return tm(r,e).parsed}function US(r,e){return rm(r,e).normalized}function rm(r,e){let{parsed:t,malformedAuthorityOrPort:n}=tm(r,e);return{normalized:n?r:Ir(t,e),malformedAuthorityOrPort:n}}function Xh(r,e){if(typeof r=="string"){let{normalized:t,malformedAuthorityOrPort:n}=rm(r,e);return n?void 0:t}if(typeof r=="object")return Ir(r,e)}var Zc={SCHEMES:qS,normalize:MS,resolve:jS,resolveComponent:em,equal:RS,serialize:Ir,parse:fn};Zi.exports=Zc;Zi.exports.default=Zc;Zi.exports.fastUri=Zc});var im=w(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var sm=nm();sm.code='require("ajv/dist/runtime/uri").default';Jc.default=sm});var Qc=w(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.CodeGen=be.Name=be.nil=be.stringify=be.str=be._=be.KeywordCxt=void 0;var BS=cn();Object.defineProperty(be,"KeywordCxt",{enumerable:!0,get:function(){return BS.KeywordCxt}});var dn=q();Object.defineProperty(be,"_",{enumerable:!0,get:function(){return dn._}});Object.defineProperty(be,"str",{enumerable:!0,get:function(){return dn.str}});Object.defineProperty(be,"stringify",{enumerable:!0,get:function(){return dn.stringify}});Object.defineProperty(be,"nil",{enumerable:!0,get:function(){return dn.nil}});Object.defineProperty(be,"Name",{enumerable:!0,get:function(){return dn.Name}});Object.defineProperty(be,"CodeGen",{enumerable:!0,get:function(){return dn.CodeGen}});var VS=hs(),um=ln(),zS=Sc(),gs=ms(),KS=q(),_s=fs(),Ji=us(),Xc=U(),om=Fh(),HS=im(),fm=(r,e)=>new RegExp(r,e);fm.code="new RegExp";var GS=["removeAdditional","useDefaults","coerceTypes"],YS=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),ZS={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."},JS={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},am=200;function WS(r){var e,t,n,s,i,o,a,c,l,h,f,d,p,y,u,m,_,v,g,b,E,$,S,O,A;let x=r.strict,j=(e=r.code)===null||e===void 0?void 0:e.optimize,B=j===!0||j===void 0?1:j||0,de=(n=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&n!==void 0?n:fm,Wr=(s=r.uriResolver)!==null&&s!==void 0?s:HS.default;return{strictSchema:(o=(i=r.strictSchema)!==null&&i!==void 0?i:x)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=r.strictNumbers)!==null&&a!==void 0?a:x)!==null&&c!==void 0?c:!0,strictTypes:(h=(l=r.strictTypes)!==null&&l!==void 0?l:x)!==null&&h!==void 0?h:"log",strictTuples:(d=(f=r.strictTuples)!==null&&f!==void 0?f:x)!==null&&d!==void 0?d:"log",strictRequired:(y=(p=r.strictRequired)!==null&&p!==void 0?p:x)!==null&&y!==void 0?y:!1,code:r.code?{...r.code,optimize:B,regExp:de}:{optimize:B,regExp:de},loopRequired:(u=r.loopRequired)!==null&&u!==void 0?u:am,loopEnum:(m=r.loopEnum)!==null&&m!==void 0?m:am,meta:(_=r.meta)!==null&&_!==void 0?_:!0,messages:(v=r.messages)!==null&&v!==void 0?v:!0,inlineRefs:(g=r.inlineRefs)!==null&&g!==void 0?g:!0,schemaId:(b=r.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(E=r.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:($=r.validateSchema)!==null&&$!==void 0?$:!0,validateFormats:(S=r.validateFormats)!==null&&S!==void 0?S:!0,unicodeRegExp:(O=r.unicodeRegExp)!==null&&O!==void 0?O:!0,int32range:(A=r.int32range)!==null&&A!==void 0?A:!0,uriResolver:Wr}}var vs=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...WS(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new KS.ValueScope({scope:{},prefixes:YS,es5:t,lines:n}),this.logger=nT(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,zS.getRules)(),cm.call(this,ZS,e,"NOT SUPPORTED"),cm.call(this,JS,e,"DEPRECATED","warn"),this._metaOpts=tT.call(this),e.formats&&QS.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&eT.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),XS.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,s=om;n==="id"&&(s={...om},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(t);return"$async"in n||(this.errors=n.errors),s}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,t);async function s(h,f){await i.call(this,h.$schema);let d=this._addSchema(h,f);return d.validate||o.call(this,d)}async function i(h){h&&!this.getSchema(h)&&await s.call(this,{$ref:h},!0)}async function o(h){try{return this._compileSchemaEnv(h)}catch(f){if(!(f instanceof um.default))throw f;return a.call(this,f),await c.call(this,f.missingSchema),o.call(this,h)}}function a({missingSchema:h,missingRef:f}){if(this.refs[h])throw new Error(`AnySchema ${h} is loaded but ${f} cannot be resolved`)}async function c(h){let f=await l.call(this,h);this.refs[h]||await i.call(this,f.$schema),this.refs[h]||this.addSchema(f,h,t)}async function l(h){let f=this._loading[h];if(f)return f;try{return await(this._loading[h]=n(h))}finally{delete this._loading[h]}}}addSchema(e,t,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return t=(0,_s.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,s,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&t){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let t;for(;typeof(t=lm.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:n}=this.opts,s=new gs.SchemaEnv({schema:{},schemaId:n});if(t=gs.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=lm.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,_s.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e=="string")n=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else if(typeof e=="object"&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(iT.call(this,n,t),!t)return(0,Xc.eachItem)(n,i=>Wc.call(this,i)),this;aT.call(this,t);let s={...t,type:(0,Ji.getJSONTypes)(t.type),schemaType:(0,Ji.getJSONTypes)(t.schemaType)};return(0,Xc.eachItem)(n,s.type.length===0?i=>Wc.call(this,i,s):i=>s.type.forEach(o=>Wc.call(this,i,s,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+t+i)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of t){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,h=o[a];l&&h&&(o[a]=dm(h))}}return e}_removeAllSchemas(e,t){for(let n in e){let s=e[n];(!t||t.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,t,n,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,_s.normalizeId)(o||n);let l=_s.getSchemaRefs.call(this,e,n);return c=new gs.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:n,localRefs:l}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),s&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):gs.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{gs.compileSchema.call(this,e)}finally{this.opts=t}}};vs.ValidationError=VS.default;vs.MissingRefError=um.default;be.default=vs;function cm(r,e,t,n="error"){for(let s in r){let i=s;i in e&&this.logger[n](`${t}: option ${s}. ${r[i]}`)}}function lm(r){return r=(0,_s.normalizeId)(r),this.schemas[r]||this.refs[r]}function XS(){let r=this.opts.schemas;if(r)if(Array.isArray(r))this.addSchema(r);else for(let e in r)this.addSchema(r[e],e)}function QS(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function eT(r){if(Array.isArray(r)){this.addVocabulary(r);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in r){let t=r[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function tT(){let r={...this.opts};for(let e of GS)delete r[e];return r}var rT={log(){},warn(){},error(){}};function nT(r){if(r===!1)return rT;if(r===void 0)return console;if(r.log&&r.warn&&r.error)return r;throw new Error("logger must implement log, warn and error methods")}var sT=/^[a-z_$][a-z0-9_$:-]*$/i;function iT(r,e){let{RULES:t}=this;if((0,Xc.eachItem)(r,n=>{if(t.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!sT.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Wc(r,e,t){var n;let s=e?.post;if(t&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:c})=>c===t);if(o||(o={type:t,rules:[]},i.rules.push(o)),i.keywords[r]=!0,!e)return;let a={keyword:r,definition:{...e,type:(0,Ji.getJSONTypes)(e.type),schemaType:(0,Ji.getJSONTypes)(e.schemaType)}};e.before?oT.call(this,o,a,e.before):o.rules.push(a),i.all[r]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function oT(r,e,t){let n=r.rules.findIndex(s=>s.keyword===t);n>=0?r.rules.splice(n,0,e):(r.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function aT(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=dm(e)),r.validateSchema=this.compile(e,!0))}var cT={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function dm(r){return{anyOf:[r,cT]}}});var pm=w(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});var lT={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};el.default=lT});var Qi=w(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.callRef=Ar.getValidate=void 0;var uT=ln(),hm=tt(),Fe=q(),pn=et(),mm=ms(),Wi=U(),fT={keyword:"$ref",schemaType:"string",code(r){let{gen:e,schema:t,it:n}=r,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=n,{root:l}=i;if((t==="#"||t==="#/")&&s===l.baseId)return f();let h=mm.resolveRef.call(c,l,s,t);if(h===void 0)throw new uT.default(n.opts.uriResolver,s,t);if(h instanceof mm.SchemaEnv)return d(h);return p(h);function f(){if(i===l)return Xi(r,o,i,i.$async);let y=e.scopeValue("root",{ref:l});return Xi(r,(0,Fe._)`${y}.validate`,l,l.$async)}function d(y){let u=ym(r,y);Xi(r,u,y,y.$async)}function p(y){let u=e.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,Fe.stringify)(y)}:{ref:y}),m=e.name("valid"),_=r.subschema({schema:y,dataTypes:[],schemaPath:Fe.nil,topSchemaRef:u,errSchemaPath:t},m);r.mergeEvaluated(_),r.ok(m)}}};function ym(r,e){let{gen:t}=r;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,Fe._)`${t.scopeValue("wrapper",{ref:e})}.validate`}Ar.getValidate=ym;function Xi(r,e,t,n){let{gen:s,it:i}=r,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?pn.default.this:Fe.nil;n?h():f();function h(){if(!a.$async)throw new Error("async schema referenced by sync schema");let y=s.let("valid");s.try(()=>{s.code((0,Fe._)`await ${(0,hm.callValidateCode)(r,e,l)}`),p(e),o||s.assign(y,!0)},u=>{s.if((0,Fe._)`!(${u} instanceof ${i.ValidationError})`,()=>s.throw(u)),d(u),o||s.assign(y,!1)}),r.ok(y)}function f(){r.result((0,hm.callValidateCode)(r,e,l),()=>p(e),()=>d(e))}function d(y){let u=(0,Fe._)`${y}.errors`;s.assign(pn.default.vErrors,(0,Fe._)`${pn.default.vErrors} === null ? ${u} : ${pn.default.vErrors}.concat(${u})`),s.assign(pn.default.errors,(0,Fe._)`${pn.default.vErrors}.length`)}function p(y){var u;if(!i.opts.unevaluated)return;let m=(u=t?.validate)===null||u===void 0?void 0:u.evaluated;if(i.props!==!0)if(m&&!m.dynamicProps)m.props!==void 0&&(i.props=Wi.mergeEvaluated.props(s,m.props,i.props));else{let _=s.var("props",(0,Fe._)`${y}.evaluated.props`);i.props=Wi.mergeEvaluated.props(s,_,i.props,Fe.Name)}if(i.items!==!0)if(m&&!m.dynamicItems)m.items!==void 0&&(i.items=Wi.mergeEvaluated.items(s,m.items,i.items));else{let _=s.var("items",(0,Fe._)`${y}.evaluated.items`);i.items=Wi.mergeEvaluated.items(s,_,i.items,Fe.Name)}}}Ar.callRef=Xi;Ar.default=fT});var rl=w(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});var dT=pm(),pT=Qi(),hT=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",dT.default,pT.default];tl.default=hT});var gm=w(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});var eo=q(),nr=eo.operators,to={maximum:{okStr:"<=",ok:nr.LTE,fail:nr.GT},minimum:{okStr:">=",ok:nr.GTE,fail:nr.LT},exclusiveMaximum:{okStr:"<",ok:nr.LT,fail:nr.GTE},exclusiveMinimum:{okStr:">",ok:nr.GT,fail:nr.LTE}},mT={message:({keyword:r,schemaCode:e})=>(0,eo.str)`must be ${to[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,eo._)`{comparison: ${to[r].okStr}, limit: ${e}}`},yT={keyword:Object.keys(to),type:"number",schemaType:"number",$data:!0,error:mT,code(r){let{keyword:e,data:t,schemaCode:n}=r;r.fail$data((0,eo._)`${t} ${to[e].fail} ${n} || isNaN(${t})`)}};nl.default=yT});var _m=w(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});var bs=q(),gT={message:({schemaCode:r})=>(0,bs.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,bs._)`{multipleOf: ${r}}`},_T={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:gT,code(r){let{gen:e,data:t,schemaCode:n,it:s}=r,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,bs._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,bs._)`${o} !== parseInt(${o})`;r.fail$data((0,bs._)`(${n} === 0 || (${o} = ${t}/${n}, ${a}))`)}};sl.default=_T});var bm=w(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});function vm(r){let e=r.length,t=0,n=0,s;for(;n<e;)t++,s=r.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=r.charCodeAt(n),(s&64512)===56320&&n++);return t}il.default=vm;vm.code='require("ajv/dist/runtime/ucs2length").default'});var wm=w(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});var Pr=q(),vT=U(),bT=bm(),wT={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,Pr.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,Pr._)`{limit: ${r}}`},ET={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:wT,code(r){let{keyword:e,data:t,schemaCode:n,it:s}=r,i=e==="maxLength"?Pr.operators.GT:Pr.operators.LT,o=s.opts.unicode===!1?(0,Pr._)`${t}.length`:(0,Pr._)`${(0,vT.useFunc)(r.gen,bT.default)}(${t})`;r.fail$data((0,Pr._)`${o} ${i} ${n}`)}};ol.default=ET});var Em=w(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});var $T=tt(),ST=U(),hn=q(),TT={message:({schemaCode:r})=>(0,hn.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,hn._)`{pattern: ${r}}`},OT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:TT,code(r){let{gen:e,data:t,$data:n,schema:s,schemaCode:i,it:o}=r,a=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=o.opts.code,l=c.code==="new RegExp"?(0,hn._)`new RegExp`:(0,ST.useFunc)(e,c),h=e.let("valid");e.try(()=>e.assign(h,(0,hn._)`${l}(${i}, ${a}).test(${t})`),()=>e.assign(h,!1)),r.fail$data((0,hn._)`!${h}`)}else{let c=(0,$T.usePattern)(r,s);r.fail$data((0,hn._)`!${c}.test(${t})`)}}};al.default=OT});var $m=w(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});var ws=q(),NT={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,ws.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,ws._)`{limit: ${r}}`},IT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:NT,code(r){let{keyword:e,data:t,schemaCode:n}=r,s=e==="maxProperties"?ws.operators.GT:ws.operators.LT;r.fail$data((0,ws._)`Object.keys(${t}).length ${s} ${n}`)}};cl.default=IT});var Sm=w(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});var Es=tt(),$s=q(),AT=U(),PT={message:({params:{missingProperty:r}})=>(0,$s.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,$s._)`{missingProperty: ${r}}`},kT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:PT,code(r){let{gen:e,schema:t,schemaCode:n,data:s,$data:i,it:o}=r,{opts:a}=o;if(!i&&t.length===0)return;let c=t.length>=a.loopRequired;if(o.allErrors?l():h(),a.strictRequired){let p=r.parentSchema.properties,{definedProperties:y}=r.it;for(let u of t)if(p?.[u]===void 0&&!y.has(u)){let m=o.schemaEnv.baseId+o.errSchemaPath,_=`required property "${u}" is not defined at "${m}" (strictRequired)`;(0,AT.checkStrictMode)(o,_,o.opts.strictRequired)}}function l(){if(c||i)r.block$data($s.nil,f);else for(let p of t)(0,Es.checkReportMissingProp)(r,p)}function h(){let p=e.let("missing");if(c||i){let y=e.let("valid",!0);r.block$data(y,()=>d(p,y)),r.ok(y)}else e.if((0,Es.checkMissingProp)(r,t,p)),(0,Es.reportMissingProp)(r,p),e.else()}function f(){e.forOf("prop",n,p=>{r.setParams({missingProperty:p}),e.if((0,Es.noPropertyInData)(e,s,p,a.ownProperties),()=>r.error())})}function d(p,y){r.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(y,(0,Es.propertyInData)(e,s,p,a.ownProperties)),e.if((0,$s.not)(y),()=>{r.error(),e.break()})},$s.nil)}}};ll.default=kT});var Tm=w(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});var Ss=q(),CT={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,Ss.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,Ss._)`{limit: ${r}}`},LT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:CT,code(r){let{keyword:e,data:t,schemaCode:n}=r,s=e==="maxItems"?Ss.operators.GT:Ss.operators.LT;r.fail$data((0,Ss._)`${t}.length ${s} ${n}`)}};ul.default=LT});var ro=w(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});var Om=Cc();Om.code='require("ajv/dist/runtime/equal").default';fl.default=Om});var Nm=w(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});var dl=us(),we=q(),DT=U(),qT=ro(),MT={message:({params:{i:r,j:e}})=>(0,we.str)`must NOT have duplicate items (items ## ${e} and ${r} are identical)`,params:({params:{i:r,j:e}})=>(0,we._)`{i: ${r}, j: ${e}}`},jT={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:MT,code(r){let{gen:e,data:t,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=r;if(!n&&!s)return;let c=e.let("valid"),l=i.items?(0,dl.getSchemaTypes)(i.items):[];r.block$data(c,h,(0,we._)`${o} === false`),r.ok(c);function h(){let y=e.let("i",(0,we._)`${t}.length`),u=e.let("j");r.setParams({i:y,j:u}),e.assign(c,!0),e.if((0,we._)`${y} > 1`,()=>(f()?d:p)(y,u))}function f(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}function d(y,u){let m=e.name("item"),_=(0,dl.checkDataTypes)(l,m,a.opts.strictNumbers,dl.DataType.Wrong),v=e.const("indices",(0,we._)`{}`);e.for((0,we._)`;${y}--;`,()=>{e.let(m,(0,we._)`${t}[${y}]`),e.if(_,(0,we._)`continue`),l.length>1&&e.if((0,we._)`typeof ${m} == "string"`,(0,we._)`${m} += "_"`),e.if((0,we._)`typeof ${v}[${m}] == "number"`,()=>{e.assign(u,(0,we._)`${v}[${m}]`),r.error(),e.assign(c,!1).break()}).code((0,we._)`${v}[${m}] = ${y}`)})}function p(y,u){let m=(0,DT.useFunc)(e,qT.default),_=e.name("outer");e.label(_).for((0,we._)`;${y}--;`,()=>e.for((0,we._)`${u} = ${y}; ${u}--;`,()=>e.if((0,we._)`${m}(${t}[${y}], ${t}[${u}])`,()=>{r.error(),e.assign(c,!1).break(_)})))}}};pl.default=jT});var Im=w(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});var hl=q(),RT=U(),xT=ro(),FT={message:"must be equal to constant",params:({schemaCode:r})=>(0,hl._)`{allowedValue: ${r}}`},UT={keyword:"const",$data:!0,error:FT,code(r){let{gen:e,data:t,$data:n,schemaCode:s,schema:i}=r;n||i&&typeof i=="object"?r.fail$data((0,hl._)`!${(0,RT.useFunc)(e,xT.default)}(${t}, ${s})`):r.fail((0,hl._)`${i} !== ${t}`)}};ml.default=UT});var Am=w(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});var Ts=q(),BT=U(),VT=ro(),zT={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,Ts._)`{allowedValues: ${r}}`},KT={keyword:"enum",schemaType:"array",$data:!0,error:zT,code(r){let{gen:e,data:t,$data:n,schema:s,schemaCode:i,it:o}=r;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,BT.useFunc)(e,VT.default)),h;if(a||n)h=e.let("valid"),r.block$data(h,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let p=e.const("vSchema",i);h=(0,Ts.or)(...s.map((y,u)=>d(p,u)))}r.pass(h);function f(){e.assign(h,!1),e.forOf("v",i,p=>e.if((0,Ts._)`${l()}(${t}, ${p})`,()=>e.assign(h,!0).break()))}function d(p,y){let u=s[y];return typeof u=="object"&&u!==null?(0,Ts._)`${l()}(${t}, ${p}[${y}])`:(0,Ts._)`${t} === ${u}`}}};yl.default=KT});var _l=w(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});var HT=gm(),GT=_m(),YT=wm(),ZT=Em(),JT=$m(),WT=Sm(),XT=Tm(),QT=Nm(),e1=Im(),t1=Am(),r1=[HT.default,GT.default,YT.default,ZT.default,JT.default,WT.default,XT.default,QT.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},e1.default,t1.default];gl.default=r1});var bl=w(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.validateAdditionalItems=void 0;var kr=q(),vl=U(),n1={message:({params:{len:r}})=>(0,kr.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,kr._)`{limit: ${r}}`},s1={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n1,code(r){let{parentSchema:e,it:t}=r,{items:n}=e;if(!Array.isArray(n)){(0,vl.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}Pm(r,n)}};function Pm(r,e){let{gen:t,schema:n,data:s,keyword:i,it:o}=r;o.items=!0;let a=t.const("len",(0,kr._)`${s}.length`);if(n===!1)r.setParams({len:e.length}),r.pass((0,kr._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,vl.alwaysValidSchema)(o,n)){let l=t.var("valid",(0,kr._)`${a} <= ${e.length}`);t.if((0,kr.not)(l),()=>c(l)),r.ok(l)}function c(l){t.forRange("i",e.length,a,h=>{r.subschema({keyword:i,dataProp:h,dataPropType:vl.Type.Num},l),o.allErrors||t.if((0,kr.not)(l),()=>t.break())})}}Os.validateAdditionalItems=Pm;Os.default=s1});var wl=w(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.validateTuple=void 0;var km=q(),no=U(),i1=tt(),o1={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return Cm(r,"additionalItems",e);t.items=!0,!(0,no.alwaysValidSchema)(t,e)&&r.ok((0,i1.validateArray)(r))}};function Cm(r,e,t=r.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=r;h(s),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=no.mergeEvaluated.items(n,t.length,a.items));let c=n.name("valid"),l=n.const("len",(0,km._)`${i}.length`);t.forEach((f,d)=>{(0,no.alwaysValidSchema)(a,f)||(n.if((0,km._)`${l} > ${d}`,()=>r.subschema({keyword:o,schemaProp:d,dataProp:d},c)),r.ok(c))});function h(f){let{opts:d,errSchemaPath:p}=a,y=t.length,u=y===f.minItems&&(y===f.maxItems||f[e]===!1);if(d.strictTuples&&!u){let m=`"${o}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,no.checkStrictMode)(a,m,d.strictTuples)}}}Ns.validateTuple=Cm;Ns.default=o1});var Lm=w(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});var a1=wl(),c1={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,a1.validateTuple)(r,"items")};El.default=c1});var qm=w($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});var Dm=q(),l1=U(),u1=tt(),f1=bl(),d1={message:({params:{len:r}})=>(0,Dm.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Dm._)`{limit: ${r}}`},p1={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:d1,code(r){let{schema:e,parentSchema:t,it:n}=r,{prefixItems:s}=t;n.items=!0,!(0,l1.alwaysValidSchema)(n,e)&&(s?(0,f1.validateAdditionalItems)(r,s):r.ok((0,u1.validateArray)(r)))}};$l.default=p1});var Mm=w(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});var nt=q(),so=U(),h1={message:({params:{min:r,max:e}})=>e===void 0?(0,nt.str)`must contain at least ${r} valid item(s)`:(0,nt.str)`must contain at least ${r} and no more than ${e} valid item(s)`,params:({params:{min:r,max:e}})=>e===void 0?(0,nt._)`{minContains: ${r}}`:(0,nt._)`{minContains: ${r}, maxContains: ${e}}`},m1={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:h1,code(r){let{gen:e,schema:t,parentSchema:n,data:s,it:i}=r,o,a,{minContains:c,maxContains:l}=n;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let h=e.const("len",(0,nt._)`${s}.length`);if(r.setParams({min:o,max:a}),a===void 0&&o===0){(0,so.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,so.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,so.alwaysValidSchema)(i,t)){let u=(0,nt._)`${h} >= ${o}`;a!==void 0&&(u=(0,nt._)`${u} && ${h} <= ${a}`),r.pass(u);return}i.items=!0;let f=e.name("valid");a===void 0&&o===1?p(f,()=>e.if(f,()=>e.break())):o===0?(e.let(f,!0),a!==void 0&&e.if((0,nt._)`${s}.length > 0`,d)):(e.let(f,!1),d()),r.result(f,()=>r.reset());function d(){let u=e.name("_valid"),m=e.let("count",0);p(u,()=>e.if(u,()=>y(m)))}function p(u,m){e.forRange("i",0,h,_=>{r.subschema({keyword:"contains",dataProp:_,dataPropType:so.Type.Num,compositeRule:!0},u),m()})}function y(u){e.code((0,nt._)`${u}++`),a===void 0?e.if((0,nt._)`${u} >= ${o}`,()=>e.assign(f,!0).break()):(e.if((0,nt._)`${u} > ${a}`,()=>e.assign(f,!1).break()),o===1?e.assign(f,!0):e.if((0,nt._)`${u} >= ${o}`,()=>e.assign(f,!0)))}}};Sl.default=m1});var io=w(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.validateSchemaDeps=Tt.validatePropertyDeps=Tt.error=void 0;var Tl=q(),y1=U(),Is=tt();Tt.error={message:({params:{property:r,depsCount:e,deps:t}})=>{let n=e===1?"property":"properties";return(0,Tl.str)`must have ${n} ${t} when property ${r} is present`},params:({params:{property:r,depsCount:e,deps:t,missingProperty:n}})=>(0,Tl._)`{property: ${r},
|
|
6
|
+
|| ${o} === "boolean" || ${s} === null`).assign(a,(0,M._)`[${s}]`)}}}function jE({gen:r,parentData:e,parentDataProperty:t},n){r.if((0,M._)`${e} !== undefined`,()=>r.assign((0,M._)`${e}[${t}]`,n))}function Oc(r,e,t,n=sn.Correct){let s=n===sn.Correct?M.operators.EQ:M.operators.NEQ,i;switch(r){case"null":return(0,M._)`${e} ${s} null`;case"array":i=(0,M._)`Array.isArray(${e})`;break;case"object":i=(0,M._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":i=o((0,M._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":i=o();break;default:return(0,M._)`typeof ${e} ${s} ${r}`}return n===sn.Correct?i:(0,M.not)(i);function o(a=M.nil){return(0,M.and)((0,M._)`typeof ${e} == "number"`,a,t?(0,M._)`isFinite(${e})`:M.nil)}}Ne.checkDataType=Oc;function Nc(r,e,t,n){if(r.length===1)return Oc(r[0],e,t,n);let s,i=(0,ih.toHash)(r);if(i.array&&i.object){let o=(0,M._)`typeof ${e} != "object"`;s=i.null?o:(0,M._)`!${e} || ${o}`,delete i.null,delete i.array,delete i.object}else s=M.nil;i.number&&delete i.integer;for(let o in i)s=(0,M.and)(s,Oc(o,e,t,n));return s}Ne.checkDataTypes=Nc;var RE={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,M._)`{type: ${r}}`:(0,M._)`{type: ${e}}`};function Ic(r){let e=xE(r);(0,CE.reportError)(e,RE)}Ne.reportTypeError=Ic;function xE(r){let{gen:e,data:t,schema:n}=r,s=(0,ih.schemaRefOrVal)(r,n,"type");return{gen:e,keyword:"type",data:t,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:r}}});var lh=w(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.assignDefaults=void 0;var on=q(),FE=U();function UE(r,e){let{properties:t,items:n}=r.schema;if(e==="object"&&t)for(let s in t)ch(r,s,t[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>ch(r,i,s.default))}Bi.assignDefaults=UE;function ch(r,e,t){let{gen:n,compositeRule:s,data:i,opts:o}=r;if(t===void 0)return;let a=(0,on._)`${i}${(0,on.getProperty)(e)}`;if(s){(0,FE.checkStrictMode)(r,`default is ignored for: ${a}`);return}let c=(0,on._)`${a} === undefined`;o.useDefaults==="empty"&&(c=(0,on._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,on._)`${a} = ${(0,on.stringify)(t)}`)}});var tt=w(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;var ne=q(),Ac=U(),Qt=et(),BE=U();function VE(r,e){let{gen:t,data:n,it:s}=r;t.if(kc(t,n,e,s.opts.ownProperties),()=>{r.setParams({missingProperty:(0,ne._)`${e}`},!0),r.error()})}X.checkReportMissingProp=VE;function zE({gen:r,data:e,it:{opts:t}},n,s){return(0,ne.or)(...n.map(i=>(0,ne.and)(kc(r,e,i,t.ownProperties),(0,ne._)`${s} = ${i}`)))}X.checkMissingProp=zE;function KE(r,e){r.setParams({missingProperty:e},!0),r.error()}X.reportMissingProp=KE;function uh(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ne._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=uh;function Pc(r,e,t){return(0,ne._)`${uh(r)}.call(${e}, ${t})`}X.isOwnProperty=Pc;function HE(r,e,t,n){let s=(0,ne._)`${e}${(0,ne.getProperty)(t)} !== undefined`;return n?(0,ne._)`${s} && ${Pc(r,e,t)}`:s}X.propertyInData=HE;function kc(r,e,t,n){let s=(0,ne._)`${e}${(0,ne.getProperty)(t)} === undefined`;return n?(0,ne.or)(s,(0,ne.not)(Pc(r,e,t))):s}X.noPropertyInData=kc;function fh(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}X.allSchemaProperties=fh;function GE(r,e){return fh(e).filter(t=>!(0,Ac.alwaysValidSchema)(r,e[t]))}X.schemaProperties=GE;function YE({schemaCode:r,data:e,it:{gen:t,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,c,l){let h=l?(0,ne._)`${r}, ${e}, ${n}${s}`:e,f=[[Qt.default.instancePath,(0,ne.strConcat)(Qt.default.instancePath,i)],[Qt.default.parentData,o.parentData],[Qt.default.parentDataProperty,o.parentDataProperty],[Qt.default.rootData,Qt.default.rootData]];o.opts.dynamicRef&&f.push([Qt.default.dynamicAnchors,Qt.default.dynamicAnchors]);let d=(0,ne._)`${h}, ${t.object(...f)}`;return c!==ne.nil?(0,ne._)`${a}.call(${c}, ${d})`:(0,ne._)`${a}(${d})`}X.callValidateCode=YE;var ZE=(0,ne._)`new RegExp`;function JE({gen:r,it:{opts:e}},t){let n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(t,n);return r.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ne._)`${s.code==="new RegExp"?ZE:(0,BE.useFunc)(r,s)}(${t}, ${n})`})}X.usePattern=JE;function WE(r){let{gen:e,data:t,keyword:n,it:s}=r,i=e.name("valid");if(s.allErrors){let a=e.let("valid",!0);return o(()=>e.assign(a,!1)),a}return e.var(i,!0),o(()=>e.break()),i;function o(a){let c=e.const("len",(0,ne._)`${t}.length`);e.forRange("i",0,c,l=>{r.subschema({keyword:n,dataProp:l,dataPropType:Ac.Type.Num},i),e.if((0,ne.not)(i),a)})}}X.validateArray=WE;function XE(r){let{gen:e,schema:t,keyword:n,it:s}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(c=>(0,Ac.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;let o=e.let("valid",!1),a=e.name("_valid");e.block(()=>t.forEach((c,l)=>{let h=r.subschema({keyword:n,schemaProp:l,compositeRule:!0},a);e.assign(o,(0,ne._)`${o} || ${a}`),r.mergeValidEvaluated(h,a)||e.if((0,ne.not)(o))})),r.result(o,()=>r.reset(),()=>r.error(!0))}X.validateUnion=XE});var hh=w($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.validateKeywordUsage=$t.validSchemaType=$t.funcKeywordCode=$t.macroKeywordCode=void 0;var Ce=q(),Or=et(),QE=tt(),e$=ls();function t$(r,e){let{gen:t,keyword:n,schema:s,parentSchema:i,it:o}=r,a=e.macro.call(o.self,s,i,o),c=ph(t,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);let l=t.name("valid");r.subschema({schema:a,schemaPath:Ce.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},l),r.pass(l,()=>r.error(!0))}$t.macroKeywordCode=t$;function r$(r,e){var t;let{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:c}=r;s$(c,e);let l=!a&&e.compile?e.compile.call(c.self,i,o,c):e.validate,h=ph(n,s,l),f=n.let("valid");r.block$data(f,d),r.ok((t=e.valid)!==null&&t!==void 0?t:f);function d(){if(e.errors===!1)u(),e.modifying&&dh(r),m(()=>r.error());else{let _=e.async?p():y();e.modifying&&dh(r),m(()=>n$(r,_))}}function p(){let _=n.let("ruleErrs",null);return n.try(()=>u((0,Ce._)`await `),v=>n.assign(f,!1).if((0,Ce._)`${v} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,Ce._)`${v}.errors`),()=>n.throw(v))),_}function y(){let _=(0,Ce._)`${h}.errors`;return n.assign(_,null),u(Ce.nil),_}function u(_=e.async?(0,Ce._)`await `:Ce.nil){let v=c.opts.passContext?Or.default.this:Or.default.self,g=!("compile"in e&&!a||e.schema===!1);n.assign(f,(0,Ce._)`${_}${(0,QE.callValidateCode)(r,h,v,g)}`,e.modifying)}function m(_){var v;n.if((0,Ce.not)((v=e.valid)!==null&&v!==void 0?v:f),_)}}$t.funcKeywordCode=r$;function dh(r){let{gen:e,data:t,it:n}=r;e.if(n.parentData,()=>e.assign(t,(0,Ce._)`${n.parentData}[${n.parentDataProperty}]`))}function n$(r,e){let{gen:t}=r;t.if((0,Ce._)`Array.isArray(${e})`,()=>{t.assign(Or.default.vErrors,(0,Ce._)`${Or.default.vErrors} === null ? ${e} : ${Or.default.vErrors}.concat(${e})`).assign(Or.default.errors,(0,Ce._)`${Or.default.vErrors}.length`),(0,e$.extendErrors)(r)},()=>r.error())}function s$({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function ph(r,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return r.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,Ce.stringify)(t)})}function i$(r,e,t=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(r):n==="object"?r&&typeof r=="object"&&!Array.isArray(r):typeof r==n||t&&typeof r>"u")}$t.validSchemaType=i$;function o$({schema:r,opts:e,self:t,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");let o=s.dependencies;if(o?.some(a=>!Object.prototype.hasOwnProperty.call(r,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(r[i])){let c=`keyword "${i}" value is invalid at path "${n}": `+t.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(c);else throw new Error(c)}}$t.validateKeywordUsage=o$});var yh=w(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.extendSubschemaMode=er.extendSubschemaData=er.getSubschema=void 0;var St=q(),mh=U();function a$(r,{keyword:e,schemaProp:t,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=r.schema[e];return t===void 0?{schema:a,schemaPath:(0,St._)`${r.schemaPath}${(0,St.getProperty)(e)}`,errSchemaPath:`${r.errSchemaPath}/${e}`}:{schema:a[t],schemaPath:(0,St._)`${r.schemaPath}${(0,St.getProperty)(e)}${(0,St.getProperty)(t)}`,errSchemaPath:`${r.errSchemaPath}/${e}/${(0,mh.escapeFragment)(t)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}er.getSubschema=a$;function c$(r,e,{dataProp:t,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(t!==void 0){let{errorPath:l,dataPathArr:h,opts:f}=e,d=a.let("data",(0,St._)`${e.data}${(0,St.getProperty)(t)}`,!0);c(d),r.errorPath=(0,St.str)`${l}${(0,mh.getErrorPath)(t,n,f.jsPropertySyntax)}`,r.parentDataProperty=(0,St._)`${t}`,r.dataPathArr=[...h,r.parentDataProperty]}if(s!==void 0){let l=s instanceof St.Name?s:a.let("data",s,!0);c(l),o!==void 0&&(r.propertyName=o)}i&&(r.dataTypes=i);function c(l){r.data=l,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,l]}}er.extendSubschemaData=c$;function l$(r,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(r.compositeRule=n),s!==void 0&&(r.createErrors=s),i!==void 0&&(r.allErrors=i),r.jtdDiscriminator=e,r.jtdMetadata=t}er.extendSubschemaMode=l$});var Cc=w((Wj,gh)=>{"use strict";gh.exports=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!r(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!r(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}});var vh=w((Xj,_h)=>{"use strict";var tr=_h.exports=function(r,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var n=typeof t=="function"?t:t.pre||function(){},s=t.post||function(){};Vi(e,n,s,r,"",r)};tr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};tr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};tr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};tr.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 Vi(r,e,t,n,s,i,o,a,c,l){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,o,a,c,l);for(var h in n){var f=n[h];if(Array.isArray(f)){if(h in tr.arrayKeywords)for(var d=0;d<f.length;d++)Vi(r,e,t,f[d],s+"/"+h+"/"+d,i,s,h,n,d)}else if(h in tr.propsKeywords){if(f&&typeof f=="object")for(var p in f)Vi(r,e,t,f[p],s+"/"+h+"/"+u$(p),i,s,h,n,p)}else(h in tr.keywords||r.allKeys&&!(h in tr.skipKeywords))&&Vi(r,e,t,f,s+"/"+h,i,s,h,n)}t(n,s,i,o,a,c,l)}}function u$(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var fs=w(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.getSchemaRefs=xe.resolveUrl=xe.normalizeId=xe._getFullPath=xe.getFullPath=xe.inlineRef=void 0;var f$=U(),d$=Cc(),p$=vh(),h$=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function m$(r,e=!0){return typeof r=="boolean"?!0:e===!0?!Lc(r):e?bh(r)<=e:!1}xe.inlineRef=m$;var y$=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Lc(r){for(let e in r){if(y$.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(Lc)||typeof t=="object"&&Lc(t))return!0}return!1}function bh(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!h$.has(t)&&(typeof r[t]=="object"&&(0,f$.eachItem)(r[t],n=>e+=bh(n)),e===1/0))return 1/0}return e}function wh(r,e="",t){t!==!1&&(e=an(e));let n=r.parse(e);return Eh(r,n)}xe.getFullPath=wh;function Eh(r,e){return r.serialize(e).split("#")[0]+"#"}xe._getFullPath=Eh;var g$=/#\/?$/;function an(r){return r?r.replace(g$,""):""}xe.normalizeId=an;function _$(r,e,t){return t=an(t),r.resolve(e,t)}xe.resolveUrl=_$;var v$=/^[a-z_][-a-z0-9._]*$/i;function b$(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:n}=this.opts,s=an(r[t]||e),i={"":s},o=wh(n,s,!1),a={},c=new Set;return p$(r,{allKeys:!0},(f,d,p,y)=>{if(y===void 0)return;let u=o+d,m=i[y];typeof f[t]=="string"&&(m=_.call(this,f[t])),v.call(this,f.$anchor),v.call(this,f.$dynamicAnchor),i[d]=m;function _(g){let b=this.opts.uriResolver.resolve;if(g=an(m?b(m,g):g),c.has(g))throw h(g);c.add(g);let E=this.refs[g];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?l(f,E.schema,g):g!==an(u)&&(g[0]==="#"?(l(f,a[g],g),a[g]=f):this.refs[g]=u),g}function v(g){if(typeof g=="string"){if(!v$.test(g))throw new Error(`invalid anchor "${g}"`);_.call(this,`#${g}`)}}}),a;function l(f,d,p){if(d!==void 0&&!d$(f,d))throw h(p)}function h(f){return new Error(`reference "${f}" resolves to more than one schema`)}}xe.getSchemaRefs=b$});var cn=w(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.getData=rr.KeywordCxt=rr.validateFunctionCode=void 0;var Nh=rh(),$h=us(),qc=Tc(),zi=us(),w$=lh(),ps=hh(),Dc=yh(),C=q(),D=et(),E$=fs(),Ut=U(),ds=ls();function $$(r){if(Ph(r)&&(kh(r),Ah(r))){O$(r);return}Ih(r,()=>(0,Nh.topBoolOrEmptySchema)(r))}rr.validateFunctionCode=$$;function Ih({gen:r,validateName:e,schema:t,schemaEnv:n,opts:s},i){s.code.es5?r.func(e,(0,C._)`${D.default.data}, ${D.default.valCxt}`,n.$async,()=>{r.code((0,C._)`"use strict"; ${Sh(t,s)}`),T$(r,s),r.code(i)}):r.func(e,(0,C._)`${D.default.data}, ${S$(s)}`,n.$async,()=>r.code(Sh(t,s)).code(i))}function S$(r){return(0,C._)`{${D.default.instancePath}="", ${D.default.parentData}, ${D.default.parentDataProperty}, ${D.default.rootData}=${D.default.data}${r.dynamicRef?(0,C._)`, ${D.default.dynamicAnchors}={}`:C.nil}}={}`}function T$(r,e){r.if(D.default.valCxt,()=>{r.var(D.default.instancePath,(0,C._)`${D.default.valCxt}.${D.default.instancePath}`),r.var(D.default.parentData,(0,C._)`${D.default.valCxt}.${D.default.parentData}`),r.var(D.default.parentDataProperty,(0,C._)`${D.default.valCxt}.${D.default.parentDataProperty}`),r.var(D.default.rootData,(0,C._)`${D.default.valCxt}.${D.default.rootData}`),e.dynamicRef&&r.var(D.default.dynamicAnchors,(0,C._)`${D.default.valCxt}.${D.default.dynamicAnchors}`)},()=>{r.var(D.default.instancePath,(0,C._)`""`),r.var(D.default.parentData,(0,C._)`undefined`),r.var(D.default.parentDataProperty,(0,C._)`undefined`),r.var(D.default.rootData,D.default.data),e.dynamicRef&&r.var(D.default.dynamicAnchors,(0,C._)`{}`)})}function O$(r){let{schema:e,opts:t,gen:n}=r;Ih(r,()=>{t.$comment&&e.$comment&&Lh(r),k$(r),n.let(D.default.vErrors,null),n.let(D.default.errors,0),t.unevaluated&&N$(r),Ch(r),D$(r)})}function N$(r){let{gen:e,validateName:t}=r;r.evaluated=e.const("evaluated",(0,C._)`${t}.evaluated`),e.if((0,C._)`${r.evaluated}.dynamicProps`,()=>e.assign((0,C._)`${r.evaluated}.props`,(0,C._)`undefined`)),e.if((0,C._)`${r.evaluated}.dynamicItems`,()=>e.assign((0,C._)`${r.evaluated}.items`,(0,C._)`undefined`))}function Sh(r,e){let t=typeof r=="object"&&r[e.schemaId];return t&&(e.code.source||e.code.process)?(0,C._)`/*# sourceURL=${t} */`:C.nil}function I$(r,e){if(Ph(r)&&(kh(r),Ah(r))){A$(r,e);return}(0,Nh.boolOrEmptySchema)(r,e)}function Ah({schema:r,self:e}){if(typeof r=="boolean")return!r;for(let t in r)if(e.RULES.all[t])return!0;return!1}function Ph(r){return typeof r.schema!="boolean"}function A$(r,e){let{schema:t,gen:n,opts:s}=r;s.$comment&&t.$comment&&Lh(r),C$(r),L$(r);let i=n.const("_errs",D.default.errors);Ch(r,i),n.var(e,(0,C._)`${i} === ${D.default.errors}`)}function kh(r){(0,Ut.checkUnknownRules)(r),P$(r)}function Ch(r,e){if(r.opts.jtd)return Th(r,[],!1,e);let t=(0,$h.getSchemaTypes)(r.schema),n=(0,$h.coerceAndCheckDataType)(r,t);Th(r,t,!n,e)}function P$(r){let{schema:e,errSchemaPath:t,opts:n,self:s}=r;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ut.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function k$(r){let{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,Ut.checkStrictMode)(r,"default is ignored in the schema root")}function C$(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,E$.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function L$(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function Lh({gen:r,schemaEnv:e,schema:t,errSchemaPath:n,opts:s}){let i=t.$comment;if(s.$comment===!0)r.code((0,C._)`${D.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){let o=(0,C.str)`${n}/$comment`,a=r.scopeValue("root",{ref:e.root});r.code((0,C._)`${D.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function D$(r){let{gen:e,schemaEnv:t,validateName:n,ValidationError:s,opts:i}=r;t.$async?e.if((0,C._)`${D.default.errors} === 0`,()=>e.return(D.default.data),()=>e.throw((0,C._)`new ${s}(${D.default.vErrors})`)):(e.assign((0,C._)`${n}.errors`,D.default.vErrors),i.unevaluated&&q$(r),e.return((0,C._)`${D.default.errors} === 0`))}function q$({gen:r,evaluated:e,props:t,items:n}){t instanceof C.Name&&r.assign((0,C._)`${e}.props`,t),n instanceof C.Name&&r.assign((0,C._)`${e}.items`,n)}function Th(r,e,t,n){let{gen:s,schema:i,data:o,allErrors:a,opts:c,self:l}=r,{RULES:h}=l;if(i.$ref&&(c.ignoreKeywordsWithRef||!(0,Ut.schemaHasRulesButRef)(i,h))){s.block(()=>qh(r,"$ref",h.all.$ref.definition));return}c.jtd||M$(r,e),s.block(()=>{for(let d of h.rules)f(d);f(h.post)});function f(d){(0,qc.shouldUseGroup)(i,d)&&(d.type?(s.if((0,zi.checkDataType)(d.type,o,c.strictNumbers)),Oh(r,d),e.length===1&&e[0]===d.type&&t&&(s.else(),(0,zi.reportTypeError)(r)),s.endIf()):Oh(r,d),a||s.if((0,C._)`${D.default.errors} === ${n||0}`))}}function Oh(r,e){let{gen:t,schema:n,opts:{useDefaults:s}}=r;s&&(0,w$.assignDefaults)(r,e.type),t.block(()=>{for(let i of e.rules)(0,qc.shouldUseRule)(n,i)&&qh(r,i.keyword,i.definition,e.type)})}function M$(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(j$(r,e),r.opts.allowUnionTypes||R$(r,e),x$(r,r.dataTypes))}function j$(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{Dh(r.dataTypes,t)||Mc(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),U$(r,e)}}function R$(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Mc(r,"use allowUnionTypes to allow union type keyword")}function x$(r,e){let t=r.self.RULES.all;for(let n in t){let s=t[n];if(typeof s=="object"&&(0,qc.shouldUseRule)(r.schema,s)){let{type:i}=s.definition;i.length&&!i.some(o=>F$(e,o))&&Mc(r,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function F$(r,e){return r.includes(e)||e==="number"&&r.includes("integer")}function Dh(r,e){return r.includes(e)||e==="integer"&&r.includes("number")}function U$(r,e){let t=[];for(let n of r.dataTypes)Dh(e,n)?t.push(n):e.includes("integer")&&n==="number"&&t.push("integer");r.dataTypes=t}function Mc(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,Ut.checkStrictMode)(r,e,r.opts.strictTypes)}var Ki=class{constructor(e,t,n){if((0,ps.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ut.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",Mh(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ps.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",D.default.errors))}result(e,t,n){this.failResult((0,C.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,C.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,C._)`${t} !== undefined && (${(0,C.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?ds.reportExtraError:ds.reportError)(this,this.def.error,t)}$dataError(){(0,ds.reportError)(this,this.def.$dataError||ds.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ds.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=C.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=C.nil,t=C.nil){if(!this.$data)return;let{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,C.or)((0,C._)`${s} === undefined`,t)),e!==C.nil&&n.assign(e,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==C.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:s,it:i}=this;return(0,C.or)(o(),a());function o(){if(n.length){if(!(t instanceof C.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,C._)`${(0,zi.checkDataTypes)(c,t,i.opts.strictNumbers,zi.DataType.Wrong)}`}return C.nil}function a(){if(s.validateSchema){let c=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,C._)`!${c}(${t})`}return C.nil}}subschema(e,t){let n=(0,Dc.getSubschema)(this.it,e);(0,Dc.extendSubschemaData)(n,this.it,e),(0,Dc.extendSubschemaMode)(n,e);let s={...this.it,...n,items:void 0,props:void 0};return I$(s,t),s}mergeEvaluated(e,t){let{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ut.mergeEvaluated.props(s,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=Ut.mergeEvaluated.items(s,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(t,()=>this.mergeEvaluated(e,C.Name)),!0}};rr.KeywordCxt=Ki;function qh(r,e,t,n){let s=new Ki(r,t,e);"code"in t?t.code(s,n):s.$data&&t.validate?(0,ps.funcKeywordCode)(s,t):"macro"in t?(0,ps.macroKeywordCode)(s,t):(t.compile||t.validate)&&(0,ps.funcKeywordCode)(s,t)}var B$=/^\/(?:[^~]|~0|~1)*$/,V$=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Mh(r,{dataLevel:e,dataNames:t,dataPathArr:n}){let s,i;if(r==="")return D.default.rootData;if(r[0]==="/"){if(!B$.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);s=r,i=D.default.rootData}else{let l=V$.exec(r);if(!l)throw new Error(`Invalid JSON-pointer: ${r}`);let h=+l[1];if(s=l[2],s==="#"){if(h>=e)throw new Error(c("property/index",h));return n[e-h]}if(h>e)throw new Error(c("data",h));if(i=t[e-h],!s)return i}let o=i,a=s.split("/");for(let l of a)l&&(i=(0,C._)`${i}${(0,C.getProperty)((0,Ut.unescapeJsonPointer)(l))}`,o=(0,C._)`${o} && ${i}`);return o;function c(l,h){return`Cannot access ${l} ${h} levels up, current level is ${e}`}}rr.getData=Mh});var hs=w(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});var jc=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Rc.default=jc});var ln=w(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});var xc=fs(),Fc=class extends Error{constructor(e,t,n,s){super(s||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,xc.resolveUrl)(e,t,n),this.missingSchema=(0,xc.normalizeId)((0,xc.getFullPath)(e,this.missingRef))}};Uc.default=Fc});var ms=w(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.resolveSchema=rt.getCompilingSchema=rt.resolveRef=rt.compileSchema=rt.SchemaEnv=void 0;var ct=q(),z$=hs(),Nr=et(),lt=fs(),jh=U(),K$=cn(),un=class{constructor(e){var t;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,lt.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};rt.SchemaEnv=un;function Vc(r){let e=Rh.call(this,r);if(e)return e;let t=(0,lt.getFullPath)(this.opts.uriResolver,r.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new ct.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i}),a;r.$async&&(a=o.scopeValue("Error",{ref:z$.default,code:(0,ct._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");r.validateName=c;let l={gen:o,allErrors:this.opts.allErrors,data:Nr.default.data,parentData:Nr.default.parentData,parentDataProperty:Nr.default.parentDataProperty,dataNames:[Nr.default.data],dataPathArr:[ct.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:r.schema,code:(0,ct.stringify)(r.schema)}:{ref:r.schema}),validateName:c,ValidationError:a,schema:r.schema,schemaEnv:r,rootId:t,baseId:r.baseId||t,schemaPath:ct.nil,errSchemaPath:r.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ct._)`""`,opts:this.opts,self:this},h;try{this._compilations.add(r),(0,K$.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);let f=o.toString();h=`${o.scopeRefs(Nr.default.scope)}return ${f}`,this.opts.code.process&&(h=this.opts.code.process(h,r));let p=new Function(`${Nr.default.self}`,`${Nr.default.scope}`,h)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=r.schema,p.schemaEnv=r,r.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){let{props:y,items:u}=l;p.evaluated={props:y instanceof ct.Name?void 0:y,items:u instanceof ct.Name?void 0:u,dynamicProps:y instanceof ct.Name,dynamicItems:u instanceof ct.Name},p.source&&(p.source.evaluated=(0,ct.stringify)(p.evaluated))}return r.validate=p,r}catch(f){throw delete r.validate,delete r.validateName,h&&this.logger.error("Error compiling schema, function code:",h),f}finally{this._compilations.delete(r)}}rt.compileSchema=Vc;function H$(r,e,t){var n;t=(0,lt.resolveUrl)(this.opts.uriResolver,e,t);let s=r.refs[t];if(s)return s;let i=Z$.call(this,r,t);if(i===void 0){let o=(n=r.localRefs)===null||n===void 0?void 0:n[t],{schemaId:a}=this.opts;o&&(i=new un({schema:o,schemaId:a,root:r,baseId:e}))}if(i!==void 0)return r.refs[t]=G$.call(this,i)}rt.resolveRef=H$;function G$(r){return(0,lt.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:Vc.call(this,r)}function Rh(r){for(let e of this._compilations)if(Y$(e,r))return e}rt.getCompilingSchema=Rh;function Y$(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function Z$(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||Hi.call(this,r,e)}function Hi(r,e){let t=this.opts.uriResolver.parse(e),n=(0,lt._getFullPath)(this.opts.uriResolver,t),s=(0,lt.getFullPath)(this.opts.uriResolver,r.baseId,void 0);if(Object.keys(r.schema).length>0&&n===s)return Bc.call(this,t,r);let i=(0,lt.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){let a=Hi.call(this,r,o);return typeof a?.schema!="object"?void 0:Bc.call(this,t,a)}if(typeof o?.schema=="object"){if(o.validate||Vc.call(this,o),i===(0,lt.normalizeId)(e)){let{schema:a}=o,{schemaId:c}=this.opts,l=a[c];return l&&(s=(0,lt.resolveUrl)(this.opts.uriResolver,s,l)),new un({schema:a,schemaId:c,root:r,baseId:s})}return Bc.call(this,t,o)}}rt.resolveSchema=Hi;var J$=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Bc(r,{baseId:e,schema:t,root:n}){var s;if(((s=r.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of r.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let c=t[(0,jh.unescapeFragment)(a)];if(c===void 0)return;t=c;let l=typeof t=="object"&&t[this.opts.schemaId];!J$.has(a)&&l&&(e=(0,lt.resolveUrl)(this.opts.uriResolver,e,l))}let i;if(typeof t!="boolean"&&t.$ref&&!(0,jh.schemaHasRulesButRef)(t,this.RULES)){let a=(0,lt.resolveUrl)(this.opts.uriResolver,e,t.$ref);i=Hi.call(this,n,a)}let{schemaId:o}=this.opts;if(i=i||new un({schema:t,schemaId:o,root:n,baseId:e}),i.schema!==i.root.schema)return i}});var xh=w((sR,W$)=>{W$.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Hc=w((iR,Kh)=>{"use strict";var X$=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Uh=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),zc=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Bh=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Q$=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Kc(r){let e="",t=0,n=0;for(n=0;n<r.length;n++)if(t=r[n].charCodeAt(0),t!==48){if(!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[n];break}for(n+=1;n<r.length;n++){if(t=r[n].charCodeAt(0),!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[n]}return e}var eS=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Fh(r){return r.length=0,!0}function tS(r,e,t){if(r.length){let n=Kc(r);if(n!=="")e.push(n);else return t.error=!0,!1;r.length=0}return!0}function rS(r){let e=0,t={error:!1,address:"",zone:""},n=[],s=[],i=!1,o=!1,a=tS;for(let c=0;c<r.length;c++){let l=r[c];if(!(l==="["||l==="]"))if(l===":"){if(i===!0&&(o=!0),!a(s,n,t))break;if(++e>7){t.error=!0;break}c>0&&r[c-1]===":"&&(i=!0),n.push(":");continue}else if(l==="%"){if(!a(s,n,t))break;a=Fh}else{s.push(l);continue}}return s.length&&(a===Fh?t.zone=s.join(""):o?n.push(s.join("")):n.push(Kc(s))),t.address=n.join(""),t}function Vh(r){if(nS(r,":")<2)return{host:r,isIPV6:!1};let e=rS(r);if(e.error)return{host:r,isIPV6:!1};{let t=e.address,n=e.address;return e.zone&&(t+="%"+e.zone,n+="%25"+e.zone),{host:t,isIPV6:!0,escapedHost:n}}}function nS(r,e){let t=0;for(let n=0;n<r.length;n++)r[n]===e&&t++;return t}function sS(r){let e=r,t=[],n=-1,s=0;for(;s=e.length;){if(s===1){if(e===".")break;if(e==="/"){t.push("/");break}else{t.push(e);break}}else if(s===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){t.push("/");break}}else if(s===3&&e==="/.."){t.length!==0&&t.pop(),t.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),t.length!==0&&t.pop();continue}}if((n=e.indexOf("/",1))===-1){t.push(e);break}else t.push(e.slice(0,n)),e=e.slice(n)}return t.join("")}var iS={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},oS=/[@/?#:]/g,aS=/[@/?#]/g;function zh(r,e){let t=e?aS:oS;return t.lastIndex=0,r.replace(t,n=>iS[n])}function cS(r,e=!1){if(r.indexOf("%")===-1)return r;let t="";for(let n=0;n<r.length;n++){if(r[n]==="%"&&n+2<r.length){let s=r.slice(n+1,n+3);if(zc(s)){let i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));e&&Bh(o)?t+=o:t+="%"+i,n+=2;continue}}t+=r[n]}return t}function lS(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let n=r.slice(t+1,t+3);if(zc(n)){let s=n.toUpperCase(),i=String.fromCharCode(parseInt(s,16));i!=="."&&Bh(i)?e+=i:e+="%"+s,t+=2;continue}}Q$(r[t])?e+=r[t]:e+=escape(r[t])}return e}function uS(r){let e="";for(let t=0;t<r.length;t++){if(r[t]==="%"&&t+2<r.length){let n=r.slice(t+1,t+3);if(zc(n)){e+="%"+n.toUpperCase(),t+=2;continue}}e+=escape(r[t])}return e}function fS(r){let e=[];if(r.userinfo!==void 0&&(e.push(r.userinfo),e.push("@")),r.host!==void 0){let t=unescape(r.host);if(!Uh(t)){let n=Vh(t);n.isIPV6===!0?t=`[${n.escapedHost}]`:t=zh(t,!1)}e.push(t)}return(typeof r.port=="number"||typeof r.port=="string")&&(e.push(":"),e.push(String(r.port))),e.length?e.join(""):void 0}Kh.exports={nonSimpleDomain:eS,recomposeAuthority:fS,reescapeHostDelimiters:zh,normalizePercentEncoding:cS,normalizePathEncoding:lS,escapePreservingEscapes:uS,removeDotSegments:sS,isIPv4:Uh,isUUID:X$,normalizeIPv6:Vh,stringArrayToHexStripped:Kc}});var Jh=w((oR,Zh)=>{"use strict";var{isUUID:dS}=Hc(),pS=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,hS=["http","https","ws","wss","urn","urn:uuid"];function mS(r){return hS.indexOf(r)!==-1}function Gc(r){return r.secure===!0?!0:r.secure===!1?!1:r.scheme?r.scheme.length===3&&(r.scheme[0]==="w"||r.scheme[0]==="W")&&(r.scheme[1]==="s"||r.scheme[1]==="S")&&(r.scheme[2]==="s"||r.scheme[2]==="S"):!1}function Hh(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function Gh(r){let e=String(r.scheme).toLowerCase()==="https";return(r.port===(e?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function yS(r){return r.secure=Gc(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function gS(r){if((r.port===(Gc(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){let[e,t]=r.resourceName.split("?");r.path=e&&e!=="/"?e:void 0,r.query=t,r.resourceName=void 0}return r.fragment=void 0,r}function _S(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(pS);if(t){let n=e.scheme||r.scheme||"urn";r.nid=t[1].toLowerCase(),r.nss=t[2];let s=`${n}:${e.nid||r.nid}`,i=Yc(s);r.path=void 0,i&&(r=i.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r}function vS(r,e){if(r.nid===void 0)throw new Error("URN without nid cannot be serialized");let t=e.scheme||r.scheme||"urn",n=r.nid.toLowerCase(),s=`${t}:${e.nid||n}`,i=Yc(s);i&&(r=i.serialize(r,e));let o=r,a=r.nss;return o.path=`${n||e.nid}:${a}`,e.skipEscape=!0,o}function bS(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!dS(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function wS(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var Yh={scheme:"http",domainHost:!0,parse:Hh,serialize:Gh},ES={scheme:"https",domainHost:Yh.domainHost,parse:Hh,serialize:Gh},Gi={scheme:"ws",domainHost:!0,parse:yS,serialize:gS},$S={scheme:"wss",domainHost:Gi.domainHost,parse:Gi.parse,serialize:Gi.serialize},SS={scheme:"urn",parse:_S,serialize:vS,skipNormalize:!0},TS={scheme:"urn:uuid",parse:bS,serialize:wS,skipNormalize:!0},Yi={http:Yh,https:ES,ws:Gi,wss:$S,urn:SS,"urn:uuid":TS};Object.setPrototypeOf(Yi,null);function Yc(r){return r&&(Yi[r]||Yi[r.toLowerCase()])||void 0}Zh.exports={wsIsSecure:Gc,SCHEMES:Yi,isValidSchemeName:mS,getSchemeHandler:Yc}});var rm=w((aR,Zi)=>{"use strict";var{normalizeIPv6:OS,removeDotSegments:ys,recomposeAuthority:NS,normalizePercentEncoding:IS,normalizePathEncoding:AS,escapePreservingEscapes:PS,reescapeHostDelimiters:kS,isIPv4:CS,nonSimpleDomain:LS}=Hc(),{SCHEMES:DS,getSchemeHandler:Xh}=Jh();function qS(r,e){return typeof r=="string"?r=FS(r,e):typeof r=="object"&&(r=fn(Ir(r,e),e)),r}function MS(r,e,t){let n=t?Object.assign({scheme:"null"},t):{scheme:"null"},s=Qh(fn(r,n),fn(e,n),n,!0);return n.skipEscape=!0,Ir(s,n)}function Qh(r,e,t,n){let s={};return n||(r=fn(Ir(r,t),t),e=fn(Ir(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(s.scheme=e.scheme,s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ys(e.path||""),s.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(s.userinfo=e.userinfo,s.host=e.host,s.port=e.port,s.path=ys(e.path||""),s.query=e.query):(e.path?(e.path[0]==="/"?s.path=ys(e.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?s.path="/"+e.path:r.path?s.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+e.path:s.path=e.path,s.path=ys(s.path)),s.query=e.query):(s.path=r.path,e.query!==void 0?s.query=e.query:s.query=r.query),s.userinfo=r.userinfo,s.host=r.host,s.port=r.port),s.scheme=r.scheme),s.fragment=e.fragment,s}function jS(r,e,t){let n=Wh(r,t),s=Wh(e,t);return n!==void 0&&s!==void 0&&n.toLowerCase()===s.toLowerCase()}function Ir(r,e){let t={host:r.host,scheme:r.scheme,userinfo:r.userinfo,port:r.port,path:r.path,query:r.query,nid:r.nid,nss:r.nss,uuid:r.uuid,fragment:r.fragment,reference:r.reference,resourceName:r.resourceName,secure:r.secure,error:""},n=Object.assign({},e),s=[],i=Xh(n.scheme||t.scheme);i&&i.serialize&&i.serialize(t,n),t.path!==void 0&&(n.skipEscape?t.path=IS(t.path):(t.path=PS(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),n.reference!=="suffix"&&t.scheme&&s.push(t.scheme,":");let o=NS(t);if(o!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(o),t.path&&t.path[0]!=="/"&&s.push("/")),t.path!==void 0){let a=t.path;!n.absolutePath&&(!i||!i.absolutePath)&&(a=ys(a)),o===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),s.push(a)}return t.query!==void 0&&s.push("?",t.query),t.fragment!==void 0&&s.push("#",t.fragment),s.join("")}var RS=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function xS(r,e){if(e[2]!==void 0&&r.path&&r.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof r.port=="number"&&(r.port<0||r.port>65535))return"URI port is malformed."}function em(r,e){let t=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1,i=!1;t.reference==="suffix"&&(t.scheme?r=t.scheme+":"+r:r="//"+r);let o=r.match(RS);if(o){n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]);let a=xS(n,o);if(a!==void 0&&(n.error=n.error||a,s=!0),n.host)if(CS(n.host)===!1){let h=OS(n.host);n.host=h.host.toLowerCase(),i=h.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");let c=Xh(t.scheme||n.scheme);if(!t.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(t.domainHost||c&&c.domainHost)&&i===!1&&LS(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(l){n.error=n.error||"Host's domain name can not be converted to ASCII: "+l}if((!c||c&&!c.skipNormalize)&&(r.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=kS(unescape(n.host),i))),n.path&&(n.path=AS(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,t)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:s}}function fn(r,e){return em(r,e).parsed}function FS(r,e){return tm(r,e).normalized}function tm(r,e){let{parsed:t,malformedAuthorityOrPort:n}=em(r,e);return{normalized:n?r:Ir(t,e),malformedAuthorityOrPort:n}}function Wh(r,e){if(typeof r=="string"){let{normalized:t,malformedAuthorityOrPort:n}=tm(r,e);return n?void 0:t}if(typeof r=="object")return Ir(r,e)}var Zc={SCHEMES:DS,normalize:qS,resolve:MS,resolveComponent:Qh,equal:jS,serialize:Ir,parse:fn};Zi.exports=Zc;Zi.exports.default=Zc;Zi.exports.fastUri=Zc});var sm=w(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});var nm=rm();nm.code='require("ajv/dist/runtime/uri").default';Jc.default=nm});var Qc=w(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.CodeGen=be.Name=be.nil=be.stringify=be.str=be._=be.KeywordCxt=void 0;var US=cn();Object.defineProperty(be,"KeywordCxt",{enumerable:!0,get:function(){return US.KeywordCxt}});var dn=q();Object.defineProperty(be,"_",{enumerable:!0,get:function(){return dn._}});Object.defineProperty(be,"str",{enumerable:!0,get:function(){return dn.str}});Object.defineProperty(be,"stringify",{enumerable:!0,get:function(){return dn.stringify}});Object.defineProperty(be,"nil",{enumerable:!0,get:function(){return dn.nil}});Object.defineProperty(be,"Name",{enumerable:!0,get:function(){return dn.Name}});Object.defineProperty(be,"CodeGen",{enumerable:!0,get:function(){return dn.CodeGen}});var BS=hs(),lm=ln(),VS=Sc(),gs=ms(),zS=q(),_s=fs(),Ji=us(),Xc=U(),im=xh(),KS=sm(),um=(r,e)=>new RegExp(r,e);um.code="new RegExp";var HS=["removeAdditional","useDefaults","coerceTypes"],GS=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),YS={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."},ZS={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},om=200;function JS(r){var e,t,n,s,i,o,a,c,l,h,f,d,p,y,u,m,_,v,g,b,E,$,S,O,A;let x=r.strict,j=(e=r.code)===null||e===void 0?void 0:e.optimize,B=j===!0||j===void 0?1:j||0,de=(n=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&n!==void 0?n:um,Wr=(s=r.uriResolver)!==null&&s!==void 0?s:KS.default;return{strictSchema:(o=(i=r.strictSchema)!==null&&i!==void 0?i:x)!==null&&o!==void 0?o:!0,strictNumbers:(c=(a=r.strictNumbers)!==null&&a!==void 0?a:x)!==null&&c!==void 0?c:!0,strictTypes:(h=(l=r.strictTypes)!==null&&l!==void 0?l:x)!==null&&h!==void 0?h:"log",strictTuples:(d=(f=r.strictTuples)!==null&&f!==void 0?f:x)!==null&&d!==void 0?d:"log",strictRequired:(y=(p=r.strictRequired)!==null&&p!==void 0?p:x)!==null&&y!==void 0?y:!1,code:r.code?{...r.code,optimize:B,regExp:de}:{optimize:B,regExp:de},loopRequired:(u=r.loopRequired)!==null&&u!==void 0?u:om,loopEnum:(m=r.loopEnum)!==null&&m!==void 0?m:om,meta:(_=r.meta)!==null&&_!==void 0?_:!0,messages:(v=r.messages)!==null&&v!==void 0?v:!0,inlineRefs:(g=r.inlineRefs)!==null&&g!==void 0?g:!0,schemaId:(b=r.schemaId)!==null&&b!==void 0?b:"$id",addUsedSchema:(E=r.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:($=r.validateSchema)!==null&&$!==void 0?$:!0,validateFormats:(S=r.validateFormats)!==null&&S!==void 0?S:!0,unicodeRegExp:(O=r.unicodeRegExp)!==null&&O!==void 0?O:!0,int32range:(A=r.int32range)!==null&&A!==void 0?A:!0,uriResolver:Wr}}var vs=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...JS(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new zS.ValueScope({scope:{},prefixes:GS,es5:t,lines:n}),this.logger=rT(e.logger);let s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,VS.getRules)(),am.call(this,YS,e,"NOT SUPPORTED"),am.call(this,ZS,e,"DEPRECATED","warn"),this._metaOpts=eT.call(this),e.formats&&XS.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&QS.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),WS.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,s=im;n==="id"&&(s={...im},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let s=n(t);return"$async"in n||(this.errors=n.errors),s}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return s.call(this,e,t);async function s(h,f){await i.call(this,h.$schema);let d=this._addSchema(h,f);return d.validate||o.call(this,d)}async function i(h){h&&!this.getSchema(h)&&await s.call(this,{$ref:h},!0)}async function o(h){try{return this._compileSchemaEnv(h)}catch(f){if(!(f instanceof lm.default))throw f;return a.call(this,f),await c.call(this,f.missingSchema),o.call(this,h)}}function a({missingSchema:h,missingRef:f}){if(this.refs[h])throw new Error(`AnySchema ${h} is loaded but ${f} cannot be resolved`)}async function c(h){let f=await l.call(this,h);this.refs[h]||await i.call(this,f.$schema),this.refs[h]||this.addSchema(f,h,t)}async function l(h){let f=this._loading[h];if(f)return f;try{return await(this._loading[h]=n(h))}finally{delete this._loading[h]}}}addSchema(e,t,n,s=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,s);return this}let i;if(typeof e=="object"){let{schemaId:o}=this.opts;if(i=e[o],i!==void 0&&typeof i!="string")throw new Error(`schema ${o} must be string`)}return t=(0,_s.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,s,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let s=this.validate(n,e);if(!s&&t){let i="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(i);else throw new Error(i)}return s}getSchema(e){let t;for(;typeof(t=cm.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:n}=this.opts,s=new gs.SchemaEnv({schema:{},schemaId:n});if(t=gs.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=cm.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,_s.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e=="string")n=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else if(typeof e=="object"&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(sT.call(this,n,t),!t)return(0,Xc.eachItem)(n,i=>Wc.call(this,i)),this;oT.call(this,t);let s={...t,type:(0,Ji.getJSONTypes)(t.type),schemaType:(0,Ji.getJSONTypes)(t.schemaType)};return(0,Xc.eachItem)(n,s.type.length===0?i=>Wc.call(this,i,s):i=>s.type.forEach(o=>Wc.call(this,i,s,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let s=n.rules.findIndex(i=>i.keyword===e);s>=0&&n.rules.splice(s,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(s=>`${n}${s.instancePath} ${s.message}`).reduce((s,i)=>s+t+i)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let s of t){let i=s.split("/").slice(1),o=e;for(let a of i)o=o[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:l}=c.definition,h=o[a];l&&h&&(o[a]=fm(h))}}return e}_removeAllSchemas(e,t){for(let n in e){let s=e[n];(!t||t.test(n))&&(typeof s=="string"?delete e[n]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[n]))}}_addSchema(e,t,n,s=this.opts.validateSchema,i=this.opts.addUsedSchema){let o,{schemaId:a}=this.opts;if(typeof e=="object")o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,_s.normalizeId)(o||n);let l=_s.getSchemaRefs.call(this,e,n);return c=new gs.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:n,localRefs:l}),this._cache.set(c.schema,c),i&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),s&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):gs.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{gs.compileSchema.call(this,e)}finally{this.opts=t}}};vs.ValidationError=BS.default;vs.MissingRefError=lm.default;be.default=vs;function am(r,e,t,n="error"){for(let s in r){let i=s;i in e&&this.logger[n](`${t}: option ${s}. ${r[i]}`)}}function cm(r){return r=(0,_s.normalizeId)(r),this.schemas[r]||this.refs[r]}function WS(){let r=this.opts.schemas;if(r)if(Array.isArray(r))this.addSchema(r);else for(let e in r)this.addSchema(r[e],e)}function XS(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function QS(r){if(Array.isArray(r)){this.addVocabulary(r);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in r){let t=r[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function eT(){let r={...this.opts};for(let e of HS)delete r[e];return r}var tT={log(){},warn(){},error(){}};function rT(r){if(r===!1)return tT;if(r===void 0)return console;if(r.log&&r.warn&&r.error)return r;throw new Error("logger must implement log, warn and error methods")}var nT=/^[a-z_$][a-z0-9_$:-]*$/i;function sT(r,e){let{RULES:t}=this;if((0,Xc.eachItem)(r,n=>{if(t.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!nT.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Wc(r,e,t){var n;let s=e?.post;if(t&&s)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,o=s?i.post:i.rules.find(({type:c})=>c===t);if(o||(o={type:t,rules:[]},i.rules.push(o)),i.keywords[r]=!0,!e)return;let a={keyword:r,definition:{...e,type:(0,Ji.getJSONTypes)(e.type),schemaType:(0,Ji.getJSONTypes)(e.schemaType)}};e.before?iT.call(this,o,a,e.before):o.rules.push(a),i.all[r]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function iT(r,e,t){let n=r.rules.findIndex(s=>s.keyword===t);n>=0?r.rules.splice(n,0,e):(r.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function oT(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=fm(e)),r.validateSchema=this.compile(e,!0))}var aT={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function fm(r){return{anyOf:[r,aT]}}});var dm=w(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});var cT={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};el.default=cT});var Qi=w(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.callRef=Ar.getValidate=void 0;var lT=ln(),pm=tt(),Fe=q(),pn=et(),hm=ms(),Wi=U(),uT={keyword:"$ref",schemaType:"string",code(r){let{gen:e,schema:t,it:n}=r,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=n,{root:l}=i;if((t==="#"||t==="#/")&&s===l.baseId)return f();let h=hm.resolveRef.call(c,l,s,t);if(h===void 0)throw new lT.default(n.opts.uriResolver,s,t);if(h instanceof hm.SchemaEnv)return d(h);return p(h);function f(){if(i===l)return Xi(r,o,i,i.$async);let y=e.scopeValue("root",{ref:l});return Xi(r,(0,Fe._)`${y}.validate`,l,l.$async)}function d(y){let u=mm(r,y);Xi(r,u,y,y.$async)}function p(y){let u=e.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,Fe.stringify)(y)}:{ref:y}),m=e.name("valid"),_=r.subschema({schema:y,dataTypes:[],schemaPath:Fe.nil,topSchemaRef:u,errSchemaPath:t},m);r.mergeEvaluated(_),r.ok(m)}}};function mm(r,e){let{gen:t}=r;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,Fe._)`${t.scopeValue("wrapper",{ref:e})}.validate`}Ar.getValidate=mm;function Xi(r,e,t,n){let{gen:s,it:i}=r,{allErrors:o,schemaEnv:a,opts:c}=i,l=c.passContext?pn.default.this:Fe.nil;n?h():f();function h(){if(!a.$async)throw new Error("async schema referenced by sync schema");let y=s.let("valid");s.try(()=>{s.code((0,Fe._)`await ${(0,pm.callValidateCode)(r,e,l)}`),p(e),o||s.assign(y,!0)},u=>{s.if((0,Fe._)`!(${u} instanceof ${i.ValidationError})`,()=>s.throw(u)),d(u),o||s.assign(y,!1)}),r.ok(y)}function f(){r.result((0,pm.callValidateCode)(r,e,l),()=>p(e),()=>d(e))}function d(y){let u=(0,Fe._)`${y}.errors`;s.assign(pn.default.vErrors,(0,Fe._)`${pn.default.vErrors} === null ? ${u} : ${pn.default.vErrors}.concat(${u})`),s.assign(pn.default.errors,(0,Fe._)`${pn.default.vErrors}.length`)}function p(y){var u;if(!i.opts.unevaluated)return;let m=(u=t?.validate)===null||u===void 0?void 0:u.evaluated;if(i.props!==!0)if(m&&!m.dynamicProps)m.props!==void 0&&(i.props=Wi.mergeEvaluated.props(s,m.props,i.props));else{let _=s.var("props",(0,Fe._)`${y}.evaluated.props`);i.props=Wi.mergeEvaluated.props(s,_,i.props,Fe.Name)}if(i.items!==!0)if(m&&!m.dynamicItems)m.items!==void 0&&(i.items=Wi.mergeEvaluated.items(s,m.items,i.items));else{let _=s.var("items",(0,Fe._)`${y}.evaluated.items`);i.items=Wi.mergeEvaluated.items(s,_,i.items,Fe.Name)}}}Ar.callRef=Xi;Ar.default=uT});var rl=w(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});var fT=dm(),dT=Qi(),pT=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",fT.default,dT.default];tl.default=pT});var ym=w(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});var eo=q(),nr=eo.operators,to={maximum:{okStr:"<=",ok:nr.LTE,fail:nr.GT},minimum:{okStr:">=",ok:nr.GTE,fail:nr.LT},exclusiveMaximum:{okStr:"<",ok:nr.LT,fail:nr.GTE},exclusiveMinimum:{okStr:">",ok:nr.GT,fail:nr.LTE}},hT={message:({keyword:r,schemaCode:e})=>(0,eo.str)`must be ${to[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,eo._)`{comparison: ${to[r].okStr}, limit: ${e}}`},mT={keyword:Object.keys(to),type:"number",schemaType:"number",$data:!0,error:hT,code(r){let{keyword:e,data:t,schemaCode:n}=r;r.fail$data((0,eo._)`${t} ${to[e].fail} ${n} || isNaN(${t})`)}};nl.default=mT});var gm=w(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});var bs=q(),yT={message:({schemaCode:r})=>(0,bs.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,bs._)`{multipleOf: ${r}}`},gT={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:yT,code(r){let{gen:e,data:t,schemaCode:n,it:s}=r,i=s.opts.multipleOfPrecision,o=e.let("res"),a=i?(0,bs._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,bs._)`${o} !== parseInt(${o})`;r.fail$data((0,bs._)`(${n} === 0 || (${o} = ${t}/${n}, ${a}))`)}};sl.default=gT});var vm=w(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});function _m(r){let e=r.length,t=0,n=0,s;for(;n<e;)t++,s=r.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=r.charCodeAt(n),(s&64512)===56320&&n++);return t}il.default=_m;_m.code='require("ajv/dist/runtime/ucs2length").default'});var bm=w(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});var Pr=q(),_T=U(),vT=vm(),bT={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,Pr.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,Pr._)`{limit: ${r}}`},wT={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:bT,code(r){let{keyword:e,data:t,schemaCode:n,it:s}=r,i=e==="maxLength"?Pr.operators.GT:Pr.operators.LT,o=s.opts.unicode===!1?(0,Pr._)`${t}.length`:(0,Pr._)`${(0,_T.useFunc)(r.gen,vT.default)}(${t})`;r.fail$data((0,Pr._)`${o} ${i} ${n}`)}};ol.default=wT});var wm=w(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});var ET=tt(),$T=U(),hn=q(),ST={message:({schemaCode:r})=>(0,hn.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,hn._)`{pattern: ${r}}`},TT={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:ST,code(r){let{gen:e,data:t,$data:n,schema:s,schemaCode:i,it:o}=r,a=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=o.opts.code,l=c.code==="new RegExp"?(0,hn._)`new RegExp`:(0,$T.useFunc)(e,c),h=e.let("valid");e.try(()=>e.assign(h,(0,hn._)`${l}(${i}, ${a}).test(${t})`),()=>e.assign(h,!1)),r.fail$data((0,hn._)`!${h}`)}else{let c=(0,ET.usePattern)(r,s);r.fail$data((0,hn._)`!${c}.test(${t})`)}}};al.default=TT});var Em=w(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});var ws=q(),OT={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,ws.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,ws._)`{limit: ${r}}`},NT={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:OT,code(r){let{keyword:e,data:t,schemaCode:n}=r,s=e==="maxProperties"?ws.operators.GT:ws.operators.LT;r.fail$data((0,ws._)`Object.keys(${t}).length ${s} ${n}`)}};cl.default=NT});var $m=w(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});var Es=tt(),$s=q(),IT=U(),AT={message:({params:{missingProperty:r}})=>(0,$s.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,$s._)`{missingProperty: ${r}}`},PT={keyword:"required",type:"object",schemaType:"array",$data:!0,error:AT,code(r){let{gen:e,schema:t,schemaCode:n,data:s,$data:i,it:o}=r,{opts:a}=o;if(!i&&t.length===0)return;let c=t.length>=a.loopRequired;if(o.allErrors?l():h(),a.strictRequired){let p=r.parentSchema.properties,{definedProperties:y}=r.it;for(let u of t)if(p?.[u]===void 0&&!y.has(u)){let m=o.schemaEnv.baseId+o.errSchemaPath,_=`required property "${u}" is not defined at "${m}" (strictRequired)`;(0,IT.checkStrictMode)(o,_,o.opts.strictRequired)}}function l(){if(c||i)r.block$data($s.nil,f);else for(let p of t)(0,Es.checkReportMissingProp)(r,p)}function h(){let p=e.let("missing");if(c||i){let y=e.let("valid",!0);r.block$data(y,()=>d(p,y)),r.ok(y)}else e.if((0,Es.checkMissingProp)(r,t,p)),(0,Es.reportMissingProp)(r,p),e.else()}function f(){e.forOf("prop",n,p=>{r.setParams({missingProperty:p}),e.if((0,Es.noPropertyInData)(e,s,p,a.ownProperties),()=>r.error())})}function d(p,y){r.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(y,(0,Es.propertyInData)(e,s,p,a.ownProperties)),e.if((0,$s.not)(y),()=>{r.error(),e.break()})},$s.nil)}}};ll.default=PT});var Sm=w(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});var Ss=q(),kT={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,Ss.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,Ss._)`{limit: ${r}}`},CT={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:kT,code(r){let{keyword:e,data:t,schemaCode:n}=r,s=e==="maxItems"?Ss.operators.GT:Ss.operators.LT;r.fail$data((0,Ss._)`${t}.length ${s} ${n}`)}};ul.default=CT});var ro=w(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});var Tm=Cc();Tm.code='require("ajv/dist/runtime/equal").default';fl.default=Tm});var Om=w(pl=>{"use strict";Object.defineProperty(pl,"__esModule",{value:!0});var dl=us(),we=q(),LT=U(),DT=ro(),qT={message:({params:{i:r,j:e}})=>(0,we.str)`must NOT have duplicate items (items ## ${e} and ${r} are identical)`,params:({params:{i:r,j:e}})=>(0,we._)`{i: ${r}, j: ${e}}`},MT={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:qT,code(r){let{gen:e,data:t,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=r;if(!n&&!s)return;let c=e.let("valid"),l=i.items?(0,dl.getSchemaTypes)(i.items):[];r.block$data(c,h,(0,we._)`${o} === false`),r.ok(c);function h(){let y=e.let("i",(0,we._)`${t}.length`),u=e.let("j");r.setParams({i:y,j:u}),e.assign(c,!0),e.if((0,we._)`${y} > 1`,()=>(f()?d:p)(y,u))}function f(){return l.length>0&&!l.some(y=>y==="object"||y==="array")}function d(y,u){let m=e.name("item"),_=(0,dl.checkDataTypes)(l,m,a.opts.strictNumbers,dl.DataType.Wrong),v=e.const("indices",(0,we._)`{}`);e.for((0,we._)`;${y}--;`,()=>{e.let(m,(0,we._)`${t}[${y}]`),e.if(_,(0,we._)`continue`),l.length>1&&e.if((0,we._)`typeof ${m} == "string"`,(0,we._)`${m} += "_"`),e.if((0,we._)`typeof ${v}[${m}] == "number"`,()=>{e.assign(u,(0,we._)`${v}[${m}]`),r.error(),e.assign(c,!1).break()}).code((0,we._)`${v}[${m}] = ${y}`)})}function p(y,u){let m=(0,LT.useFunc)(e,DT.default),_=e.name("outer");e.label(_).for((0,we._)`;${y}--;`,()=>e.for((0,we._)`${u} = ${y}; ${u}--;`,()=>e.if((0,we._)`${m}(${t}[${y}], ${t}[${u}])`,()=>{r.error(),e.assign(c,!1).break(_)})))}}};pl.default=MT});var Nm=w(ml=>{"use strict";Object.defineProperty(ml,"__esModule",{value:!0});var hl=q(),jT=U(),RT=ro(),xT={message:"must be equal to constant",params:({schemaCode:r})=>(0,hl._)`{allowedValue: ${r}}`},FT={keyword:"const",$data:!0,error:xT,code(r){let{gen:e,data:t,$data:n,schemaCode:s,schema:i}=r;n||i&&typeof i=="object"?r.fail$data((0,hl._)`!${(0,jT.useFunc)(e,RT.default)}(${t}, ${s})`):r.fail((0,hl._)`${i} !== ${t}`)}};ml.default=FT});var Im=w(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});var Ts=q(),UT=U(),BT=ro(),VT={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,Ts._)`{allowedValues: ${r}}`},zT={keyword:"enum",schemaType:"array",$data:!0,error:VT,code(r){let{gen:e,data:t,$data:n,schema:s,schemaCode:i,it:o}=r;if(!n&&s.length===0)throw new Error("enum must have non-empty array");let a=s.length>=o.opts.loopEnum,c,l=()=>c??(c=(0,UT.useFunc)(e,BT.default)),h;if(a||n)h=e.let("valid"),r.block$data(h,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");let p=e.const("vSchema",i);h=(0,Ts.or)(...s.map((y,u)=>d(p,u)))}r.pass(h);function f(){e.assign(h,!1),e.forOf("v",i,p=>e.if((0,Ts._)`${l()}(${t}, ${p})`,()=>e.assign(h,!0).break()))}function d(p,y){let u=s[y];return typeof u=="object"&&u!==null?(0,Ts._)`${l()}(${t}, ${p}[${y}])`:(0,Ts._)`${t} === ${u}`}}};yl.default=zT});var _l=w(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});var KT=ym(),HT=gm(),GT=bm(),YT=wm(),ZT=Em(),JT=$m(),WT=Sm(),XT=Om(),QT=Nm(),e1=Im(),t1=[KT.default,HT.default,GT.default,YT.default,ZT.default,JT.default,WT.default,XT.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},QT.default,e1.default];gl.default=t1});var bl=w(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.validateAdditionalItems=void 0;var kr=q(),vl=U(),r1={message:({params:{len:r}})=>(0,kr.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,kr._)`{limit: ${r}}`},n1={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:r1,code(r){let{parentSchema:e,it:t}=r,{items:n}=e;if(!Array.isArray(n)){(0,vl.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}Am(r,n)}};function Am(r,e){let{gen:t,schema:n,data:s,keyword:i,it:o}=r;o.items=!0;let a=t.const("len",(0,kr._)`${s}.length`);if(n===!1)r.setParams({len:e.length}),r.pass((0,kr._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,vl.alwaysValidSchema)(o,n)){let l=t.var("valid",(0,kr._)`${a} <= ${e.length}`);t.if((0,kr.not)(l),()=>c(l)),r.ok(l)}function c(l){t.forRange("i",e.length,a,h=>{r.subschema({keyword:i,dataProp:h,dataPropType:vl.Type.Num},l),o.allErrors||t.if((0,kr.not)(l),()=>t.break())})}}Os.validateAdditionalItems=Am;Os.default=n1});var wl=w(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});Ns.validateTuple=void 0;var Pm=q(),no=U(),s1=tt(),i1={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return km(r,"additionalItems",e);t.items=!0,!(0,no.alwaysValidSchema)(t,e)&&r.ok((0,s1.validateArray)(r))}};function km(r,e,t=r.schema){let{gen:n,parentSchema:s,data:i,keyword:o,it:a}=r;h(s),a.opts.unevaluated&&t.length&&a.items!==!0&&(a.items=no.mergeEvaluated.items(n,t.length,a.items));let c=n.name("valid"),l=n.const("len",(0,Pm._)`${i}.length`);t.forEach((f,d)=>{(0,no.alwaysValidSchema)(a,f)||(n.if((0,Pm._)`${l} > ${d}`,()=>r.subschema({keyword:o,schemaProp:d,dataProp:d},c)),r.ok(c))});function h(f){let{opts:d,errSchemaPath:p}=a,y=t.length,u=y===f.minItems&&(y===f.maxItems||f[e]===!1);if(d.strictTuples&&!u){let m=`"${o}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,no.checkStrictMode)(a,m,d.strictTuples)}}}Ns.validateTuple=km;Ns.default=i1});var Cm=w(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});var o1=wl(),a1={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,o1.validateTuple)(r,"items")};El.default=a1});var Dm=w($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});var Lm=q(),c1=U(),l1=tt(),u1=bl(),f1={message:({params:{len:r}})=>(0,Lm.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Lm._)`{limit: ${r}}`},d1={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:f1,code(r){let{schema:e,parentSchema:t,it:n}=r,{prefixItems:s}=t;n.items=!0,!(0,c1.alwaysValidSchema)(n,e)&&(s?(0,u1.validateAdditionalItems)(r,s):r.ok((0,l1.validateArray)(r)))}};$l.default=d1});var qm=w(Sl=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});var nt=q(),so=U(),p1={message:({params:{min:r,max:e}})=>e===void 0?(0,nt.str)`must contain at least ${r} valid item(s)`:(0,nt.str)`must contain at least ${r} and no more than ${e} valid item(s)`,params:({params:{min:r,max:e}})=>e===void 0?(0,nt._)`{minContains: ${r}}`:(0,nt._)`{minContains: ${r}, maxContains: ${e}}`},h1={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:p1,code(r){let{gen:e,schema:t,parentSchema:n,data:s,it:i}=r,o,a,{minContains:c,maxContains:l}=n;i.opts.next?(o=c===void 0?1:c,a=l):o=1;let h=e.const("len",(0,nt._)`${s}.length`);if(r.setParams({min:o,max:a}),a===void 0&&o===0){(0,so.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,so.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,so.alwaysValidSchema)(i,t)){let u=(0,nt._)`${h} >= ${o}`;a!==void 0&&(u=(0,nt._)`${u} && ${h} <= ${a}`),r.pass(u);return}i.items=!0;let f=e.name("valid");a===void 0&&o===1?p(f,()=>e.if(f,()=>e.break())):o===0?(e.let(f,!0),a!==void 0&&e.if((0,nt._)`${s}.length > 0`,d)):(e.let(f,!1),d()),r.result(f,()=>r.reset());function d(){let u=e.name("_valid"),m=e.let("count",0);p(u,()=>e.if(u,()=>y(m)))}function p(u,m){e.forRange("i",0,h,_=>{r.subschema({keyword:"contains",dataProp:_,dataPropType:so.Type.Num,compositeRule:!0},u),m()})}function y(u){e.code((0,nt._)`${u}++`),a===void 0?e.if((0,nt._)`${u} >= ${o}`,()=>e.assign(f,!0).break()):(e.if((0,nt._)`${u} > ${a}`,()=>e.assign(f,!1).break()),o===1?e.assign(f,!0):e.if((0,nt._)`${u} >= ${o}`,()=>e.assign(f,!0)))}}};Sl.default=h1});var io=w(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.validateSchemaDeps=Tt.validatePropertyDeps=Tt.error=void 0;var Tl=q(),m1=U(),Is=tt();Tt.error={message:({params:{property:r,depsCount:e,deps:t}})=>{let n=e===1?"property":"properties";return(0,Tl.str)`must have ${n} ${t} when property ${r} is present`},params:({params:{property:r,depsCount:e,deps:t,missingProperty:n}})=>(0,Tl._)`{property: ${r},
|
|
7
7
|
missingProperty: ${n},
|
|
8
8
|
depsCount: ${e},
|
|
9
|
-
deps: ${t}}`};var g1={keyword:"dependencies",type:"object",schemaType:"object",error:Tt.error,code(r){let[e,t]=_1(r);jm(r,e),Rm(r,t)}};function _1({schema:r}){let e={},t={};for(let n in r){if(n==="__proto__")continue;let s=Array.isArray(r[n])?e:t;s[n]=r[n]}return[e,t]}function jm(r,e=r.schema){let{gen:t,data:n,it:s}=r;if(Object.keys(e).length===0)return;let i=t.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,Is.propertyInData)(t,n,o,s.opts.ownProperties);r.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?t.if(c,()=>{for(let l of a)(0,Is.checkReportMissingProp)(r,l)}):(t.if((0,Tl._)`${c} && (${(0,Is.checkMissingProp)(r,a,i)})`),(0,Is.reportMissingProp)(r,i),t.else())}}Tt.validatePropertyDeps=jm;function Rm(r,e=r.schema){let{gen:t,data:n,keyword:s,it:i}=r,o=t.name("valid");for(let a in e)(0,y1.alwaysValidSchema)(i,e[a])||(t.if((0,Is.propertyInData)(t,n,a,i.opts.ownProperties),()=>{let c=r.subschema({keyword:s,schemaProp:a},o);r.mergeValidEvaluated(c,o)},()=>t.var(o,!0)),r.ok(o))}Tt.validateSchemaDeps=Rm;Tt.default=g1});var Fm=w(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});var xm=q(),v1=U(),b1={message:"property name must be valid",params:({params:r})=>(0,xm._)`{propertyName: ${r.propertyName}}`},w1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:b1,code(r){let{gen:e,schema:t,data:n,it:s}=r;if((0,v1.alwaysValidSchema)(s,t))return;let i=e.name("valid");e.forIn("key",n,o=>{r.setParams({propertyName:o}),r.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,xm.not)(i),()=>{r.error(!0),s.allErrors||e.break()})}),r.ok(i)}};Ol.default=w1});var Il=w(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});var oo=tt(),ut=q(),E1=et(),ao=U(),$1={message:"must NOT have additional properties",params:({params:r})=>(0,ut._)`{additionalProperty: ${r.additionalProperty}}`},S1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:$1,code(r){let{gen:e,schema:t,parentSchema:n,data:s,errsCount:i,it:o}=r;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,ao.alwaysValidSchema)(o,t))return;let l=(0,oo.allSchemaProperties)(n.properties),h=(0,oo.allSchemaProperties)(n.patternProperties);f(),r.ok((0,ut._)`${i} === ${E1.default.errors}`);function f(){e.forIn("key",s,m=>{!l.length&&!h.length?y(m):e.if(d(m),()=>y(m))})}function d(m){let _;if(l.length>8){let v=(0,ao.schemaRefOrVal)(o,n.properties,"properties");_=(0,oo.isOwnProperty)(e,v,m)}else l.length?_=(0,ut.or)(...l.map(v=>(0,ut._)`${m} === ${v}`)):_=ut.nil;return h.length&&(_=(0,ut.or)(_,...h.map(v=>(0,ut._)`${(0,oo.usePattern)(r,v)}.test(${m})`))),(0,ut.not)(_)}function p(m){e.code((0,ut._)`delete ${s}[${m}]`)}function y(m){if(c.removeAdditional==="all"||c.removeAdditional&&t===!1){p(m);return}if(t===!1){r.setParams({additionalProperty:m}),r.error(),a||e.break();return}if(typeof t=="object"&&!(0,ao.alwaysValidSchema)(o,t)){let _=e.name("valid");c.removeAdditional==="failing"?(u(m,_,!1),e.if((0,ut.not)(_),()=>{r.reset(),p(m)})):(u(m,_),a||e.if((0,ut.not)(_),()=>e.break()))}}function u(m,_,v){let g={keyword:"additionalProperties",dataProp:m,dataPropType:ao.Type.Str};v===!1&&Object.assign(g,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(g,_)}}};Nl.default=S1});var Vm=w(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var T1=cn(),Um=tt(),Al=U(),Bm=Il(),O1={keyword:"properties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,parentSchema:n,data:s,it:i}=r;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Bm.default.code(new T1.KeywordCxt(i,Bm.default,"additionalProperties"));let o=(0,Um.allSchemaProperties)(t);for(let f of o)i.definedProperties.add(f);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=Al.mergeEvaluated.props(e,(0,Al.toHash)(o),i.props));let a=o.filter(f=>!(0,Al.alwaysValidSchema)(i,t[f]));if(a.length===0)return;let c=e.name("valid");for(let f of a)l(f)?h(f):(e.if((0,Um.propertyInData)(e,s,f,i.opts.ownProperties)),h(f),i.allErrors||e.else().var(c,!0),e.endIf()),r.it.definedProperties.add(f),r.ok(c);function l(f){return i.opts.useDefaults&&!i.compositeRule&&t[f].default!==void 0}function h(f){r.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};Pl.default=O1});var Gm=w(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});var zm=tt(),co=q(),Km=U(),Hm=U(),N1={keyword:"patternProperties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,data:n,parentSchema:s,it:i}=r,{opts:o}=i,a=(0,zm.allSchemaProperties)(t),c=a.filter(u=>(0,Km.alwaysValidSchema)(i,t[u]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,h=e.name("valid");i.props!==!0&&!(i.props instanceof co.Name)&&(i.props=(0,Hm.evaluatedPropsToName)(e,i.props));let{props:f}=i;d();function d(){for(let u of a)l&&p(u),i.allErrors?y(u):(e.var(h,!0),y(u),e.if(h))}function p(u){for(let m in l)new RegExp(u).test(m)&&(0,Km.checkStrictMode)(i,`property ${m} matches pattern ${u} (use allowMatchingProperties)`)}function y(u){e.forIn("key",n,m=>{e.if((0,co._)`${(0,zm.usePattern)(r,u)}.test(${m})`,()=>{let _=c.includes(u);_||r.subschema({keyword:"patternProperties",schemaProp:u,dataProp:m,dataPropType:Hm.Type.Str},h),i.opts.unevaluated&&f!==!0?e.assign((0,co._)`${f}[${m}]`,!0):!_&&!i.allErrors&&e.if((0,co.not)(h),()=>e.break())})})}}};kl.default=N1});var Ym=w(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});var I1=U(),A1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:n}=r;if((0,I1.alwaysValidSchema)(n,t)){r.fail();return}let s=e.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),r.failResult(s,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};Cl.default=A1});var Zm=w(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var P1=tt(),k1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:P1.validateUnion,error:{message:"must match a schema in anyOf"}};Ll.default=k1});var Jm=w(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});var lo=q(),C1=U(),L1={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,lo._)`{passingSchemas: ${r.passing}}`},D1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:L1,code(r){let{gen:e,schema:t,parentSchema:n,it:s}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=t,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");r.setParams({passing:a}),e.block(l),r.result(o,()=>r.reset(),()=>r.error(!0));function l(){i.forEach((h,f)=>{let d;(0,C1.alwaysValidSchema)(s,h)?e.var(c,!0):d=r.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c),f>0&&e.if((0,lo._)`${c} && ${o}`).assign(o,!1).assign(a,(0,lo._)`[${a}, ${f}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,f),d&&r.mergeEvaluated(d,lo.Name)})})}}};Dl.default=D1});var Wm=w(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});var q1=U(),M1={keyword:"allOf",schemaType:"array",code(r){let{gen:e,schema:t,it:n}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");let s=e.name("valid");t.forEach((i,o)=>{if((0,q1.alwaysValidSchema)(n,i))return;let a=r.subschema({keyword:"allOf",schemaProp:o},s);r.ok(s),r.mergeEvaluated(a)})}};ql.default=M1});var ey=w(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var uo=q(),Qm=U(),j1={message:({params:r})=>(0,uo.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,uo._)`{failingKeyword: ${r.ifClause}}`},R1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:j1,code(r){let{gen:e,parentSchema:t,it:n}=r;t.then===void 0&&t.else===void 0&&(0,Qm.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=Xm(n,"then"),i=Xm(n,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),r.reset(),s&&i){let h=e.let("ifClause");r.setParams({ifClause:h}),e.if(a,l("then",h),l("else",h))}else s?e.if(a,l("then")):e.if((0,uo.not)(a),l("else"));r.pass(o,()=>r.error(!0));function c(){let h=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);r.mergeEvaluated(h)}function l(h,f){return()=>{let d=r.subschema({keyword:h},a);e.assign(o,a),r.mergeValidEvaluated(d,o),f?e.assign(f,(0,uo._)`${h}`):r.setParams({ifClause:h})}}}};function Xm(r,e){let t=r.schema[e];return t!==void 0&&!(0,Qm.alwaysValidSchema)(r,t)}Ml.default=R1});var ty=w(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});var x1=U(),F1={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,x1.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};jl.default=F1});var xl=w(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});var U1=bl(),B1=Lm(),V1=wl(),z1=qm(),K1=Mm(),H1=io(),G1=Fm(),Y1=Il(),Z1=Vm(),J1=Gm(),W1=Ym(),X1=Zm(),Q1=Jm(),eO=Wm(),tO=ey(),rO=ty();function nO(r=!1){let e=[W1.default,X1.default,Q1.default,eO.default,tO.default,rO.default,G1.default,Y1.default,H1.default,Z1.default,J1.default];return r?e.push(B1.default,z1.default):e.push(U1.default,V1.default),e.push(K1.default),e}Rl.default=nO});var Ul=w(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.dynamicAnchor=void 0;var Fl=q(),sO=et(),ry=ms(),iO=Qi(),oO={keyword:"$dynamicAnchor",schemaType:"string",code:r=>ny(r,r.schema)};function ny(r,e){let{gen:t,it:n}=r;n.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,Fl._)`${sO.default.dynamicAnchors}${(0,Fl.getProperty)(e)}`,i=n.errSchemaPath==="#"?n.validateName:aO(r);t.if((0,Fl._)`!${s}`,()=>t.assign(s,i))}As.dynamicAnchor=ny;function aO(r){let{schemaEnv:e,schema:t,self:n}=r.it,{root:s,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=n.opts,l=new ry.SchemaEnv({schema:t,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return ry.compileSchema.call(n,l),(0,iO.getValidate)(r,l)}As.default=oO});var Bl=w(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.dynamicRef=void 0;var sy=q(),cO=et(),iy=Qi(),lO={keyword:"$dynamicRef",schemaType:"string",code:r=>oy(r,r.schema)};function oy(r,e){let{gen:t,keyword:n,it:s}=r;if(e[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let i=e.slice(1);if(s.allErrors)o();else{let c=t.let("valid",!1);o(c),r.ok(c)}function o(c){if(s.schemaEnv.root.dynamicAnchors[i]){let l=t.let("_v",(0,sy._)`${cO.default.dynamicAnchors}${(0,sy.getProperty)(i)}`);t.if(l,a(l,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,l){return l?()=>t.block(()=>{(0,iy.callRef)(r,c),t.let(l,!0)}):()=>(0,iy.callRef)(r,c)}}Ps.dynamicRef=oy;Ps.default=lO});var ay=w(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var uO=Ul(),fO=U(),dO={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,uO.dynamicAnchor)(r,""):(0,fO.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};Vl.default=dO});var cy=w(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});var pO=Bl(),hO={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,pO.dynamicRef)(r,r.schema)};zl.default=hO});var ly=w(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});var mO=Ul(),yO=Bl(),gO=ay(),_O=cy(),vO=[mO.default,yO.default,gO.default,_O.default];Kl.default=vO});var fy=w(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var uy=io(),bO={keyword:"dependentRequired",type:"object",schemaType:"object",error:uy.error,code:r=>(0,uy.validatePropertyDeps)(r)};Hl.default=bO});var dy=w(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var wO=io(),EO={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,wO.validateSchemaDeps)(r)};Gl.default=EO});var py=w(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});var $O=U(),SO={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:e,it:t}){e.contains===void 0&&(0,$O.checkStrictMode)(t,`"${r}" without "contains" is ignored`)}};Yl.default=SO});var hy=w(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});var TO=fy(),OO=dy(),NO=py(),IO=[TO.default,OO.default,NO.default];Zl.default=IO});var yy=w(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var sr=q(),my=U(),AO=et(),PO={message:"must NOT have unevaluated properties",params:({params:r})=>(0,sr._)`{unevaluatedProperty: ${r.unevaluatedProperty}}`},kO={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:PO,code(r){let{gen:e,schema:t,data:n,errsCount:s,it:i}=r;if(!s)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof sr.Name?e.if((0,sr._)`${a} !== true`,()=>e.forIn("key",n,f=>e.if(l(a,f),()=>c(f)))):a!==!0&&e.forIn("key",n,f=>a===void 0?c(f):e.if(h(a,f),()=>c(f))),i.props=!0,r.ok((0,sr._)`${s} === ${AO.default.errors}`);function c(f){if(t===!1){r.setParams({unevaluatedProperty:f}),r.error(),o||e.break();return}if(!(0,my.alwaysValidSchema)(i,t)){let d=e.name("valid");r.subschema({keyword:"unevaluatedProperties",dataProp:f,dataPropType:my.Type.Str},d),o||e.if((0,sr.not)(d),()=>e.break())}}function l(f,d){return(0,sr._)`!${f} || !${f}[${d}]`}function h(f,d){let p=[];for(let y in f)f[y]===!0&&p.push((0,sr._)`${d} !== ${y}`);return(0,sr.and)(...p)}}};Jl.default=kO});var _y=w(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var Cr=q(),gy=U(),CO={message:({params:{len:r}})=>(0,Cr.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Cr._)`{limit: ${r}}`},LO={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:CO,code(r){let{gen:e,schema:t,data:n,it:s}=r,i=s.items||0;if(i===!0)return;let o=e.const("len",(0,Cr._)`${n}.length`);if(t===!1)r.setParams({len:i}),r.fail((0,Cr._)`${o} > ${i}`);else if(typeof t=="object"&&!(0,gy.alwaysValidSchema)(s,t)){let c=e.var("valid",(0,Cr._)`${o} <= ${i}`);e.if((0,Cr.not)(c),()=>a(c,i)),r.ok(c)}s.items=!0;function a(c,l){e.forRange("i",l,o,h=>{r.subschema({keyword:"unevaluatedItems",dataProp:h,dataPropType:gy.Type.Num},c),s.allErrors||e.if((0,Cr.not)(c),()=>e.break())})}}};Wl.default=LO});var vy=w(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var DO=yy(),qO=_y(),MO=[DO.default,qO.default];Xl.default=MO});var by=w(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});var pe=q(),jO={message:({schemaCode:r})=>(0,pe.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,pe._)`{format: ${r}}`},RO={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:jO,code(r,e){let{gen:t,data:n,$data:s,schema:i,schemaCode:o,it:a}=r,{opts:c,errSchemaPath:l,schemaEnv:h,self:f}=a;if(!c.validateFormats)return;s?d():p();function d(){let y=t.scopeValue("formats",{ref:f.formats,code:c.code.formats}),u=t.const("fDef",(0,pe._)`${y}[${o}]`),m=t.let("fType"),_=t.let("format");t.if((0,pe._)`typeof ${u} == "object" && !(${u} instanceof RegExp)`,()=>t.assign(m,(0,pe._)`${u}.type || "string"`).assign(_,(0,pe._)`${u}.validate`),()=>t.assign(m,(0,pe._)`"string"`).assign(_,u)),r.fail$data((0,pe.or)(v(),g()));function v(){return c.strictSchema===!1?pe.nil:(0,pe._)`${o} && !${_}`}function g(){let b=h.$async?(0,pe._)`(${u}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,pe._)`${_}(${n})`,E=(0,pe._)`(typeof ${_} == "function" ? ${b} : ${_}.test(${n}))`;return(0,pe._)`${_} && ${_} !== true && ${m} === ${e} && !${E}`}}function p(){let y=f.formats[i];if(!y){v();return}if(y===!0)return;let[u,m,_]=g(y);u===e&&r.pass(b());function v(){if(c.strictSchema===!1){f.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function g(E){let $=E instanceof RegExp?(0,pe.regexpCode)(E):c.code.formats?(0,pe._)`${c.code.formats}${(0,pe.getProperty)(i)}`:void 0,S=t.scopeValue("formats",{key:i,ref:E,code:$});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,pe._)`${S}.validate`]:["string",E,S]}function b(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!h.$async)throw new Error("async format in sync schema");return(0,pe._)`await ${_}(${n})`}return typeof m=="function"?(0,pe._)`${_}(${n})`:(0,pe._)`${_}.test(${n})`}}}};Ql.default=RO});var tu=w(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});var xO=by(),FO=[xO.default];eu.default=FO});var ru=w(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.contentVocabulary=mn.metadataVocabulary=void 0;mn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];mn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Ey=w(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});var UO=rl(),BO=_l(),VO=xl(),zO=ly(),KO=hy(),HO=vy(),GO=tu(),wy=ru(),YO=[zO.default,UO.default,BO.default,(0,VO.default)(!0),GO.default,wy.metadataVocabulary,wy.contentVocabulary,KO.default,HO.default];nu.default=YO});var Sy=w(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.DiscrError=void 0;var $y;(function(r){r.Tag="tag",r.Mapping="mapping"})($y||(fo.DiscrError=$y={}))});var ou=w(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});var yn=q(),su=Sy(),Ty=ms(),ZO=ln(),JO=U(),WO={message:({params:{discrError:r,tagName:e}})=>r===su.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:r,tag:e,tagName:t}})=>(0,yn._)`{error: ${r}, tag: ${t}, tagValue: ${e}}`},XO={keyword:"discriminator",type:"object",schemaType:"object",error:WO,code(r){let{gen:e,data:t,schema:n,parentSchema:s,it:i}=r,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,yn._)`${t}${(0,yn.getProperty)(a)}`);e.if((0,yn._)`typeof ${l} == "string"`,()=>h(),()=>r.error(!1,{discrError:su.DiscrError.Tag,tag:l,tagName:a})),r.ok(c);function h(){let p=d();e.if(!1);for(let y in p)e.elseIf((0,yn._)`${l} === ${y}`),e.assign(c,f(p[y]));e.else(),r.error(!1,{discrError:su.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function f(p){let y=e.name("valid"),u=r.subschema({keyword:"oneOf",schemaProp:p},y);return r.mergeEvaluated(u,yn.Name),y}function d(){var p;let y={},u=_(s),m=!0;for(let b=0;b<o.length;b++){let E=o[b];if(E?.$ref&&!(0,JO.schemaHasRulesButRef)(E,i.self.RULES)){let S=E.$ref;if(E=Ty.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,S),E instanceof Ty.SchemaEnv&&(E=E.schema),E===void 0)throw new ZO.default(i.opts.uriResolver,i.baseId,S)}let $=(p=E?.properties)===null||p===void 0?void 0:p[a];if(typeof $!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);m=m&&(u||_(E)),v($,b)}if(!m)throw new Error(`discriminator: "${a}" must be required`);return y;function _({required:b}){return Array.isArray(b)&&b.includes(a)}function v(b,E){if(b.const)g(b.const,E);else if(b.enum)for(let $ of b.enum)g($,E);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function g(b,E){if(typeof b!="string"||b in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[b]=E}}}};iu.default=XO});var Oy=w((c2,QO)=>{QO.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Ny=w((l2,eN)=>{eN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Iy=w((u2,tN)=>{tN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Ay=w((f2,rN)=>{rN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var Py=w((d2,nN)=>{nN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var ky=w((p2,sN)=>{sN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var Cy=w((h2,iN)=>{iN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var Ly=w((m2,oN)=>{oN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var Dy=w(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});var aN=Oy(),cN=Ny(),lN=Iy(),uN=Ay(),fN=Py(),dN=ky(),pN=Cy(),hN=Ly(),mN=["/properties"];function yN(r){return[aN,cN,lN,uN,fN,e(this,dN),pN,e(this,hN)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,n){return r?t.$dataMetaSchema(n,mN):n}}au.default=yN});var uu=w((se,lu)=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.MissingRefError=se.ValidationError=se.CodeGen=se.Name=se.nil=se.stringify=se.str=se._=se.KeywordCxt=se.Ajv2020=void 0;var gN=Qc(),_N=Ey(),vN=ou(),bN=Dy(),cu="https://json-schema.org/draft/2020-12/schema",gn=class extends gN.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),_N.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(vN.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(bN.default.call(this,e),this.refs["http://json-schema.org/schema"]=cu)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(cu)?cu:void 0)}};se.Ajv2020=gn;lu.exports=se=gn;lu.exports.Ajv2020=gn;Object.defineProperty(se,"__esModule",{value:!0});se.default=gn;var wN=cn();Object.defineProperty(se,"KeywordCxt",{enumerable:!0,get:function(){return wN.KeywordCxt}});var _n=q();Object.defineProperty(se,"_",{enumerable:!0,get:function(){return _n._}});Object.defineProperty(se,"str",{enumerable:!0,get:function(){return _n.str}});Object.defineProperty(se,"stringify",{enumerable:!0,get:function(){return _n.stringify}});Object.defineProperty(se,"nil",{enumerable:!0,get:function(){return _n.nil}});Object.defineProperty(se,"Name",{enumerable:!0,get:function(){return _n.Name}});Object.defineProperty(se,"CodeGen",{enumerable:!0,get:function(){return _n.CodeGen}});var EN=hs();Object.defineProperty(se,"ValidationError",{enumerable:!0,get:function(){return EN.default}});var $N=ln();Object.defineProperty(se,"MissingRefError",{enumerable:!0,get:function(){return $N.default}})});var By=w(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.formatNames=Nt.fastFormats=Nt.fullFormats=void 0;function Ot(r,e){return{validate:r,compare:e}}Nt.fullFormats={date:Ot(Ry,hu),time:Ot(du(!0),mu),"date-time":Ot(qy(!0),Fy),"iso-time":Ot(du(),xy),"iso-date-time":Ot(qy(),Uy),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:AN,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:MN,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:PN,int32:{type:"number",validate:LN},int64:{type:"number",validate:DN},float:{type:"number",validate:jy},double:{type:"number",validate:jy},password:!0,binary:!0};Nt.fastFormats={...Nt.fullFormats,date:Ot(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,hu),time:Ot(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,mu),"date-time":Ot(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Fy),"iso-time":Ot(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,xy),"iso-date-time":Ot(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Uy),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Nt.formatNames=Object.keys(Nt.fullFormats);function SN(r){return r%4===0&&(r%100!==0||r%400===0)}var TN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,ON=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Ry(r){let e=TN.exec(r);if(!e)return!1;let t=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&SN(t)?29:ON[n])}function hu(r,e){if(r&&e)return r>e?1:r<e?-1:0}var fu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function du(r){return function(t){let n=fu.exec(t);if(!n)return!1;let s=+n[1],i=+n[2],o=+n[3],a=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),h=+(n[7]||0);if(l>23||h>59||r&&!a)return!1;if(s<=23&&i<=59&&o<60)return!0;let f=i-h*c,d=s-l*c-(f<0?1:0);return(d===23||d===-1)&&(f===59||f===-1)&&o<61}}function mu(r,e){if(!(r&&e))return;let t=new Date("2020-01-01T"+r).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(t&&n)return t-n}function xy(r,e){if(!(r&&e))return;let t=fu.exec(r),n=fu.exec(e);if(t&&n)return r=t[1]+t[2]+t[3],e=n[1]+n[2]+n[3],r>e?1:r<e?-1:0}var pu=/t|\s/i;function qy(r){let e=du(r);return function(n){let s=n.split(pu);return s.length===2&&Ry(s[0])&&e(s[1])}}function Fy(r,e){if(!(r&&e))return;let t=new Date(r).valueOf(),n=new Date(e).valueOf();if(t&&n)return t-n}function Uy(r,e){if(!(r&&e))return;let[t,n]=r.split(pu),[s,i]=e.split(pu),o=hu(t,s);if(o!==void 0)return o||mu(n,i)}var NN=/\/|:/,IN=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function AN(r){return NN.test(r)&&IN.test(r)}var My=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function PN(r){return My.lastIndex=0,My.test(r)}var kN=-(2**31),CN=2**31-1;function LN(r){return Number.isInteger(r)&&r<=CN&&r>=kN}function DN(r){return Number.isInteger(r)}function jy(){return!0}var qN=/[^\\]\\Z/;function MN(r){if(qN.test(r))return!1;try{return new RegExp(r),!0}catch{return!1}}});var zy=w(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});var jN=rl(),RN=_l(),xN=xl(),FN=tu(),Vy=ru(),UN=[jN.default,RN.default,(0,xN.default)(),FN.default,Vy.metadataVocabulary,Vy.contentVocabulary];yu.default=UN});var Ky=w((v2,BN)=>{BN.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Gy=w((ie,gu)=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.MissingRefError=ie.ValidationError=ie.CodeGen=ie.Name=ie.nil=ie.stringify=ie.str=ie._=ie.KeywordCxt=ie.Ajv=void 0;var VN=Qc(),zN=zy(),KN=ou(),Hy=Ky(),HN=["/properties"],po="http://json-schema.org/draft-07/schema",vn=class extends VN.default{_addVocabularies(){super._addVocabularies(),zN.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(KN.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Hy,HN):Hy;this.addMetaSchema(e,po,!1),this.refs["http://json-schema.org/schema"]=po}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(po)?po:void 0)}};ie.Ajv=vn;gu.exports=ie=vn;gu.exports.Ajv=vn;Object.defineProperty(ie,"__esModule",{value:!0});ie.default=vn;var GN=cn();Object.defineProperty(ie,"KeywordCxt",{enumerable:!0,get:function(){return GN.KeywordCxt}});var bn=q();Object.defineProperty(ie,"_",{enumerable:!0,get:function(){return bn._}});Object.defineProperty(ie,"str",{enumerable:!0,get:function(){return bn.str}});Object.defineProperty(ie,"stringify",{enumerable:!0,get:function(){return bn.stringify}});Object.defineProperty(ie,"nil",{enumerable:!0,get:function(){return bn.nil}});Object.defineProperty(ie,"Name",{enumerable:!0,get:function(){return bn.Name}});Object.defineProperty(ie,"CodeGen",{enumerable:!0,get:function(){return bn.CodeGen}});var YN=hs();Object.defineProperty(ie,"ValidationError",{enumerable:!0,get:function(){return YN.default}});var ZN=ln();Object.defineProperty(ie,"MissingRefError",{enumerable:!0,get:function(){return ZN.default}})});var Yy=w(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.formatLimitDefinition=void 0;var JN=Gy(),ft=q(),ir=ft.operators,ho={formatMaximum:{okStr:"<=",ok:ir.LTE,fail:ir.GT},formatMinimum:{okStr:">=",ok:ir.GTE,fail:ir.LT},formatExclusiveMaximum:{okStr:"<",ok:ir.LT,fail:ir.GTE},formatExclusiveMinimum:{okStr:">",ok:ir.GT,fail:ir.LTE}},WN={message:({keyword:r,schemaCode:e})=>(0,ft.str)`should be ${ho[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,ft._)`{comparison: ${ho[r].okStr}, limit: ${e}}`};wn.formatLimitDefinition={keyword:Object.keys(ho),type:"string",schemaType:"string",$data:!0,error:WN,code(r){let{gen:e,data:t,schemaCode:n,keyword:s,it:i}=r,{opts:o,self:a}=i;if(!o.validateFormats)return;let c=new JN.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?l():h();function l(){let d=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),p=e.const("fmt",(0,ft._)`${d}[${c.schemaCode}]`);r.fail$data((0,ft.or)((0,ft._)`typeof ${p} != "object"`,(0,ft._)`${p} instanceof RegExp`,(0,ft._)`typeof ${p}.compare != "function"`,f(p)))}function h(){let d=c.schema,p=a.formats[d];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${s}": format "${d}" does not define "compare" function`);let y=e.scopeValue("formats",{key:d,ref:p,code:o.code.formats?(0,ft._)`${o.code.formats}${(0,ft.getProperty)(d)}`:void 0});r.fail$data(f(y))}function f(d){return(0,ft._)`${d}.compare(${t}, ${n}) ${ho[s].fail} 0`}},dependencies:["format"]};var XN=r=>(r.addKeyword(wn.formatLimitDefinition),r);wn.default=XN});var bu=w((ks,Wy)=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});var En=By(),QN=Yy(),_u=q(),Zy=new _u.Name("fullFormats"),eI=new _u.Name("fastFormats"),vu=(r,e={keywords:!0})=>{if(Array.isArray(e))return Jy(r,e,En.fullFormats,Zy),r;let[t,n]=e.mode==="fast"?[En.fastFormats,eI]:[En.fullFormats,Zy],s=e.formats||En.formatNames;return Jy(r,s,t,n),e.keywords&&(0,QN.default)(r),r};vu.get=(r,e="full")=>{let n=(e==="fast"?En.fastFormats:En.fullFormats)[r];if(!n)throw new Error(`Unknown format "${r}"`);return n};function Jy(r,e,t,n){var s,i;(s=(i=r.opts.code).formats)!==null&&s!==void 0||(i.formats=(0,_u._)`require("ajv-formats/dist/formats").${n}`);for(let o of e)r.addFormat(o,t[o])}Wy.exports=ks=vu;Object.defineProperty(ks,"__esModule",{value:!0});ks.default=vu});var Xy=w((w2,tI)=>{tI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L0/run.schema.json",title:"run.yaml (L0)",description:"Run-level manifest for an .evidence pack. Its presence at the top of a pack is what identifies the pack (the manifest anchor). One pack = one run. evidence-cli is framework-agnostic: nothing here is specific to any test framework.",type:"object",required:["evidence","run_id","status","started","title"],properties:{evidence:{description:"Evidence CONTRACT version this pack conforms to. One contract version spans all profiles (L0\u2013L3); adding a profile is additive and does NOT change it \u2014 only a breaking change to an existing meaning bumps the version. A validator is pinned to one contract version, so this is a const: a 0.1 validator rejects other versions rather than silently mis-reading them. See decision 0027.",const:"0.1"},run_id:{description:"Stable identifier for this run.",type:"string",minLength:1},status:{description:"Lifecycle of the run, NOT a test verdict. While `running`, totals are not yet authoritative; `finalize` seals the pack to `finalized`. `aborted` is a run that ended without sealing.",enum:["running","finalized","aborted"]},title:{description:"Human-readable run title.",type:"string",minLength:1},started:{description:"When the run started (RFC3339 / ISO-8601).",type:"string",format:"date-time"},ended:{description:"When the run ended (RFC3339 / ISO-8601). Required once status is `finalized`.",type:"string",format:"date-time"},totals:{description:"Verdict roll-up over all tests. DERIVED by `evidence finalize` from every tests/<id>/result.yaml \u2014 not hand-authored. Required once status is `finalized`.",type:"object",required:["tests","passed","failed","broken","skipped"],additionalProperties:!1,properties:{tests:{type:"integer",minimum:0},passed:{type:"integer",minimum:0},failed:{type:"integer",minimum:0},broken:{type:"integer",minimum:0},skipped:{type:"integer",minimum:0}}},metrics:{description:"Free-form, framework-defined metrics. Each metric is a typed FACT, never a verdict. The set of metric names and their `type` strings is entirely up to the producing framework.",type:"object",additionalProperties:{type:"object",required:["value","type"],properties:{value:{description:"The measured value. A metric is a FACT, never a verdict, so boolean is intentionally excluded \u2014 a bare true/false reads as a pass/fail. Emit a flag as a typed string instead. See decision 0012.",type:["number","integer","string"]},type:{description:"Producer-defined type of the metric (open string, e.g. percentage, ratio, count, ms, currency). evidence-cli validates presence only, not vocabulary.",type:"string",minLength:1},unit:{description:"Optional display unit.",type:"string"},label:{description:"Optional human label.",type:"string"}},additionalProperties:!0}},metrics_catalog:{description:"Present when the producer snapshotted its metric catalog into the pack at meta/metrics-catalog.yaml: which catalog it is and the sha256 hex of the snapshot's bytes. `validate` checks the snapshot exists, conforms, hashes to `sha256` and carries `id` and `version`. `source` is the producer's own word for where the catalog came from (e.g. controller, cache, bundled). See decision 0048.",type:"object",required:["id","version","sha256"],properties:{id:{type:"string",minLength:1},version:{type:["integer","string"]},sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},source:{type:"string",minLength:1}},additionalProperties:!0},merged_from:{description:"Present only on a pack produced by `evidence merge`: the source run_ids, in CLI order. The additive slice of deferred lineage (0014). See decision 0045.",type:"array",minItems:1,items:{type:"string",minLength:1}},environment:{description:"Optional provenance/context block \u2014 an OPEN map of key:value pairs. The keys below are conventional, none is required, and any additional key:value pairs are allowed. A non-browser framework (unit, API) may legitimately omit model/surfaces \u2014 or the whole block \u2014 entirely. See decision 0013.",type:"object",properties:{producer:{description:"The tool that produced this pack.",type:"object",properties:{name:{type:"string"},version:{type:"string"}},additionalProperties:!0},model:{type:"string"},surfaces:{type:"array",items:{type:"string"}},ci:{type:"object",additionalProperties:!0}},additionalProperties:!0}},allOf:[{description:"Finalized packs are sealed: ended timestamp and the derived totals must be present.",if:{properties:{status:{const:"finalized"}},required:["status"]},then:{required:["ended","totals"]}}],additionalProperties:!0}});var Qy=w((E2,rI)=>{rI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L0/result.schema.json",title:"result.yaml (L0)",description:"THE RESULT for one test inside an .evidence pack (tests/<id>/result.yaml): structured, easy-to-parse per-step outcomes. The test's DEFINITION (the framework's own artifact \u2014 kane test.md, a .spec.ts, etc.) lives beside this file and is OPAQUE to evidence-cli; it is referenced by `definition`, never parsed.",type:"object",required:["evidence","test","status","steps"],properties:{evidence:{description:"Evidence CONTRACT version this file conforms to. One contract version spans all profiles (L0\u2013L3); only a breaking change bumps it. Const by design \u2014 a validator is pinned to its contract version. See decision 0027.",const:"0.1"},test:{description:"Test identifier. MUST equal the tests/<id>/ directory name \u2014 the validator enforces this equality (a cross-check beyond JSON Schema; see decision 0031).",type:"string",minLength:1},status:{description:"Test verdict, authored by the producer. `failed` = oracle evaluated and the product was wrong. `broken` = oracle could NOT be evaluated (environment/infra/test fault). `skipped` = not executed.",enum:["passed","failed","broken","skipped"]},definition:{description:"Reference to the opaque definition artifact. The framework pre-declares `path` (its own native filename); `evidence finalize` adds `sha256`. evidence-cli asserts the file at `path` exists and (when sealed) that its hash matches \u2014 it never reads the content.",type:"object",required:["path"],properties:{path:{description:"Path to the definition file, relative to and CONTAINED WITHIN this test directory. No leading '/', no '..' segment, no URL scheme \u2014 subdirectories are allowed. The pattern below catches the obvious shapes; the validator additionally normalizes the path and rejects any escape (see decisions 0029, 0031).",type:"string",minLength:1,pattern:"^(?!/)(?!.*(^|/)\\.\\.(/|$))(?![a-zA-Z][a-zA-Z0-9+.-]*:)[^\\\\]+$"},sha256:{description:"Content hash of the definition file. Added by `evidence finalize`. Format: 'sha256:<hex>'.",type:"string",pattern:"^sha256:[0-9a-f]{64}$"}},additionalProperties:!0},steps:{description:"Ordered per-step outcomes. The framework decides what a 'step' is and its granularity. MAY be empty (a unit/API test may have no sub-steps).",type:"array",items:{$ref:"#/$defs/step"}},params_hash:{description:"Optional hash of the parameterization used for this test.",type:"string"},external_id:{description:"Optional open map of links into external systems (e.g. a test-manager URL).",type:"object",additionalProperties:!0},duration_ms:{type:"number",minimum:0},attempts:{description:"Optional per-attempt outcomes for a retried test. Each attempt carries a `status` from the verdict enum; the array length is the attempt count. The test-level `status` remains the authoritative final verdict. See decision 0033.",type:"array",minItems:1,items:{type:"object",required:["status"],properties:{status:{description:"Outcome of this attempt \u2014 same vocabulary as the test verdict.",enum:["passed","failed","broken","skipped"]},duration_ms:{type:"number",minimum:0}},additionalProperties:!0}},flaky:{description:"Optional. Derived: true when the statuses in `attempts` disagree. See decision 0033.",type:"boolean"},tags:{type:"array",items:{type:"string"}},requirements:{type:"array",items:{type:"string"}},environment:{description:"Optional per-test execution context \u2014 an OPEN map of key:value pairs, the SAME shape as run.yaml.environment (decision 0013). Records the environment a single test executed in (e.g. cross-browser, sharded, or merged evidence, where tests diverge). How this relates to the run-level environment \u2014 precedence, merge, inheritance \u2014 is left to the consumer that reads the pack; the format only carries the facts and the validator checks shape. Nothing here is required. See decision 0043.",type:"object",properties:{producer:{description:"The tool that executed this test; typically only recorded at run level, present here only if a test's producer differs.",type:"object",properties:{name:{type:"string"},version:{type:"string"}},additionalProperties:!0},model:{type:"string"},surfaces:{type:"array",items:{type:"string"}},ci:{type:"object",additionalProperties:!0}},additionalProperties:!0}},additionalProperties:!0,$defs:{step:{type:"object",required:["id","ordinal","status"],properties:{id:{description:"Stable identifier for the step within this test.",type:"string",minLength:1},ordinal:{description:"1-based position in the producer's step sequence (NOT an index into this array). Ordinals MUST be unique and strictly increasing in array order; gaps are allowed when a producer records only some of a longer sequence. Uniqueness/monotonicity is a validator cross-check beyond JSON Schema; see decisions 0030, 0031.",type:"integer",minimum:1},status:{description:"Step verdict, same vocabulary as the test verdict.",enum:["passed","failed","broken","skipped"]},kind:{description:"OPTIONAL producer-defined step kind (open string, e.g. navigate, input, assertion, api, wait). Not required on a step; when present it must be non-empty. evidence-cli never checks the vocabulary. See decision 0009.",type:"string",minLength:1},duration_ms:{type:"number",minimum:0},durable_id:{description:"Optional stable cross-run identity for the step.",type:"string"},defect:{description:"Optional defect classification for a non-passing step (e.g. Product, Infrastructure, Test).",type:"string"},expected:{type:"string"},actual:{type:"string"},check:{description:"Optional oracle descriptor.",type:"object",properties:{kind:{type:"string"}},additionalProperties:!0}},additionalProperties:!0}}}});var eg=w(($2,nI)=>{nI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L1/logs-meta.schema.json",title:"logs/meta.yaml (L1)",description:"Declares the execution logs kept for one test, at tests/<id>/logs/meta.yaml. The log files themselves are OPAQUE to evidence-cli \u2014 referenced by `file` and checked for existence and declared `format`, never parsed. L1 requires at least one log. See decision 0040.",type:"object",required:["logs"],properties:{logs:{description:"The logs this test kept. L1 requires at least one. Both the log `name` and its `format` are open vocabulary \u2014 the framework chooses what to keep and how to label it; evidence-cli records both and parses neither.",type:"array",minItems:1,items:{type:"object",required:["name","file","format"],properties:{name:{description:"Human-facing log name (e.g. console, network). Open vocabulary.",type:"string",minLength:1},file:{description:"Path to the log file, relative to and CONTAINED WITHIN this test's logs/ directory. No leading '/', no '..' segment, no URL scheme \u2014 same containment rule as definition.path (decision 0029). The file MUST exist (a validator cross-check).",type:"string",minLength:1,pattern:"^(?!/)(?!.*(^|/)\\.\\.(/|$))(?![a-zA-Z][a-zA-Z0-9+.-]*:)[^\\\\]+$"},format:{description:"Producer-declared log format (open string, e.g. ndjson, har, log, csv, jsonl, txt). Since evidence-cli never parses the log content, it validates presence and non-emptiness only, never the vocabulary \u2014 same stance as step `kind` (decision 0009) and metric `type` (decision 0012).",type:"string",minLength:1}},additionalProperties:!0}}},additionalProperties:!0}});var tg=w((S2,sI)=>{sI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L1/video.schema.json",title:"video.yaml (L1)",description:"Optional pointer to a test's video when it is not stored inline. Present only when a test uses the external form instead of an inline video.<ext> file. Validated only when present (video is optional at L1). See decision 0040.",type:"object",required:["url"],properties:{url:{description:"Location of the video (e.g. an object-store or CDN URL).",type:"string",minLength:1}},additionalProperties:!0}});var rg=w((T2,iI)=>{iI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L1/failure.schema.json",title:"steps/<ordinal>-<id>/failure.yaml (L1)",description:"The structured explanation of why one step did not pass, at tests/<id>/steps/<ordinal>-<id>/failure.yaml \u2014 authored by the framework (or a triage agent). Required core: `step` (anchored to the folder and a result.yaml step), `status` (verdict enum), and evidence-of-what (error.message, or expected+actual). File references resolve relative to the TEST ROOT tests/<id>/ (no '..', no leading '/', no scheme) and are checked for containment and existence by the validator, never parsed \u2014 the schema only requires them to be strings. The optional `triage` block is strictly shaped when present; free-form forensic blocks stay open. See decision 0044.",type:"object",required:["step","status"],anyOf:[{description:"evidence-of-what: an error message\u2026",properties:{error:{type:"object",required:["message"]}},required:["error"]},{description:"\u2026or both expected and actual.",required:["expected","actual"]}],properties:{step:{description:"The step id. MUST equal the containing folder's <id> and match a result.yaml step \u2014 a validator cross-check (l1.failure.unmatched).",type:"string",minLength:1},status:{description:"The step verdict \u2014 same vocabulary as result.yaml (decision 0006). Cross-checked against the matched step; disagreement is an advisory warning (l1.failure.status_disagrees).",enum:["passed","failed","broken","skipped"]},title:{description:"Short defect-style name for the failure, authored by the framework (typically the investigation verdict's bug title). Optional; open string, never cross-checked.",type:"string",minLength:1},expected:{type:"string"},actual:{type:"string"},error:{description:"The error at failure. `type` is an open string; `urls` are external locations (open, never checked).",type:"object",properties:{message:{type:"string",minLength:1},type:{type:"string"},urls:{type:"array",items:{type:"string"}}},additionalProperties:!0},repro:{description:"How to reproduce. `definition`/`resolved` are test-root-relative file references (validator-checked).",type:"object",properties:{definition:{type:"string",minLength:1},resolved:{type:"string",minLength:1}},additionalProperties:!0},locator_context:{description:"Open block \u2014 selector forensics in the framework's own vocabulary.",type:"object",additionalProperties:!0},page_state:{description:"Page state at failure. `url` is an external URL (open); `dom`/`a11y`/`screenshot` are test-root-relative file references (validator-checked).",type:"object",properties:{url:{type:"string"},dom:{type:"string",minLength:1},a11y:{type:"string",minLength:1},screenshot:{type:"string",minLength:1}},additionalProperties:!0},console_at_failure:{description:"`ref` is a test-root-relative file reference (validator-checked); the rest is open.",type:"object",properties:{ref:{type:"string",minLength:1}},additionalProperties:!0},network_at_failure:{description:"`ref` is a test-root-relative file reference (validator-checked); the rest is open.",type:"object",properties:{ref:{type:"string",minLength:1}},additionalProperties:!0},trajectory_refs:{description:"Open \u2014 producer-defined trajectory pointers.",type:"array",items:{type:"string"}},triage:{description:"Optional post-hoc triage. Strictly shaped when present (decision 0044): closed lifecycle enums, required sub-fields, bounded confidence.",type:"object",required:["status"],properties:{status:{description:"Triage lifecycle \u2014 closed enum (snake_case, decision 0036).",enum:["untriaged","triaged","in_progress","dismissed"]},by:{description:"Who/what triaged. `kind` and `id` are open strings; `at` is required when the block is present.",type:"object",required:["at"],properties:{kind:{type:"string"},id:{type:"string"},at:{type:"string",format:"date-time"}},additionalProperties:!0},rca:{description:"Root-cause analysis. `root_cause` is required; `category` is an open string; `evidence` entries are test-root-relative file references (validator-checked).",type:"object",required:["root_cause"],properties:{root_cause:{type:"string",minLength:1},category:{type:"string"},hypothesis:{type:"string"},evidence:{type:"array",items:{type:"string",minLength:1}},confidence:{type:"number",minimum:0,maximum:1}},additionalProperties:!0},suggested_fix:{description:"`patch` is a test-root-relative file reference (validator-checked); `summary`/`target` are open.",type:"object",properties:{summary:{type:"string"},patch:{type:"string",minLength:1},target:{type:"object",additionalProperties:!0}},additionalProperties:!0},verification:{description:"Whether the suggested fix was checked: not yet, confirmed to resolve, or checked and did NOT resolve.",type:"object",required:["status"],properties:{status:{enum:["not_verified","verified","refuted"]}},additionalProperties:!0},linked_defects:{description:"Open strings \u2014 external defect ids.",type:"array",items:{type:"string"}}},additionalProperties:!0}},additionalProperties:!0}});var ng=w((O2,oI)=>{oI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L1/failure-index.schema.json",title:"failure.yaml (L1, pack root)",description:"The run-level failure index at the pack root \u2014 GENERATED by `evidence finalize` from every step-level failure.yaml, never hand-authored. Denormalized rows (test, ordinal, step, status, path, lifted triage_status) so a consumer renders a failure table without opening each record. `path` is pack-root-relative and MUST agree with its own row \u2014 path/row consistency, pointer resolution (dangling), and completeness against the records actually present are validator cross-checks. Always written at finalize: a clean run carries `failures: []`. See decision 0044.",type:"object",required:["failures"],properties:{generated:{description:"When finalize generated this index \u2014 its endedAt timestamp.",type:"string",format:"date-time"},totals:{description:"Informational tallies (open map). finalize writes at least `failures`.",type:"object",additionalProperties:!0},failures:{description:"One row per step-level failure.yaml, sorted by test then ordinal.",type:"array",items:{type:"object",required:["test","ordinal","step","status","path"],properties:{test:{type:"string",minLength:1},ordinal:{type:"integer",minimum:1},step:{type:"string",minLength:1},status:{description:"The step verdict, mirrored from the record.",enum:["passed","failed","broken","skipped"]},path:{description:"Pack-root-relative pointer to the step record: tests/<test>/steps/<ordinal>-<step>/failure.yaml. Row/path agreement is a validator cross-check (l1.failure_index.invalid).",type:"string",minLength:1},triage_status:{description:"Lifted verbatim from the record's triage.status when present.",enum:["untriaged","triaged","in_progress","dismissed"]},title:{description:"Lifted verbatim from the record's title when present.",type:"string",minLength:1}},additionalProperties:!0}}},additionalProperties:!0}});var sg=w((N2,aI)=>{aI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/policy.schema.json",title:"policy.yaml",description:"A verdict policy passed to `evidence verdict` (--policy). TOOL INPUT, not pack contract \u2014 it lives beside the versioned 0.1/ tree and is never written into a pack. A policy is a named list of gates; each gate either compares one metric against a threshold or evaluates a boolean CEL expression. Unknown keys are rejected so a typo'd operator fails loudly. See decisions 0047 and 0049.",type:"object",required:["policy","gates"],properties:{policy:{description:"Policy id, echoed in the verdict and used as the verdict file name (<policy>.verdict.json), so it is file-name safe.",type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},requires:{description:"Optional: refuse packs whose metric catalog is a different producer catalog, or a version outside `version`. A pack without a catalog fails this requirement.",type:"object",required:["catalog"],properties:{catalog:{description:"The catalog id the pack must carry (meta/metrics-catalog.yaml `catalog`).",type:"string",minLength:1},version:{description:'Space-separated comparators over the catalog version, e.g. ">=1", ">=1 <4", "3". Versions compare numerically by dot-separated segment.',type:"string",pattern:"^\\s*(?:(?:>=|<=|>|<|=)?\\s*[0-9]+(?:\\.[0-9]+)*\\s*)+$"}},additionalProperties:!1},gates:{type:"array",minItems:1,items:{$ref:"#/$defs/gate"}}},additionalProperties:!1,$defs:{gate:{description:"One check. A metric gate names a metric and exactly one operator; an expression gate carries `expr` (a CEL expression that must evaluate to a bool) and no operator.",type:"object",required:["id","severity"],properties:{id:{description:"Gate id, unique within the policy.",type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},metric:{description:"A built-in metric (evidence-core, unprefixed, e.g. totals.failed) or a producer metric from the pack's catalog (always metrics.<name>).",type:"string",minLength:1},expr:{description:"A CEL expression over the pack facts that must evaluate to a bool (decision 0049).",type:"string",minLength:1},where:{description:"A CEL expression over one test (`test`) that narrows a per-test metric to the tests it holds for. Only on metric gates whose metric is per_test.",type:"string",minLength:1},equals:{description:"Pass when the metric equals this value.",type:["number","string"]},min:{description:"Pass when the metric is >= this value.",type:"number"},max:{description:"Pass when the metric is <= this value.",type:"number"},range:{description:"Pass when lo <= metric <= hi.",type:"array",prefixItems:[{type:"number"},{type:"number"}],minItems:2,maxItems:2},in:{description:"Pass when the metric is one of these values.",type:"array",minItems:1,items:{type:["number","string"]}},severity:{description:"blocking: a failure fails the verdict. warning: a failure is reported but does not fail it. An errored gate errors the verdict whatever its severity.",enum:["blocking","warning"]},message:{description:"Optional human message, echoed in the gate result.",type:"string"}},additionalProperties:!1,oneOf:[{required:["metric"],not:{required:["expr"]},oneOf:[{required:["equals"]},{required:["min"]},{required:["max"]},{required:["range"]},{required:["in"]}]},{required:["expr"],not:{anyOf:[{required:["metric"]},{required:["where"]},{required:["equals"]},{required:["min"]},{required:["max"]},{required:["range"]},{required:["in"]}]}}]}}}});var ig=w((I2,cI)=>{cI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/metrics-catalog.schema.json",title:"metrics catalog",description:"What each metric name means and how a verdict checks it. One format for the built-in catalog (evidence-core, shipped with evidence-cli) and for every producer catalog. A producer snapshots its catalog into the pack at meta/metrics-catalog.yaml and records it in run.yaml `metrics_catalog`. Producer metrics are reached in a policy as metrics.<name>; built-in names are unprefixed and reserved. See decision 0048.",type:"object",required:["catalog","version","metrics"],properties:{catalog:{description:"Catalog id (e.g. evidence-core, kane-cli).",type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$"},version:{description:"Catalog version: an integer, or a dot-separated numeric string. Compared numerically by segment against a policy's `requires.version`.",anyOf:[{type:"integer",minimum:0},{type:"string",pattern:"^[0-9]+(\\.[0-9]+)*$"}]},min_producer:{description:"Lowest producer version that writes every fact this catalog version reads. Used by the service that hands catalogs out; the verdict ignores it.",type:"string",minLength:1},description:{type:"string"},metrics:{type:"object",propertyNames:{pattern:"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"},additionalProperties:{$ref:"#/$defs/metric"}}},additionalProperties:!1,$defs:{metric:{type:"object",required:["type","verify"],properties:{type:{description:"Fixes the value shape and the operators a gate may use. Integer kinds (count, integer, bytes) and number kinds (ms, currency) take equals/min/max/range/in; fraction kinds (ratio, percentage, decimal) take min/max/range; string kinds (string, enum) take equals/in.",enum:["count","integer","ms","bytes","currency","ratio","percentage","decimal","string","enum"]},unit:{type:"string",minLength:1},label:{type:"string"},description:{type:"string"},range:{description:"Inclusive bounds every value must fall within; a value outside errors the gate.",type:"array",prefixItems:[{type:"number"},{type:"number"}],minItems:2,maxItems:2},values:{description:"The allowed values of an enum metric.",type:"array",minItems:1,items:{type:"string"}},per_test:{description:"true when a gate may narrow the metric to some tests with `where`.",type:"boolean"},verify:{description:"How the verdict obtains the value. `stored` trusts run.yaml.metrics.<name>; `file` reads a dot-path from a YAML/JSON file in the pack; `aggregate` folds a per-test value over tests/*/\u2026; `expr` evaluates CEL over the pack facts.",oneOf:[{const:"stored"},{type:"object",required:["file","path"],properties:{file:{description:"Pack-root-relative .yaml/.yml/.json file, contained in the pack.",type:"string",pattern:"\\.(ya?ml|json)$"},path:{description:"Dot-path into the parsed file.",type:"string",minLength:1}},additionalProperties:!1},{type:"object",required:["aggregate"],properties:{aggregate:{enum:["sum","min","max","mean","count","p50","p90","p95"]},over:{description:"Per-test file the value is read from, as tests/*/<file>. Default tests/*/result.yaml.",type:"string",pattern:"^tests/\\*/[^*]+\\.(ya?ml|json)$"},path:{description:"Dot-path into the per-test file.",type:"string",minLength:1},value:{description:"CEL over `test` and `file` giving the per-test value.",type:"string",minLength:1},where:{description:"A bool CEL expression over `test` and `file`; only tests it holds for are folded. A non-bool result errors the gate.",type:"string",minLength:1}},additionalProperties:!1,not:{required:["path","value"]}},{type:"object",required:["expr"],properties:{expr:{description:"CEL over the pack facts (decision 0049).",type:"string",minLength:1}},additionalProperties:!1}]},merge:{description:"How the metric resolves on a merged pack. sum/min/max/mean combine every source's stored value, each checked for type, unit and range first; recompute re-runs an aggregate/expr over the merged tests; none (the default) errors a gate on it.",enum:["sum","min","max","mean","recompute","none"]},min_producer:{description:"Lowest producer version (semver) that writes the facts this metric reads. The verdict errors a gate on the metric when a test in the pack was written by an older producer.",type:"string",minLength:1}},additionalProperties:!1}}}});var og=w((A2,lI)=>{lI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/verdict.schema.json",title:"<policy>.verdict.json",description:"One policy judged against one evidence pack, as written by `evidence verdict`. A SIDECAR: it is written next to the pack and never into it, so any sealed pack can be judged at any time without changing its bytes. `pack.sha256` ties the verdict to the exact pack file it judged. See decisions 0047 and 0050.",type:"object",required:["result","evaluated_at","evaluator","pack","policy","catalog","error","gates","failed_gates","warnings","errored_gates","exit_code"],properties:{result:{description:"errored when the policy could not be judged as a whole or any gate errored; else fail when any blocking gate failed; else pass.",enum:["pass","fail","errored"]},evaluated_at:{type:"string",format:"date-time"},evaluator:{description:'The tool and version that judged the pack, e.g. "evidence-cli 0.2.0".',type:"string",minLength:1},pack:{type:"object",required:["run_id","sha256","contract"],properties:{run_id:{type:["string","null"]},sha256:{description:"sha256 hex of the sealed .evidence file bytes; null when a live directory was judged.",type:["string","null"],pattern:"^[0-9a-f]{64}$"},contract:{description:"run.yaml `evidence`.",type:["string","null"]}},additionalProperties:!1},policy:{type:"object",required:["id","sha256"],properties:{id:{type:"string",minLength:1},sha256:{description:"sha256 hex of the exact policy YAML bytes.",type:"string",pattern:"^[0-9a-f]{64}$"}},additionalProperties:!1},catalog:{description:"The producer catalog the pack carried, or null when it carried none.",type:["object","null"],required:["id","version","sha256","source"],properties:{id:{type:"string"},version:{type:["integer","string"]},sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},source:{description:"run.yaml metrics_catalog.source as the producer recorded it, or null.",type:["string","null"]}},additionalProperties:!1},error:{description:"Set when the policy as a whole could not be judged (pack not finalized or not valid, a policy problem against this pack's catalog). gates is then empty.",oneOf:[{type:"null"},{$ref:"#/$defs/error"}]},gates:{type:"array",items:{$ref:"#/$defs/gate"}},failed_gates:{description:"Ids of blocking gates that failed.",type:"array",items:{type:"string"}},warnings:{description:"Ids of warning gates that failed.",type:"array",items:{type:"string"}},errored_gates:{type:"array",items:{type:"string"}},exit_code:{description:"0 pass, 1 fail, 3 errored.",enum:[0,1,3]}},additionalProperties:!1,$defs:{error:{type:"object",required:["code","message","hint"],properties:{code:{type:"string",minLength:1},message:{type:"string"},hint:{type:["string","null"]}},additionalProperties:!1},gate:{type:"object",required:["id","where","op","expected","actual","severity","status","trust","message","error","stored"],properties:{id:{type:"string"},metric:{type:"string"},expr:{type:"string"},where:{type:["string","null"]},op:{description:"The comparison; expr for an expression gate.",enum:["equals","min","max","range","in","expr"]},expected:{description:"The threshold as written; true for an expression gate."},actual:{description:"The resolved value, or null when it could not be resolved."},severity:{enum:["blocking","warning"]},status:{description:"warn is a failed warning gate.",enum:["pass","fail","warn","errored"]},trust:{description:"recomputed: derived from the pack's raw files. file: read from a file in the pack. stored: the producer's own number. null when nothing was resolved.",enum:["recomputed","file","stored",null]},message:{type:["string","null"]},error:{oneOf:[{type:"null"},{$ref:"#/$defs/error"}]},stored:{description:"The producer's stored number when it disagreed with the recompute.",type:["number","string","null"]}},oneOf:[{required:["metric"]},{required:["expr"]}],additionalProperties:!1}}}});var ag=w(Lr=>{"use strict";var Bt=Lr&&Lr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.getSchemas=wI;Lr.getL1Schemas=EI;Lr.getToolSchema=SI;var uI=Bt(Xy()),fI=Bt(Qy()),dI=Bt(eg()),pI=Bt(tg()),hI=Bt(rg()),mI=Bt(ng()),yI=Bt(sg()),gI=Bt(ig()),_I=Bt(og()),vI={"0.1":{L0:{run:uI.default,result:fI.default}}},bI={"0.1":{logsMeta:dI.default,video:pI.default,failure:hI.default,failureIndex:mI.default}};function wI(r,e){let t=vI[r];if(!t)throw new Error(`no schemas for contract version ${r}`);let n=t[e];if(!n)throw new Error(`no schemas for profile ${e} at version ${r}`);return n}function EI(r){let e=bI[r];if(!e)throw new Error(`no L1 schemas for contract version ${r}`);return e}var $I={policy:yI.default,"metrics-catalog":gI.default,verdict:_I.default};function SI(r){let e=$I[r];if(!e)throw new Error(`no tool schema "${r}"`);return e}});var Cs=w(Dr=>{"use strict";var fg=Dr&&Dr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.loadSchemas=NI;Dr.loadL1Schemas=II;Dr.loadToolSchema=AI;var TI=fg(uu()),OI=fg(bu()),wu=ag(),cg=new Map,lg=new Map,ug=new Map;function Eu(){let r=new TI.default({allErrors:!0,strict:!1});return(0,OI.default)(r),r}function NI(r,e){let t=`${r}/${e}`,n=cg.get(t);if(n)return n;let{run:s,result:i}=(0,wu.getSchemas)(r,e),o=Eu(),a={run:o.compile(s),result:o.compile(i)};return cg.set(t,a),a}function II(r){let e=lg.get(r);if(e)return e;let{logsMeta:t,video:n,failure:s,failureIndex:i}=(0,wu.getL1Schemas)(r),o=Eu(),a={logsMeta:o.compile(t),video:o.compile(n),failure:o.compile(s),failureIndex:o.compile(i)};return lg.set(r,a),a}function AI(r){let e=ug.get(r);if(e)return e;let t=Eu().compile((0,wu.getToolSchema)(r));return ug.set(r,t),t}});var H=w(Ee=>{"use strict";var $u=Symbol.for("yaml.alias"),dg=Symbol.for("yaml.document"),mo=Symbol.for("yaml.map"),pg=Symbol.for("yaml.pair"),Su=Symbol.for("yaml.scalar"),yo=Symbol.for("yaml.seq"),Vt=Symbol.for("yaml.node.type"),PI=r=>!!r&&typeof r=="object"&&r[Vt]===$u,kI=r=>!!r&&typeof r=="object"&&r[Vt]===dg,CI=r=>!!r&&typeof r=="object"&&r[Vt]===mo,LI=r=>!!r&&typeof r=="object"&&r[Vt]===pg,hg=r=>!!r&&typeof r=="object"&&r[Vt]===Su,DI=r=>!!r&&typeof r=="object"&&r[Vt]===yo;function mg(r){if(r&&typeof r=="object")switch(r[Vt]){case mo:case yo:return!0}return!1}function qI(r){if(r&&typeof r=="object")switch(r[Vt]){case $u:case mo:case Su:case yo:return!0}return!1}var MI=r=>(hg(r)||mg(r))&&!!r.anchor;Ee.ALIAS=$u;Ee.DOC=dg;Ee.MAP=mo;Ee.NODE_TYPE=Vt;Ee.PAIR=pg;Ee.SCALAR=Su;Ee.SEQ=yo;Ee.hasAnchor=MI;Ee.isAlias=PI;Ee.isCollection=mg;Ee.isDocument=kI;Ee.isMap=CI;Ee.isNode=qI;Ee.isPair=LI;Ee.isScalar=hg;Ee.isSeq=DI});var Ls=w(Tu=>{"use strict";var ye=H(),Ue=Symbol("break visit"),yg=Symbol("skip children"),It=Symbol("remove node");function go(r,e){let t=gg(e);ye.isDocument(r)?$n(null,r.contents,t,Object.freeze([r]))===It&&(r.contents=null):$n(null,r,t,Object.freeze([]))}go.BREAK=Ue;go.SKIP=yg;go.REMOVE=It;function $n(r,e,t,n){let s=_g(r,e,t,n);if(ye.isNode(s)||ye.isPair(s))return vg(r,n,s),$n(r,s,t,n);if(typeof s!="symbol"){if(ye.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let o=$n(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===Ue)return Ue;o===It&&(e.items.splice(i,1),i-=1)}}}else if(ye.isPair(e)){n=Object.freeze(n.concat(e));let i=$n("key",e.key,t,n);if(i===Ue)return Ue;i===It&&(e.key=null);let o=$n("value",e.value,t,n);if(o===Ue)return Ue;o===It&&(e.value=null)}}return s}async function _o(r,e){let t=gg(e);ye.isDocument(r)?await Sn(null,r.contents,t,Object.freeze([r]))===It&&(r.contents=null):await Sn(null,r,t,Object.freeze([]))}_o.BREAK=Ue;_o.SKIP=yg;_o.REMOVE=It;async function Sn(r,e,t,n){let s=await _g(r,e,t,n);if(ye.isNode(s)||ye.isPair(s))return vg(r,n,s),Sn(r,s,t,n);if(typeof s!="symbol"){if(ye.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let o=await Sn(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===Ue)return Ue;o===It&&(e.items.splice(i,1),i-=1)}}}else if(ye.isPair(e)){n=Object.freeze(n.concat(e));let i=await Sn("key",e.key,t,n);if(i===Ue)return Ue;i===It&&(e.key=null);let o=await Sn("value",e.value,t,n);if(o===Ue)return Ue;o===It&&(e.value=null)}}return s}function gg(r){return typeof r=="object"&&(r.Collection||r.Node||r.Value)?Object.assign({Alias:r.Node,Map:r.Node,Scalar:r.Node,Seq:r.Node},r.Value&&{Map:r.Value,Scalar:r.Value,Seq:r.Value},r.Collection&&{Map:r.Collection,Seq:r.Collection},r):r}function _g(r,e,t,n){if(typeof t=="function")return t(r,e,n);if(ye.isMap(e))return t.Map?.(r,e,n);if(ye.isSeq(e))return t.Seq?.(r,e,n);if(ye.isPair(e))return t.Pair?.(r,e,n);if(ye.isScalar(e))return t.Scalar?.(r,e,n);if(ye.isAlias(e))return t.Alias?.(r,e,n)}function vg(r,e,t){let n=e[e.length-1];if(ye.isCollection(n))n.items[r]=t;else if(ye.isPair(n))r==="key"?n.key=t:n.value=t;else if(ye.isDocument(n))n.contents=t;else{let s=ye.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}Tu.visit=go;Tu.visitAsync=_o});var Ou=w(wg=>{"use strict";var bg=H(),jI=Ls(),RI={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},xI=r=>r.replace(/[!,[\]{}]/g,e=>RI[e]),Ds=class r{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},r.defaultYaml,e),this.tags=Object.assign({},r.defaultTags,t)}clone(){let e=new r(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},r.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},r.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),s=n.shift();switch(s){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[i,o]=n;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=n;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(s)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+xI(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),s;if(e&&n.length>0&&bg.isNode(e.contents)){let i={};jI.visit(e.contents,(o,a)=>{bg.isNode(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of n)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&t.push(`%TAG ${i} ${o}`);return t.join(`
|
|
10
|
-
`)}};Ds.defaultYaml={explicit:!1,version:"1.2"};Ds.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
9
|
+
deps: ${t}}`};var y1={keyword:"dependencies",type:"object",schemaType:"object",error:Tt.error,code(r){let[e,t]=g1(r);Mm(r,e),jm(r,t)}};function g1({schema:r}){let e={},t={};for(let n in r){if(n==="__proto__")continue;let s=Array.isArray(r[n])?e:t;s[n]=r[n]}return[e,t]}function Mm(r,e=r.schema){let{gen:t,data:n,it:s}=r;if(Object.keys(e).length===0)return;let i=t.let("missing");for(let o in e){let a=e[o];if(a.length===0)continue;let c=(0,Is.propertyInData)(t,n,o,s.opts.ownProperties);r.setParams({property:o,depsCount:a.length,deps:a.join(", ")}),s.allErrors?t.if(c,()=>{for(let l of a)(0,Is.checkReportMissingProp)(r,l)}):(t.if((0,Tl._)`${c} && (${(0,Is.checkMissingProp)(r,a,i)})`),(0,Is.reportMissingProp)(r,i),t.else())}}Tt.validatePropertyDeps=Mm;function jm(r,e=r.schema){let{gen:t,data:n,keyword:s,it:i}=r,o=t.name("valid");for(let a in e)(0,m1.alwaysValidSchema)(i,e[a])||(t.if((0,Is.propertyInData)(t,n,a,i.opts.ownProperties),()=>{let c=r.subschema({keyword:s,schemaProp:a},o);r.mergeValidEvaluated(c,o)},()=>t.var(o,!0)),r.ok(o))}Tt.validateSchemaDeps=jm;Tt.default=y1});var xm=w(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});var Rm=q(),_1=U(),v1={message:"property name must be valid",params:({params:r})=>(0,Rm._)`{propertyName: ${r.propertyName}}`},b1={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:v1,code(r){let{gen:e,schema:t,data:n,it:s}=r;if((0,_1.alwaysValidSchema)(s,t))return;let i=e.name("valid");e.forIn("key",n,o=>{r.setParams({propertyName:o}),r.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),e.if((0,Rm.not)(i),()=>{r.error(!0),s.allErrors||e.break()})}),r.ok(i)}};Ol.default=b1});var Il=w(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});var oo=tt(),ut=q(),w1=et(),ao=U(),E1={message:"must NOT have additional properties",params:({params:r})=>(0,ut._)`{additionalProperty: ${r.additionalProperty}}`},$1={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:E1,code(r){let{gen:e,schema:t,parentSchema:n,data:s,errsCount:i,it:o}=r;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,ao.alwaysValidSchema)(o,t))return;let l=(0,oo.allSchemaProperties)(n.properties),h=(0,oo.allSchemaProperties)(n.patternProperties);f(),r.ok((0,ut._)`${i} === ${w1.default.errors}`);function f(){e.forIn("key",s,m=>{!l.length&&!h.length?y(m):e.if(d(m),()=>y(m))})}function d(m){let _;if(l.length>8){let v=(0,ao.schemaRefOrVal)(o,n.properties,"properties");_=(0,oo.isOwnProperty)(e,v,m)}else l.length?_=(0,ut.or)(...l.map(v=>(0,ut._)`${m} === ${v}`)):_=ut.nil;return h.length&&(_=(0,ut.or)(_,...h.map(v=>(0,ut._)`${(0,oo.usePattern)(r,v)}.test(${m})`))),(0,ut.not)(_)}function p(m){e.code((0,ut._)`delete ${s}[${m}]`)}function y(m){if(c.removeAdditional==="all"||c.removeAdditional&&t===!1){p(m);return}if(t===!1){r.setParams({additionalProperty:m}),r.error(),a||e.break();return}if(typeof t=="object"&&!(0,ao.alwaysValidSchema)(o,t)){let _=e.name("valid");c.removeAdditional==="failing"?(u(m,_,!1),e.if((0,ut.not)(_),()=>{r.reset(),p(m)})):(u(m,_),a||e.if((0,ut.not)(_),()=>e.break()))}}function u(m,_,v){let g={keyword:"additionalProperties",dataProp:m,dataPropType:ao.Type.Str};v===!1&&Object.assign(g,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(g,_)}}};Nl.default=$1});var Bm=w(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var S1=cn(),Fm=tt(),Al=U(),Um=Il(),T1={keyword:"properties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,parentSchema:n,data:s,it:i}=r;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Um.default.code(new S1.KeywordCxt(i,Um.default,"additionalProperties"));let o=(0,Fm.allSchemaProperties)(t);for(let f of o)i.definedProperties.add(f);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=Al.mergeEvaluated.props(e,(0,Al.toHash)(o),i.props));let a=o.filter(f=>!(0,Al.alwaysValidSchema)(i,t[f]));if(a.length===0)return;let c=e.name("valid");for(let f of a)l(f)?h(f):(e.if((0,Fm.propertyInData)(e,s,f,i.opts.ownProperties)),h(f),i.allErrors||e.else().var(c,!0),e.endIf()),r.it.definedProperties.add(f),r.ok(c);function l(f){return i.opts.useDefaults&&!i.compositeRule&&t[f].default!==void 0}function h(f){r.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};Pl.default=T1});var Hm=w(kl=>{"use strict";Object.defineProperty(kl,"__esModule",{value:!0});var Vm=tt(),co=q(),zm=U(),Km=U(),O1={keyword:"patternProperties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,data:n,parentSchema:s,it:i}=r,{opts:o}=i,a=(0,Vm.allSchemaProperties)(t),c=a.filter(u=>(0,zm.alwaysValidSchema)(i,t[u]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;let l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,h=e.name("valid");i.props!==!0&&!(i.props instanceof co.Name)&&(i.props=(0,Km.evaluatedPropsToName)(e,i.props));let{props:f}=i;d();function d(){for(let u of a)l&&p(u),i.allErrors?y(u):(e.var(h,!0),y(u),e.if(h))}function p(u){for(let m in l)new RegExp(u).test(m)&&(0,zm.checkStrictMode)(i,`property ${m} matches pattern ${u} (use allowMatchingProperties)`)}function y(u){e.forIn("key",n,m=>{e.if((0,co._)`${(0,Vm.usePattern)(r,u)}.test(${m})`,()=>{let _=c.includes(u);_||r.subschema({keyword:"patternProperties",schemaProp:u,dataProp:m,dataPropType:Km.Type.Str},h),i.opts.unevaluated&&f!==!0?e.assign((0,co._)`${f}[${m}]`,!0):!_&&!i.allErrors&&e.if((0,co.not)(h),()=>e.break())})})}}};kl.default=O1});var Gm=w(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});var N1=U(),I1={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:n}=r;if((0,N1.alwaysValidSchema)(n,t)){r.fail();return}let s=e.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),r.failResult(s,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};Cl.default=I1});var Ym=w(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var A1=tt(),P1={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:A1.validateUnion,error:{message:"must match a schema in anyOf"}};Ll.default=P1});var Zm=w(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});var lo=q(),k1=U(),C1={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,lo._)`{passingSchemas: ${r.passing}}`},L1={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:C1,code(r){let{gen:e,schema:t,parentSchema:n,it:s}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let i=t,o=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");r.setParams({passing:a}),e.block(l),r.result(o,()=>r.reset(),()=>r.error(!0));function l(){i.forEach((h,f)=>{let d;(0,k1.alwaysValidSchema)(s,h)?e.var(c,!0):d=r.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c),f>0&&e.if((0,lo._)`${c} && ${o}`).assign(o,!1).assign(a,(0,lo._)`[${a}, ${f}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(a,f),d&&r.mergeEvaluated(d,lo.Name)})})}}};Dl.default=L1});var Jm=w(ql=>{"use strict";Object.defineProperty(ql,"__esModule",{value:!0});var D1=U(),q1={keyword:"allOf",schemaType:"array",code(r){let{gen:e,schema:t,it:n}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");let s=e.name("valid");t.forEach((i,o)=>{if((0,D1.alwaysValidSchema)(n,i))return;let a=r.subschema({keyword:"allOf",schemaProp:o},s);r.ok(s),r.mergeEvaluated(a)})}};ql.default=q1});var Qm=w(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var uo=q(),Xm=U(),M1={message:({params:r})=>(0,uo.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,uo._)`{failingKeyword: ${r.ifClause}}`},j1={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:M1,code(r){let{gen:e,parentSchema:t,it:n}=r;t.then===void 0&&t.else===void 0&&(0,Xm.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let s=Wm(n,"then"),i=Wm(n,"else");if(!s&&!i)return;let o=e.let("valid",!0),a=e.name("_valid");if(c(),r.reset(),s&&i){let h=e.let("ifClause");r.setParams({ifClause:h}),e.if(a,l("then",h),l("else",h))}else s?e.if(a,l("then")):e.if((0,uo.not)(a),l("else"));r.pass(o,()=>r.error(!0));function c(){let h=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);r.mergeEvaluated(h)}function l(h,f){return()=>{let d=r.subschema({keyword:h},a);e.assign(o,a),r.mergeValidEvaluated(d,o),f?e.assign(f,(0,uo._)`${h}`):r.setParams({ifClause:h})}}}};function Wm(r,e){let t=r.schema[e];return t!==void 0&&!(0,Xm.alwaysValidSchema)(r,t)}Ml.default=j1});var ey=w(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});var R1=U(),x1={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,R1.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};jl.default=x1});var xl=w(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});var F1=bl(),U1=Cm(),B1=wl(),V1=Dm(),z1=qm(),K1=io(),H1=xm(),G1=Il(),Y1=Bm(),Z1=Hm(),J1=Gm(),W1=Ym(),X1=Zm(),Q1=Jm(),eO=Qm(),tO=ey();function rO(r=!1){let e=[J1.default,W1.default,X1.default,Q1.default,eO.default,tO.default,H1.default,G1.default,K1.default,Y1.default,Z1.default];return r?e.push(U1.default,V1.default):e.push(F1.default,B1.default),e.push(z1.default),e}Rl.default=rO});var Ul=w(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.dynamicAnchor=void 0;var Fl=q(),nO=et(),ty=ms(),sO=Qi(),iO={keyword:"$dynamicAnchor",schemaType:"string",code:r=>ry(r,r.schema)};function ry(r,e){let{gen:t,it:n}=r;n.schemaEnv.root.dynamicAnchors[e]=!0;let s=(0,Fl._)`${nO.default.dynamicAnchors}${(0,Fl.getProperty)(e)}`,i=n.errSchemaPath==="#"?n.validateName:oO(r);t.if((0,Fl._)`!${s}`,()=>t.assign(s,i))}As.dynamicAnchor=ry;function oO(r){let{schemaEnv:e,schema:t,self:n}=r.it,{root:s,baseId:i,localRefs:o,meta:a}=e.root,{schemaId:c}=n.opts,l=new ty.SchemaEnv({schema:t,schemaId:c,root:s,baseId:i,localRefs:o,meta:a});return ty.compileSchema.call(n,l),(0,sO.getValidate)(r,l)}As.default=iO});var Bl=w(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.dynamicRef=void 0;var ny=q(),aO=et(),sy=Qi(),cO={keyword:"$dynamicRef",schemaType:"string",code:r=>iy(r,r.schema)};function iy(r,e){let{gen:t,keyword:n,it:s}=r;if(e[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let i=e.slice(1);if(s.allErrors)o();else{let c=t.let("valid",!1);o(c),r.ok(c)}function o(c){if(s.schemaEnv.root.dynamicAnchors[i]){let l=t.let("_v",(0,ny._)`${aO.default.dynamicAnchors}${(0,ny.getProperty)(i)}`);t.if(l,a(l,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,l){return l?()=>t.block(()=>{(0,sy.callRef)(r,c),t.let(l,!0)}):()=>(0,sy.callRef)(r,c)}}Ps.dynamicRef=iy;Ps.default=cO});var oy=w(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var lO=Ul(),uO=U(),fO={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,lO.dynamicAnchor)(r,""):(0,uO.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};Vl.default=fO});var ay=w(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});var dO=Bl(),pO={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,dO.dynamicRef)(r,r.schema)};zl.default=pO});var cy=w(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});var hO=Ul(),mO=Bl(),yO=oy(),gO=ay(),_O=[hO.default,mO.default,yO.default,gO.default];Kl.default=_O});var uy=w(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var ly=io(),vO={keyword:"dependentRequired",type:"object",schemaType:"object",error:ly.error,code:r=>(0,ly.validatePropertyDeps)(r)};Hl.default=vO});var fy=w(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var bO=io(),wO={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,bO.validateSchemaDeps)(r)};Gl.default=wO});var dy=w(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});var EO=U(),$O={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:e,it:t}){e.contains===void 0&&(0,EO.checkStrictMode)(t,`"${r}" without "contains" is ignored`)}};Yl.default=$O});var py=w(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});var SO=uy(),TO=fy(),OO=dy(),NO=[SO.default,TO.default,OO.default];Zl.default=NO});var my=w(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var sr=q(),hy=U(),IO=et(),AO={message:"must NOT have unevaluated properties",params:({params:r})=>(0,sr._)`{unevaluatedProperty: ${r.unevaluatedProperty}}`},PO={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:AO,code(r){let{gen:e,schema:t,data:n,errsCount:s,it:i}=r;if(!s)throw new Error("ajv implementation error");let{allErrors:o,props:a}=i;a instanceof sr.Name?e.if((0,sr._)`${a} !== true`,()=>e.forIn("key",n,f=>e.if(l(a,f),()=>c(f)))):a!==!0&&e.forIn("key",n,f=>a===void 0?c(f):e.if(h(a,f),()=>c(f))),i.props=!0,r.ok((0,sr._)`${s} === ${IO.default.errors}`);function c(f){if(t===!1){r.setParams({unevaluatedProperty:f}),r.error(),o||e.break();return}if(!(0,hy.alwaysValidSchema)(i,t)){let d=e.name("valid");r.subschema({keyword:"unevaluatedProperties",dataProp:f,dataPropType:hy.Type.Str},d),o||e.if((0,sr.not)(d),()=>e.break())}}function l(f,d){return(0,sr._)`!${f} || !${f}[${d}]`}function h(f,d){let p=[];for(let y in f)f[y]===!0&&p.push((0,sr._)`${d} !== ${y}`);return(0,sr.and)(...p)}}};Jl.default=PO});var gy=w(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var Cr=q(),yy=U(),kO={message:({params:{len:r}})=>(0,Cr.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Cr._)`{limit: ${r}}`},CO={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:kO,code(r){let{gen:e,schema:t,data:n,it:s}=r,i=s.items||0;if(i===!0)return;let o=e.const("len",(0,Cr._)`${n}.length`);if(t===!1)r.setParams({len:i}),r.fail((0,Cr._)`${o} > ${i}`);else if(typeof t=="object"&&!(0,yy.alwaysValidSchema)(s,t)){let c=e.var("valid",(0,Cr._)`${o} <= ${i}`);e.if((0,Cr.not)(c),()=>a(c,i)),r.ok(c)}s.items=!0;function a(c,l){e.forRange("i",l,o,h=>{r.subschema({keyword:"unevaluatedItems",dataProp:h,dataPropType:yy.Type.Num},c),s.allErrors||e.if((0,Cr.not)(c),()=>e.break())})}}};Wl.default=CO});var _y=w(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var LO=my(),DO=gy(),qO=[LO.default,DO.default];Xl.default=qO});var vy=w(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});var pe=q(),MO={message:({schemaCode:r})=>(0,pe.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,pe._)`{format: ${r}}`},jO={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:MO,code(r,e){let{gen:t,data:n,$data:s,schema:i,schemaCode:o,it:a}=r,{opts:c,errSchemaPath:l,schemaEnv:h,self:f}=a;if(!c.validateFormats)return;s?d():p();function d(){let y=t.scopeValue("formats",{ref:f.formats,code:c.code.formats}),u=t.const("fDef",(0,pe._)`${y}[${o}]`),m=t.let("fType"),_=t.let("format");t.if((0,pe._)`typeof ${u} == "object" && !(${u} instanceof RegExp)`,()=>t.assign(m,(0,pe._)`${u}.type || "string"`).assign(_,(0,pe._)`${u}.validate`),()=>t.assign(m,(0,pe._)`"string"`).assign(_,u)),r.fail$data((0,pe.or)(v(),g()));function v(){return c.strictSchema===!1?pe.nil:(0,pe._)`${o} && !${_}`}function g(){let b=h.$async?(0,pe._)`(${u}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,pe._)`${_}(${n})`,E=(0,pe._)`(typeof ${_} == "function" ? ${b} : ${_}.test(${n}))`;return(0,pe._)`${_} && ${_} !== true && ${m} === ${e} && !${E}`}}function p(){let y=f.formats[i];if(!y){v();return}if(y===!0)return;let[u,m,_]=g(y);u===e&&r.pass(b());function v(){if(c.strictSchema===!1){f.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function g(E){let $=E instanceof RegExp?(0,pe.regexpCode)(E):c.code.formats?(0,pe._)`${c.code.formats}${(0,pe.getProperty)(i)}`:void 0,S=t.scopeValue("formats",{key:i,ref:E,code:$});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,pe._)`${S}.validate`]:["string",E,S]}function b(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!h.$async)throw new Error("async format in sync schema");return(0,pe._)`await ${_}(${n})`}return typeof m=="function"?(0,pe._)`${_}(${n})`:(0,pe._)`${_}.test(${n})`}}}};Ql.default=jO});var tu=w(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});var RO=vy(),xO=[RO.default];eu.default=xO});var ru=w(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.contentVocabulary=mn.metadataVocabulary=void 0;mn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];mn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var wy=w(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});var FO=rl(),UO=_l(),BO=xl(),VO=cy(),zO=py(),KO=_y(),HO=tu(),by=ru(),GO=[VO.default,FO.default,UO.default,(0,BO.default)(!0),HO.default,by.metadataVocabulary,by.contentVocabulary,zO.default,KO.default];nu.default=GO});var $y=w(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.DiscrError=void 0;var Ey;(function(r){r.Tag="tag",r.Mapping="mapping"})(Ey||(fo.DiscrError=Ey={}))});var ou=w(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});var yn=q(),su=$y(),Sy=ms(),YO=ln(),ZO=U(),JO={message:({params:{discrError:r,tagName:e}})=>r===su.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:r,tag:e,tagName:t}})=>(0,yn._)`{error: ${r}, tag: ${t}, tagValue: ${e}}`},WO={keyword:"discriminator",type:"object",schemaType:"object",error:JO,code(r){let{gen:e,data:t,schema:n,parentSchema:s,it:i}=r,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),l=e.const("tag",(0,yn._)`${t}${(0,yn.getProperty)(a)}`);e.if((0,yn._)`typeof ${l} == "string"`,()=>h(),()=>r.error(!1,{discrError:su.DiscrError.Tag,tag:l,tagName:a})),r.ok(c);function h(){let p=d();e.if(!1);for(let y in p)e.elseIf((0,yn._)`${l} === ${y}`),e.assign(c,f(p[y]));e.else(),r.error(!1,{discrError:su.DiscrError.Mapping,tag:l,tagName:a}),e.endIf()}function f(p){let y=e.name("valid"),u=r.subschema({keyword:"oneOf",schemaProp:p},y);return r.mergeEvaluated(u,yn.Name),y}function d(){var p;let y={},u=_(s),m=!0;for(let b=0;b<o.length;b++){let E=o[b];if(E?.$ref&&!(0,ZO.schemaHasRulesButRef)(E,i.self.RULES)){let S=E.$ref;if(E=Sy.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,S),E instanceof Sy.SchemaEnv&&(E=E.schema),E===void 0)throw new YO.default(i.opts.uriResolver,i.baseId,S)}let $=(p=E?.properties)===null||p===void 0?void 0:p[a];if(typeof $!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);m=m&&(u||_(E)),v($,b)}if(!m)throw new Error(`discriminator: "${a}" must be required`);return y;function _({required:b}){return Array.isArray(b)&&b.includes(a)}function v(b,E){if(b.const)g(b.const,E);else if(b.enum)for(let $ of b.enum)g($,E);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function g(b,E){if(typeof b!="string"||b in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[b]=E}}}};iu.default=WO});var Ty=w((a2,XO)=>{XO.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Oy=w((c2,QO)=>{QO.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Ny=w((l2,eN)=>{eN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Iy=w((u2,tN)=>{tN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var Ay=w((f2,rN)=>{rN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var Py=w((d2,nN)=>{nN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var ky=w((p2,sN)=>{sN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var Cy=w((h2,iN)=>{iN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var Ly=w(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});var oN=Ty(),aN=Oy(),cN=Ny(),lN=Iy(),uN=Ay(),fN=Py(),dN=ky(),pN=Cy(),hN=["/properties"];function mN(r){return[oN,aN,cN,lN,uN,e(this,fN),dN,e(this,pN)].forEach(t=>this.addMetaSchema(t,void 0,!1)),this;function e(t,n){return r?t.$dataMetaSchema(n,hN):n}}au.default=mN});var uu=w((se,lu)=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.MissingRefError=se.ValidationError=se.CodeGen=se.Name=se.nil=se.stringify=se.str=se._=se.KeywordCxt=se.Ajv2020=void 0;var yN=Qc(),gN=wy(),_N=ou(),vN=Ly(),cu="https://json-schema.org/draft/2020-12/schema",gn=class extends yN.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),gN.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(_N.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(vN.default.call(this,e),this.refs["http://json-schema.org/schema"]=cu)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(cu)?cu:void 0)}};se.Ajv2020=gn;lu.exports=se=gn;lu.exports.Ajv2020=gn;Object.defineProperty(se,"__esModule",{value:!0});se.default=gn;var bN=cn();Object.defineProperty(se,"KeywordCxt",{enumerable:!0,get:function(){return bN.KeywordCxt}});var _n=q();Object.defineProperty(se,"_",{enumerable:!0,get:function(){return _n._}});Object.defineProperty(se,"str",{enumerable:!0,get:function(){return _n.str}});Object.defineProperty(se,"stringify",{enumerable:!0,get:function(){return _n.stringify}});Object.defineProperty(se,"nil",{enumerable:!0,get:function(){return _n.nil}});Object.defineProperty(se,"Name",{enumerable:!0,get:function(){return _n.Name}});Object.defineProperty(se,"CodeGen",{enumerable:!0,get:function(){return _n.CodeGen}});var wN=hs();Object.defineProperty(se,"ValidationError",{enumerable:!0,get:function(){return wN.default}});var EN=ln();Object.defineProperty(se,"MissingRefError",{enumerable:!0,get:function(){return EN.default}})});var Uy=w(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.formatNames=Nt.fastFormats=Nt.fullFormats=void 0;function Ot(r,e){return{validate:r,compare:e}}Nt.fullFormats={date:Ot(jy,hu),time:Ot(du(!0),mu),"date-time":Ot(Dy(!0),xy),"iso-time":Ot(du(),Ry),"iso-date-time":Ot(Dy(),Fy),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:IN,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:qN,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:AN,int32:{type:"number",validate:CN},int64:{type:"number",validate:LN},float:{type:"number",validate:My},double:{type:"number",validate:My},password:!0,binary:!0};Nt.fastFormats={...Nt.fullFormats,date:Ot(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,hu),time:Ot(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,mu),"date-time":Ot(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,xy),"iso-time":Ot(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Ry),"iso-date-time":Ot(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Fy),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Nt.formatNames=Object.keys(Nt.fullFormats);function $N(r){return r%4===0&&(r%100!==0||r%400===0)}var SN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,TN=[0,31,28,31,30,31,30,31,31,30,31,30,31];function jy(r){let e=SN.exec(r);if(!e)return!1;let t=+e[1],n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&$N(t)?29:TN[n])}function hu(r,e){if(r&&e)return r>e?1:r<e?-1:0}var fu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function du(r){return function(t){let n=fu.exec(t);if(!n)return!1;let s=+n[1],i=+n[2],o=+n[3],a=n[4],c=n[5]==="-"?-1:1,l=+(n[6]||0),h=+(n[7]||0);if(l>23||h>59||r&&!a)return!1;if(s<=23&&i<=59&&o<60)return!0;let f=i-h*c,d=s-l*c-(f<0?1:0);return(d===23||d===-1)&&(f===59||f===-1)&&o<61}}function mu(r,e){if(!(r&&e))return;let t=new Date("2020-01-01T"+r).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(t&&n)return t-n}function Ry(r,e){if(!(r&&e))return;let t=fu.exec(r),n=fu.exec(e);if(t&&n)return r=t[1]+t[2]+t[3],e=n[1]+n[2]+n[3],r>e?1:r<e?-1:0}var pu=/t|\s/i;function Dy(r){let e=du(r);return function(n){let s=n.split(pu);return s.length===2&&jy(s[0])&&e(s[1])}}function xy(r,e){if(!(r&&e))return;let t=new Date(r).valueOf(),n=new Date(e).valueOf();if(t&&n)return t-n}function Fy(r,e){if(!(r&&e))return;let[t,n]=r.split(pu),[s,i]=e.split(pu),o=hu(t,s);if(o!==void 0)return o||mu(n,i)}var ON=/\/|:/,NN=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function IN(r){return ON.test(r)&&NN.test(r)}var qy=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function AN(r){return qy.lastIndex=0,qy.test(r)}var PN=-(2**31),kN=2**31-1;function CN(r){return Number.isInteger(r)&&r<=kN&&r>=PN}function LN(r){return Number.isInteger(r)}function My(){return!0}var DN=/[^\\]\\Z/;function qN(r){if(DN.test(r))return!1;try{return new RegExp(r),!0}catch{return!1}}});var Vy=w(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});var MN=rl(),jN=_l(),RN=xl(),xN=tu(),By=ru(),FN=[MN.default,jN.default,(0,RN.default)(),xN.default,By.metadataVocabulary,By.contentVocabulary];yu.default=FN});var zy=w((_2,UN)=>{UN.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Hy=w((ie,gu)=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.MissingRefError=ie.ValidationError=ie.CodeGen=ie.Name=ie.nil=ie.stringify=ie.str=ie._=ie.KeywordCxt=ie.Ajv=void 0;var BN=Qc(),VN=Vy(),zN=ou(),Ky=zy(),KN=["/properties"],po="http://json-schema.org/draft-07/schema",vn=class extends BN.default{_addVocabularies(){super._addVocabularies(),VN.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(zN.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Ky,KN):Ky;this.addMetaSchema(e,po,!1),this.refs["http://json-schema.org/schema"]=po}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(po)?po:void 0)}};ie.Ajv=vn;gu.exports=ie=vn;gu.exports.Ajv=vn;Object.defineProperty(ie,"__esModule",{value:!0});ie.default=vn;var HN=cn();Object.defineProperty(ie,"KeywordCxt",{enumerable:!0,get:function(){return HN.KeywordCxt}});var bn=q();Object.defineProperty(ie,"_",{enumerable:!0,get:function(){return bn._}});Object.defineProperty(ie,"str",{enumerable:!0,get:function(){return bn.str}});Object.defineProperty(ie,"stringify",{enumerable:!0,get:function(){return bn.stringify}});Object.defineProperty(ie,"nil",{enumerable:!0,get:function(){return bn.nil}});Object.defineProperty(ie,"Name",{enumerable:!0,get:function(){return bn.Name}});Object.defineProperty(ie,"CodeGen",{enumerable:!0,get:function(){return bn.CodeGen}});var GN=hs();Object.defineProperty(ie,"ValidationError",{enumerable:!0,get:function(){return GN.default}});var YN=ln();Object.defineProperty(ie,"MissingRefError",{enumerable:!0,get:function(){return YN.default}})});var Gy=w(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.formatLimitDefinition=void 0;var ZN=Hy(),ft=q(),ir=ft.operators,ho={formatMaximum:{okStr:"<=",ok:ir.LTE,fail:ir.GT},formatMinimum:{okStr:">=",ok:ir.GTE,fail:ir.LT},formatExclusiveMaximum:{okStr:"<",ok:ir.LT,fail:ir.GTE},formatExclusiveMinimum:{okStr:">",ok:ir.GT,fail:ir.LTE}},JN={message:({keyword:r,schemaCode:e})=>(0,ft.str)`should be ${ho[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,ft._)`{comparison: ${ho[r].okStr}, limit: ${e}}`};wn.formatLimitDefinition={keyword:Object.keys(ho),type:"string",schemaType:"string",$data:!0,error:JN,code(r){let{gen:e,data:t,schemaCode:n,keyword:s,it:i}=r,{opts:o,self:a}=i;if(!o.validateFormats)return;let c=new ZN.KeywordCxt(i,a.RULES.all.format.definition,"format");c.$data?l():h();function l(){let d=e.scopeValue("formats",{ref:a.formats,code:o.code.formats}),p=e.const("fmt",(0,ft._)`${d}[${c.schemaCode}]`);r.fail$data((0,ft.or)((0,ft._)`typeof ${p} != "object"`,(0,ft._)`${p} instanceof RegExp`,(0,ft._)`typeof ${p}.compare != "function"`,f(p)))}function h(){let d=c.schema,p=a.formats[d];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${s}": format "${d}" does not define "compare" function`);let y=e.scopeValue("formats",{key:d,ref:p,code:o.code.formats?(0,ft._)`${o.code.formats}${(0,ft.getProperty)(d)}`:void 0});r.fail$data(f(y))}function f(d){return(0,ft._)`${d}.compare(${t}, ${n}) ${ho[s].fail} 0`}},dependencies:["format"]};var WN=r=>(r.addKeyword(wn.formatLimitDefinition),r);wn.default=WN});var bu=w((ks,Jy)=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});var En=Uy(),XN=Gy(),_u=q(),Yy=new _u.Name("fullFormats"),QN=new _u.Name("fastFormats"),vu=(r,e={keywords:!0})=>{if(Array.isArray(e))return Zy(r,e,En.fullFormats,Yy),r;let[t,n]=e.mode==="fast"?[En.fastFormats,QN]:[En.fullFormats,Yy],s=e.formats||En.formatNames;return Zy(r,s,t,n),e.keywords&&(0,XN.default)(r),r};vu.get=(r,e="full")=>{let n=(e==="fast"?En.fastFormats:En.fullFormats)[r];if(!n)throw new Error(`Unknown format "${r}"`);return n};function Zy(r,e,t,n){var s,i;(s=(i=r.opts.code).formats)!==null&&s!==void 0||(i.formats=(0,_u._)`require("ajv-formats/dist/formats").${n}`);for(let o of e)r.addFormat(o,t[o])}Jy.exports=ks=vu;Object.defineProperty(ks,"__esModule",{value:!0});ks.default=vu});var Wy=w((b2,eI)=>{eI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L0/run.schema.json",title:"run.yaml (L0)",description:"Run-level manifest for an .evidence pack. Its presence at the top of a pack is what identifies the pack (the manifest anchor). One pack = one run. evidence-cli is framework-agnostic: nothing here is specific to any test framework.",type:"object",required:["evidence","run_id","status","started","title"],properties:{evidence:{description:"Evidence CONTRACT version this pack conforms to. One contract version spans all profiles (L0\u2013L3); adding a profile is additive and does NOT change it \u2014 only a breaking change to an existing meaning bumps the version. A validator is pinned to one contract version, so this is a const: a 0.1 validator rejects other versions rather than silently mis-reading them. See decision 0027.",const:"0.1"},run_id:{description:"Stable identifier for this run.",type:"string",minLength:1},status:{description:"Lifecycle of the run, NOT a test verdict. While `running`, totals are not yet authoritative; `finalize` seals the pack to `finalized`. `aborted` is a run that ended without sealing.",enum:["running","finalized","aborted"]},title:{description:"Human-readable run title.",type:"string",minLength:1},started:{description:"When the run started (RFC3339 / ISO-8601).",type:"string",format:"date-time"},ended:{description:"When the run ended (RFC3339 / ISO-8601). Required once status is `finalized`.",type:"string",format:"date-time"},totals:{description:"Verdict roll-up over all tests. DERIVED by `evidence finalize` from every tests/<id>/result.yaml \u2014 not hand-authored. Required once status is `finalized`.",type:"object",required:["tests","passed","failed","broken","skipped"],additionalProperties:!1,properties:{tests:{type:"integer",minimum:0},passed:{type:"integer",minimum:0},failed:{type:"integer",minimum:0},broken:{type:"integer",minimum:0},skipped:{type:"integer",minimum:0}}},metrics:{description:"Free-form, framework-defined metrics. Each metric is a typed FACT, never a verdict. The set of metric names and their `type` strings is entirely up to the producing framework.",type:"object",additionalProperties:{type:"object",required:["value","type"],properties:{value:{description:"The measured value. A metric is a FACT, never a verdict, so boolean is intentionally excluded \u2014 a bare true/false reads as a pass/fail. Emit a flag as a typed string instead. See decision 0012.",type:["number","integer","string"]},type:{description:"Producer-defined type of the metric (open string, e.g. percentage, ratio, count, ms, currency). evidence-cli validates presence only, not vocabulary.",type:"string",minLength:1},unit:{description:"Optional display unit.",type:"string"},label:{description:"Optional human label.",type:"string"}},additionalProperties:!0}},metrics_catalog:{description:"Present when the producer snapshotted its metric catalog into the pack at meta/metrics-catalog.yaml: which catalog it is and the sha256 hex of the snapshot's bytes. `validate` checks the snapshot exists, conforms, hashes to `sha256` and carries `id` and `version`. `source` is the producer's own word for where the catalog came from (e.g. controller, cache, bundled). See decision 0048.",type:"object",required:["id","version","sha256"],properties:{id:{type:"string",minLength:1},version:{type:["integer","string"]},sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},source:{type:"string",minLength:1}},additionalProperties:!0},merged_from:{description:"Present only on a pack produced by `evidence merge`: the source run_ids, in CLI order. The additive slice of deferred lineage (0014). See decision 0045.",type:"array",minItems:1,items:{type:"string",minLength:1}},environment:{description:"Optional provenance/context block \u2014 an OPEN map of key:value pairs. The keys below are conventional, none is required, and any additional key:value pairs are allowed. A non-browser framework (unit, API) may legitimately omit model/surfaces \u2014 or the whole block \u2014 entirely. See decision 0013.",type:"object",properties:{producer:{description:"The tool that produced this pack.",type:"object",properties:{name:{type:"string"},version:{type:"string"}},additionalProperties:!0},model:{type:"string"},surfaces:{type:"array",items:{type:"string"}},ci:{type:"object",additionalProperties:!0}},additionalProperties:!0}},allOf:[{description:"Finalized packs are sealed: ended timestamp and the derived totals must be present.",if:{properties:{status:{const:"finalized"}},required:["status"]},then:{required:["ended","totals"]}}],additionalProperties:!0}});var Xy=w((w2,tI)=>{tI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L0/result.schema.json",title:"result.yaml (L0)",description:"THE RESULT for one test inside an .evidence pack (tests/<id>/result.yaml): structured, easy-to-parse per-step outcomes. The test's DEFINITION (the framework's own artifact \u2014 kane test.md, a .spec.ts, etc.) lives beside this file and is OPAQUE to evidence-cli; it is referenced by `definition`, never parsed.",type:"object",required:["evidence","test","status","steps"],properties:{evidence:{description:"Evidence CONTRACT version this file conforms to. One contract version spans all profiles (L0\u2013L3); only a breaking change bumps it. Const by design \u2014 a validator is pinned to its contract version. See decision 0027.",const:"0.1"},test:{description:"Test identifier. MUST equal the tests/<id>/ directory name \u2014 the validator enforces this equality (a cross-check beyond JSON Schema; see decision 0031).",type:"string",minLength:1},status:{description:"Test verdict, authored by the producer. `failed` = oracle evaluated and the product was wrong. `broken` = oracle could NOT be evaluated (environment/infra/test fault). `skipped` = not executed.",enum:["passed","failed","broken","skipped"]},definition:{description:"Reference to the opaque definition artifact. The framework pre-declares `path` (its own native filename); `evidence finalize` adds `sha256`. evidence-cli asserts the file at `path` exists and (when sealed) that its hash matches \u2014 it never reads the content.",type:"object",required:["path"],properties:{path:{description:"Path to the definition file, relative to and CONTAINED WITHIN this test directory. No leading '/', no '..' segment, no URL scheme \u2014 subdirectories are allowed. The pattern below catches the obvious shapes; the validator additionally normalizes the path and rejects any escape (see decisions 0029, 0031).",type:"string",minLength:1,pattern:"^(?!/)(?!.*(^|/)\\.\\.(/|$))(?![a-zA-Z][a-zA-Z0-9+.-]*:)[^\\\\]+$"},sha256:{description:"Content hash of the definition file. Added by `evidence finalize`. Format: 'sha256:<hex>'.",type:"string",pattern:"^sha256:[0-9a-f]{64}$"}},additionalProperties:!0},steps:{description:"Ordered per-step outcomes. The framework decides what a 'step' is and its granularity. MAY be empty (a unit/API test may have no sub-steps).",type:"array",items:{$ref:"#/$defs/step"}},params_hash:{description:"Optional hash of the parameterization used for this test.",type:"string"},external_id:{description:"Optional open map of links into external systems (e.g. a test-manager URL).",type:"object",additionalProperties:!0},duration_ms:{type:"number",minimum:0},attempts:{description:"Optional per-attempt outcomes for a retried test. Each attempt carries a `status` from the verdict enum; the array length is the attempt count. The test-level `status` remains the authoritative final verdict. See decision 0033.",type:"array",minItems:1,items:{type:"object",required:["status"],properties:{status:{description:"Outcome of this attempt \u2014 same vocabulary as the test verdict.",enum:["passed","failed","broken","skipped"]},duration_ms:{type:"number",minimum:0}},additionalProperties:!0}},flaky:{description:"Optional. Derived: true when the statuses in `attempts` disagree. See decision 0033.",type:"boolean"},tags:{type:"array",items:{type:"string"}},requirements:{type:"array",items:{type:"string"}},environment:{description:"Optional per-test execution context \u2014 an OPEN map of key:value pairs, the SAME shape as run.yaml.environment (decision 0013). Records the environment a single test executed in (e.g. cross-browser, sharded, or merged evidence, where tests diverge). How this relates to the run-level environment \u2014 precedence, merge, inheritance \u2014 is left to the consumer that reads the pack; the format only carries the facts and the validator checks shape. Nothing here is required. See decision 0043.",type:"object",properties:{producer:{description:"The tool that executed this test; typically only recorded at run level, present here only if a test's producer differs.",type:"object",properties:{name:{type:"string"},version:{type:"string"}},additionalProperties:!0},model:{type:"string"},surfaces:{type:"array",items:{type:"string"}},ci:{type:"object",additionalProperties:!0}},additionalProperties:!0}},additionalProperties:!0,$defs:{step:{type:"object",required:["id","ordinal","status"],properties:{id:{description:"Stable identifier for the step within this test.",type:"string",minLength:1},ordinal:{description:"1-based position in the producer's step sequence (NOT an index into this array). Ordinals MUST be unique and strictly increasing in array order; gaps are allowed when a producer records only some of a longer sequence. Uniqueness/monotonicity is a validator cross-check beyond JSON Schema; see decisions 0030, 0031.",type:"integer",minimum:1},status:{description:"Step verdict, same vocabulary as the test verdict.",enum:["passed","failed","broken","skipped"]},kind:{description:"OPTIONAL producer-defined step kind (open string, e.g. navigate, input, assertion, api, wait). Not required on a step; when present it must be non-empty. evidence-cli never checks the vocabulary. See decision 0009.",type:"string",minLength:1},duration_ms:{type:"number",minimum:0},durable_id:{description:"Optional stable cross-run identity for the step.",type:"string"},defect:{description:"Optional defect classification for a non-passing step (e.g. Product, Infrastructure, Test).",type:"string"},expected:{type:"string"},actual:{type:"string"},check:{description:"Optional oracle descriptor.",type:"object",properties:{kind:{type:"string"}},additionalProperties:!0}},additionalProperties:!0}}}});var Qy=w((E2,rI)=>{rI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L1/logs-meta.schema.json",title:"logs/meta.yaml (L1)",description:"Declares the execution logs kept for one test, at tests/<id>/logs/meta.yaml. The log files themselves are OPAQUE to evidence-cli \u2014 referenced by `file` and checked for existence and declared `format`, never parsed. L1 requires at least one log. See decision 0040.",type:"object",required:["logs"],properties:{logs:{description:"The logs this test kept. L1 requires at least one. Both the log `name` and its `format` are open vocabulary \u2014 the framework chooses what to keep and how to label it; evidence-cli records both and parses neither.",type:"array",minItems:1,items:{type:"object",required:["name","file","format"],properties:{name:{description:"Human-facing log name (e.g. console, network). Open vocabulary.",type:"string",minLength:1},file:{description:"Path to the log file, relative to and CONTAINED WITHIN this test's logs/ directory. No leading '/', no '..' segment, no URL scheme \u2014 same containment rule as definition.path (decision 0029). The file MUST exist (a validator cross-check).",type:"string",minLength:1,pattern:"^(?!/)(?!.*(^|/)\\.\\.(/|$))(?![a-zA-Z][a-zA-Z0-9+.-]*:)[^\\\\]+$"},format:{description:"Producer-declared log format (open string, e.g. ndjson, har, log, csv, jsonl, txt). Since evidence-cli never parses the log content, it validates presence and non-emptiness only, never the vocabulary \u2014 same stance as step `kind` (decision 0009) and metric `type` (decision 0012).",type:"string",minLength:1}},additionalProperties:!0}}},additionalProperties:!0}});var eg=w(($2,nI)=>{nI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L1/video.schema.json",title:"video.yaml (L1)",description:"Optional pointer to a test's video when it is not stored inline. Present only when a test uses the external form instead of an inline video.<ext> file. Validated only when present (video is optional at L1). See decision 0040.",type:"object",required:["url"],properties:{url:{description:"Location of the video (e.g. an object-store or CDN URL).",type:"string",minLength:1}},additionalProperties:!0}});var tg=w((S2,sI)=>{sI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L1/failure.schema.json",title:"steps/<ordinal>-<id>/failure.yaml (L1)",description:"The structured explanation of why one step did not pass, at tests/<id>/steps/<ordinal>-<id>/failure.yaml \u2014 authored by the framework (or a triage agent). Required core: `step` (anchored to the folder and a result.yaml step), `status` (verdict enum), and evidence-of-what (error.message, or expected+actual). File references resolve relative to the TEST ROOT tests/<id>/ (no '..', no leading '/', no scheme) and are checked for containment and existence by the validator, never parsed \u2014 the schema only requires them to be strings. The optional `triage` block is strictly shaped when present; free-form forensic blocks stay open. See decision 0044.",type:"object",required:["step","status"],anyOf:[{description:"evidence-of-what: an error message\u2026",properties:{error:{type:"object",required:["message"]}},required:["error"]},{description:"\u2026or both expected and actual.",required:["expected","actual"]}],properties:{step:{description:"The step id. MUST equal the containing folder's <id> and match a result.yaml step \u2014 a validator cross-check (l1.failure.unmatched).",type:"string",minLength:1},status:{description:"The step verdict \u2014 same vocabulary as result.yaml (decision 0006). Cross-checked against the matched step; disagreement is an advisory warning (l1.failure.status_disagrees).",enum:["passed","failed","broken","skipped"]},title:{description:"Short defect-style name for the failure, authored by the framework (typically the investigation verdict's bug title). Optional; open string, never cross-checked.",type:"string",minLength:1},expected:{type:"string"},actual:{type:"string"},error:{description:"The error at failure. `type` is an open string; `urls` are external locations (open, never checked).",type:"object",properties:{message:{type:"string",minLength:1},type:{type:"string"},urls:{type:"array",items:{type:"string"}}},additionalProperties:!0},repro:{description:"How to reproduce. `definition`/`resolved` are test-root-relative file references (validator-checked).",type:"object",properties:{definition:{type:"string",minLength:1},resolved:{type:"string",minLength:1}},additionalProperties:!0},locator_context:{description:"Open block \u2014 selector forensics in the framework's own vocabulary.",type:"object",additionalProperties:!0},page_state:{description:"Page state at failure. `url` is an external URL (open); `dom`/`a11y`/`screenshot` are test-root-relative file references (validator-checked).",type:"object",properties:{url:{type:"string"},dom:{type:"string",minLength:1},a11y:{type:"string",minLength:1},screenshot:{type:"string",minLength:1}},additionalProperties:!0},console_at_failure:{description:"`ref` is a test-root-relative file reference (validator-checked); the rest is open.",type:"object",properties:{ref:{type:"string",minLength:1}},additionalProperties:!0},network_at_failure:{description:"`ref` is a test-root-relative file reference (validator-checked); the rest is open.",type:"object",properties:{ref:{type:"string",minLength:1}},additionalProperties:!0},trajectory_refs:{description:"Open \u2014 producer-defined trajectory pointers.",type:"array",items:{type:"string"}},triage:{description:"Optional post-hoc triage. Strictly shaped when present (decision 0044): closed lifecycle enums, required sub-fields, bounded confidence.",type:"object",required:["status"],properties:{status:{description:"Triage lifecycle \u2014 closed enum (snake_case, decision 0036).",enum:["untriaged","triaged","in_progress","dismissed"]},by:{description:"Who/what triaged. `kind` and `id` are open strings; `at` is required when the block is present.",type:"object",required:["at"],properties:{kind:{type:"string"},id:{type:"string"},at:{type:"string",format:"date-time"}},additionalProperties:!0},rca:{description:"Root-cause analysis. `root_cause` is required; `category` is an open string; `evidence` entries are test-root-relative file references (validator-checked).",type:"object",required:["root_cause"],properties:{root_cause:{type:"string",minLength:1},category:{type:"string"},hypothesis:{type:"string"},evidence:{type:"array",items:{type:"string",minLength:1}},confidence:{type:"number",minimum:0,maximum:1}},additionalProperties:!0},suggested_fix:{description:"`patch` is a test-root-relative file reference (validator-checked); `summary`/`target` are open.",type:"object",properties:{summary:{type:"string"},patch:{type:"string",minLength:1},target:{type:"object",additionalProperties:!0}},additionalProperties:!0},verification:{description:"Whether the suggested fix was checked: not yet, confirmed to resolve, or checked and did NOT resolve.",type:"object",required:["status"],properties:{status:{enum:["not_verified","verified","refuted"]}},additionalProperties:!0},linked_defects:{description:"Open strings \u2014 external defect ids.",type:"array",items:{type:"string"}}},additionalProperties:!0}},additionalProperties:!0}});var rg=w((T2,iI)=>{iI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/0.1/L1/failure-index.schema.json",title:"failure.yaml (L1, pack root)",description:"The run-level failure index at the pack root \u2014 GENERATED by `evidence finalize` from every step-level failure.yaml, never hand-authored. Denormalized rows (test, ordinal, step, status, path, lifted triage_status) so a consumer renders a failure table without opening each record. `path` is pack-root-relative and MUST agree with its own row \u2014 path/row consistency, pointer resolution (dangling), and completeness against the records actually present are validator cross-checks. Always written at finalize: a clean run carries `failures: []`. See decision 0044.",type:"object",required:["failures"],properties:{generated:{description:"When finalize generated this index \u2014 its endedAt timestamp.",type:"string",format:"date-time"},totals:{description:"Informational tallies (open map). finalize writes at least `failures`.",type:"object",additionalProperties:!0},failures:{description:"One row per step-level failure.yaml, sorted by test then ordinal.",type:"array",items:{type:"object",required:["test","ordinal","step","status","path"],properties:{test:{type:"string",minLength:1},ordinal:{type:"integer",minimum:1},step:{type:"string",minLength:1},status:{description:"The step verdict, mirrored from the record.",enum:["passed","failed","broken","skipped"]},path:{description:"Pack-root-relative pointer to the step record: tests/<test>/steps/<ordinal>-<step>/failure.yaml. Row/path agreement is a validator cross-check (l1.failure_index.invalid).",type:"string",minLength:1},triage_status:{description:"Lifted verbatim from the record's triage.status when present.",enum:["untriaged","triaged","in_progress","dismissed"]},title:{description:"Lifted verbatim from the record's title when present.",type:"string",minLength:1}},additionalProperties:!0}}},additionalProperties:!0}});var ng=w((O2,oI)=>{oI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/policy.schema.json",title:"policy.yaml",description:"A verdict policy passed to `evidence verdict` (--policy). TOOL INPUT, not pack contract \u2014 it lives beside the versioned 0.1/ tree and is never written into a pack. A policy is a named list of gates; each gate either compares one metric against a threshold or evaluates a boolean CEL expression. Unknown keys are rejected so a typo'd operator fails loudly. See decisions 0047 and 0049.",type:"object",required:["policy","gates"],properties:{policy:{description:"Policy id, echoed in the verdict and used as the verdict file name (<policy>.verdict.json), so it is file-name safe.",type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},requires:{description:"Optional: refuse packs whose metric catalog is a different producer catalog, or a version outside `version`. A pack without a catalog fails this requirement.",type:"object",required:["catalog"],properties:{catalog:{description:"The catalog id the pack must carry (meta/metrics-catalog.yaml `catalog`).",type:"string",minLength:1},version:{description:'Space-separated comparators over the catalog version, e.g. ">=1", ">=1 <4", "3". Versions compare numerically by dot-separated segment.',type:"string",pattern:"^\\s*(?:(?:>=|<=|>|<|=)?\\s*[0-9]+(?:\\.[0-9]+)*\\s*)+$"}},additionalProperties:!1},gates:{type:"array",minItems:1,items:{$ref:"#/$defs/gate"}}},additionalProperties:!1,$defs:{gate:{description:"One check. A metric gate names a metric and exactly one operator; an expression gate carries `expr` (a CEL expression that must evaluate to a bool) and no operator.",type:"object",required:["id","severity"],properties:{id:{description:"Gate id, unique within the policy.",type:"string",pattern:"^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"},metric:{description:"A built-in metric (evidence-core, unprefixed, e.g. totals.failed) or a producer metric from the pack's catalog (always metrics.<name>).",type:"string",minLength:1},expr:{description:"A CEL expression over the pack facts that must evaluate to a bool (decision 0049).",type:"string",minLength:1},where:{description:"A CEL expression over one test (`test`) that narrows a per-test metric to the tests it holds for. Only on metric gates whose metric is per_test.",type:"string",minLength:1},equals:{description:"Pass when the metric equals this value.",type:["number","string"]},min:{description:"Pass when the metric is >= this value.",type:"number"},max:{description:"Pass when the metric is <= this value.",type:"number"},range:{description:"Pass when lo <= metric <= hi.",type:"array",prefixItems:[{type:"number"},{type:"number"}],minItems:2,maxItems:2},in:{description:"Pass when the metric is one of these values.",type:"array",minItems:1,items:{type:["number","string"]}},severity:{description:"blocking: a failure fails the verdict. warning: a failure is reported but does not fail it. An errored gate errors the verdict whatever its severity.",enum:["blocking","warning"]},message:{description:"Optional human message, echoed in the gate result.",type:"string"}},additionalProperties:!1,oneOf:[{required:["metric"],not:{required:["expr"]},oneOf:[{required:["equals"]},{required:["min"]},{required:["max"]},{required:["range"]},{required:["in"]}]},{required:["expr"],not:{anyOf:[{required:["metric"]},{required:["where"]},{required:["equals"]},{required:["min"]},{required:["max"]},{required:["range"]},{required:["in"]}]}}]}}}});var sg=w((N2,aI)=>{aI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/metrics-catalog.schema.json",title:"metrics catalog",description:"What each metric name means and how a verdict checks it. One format for the built-in catalog (evidence-core, shipped with evidence-cli) and for every producer catalog. A producer snapshots its catalog into the pack at meta/metrics-catalog.yaml and records it in run.yaml `metrics_catalog`. Producer metrics are reached in a policy as metrics.<name>; built-in names are unprefixed and reserved. See decision 0048.",type:"object",required:["catalog","version","metrics"],properties:{catalog:{description:"Catalog id (e.g. evidence-core, kane-cli).",type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$"},version:{description:"Catalog version: an integer, or a dot-separated numeric string. Compared numerically by segment against a policy's `requires.version`.",anyOf:[{type:"integer",minimum:0},{type:"string",pattern:"^[0-9]+(\\.[0-9]+)*$"}]},min_producer:{description:"Lowest producer version that writes every fact this catalog version reads. Used by the service that hands catalogs out; the verdict ignores it.",type:"string",minLength:1},description:{type:"string"},metrics:{type:"object",propertyNames:{pattern:"^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)*$"},additionalProperties:{$ref:"#/$defs/metric"}}},additionalProperties:!1,$defs:{metric:{type:"object",required:["type","verify"],properties:{type:{description:"Fixes the value shape and the operators a gate may use. Integer kinds (count, integer, bytes) and number kinds (ms, currency) take equals/min/max/range/in; fraction kinds (ratio, percentage, decimal) take min/max/range; string kinds (string, enum) take equals/in.",enum:["count","integer","ms","bytes","currency","ratio","percentage","decimal","string","enum"]},unit:{type:"string",minLength:1},label:{type:"string"},description:{type:"string"},range:{description:"Inclusive bounds every value must fall within; a value outside errors the gate.",type:"array",prefixItems:[{type:"number"},{type:"number"}],minItems:2,maxItems:2},values:{description:"The allowed values of an enum metric.",type:"array",minItems:1,items:{type:"string"}},per_test:{description:"true when a gate may narrow the metric to some tests with `where`.",type:"boolean"},verify:{description:"How the verdict obtains the value. `stored` trusts run.yaml.metrics.<name>; `file` reads a dot-path from a YAML/JSON file in the pack; `aggregate` folds a per-test value over tests/*/\u2026; `expr` evaluates CEL over the pack facts.",oneOf:[{const:"stored"},{type:"object",required:["file","path"],properties:{file:{description:"Pack-root-relative .yaml/.yml/.json file, contained in the pack.",type:"string",pattern:"\\.(ya?ml|json)$"},path:{description:"Dot-path into the parsed file.",type:"string",minLength:1}},additionalProperties:!1},{type:"object",required:["aggregate"],properties:{aggregate:{enum:["sum","min","max","mean","count","p50","p90","p95"]},over:{description:"Per-test file the value is read from, as tests/*/<file>. Default tests/*/result.yaml.",type:"string",pattern:"^tests/\\*/[^*]+\\.(ya?ml|json)$"},path:{description:"Dot-path into the per-test file.",type:"string",minLength:1},value:{description:"CEL over `test` and `file` giving the per-test value.",type:"string",minLength:1},where:{description:"A bool CEL expression over `test` and `file`; only tests it holds for are folded. A non-bool result errors the gate.",type:"string",minLength:1}},additionalProperties:!1,not:{required:["path","value"]}},{type:"object",required:["expr"],properties:{expr:{description:"CEL over the pack facts (decision 0049).",type:"string",minLength:1}},additionalProperties:!1}]},merge:{description:"How the metric resolves on a merged pack. sum/min/max/mean combine every source's stored value, each checked for type, unit and range first; recompute re-runs an aggregate/expr over the merged tests; none (the default) errors a gate on it.",enum:["sum","min","max","mean","recompute","none"]},min_producer:{description:"Lowest producer version (semver) that writes the facts this metric reads. The verdict errors a gate on the metric when a test in the pack was written by an older producer.",type:"string",minLength:1}},additionalProperties:!1}}}});var ig=w((I2,cI)=>{cI.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/verdict.schema.json",title:"<policy>.verdict.json",description:"One policy judged against one evidence pack, as written by `evidence verdict`. A SIDECAR: it is written next to the pack and never into it, so any sealed pack can be judged at any time without changing its bytes. `pack.sha256` ties the verdict to the exact pack file it judged. See decisions 0047 and 0050.",type:"object",required:["result","evaluated_at","evaluator","pack","policy","catalog","error","gates","failed_gates","warnings","errored_gates","exit_code"],properties:{result:{description:"errored when the policy could not be judged as a whole or any gate errored; else fail when any blocking gate failed; else pass.",enum:["pass","fail","errored"]},evaluated_at:{type:"string",format:"date-time"},evaluator:{description:'The tool and version that judged the pack, e.g. "evidence-cli 0.2.0".',type:"string",minLength:1},pack:{type:"object",required:["run_id","sha256","contract"],properties:{run_id:{type:["string","null"]},sha256:{description:"sha256 hex of the sealed .evidence file bytes; null when a live directory was judged.",type:["string","null"],pattern:"^[0-9a-f]{64}$"},contract:{description:"run.yaml `evidence`.",type:["string","null"]}},additionalProperties:!1},policy:{type:"object",required:["id","sha256"],properties:{id:{type:"string",minLength:1},sha256:{description:"sha256 hex of the exact policy YAML bytes.",type:"string",pattern:"^[0-9a-f]{64}$"}},additionalProperties:!1},catalog:{description:"The producer catalog the pack carried, or null when it carried none.",type:["object","null"],required:["id","version","sha256","source"],properties:{id:{type:"string"},version:{type:["integer","string"]},sha256:{type:"string",pattern:"^[0-9a-f]{64}$"},source:{description:"run.yaml metrics_catalog.source as the producer recorded it, or null.",type:["string","null"]}},additionalProperties:!1},error:{description:"Set when the policy as a whole could not be judged (pack not finalized or not valid, a policy problem against this pack's catalog). gates is then empty.",oneOf:[{type:"null"},{$ref:"#/$defs/error"}]},gates:{type:"array",items:{$ref:"#/$defs/gate"}},failed_gates:{description:"Ids of blocking gates that failed.",type:"array",items:{type:"string"}},warnings:{description:"Ids of warning gates that failed.",type:"array",items:{type:"string"}},errored_gates:{type:"array",items:{type:"string"}},exit_code:{description:"0 pass, 1 fail, 3 errored.",enum:[0,1,3]}},additionalProperties:!1,$defs:{error:{type:"object",required:["code","message","hint"],properties:{code:{type:"string",minLength:1},message:{type:"string"},hint:{type:["string","null"]}},additionalProperties:!1},gate:{type:"object",required:["id","where","op","expected","actual","severity","status","trust","message","error","stored"],properties:{id:{type:"string"},metric:{type:"string"},expr:{type:"string"},where:{type:["string","null"]},op:{description:"The comparison; expr for an expression gate.",enum:["equals","min","max","range","in","expr"]},expected:{description:"The threshold as written; true for an expression gate."},actual:{description:"The resolved value, or null when it could not be resolved."},severity:{enum:["blocking","warning"]},status:{description:"warn is a failed warning gate.",enum:["pass","fail","warn","errored"]},trust:{description:"recomputed: derived from the pack's raw files. file: read from a file in the pack. stored: the producer's own number. null when nothing was resolved.",enum:["recomputed","file","stored",null]},message:{type:["string","null"]},error:{oneOf:[{type:"null"},{$ref:"#/$defs/error"}]},stored:{description:"The producer's stored number when it disagreed with the recompute.",type:["number","string","null"]}},oneOf:[{required:["metric"]},{required:["expr"]}],additionalProperties:!1}}}});var og=w(Lr=>{"use strict";var Bt=Lr&&Lr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.getSchemas=bI;Lr.getL1Schemas=wI;Lr.getToolSchema=$I;var lI=Bt(Wy()),uI=Bt(Xy()),fI=Bt(Qy()),dI=Bt(eg()),pI=Bt(tg()),hI=Bt(rg()),mI=Bt(ng()),yI=Bt(sg()),gI=Bt(ig()),_I={"0.1":{L0:{run:lI.default,result:uI.default}}},vI={"0.1":{logsMeta:fI.default,video:dI.default,failure:pI.default,failureIndex:hI.default}};function bI(r,e){let t=_I[r];if(!t)throw new Error(`no schemas for contract version ${r}`);let n=t[e];if(!n)throw new Error(`no schemas for profile ${e} at version ${r}`);return n}function wI(r){let e=vI[r];if(!e)throw new Error(`no L1 schemas for contract version ${r}`);return e}var EI={policy:mI.default,"metrics-catalog":yI.default,verdict:gI.default};function $I(r){let e=EI[r];if(!e)throw new Error(`no tool schema "${r}"`);return e}});var Cs=w(Dr=>{"use strict";var ug=Dr&&Dr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.loadSchemas=OI;Dr.loadL1Schemas=NI;Dr.loadToolSchema=II;var SI=ug(uu()),TI=ug(bu()),wu=og(),ag=new Map,cg=new Map,lg=new Map;function Eu(){let r=new SI.default({allErrors:!0,strict:!1});return(0,TI.default)(r),r}function OI(r,e){let t=`${r}/${e}`,n=ag.get(t);if(n)return n;let{run:s,result:i}=(0,wu.getSchemas)(r,e),o=Eu(),a={run:o.compile(s),result:o.compile(i)};return ag.set(t,a),a}function NI(r){let e=cg.get(r);if(e)return e;let{logsMeta:t,video:n,failure:s,failureIndex:i}=(0,wu.getL1Schemas)(r),o=Eu(),a={logsMeta:o.compile(t),video:o.compile(n),failure:o.compile(s),failureIndex:o.compile(i)};return cg.set(r,a),a}function II(r){let e=lg.get(r);if(e)return e;let t=Eu().compile((0,wu.getToolSchema)(r));return lg.set(r,t),t}});var H=w(Ee=>{"use strict";var $u=Symbol.for("yaml.alias"),fg=Symbol.for("yaml.document"),mo=Symbol.for("yaml.map"),dg=Symbol.for("yaml.pair"),Su=Symbol.for("yaml.scalar"),yo=Symbol.for("yaml.seq"),Vt=Symbol.for("yaml.node.type"),AI=r=>!!r&&typeof r=="object"&&r[Vt]===$u,PI=r=>!!r&&typeof r=="object"&&r[Vt]===fg,kI=r=>!!r&&typeof r=="object"&&r[Vt]===mo,CI=r=>!!r&&typeof r=="object"&&r[Vt]===dg,pg=r=>!!r&&typeof r=="object"&&r[Vt]===Su,LI=r=>!!r&&typeof r=="object"&&r[Vt]===yo;function hg(r){if(r&&typeof r=="object")switch(r[Vt]){case mo:case yo:return!0}return!1}function DI(r){if(r&&typeof r=="object")switch(r[Vt]){case $u:case mo:case Su:case yo:return!0}return!1}var qI=r=>(pg(r)||hg(r))&&!!r.anchor;Ee.ALIAS=$u;Ee.DOC=fg;Ee.MAP=mo;Ee.NODE_TYPE=Vt;Ee.PAIR=dg;Ee.SCALAR=Su;Ee.SEQ=yo;Ee.hasAnchor=qI;Ee.isAlias=AI;Ee.isCollection=hg;Ee.isDocument=PI;Ee.isMap=kI;Ee.isNode=DI;Ee.isPair=CI;Ee.isScalar=pg;Ee.isSeq=LI});var Ls=w(Tu=>{"use strict";var ye=H(),Ue=Symbol("break visit"),mg=Symbol("skip children"),It=Symbol("remove node");function go(r,e){let t=yg(e);ye.isDocument(r)?$n(null,r.contents,t,Object.freeze([r]))===It&&(r.contents=null):$n(null,r,t,Object.freeze([]))}go.BREAK=Ue;go.SKIP=mg;go.REMOVE=It;function $n(r,e,t,n){let s=gg(r,e,t,n);if(ye.isNode(s)||ye.isPair(s))return _g(r,n,s),$n(r,s,t,n);if(typeof s!="symbol"){if(ye.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let o=$n(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===Ue)return Ue;o===It&&(e.items.splice(i,1),i-=1)}}}else if(ye.isPair(e)){n=Object.freeze(n.concat(e));let i=$n("key",e.key,t,n);if(i===Ue)return Ue;i===It&&(e.key=null);let o=$n("value",e.value,t,n);if(o===Ue)return Ue;o===It&&(e.value=null)}}return s}async function _o(r,e){let t=yg(e);ye.isDocument(r)?await Sn(null,r.contents,t,Object.freeze([r]))===It&&(r.contents=null):await Sn(null,r,t,Object.freeze([]))}_o.BREAK=Ue;_o.SKIP=mg;_o.REMOVE=It;async function Sn(r,e,t,n){let s=await gg(r,e,t,n);if(ye.isNode(s)||ye.isPair(s))return _g(r,n,s),Sn(r,s,t,n);if(typeof s!="symbol"){if(ye.isCollection(e)){n=Object.freeze(n.concat(e));for(let i=0;i<e.items.length;++i){let o=await Sn(i,e.items[i],t,n);if(typeof o=="number")i=o-1;else{if(o===Ue)return Ue;o===It&&(e.items.splice(i,1),i-=1)}}}else if(ye.isPair(e)){n=Object.freeze(n.concat(e));let i=await Sn("key",e.key,t,n);if(i===Ue)return Ue;i===It&&(e.key=null);let o=await Sn("value",e.value,t,n);if(o===Ue)return Ue;o===It&&(e.value=null)}}return s}function yg(r){return typeof r=="object"&&(r.Collection||r.Node||r.Value)?Object.assign({Alias:r.Node,Map:r.Node,Scalar:r.Node,Seq:r.Node},r.Value&&{Map:r.Value,Scalar:r.Value,Seq:r.Value},r.Collection&&{Map:r.Collection,Seq:r.Collection},r):r}function gg(r,e,t,n){if(typeof t=="function")return t(r,e,n);if(ye.isMap(e))return t.Map?.(r,e,n);if(ye.isSeq(e))return t.Seq?.(r,e,n);if(ye.isPair(e))return t.Pair?.(r,e,n);if(ye.isScalar(e))return t.Scalar?.(r,e,n);if(ye.isAlias(e))return t.Alias?.(r,e,n)}function _g(r,e,t){let n=e[e.length-1];if(ye.isCollection(n))n.items[r]=t;else if(ye.isPair(n))r==="key"?n.key=t:n.value=t;else if(ye.isDocument(n))n.contents=t;else{let s=ye.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}Tu.visit=go;Tu.visitAsync=_o});var Ou=w(bg=>{"use strict";var vg=H(),MI=Ls(),jI={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},RI=r=>r.replace(/[!,[\]{}]/g,e=>jI[e]),Ds=class r{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},r.defaultYaml,e),this.tags=Object.assign({},r.defaultTags,t)}clone(){let e=new r(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},r.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},r.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),s=n.shift();switch(s){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[i,o]=n;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[i]=n;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{let o=/^\d+\.\d+$/.test(i);return t(6,`Unsupported YAML version ${i}`,o),!1}}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}let[,n,s]=e.match(/^(.*!)([^!]*)$/s);s||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(s)}catch(o){return t(String(o)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+RI(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),s;if(e&&n.length>0&&vg.isNode(e.contents)){let i={};MI.visit(e.contents,(o,a)=>{vg.isNode(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(let[i,o]of n)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&t.push(`%TAG ${i} ${o}`);return t.join(`
|
|
10
|
+
`)}};Ds.defaultYaml={explicit:!1,version:"1.2"};Ds.defaultTags={"!!":"tag:yaml.org,2002:"};bg.Directives=Ds});var vo=w(qs=>{"use strict";var wg=H(),xI=Ls();function FI(r){if(/[\x00-\x19\s,[\]{}]/.test(r)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(r)}`;throw new Error(t)}return!0}function Eg(r){let e=new Set;return xI.visit(r,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function $g(r,e){for(let t=1;;++t){let n=`${r}${t}`;if(!e.has(n))return n}}function UI(r,e){let t=[],n=new Map,s=null;return{onAnchor:i=>{t.push(i),s??(s=Eg(r));let o=$g(e,s);return s.add(o),o},setAnchors:()=>{for(let i of t){let o=n.get(i);if(typeof o=="object"&&o.anchor&&(wg.isScalar(o.node)||wg.isCollection(o.node)))o.node.anchor=o.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:n}}qs.anchorIsValid=FI;qs.anchorNames=Eg;qs.createNodeAnchors=UI;qs.findNewAnchor=$g});var Nu=w(Sg=>{"use strict";function Ms(r,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let s=0,i=n.length;s<i;++s){let o=n[s],a=Ms(r,n,String(s),o);a===void 0?delete n[s]:a!==o&&(n[s]=a)}else if(n instanceof Map)for(let s of Array.from(n.keys())){let i=n.get(s),o=Ms(r,n,s,i);o===void 0?n.delete(s):o!==i&&n.set(s,o)}else if(n instanceof Set)for(let s of Array.from(n)){let i=Ms(r,n,s,s);i===void 0?n.delete(s):i!==s&&(n.delete(s),n.add(i))}else for(let[s,i]of Object.entries(n)){let o=Ms(r,n,s,i);o===void 0?delete n[s]:o!==i&&(n[s]=o)}return r.call(e,t,n)}Sg.applyReviver=Ms});var or=w(Og=>{"use strict";var BI=H();function Tg(r,e,t){if(Array.isArray(r))return r.map((n,s)=>Tg(n,String(s),t));if(r&&typeof r.toJSON=="function"){if(!t||!BI.hasAnchor(r))return r.toJSON(e,t);let n={aliasCount:0,count:1,res:void 0};t.anchors.set(r,n),t.onCreate=i=>{n.res=i,delete t.onCreate};let s=r.toJSON(e,t);return t.onCreate&&t.onCreate(s),s}return typeof r=="bigint"&&!t?.keep?Number(r):r}Og.toJS=Tg});var bo=w(Ig=>{"use strict";var VI=Nu(),Ng=H(),zI=or(),Iu=class{constructor(e){Object.defineProperty(this,Ng.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:s,reviver:i}={}){if(!Ng.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=zI.toJS(this,"",o);if(typeof s=="function")for(let{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?VI.applyReviver(i,{"":a},"",a):a}};Ig.NodeBase=Iu});var js=w(Ag=>{"use strict";var KI=vo(),HI=Ls(),Tn=H(),GI=bo(),YI=or(),Au=class extends GI.NodeBase{constructor(e){super(Tn.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],HI.visit(e,{Node:(i,o)=>{(Tn.isAlias(o)||Tn.hasAnchor(o))&&n.push(o)}}),t&&(t.aliasResolveCache=n));let s;for(let i of n){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:s,maxAliasCount:i}=t,o=this.resolve(s,t);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(o);if(a||(YI.toJS(o,null,t),a=n.get(o)),a?.res===void 0){let 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=wo(s,o,n)),a.count*a.aliasCount>i)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,t,n){let s=`*${this.source}`;if(e){if(KI.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(e.implicitKey)return`${s} `}return s}};function wo(r,e,t){if(Tn.isAlias(e)){let n=e.resolve(r),s=t&&n&&t.get(n);return s?s.count*s.aliasCount:0}else if(Tn.isCollection(e)){let n=0;for(let s of e.items){let i=wo(r,s,t);i>n&&(n=i)}return n}else if(Tn.isPair(e)){let n=wo(r,e.key,t),s=wo(r,e.value,t);return Math.max(n,s)}return 1}Ag.Alias=Au});var me=w(Pu=>{"use strict";var ZI=H(),JI=bo(),WI=or(),XI=r=>!r||typeof r!="function"&&typeof r!="object",ar=class extends JI.NodeBase{constructor(e){super(ZI.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:WI.toJS(this.value,e,t)}toString(){return String(this.value)}};ar.BLOCK_FOLDED="BLOCK_FOLDED";ar.BLOCK_LITERAL="BLOCK_LITERAL";ar.PLAIN="PLAIN";ar.QUOTE_DOUBLE="QUOTE_DOUBLE";ar.QUOTE_SINGLE="QUOTE_SINGLE";Pu.Scalar=ar;Pu.isScalarValue=XI});var Rs=w(kg=>{"use strict";var QI=js(),qr=H(),Pg=me(),eA="tag:yaml.org,2002:";function tA(r,e,t){if(e){let n=t.filter(i=>i.tag===e),s=n.find(i=>!i.format)??n[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return t.find(n=>n.identify?.(r)&&!n.format)}function rA(r,e,t){if(qr.isDocument(r)&&(r=r.contents),qr.isNode(r))return r;if(qr.isPair(r)){let f=t.schema[qr.MAP].createNode?.(t.schema,null,t);return f.items.push(r),f}(r instanceof String||r instanceof Number||r instanceof Boolean||typeof BigInt<"u"&&r instanceof BigInt)&&(r=r.valueOf());let{aliasDuplicateObjects:n,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=t,c;if(n&&r&&typeof r=="object"){if(c=a.get(r),c)return c.anchor??(c.anchor=s(r)),new QI.Alias(c.anchor);c={anchor:null,node:null},a.set(r,c)}e?.startsWith("!!")&&(e=eA+e.slice(2));let l=tA(r,e,o.tags);if(!l){if(r&&typeof r.toJSON=="function"&&(r=r.toJSON()),!r||typeof r!="object"){let f=new Pg.Scalar(r);return c&&(c.node=f),f}l=r instanceof Map?o[qr.MAP]:Symbol.iterator in Object(r)?o[qr.SEQ]:o[qr.MAP]}i&&(i(l),delete t.onTagObj);let h=l?.createNode?l.createNode(t.schema,r,t):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(t.schema,r,t):new Pg.Scalar(r);return e?h.tag=e:l.default||(h.tag=l.tag),c&&(c.node=h),h}kg.createNode=rA});var $o=w(Eo=>{"use strict";var nA=Rs(),At=H(),sA=bo();function ku(r,e,t){let n=t;for(let s=e.length-1;s>=0;--s){let i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){let o=[];o[i]=n,n=o}else n=new Map([[i,n]])}return nA.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:r,sourceObjects:new Map})}var Cg=r=>r==null||typeof r=="object"&&!!r[Symbol.iterator]().next().done,Cu=class extends sA.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>At.isNode(n)||At.isPair(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Cg(e))this.add(t);else{let[n,...s]=e,i=this.get(n,!0);if(At.isCollection(i))i.addIn(s,t);else if(i===void 0&&this.schema)this.set(n,ku(this.schema,s,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let s=this.get(t,!0);if(At.isCollection(s))return s.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...s]=e,i=this.get(n,!0);return s.length===0?!t&&At.isScalar(i)?i.value:i:At.isCollection(i)?i.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!At.isPair(t))return!1;let n=t.value;return n==null||e&&At.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let s=this.get(t,!0);return At.isCollection(s)?s.hasIn(n):!1}setIn(e,t){let[n,...s]=e;if(s.length===0)this.set(n,t);else{let i=this.get(n,!0);if(At.isCollection(i))i.setIn(s,t);else if(i===void 0&&this.schema)this.set(n,ku(this.schema,s,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}}};Eo.Collection=Cu;Eo.collectionFromPath=ku;Eo.isEmptyPath=Cg});var xs=w(So=>{"use strict";var iA=r=>r.replace(/^(?!$)(?: $)?/gm,"#");function Lu(r,e){return/^\n+$/.test(r)?r.substring(1):e?r.replace(/^(?! *$)/gm,e):r}var oA=(r,e,t)=>r.endsWith(`
|
|
11
11
|
`)?Lu(t,e):t.includes(`
|
|
12
12
|
`)?`
|
|
13
|
-
`+Lu(t,e):(r.endsWith(" ")?"":" ")+t;So.indentComment=Lu;So.lineComment=
|
|
14
|
-
`)t===Du&&(u=
|
|
13
|
+
`+Lu(t,e):(r.endsWith(" ")?"":" ")+t;So.indentComment=Lu;So.lineComment=oA;So.stringifyComment=iA});var Dg=w(Fs=>{"use strict";var aA="flow",Du="block",To="quoted";function cA(r,e,t="flow",{indentAtStart:n,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return r;s<i&&(i=0);let c=Math.max(1+i,1+s-e.length);if(r.length<=c)return r;let l=[],h={},f=s-e.length;typeof n=="number"&&(n>s-Math.max(2,i)?l.push(0):f=s-n);let d,p,y=!1,u=-1,m=-1,_=-1;t===Du&&(u=Lg(r,u,e.length),u!==-1&&(f=u+c));for(let g;g=r[u+=1];){if(t===To&&g==="\\"){switch(m=u,r[u+1]){case"x":u+=3;break;case"u":u+=5;break;case"U":u+=9;break;default:u+=1}_=u}if(g===`
|
|
14
|
+
`)t===Du&&(u=Lg(r,u,e.length)),f=u+e.length+c,d=void 0;else{if(g===" "&&p&&p!==" "&&p!==`
|
|
15
15
|
`&&p!==" "){let b=r[u+1];b&&b!==" "&&b!==`
|
|
16
16
|
`&&b!==" "&&(d=u)}if(u>=f)if(d)l.push(d),f=d+c,d=void 0;else if(t===To){for(;p===" "||p===" ";)p=g,g=r[u+=1],y=!0;let b=u>_+1?u-2:m-1;if(h[b])return r;l.push(b),h[b]=!0,f=b+c,d=void 0}else y=!0}p=g}if(y&&a&&a(),l.length===0)return r;o&&o();let v=r.slice(0,l[0]);for(let g=0;g<l.length;++g){let b=l[g],E=l[g+1]||r.length;b===0?v=`
|
|
17
17
|
${e}${r.slice(0,E)}`:(t===To&&h[b]&&(v+=`${r[b]}\\`),v+=`
|
|
18
|
-
${e}${r.slice(b+1,E)}`)}return v}function
|
|
19
|
-
`);n=e,s=e+1,i=r[s]}return n}Fs.FOLD_BLOCK=Du;Fs.FOLD_FLOW=
|
|
18
|
+
${e}${r.slice(b+1,E)}`)}return v}function Lg(r,e,t){let n=e,s=e+1,i=r[s];for(;i===" "||i===" ";)if(e<s+t)i=r[++e];else{do i=r[++e];while(i&&i!==`
|
|
19
|
+
`);n=e,s=e+1,i=r[s]}return n}Fs.FOLD_BLOCK=Du;Fs.FOLD_FLOW=aA;Fs.FOLD_QUOTED=To;Fs.foldFlowLines=cA});var Bs=w(qg=>{"use strict";var dt=me(),cr=Dg(),No=(r,e)=>({indentAtStart:e?r.indent.length:r.indentAtStart,lineWidth:r.options.lineWidth,minContentWidth:r.options.minContentWidth}),Io=r=>/^(%|---|\.\.\.)/m.test(r);function lA(r,e,t){if(!e||e<0)return!1;let n=e-t,s=r.length;if(s<=n)return!1;for(let i=0,o=0;i<s;++i)if(r[i]===`
|
|
20
20
|
`){if(i-o>n)return!0;if(o=i+1,s-o<=n)return!1}return!0}function Us(r,e){let t=JSON.stringify(r);if(e.options.doubleQuotedAsJSON)return t;let{implicitKey:n}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(Io(r)?" ":""),o="",a=0;for(let c=0,l=t[c];l;l=t[++c])if(l===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(o+=t.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(t[c+1]){case"u":{o+=t.slice(a,c);let h=t.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+=t.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||t[c+2]==='"'||t.length<s)c+=1;else{for(o+=t.slice(a,c)+`
|
|
21
21
|
|
|
22
22
|
`;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)o+=`
|
|
@@ -25,7 +25,7 @@ ${e}${r.slice(b+1,E)}`)}return v}function Dg(r,e,t){let n=e,s=e+1,i=r[s];for(;i=
|
|
|
25
25
|
${t}`)+"'";return e.implicitKey?n:cr.foldFlowLines(n,t,cr.FOLD_FLOW,No(e,!1))}function On(r,e){let{singleQuote:t}=e.options,n;if(t===!1)n=Us;else{let s=r.includes('"'),i=r.includes("'");s&&!i?n=qu:i&&!s?n=Us:n=t?qu:Us}return n(r,e)}var Mu;try{Mu=new RegExp(`(^|(?<!
|
|
26
26
|
))
|
|
27
27
|
+(?!
|
|
28
|
-
|$)`,"g")}catch{Mu=/\n+(?!\n|$)/g}function Oo({comment:r,type:e,value:t},n,s,i){let{blockQuote:o,commentString:a,lineWidth:c}=n.options;if(!o||/\n[\t ]+$/.test(t))return On(t,n);let l=n.indent||(n.forceBlockIndent||Io(t)?" ":""),h=o==="literal"?!0:o==="folded"||e===dt.Scalar.BLOCK_FOLDED?!1:e===dt.Scalar.BLOCK_LITERAL?!0:!
|
|
28
|
+
|$)`,"g")}catch{Mu=/\n+(?!\n|$)/g}function Oo({comment:r,type:e,value:t},n,s,i){let{blockQuote:o,commentString:a,lineWidth:c}=n.options;if(!o||/\n[\t ]+$/.test(t))return On(t,n);let l=n.indent||(n.forceBlockIndent||Io(t)?" ":""),h=o==="literal"?!0:o==="folded"||e===dt.Scalar.BLOCK_FOLDED?!1:e===dt.Scalar.BLOCK_LITERAL?!0:!lA(t,c,l.length);if(!t)return h?`|
|
|
29
29
|
`:`>
|
|
30
30
|
`;let f,d;for(d=t.length;d>0;--d){let E=t[d-1];if(E!==`
|
|
31
31
|
`&&E!==" "&&E!==" ")break}let p=t.substring(d),y=p.indexOf(`
|
|
@@ -34,13 +34,13 @@ ${t}`)+"'";return e.implicitKey?n:cr.foldFlowLines(n,t,cr.FOLD_FLOW,No(e,!1))}fu
|
|
|
34
34
|
`)_=m;else break}let v=t.substring(0,_<m?_+1:m);v&&(t=t.substring(v.length),v=v.replace(/\n+/g,`$&${l}`));let b=(u?l?"2":"1":"")+f;if(r&&(b+=" "+a(r.replace(/ ?[\r\n]+/g," ")),s&&s()),!h){let E=t.replace(/\n+/g,`
|
|
35
35
|
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),$=!1,S=No(n,!0);o!=="folded"&&e!==dt.Scalar.BLOCK_FOLDED&&(S.onOverflow=()=>{$=!0});let O=cr.foldFlowLines(`${v}${E}${p}`,l,cr.FOLD_BLOCK,S);if(!$)return`>${b}
|
|
36
36
|
${l}${O}`}return t=t.replace(/\n+/g,`$&${l}`),`|${b}
|
|
37
|
-
${l}${v}${t}${p}`}function
|
|
37
|
+
${l}${v}${t}${p}`}function uA(r,e,t,n){let{type:s,value:i}=r,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:h}=e;if(a&&i.includes(`
|
|
38
38
|
`)||h&&/[[\]{},]/.test(i))return On(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||h||!i.includes(`
|
|
39
39
|
`)?On(i,e):Oo(r,e,t,n);if(!a&&!h&&s!==dt.Scalar.PLAIN&&i.includes(`
|
|
40
40
|
`))return Oo(r,e,t,n);if(Io(i)){if(c==="")return e.forceBlockIndent=!0,Oo(r,e,t,n);if(a&&c===l)return On(i,e)}let f=i.replace(/\n+/g,`$&
|
|
41
|
-
${c}`);if(o){let d=u=>u.default&&u.tag!=="tag:yaml.org,2002:str"&&u.test?.test(f),{compat:p,tags:y}=e.doc.schema;if(y.some(d)||p?.some(d))return On(i,e)}return a?f:cr.foldFlowLines(f,c,cr.FOLD_FLOW,No(e,!1))}function
|
|
42
|
-
${e.indent}${a}`:a}ju.createStringifyContext=
|
|
43
|
-
${a}:`):(m=`${m}:`,d&&(m+=zs.lineComment(m,t.indent,l(d))));let _,v,g;zt.isNode(e)?(_=!!e.spaceBefore,v=e.commentBefore,g=e.comment):(_=!1,v=null,g=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!d&&zt.isScalar(e)&&(t.indentAtStart=m.length+1),u=!1,!h&&c.length>=2&&!t.inFlow&&!p&&zt.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let b=!1,E=
|
|
41
|
+
${c}`);if(o){let d=u=>u.default&&u.tag!=="tag:yaml.org,2002:str"&&u.test?.test(f),{compat:p,tags:y}=e.doc.schema;if(y.some(d)||p?.some(d))return On(i,e)}return a?f:cr.foldFlowLines(f,c,cr.FOLD_FLOW,No(e,!1))}function fA(r,e,t,n){let{implicitKey:s,inFlow:i}=e,o=typeof r.value=="string"?r:Object.assign({},r,{value:String(r.value)}),{type:a}=r;a!==dt.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=dt.Scalar.QUOTE_DOUBLE);let c=h=>{switch(h){case dt.Scalar.BLOCK_FOLDED:case dt.Scalar.BLOCK_LITERAL:return s||i?On(o.value,e):Oo(o,e,t,n);case dt.Scalar.QUOTE_DOUBLE:return Us(o.value,e);case dt.Scalar.QUOTE_SINGLE:return qu(o.value,e);case dt.Scalar.PLAIN:return uA(o,e,t,n);default:return null}},l=c(a);if(l===null){let{defaultKeyType:h,defaultStringType:f}=e.options,d=s&&h||f;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}qg.stringifyString=fA});var Vs=w(ju=>{"use strict";var dA=vo(),lr=H(),pA=xs(),hA=Bs();function mA(r,e){let t=Object.assign({blockQuote:!0,commentString:pA.stringifyComment,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},r.schema.toStringOptions,e),n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:r,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function yA(r,e){if(e.tag){let s=r.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let t,n;if(lr.isScalar(e)){n=e.value;let s=r.filter(i=>i.identify?.(n));if(s.length>1){let i=s.filter(o=>o.test);i.length>0&&(s=i)}t=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else n=e,t=r.find(s=>s.nodeClass&&n instanceof s.nodeClass);if(!t){let s=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${s} value`)}return t}function gA(r,e,{anchors:t,doc:n}){if(!n.directives)return"";let s=[],i=(lr.isScalar(r)||lr.isCollection(r))&&r.anchor;i&&dA.anchorIsValid(i)&&(t.add(i),s.push(`&${i}`));let o=r.tag??(e.default?null:e.tag);return o&&s.push(n.directives.tagString(o)),s.join(" ")}function _A(r,e,t,n){if(lr.isPair(r))return r.toString(e,t,n);if(lr.isAlias(r)){if(e.doc.directives)return r.toString(e);if(e.resolvedAliases?.has(r))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(r):e.resolvedAliases=new Set([r]),r=r.resolve(e.doc)}let s,i=lr.isNode(r)?r:e.doc.createNode(r,{onTagObj:c=>s=c});s??(s=yA(e.doc.schema.tags,i));let o=gA(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let a=typeof s.stringify=="function"?s.stringify(i,e,t,n):lr.isScalar(i)?hA.stringifyString(i,e,t,n):i.toString(e,t,n);return o?lr.isScalar(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
42
|
+
${e.indent}${a}`:a}ju.createStringifyContext=mA;ju.stringify=_A});var xg=w(Rg=>{"use strict";var zt=H(),Mg=me(),jg=Vs(),zs=xs();function vA({key:r,value:e},t,n,s){let{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:h,simpleKeys:f}}=t,d=zt.isNode(r)&&r.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(zt.isCollection(r)||!zt.isNode(r)&&typeof r=="object"){let S="With simple keys, collection cannot be used as a key value";throw new Error(S)}}let p=!f&&(!r||d&&e==null&&!t.inFlow||zt.isCollection(r)||(zt.isScalar(r)?r.type===Mg.Scalar.BLOCK_FOLDED||r.type===Mg.Scalar.BLOCK_LITERAL:typeof r=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!p&&(f||!i),indent:a+c});let y=!1,u=!1,m=jg.stringify(r,t,()=>y=!0,()=>u=!0);if(!p&&!t.inFlow&&m.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(t.inFlow){if(i||e==null)return y&&n&&n(),m===""?"?":p?`? ${m}`:m}else if(i&&!f||e==null&&p)return m=`? ${m}`,d&&!y?m+=zs.lineComment(m,t.indent,l(d)):u&&s&&s(),m;y&&(d=null),p?(d&&(m+=zs.lineComment(m,t.indent,l(d))),m=`? ${m}
|
|
43
|
+
${a}:`):(m=`${m}:`,d&&(m+=zs.lineComment(m,t.indent,l(d))));let _,v,g;zt.isNode(e)?(_=!!e.spaceBefore,v=e.commentBefore,g=e.comment):(_=!1,v=null,g=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!p&&!d&&zt.isScalar(e)&&(t.indentAtStart=m.length+1),u=!1,!h&&c.length>=2&&!t.inFlow&&!p&&zt.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let b=!1,E=jg.stringify(e,t,()=>b=!0,()=>u=!0),$=" ";if(d||_||v){if($=_?`
|
|
44
44
|
`:"",v){let S=l(v);$+=`
|
|
45
45
|
${zs.indentComment(S,t.indent)}`}E===""&&!t.inFlow?$===`
|
|
46
46
|
`&&g&&($=`
|
|
@@ -49,32 +49,32 @@ ${zs.indentComment(S,t.indent)}`}E===""&&!t.inFlow?$===`
|
|
|
49
49
|
${t.indent}`}else if(!p&&zt.isCollection(e)){let S=E[0],O=E.indexOf(`
|
|
50
50
|
`),A=O!==-1,x=t.inFlow??e.flow??e.items.length===0;if(A||!x){let j=!1;if(A&&(S==="&"||S==="!")){let B=E.indexOf(" ");S==="&"&&B!==-1&&B<O&&E[B+1]==="!"&&(B=E.indexOf(" ",B+1)),(B===-1||O<B)&&(j=!0)}j||($=`
|
|
51
51
|
${t.indent}`)}}else(E===""||E[0]===`
|
|
52
|
-
`)&&($="");return m+=$+E,t.inFlow?b&&n&&n():g&&!b?m+=zs.lineComment(m,t.indent,l(g)):u&&s&&s(),m}
|
|
52
|
+
`)&&($="");return m+=$+E,t.inFlow?b&&n&&n():g&&!b?m+=zs.lineComment(m,t.indent,l(g)):u&&s&&s(),m}Rg.stringifyPair=vA});var xu=w(Ru=>{"use strict";var Fg=V("process");function bA(r,...e){r==="debug"&&console.log(...e)}function wA(r,e){(r==="debug"||r==="warn")&&(typeof Fg.emitWarning=="function"?Fg.emitWarning(e):console.warn(e))}Ru.debug=bA;Ru.warn=wA});var Lo=w(Co=>{"use strict";var ko=H(),Ug=me(),Ao="<<",Po={identify:r=>r===Ao||typeof r=="symbol"&&r.description===Ao,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ug.Scalar(Symbol(Ao)),{addToJSMap:Bg}),stringify:()=>Ao},EA=(r,e)=>(Po.identify(e)||ko.isScalar(e)&&(!e.type||e.type===Ug.Scalar.PLAIN)&&Po.identify(e.value))&&r?.doc.schema.tags.some(t=>t.tag===Po.tag&&t.default);function Bg(r,e,t){let n=Vg(r,t);if(ko.isSeq(n))for(let s of n.items)Fu(r,e,s);else if(Array.isArray(n))for(let s of n)Fu(r,e,s);else Fu(r,e,n)}function Fu(r,e,t){let n=Vg(r,t);if(!ko.isMap(n))throw new Error("Merge sources must be maps or map aliases");let s=n.toJSON(null,r,Map);for(let[i,o]of s)e instanceof Map?e.has(i)||e.set(i,o):e instanceof Set?e.add(i):Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Vg(r,e){return r&&ko.isAlias(e)?e.resolve(r.doc,r):e}Co.addMergeToJSMap=Bg;Co.isMergeKey=EA;Co.merge=Po});var Bu=w(Hg=>{"use strict";var $A=xu(),zg=Lo(),SA=Vs(),Kg=H(),Uu=or();function TA(r,e,{key:t,value:n}){if(Kg.isNode(t)&&t.addToJSMap)t.addToJSMap(r,e,n);else if(zg.isMergeKey(r,t))zg.addMergeToJSMap(r,e,n);else{let s=Uu.toJS(t,"",r);if(e instanceof Map)e.set(s,Uu.toJS(n,s,r));else if(e instanceof Set)e.add(s);else{let i=OA(t,s,r),o=Uu.toJS(n,i,r);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function OA(r,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Kg.isNode(r)&&t?.doc){let n=SA.createStringifyContext(t.doc,{});n.anchors=new Set;for(let i of t.anchors.keys())n.anchors.add(i.anchor);n.inFlow=!0,n.inStringifyKey=!0;let s=r.toString(n);if(!t.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),$A.warn(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return s}return JSON.stringify(e)}Hg.addPairToJSMap=TA});var ur=w(Vu=>{"use strict";var Gg=Rs(),NA=xg(),IA=Bu(),Do=H();function AA(r,e,t){let n=Gg.createNode(r,void 0,t),s=Gg.createNode(e,void 0,t);return new qo(n,s)}var qo=class r{constructor(e,t=null){Object.defineProperty(this,Do.NODE_TYPE,{value:Do.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Do.isNode(t)&&(t=t.clone(e)),Do.isNode(n)&&(n=n.clone(e)),new r(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return IA.addPairToJSMap(t,n,this)}toString(e,t,n){return e?.doc?NA.stringifyPair(this,e,t,n):JSON.stringify(this)}};Vu.Pair=qo;Vu.createPair=AA});var zu=w(Zg=>{"use strict";var Mr=H(),Yg=Vs(),Mo=xs();function PA(r,e,t){return(e.inFlow??r.flow?CA:kA)(r,e,t)}function kA({comment:r,items:e},t,{blockItemPrefix:n,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){let{indent:c,options:{commentString:l}}=t,h=Object.assign({},t,{indent:i,type:null}),f=!1,d=[];for(let y=0;y<e.length;++y){let u=e[y],m=null;if(Mr.isNode(u))!f&&u.spaceBefore&&d.push(""),jo(t,d,u.commentBefore,f),u.comment&&(m=u.comment);else if(Mr.isPair(u)){let v=Mr.isNode(u.key)?u.key:null;v&&(!f&&v.spaceBefore&&d.push(""),jo(t,d,v.commentBefore,f))}f=!1;let _=Yg.stringify(u,h,()=>m=null,()=>f=!0);m&&(_+=Mo.lineComment(_,i,l(m))),f&&m&&(f=!1),d.push(n+_)}let p;if(d.length===0)p=s.start+s.end;else{p=d[0];for(let y=1;y<d.length;++y){let u=d[y];p+=u?`
|
|
53
53
|
${c}${u}`:`
|
|
54
54
|
`}}return r?(p+=`
|
|
55
|
-
`+Mo.indentComment(l(r),c),a&&a()):f&&o&&o(),p}function
|
|
55
|
+
`+Mo.indentComment(l(r),c),a&&a()):f&&o&&o(),p}function CA({items:r},e,{flowChars:t,itemIndent:n}){let{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;n+=i;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),l=!1,h=0,f=[];for(let y=0;y<r.length;++y){let u=r[y],m=null;if(Mr.isNode(u))u.spaceBefore&&f.push(""),jo(e,f,u.commentBefore,!1),u.comment&&(m=u.comment);else if(Mr.isPair(u)){let v=Mr.isNode(u.key)?u.key:null;v&&(v.spaceBefore&&f.push(""),jo(e,f,v.commentBefore,!1),v.comment&&(l=!0));let g=Mr.isNode(u.value)?u.value:null;g?(g.comment&&(m=g.comment),g.commentBefore&&(l=!0)):u.value==null&&v?.comment&&(m=v.comment)}m&&(l=!0);let _=Yg.stringify(u,c,()=>m=null);l||(l=f.length>h||_.includes(`
|
|
56
56
|
`)),y<r.length-1?_+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((v,g)=>v+g.length+2,2)+(_.length+2)>e.options.lineWidth)),l&&(_+=",")),m&&(_+=Mo.lineComment(_,n,a(m))),f.push(_),h=f.length}let{start:d,end:p}=t;if(f.length===0)return d+p;if(!l){let y=f.reduce((u,m)=>u+m.length+2,2);l=e.options.lineWidth>0&&y>e.options.lineWidth}if(l){let y=d;for(let u of f)y+=u?`
|
|
57
57
|
${i}${s}${u}`:`
|
|
58
58
|
`;return`${y}
|
|
59
|
-
${s}${p}`}else return`${d}${o}${f.join(" ")}${o}${p}`}function jo({indent:r,options:{commentString:e}},t,n,s){if(n&&s&&(n=n.replace(/^\n+/,"")),n){let i=Mo.indentComment(e(n),r);t.push(i.trimStart())}}
|
|
60
|
-
`:" ")}return
|
|
59
|
+
${s}${p}`}else return`${d}${o}${f.join(" ")}${o}${p}`}function jo({indent:r,options:{commentString:e}},t,n,s){if(n&&s&&(n=n.replace(/^\n+/,"")),n){let i=Mo.indentComment(e(n),r);t.push(i.trimStart())}}Zg.stringifyCollection=PA});var dr=w(Hu=>{"use strict";var LA=zu(),DA=Bu(),qA=$o(),fr=H(),Ro=ur(),MA=me();function Ks(r,e){let t=fr.isScalar(e)?e.value:e;for(let n of r)if(fr.isPair(n)&&(n.key===e||n.key===t||fr.isScalar(n.key)&&n.key.value===t))return n}var Ku=class extends qA.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(fr.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:s,replacer:i}=n,o=new this(e),a=(c,l)=>{if(typeof i=="function")l=i.call(t,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(Ro.createPair(c,l,n))};if(t instanceof Map)for(let[c,l]of t)a(c,l);else if(t&&typeof t=="object")for(let c of Object.keys(t))a(c,t[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;fr.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Ro.Pair(e,e?.value):n=new Ro.Pair(e.key,e.value);let s=Ks(this.items,n.key),i=this.schema?.sortMapEntries;if(s){if(!t)throw new Error(`Key ${n.key} already set`);fr.isScalar(s.value)&&MA.isScalarValue(n.value)?s.value.value=n.value:s.value=n.value}else if(i){let o=this.items.findIndex(a=>i(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let t=Ks(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let s=Ks(this.items,e)?.value;return(!t&&fr.isScalar(s)?s.value:s)??void 0}has(e){return!!Ks(this.items,e)}set(e,t){this.add(new Ro.Pair(e,t),!0)}toJSON(e,t,n){let s=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(s);for(let i of this.items)DA.addPairToJSMap(t,s,i);return s}toString(e,t,n){if(!e)return JSON.stringify(this);for(let s of this.items)if(!fr.isPair(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),LA.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}};Hu.YAMLMap=Ku;Hu.findPair=Ks});var Nn=w(Wg=>{"use strict";var jA=H(),Jg=dr(),RA={collection:"map",default:!0,nodeClass:Jg.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(r,e){return jA.isMap(r)||e("Expected a mapping for this tag"),r},createNode:(r,e,t)=>Jg.YAMLMap.from(r,e,t)};Wg.map=RA});var pr=w(Xg=>{"use strict";var xA=Rs(),FA=zu(),UA=$o(),Fo=H(),BA=me(),VA=or(),Gu=class extends UA.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Fo.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=xo(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){let n=xo(e);if(typeof n!="number")return;let s=this.items[n];return!t&&Fo.isScalar(s)?s.value:s}has(e){let t=xo(e);return typeof t=="number"&&t<this.items.length}set(e,t){let n=xo(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let s=this.items[n];Fo.isScalar(s)&&BA.isScalarValue(t)?s.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let s=0;for(let i of this.items)n.push(VA.toJS(i,String(s++),t));return n}toString(e,t,n){return e?FA.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:s}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof s=="function"){let c=t instanceof Set?a:String(o++);a=s.call(t,c,a)}i.items.push(xA.createNode(a,void 0,n))}}return i}};function xo(r){let e=Fo.isScalar(r)?r.value:r;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Xg.YAMLSeq=Gu});var In=w(e0=>{"use strict";var zA=H(),Qg=pr(),KA={collection:"seq",default:!0,nodeClass:Qg.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(r,e){return zA.isSeq(r)||e("Expected a sequence for this tag"),r},createNode:(r,e,t)=>Qg.YAMLSeq.from(r,e,t)};e0.seq=KA});var Hs=w(t0=>{"use strict";var HA=Bs(),GA={identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify(r,e,t,n){return e=Object.assign({actualString:!0},e),HA.stringifyString(r,e,t,n)}};t0.string=GA});var Uo=w(s0=>{"use strict";var r0=me(),n0={identify:r=>r==null,createNode:()=>new r0.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new r0.Scalar(null),stringify:({source:r},e)=>typeof r=="string"&&n0.test.test(r)?r:e.options.nullStr};s0.nullTag=n0});var Yu=w(o0=>{"use strict";var YA=me(),i0={identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:r=>new YA.Scalar(r[0]==="t"||r[0]==="T"),stringify({source:r,value:e},t){if(r&&i0.test.test(r)){let n=r[0]==="t"||r[0]==="T";if(e===n)return r}return e?t.options.trueStr:t.options.falseStr}};o0.boolTag=i0});var An=w(a0=>{"use strict";function ZA({format:r,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);let s=typeof n=="number"?n:Number(n);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(n,-0)?"-0":JSON.stringify(n);if(!r&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}a0.stringifyNumber=ZA});var Ju=w(Bo=>{"use strict";var JA=me(),Zu=An(),WA={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Zu.stringifyNumber},XA={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():Zu.stringifyNumber(r)}},QA={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(r){let e=new JA.Scalar(parseFloat(r)),t=r.indexOf(".");return t!==-1&&r[r.length-1]==="0"&&(e.minFractionDigits=r.length-t-1),e},stringify:Zu.stringifyNumber};Bo.float=QA;Bo.floatExp=XA;Bo.floatNaN=WA});var Xu=w(zo=>{"use strict";var c0=An(),Vo=r=>typeof r=="bigint"||Number.isInteger(r),Wu=(r,e,t,{intAsBigInt:n})=>n?BigInt(r):parseInt(r.substring(e),t);function l0(r,e,t){let{value:n}=r;return Vo(n)&&n>=0?t+n.toString(e):c0.stringifyNumber(r)}var eP={identify:r=>Vo(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(r,e,t)=>Wu(r,2,8,t),stringify:r=>l0(r,8,"0o")},tP={identify:Vo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(r,e,t)=>Wu(r,0,10,t),stringify:c0.stringifyNumber},rP={identify:r=>Vo(r)&&r>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(r,e,t)=>Wu(r,2,16,t),stringify:r=>l0(r,16,"0x")};zo.int=tP;zo.intHex=rP;zo.intOct=eP});var f0=w(u0=>{"use strict";var nP=Nn(),sP=Uo(),iP=In(),oP=Hs(),aP=Yu(),Qu=Ju(),ef=Xu(),cP=[nP.map,iP.seq,oP.string,sP.nullTag,aP.boolTag,ef.intOct,ef.int,ef.intHex,Qu.floatNaN,Qu.floatExp,Qu.float];u0.schema=cP});var h0=w(p0=>{"use strict";var lP=me(),uP=Nn(),fP=In();function d0(r){return typeof r=="bigint"||Number.isInteger(r)}var Ko=({value:r})=>JSON.stringify(r),dP=[{identify:r=>typeof r=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:r=>r,stringify:Ko},{identify:r=>r==null,createNode:()=>new lP.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ko},{identify:r=>typeof r=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:r=>r==="true",stringify:Ko},{identify:d0,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(r,e,{intAsBigInt:t})=>t?BigInt(r):parseInt(r,10),stringify:({value:r})=>d0(r)?r.toString():JSON.stringify(r)},{identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:r=>parseFloat(r),stringify:Ko}],pP={default:!0,tag:"",test:/^/,resolve(r,e){return e(`Unresolved plain scalar ${JSON.stringify(r)}`),r}},hP=[uP.map,fP.seq].concat(dP,pP);p0.schema=hP});var rf=w(m0=>{"use strict";var Gs=V("buffer"),tf=me(),mP=Bs(),yP={identify:r=>r instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(r,e){if(typeof Gs.Buffer=="function")return Gs.Buffer.from(r,"base64");if(typeof atob=="function"){let t=atob(r.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let s=0;s<t.length;++s)n[s]=t.charCodeAt(s);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),r},stringify({comment:r,type:e,value:t},n,s,i){if(!t)return"";let o=t,a;if(typeof Gs.Buffer=="function")a=o instanceof Gs.Buffer?o.toString("base64"):Gs.Buffer.from(o.buffer).toString("base64");else 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(e??(e=tf.Scalar.BLOCK_LITERAL),e!==tf.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),h=new Array(l);for(let f=0,d=0;f<l;++f,d+=c)h[f]=a.substr(d,c);a=h.join(e===tf.Scalar.BLOCK_LITERAL?`
|
|
60
|
+
`:" ")}return mP.stringifyString({comment:r,type:e,value:a},n,s,i)}};m0.binary=yP});var Yo=w(Go=>{"use strict";var Ho=H(),nf=ur(),gP=me(),_P=pr();function y0(r,e){if(Ho.isSeq(r))for(let t=0;t<r.items.length;++t){let n=r.items[t];if(!Ho.isPair(n)){if(Ho.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let s=n.items[0]||new nf.Pair(new gP.Scalar(null));if(n.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${n.commentBefore}
|
|
61
61
|
${s.key.commentBefore}`:n.commentBefore),n.comment){let i=s.value??s.key;i.comment=i.comment?`${n.comment}
|
|
62
|
-
${i.comment}`:n.comment}n=s}r.items[t]=Ho.isPair(n)?n:new nf.Pair(n)}}else e("Expected a sequence for this tag");return r}function _0(r,e,t){let{replacer:n}=t,s=new vP.YAMLSeq(r);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,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){let 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(nf.createPair(a,c,t))}return s}var bP={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:g0,createNode:_0};Go.createPairs=_0;Go.pairs=bP;Go.resolvePairs=g0});var af=w(of=>{"use strict";var v0=H(),sf=or(),Ys=dr(),wP=pr(),b0=Yo(),jr=class r extends wP.YAMLSeq{constructor(){super(),this.add=Ys.YAMLMap.prototype.add.bind(this),this.delete=Ys.YAMLMap.prototype.delete.bind(this),this.get=Ys.YAMLMap.prototype.get.bind(this),this.has=Ys.YAMLMap.prototype.has.bind(this),this.set=Ys.YAMLMap.prototype.set.bind(this),this.tag=r.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let s of this.items){let i,o;if(v0.isPair(s)?(i=sf.toJS(s.key,"",t),o=sf.toJS(s.value,i,t)):i=sf.toJS(s,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,o)}return n}static from(e,t,n){let s=b0.createPairs(e,t,n),i=new this;return i.items=s.items,i}};jr.tag="tag:yaml.org,2002:omap";var EP={collection:"seq",identify:r=>r instanceof Map,nodeClass:jr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(r,e){let t=b0.resolvePairs(r,e),n=[];for(let{key:s}of t.items)v0.isScalar(s)&&(n.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):n.push(s.value));return Object.assign(new jr,t)},createNode:(r,e,t)=>jr.from(r,e,t)};of.YAMLOMap=jr;of.omap=EP});var T0=w(cf=>{"use strict";var w0=me();function E0({value:r,source:e},t){return e&&(r?$0:S0).test.test(e)?e:r?t.options.trueStr:t.options.falseStr}var $0={identify:r=>r===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new w0.Scalar(!0),stringify:E0},S0={identify:r=>r===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new w0.Scalar(!1),stringify:E0};cf.falseTag=S0;cf.trueTag=$0});var O0=w(Zo=>{"use strict";var $P=me(),lf=An(),SP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:lf.stringifyNumber},TP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r.replace(/_/g,"")),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():lf.stringifyNumber(r)}},OP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(r){let e=new $P.Scalar(parseFloat(r.replace(/_/g,""))),t=r.indexOf(".");if(t!==-1){let n=r.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:lf.stringifyNumber};Zo.float=OP;Zo.floatExp=TP;Zo.floatNaN=SP});var I0=w(Js=>{"use strict";var N0=An(),Zs=r=>typeof r=="bigint"||Number.isInteger(r);function Jo(r,e,t,{intAsBigInt:n}){let s=r[0];if((s==="-"||s==="+")&&(e+=1),r=r.substring(e).replace(/_/g,""),n){switch(t){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let o=BigInt(r);return s==="-"?BigInt(-1)*o:o}let i=parseInt(r,t);return s==="-"?-1*i:i}function uf(r,e,t){let{value:n}=r;if(Zs(n)){let s=n.toString(e);return n<0?"-"+t+s.substr(1):t+s}return N0.stringifyNumber(r)}var NP={identify:Zs,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(r,e,t)=>Jo(r,2,2,t),stringify:r=>uf(r,2,"0b")},IP={identify:Zs,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(r,e,t)=>Jo(r,1,8,t),stringify:r=>uf(r,8,"0")},AP={identify:Zs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(r,e,t)=>Jo(r,0,10,t),stringify:N0.stringifyNumber},PP={identify:Zs,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(r,e,t)=>Jo(r,2,16,t),stringify:r=>uf(r,16,"0x")};Js.int=AP;Js.intBin=NP;Js.intHex=PP;Js.intOct=IP});var df=w(ff=>{"use strict";var Qo=H(),Wo=ur(),Xo=dr(),Rr=class r extends Xo.YAMLMap{constructor(e){super(e),this.tag=r.tag}add(e){let t;Qo.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Wo.Pair(e.key,null):t=new Wo.Pair(e,null),Xo.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Xo.findPair(this.items,e);return!t&&Qo.isPair(n)?Qo.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Xo.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Wo.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:s}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof s=="function"&&(o=s.call(t,o,o)),i.items.push(Wo.createPair(o,null,n));return i}};Rr.tag="tag:yaml.org,2002:set";var kP={collection:"map",identify:r=>r instanceof Set,nodeClass:Rr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(r,e,t)=>Rr.from(r,e,t),resolve(r,e){if(Qo.isMap(r)){if(r.hasAllNullValues(!0))return Object.assign(new Rr,r);e("Set items must all have null values")}else e("Expected a mapping for this tag");return r}};ff.YAMLSet=Rr;ff.set=kP});var hf=w(ea=>{"use strict";var CP=An();function pf(r,e){let t=r[0],n=t==="-"||t==="+"?r.substring(1):r,s=o=>e?BigInt(o):Number(o),i=n.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return t==="-"?s(-1)*i:i}function A0(r){let{value:e}=r,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return CP.stringifyNumber(r);let n="";e<0&&(n="-",e*=t(-1));let s=t(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),n+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var LP={identify:r=>typeof r=="bigint"||Number.isInteger(r),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(r,e,{intAsBigInt:t})=>pf(r,t),stringify:A0},DP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:r=>pf(r,!1),stringify:A0},P0={identify:r=>r 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(r){let e=r.match(P0.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,n-1,s,i||0,o||0,a||0,c),h=e[8];if(h&&h!=="Z"){let f=pf(h,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:r})=>r?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};ea.floatTime=DP;ea.intTime=LP;ea.timestamp=P0});var L0=w(C0=>{"use strict";var qP=Nn(),MP=Uo(),jP=In(),RP=Hs(),xP=rf(),k0=T0(),mf=O0(),ta=I0(),FP=Lo(),UP=af(),BP=Yo(),VP=df(),yf=hf(),zP=[qP.map,jP.seq,RP.string,MP.nullTag,k0.trueTag,k0.falseTag,ta.intBin,ta.intOct,ta.int,ta.intHex,mf.floatNaN,mf.floatExp,mf.float,xP.binary,FP.merge,UP.omap,BP.pairs,VP.set,yf.intTime,yf.floatTime,yf.timestamp];C0.schema=zP});var V0=w(vf=>{"use strict";var j0=Nn(),KP=Uo(),R0=In(),HP=Hs(),GP=Yu(),gf=Ju(),_f=Xu(),YP=d0(),ZP=m0(),x0=rf(),Ws=Lo(),F0=af(),U0=Yo(),D0=L0(),B0=df(),ra=hf(),q0=new Map([["core",YP.schema],["failsafe",[j0.map,R0.seq,HP.string]],["json",ZP.schema],["yaml11",D0.schema],["yaml-1.1",D0.schema]]),M0={binary:x0.binary,bool:GP.boolTag,float:gf.float,floatExp:gf.floatExp,floatNaN:gf.floatNaN,floatTime:ra.floatTime,int:_f.int,intHex:_f.intHex,intOct:_f.intOct,intTime:ra.intTime,map:j0.map,merge:Ws.merge,null:KP.nullTag,omap:F0.omap,pairs:U0.pairs,seq:R0.seq,set:B0.set,timestamp:ra.timestamp},JP={"tag:yaml.org,2002:binary":x0.binary,"tag:yaml.org,2002:merge":Ws.merge,"tag:yaml.org,2002:omap":F0.omap,"tag:yaml.org,2002:pairs":U0.pairs,"tag:yaml.org,2002:set":B0.set,"tag:yaml.org,2002:timestamp":ra.timestamp};function WP(r,e,t){let n=q0.get(e);if(n&&!r)return t&&!n.includes(Ws.merge)?n.concat(Ws.merge):n.slice();let s=n;if(!s)if(Array.isArray(r))s=[];else{let i=Array.from(q0.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(r))for(let i of r)s=s.concat(i);else typeof r=="function"&&(s=r(s.slice()));return t&&(s=s.concat(Ws.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?M0[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(M0).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},[])}vf.coreKnownTags=JP;vf.getTags=WP});var Ef=w(z0=>{"use strict";var bf=H(),XP=Nn(),QP=In(),ek=Hs(),na=V0(),tk=(r,e)=>r.key<e.key?-1:r.key>e.key?1:0,wf=class r{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?na.getTags(e,"compat"):e?na.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?na.coreKnownTags:{},this.tags=na.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,bf.MAP,{value:XP.map}),Object.defineProperty(this,bf.SCALAR,{value:ek.string}),Object.defineProperty(this,bf.SEQ,{value:QP.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?tk:null}clone(){let e=Object.create(r.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};z0.Schema=wf});var H0=w(K0=>{"use strict";var rk=H(),$f=Vs(),Xs=xs();function nk(r,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&r.directives){let c=r.directives.toString(r);c?(t.push(c),n=!0):r.directives.docStart&&(n=!0)}n&&t.push("---");let s=$f.createStringifyContext(r,e),{commentString:i}=s.options;if(r.commentBefore){t.length!==1&&t.unshift("");let c=i(r.commentBefore);t.unshift(Xs.indentComment(c,""))}let o=!1,a=null;if(r.contents){if(rk.isNode(r.contents)){if(r.contents.spaceBefore&&n&&t.push(""),r.contents.commentBefore){let h=i(r.contents.commentBefore);t.push(Xs.indentComment(h,""))}s.forceBlockIndent=!!r.comment,a=r.contents.comment}let c=a?void 0:()=>o=!0,l=$f.stringify(r.contents,s,()=>a=null,c);a&&(l+=Xs.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push($f.stringify(r.contents,s));if(r.directives?.docEnd)if(r.comment){let c=i(r.comment);c.includes(`
|
|
62
|
+
${i.comment}`:n.comment}n=s}r.items[t]=Ho.isPair(n)?n:new nf.Pair(n)}}else e("Expected a sequence for this tag");return r}function g0(r,e,t){let{replacer:n}=t,s=new _P.YAMLSeq(r);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,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){let 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(nf.createPair(a,c,t))}return s}var vP={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:y0,createNode:g0};Go.createPairs=g0;Go.pairs=vP;Go.resolvePairs=y0});var af=w(of=>{"use strict";var _0=H(),sf=or(),Ys=dr(),bP=pr(),v0=Yo(),jr=class r extends bP.YAMLSeq{constructor(){super(),this.add=Ys.YAMLMap.prototype.add.bind(this),this.delete=Ys.YAMLMap.prototype.delete.bind(this),this.get=Ys.YAMLMap.prototype.get.bind(this),this.has=Ys.YAMLMap.prototype.has.bind(this),this.set=Ys.YAMLMap.prototype.set.bind(this),this.tag=r.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let s of this.items){let i,o;if(_0.isPair(s)?(i=sf.toJS(s.key,"",t),o=sf.toJS(s.value,i,t)):i=sf.toJS(s,"",t),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,o)}return n}static from(e,t,n){let s=v0.createPairs(e,t,n),i=new this;return i.items=s.items,i}};jr.tag="tag:yaml.org,2002:omap";var wP={collection:"seq",identify:r=>r instanceof Map,nodeClass:jr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(r,e){let t=v0.resolvePairs(r,e),n=[];for(let{key:s}of t.items)_0.isScalar(s)&&(n.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):n.push(s.value));return Object.assign(new jr,t)},createNode:(r,e,t)=>jr.from(r,e,t)};of.YAMLOMap=jr;of.omap=wP});var S0=w(cf=>{"use strict";var b0=me();function w0({value:r,source:e},t){return e&&(r?E0:$0).test.test(e)?e:r?t.options.trueStr:t.options.falseStr}var E0={identify:r=>r===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new b0.Scalar(!0),stringify:w0},$0={identify:r=>r===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new b0.Scalar(!1),stringify:w0};cf.falseTag=$0;cf.trueTag=E0});var T0=w(Zo=>{"use strict";var EP=me(),lf=An(),$P={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:lf.stringifyNumber},SP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r.replace(/_/g,"")),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():lf.stringifyNumber(r)}},TP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(r){let e=new EP.Scalar(parseFloat(r.replace(/_/g,""))),t=r.indexOf(".");if(t!==-1){let n=r.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:lf.stringifyNumber};Zo.float=TP;Zo.floatExp=SP;Zo.floatNaN=$P});var N0=w(Js=>{"use strict";var O0=An(),Zs=r=>typeof r=="bigint"||Number.isInteger(r);function Jo(r,e,t,{intAsBigInt:n}){let s=r[0];if((s==="-"||s==="+")&&(e+=1),r=r.substring(e).replace(/_/g,""),n){switch(t){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let o=BigInt(r);return s==="-"?BigInt(-1)*o:o}let i=parseInt(r,t);return s==="-"?-1*i:i}function uf(r,e,t){let{value:n}=r;if(Zs(n)){let s=n.toString(e);return n<0?"-"+t+s.substr(1):t+s}return O0.stringifyNumber(r)}var OP={identify:Zs,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(r,e,t)=>Jo(r,2,2,t),stringify:r=>uf(r,2,"0b")},NP={identify:Zs,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(r,e,t)=>Jo(r,1,8,t),stringify:r=>uf(r,8,"0")},IP={identify:Zs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(r,e,t)=>Jo(r,0,10,t),stringify:O0.stringifyNumber},AP={identify:Zs,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(r,e,t)=>Jo(r,2,16,t),stringify:r=>uf(r,16,"0x")};Js.int=IP;Js.intBin=OP;Js.intHex=AP;Js.intOct=NP});var df=w(ff=>{"use strict";var Qo=H(),Wo=ur(),Xo=dr(),Rr=class r extends Xo.YAMLMap{constructor(e){super(e),this.tag=r.tag}add(e){let t;Qo.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new Wo.Pair(e.key,null):t=new Wo.Pair(e,null),Xo.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=Xo.findPair(this.items,e);return!t&&Qo.isPair(n)?Qo.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Xo.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Wo.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:s}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof s=="function"&&(o=s.call(t,o,o)),i.items.push(Wo.createPair(o,null,n));return i}};Rr.tag="tag:yaml.org,2002:set";var PP={collection:"map",identify:r=>r instanceof Set,nodeClass:Rr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(r,e,t)=>Rr.from(r,e,t),resolve(r,e){if(Qo.isMap(r)){if(r.hasAllNullValues(!0))return Object.assign(new Rr,r);e("Set items must all have null values")}else e("Expected a mapping for this tag");return r}};ff.YAMLSet=Rr;ff.set=PP});var hf=w(ea=>{"use strict";var kP=An();function pf(r,e){let t=r[0],n=t==="-"||t==="+"?r.substring(1):r,s=o=>e?BigInt(o):Number(o),i=n.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return t==="-"?s(-1)*i:i}function I0(r){let{value:e}=r,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return kP.stringifyNumber(r);let n="";e<0&&(n="-",e*=t(-1));let s=t(60),i=[e%s];return e<60?i.unshift(0):(e=(e-i[0])/s,i.unshift(e%s),e>=60&&(e=(e-i[0])/s,i.unshift(e))),n+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var CP={identify:r=>typeof r=="bigint"||Number.isInteger(r),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(r,e,{intAsBigInt:t})=>pf(r,t),stringify:I0},LP={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:r=>pf(r,!1),stringify:I0},A0={identify:r=>r 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(r){let e=r.match(A0.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(t,n-1,s,i||0,o||0,a||0,c),h=e[8];if(h&&h!=="Z"){let f=pf(h,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:r})=>r?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};ea.floatTime=LP;ea.intTime=CP;ea.timestamp=A0});var C0=w(k0=>{"use strict";var DP=Nn(),qP=Uo(),MP=In(),jP=Hs(),RP=rf(),P0=S0(),mf=T0(),ta=N0(),xP=Lo(),FP=af(),UP=Yo(),BP=df(),yf=hf(),VP=[DP.map,MP.seq,jP.string,qP.nullTag,P0.trueTag,P0.falseTag,ta.intBin,ta.intOct,ta.int,ta.intHex,mf.floatNaN,mf.floatExp,mf.float,RP.binary,xP.merge,FP.omap,UP.pairs,BP.set,yf.intTime,yf.floatTime,yf.timestamp];k0.schema=VP});var B0=w(vf=>{"use strict";var M0=Nn(),zP=Uo(),j0=In(),KP=Hs(),HP=Yu(),gf=Ju(),_f=Xu(),GP=f0(),YP=h0(),R0=rf(),Ws=Lo(),x0=af(),F0=Yo(),L0=C0(),U0=df(),ra=hf(),D0=new Map([["core",GP.schema],["failsafe",[M0.map,j0.seq,KP.string]],["json",YP.schema],["yaml11",L0.schema],["yaml-1.1",L0.schema]]),q0={binary:R0.binary,bool:HP.boolTag,float:gf.float,floatExp:gf.floatExp,floatNaN:gf.floatNaN,floatTime:ra.floatTime,int:_f.int,intHex:_f.intHex,intOct:_f.intOct,intTime:ra.intTime,map:M0.map,merge:Ws.merge,null:zP.nullTag,omap:x0.omap,pairs:F0.pairs,seq:j0.seq,set:U0.set,timestamp:ra.timestamp},ZP={"tag:yaml.org,2002:binary":R0.binary,"tag:yaml.org,2002:merge":Ws.merge,"tag:yaml.org,2002:omap":x0.omap,"tag:yaml.org,2002:pairs":F0.pairs,"tag:yaml.org,2002:set":U0.set,"tag:yaml.org,2002:timestamp":ra.timestamp};function JP(r,e,t){let n=D0.get(e);if(n&&!r)return t&&!n.includes(Ws.merge)?n.concat(Ws.merge):n.slice();let s=n;if(!s)if(Array.isArray(r))s=[];else{let i=Array.from(D0.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${i} or define customTags array`)}if(Array.isArray(r))for(let i of r)s=s.concat(i);else typeof r=="function"&&(s=r(s.slice()));return t&&(s=s.concat(Ws.merge)),s.reduce((i,o)=>{let a=typeof o=="string"?q0[o]:o;if(!a){let c=JSON.stringify(o),l=Object.keys(q0).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},[])}vf.coreKnownTags=ZP;vf.getTags=JP});var Ef=w(V0=>{"use strict";var bf=H(),WP=Nn(),XP=In(),QP=Hs(),na=B0(),ek=(r,e)=>r.key<e.key?-1:r.key>e.key?1:0,wf=class r{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?na.getTags(e,"compat"):e?na.getTags(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?na.coreKnownTags:{},this.tags=na.getTags(t,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,bf.MAP,{value:WP.map}),Object.defineProperty(this,bf.SCALAR,{value:QP.string}),Object.defineProperty(this,bf.SEQ,{value:XP.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?ek:null}clone(){let e=Object.create(r.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};V0.Schema=wf});var K0=w(z0=>{"use strict";var tk=H(),$f=Vs(),Xs=xs();function rk(r,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&r.directives){let c=r.directives.toString(r);c?(t.push(c),n=!0):r.directives.docStart&&(n=!0)}n&&t.push("---");let s=$f.createStringifyContext(r,e),{commentString:i}=s.options;if(r.commentBefore){t.length!==1&&t.unshift("");let c=i(r.commentBefore);t.unshift(Xs.indentComment(c,""))}let o=!1,a=null;if(r.contents){if(tk.isNode(r.contents)){if(r.contents.spaceBefore&&n&&t.push(""),r.contents.commentBefore){let h=i(r.contents.commentBefore);t.push(Xs.indentComment(h,""))}s.forceBlockIndent=!!r.comment,a=r.contents.comment}let c=a?void 0:()=>o=!0,l=$f.stringify(r.contents,s,()=>a=null,c);a&&(l+=Xs.lineComment(l,"",i(a))),(l[0]==="|"||l[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${l}`:t.push(l)}else t.push($f.stringify(r.contents,s));if(r.directives?.docEnd)if(r.comment){let c=i(r.comment);c.includes(`
|
|
63
63
|
`)?(t.push("..."),t.push(Xs.indentComment(c,""))):t.push(`... ${c}`)}else t.push("...");else{let c=r.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(Xs.indentComment(i(c),"")))}return t.join(`
|
|
64
64
|
`)+`
|
|
65
|
-
`}
|
|
65
|
+
`}z0.stringifyDocument=rk});var Qs=w(H0=>{"use strict";var nk=js(),Pn=$o(),st=H(),sk=ur(),ik=or(),ok=Ef(),ak=K0(),Sf=vo(),ck=Nu(),lk=Rs(),Tf=Ou(),Of=class r{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,st.NODE_TYPE,{value:st.DOC});let s=null;typeof t=="function"||Array.isArray(t)?s=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Tf.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,s,n)}clone(){let e=Object.create(r.prototype,{[st.NODE_TYPE]:{value:st.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=st.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){kn(this.contents)&&this.contents.add(e)}addIn(e,t){kn(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=Sf.anchorNames(this);e.anchor=!t||n.has(t)?Sf.findNewAnchor(t||"a",n):t}return new nk.Alias(e.anchor)}createNode(e,t,n){let s;if(typeof t=="function")e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){let m=v=>typeof v=="number"||v instanceof String||v instanceof Number,_=t.filter(m).map(String);_.length>0&&(t=t.concat(_)),s=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:h}=n??{},{onAnchor:f,setAnchors:d,sourceObjects:p}=Sf.createNodeAnchors(this,o||"a"),y={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:p},u=lk.createNode(e,h,y);return a&&st.isCollection(u)&&(u.flow=!0),d(),u}createPair(e,t,n={}){let s=this.createNode(e,null,n),i=this.createNode(t,null,n);return new sk.Pair(s,i)}delete(e){return kn(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Pn.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):kn(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return st.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Pn.isEmptyPath(e)?!t&&st.isScalar(this.contents)?this.contents.value:this.contents:st.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return st.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Pn.isEmptyPath(e)?this.contents!==void 0:st.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Pn.collectionFromPath(this.schema,[e],t):kn(this.contents)&&this.contents.set(e,t)}setIn(e,t){Pn.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=Pn.collectionFromPath(this.schema,Array.from(e),t):kn(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Tf.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Tf.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new ok.Schema(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:o}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=ik.toJS(this.contents,t??"",a);if(typeof i=="function")for(let{count:l,res:h}of a.anchors.values())i(h,l);return typeof o=="function"?ck.applyReviver(o,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return ak.stringifyDocument(this,e)}};function kn(r){if(st.isCollection(r))return!0;throw new Error("Expected a YAML collection as document contents")}H0.Document=Of});var ri=w(ti=>{"use strict";var ei=class extends Error{constructor(e,t,n,s){super(),this.name=e,this.code=n,this.message=s,this.pos=t}},Nf=class extends ei{constructor(e,t,n){super("YAMLParseError",e,t,n)}},If=class extends ei{constructor(e,t,n){super("YAMLWarning",e,t,n)}},uk=(r,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));let{line:n,col:s}=t.linePos[0];t.message+=` at line ${n}, column ${s}`;let i=s-1,o=r.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){let a=Math.min(i-39,o.length-79);o="\u2026"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,i))){let a=r.substring(e.lineStarts[n-2],e.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
66
66
|
`),o=a+o}if(/[^ ]/.test(o)){let a=1,c=t.linePos[1];c?.line===n&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));let l=" ".repeat(i)+"^".repeat(a);t.message+=`:
|
|
67
67
|
|
|
68
68
|
${o}
|
|
69
69
|
${l}
|
|
70
|
-
`}};ti.YAMLError=ei;ti.YAMLParseError=Nf;ti.YAMLWarning=If;ti.prettifyError=
|
|
71
|
-
`))return!0;if(r.end){for(let e of r.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of r.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Af(e.key)||Af(e.value))return!0}return!1;default:return!0}}
|
|
72
|
-
`+u.comment:a.comment=u.comment);continue}(u.newlineAfterProp||
|
|
73
|
-
`+g.comment:v.comment=g.comment);let b=new
|
|
74
|
-
`+$.comment:l.comment=$.comment),f=$.end;continue}!o&&t.options.strict&&
|
|
75
|
-
`+S:O.comment=S,$.comment=$.comment.substring(S.length+1)}}if(!o&&!b&&!$.found){let S=E?r(t,E,$,s):e(t,$.end,b,null,$,s);l.items.push(S),f=S.range[2],Lf(E)&&s(S.range,"BLOCK_IN_FLOW",Cf)}else{t.atKey=!0;let S=$.end,O=g?r(t,g,$,s):e(t,S,v,null,$,s);Lf(g)&&s(O.range,"BLOCK_IN_FLOW",Cf),t.atKey=!1;let A=
|
|
76
|
-
`+A.comment:O.comment=A.comment);let j=new
|
|
77
|
-
`+m.comment:l.comment=m.comment),l.range=[n.offset,u,m.offset]}else l.range=[n.offset,u,u];return l}
|
|
70
|
+
`}};ti.YAMLError=ei;ti.YAMLParseError=Nf;ti.YAMLWarning=If;ti.prettifyError=uk});var ni=w(G0=>{"use strict";function fk(r,{flow:e,indicator:t,next:n,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,h=a,f="",d="",p=!1,y=!1,u=null,m=null,_=null,v=null,g=null,b=null,E=null;for(let O of r)switch(y&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&i(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),u&&(l&&O.type!=="comment"&&O.type!=="newline"&&i(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),u=null),O.type){case"space":!e&&(t!=="doc-start"||n?.type!=="flow-collection")&&O.source.includes(" ")&&(u=O),h=!0;break;case"comment":{h||i(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=O.source.substring(1)||" ";f?f+=d+A:f=A,d="",l=!1;break}case"newline":l?f?f+=O.source:(!b||t!=="seq-item-ind")&&(c=!0):d+=O.source,l=!0,p=!0,(m||_)&&(v=O),h=!0;break;case"anchor":m&&i(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&i(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=O,E??(E=O.offset),l=!1,h=!1,y=!0;break;case"tag":{_&&i(O,"MULTIPLE_TAGS","A node can have at most one tag"),_=O,E??(E=O.offset),l=!1,h=!1,y=!0;break}case t:(m||_)&&i(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),b&&i(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${e??"collection"}`),b=O,l=t==="seq-item-ind"||t==="explicit-key-ind",h=!1;break;case"comma":if(e){g&&i(O,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),g=O,l=!1,h=!1;break}default:i(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),l=!1,h=!1}let $=r[r.length-1],S=$?$.offset+$.source.length:s;return y&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),u&&(l&&u.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&i(u,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:g,found:b,spaceBefore:c,comment:f,hasNewline:p,anchor:m,tag:_,newlineAfterProp:v,end:S,start:E??S}}G0.resolveProps=fk});var sa=w(Y0=>{"use strict";function Af(r){if(!r)return null;switch(r.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(r.source.includes(`
|
|
71
|
+
`))return!0;if(r.end){for(let e of r.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of r.items){for(let t of e.start)if(t.type==="newline")return!0;if(e.sep){for(let t of e.sep)if(t.type==="newline")return!0}if(Af(e.key)||Af(e.value))return!0}return!1;default:return!0}}Y0.containsNewline=Af});var Pf=w(Z0=>{"use strict";var dk=sa();function pk(r,e,t){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===r&&(n.source==="]"||n.source==="}")&&dk.containsNewline(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Z0.flowIndentCheck=pk});var kf=w(W0=>{"use strict";var J0=H();function hk(r,e,t){let{uniqueKeys:n}=r.options;if(n===!1)return!1;let s=typeof n=="function"?n:(i,o)=>i===o||J0.isScalar(i)&&J0.isScalar(o)&&i.value===o.value;return e.some(i=>s(i.key,t))}W0.mapIncludes=hk});var n_=w(r_=>{"use strict";var X0=ur(),mk=dr(),Q0=ni(),yk=sa(),e_=Pf(),gk=kf(),t_="All mapping items must start at the same column";function _k({composeNode:r,composeEmptyNode:e},t,n,s,i){let o=i?.nodeClass??mk.YAMLMap,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=n.offset,l=null;for(let h of n.items){let{start:f,key:d,sep:p,value:y}=h,u=Q0.resolveProps(f,{indicator:"explicit-key-ind",next:d??p?.[0],offset:c,onError:s,parentIndent:n.indent,startOnNewline:!0}),m=!u.found;if(m){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!==n.indent&&s(c,"BAD_INDENT",t_)),!u.anchor&&!u.tag&&!p){l=u.end,u.comment&&(a.comment?a.comment+=`
|
|
72
|
+
`+u.comment:a.comment=u.comment);continue}(u.newlineAfterProp||yk.containsNewline(d))&&s(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else u.found?.indent!==n.indent&&s(c,"BAD_INDENT",t_);t.atKey=!0;let _=u.end,v=d?r(t,d,u,s):e(t,_,f,null,u,s);t.schema.compat&&e_.flowIndentCheck(n.indent,d,s),t.atKey=!1,gk.mapIncludes(t,a.items,v)&&s(_,"DUPLICATE_KEY","Map keys must be unique");let g=Q0.resolveProps(p??[],{indicator:"map-value-ind",next:y,offset:v.range[2],onError:s,parentIndent:n.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=g.end,g.found){m&&(y?.type==="block-map"&&!g.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&u.start<g.found.offset-1024&&s(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let b=y?r(t,y,g,s):e(t,c,p,null,g,s);t.schema.compat&&e_.flowIndentCheck(n.indent,y,s),c=b.range[2];let E=new X0.Pair(v,b);t.options.keepSourceTokens&&(E.srcToken=h),a.items.push(E)}else{m&&s(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),g.comment&&(v.comment?v.comment+=`
|
|
73
|
+
`+g.comment:v.comment=g.comment);let b=new X0.Pair(v);t.options.keepSourceTokens&&(b.srcToken=h),a.items.push(b)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,l??c],a}r_.resolveBlockMap=_k});var i_=w(s_=>{"use strict";var vk=pr(),bk=ni(),wk=Pf();function Ek({composeNode:r,composeEmptyNode:e},t,n,s,i){let o=i?.nodeClass??vk.YAMLSeq,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=n.offset,l=null;for(let{start:h,value:f}of n.items){let d=bk.resolveProps(h,{indicator:"seq-item-ind",next:f,offset:c,onError:s,parentIndent:n.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.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}let p=f?r(t,f,d,s):e(t,d.end,h,null,d,s);t.schema.compat&&wk.flowIndentCheck(n.indent,f,s),c=p.range[2],a.items.push(p)}return a.range=[n.offset,c,l??c],a}s_.resolveBlockSeq=Ek});var Cn=w(o_=>{"use strict";function $k(r,e,t,n){let s="";if(r){let i=!1,o="";for(let a of r){let{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{t&&!i&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let h=c.substring(1)||" ";s?s+=o+h:s=h,o="";break}case"newline":s&&(o+=c),i=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:s,offset:e}}o_.resolveEnd=$k});var u_=w(l_=>{"use strict";var Sk=H(),Tk=ur(),a_=dr(),Ok=pr(),Nk=Cn(),c_=ni(),Ik=sa(),Ak=kf(),Cf="Block collections are not allowed within flow collections",Lf=r=>r&&(r.type==="block-map"||r.type==="block-seq");function Pk({composeNode:r,composeEmptyNode:e},t,n,s,i){let o=n.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?a_.YAMLMap:Ok.YAMLSeq),l=new c(t.schema);l.flow=!0;let h=t.atRoot;h&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=n.offset+n.start.source.length;for(let m=0;m<n.items.length;++m){let _=n.items[m],{start:v,key:g,sep:b,value:E}=_,$=c_.resolveProps(v,{flow:a,indicator:"explicit-key-ind",next:g??b?.[0],offset:f,onError:s,parentIndent:n.indent,startOnNewline:!1});if(!$.found){if(!$.anchor&&!$.tag&&!b&&!E){m===0&&$.comma?s($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):m<n.items.length-1&&s($.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),$.comment&&(l.comment?l.comment+=`
|
|
74
|
+
`+$.comment:l.comment=$.comment),f=$.end;continue}!o&&t.options.strict&&Ik.containsNewline(g)&&s(g,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)$.comma&&s($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if($.comma||s($.start,"MISSING_CHAR",`Missing , between ${a} items`),$.comment){let S="";e:for(let O of v)switch(O.type){case"comma":case"space":break;case"comment":S=O.source.substring(1);break e;default:break e}if(S){let O=l.items[l.items.length-1];Sk.isPair(O)&&(O=O.value??O.key),O.comment?O.comment+=`
|
|
75
|
+
`+S:O.comment=S,$.comment=$.comment.substring(S.length+1)}}if(!o&&!b&&!$.found){let S=E?r(t,E,$,s):e(t,$.end,b,null,$,s);l.items.push(S),f=S.range[2],Lf(E)&&s(S.range,"BLOCK_IN_FLOW",Cf)}else{t.atKey=!0;let S=$.end,O=g?r(t,g,$,s):e(t,S,v,null,$,s);Lf(g)&&s(O.range,"BLOCK_IN_FLOW",Cf),t.atKey=!1;let A=c_.resolveProps(b??[],{flow:a,indicator:"map-value-ind",next:E,offset:O.range[2],onError:s,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!o&&!$.found&&t.options.strict){if(b)for(let B of b){if(B===A.found)break;if(B.type==="newline"){s(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}$.start<A.found.offset-1024&&s(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?s(E,"MISSING_CHAR",`Missing space after : in ${a}`):s(A.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let x=E?r(t,E,A,s):A.found?e(t,A.end,b,null,A,s):null;x?Lf(E)&&s(x.range,"BLOCK_IN_FLOW",Cf):A.comment&&(O.comment?O.comment+=`
|
|
76
|
+
`+A.comment:O.comment=A.comment);let j=new Tk.Pair(O,x);if(t.options.keepSourceTokens&&(j.srcToken=_),o){let B=l;Ak.mapIncludes(t,B.items,O)&&s(S,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(j)}else{let B=new a_.YAMLMap(t.schema);B.flow=!0,B.items.push(j);let de=(x??O).range;B.range=[O.range[0],de[1],de[2]],l.items.push(B)}f=x?x.range[2]:A.end}}let d=o?"}":"]",[p,...y]=n.end,u=f;if(p?.source===d)u=p.offset+p.source.length;else{let m=a[0].toUpperCase()+a.substring(1),_=h?`${m} must end with a ${d}`:`${m} in block collection must be sufficiently indented and end with a ${d}`;s(f,h?"MISSING_CHAR":"BAD_INDENT",_),p&&p.source.length!==1&&y.unshift(p)}if(y.length>0){let m=Nk.resolveEnd(y,u,t.options.strict,s);m.comment&&(l.comment?l.comment+=`
|
|
77
|
+
`+m.comment:l.comment=m.comment),l.range=[n.offset,u,m.offset]}else l.range=[n.offset,u,u];return l}l_.resolveFlowCollection=Pk});var d_=w(f_=>{"use strict";var kk=H(),Ck=me(),Lk=dr(),Dk=pr(),qk=n_(),Mk=i_(),jk=u_();function Df(r,e,t,n,s,i){let o=t.type==="block-map"?qk.resolveBlockMap(r,e,t,n,i):t.type==="block-seq"?Mk.resolveBlockSeq(r,e,t,n,i):jk.resolveFlowCollection(r,e,t,n,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function Rk(r,e,t,n,s){let i=n.tag,o=i?e.directives.tagName(i.source,d=>s(i,"TAG_RESOLVE_FAILED",d)):null;if(t.type==="block-seq"){let{anchor:d,newlineAfterProp:p}=n,y=d&&i?d.offset>i.offset?d:i:d??i;y&&(!p||p.offset<y.offset)&&s(y,"MISSING_CHAR","Missing newline after block sequence props")}let a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===Lk.YAMLMap.tagName&&a==="map"||o===Dk.YAMLSeq.tagName&&a==="seq")return Df(r,e,t,s,o);let c=e.schema.tags.find(d=>d.tag===o&&d.collection===a);if(!c){let d=e.schema.knownTags[o];if(d?.collection===a)e.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),Df(r,e,t,s,o)}let l=Df(r,e,t,s,o,c),h=c.resolve?.(l,d=>s(i,"TAG_RESOLVE_FAILED",d),e.options)??l,f=kk.isNode(h)?h:new Ck.Scalar(h);return f.range=l.range,f.tag=o,c?.format&&(f.format=c.format),f}f_.composeCollection=Rk});var Mf=w(p_=>{"use strict";var qf=me();function xk(r,e,t){let n=e.offset,s=Fk(e,r.options.strict,t);if(!s)return{value:"",type:null,comment:"",range:[n,n,n]};let i=s.mode===">"?qf.Scalar.BLOCK_FOLDED:qf.Scalar.BLOCK_LITERAL,o=e.source?Uk(e.source):[],a=o.length;for(let u=o.length-1;u>=0;--u){let m=o[u][1];if(m===""||m==="\r")a=u;else break}if(a===0){let u=s.chomp==="+"&&o.length>0?`
|
|
78
78
|
`.repeat(Math.max(1,o.length-1)):"",m=n+s.length;return e.source&&(m+=e.source.length),{value:u,type:i,comment:s.comment,range:[n,m,m]}}let c=e.indent+s.indent,l=e.offset+s.length,h=0;for(let u=0;u<a;++u){let[m,_]=o[u];if(_===""||_==="\r")s.indent===0&&m.length>c&&(c=m.length);else{m.length<c&&t(l+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=m.length),h=u,c===0&&!r.atRoot&&t(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=m.length+_.length+1}for(let u=o.length-1;u>=a;--u)o[u][0].length>c&&(a=u+1);let f="",d="",p=!1;for(let u=0;u<h;++u)f+=o[u][0].slice(c)+`
|
|
79
79
|
`;for(let u=h;u<a;++u){let[m,_]=o[u];l+=m.length+_.length+1;let v=_[_.length-1]==="\r";if(v&&(_=_.slice(0,-1)),_&&m.length<c){let b=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;t(l-_.length-(v?2:1),"BAD_INDENT",b),m=""}i===qf.Scalar.BLOCK_LITERAL?(f+=d+m.slice(c)+_,d=`
|
|
80
80
|
`):m.length>c||_[0]===" "?(d===" "?d=`
|
|
@@ -89,41 +89,41 @@ ${l}
|
|
|
89
89
|
`+o[u][0].slice(c);f[f.length-1]!==`
|
|
90
90
|
`&&(f+=`
|
|
91
91
|
`);break;default:f+=`
|
|
92
|
-
`}let y=n+s.length+e.source.length;return{value:f,type:i,comment:s.comment,range:[n,y,y]}}function
|
|
92
|
+
`}let y=n+s.length+e.source.length;return{value:f,type:i,comment:s.comment,range:[n,y,y]}}function Fk({offset:r,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:s}=e[0],i=s[0],o=0,a="",c=-1;for(let d=1;d<s.length;++d){let p=s[d];if(!a&&(p==="-"||p==="+"))a=p;else{let y=Number(p);!o&&y?o=y:c===-1&&(c=r+d)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,h="",f=s.length;for(let d=1;d<e.length;++d){let p=e[d];switch(p.type){case"space":l=!0;case"newline":f+=p.source.length;break;case"comment":t&&!l&&n(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,h=p.source.substring(1);break;case"error":n(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let y=`Unexpected token in block scalar header: ${p.type}`;n(p,"UNEXPECTED_TOKEN",y);let u=p.source;u&&typeof u=="string"&&(f+=u.length)}}}return{mode:i,indent:o,chomp:a,comment:h,length:f}}function Uk(r){let e=r.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),i=[n?.[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}p_.resolveBlockScalar=xk});var Rf=w(m_=>{"use strict";var jf=me(),Bk=Cn();function Vk(r,e,t){let{offset:n,type:s,source:i,end:o}=r,a,c,l=(d,p,y)=>t(n+d,p,y);switch(s){case"scalar":a=jf.Scalar.PLAIN,c=zk(i,l);break;case"single-quoted-scalar":a=jf.Scalar.QUOTE_SINGLE,c=Kk(i,l);break;case"double-quoted-scalar":a=jf.Scalar.QUOTE_DOUBLE,c=Hk(i,l);break;default:return t(r,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[n,n+i.length,n+i.length]}}let h=n+i.length,f=Bk.resolveEnd(o,h,e,t);return{value:c,type:a,comment:f.comment,range:[n,h,f.offset]}}function zk(r,e){let t="";switch(r[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${r[0]}`;break}case"@":case"`":{t=`reserved character ${r[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),h_(r)}function Kk(r,e){return(r[r.length-1]!=="'"||r.length===1)&&e(r.length,"MISSING_CHAR","Missing closing 'quote"),h_(r.slice(1,-1)).replace(/''/g,"'")}function h_(r){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
93
93
|
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
94
94
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(r);if(!n)return r;let s=n[1],i=" ",o=e.lastIndex;for(t.lastIndex=o;n=t.exec(r);)n[1]===""?i===`
|
|
95
95
|
`?s+=i:i=`
|
|
96
|
-
`:(s+=i+n[1],i=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(r),s+i+(n?.[1]??"")}function
|
|
96
|
+
`:(s+=i+n[1],i=" "),o=t.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=o,n=a.exec(r),s+i+(n?.[1]??"")}function Hk(r,e){let t="";for(let n=1;n<r.length-1;++n){let s=r[n];if(!(s==="\r"&&r[n+1]===`
|
|
97
97
|
`))if(s===`
|
|
98
|
-
`){let{fold:i,offset:o}=
|
|
98
|
+
`){let{fold:i,offset:o}=Gk(r,n);t+=i,n=o}else if(s==="\\"){let i=r[++n],o=Yk[i];if(o)t+=o;else if(i===`
|
|
99
99
|
`)for(i=r[n+1];i===" "||i===" ";)i=r[++n+1];else if(i==="\r"&&r[n+1]===`
|
|
100
|
-
`)for(i=r[++n+1];i===" "||i===" ";)i=r[++n+1];else if(i==="x"||i==="u"||i==="U"){let a=i==="x"?2:i==="u"?4:8;t+=
|
|
100
|
+
`)for(i=r[++n+1];i===" "||i===" ";)i=r[++n+1];else if(i==="x"||i==="u"||i==="U"){let a=i==="x"?2:i==="u"?4:8;t+=Zk(r,n+1,a,e),n+=a}else{let a=r.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(s===" "||s===" "){let i=n,o=r[n+1];for(;o===" "||o===" ";)o=r[++n+1];o!==`
|
|
101
101
|
`&&!(o==="\r"&&r[n+2]===`
|
|
102
|
-
`)&&(t+=n>i?r.slice(i,n+1):s)}else t+=s}return(r[r.length-1]!=='"'||r.length===1)&&e(r.length,"MISSING_CHAR",'Missing closing "quote'),t}function
|
|
102
|
+
`)&&(t+=n>i?r.slice(i,n+1):s)}else t+=s}return(r[r.length-1]!=='"'||r.length===1)&&e(r.length,"MISSING_CHAR",'Missing closing "quote'),t}function Gk(r,e){let t="",n=r[e+1];for(;(n===" "||n===" "||n===`
|
|
103
103
|
`||n==="\r")&&!(n==="\r"&&r[e+2]!==`
|
|
104
104
|
`);)n===`
|
|
105
105
|
`&&(t+=`
|
|
106
|
-
`),e+=1,n=r[e+1];return t||(t=" "),{fold:t,offset:e}}var
|
|
107
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
106
|
+
`),e+=1,n=r[e+1];return t||(t=" "),{fold:t,offset:e}}var Yk={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
107
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Zk(r,e,t,n){let s=r.substr(e,t),o=s.length===t&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{let a=r.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}m_.resolveFlowScalar=Vk});var __=w(g_=>{"use strict";var xr=H(),y_=me(),Jk=Mf(),Wk=Rf();function Xk(r,e,t,n){let{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?Jk.resolveBlockScalar(r,e,n):Wk.resolveFlowScalar(e,r.options.strict,n),c=t?r.directives.tagName(t.source,f=>n(t,"TAG_RESOLVE_FAILED",f)):null,l;r.options.stringKeys&&r.atKey?l=r.schema[xr.SCALAR]:c?l=Qk(r.schema,s,c,t,n):e.type==="scalar"?l=eC(r,s,e,n):l=r.schema[xr.SCALAR];let h;try{let f=l.resolve(s,d=>n(t??e,"TAG_RESOLVE_FAILED",d),r.options);h=xr.isScalar(f)?f:new y_.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);n(t??e,"TAG_RESOLVE_FAILED",d),h=new y_.Scalar(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 Qk(r,e,t,n,s){if(t==="!")return r[xr.SCALAR];let i=[];for(let a of r.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(e))return a;let o=r.knownTags[t];return o&&!o.collection?(r.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),r[xr.SCALAR])}function eC({atKey:r,directives:e,schema:t},n,s,i){let o=t.tags.find(a=>(a.default===!0||r&&a.default==="key")&&a.test?.test(n))||t[xr.SCALAR];if(t.compat){let a=t.compat.find(c=>c.default&&c.test?.test(n))??t[xr.SCALAR];if(o.tag!==a.tag){let c=e.tagString(o.tag),l=e.tagString(a.tag),h=`Value may be parsed as either ${c} or ${l}`;i(s,"TAG_RESOLVE_FAILED",h,!0)}}return o}g_.composeScalar=Xk});var b_=w(v_=>{"use strict";function tC(r,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let s=e[n];switch(s.type){case"space":case"comment":case"newline":r-=s.source.length;continue}for(s=e[++n];s?.type==="space";)r+=s.source.length,s=e[++n];break}}return r}v_.emptyScalarPosition=tC});var $_=w(Ff=>{"use strict";var rC=js(),nC=H(),sC=d_(),w_=__(),iC=Cn(),oC=b_(),aC={composeNode:E_,composeEmptyNode:xf};function E_(r,e,t,n){let s=r.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=t,l,h=!0;switch(e.type){case"alias":l=cC(r,e,n),(a||c)&&n(e,"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=w_.composeScalar(r,e,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=sC.composeCollection(aC,r,e,t,n),a&&(l.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);n(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",f),h=!1}}return l??(l=xf(r,e.offset,void 0,null,t,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&r.options.stringKeys&&(!nC.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),r.options.keepSourceTokens&&h&&(l.srcToken=e),l}function xf(r,e,t,n,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){let h={type:"scalar",offset:oC.emptyScalarPosition(e,t,n),indent:-1,source:""},f=w_.composeScalar(r,h,a,l);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(f.spaceBefore=!0),i&&(f.comment=i,f.range[2]=c),f}function cC({options:r},{offset:e,source:t,end:n},s){let i=new rC.Alias(t.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+t.length,a=iC.resolveEnd(n,o,r.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}Ff.composeEmptyNode=xf;Ff.composeNode=E_});var O_=w(T_=>{"use strict";var lC=Qs(),S_=$_(),uC=Cn(),fC=ni();function dC(r,e,{offset:t,start:n,value:s,end:i},o){let a=Object.assign({_directives:e},r),c=new lC.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},h=fC.resolveProps(n,{indicator:"doc-start",next:s??i?.[0],offset:t,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?S_.composeNode(l,s,h,o):S_.composeEmptyNode(l,h.end,n,null,h,o);let f=c.contents.range[2],d=uC.resolveEnd(i,f,!1,o);return d.comment&&(c.comment=d.comment),c.range=[t,f,d.offset],c}T_.composeDoc=dC});var Bf=w(A_=>{"use strict";var pC=V("process"),hC=Ou(),mC=Qs(),si=ri(),N_=H(),yC=O_(),gC=Cn();function ii(r){if(typeof r=="number")return[r,r+1];if(Array.isArray(r))return r.length===2?r:[r[0],r[1]];let{offset:e,source:t}=r;return[e,e+(typeof t=="string"?t.length:1)]}function I_(r){let e="",t=!1,n=!1;for(let s=0;s<r.length;++s){let i=r[s];switch(i[0]){case"#":e+=(e===""?"":n?`
|
|
108
108
|
|
|
109
109
|
`:`
|
|
110
|
-
`)+(i.substring(1)||" "),t=!0,n=!1;break;case"%":r[s+1]?.[0]!=="#"&&(s+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var Uf=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,s,i)=>{let o=ii(t);i?this.warnings.push(new si.YAMLWarning(o,n,s)):this.errors.push(new si.YAMLParseError(o,n,s))},this.directives=new
|
|
111
|
-
${n}`:n;else if(s||e.directives.docStart||!i)e.commentBefore=n;else if(
|
|
110
|
+
`)+(i.substring(1)||" "),t=!0,n=!1;break;case"%":r[s+1]?.[0]!=="#"&&(s+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}var Uf=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,s,i)=>{let o=ii(t);i?this.warnings.push(new si.YAMLWarning(o,n,s)):this.errors.push(new si.YAMLParseError(o,n,s))},this.directives=new hC.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:s}=I_(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
111
|
+
${n}`:n;else if(s||e.directives.docStart||!i)e.commentBefore=n;else if(N_.isCollection(i)&&!i.flow&&i.items.length>0){let o=i.items[0];N_.isPair(o)&&(o=o.key);let a=o.commentBefore;o.commentBefore=a?`${n}
|
|
112
112
|
${a}`:n}else{let o=i.commentBefore;i.commentBefore=o?`${n}
|
|
113
|
-
${o}`:n}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
114
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new si.YAMLParseError(ii(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),s=new
|
|
113
|
+
${o}`:n}}if(t){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:I_(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let s of e)yield*this.next(s);yield*this.end(t,n)}*next(e){switch(pC.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(t,n,s)=>{let i=ii(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=yC.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new si.YAMLParseError(ii(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new si.YAMLParseError(ii(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let t=gC.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
114
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new si.YAMLParseError(ii(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),s=new mC.Document(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,t,t],this.decorate(s,!1),yield s}}};A_.Composer=Uf});var C_=w(ia=>{"use strict";var _C=Mf(),vC=Rf(),bC=ri(),P_=Bs();function wC(r,e=!0,t){if(r){let n=(s,i,o)=>{let a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(t)t(a,i,o);else throw new bC.YAMLParseError([a,a+1],i,o)};switch(r.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return vC.resolveFlowScalar(r,e,n);case"block-scalar":return _C.resolveBlockScalar({options:{strict:e}},r,n)}}return null}function EC(r,e){let{implicitKey:t=!1,indent:n,inFlow:s=!1,offset:i=-1,type:o="PLAIN"}=e,a=P_.stringifyString({type:o,value:r},{implicitKey:t,indent:n>0?" ".repeat(n):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
115
115
|
`}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
|
|
116
116
|
`),h=a.substring(0,l),f=a.substring(l+1)+`
|
|
117
|
-
`,d=[{type:"block-scalar-header",offset:i,indent:n,source:h}];return
|
|
118
|
-
`}),{type:"block-scalar",offset:i,indent:n,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:a,end:c};default:return{type:"scalar",offset:i,indent:n,source:a,end:c}}}function
|
|
117
|
+
`,d=[{type:"block-scalar-header",offset:i,indent:n,source:h}];return k_(d,c)||d.push({type:"newline",offset:-1,indent:n,source:`
|
|
118
|
+
`}),{type:"block-scalar",offset:i,indent:n,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:i,indent:n,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:n,source:a,end:c};default:return{type:"scalar",offset:i,indent:n,source:a,end:c}}}function $C(r,e,t={}){let{afterKey:n=!1,implicitKey:s=!1,inFlow:i=!1,type:o}=t,a="indent"in r?r.indent:null;if(n&&typeof a=="number"&&(a+=2),!o)switch(r.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=r.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=P_.stringifyString({type:o,value:e},{implicitKey:s||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":SC(r,c);break;case'"':Vf(r,c,"double-quoted-scalar");break;case"'":Vf(r,c,"single-quoted-scalar");break;default:Vf(r,c,"scalar")}}function SC(r,e){let t=e.indexOf(`
|
|
119
119
|
`),n=e.substring(0,t),s=e.substring(t+1)+`
|
|
120
|
-
`;if(r.type==="block-scalar"){let i=r.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=n,r.source=s}else{let{offset:i}=r,o="indent"in r?r.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:n}];
|
|
121
|
-
`});for(let c of Object.keys(r))c!=="type"&&c!=="offset"&&delete r[c];Object.assign(r,{type:"block-scalar",indent:o,props:a,source:s})}}function
|
|
122
|
-
`};delete r.items,Object.assign(r,{type:t,source:e,end:[s]});break}default:{let n="indent"in r?r.indent:-1,s="end"in r&&Array.isArray(r.end)?r.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(r))i!=="type"&&i!=="offset"&&delete r[i];Object.assign(r,{type:t,indent:n,source:e,end:s})}}}ia.createScalarToken
|
|
120
|
+
`;if(r.type==="block-scalar"){let i=r.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=n,r.source=s}else{let{offset:i}=r,o="indent"in r?r.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:n}];k_(a,"end"in r?r.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
121
|
+
`});for(let c of Object.keys(r))c!=="type"&&c!=="offset"&&delete r[c];Object.assign(r,{type:"block-scalar",indent:o,props:a,source:s})}}function k_(r,e){if(e)for(let t of e)switch(t.type){case"space":case"comment":r.push(t);break;case"newline":return r.push(t),!0}return!1}function Vf(r,e,t){switch(r.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":r.type=t,r.source=e;break;case"block-scalar":{let n=r.props.slice(1),s=e.length;r.props[0].type==="block-scalar-header"&&(s-=r.props[0].source.length);for(let i of n)i.offset+=s;delete r.props,Object.assign(r,{type:t,source:e,end:n});break}case"block-map":case"block-seq":{let s={type:"newline",offset:r.offset+e.length,indent:r.indent,source:`
|
|
122
|
+
`};delete r.items,Object.assign(r,{type:t,source:e,end:[s]});break}default:{let n="indent"in r?r.indent:-1,s="end"in r&&Array.isArray(r.end)?r.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(r))i!=="type"&&i!=="offset"&&delete r[i];Object.assign(r,{type:t,indent:n,source:e,end:s})}}}ia.createScalarToken=EC;ia.resolveAsScalar=wC;ia.setScalarValue=$C});var D_=w(L_=>{"use strict";var TC=r=>"type"in r?aa(r):oa(r);function aa(r){switch(r.type){case"block-scalar":{let e="";for(let t of r.props)e+=aa(t);return e+r.source}case"block-map":case"block-seq":{let e="";for(let t of r.items)e+=oa(t);return e}case"flow-collection":{let e=r.start.source;for(let t of r.items)e+=oa(t);for(let t of r.end)e+=t.source;return e}case"document":{let e=oa(r);if(r.end)for(let t of r.end)e+=t.source;return e}default:{let e=r.source;if("end"in r&&r.end)for(let t of r.end)e+=t.source;return e}}}function oa({start:r,key:e,sep:t,value:n}){let s="";for(let i of r)s+=i.source;if(e&&(s+=aa(e)),t)for(let i of t)s+=i.source;return n&&(s+=aa(n)),s}L_.stringify=TC});var R_=w(j_=>{"use strict";var zf=Symbol("break visit"),OC=Symbol("skip children"),q_=Symbol("remove item");function Fr(r,e){"type"in r&&r.type==="document"&&(r={start:r.start,value:r.value}),M_(Object.freeze([]),r,e)}Fr.BREAK=zf;Fr.SKIP=OC;Fr.REMOVE=q_;Fr.itemAtPath=(r,e)=>{let t=r;for(let[n,s]of e){let i=t?.[n];if(i&&"items"in i)t=i.items[s];else return}return t};Fr.parentCollection=(r,e)=>{let t=Fr.itemAtPath(r,e.slice(0,-1)),n=e[e.length-1][0],s=t?.[n];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function M_(r,e,t){let n=t(e,r);if(typeof n=="symbol")return n;for(let s of["key","value"]){let i=e[s];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){let a=M_(Object.freeze(r.concat([[s,o]])),i.items[o],t);if(typeof a=="number")o=a-1;else{if(a===zf)return zf;a===q_&&(i.items.splice(o,1),o-=1)}}typeof n=="function"&&s==="key"&&(n=n(e,r))}}return typeof n=="function"?n(e,r):n}j_.visit=Fr});var ca=w(Be=>{"use strict";var Kf=C_(),NC=D_(),IC=R_(),Hf="\uFEFF",Gf="",Yf="",Zf="",AC=r=>!!r&&"items"in r,PC=r=>!!r&&(r.type==="scalar"||r.type==="single-quoted-scalar"||r.type==="double-quoted-scalar"||r.type==="block-scalar");function kC(r){switch(r){case Hf:return"<BOM>";case Gf:return"<DOC>";case Yf:return"<FLOW_END>";case Zf:return"<SCALAR>";default:return JSON.stringify(r)}}function CC(r){switch(r){case Hf:return"byte-order-mark";case Gf:return"doc-mode";case Yf:return"flow-error-end";case Zf:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
123
123
|
`:case`\r
|
|
124
|
-
`: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(r[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}Be.createScalarToken=Kf.createScalarToken;Be.resolveAsScalar=Kf.resolveAsScalar;Be.setScalarValue=Kf.setScalarValue;Be.stringify=
|
|
125
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
126
|
-
\r `),Jf=r=>!r||
|
|
124
|
+
`: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(r[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}Be.createScalarToken=Kf.createScalarToken;Be.resolveAsScalar=Kf.resolveAsScalar;Be.setScalarValue=Kf.setScalarValue;Be.stringify=NC.stringify;Be.visit=IC.visit;Be.BOM=Hf;Be.DOCUMENT=Gf;Be.FLOW_END=Yf;Be.SCALAR=Zf;Be.isCollection=AC;Be.isScalar=PC;Be.prettyToken=kC;Be.tokenType=CC});var Xf=w(F_=>{"use strict";var oi=ca();function pt(r){switch(r){case void 0:case" ":case`
|
|
125
|
+
`:case"\r":case" ":return!0;default:return!1}}var x_=new Set("0123456789ABCDEFabcdef"),LC=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),la=new Set(",[]{}"),DC=new Set(` ,[]{}
|
|
126
|
+
\r `),Jf=r=>!r||DC.has(r),Wf=class{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(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
127
127
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
128
128
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){let s=this.buffer[n+e+1];if(s===`
|
|
129
129
|
`||!s&&!this.atEnd)return e+n+1}return t===`
|
|
@@ -138,24 +138,24 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
138
138
|
`&&i>=this.pos&&i+1+t>a)e=i;else break}while(!0);return yield oi.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,s;for(;s=this.buffer[++n];)if(s===":"){let i=this.buffer[n+1];if(pt(i)||e&&la.has(i))break;t=n}else if(pt(s)){let i=this.buffer[n+1];if(s==="\r"&&(i===`
|
|
139
139
|
`?(n+=1,s=`
|
|
140
140
|
`,i=this.buffer[n+1]):t=n),i==="#"||e&&la.has(i))break;if(s===`
|
|
141
|
-
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&la.has(s))break;t=n}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield oi.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Jf),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(pt(n)||t&&la.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!pt(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(
|
|
141
|
+
`){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&la.has(s))break;t=n}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield oi.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Jf),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(pt(n)||t&&la.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!pt(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(LC.has(t))t=this.buffer[++e];else if(t==="%"&&x_.has(this.buffer[e+1])&&x_.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
142
142
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
143
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let s=t-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=t),s}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};
|
|
143
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");let s=t-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=t),s}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}};F_.Lexer=Wf});var ed=w(U_=>{"use strict";var Qf=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let i=t+n>>1;this.lineStarts[i]<e?t=i+1:n=i}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let s=this.lineStarts[t-1];return{line:t,col:e-s+1}}}};U_.LineCounter=Qf});var rd=w(H_=>{"use strict";var qC=V("process"),B_=ca(),MC=Xf();function hr(r,e){for(let t=0;t<r.length;++t)if(r[t].type===e)return!0;return!1}function V_(r){for(let e=0;e<r.length;++e)switch(r[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function K_(r){switch(r?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function ua(r){switch(r.type){case"document":return r.start;case"block-map":{let e=r.items[r.items.length-1];return e.sep??e.start}case"block-seq":return r.items[r.items.length-1].start;default:return[]}}function Ln(r){if(r.length===0)return[];let e=r.length;e:for(;--e>=0;)switch(r[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;r[++e]?.type==="space";);return r.splice(e,r.length)}function fa(r,e){if(e.length<1e5)Array.prototype.push.apply(r,e);else for(let t=0;t<e.length;++t)r.push(e[t])}function z_(r){if(r.start.type==="flow-seq-start")for(let e of r.items)e.sep&&!e.value&&!hr(e.start,"explicit-key-ind")&&!hr(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,K_(e.value)?e.value.end?fa(e.value.end,e.sep):e.value.end=e.sep:fa(e.start,e.sep),delete e.sep)}var td=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new MC.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,qC.env.LOG_TOKENS&&console.log("|",B_.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=B_.tokenType(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.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(){let e=this.peek(1);if(this.type==="doc-end"&&e?.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(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&z_(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{let s=n.items[n.items.length-1];if(s.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=t;else{Object.assign(s,{key:t,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{let s=n.items[n.items.length-1];s.value?n.items.push({start:[],value:t}):s.value=t;break}case"flow-collection":{let s=n.items[n.items.length-1];!s||s.value?n.items.push({start:[],key:t,sep:[]}):s.sep?s.value=t:Object.assign(s,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let s=t.items[t.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&V_(s.start)===-1&&(t.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<t.indent))&&(n.type==="document"?n.end=s.start:n.items.push({start:s.start}),t.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":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{V_(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=ua(this.peek(2)),n=Ln(t),s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
144
144
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
145
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){fa(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,s=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(s&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):s||t.value?(i.push(this.sourceToken),e.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(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(hr(t.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(
|
|
145
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){fa(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,s=n&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",i=[];if(s&&t.sep&&!t.value){let o=[];for(let a=0;a<t.sep.length;++a){let c=t.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):s||t.value?(i.push(this.sourceToken),e.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(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(hr(t.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(K_(t.key)&&!hr(t.sep,"newline")){let o=Ln(t.start),a=t.key,c=t.sep;c.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(hr(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let o=Ln(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):hr(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);s||t.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!hr(t.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 n&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){fa(s,t.start),s.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||hr(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:s,sep:[]}):t.sep?this.stack.push(s):Object.assign(t,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let s=ua(n),i=Ln(s);z_(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
146
146
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
147
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){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;let t=ua(e),n=Ln(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=ua(e),n=Ln(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){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:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};G_.Parser=td});var X_=w(ci=>{"use strict";var Y_=Bf(),RC=Qs(),ai=ri(),xC=xu(),FC=H(),UC=ed(),Z_=rd();function J_(r){let e=r.prettyErrors!==!1;return{lineCounter:r.lineCounter||e&&new UC.LineCounter||null,prettyErrors:e}}function BC(r,e={}){let{lineCounter:t,prettyErrors:n}=J_(e),s=new Z_.Parser(t?.addNewLine),i=new Y_.Composer(e),o=Array.from(i.compose(s.parse(r)));if(n&&t)for(let a of o)a.errors.forEach(ai.prettifyError(r,t)),a.warnings.forEach(ai.prettifyError(r,t));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function W_(r,e={}){let{lineCounter:t,prettyErrors:n}=J_(e),s=new Z_.Parser(t?.addNewLine),i=new Y_.Composer(e),o=null;for(let a of i.compose(s.parse(r),!0,r.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new ai.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(ai.prettifyError(r,t)),o.warnings.forEach(ai.prettifyError(r,t))),o}function VC(r,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let s=W_(r,t);if(!s)return null;if(s.warnings.forEach(i=>xC.warn(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:n},t))}function zC(r,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(r===void 0){let{keepUndefined:s}=t??e??{};if(!s)return}return FC.isDocument(r)&&!n?r.toString(t):new RC.Document(r,n,t).toString(t)}ci.parse=VC;ci.parseAllDocuments=BC;ci.parseDocument=W_;ci.stringify=zC});var sd=w(Z=>{"use strict";var KC=Bf(),HC=Qs(),GC=Ef(),nd=ri(),YC=js(),mr=H(),ZC=ur(),JC=me(),WC=dr(),XC=pr(),QC=ca(),eL=Xf(),tL=ed(),rL=rd(),da=X_(),Q_=Ls();Z.Composer=KC.Composer;Z.Document=HC.Document;Z.Schema=GC.Schema;Z.YAMLError=nd.YAMLError;Z.YAMLParseError=nd.YAMLParseError;Z.YAMLWarning=nd.YAMLWarning;Z.Alias=YC.Alias;Z.isAlias=mr.isAlias;Z.isCollection=mr.isCollection;Z.isDocument=mr.isDocument;Z.isMap=mr.isMap;Z.isNode=mr.isNode;Z.isPair=mr.isPair;Z.isScalar=mr.isScalar;Z.isSeq=mr.isSeq;Z.Pair=ZC.Pair;Z.Scalar=JC.Scalar;Z.YAMLMap=WC.YAMLMap;Z.YAMLSeq=XC.YAMLSeq;Z.CST=QC;Z.Lexer=eL.Lexer;Z.LineCounter=tL.LineCounter;Z.Parser=rL.Parser;Z.parse=da.parse;Z.parseAllDocuments=da.parseAllDocuments;Z.parseDocument=da.parseDocument;Z.stringify=da.stringify;Z.visit=Q_.visit;Z.visitAsync=Q_.visitAsync});var ht=w(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.parseYaml=nL;Ur.stringifyYaml=sL;Ur.parseDoc=iL;Ur.stringifyDoc=oL;Ur.parseDocWithLines=aL;var li=sd();function nL(r){return(0,li.parse)(r)}function sL(r){return(0,li.stringify)(r)}function iL(r){return(0,li.parseDocument)(r)}function oL(r){return r.toString()}function aL(r){let e=new li.LineCounter;return{doc:(0,li.parseDocument)(r,{lineCounter:e}),lines:e}}});var ev=w((Wx,cL)=>{cL.exports={catalog:"evidence-core",version:"0.1",description:"Built-in metrics every 0.1 pack supports, from any producer. Names are unprefixed and reserved; every value is recomputed from the pack's own files, never read from a stored number. See decision 0048.",metrics:{"totals.tests":{type:"count",label:"Tests",per_test:!0,verify:{aggregate:"count"}},"totals.passed":{type:"count",label:"Passed tests",per_test:!0,verify:{aggregate:"count",where:"test.status == 'passed'"}},"totals.failed":{type:"count",label:"Failed tests",per_test:!0,verify:{aggregate:"count",where:"test.status == 'failed'"}},"totals.broken":{type:"count",label:"Broken tests",description:"Tests whose oracle could not be evaluated.",per_test:!0,verify:{aggregate:"count",where:"test.status == 'broken'"}},"totals.skipped":{type:"count",label:"Skipped tests",per_test:!0,verify:{aggregate:"count",where:"test.status == 'skipped'"}},pass_rate:{type:"ratio",label:"Pass rate",description:"passed \xF7 (tests \u2212 skipped). Errors when every test was skipped.",range:[0,1],per_test:!0,verify:{expr:"double(totals.passed) / double(totals.tests - totals.skipped)"}},"steps.total":{type:"count",label:"Steps",per_test:!0,verify:{aggregate:"sum",value:"size(test.steps)"}},"steps.failed":{type:"count",label:"Failed steps",per_test:!0,verify:{aggregate:"sum",value:"size(test.steps.filter(s, s.status == 'failed'))"}},"steps.skipped":{type:"count",label:"Skipped steps",per_test:!0,verify:{aggregate:"sum",value:"size(test.steps.filter(s, s.status == 'skipped'))"}},"run.duration_ms":{type:"ms",label:"Run duration",description:"run.yaml ended \u2212 started.",verify:{expr:"double((timestamp(run.ended) - timestamp(run.started)).getMilliseconds())"}},"run.status":{type:"enum",label:"Run status",values:["running","finalized","aborted"],verify:{file:"run.yaml",path:"status"}},"failures.count":{type:"count",label:"Failure records",description:"Rows in the root failure.yaml index.",verify:{file:"failure.yaml",path:"totals.failures"}}}}});var pa=w(Pt=>{"use strict";var lL=Pt&&Pt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),uL=Pt&&Pt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),fL=Pt&&Pt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&lL(t,e,n[s]);return uL(t,e),t}})();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.runCrossChecks=hL;Pt.isContained=id;var dL=fL(V("path")),pL=V("crypto"),mt=Mt(),yt=jt();async function hL(r){let e=[],t=r.run?.status==="finalized";for(let{testId:a,result:c}of r.tests){let l=`tests/${a}/result.yaml`;c?.test!==void 0&&c.test!==a&&e.push((0,yt.err)(mt.Codes.TEST_ID_MISMATCH,l,`result.test "${c.test}" does not match directory name "${a}"`));let h=c?.definition?.path;typeof h=="string"&&h.length>0&&(id(h)?await r.container.fileExists(a,h)||e.push((0,yt.err)(mt.Codes.DEFINITION_MISSING,`${l}#/definition/path`,`definition file "${h}" does not exist`)):e.push((0,yt.err)(mt.Codes.DEFINITION_PATH_ESCAPE,`${l}#/definition/path`,`definition.path "${h}" escapes the test directory`)));let f=Array.isArray(c?.steps)?c.steps:[],d=-1/0,p=new Set;f.forEach((u,m)=>{let _=u?.ordinal;typeof _=="number"&&(p.has(_)&&e.push((0,yt.err)(mt.Codes.ORDINAL_COLLISION,`${l}#/steps/${m}/ordinal`,`duplicate step ordinal ${_}`)),p.add(_),_<=d&&e.push((0,yt.err)(mt.Codes.ORDINAL_NOT_INCREASING,`${l}#/steps/${m}/ordinal`,`step ordinal ${_} is not strictly increasing (previous ${d})`)),d=_)});let y=f.find(u=>u?.status==="failed"||u?.status==="broken");c?.status==="passed"&&y&&e.push((0,yt.warn)(mt.Codes.STATUS_DISAGREES,l,`test status "passed" but step "${y.id}" is "${y.status}"`))}if(!t)return e;let n=r.run?.started,s=r.run?.ended;typeof n=="string"&&typeof s=="string"&&Date.parse(s)<Date.parse(n)&&e.push((0,yt.err)(mt.Codes.ENDED_BEFORE_STARTED,"run.yaml#/ended",`ended (${s}) is before started (${n})`));let i=mL(r.tests),o=r.run?.totals;if(o&&typeof o=="object"){["tests","passed","failed","broken","skipped"].forEach(c=>{o[c]!==i[c]&&e.push((0,yt.err)(mt.Codes.TOTALS_MISMATCH,`run.yaml#/totals/${c}`,`totals.${c} is ${o[c]} but the rolled-up value is ${i[c]}`))});let a=(o.passed??0)+(o.failed??0)+(o.broken??0)+(o.skipped??0);o.tests!==a&&e.push((0,yt.err)(mt.Codes.TOTALS_MISMATCH,"run.yaml#/totals/tests",`totals.tests (${o.tests}) does not equal the sum of the four buckets (${a})`))}for(let{testId:a,result:c}of r.tests){let l=`tests/${a}/result.yaml`,h=c?.definition?.path;if(typeof h!="string"||!id(h))continue;let f=c?.definition?.sha256;if(typeof f!="string"||f.length===0){e.push((0,yt.err)(mt.Codes.HASH_MISSING,`${l}#/definition/sha256`,"definition.sha256 is required on a finalized pack"));continue}let d=await r.container.readBytes(a,h);if(!d)continue;let p=`sha256:${(0,pL.createHash)("sha256").update(d).digest("hex")}`;p!==f&&e.push((0,yt.err)(mt.Codes.HASH_MISMATCH,`${l}#/definition/sha256`,`definition.sha256 ${f} does not match the file hash ${p}`))}return e}function id(r){if(r.startsWith("/")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(r))return!1;let e=dL.posix.normalize(r);return e.startsWith("/")||e===".."||e.startsWith("../")?!1:!e.split("/").includes("..")}function mL(r){let e={tests:0,passed:0,failed:0,broken:0,skipped:0};for(let{result:t}of r){e.tests++;let n=t?.status;(n==="passed"||n==="failed"||n==="broken"||n==="skipped")&&e[n]++}return e}});function ad(r,e,t,n,s){if(typeof t=="string")return{name:r,code:e,message:t,node:n,cause:s};let i=t;if(typeof i!="object")throw new Error("First param to error must be a string or object");return{name:r,code:i.code||e,message:i.message,node:i.node,cause:i.cause,range:i.range}}function $e(r,e,t){return typeof r=="object"?new Br(r):new Br({code:r,message:e,node:t})}function L(r,e,t){return typeof r=="object"?new Kt(r):new Kt({code:r,message:e,node:t})}function rv(r,e,t){return typeof r=="object"?new Vr(r):new Vr({code:r,message:e,node:t})}function od(r){let e=r?.pos??r?.start;if(typeof e!="number")return;let t=typeof r.end=="number"?r.end:e;return{start:e,end:t}}function tv(r,e,t){let n=e.pos??t?.start;if(typeof n!="number")return r;let s=e.input,i=1,o=0,a=0;for(;o<n;)s[o]===`
|
|
147
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){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;let t=ua(e),n=Ln(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=ua(e),n=Ln(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){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:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};H_.Parser=td});var W_=w(ci=>{"use strict";var G_=Bf(),jC=Qs(),ai=ri(),RC=xu(),xC=H(),FC=ed(),Y_=rd();function Z_(r){let e=r.prettyErrors!==!1;return{lineCounter:r.lineCounter||e&&new FC.LineCounter||null,prettyErrors:e}}function UC(r,e={}){let{lineCounter:t,prettyErrors:n}=Z_(e),s=new Y_.Parser(t?.addNewLine),i=new G_.Composer(e),o=Array.from(i.compose(s.parse(r)));if(n&&t)for(let a of o)a.errors.forEach(ai.prettifyError(r,t)),a.warnings.forEach(ai.prettifyError(r,t));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}function J_(r,e={}){let{lineCounter:t,prettyErrors:n}=Z_(e),s=new Y_.Parser(t?.addNewLine),i=new G_.Composer(e),o=null;for(let a of i.compose(s.parse(r),!0,r.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new ai.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(o.errors.forEach(ai.prettifyError(r,t)),o.warnings.forEach(ai.prettifyError(r,t))),o}function BC(r,e,t){let n;typeof e=="function"?n=e:t===void 0&&e&&typeof e=="object"&&(t=e);let s=J_(r,t);if(!s)return null;if(s.warnings.forEach(i=>RC.warn(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:n},t))}function VC(r,e,t){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){let s=Math.round(t);t=s<1?void 0:s>8?{indent:8}:{indent:s}}if(r===void 0){let{keepUndefined:s}=t??e??{};if(!s)return}return xC.isDocument(r)&&!n?r.toString(t):new jC.Document(r,n,t).toString(t)}ci.parse=BC;ci.parseAllDocuments=UC;ci.parseDocument=J_;ci.stringify=VC});var sd=w(Z=>{"use strict";var zC=Bf(),KC=Qs(),HC=Ef(),nd=ri(),GC=js(),mr=H(),YC=ur(),ZC=me(),JC=dr(),WC=pr(),XC=ca(),QC=Xf(),eL=ed(),tL=rd(),da=W_(),X_=Ls();Z.Composer=zC.Composer;Z.Document=KC.Document;Z.Schema=HC.Schema;Z.YAMLError=nd.YAMLError;Z.YAMLParseError=nd.YAMLParseError;Z.YAMLWarning=nd.YAMLWarning;Z.Alias=GC.Alias;Z.isAlias=mr.isAlias;Z.isCollection=mr.isCollection;Z.isDocument=mr.isDocument;Z.isMap=mr.isMap;Z.isNode=mr.isNode;Z.isPair=mr.isPair;Z.isScalar=mr.isScalar;Z.isSeq=mr.isSeq;Z.Pair=YC.Pair;Z.Scalar=ZC.Scalar;Z.YAMLMap=JC.YAMLMap;Z.YAMLSeq=WC.YAMLSeq;Z.CST=XC;Z.Lexer=QC.Lexer;Z.LineCounter=eL.LineCounter;Z.Parser=tL.Parser;Z.parse=da.parse;Z.parseAllDocuments=da.parseAllDocuments;Z.parseDocument=da.parseDocument;Z.stringify=da.stringify;Z.visit=X_.visit;Z.visitAsync=X_.visitAsync});var ht=w(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.parseYaml=rL;Ur.stringifyYaml=nL;Ur.parseDoc=sL;Ur.stringifyDoc=iL;Ur.parseDocWithLines=oL;var li=sd();function rL(r){return(0,li.parse)(r)}function nL(r){return(0,li.stringify)(r)}function sL(r){return(0,li.parseDocument)(r)}function iL(r){return r.toString()}function oL(r){let e=new li.LineCounter;return{doc:(0,li.parseDocument)(r,{lineCounter:e}),lines:e}}});var Q_=w((Jx,aL)=>{aL.exports={catalog:"evidence-core",version:"0.1",description:"Built-in metrics every 0.1 pack supports, from any producer. Names are unprefixed and reserved; every value is recomputed from the pack's own files, never read from a stored number. See decision 0048.",metrics:{"totals.tests":{type:"count",label:"Tests",per_test:!0,verify:{aggregate:"count"}},"totals.passed":{type:"count",label:"Passed tests",per_test:!0,verify:{aggregate:"count",where:"test.status == 'passed'"}},"totals.failed":{type:"count",label:"Failed tests",per_test:!0,verify:{aggregate:"count",where:"test.status == 'failed'"}},"totals.broken":{type:"count",label:"Broken tests",description:"Tests whose oracle could not be evaluated.",per_test:!0,verify:{aggregate:"count",where:"test.status == 'broken'"}},"totals.skipped":{type:"count",label:"Skipped tests",per_test:!0,verify:{aggregate:"count",where:"test.status == 'skipped'"}},pass_rate:{type:"ratio",label:"Pass rate",description:"passed \xF7 (tests \u2212 skipped). Errors when every test was skipped.",range:[0,1],per_test:!0,verify:{expr:"double(totals.passed) / double(totals.tests - totals.skipped)"}},"steps.total":{type:"count",label:"Steps",per_test:!0,verify:{aggregate:"sum",value:"size(test.steps)"}},"steps.failed":{type:"count",label:"Failed steps",per_test:!0,verify:{aggregate:"sum",value:"size(test.steps.filter(s, s.status == 'failed'))"}},"steps.skipped":{type:"count",label:"Skipped steps",per_test:!0,verify:{aggregate:"sum",value:"size(test.steps.filter(s, s.status == 'skipped'))"}},"run.duration_ms":{type:"ms",label:"Run duration",description:"run.yaml ended \u2212 started.",verify:{expr:"double((timestamp(run.ended) - timestamp(run.started)).getMilliseconds())"}},"run.status":{type:"enum",label:"Run status",values:["running","finalized","aborted"],verify:{file:"run.yaml",path:"status"}},"failures.count":{type:"count",label:"Failure records",description:"Rows in the root failure.yaml index.",verify:{file:"failure.yaml",path:"totals.failures"}}}}});var pa=w(Pt=>{"use strict";var cL=Pt&&Pt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),lL=Pt&&Pt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),uL=Pt&&Pt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&cL(t,e,n[s]);return lL(t,e),t}})();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.runCrossChecks=pL;Pt.isContained=id;var fL=uL(V("path")),dL=V("crypto"),mt=Mt(),yt=jt();async function pL(r){let e=[],t=r.run?.status==="finalized";for(let{testId:a,result:c}of r.tests){let l=`tests/${a}/result.yaml`;c?.test!==void 0&&c.test!==a&&e.push((0,yt.err)(mt.Codes.TEST_ID_MISMATCH,l,`result.test "${c.test}" does not match directory name "${a}"`));let h=c?.definition?.path;typeof h=="string"&&h.length>0&&(id(h)?await r.container.fileExists(a,h)||e.push((0,yt.err)(mt.Codes.DEFINITION_MISSING,`${l}#/definition/path`,`definition file "${h}" does not exist`)):e.push((0,yt.err)(mt.Codes.DEFINITION_PATH_ESCAPE,`${l}#/definition/path`,`definition.path "${h}" escapes the test directory`)));let f=Array.isArray(c?.steps)?c.steps:[],d=-1/0,p=new Set;f.forEach((u,m)=>{let _=u?.ordinal;typeof _=="number"&&(p.has(_)&&e.push((0,yt.err)(mt.Codes.ORDINAL_COLLISION,`${l}#/steps/${m}/ordinal`,`duplicate step ordinal ${_}`)),p.add(_),_<=d&&e.push((0,yt.err)(mt.Codes.ORDINAL_NOT_INCREASING,`${l}#/steps/${m}/ordinal`,`step ordinal ${_} is not strictly increasing (previous ${d})`)),d=_)});let y=f.find(u=>u?.status==="failed"||u?.status==="broken");c?.status==="passed"&&y&&e.push((0,yt.warn)(mt.Codes.STATUS_DISAGREES,l,`test status "passed" but step "${y.id}" is "${y.status}"`))}if(!t)return e;let n=r.run?.started,s=r.run?.ended;typeof n=="string"&&typeof s=="string"&&Date.parse(s)<Date.parse(n)&&e.push((0,yt.err)(mt.Codes.ENDED_BEFORE_STARTED,"run.yaml#/ended",`ended (${s}) is before started (${n})`));let i=hL(r.tests),o=r.run?.totals;if(o&&typeof o=="object"){["tests","passed","failed","broken","skipped"].forEach(c=>{o[c]!==i[c]&&e.push((0,yt.err)(mt.Codes.TOTALS_MISMATCH,`run.yaml#/totals/${c}`,`totals.${c} is ${o[c]} but the rolled-up value is ${i[c]}`))});let a=(o.passed??0)+(o.failed??0)+(o.broken??0)+(o.skipped??0);o.tests!==a&&e.push((0,yt.err)(mt.Codes.TOTALS_MISMATCH,"run.yaml#/totals/tests",`totals.tests (${o.tests}) does not equal the sum of the four buckets (${a})`))}for(let{testId:a,result:c}of r.tests){let l=`tests/${a}/result.yaml`,h=c?.definition?.path;if(typeof h!="string"||!id(h))continue;let f=c?.definition?.sha256;if(typeof f!="string"||f.length===0){e.push((0,yt.err)(mt.Codes.HASH_MISSING,`${l}#/definition/sha256`,"definition.sha256 is required on a finalized pack"));continue}let d=await r.container.readBytes(a,h);if(!d)continue;let p=`sha256:${(0,dL.createHash)("sha256").update(d).digest("hex")}`;p!==f&&e.push((0,yt.err)(mt.Codes.HASH_MISMATCH,`${l}#/definition/sha256`,`definition.sha256 ${f} does not match the file hash ${p}`))}return e}function id(r){if(r.startsWith("/")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(r))return!1;let e=fL.posix.normalize(r);return e.startsWith("/")||e===".."||e.startsWith("../")?!1:!e.split("/").includes("..")}function hL(r){let e={tests:0,passed:0,failed:0,broken:0,skipped:0};for(let{result:t}of r){e.tests++;let n=t?.status;(n==="passed"||n==="failed"||n==="broken"||n==="skipped")&&e[n]++}return e}});function ad(r,e,t,n,s){if(typeof t=="string")return{name:r,code:e,message:t,node:n,cause:s};let i=t;if(typeof i!="object")throw new Error("First param to error must be a string or object");return{name:r,code:i.code||e,message:i.message,node:i.node,cause:i.cause,range:i.range}}function $e(r,e,t){return typeof r=="object"?new Br(r):new Br({code:r,message:e,node:t})}function L(r,e,t){return typeof r=="object"?new Kt(r):new Kt({code:r,message:e,node:t})}function tv(r,e,t){return typeof r=="object"?new Vr(r):new Vr({code:r,message:e,node:t})}function od(r){let e=r?.pos??r?.start;if(typeof e!="number")return;let t=typeof r.end=="number"?r.end:e;return{start:e,end:t}}function ev(r,e,t){let n=e.pos??t?.start;if(typeof n!="number")return r;let s=e.input,i=1,o=0,a=0;for(;o<n;)s[o]===`
|
|
148
148
|
`?(i++,a=0):a++,o++;let c=n,l=n;for(;c>0&&s[c-1]!==`
|
|
149
149
|
`;)c--;for(;l<s.length&&s[l]!==`
|
|
150
150
|
`;)l++;let h=s.slice(c,l),f=`> ${`${i}`.padStart(4," ")} | ${h}
|
|
151
151
|
${" ".repeat(9+a)}^`;return`${r}
|
|
152
152
|
|
|
153
|
-
${f}`}function ui(r,e){return r instanceof Dn?r.withAst(e):r}var Dn,Br,Kt,Vr,gt=Me(()=>{"use strict";Dn=class extends Error{#e;#t;#n;#s;constructor({name:e,code:t,message:n,node:s,cause:i,range:o}){super(n,i?{cause:i}:void 0),this.name=e,this.#t=t,this.#s=n,this.#e=s,this.#n=o&&od(o)||od(s),s?.input&&(this.message=tv(this.#s,s,this.#n))}get node(){return this.#e}get code(){return this.#t}get range(){return this.#n}get summary(){return this.#s}withAst(e){return this.#e||!e?.input?this:(this.#e=e,this.#n??=od(e),this.message=tv(this.#s,e,this.#n),this)}};Br=class extends Dn{constructor(e,t,n){super(ad("ParseError","parse_error",e,t,n))}},Kt=class extends Dn{constructor(e,t,n){super(ad("EvaluationError","evaluation_error",e,t,n))}},Vr=class extends Dn{constructor(e,t,n){super(ad("TypeError","type_error",e,t,n))}}});function sv(r,e){let t=e?nv:void 0;r.deleteVariable("optional"),r.registerConstant("optional","OptionalNamespace",t)}function iv(r){let e={async:!1},t=(d,p)=>r.registerFunctionOverload(d,p,e),n=r.enableOptionalTypes?nv:void 0;r.registerType("OptionalNamespace",ha),r.registerConstant("optional","OptionalNamespace",n),t("optional.hasValue(): bool",d=>d.hasValue()),t("optional<A>.value(): A",d=>d.value()),r.registerFunctionOverload("OptionalNamespace.none(): optional<T>",()=>Ie.none()),t("OptionalNamespace.of(A): optional<A>",(d,p)=>Ie.of(p));function s(d,p,y){if(d instanceof Ie)return d;throw L("optional_expected",`${y} must be optional`,p)}function i(d,p,y){let u=d.run(p.receiver,y);return u instanceof Promise?u.then(m=>o(m,d,p,y)):o(u,d,p,y)}function o(d,p,y,u){let m=s(d,y.receiver,`${y.functionDesc} receiver`);return m.hasValue()?y.onHasValue(m):y.onEmpty(p,y,u)}function a(d,p,y,u){let m=d.check(p,y);if(m.kind==="optional")return m;if(m.kind==="dyn")return d.getType("optional");throw d.createError("optional_expected",`${u} must be optional, got '${m}'`,p)}function c({functionDesc:d,evaluate:p,typeCheck:y,onHasValue:u,onEmpty:m}){return({ast:_,args:v,receiver:g})=>({ast:_,functionDesc:d,receiver:g,arg:v[0],evaluate:p,typeCheck:y,onHasValue:u,onEmpty:m})}let l="optional.orValue() receiver",h="optional.or(optional) receiver",f="optional.or(optional) argument";r.registerFunctionOverload("optional.or(ast): optional<dyn>",c({functionDesc:"optional.or(optional)",evaluate:i,typeCheck(d,p,y){let u=a(d,p.receiver,y,h),m=a(d,p.arg,y,f);p.receiver.maybeAsync||p.arg.maybeAsync||p.ast.setMeta("async",!1);let _=u.unify(d.registry,m);if(_)return _;throw d.createError("incompatible_argument_type",`${p.functionDesc} argument must be compatible type, got '${u}' and '${m}'`,p.arg)},onHasValue:d=>d,onEmpty(d,p,y){let u=p.arg,m=d.run(u,y);return m instanceof Promise?m.then(_=>s(_,u,f)):s(m,u,f)}})),r.registerFunctionOverload("optional.orValue(ast): dyn",c({functionDesc:"optional.orValue(value)",onHasValue:d=>d.value(),onEmpty(d,p,y){return d.run(p.arg,y)},evaluate:i,typeCheck(d,p,y){let u=a(d,p.receiver,y,l).valueType,m=d.check(p.arg,y);p.receiver.maybeAsync||p.arg.maybeAsync||p.ast.setMeta("async",!1);let _=u.unify(d.registry,m);if(_)return _;throw d.createError("incompatible_argument_type",`${p.functionDesc} argument must be compatible type, got '${u}' and '${m}'`,p.arg)}}))}var Ie,fi,ha,nv,di=Me(()=>{"use strict";gt();Ie=class r{#e;constructor(e){this.#e=e}static of(e){return e===void 0?fi:new r(e)}static none(){return fi}hasValue(){return this.#e!==void 0}value(){if(this.#e===void 0)throw L("optional_value_missing","Optional value is not present");return this.#e}or(e){if(this.#e!==void 0)return this;if(e instanceof r)return e;throw L("invalid_optional_argument","Optional.or must be called with an Optional argument")}orValue(e){return this.#e===void 0?e:this.#e}get[Symbol.toStringTag](){return"optional"}[Symbol.for("nodejs.util.inspect.custom")](){return this.#e===void 0?"Optional { none }":`Optional { value: ${JSON.stringify(this.#e)} }`}},fi=Object.freeze(new Ie),ha=class{},nv=new ha});function pi(r,e){return r?.[Symbol.toStringTag]==="AsyncFunction"?!0:typeof e=="boolean"?e:!0}var qn,Se,_t,ov,zr,cd,Kr,av,ma,ya,Mn,Hr=Me(()=>{"use strict";qn=Object.hasOwn,Se=Object.keys,_t=Object.freeze,ov=Object.entries,zr=Array.isArray,cd=Array.from,Kr=0n,av=18446744073709551615n,ma=9223372036854775807n,ya=-9223372036854775808n;Mn=new Set(["as","break","const","continue","else","for","function","if","import","let","loop","package","namespace","return","var","void","while","__proto__","prototype"])});function lv(r){let e={async:!1},t=(u,m)=>r.registerFunctionOverload(u,m,e),n=u=>u;t("dyn(dyn): dyn",n);for(let u in Ht){let m=Ht[u];m instanceof ve&&t(`type(${m.name}): type`,()=>m)}t("bool(bool): bool",n),t("bool(string): bool",u=>{switch(u){case"1":case"t":case"true":case"TRUE":case"True":return!0;case"0":case"f":case"false":case"FALSE":case"False":return!1;default:throw L("bool_conversion_error",`bool() conversion error: invalid string value "${u}"`)}}),t("size(string): int",u=>BigInt(cv(u))),t("size(bytes): int",u=>BigInt(u.length)),t("size(list): int",u=>BigInt(u.length??u.size)),t("size(map): int",u=>BigInt(u instanceof Map?u.size:Se(u).length)),t("string.size(): int",u=>BigInt(cv(u))),t("bytes.size(): int",u=>BigInt(u.length)),t("list.size(): int",u=>BigInt(u.length??u.size)),t("map.size(): int",u=>BigInt(u instanceof Map?u.size:Se(u).length)),t("bytes(string): bytes",u=>o.fromString(u)),t("bytes(bytes): bytes",n),t("double(double): double",n),t("double(int): double",u=>Number(u)),t("double(uint): double",u=>Number(u)),t("double(string): double",u=>{if(!u||u!==u.trim())throw L("double_conversion_error","double() type error: cannot convert to double");switch(u.toLowerCase()){case"inf":case"+inf":case"infinity":case"+infinity":return Number.POSITIVE_INFINITY;case"-inf":case"-infinity":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:{let _=Number(u);if(!Number.isNaN(_))return _;throw L("double_conversion_error","double() type error: cannot convert to double")}}}),t("int(int): int",n),t("int(double): int",u=>{if(Number.isFinite(u))return BigInt(Math.trunc(u));throw L("numeric_overflow","int() type error: integer overflow")}),t("int(string): int",u=>{if(u!==u.trim()||u.length>20||u.includes("0x"))throw L("int_conversion_error","int() type error: cannot convert to int");try{let m=BigInt(u);if(m<=ma&&m>=ya)return m}catch{}throw L("int_conversion_error","int() type error: cannot convert to int")}),t("uint(uint): uint",n),t("uint(int): uint",u=>{try{return new ge(u)}catch{throw L("uint_conversion_error","uint() type error: cannot convert to uint")}}),t("uint(double): uint",u=>{try{return new ge(Math.trunc(u))}catch{throw L("numeric_overflow","uint() type error: unsigned integer overflow")}}),t("uint(string): uint",u=>{if(u!==u.trim()||u.length>20||u.includes("0x"))throw L("uint_conversion_error","uint() type error: cannot convert to uint");try{return new ge(u)}catch{throw L("uint_conversion_error","uint() type error: cannot convert to uint")}}),t("string(string): string",n),t("string(bool): string",u=>`${u}`),t("string(int): string",u=>`${u}`),t("string(uint): string",u=>`${u}`),t("string(bytes): string",u=>o.toUtf8(u)),t("string(double): string",u=>u===1/0?"+Inf":u===-1/0?"-Inf":`${u}`),t("string.startsWith(string): bool",(u,m)=>u.startsWith(m)),t("string.endsWith(string): bool",(u,m)=>u.endsWith(m)),t("string.contains(string): bool",(u,m)=>u.includes(m)),t("string.lowerAscii(): string",u=>u.toLowerCase()),t("string.upperAscii(): string",u=>u.toUpperCase()),t("string.trim(): string",u=>u.trim()),t("string.indexOf(string): int",(u,m)=>BigInt(u.indexOf(m))),t("string.indexOf(string, int): int",(u,m,_)=>{if(m==="")return _;if(_=Number(_),_<0||_>=u.length)throw L("index_out_of_range","string.indexOf(search, fromIndex): fromIndex out of range");return BigInt(u.indexOf(m,_))}),t("string.lastIndexOf(string): int",(u,m)=>BigInt(u.lastIndexOf(m))),t("string.lastIndexOf(string, int): int",(u,m,_)=>{if(m==="")return _;if(_=Number(_),_<0||_>=u.length)throw L("index_out_of_range","string.lastIndexOf(search, fromIndex): fromIndex out of range");return BigInt(u.lastIndexOf(m,_))}),t("string.substring(int): string",(u,m)=>{if(m=Number(m),m<0||m>u.length)throw L("index_out_of_range","string.substring(start, end): start index out of range");return u.substring(m)}),t("string.substring(int, int): string",(u,m,_)=>{if(m=Number(m),m<0||m>u.length)throw L("index_out_of_range","string.substring(start, end): start index out of range");if(_=Number(_),_<m||_>u.length)throw L("index_out_of_range","string.substring(start, end): end index out of range");return u.substring(m,_)}),t("string.matches(string): bool",(u,m)=>{try{return new RegExp(m).test(u)}catch{throw L("invalid_regular_expression",`Invalid regular expression: ${m}`)}}),t("string.split(string): list<string>",(u,m)=>u.split(m)),t("string.split(string, int): list<string>",(u,m,_)=>{if(_=Number(_),_===0)return[];let v=u.split(m);if(_<0||v.length<=_)return v;let g=v.slice(0,_-1);return g.push(v.slice(_-1).join(m)),g}),t("list<string>.join(): string",u=>{for(let m=0;m<u.length;m++)if(typeof u[m]!="string")throw L("invalid_list_element_type","string.join(): list must contain only strings");return u.join("")}),t("list<string>.join(string): string",(u,m)=>{for(let _=0;_<u.length;_++)if(typeof u[_]!="string")throw L("invalid_list_element_type","string.join(separator): list must contain only strings");return u.join(m)});let s=new TextEncoder("utf8"),i=new TextDecoder("utf8"),o=typeof Buffer<"u"?{byteLength:u=>Buffer.byteLength(u),fromString:u=>Buffer.from(u,"utf8"),toHex:u=>Buffer.prototype.hexSlice.call(u,0,u.length),toBase64:u=>Buffer.prototype.base64Slice.call(u,0,u.length),toUtf8:u=>Buffer.prototype.utf8Slice.call(u,0,u.length),jsonParse:u=>JSON.parse(u)}:{textEncoder:new TextEncoder("utf8"),byteLength:u=>s.encode(u).length,fromString:u=>s.encode(u),toHex:Uint8Array.prototype.toHex?u=>u.toHex():u=>cd(u,m=>m.toString(16).padStart(2,"0")).join(""),toBase64:Uint8Array.prototype.toBase64?u=>u.toBase64():u=>btoa(cd(u,m=>String.fromCodePoint(m)).join("")),toUtf8:u=>i.decode(u),jsonParse:u=>JSON.parse(s.decode(u))};t("bytes.json(): map",o.jsonParse),t("bytes.hex(): string",o.toHex),t("bytes.string(): string",o.toUtf8),t("bytes.base64(): string",o.toBase64),t("bytes.at(int): int",(u,m)=>{if(m<0||m>=u.length)throw L("index_out_of_range","Bytes index out of range");return BigInt(u[m])});let a="google.protobuf.Timestamp",c="google.protobuf.Duration",l=r.registerType(a,Date).typeType,h=r.registerType(c,yr).typeType;r.registerConstant("google","map<string, map<string, type>>",{protobuf:{Duration:h,Timestamp:l}});function f(u,m){return new Date(u.toLocaleString("en-US",{timeZone:m}))}function d(u,m){let _=m?f(u,m):new Date(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),v=new Date(_.getFullYear(),0,0);return BigInt(Math.floor((_-v)/864e5)-1)}t(`timestamp(string): ${a}`,u=>{if(u.length<20||u.length>30)throw L("invalid_timestamp","timestamp() requires a string in ISO 8601 format");let m=new Date(u);if(m<=0xe677d21fdbff&&m>=-621355968e5)return m;throw L("invalid_timestamp","timestamp() requires a string in ISO 8601 format")}),t(`timestamp(int): ${a}`,u=>{if(u=Number(u)*1e3,u<=0xe677d21fdbff&&u>=-621355968e5)return new Date(u);throw L("invalid_timestamp","timestamp() requires a valid integer unix timestamp")}),t(`${a}.getDate(): int`,u=>BigInt(u.getUTCDate())),t(`${a}.getDate(string): int`,(u,m)=>BigInt(f(u,m).getDate())),t(`${a}.getDayOfMonth(): int`,u=>BigInt(u.getUTCDate()-1)),t(`${a}.getDayOfMonth(string): int`,(u,m)=>BigInt(f(u,m).getDate()-1)),t(`${a}.getDayOfWeek(): int`,u=>BigInt(u.getUTCDay())),t(`${a}.getDayOfWeek(string): int`,(u,m)=>BigInt(f(u,m).getDay())),t(`${a}.getDayOfYear(): int`,d),t(`${a}.getDayOfYear(string): int`,d),t(`${a}.getFullYear(): int`,u=>BigInt(u.getUTCFullYear())),t(`${a}.getFullYear(string): int`,(u,m)=>BigInt(f(u,m).getFullYear())),t(`${a}.getHours(): int`,u=>BigInt(u.getUTCHours())),t(`${a}.getHours(string): int`,(u,m)=>BigInt(f(u,m).getHours())),t(`${a}.getMilliseconds(): int`,u=>BigInt(u.getUTCMilliseconds())),t(`${a}.getMilliseconds(string): int`,u=>BigInt(u.getUTCMilliseconds())),t(`${a}.getMinutes(): int`,u=>BigInt(u.getUTCMinutes())),t(`${a}.getMinutes(string): int`,(u,m)=>BigInt(f(u,m).getMinutes())),t(`${a}.getMonth(): int`,u=>BigInt(u.getUTCMonth())),t(`${a}.getMonth(string): int`,(u,m)=>BigInt(f(u,m).getMonth())),t(`${a}.getSeconds(): int`,u=>BigInt(u.getUTCSeconds())),t(`${a}.getSeconds(string): int`,(u,m)=>BigInt(f(u,m).getSeconds()));let p=/(\d*\.?\d*)(ns|us|µs|ms|s|m|h)/;function y(u){if(!u)throw L("invalid_duration","Invalid duration string: ''");let m=u[0]==="-";(u[0]==="-"||u[0]==="+")&&(u=u.slice(1));let _=BigInt(0);for(;;){let b=p.exec(u);if(!b)throw L("invalid_duration",`Invalid duration string: ${u}`);if(b.index!==0)throw L("invalid_duration",`Invalid duration string: ${u}`);u=u.slice(b[0].length);let E=yL[b[2]],[$="0",S=""]=b[1].split("."),O=BigInt($)*E,A=S?BigInt(S.slice(0,13).padEnd(13,"0"))*E/10000000000000n:0n;if(_+=O+A,u==="")break}let v=_>=Rn?_/Rn:0n,g=Number(_%Rn);return m?new yr(-v,-g):new yr(v,g)}t("duration(string): google.protobuf.Duration",u=>y(u)),t("google.protobuf.Duration.getHours(): int",u=>u.getHours()),t("google.protobuf.Duration.getMinutes(): int",u=>u.getMinutes()),t("google.protobuf.Duration.getSeconds(): int",u=>u.getSeconds()),t("google.protobuf.Duration.getMilliseconds(): int",u=>u.getMilliseconds()),iv(r)}function cv(r){let e=0;for(let t of r)e++;return e}var ge,jn,Rn,yL,yr,xn=Me(()=>{"use strict";gt();ga();di();Hr();ge=class{#e;constructor(e){this.verify(typeof e=="bigint"?e:BigInt(e))}get value(){return this.#e}valueOf(){return this.#e}toString(){return`${this.#e}`}verify(e){if(e<Kr||e>av)throw L("numeric_overflow","Unsigned integer overflow");this.#e=e}get[Symbol.toStringTag](){return`value = ${this.#e}`}[Symbol.for("nodejs.util.inspect.custom")](){return`UnsignedInteger { value: ${this.#e} }`}},jn=1e9,Rn=1000000000n,yL={h:3600000000000n,m:60000000000n,s:Rn,ms:1000000n,us:1000n,\u00B5s:1000n,ns:1n},yr=class r{#e;#t;constructor(e,t=0){this.#e=BigInt(e),this.#t=t}get seconds(){return this.#e}get nanos(){return this.#t}valueOf(){return Number(this.#e)*1e3+this.#t/1e6}static fromMilliseconds(e){let t=BigInt(Math.trunc(e*1e6)),n=t/Rn,s=Number(t%Rn);return new r(n,s)}addDuration(e){let t=this.#t+e.nanos;return new r(this.#e+e.seconds+BigInt(Math.floor(t/jn)),t%jn)}subtractDuration(e){let t=this.#t-e.nanos;return new r(this.#e-e.seconds+BigInt(Math.floor(t/jn)),(t+jn)%jn)}extendTimestamp(e){return new Date(e.getTime()+Number(this.#e)*1e3+Math.floor(this.#t/1e6))}subtractTimestamp(e){return new Date(e.getTime()-Number(this.#e)*1e3-Math.floor(this.#t/1e6))}toString(){let e=this.#t?(this.#t/jn).toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:9}).slice(1):"";return`${this.#e}${e}s`}getHours(){return this.#e/3600n}getMinutes(){return this.#e/60n}getSeconds(){return this.#e}getMilliseconds(){return this.#e*1000n+BigInt(Math.floor(this.#t/1e6))}get[Symbol.toStringTag](){return"google.protobuf.Duration"}[Symbol.for("nodejs.util.inspect.custom")](){return`google.protobuf.Duration { seconds: ${this.#e}, nanos: ${this.#t} }`}}});function bL(r,e){let t=`Macro '${r}' must`;return function(s){let i=e(s);if(!i||typeof i!="object")throw new Error(`${t} return an object.`);if(i.callAst)return i;if(!i.evaluate)throw new Error(`${t} ${_L}`);if(!i.typeCheck)throw new Error(`${t} ${vL}`);return i}}function hd(r){return new vt({kind:"list",name:`list<${r}>`,type:"list",valueType:r})}function Gt(r){return new vt({kind:"primitive",name:r,type:r})}function wL(r){return new vt({kind:"message",name:r,type:r})}function hv(r){let e=r?`dyn<${r}>`:"dyn";return new vt({kind:"dyn",name:e,type:e,valueType:r})}function mv(r){let e=`optional<${r}>`;return new vt({kind:"optional",name:e,type:"optional",valueType:r})}function md(r,e){return new vt({kind:"map",name:`map<${r}, ${e}>`,type:"map",keyType:r,valueType:e})}function EL(r){return new vt({kind:"param",name:r,type:r})}function dv(r){let e=[],t="",n=0;for(let s of r){if(s==="<")n++;else if(s===">")n--;else if(s===","&&n===0){e.push(t.trim()),t="";continue}t+=s}return t&&e.push(t.trim()),e}function _v(r){return new dd(r)}function OL(r){let e;if(r.map){let t=ld(r.keyType,r.resolvedKeyType),n=ld(r.type,r.resolvedType);e=`map<${t}, ${n}>`}else e=ld(r.type,r.resolvedType);return{type:r.repeated?`list<${e}>`:e}}function ld(r,e){switch(r){case"string":return"string";case"bytes":return"bytes";case"bool":return"bool";case"double":case"float":case"int32":case"int64":case"sint32":case"sint64":case"sfixed32":case"sfixed64":case"uint32":case"uint64":case"fixed32":case"fixed64":return"double";default:switch(e?.constructor.name){case"Type":return e.fullName.slice(1);case"Enum":return"int"}return r?.includes(".")?r:"dyn"}}var ve,Ht,gL,ba,vt,_L,vL,hi,ud,Gr,Ve,yv,uv,fv,ee,fd,gv,$L,SL,_a,va,TL,dd,pv,Fn,pd,ga=Me(()=>{"use strict";gt();xn();di();Hr();ve=class{#e;constructor(e){this.#e=e,_t(this)}get name(){return this.#e}get[Symbol.toStringTag](){return`Type<${this.#e}>`}toString(){return`Type<${this.#e}>`}},Ht={string:new ve("string"),bool:new ve("bool"),int:new ve("int"),uint:new ve("uint"),double:new ve("double"),map:new ve("map"),list:new ve("list"),bytes:new ve("bytes"),null_type:new ve("null"),type:new ve("type")},gL=new ve("optional"),ba={dyn(r,e){switch(typeof r){case"string":case"bigint":case"number":case"boolean":return!0;case"object":switch(r&&r.constructor){case null:case void 0:case Object:case Map:case Array:case Set:return!0;default:if(e.objectTypesByConstructor.get(r.constructor))return!0}}return!!e.debugType(r)},string(r){return typeof r=="string"},int(r){return typeof r=="bigint"},double(r){return typeof r=="number"},bool(r){return typeof r=="boolean"},null(r){return r===null},bytes(r){return r instanceof Uint8Array},uint(r){return r instanceof ge},type(r){return r instanceof ve},list(r){switch(r?.constructor){case Array:case Set:return!0;default:return!1}},map(r){switch(typeof r=="object"&&r?r.constructor:null){case void 0:case Object:case Map:return!0;default:return!1}},optional(r){return r instanceof Ie},message(r,e){return this===e.debugType(r)}};ba.param=ba.dyn;vt=class{#e=new WeakMap;constructor({kind:e,type:t,name:n,keyType:s,valueType:i}){this.kind=e,this.type=t,this.name=n,this.keyType=s,this.valueType=i,this.unwrappedType=e==="dyn"&&i?i.unwrappedType:this,this.wrappedType=e==="dyn"?this:hv(this.unwrappedType),this.hasDynType=this.kind==="dyn"||this.valueType?.hasDynType||this.keyType?.hasDynType||!1,this.hasPlaceholderType=this.kind==="param"||this.keyType?.hasPlaceholderType||this.valueType?.hasPlaceholderType||!1,e==="list"?this.fieldLazy=this.#o:e==="map"?this.fieldLazy=this.#s:e==="message"?this.fieldLazy=this.#n:e==="optional"&&(this.fieldLazy=this.#t),this.matchesValueType=ba[n]||ba[e],_t(this)}isDynOrBool(){return this.type==="bool"||this.kind==="dyn"}isEmpty(){return this.valueType&&this.valueType.kind==="param"}unify(e,t){let n=this;if(n===t||n.kind==="dyn"||t.kind==="param")return n;if(t.kind==="dyn"||n.kind==="param")return t;if(n.kind!==t.kind||!(n.hasPlaceholderType||t.hasPlaceholderType||n.hasDynType||t.hasDynType))return null;let s=n.valueType.unify(e,t.valueType);if(!s)return null;switch(n.kind){case"optional":return e.getOptionalType(s);case"list":return e.getListType(s);case"map":let i=n.keyType.unify(e,t.keyType);return i?e.getMapType(i,s):null}}templated(e,t){if(!this.hasPlaceholderType)return this;switch(this.kind){case"dyn":return this.valueType.templated(e,t);case"param":return t?.get(this.name)||this;case"map":return e.getMapType(this.keyType.templated(e,t),this.valueType.templated(e,t));case"list":return e.getListType(this.valueType.templated(e,t));case"optional":return e.getOptionalType(this.valueType.templated(e,t));default:return this}}toString(){return this.name}#t(e,t,n,s){if(e=e instanceof Ie?e.orValue():e,e===void 0)return fi;let i=s.debugType(e);try{return Ie.of(i.fieldLazy(e,t,n,s))}catch(o){if(o instanceof Kt)return fi;throw o}}#n(e,t,n,s){let i=e?s.objectTypesByConstructor.get(e.constructor):void 0;if(!i)return;let o=i.fields?i.fields[t]:Ve;if(!o)return;let a=e instanceof Map?e.get(t):e[t];if(a!==void 0){if(o.matchesValueType(a,s))return a;throw L("field_type_mismatch",`Field '${t}' is not of type '${o}', got '${s.debugType(a)}'`,n)}}#s(e,t,n,s){let i=e instanceof Map?e.get(t):e&&qn(e,t)?e[t]:void 0;if(i!==void 0){if(this.valueType.matchesValueType(i,s))return i;throw L("field_type_mismatch",`Field '${t}' is not of type '${this.valueType}', got '${s.debugType(i)}'`,n)}}#i(e,t){switch(e?.constructor){case Array:return e[t];case Set:{let n=0;for(let s of e)if(n++===t)return s}}}#o(e,t,n,s){if(typeof t=="bigint")t=Number(t);else if(typeof t!="number")return;let i=this.#i(e,t);if(i===void 0){if(!e)return;throw L("index_out_of_bounds",`No such key: index out of bounds, index ${t} ${t<0?"< 0":`>= size ${e.length||e.size}`}`,n)}if(this.valueType.matchesValueType(i,s))return i;throw L("list_item_type_mismatch",`List item with index '${t}' is not of type '${this.valueType}', got '${s.debugType(i)}'`,n)}fieldLazy(){}field(e,t,n,s){let i=this.fieldLazy(e,t,n,s);if(i!==void 0)return i;throw L("no_such_key",`No such key: ${t}`,n)}matchesBoth(e){return this.matches(e)&&e.matches(this)}matches(e){let t=this.unwrappedType;return e=e.unwrappedType,t===e||t.kind==="dyn"||e.kind==="dyn"||e.kind==="param"?!0:this.#e.get(e)??this.#e.set(e,this.#r(t,e)).get(e)}#r(e,t){switch(e.kind){case"dyn":case"param":return!0;case"list":return t.kind==="list"&&e.valueType.matches(t.valueType);case"map":return t.kind==="map"&&e.keyType.matches(t.keyType)&&e.valueType.matches(t.valueType);case"optional":return t.kind==="optional"&&e.valueType.matches(t.valueType);default:return e.name===t.name}}},_L="have a .callAst property or .evaluate(checker, macro, ctx) method.",vL="have a .callAst property or .typeCheck(checker, macro, ctx) method.";hi=class{constructor(e,t,n,s){this.name=e,this.type=t,this.description=n??null,this.constant=s!==void 0,this.value=s,_t(this)}},ud=class{constructor({name:e,receiverType:t,returnType:n,handler:s,description:i,params:o,async:a}){if(typeof e!="string")throw new Error("name must be a string");if(typeof s!="function")throw new Error("handler must be a function");this.name=e,this.async=pi(s,a),this.receiverType=t??null,this.returnType=n,this.description=i??null,this.params=o,this.argTypes=o.map(l=>l.type),this.macro=this.argTypes.includes(yv);let c=t?`${t}.`:"";this.signature=`${c}${e}(${this.argTypes.join(", ")}): ${n}`,this.handler=this.macro?bL(this.signature,s):s,this.partitionKey=`${t?"rcall":"call"}:${e}:${o.length}`,this.hasPlaceholderType=this.returnType.hasPlaceholderType||this.receiverType?.hasPlaceholderType||this.argTypes.some(l=>l.hasPlaceholderType)||!1,_t(this)}matchesArgs(e){return e.length===this.argTypes.length&&this.argTypes.every((t,n)=>t.matches(e[n]))?this:null}},Gr=class{constructor({op:e,leftType:t,rightType:n,handler:s,returnType:i,async:o}){this.operator=e,this.leftType=t,this.rightType=n||null,this.handler=s,this.async=pi(s,o),this.returnType=i,n?this.signature=`${t} ${e} ${n}: ${i}`:this.signature=`${e}${t}: ${i}`,this.hasPlaceholderType=this.leftType.hasPlaceholderType||this.rightType?.hasPlaceholderType||!1,_t(this)}equals(e){return this.operator===e.operator&&this.leftType===e.leftType&&this.rightType===e.rightType}};Ve=hv(),yv=Gt("ast"),uv=hd(Ve),fv=md(Ve,Ve),ee={string:Gt("string"),bool:Gt("bool"),int:Gt("int"),uint:Gt("uint"),double:Gt("double"),bytes:Gt("bytes"),dyn:Ve,null:Gt("null"),type:Gt("type"),optional:mv(Ve),list:uv,"list<dyn>":uv,map:fv,"map<dyn, dyn>":fv};for(let r of[ee.string,ee.double,ee.int]){let e=hd(r),t=md(ee.string,r);ee[e.name]=e,ee[t.name]=t}Object.freeze(ee);fd=class{returnType=null;async=!1;macro=!1;#e=null;#t=null;declarations=[];constructor(e){this.registry=e}[Symbol.iterator](){return this.declarations[Symbol.iterator]()}add(e){this.returnType=(this.returnType||e.returnType).unify(this.registry,e.returnType)||Ve,e.macro&&(this.macro=e),e.async&&!this.async&&(this.async=!0),this.declarations.push(e),this.#e?.clear(),this.#t?.clear()}findFunction(e,t=null){for(let n=0;n<this.declarations.length;n++){let s=this.#a(this.declarations[n],e,t);if(s)return s}return null}findUnaryOverload(e){let t=(this.#e??=new Map).get(e);if(t!==void 0)return t;let n=!1;for(let s of this.declarations)if(s.leftType===e){n=s;break}return this.#e.set(e,n),n}findBinaryOverload(e,t){return e.kind==="dyn"&&e.valueType?t=t.wrappedType:t.kind==="dyn"&&t.valueType&&(e=e.wrappedType),(this.#e??=new Map).get(e)?.get(t)??this.#n(this.#e,e,t,this.#s(e,t))}checkBinaryOverload(e,t){return(this.#t??=new Map).get(e)?.get(t)??this.#n(this.#t,e,t,this.#i(e,t))}#n(e,t,n,s){return(e.get(t)||e.set(t,new Map).get(t)).set(n,s),s}#s(e,t){let n=this.#o(e,t);if(n.length===0)return!1;if(n.length===1)return n[0];throw new Error(`Operator overload '${n[0].signature}' overlaps with '${n[1].signature}'.`)}#i(e,t){let n=this.#o(e,t);if(n.length===0)return!1;let s=n[0].returnType;for(let i=1;i<n.length;i++)s=s.unify(this.registry,n[i].returnType)||Ve;return s}#o(e,t){let n=[];for(let s of this.declarations){if(s.leftType===e&&s.rightType===t)return[s];let i=this.#r(s,e,t);i&&n.push(i)}if(n.length===0){let s=this.declarations[0]?.operator;if((s==="=="||s==="!=")&&e.kind==="dyn")return TL[s]}return n}#r(e,t,n){let s=e.hasPlaceholderType?new Map:null,i=this.#l(e.leftType,t,s);if(!i)return;let o=this.#l(e.rightType,n,s);if(o)return(e.operator==="=="||e.operator==="!=")&&e.leftType.kind==="dyn"&&e.leftType.valueType&&t.kind!=="dyn"&&n.kind!=="dyn"?!1:e.hasPlaceholderType?{async:e.async,signature:e.signature,handler:e.handler,leftType:i,rightType:o,returnType:e.returnType.templated(this.registry,s)}:e}#a(e,t,n){if(e.hasPlaceholderType)return this.#f(e,t,n);if(!(n&&e.receiverType&&!n.matches(e.receiverType)))return e.matchesArgs(t)}#f(e,t,n){let s=new Map;if(n&&e.receiverType&&!this.#l(e.receiverType,n,s))return null;for(let i=0;i<t.length;i++)if(!this.#l(e.argTypes[i],t[i],s))return null;return{async:e.async,handler:e.handler,signature:e.signature,returnType:e.returnType.templated(this.registry,s)}}#l(e,t,n){if(!e.hasPlaceholderType)return t.matches(e)?t:null;let s=t.kind==="dyn";return this.#u(e,t,n,s)&&(s||t.matches(e.templated(this.registry,n)))?t:null}#u(e,t,n,s=!1){if(!e.hasPlaceholderType)return!0;if(!t)return!1;let i=s||t.kind==="dyn";switch(t=t.unwrappedType,e.kind){case"param":{let o=i?Ve:t,a=n.get(e.name);return a?a.kind==="dyn"||o.kind==="dyn"?!0:a.matchesBoth(o):n.set(e.name,o)&&!0}case"list":return t.name==="dyn"&&(t=e),t.kind!=="list"?!1:this.#u(e.valueType,t.valueType,n,i);case"map":return t.name==="dyn"&&(t=e),t.kind!=="map"?!1:this.#u(e.keyType,t.keyType,n,i)&&this.#u(e.valueType,t.valueType,n,i);case"optional":return t.name==="dyn"&&(t=e),t.kind!=="optional"?!1:this.#u(e.valueType,t.valueType,n,i)}return!0}};gv=[[ge,"uint",Ht.uint,ee.uint],[ve,"type",Ht.type,ee.type],[Ie,"optional",gL,ee.optional],[Uint8Array,"bytes",Ht.bytes,ee.bytes],...typeof Buffer<"u"?[[Buffer,"bytes",Ht.bytes,ee.bytes]]:[]].map(([r,e,t,n])=>Object.freeze({name:e,typeType:t,type:n,ctor:r})),$L=gv.map(r=>[r.name,r]),SL=gv.map(r=>[r.ctor,r]),_a=r=>new Error(`Invalid variable declaration: ${r}`),va=r=>new Error(`Invalid type declaration: ${r}`),TL={"==":[{handler:(r,e)=>r===e,returnType:ee.bool}],"!=":[{handler:(r,e)=>r!==e,returnType:ee.bool}]},dd=class r{#e=null;#t;#n=!0;#s=null;#i=null;#o=null;#r=null;#a=null;#f=null;#l=null;#u=null;#d=!1;constructor(e={}){this.enableOptionalTypes=e.enableOptionalTypes??!1,this.unlistedVariablesAreDyn=e.unlistedVariablesAreDyn??!1;let t=e.parent instanceof r?e.parent:null;if(t){this.#e=t;let n=t;for(;n&&!n.#s;)n=n.#e;let s=t;for(;s&&!s.#i;)s=s.#e;this.#o=t.#o,this.#r=t.#r,this.#u={operators:n.#s,functions:s.#i},this.objectTypes=new Map(t.objectTypes),this.objectTypesByConstructor=new Map(t.objectTypesByConstructor),this.variables=t.variables,this.#n=!1,this.#t=t.#t,this.#a=t.#a,this.#f=t.#f,this.#l=t.#l,(this.enableOptionalTypes!==t.enableOptionalTypes||this.unlistedVariablesAreDyn!==t.unlistedVariablesAreDyn)&&sv(this,this.enableOptionalTypes)}else{this.#s=[],this.#i=[],this.objectTypes=new Map($L),this.objectTypesByConstructor=new Map(SL),this.#t=new Map(ov(ee)),this.#a=new Map,this.#f=new Map,this.#l=new Map,this.variables=new Map,this.variables.dyn=this.unlistedVariablesAreDyn;for(let n in Ht)this.registerConstant(n,"type",Ht[n])}}#v(){this.#n||(this.variables=new Map(this.variables),this.variables.dyn=this.unlistedVariablesAreDyn,this.#n=!0)}deleteVariable(e){this.#v(),this.variables.delete(e)}#y(e){this.#s||(this.#o=null),this.operatorCandidates(e.operator).add(e),this.#s.push(e)}#E(e){this.#i||(this.#r=null),this.#g(e.partitionKey).add(e),this.#i.push(e)}#p(e,t){return e.get(t)||e.set(t,new fd(this)).get(t)}#$(){return this.#s?this.#s:this.#s=[...this.#u.operators]}#b(){return this.#i?this.#i:this.#i=[...this.#u.functions]}operatorCandidates(e){if(this.#o)return this.#p(this.#o,e);let t=this.#o=new Map;for(let n of this.#$())this.#p(t,n.operator).add(n);return this.#p(t,e)}functionCandidates(e,t,n){return this.#g(`${e?"rcall":"call"}:${t}:${n}`)}#g(e){if(this.#r)return this.#p(this.#r,e);let t=this.#r=new Map;for(let n of this.#b())this.#p(t,n.partitionKey).add(n);return this.#p(t,e)}registerVariable(e,t,n){if(this.#d)throw new Error("Cannot modify frozen registry");let s=n?.description,i;if(typeof e=="string"&&typeof t=="object"&&!(t instanceof vt)?(s=t.description,i=t.value,t.schema?t=this.registerType({name:`$${e}`,schema:t.schema}).type:t=t.type):typeof e=="object"&&(e.schema?t=this.registerType({name:`$${e.name}`,schema:e.schema}).type:t=e.type,s=e.description,i=e.value,e=e.name),typeof e!="string"||!e)throw _a("name must be a string");if(Mn.has(e))throw _a(`'${e}' is a reserved name`);if(this.variables.get(e)!==void 0)throw _a(`'${e}' is already registered`);if(typeof t=="string")t=this.getType(t);else if(!(t instanceof vt))throw _a("type is required");return this.#v(),this.variables.set(e,new hi(e,t,s,i)),this}#S(e,t){let n=Object.create(null);for(let s of Se(t)){let i=t[s];if(typeof i=="object"&&i)n[s]=this.registerType({name:`${e}.${s}`,schema:i}).type.name;else if(typeof i=="string")n[s]=i;else throw new Error(`Invalid field definition for '${e}.${s}'`)}return n}registerConstant(e,t,n){return typeof e=="object"?this.registerVariable(e):this.registerVariable({name:e,type:t,value:n}),this}getType(e){return this.#c(e,!0)}getListType(e){return this.#a.get(e)||this.#a.set(e,this.#c(`list<${e}>`,!0)).get(e)}getMapType(e,t){return this.#f.get(e)?.get(t)||(this.#f.get(e)||this.#f.set(e,new Map).get(e)).set(t,this.#c(`map<${e}, ${t}>`,!0)).get(t)}getOptionalType(e){return this.#l.get(e)||this.#l.set(e,this.#c(`optional<${e}>`,!0)).get(e)}assertType(e,t,n){try{return this.#c(e,!0)}catch(s){throw s.message=`Invalid ${t} '${s.unknownType||e}' in '${n}'`,s}}getFunctionType(e){if(e==="ast")return yv;let t=this.#c(e,!0);if(t.kind==="dyn"&&t.valueType)throw new Error(`type '${t.name}' is not supported`);return t}registerType(e,t){if(this.#d)throw new Error("Cannot modify frozen registry");if(typeof e=="object"&&(t=e,e=t.fullName||t.name||t.ctor?.name),typeof e=="string"&&e[0]==="."&&(e=e.slice(1)),typeof e!="string"||e.length<2||Mn.has(e))throw va(`name '${e}' is not valid`);if(this.objectTypes.has(e))throw va(`type '${e}' already registered`);let n=this.#c(e,!1);if(n.kind!=="message")throw va(`type '${e}' is not valid`);let s={name:e,typeType:new ve(e),type:n,ctor:typeof t=="function"?t:t?.ctor,convert:typeof t=="function"?void 0:t?.convert,fields:typeof t?.schema=="object"?this.#w(e,this.#S(e,t.schema)):this.#w(e,typeof t=="function"?void 0:t?.fields)};if(typeof s.ctor!="function"){if(!s.fields)throw va(`type '${e}' requires a constructor or fields`);Object.assign(s,this.#N(e,s.fields))}return this.objectTypes.set(e,Object.freeze(s)),this.objectTypesByConstructor.set(s.ctor,s),this.registerFunctionOverload(`type(${e}): type`,()=>s.typeType,{async:!1}),s}#c(e,t=!0){let n=this.#t.get(e);if(n)return n;if(typeof e!="string"||!e.length)throw new Error("Invalid type: must be a string");if(n=e.match(/^[A-Z]$/),n)return this.#h(EL,e,e);if(n=e.match(/^(dyn|list|map|optional)<(.+)>$/),!n){if(t){let o=new Error(`Unknown type: ${e}`);throw o.unknownType=e,o}return this.#h(wL,e,e)}let s=n[1],i=n[2].trim();switch(s){case"dyn":{let o=this.#c(i,t).wrappedType;return this.#t.set(o.name,o),o}case"list":{let o=this.#c(i,t);return this.#h(hd,`list<${o}>`,o)}case"map":{let o=dv(i);if(o.length!==2)throw new Error(`Invalid map type: ${e}`);let a=this.#c(o[0],t),c=this.#c(o[1],t);return this.#h(md,`map<${a}, ${c}>`,a,c)}case"optional":{let o=this.#c(i,t);return this.#h(mv,`optional<${o}>`,o)}}}#h(e,t,...n){return this.#t.get(t)||this.#t.set(t,e(...n)).get(t)}findMacro(e,t,n){return this.functionCandidates(t,e,n).macro}findUnaryOverload(e,t){return this.operatorCandidates(e).findUnaryOverload(t)}findBinaryOverload(e,t,n){return this.operatorCandidates(e).findBinaryOverload(t,n)}#T(e){return typeof e=="string"?{type:e}:e.id?OL(e):e}#O(e,t,n,s=!1){try{let i=this.#T(t[n]);if(typeof i?.type!="string")throw new Error("unsupported declaration");return this.#c(i.type,s)}catch(i){throw i.message=`Field '${n}' in type '${e}' has unsupported declaration: ${JSON.stringify(t[n])}`,i}}#w(e,t){if(!t)return;let n=Object.create(null);for(let s of Se(t))n[s]=this.#O(e,t,s);return n}#N(e,t){let n=Se(t),s=Object.create(null);for(let o of n){let a=t[o],c=a.kind==="message"&&this.objectTypes.get(a.name);c===!1?s[o]=!1:s[o]=c.convert?c:!1}let i={[e]:class extends Map{#m;constructor(o){super(),this.#m=o}[Symbol.iterator](){if(this.size!==n.length)for(let o of n)this.get(o);return super[Symbol.iterator]()}get(o){let a=super.get(o);if(a!==void 0||this.has(o))return a;let c=s[o];if(c!==void 0){if(a=this.#m instanceof Map?this.#m.get(o):this.#m?.[o],c&&a&&typeof a=="object")switch(a.constructor){case void 0:case Object:case Map:a=c.convert(a)}return super.set(o,a),a}}}}[e];return{ctor:i,convert(o){if(o)return o.constructor===i?o:new i(o)}}}clone(e){return this.#d=!0,new r({parent:this,unlistedVariablesAreDyn:e.unlistedVariablesAreDyn,enableOptionalTypes:e.enableOptionalTypes})}getDefinitions(){let e=[],t=[];for(let[,n]of this.variables)n&&e.push({name:n.name,description:n.description||null,type:n.type.name});for(let n of this.#b())t.push({signature:n.signature,name:n.name,description:n.description,receiverType:n.receiverType?n.receiverType.name:null,returnType:n.returnType.name,params:n.params.map(s=>({name:s.name,type:s.type.name,description:s.description}))});return{variables:e,functions:t}}#I(e){if(typeof e!="string")throw new Error("Invalid signature: must be a string");let t=e.match(/^(?:([a-zA-Z0-9.<>]+)\.)?(\w+)\(([^)]*)\):(.*)$/);if(!t)throw new Error(`Invalid signature: ${e}`);let n=t[4].trim();if(!n)throw new Error(`Invalid signature: ${e}`);return{receiverType:t[1]||null,name:t[2],argTypes:dv(t[3]),returnType:n}}#A(e,t){return e.name!==t.name||e.argTypes.length!==t.argTypes.length||(e.receiverType||t.receiverType)&&(!e.receiverType||!t.receiverType)?!1:!(e.receiverType!==t.receiverType&&e.receiverType!==Ve&&t.receiverType!==Ve)&&(t.macro||e.macro||t.argTypes.every((s,i)=>{let o=e.argTypes[i];return s===o||s===Ve||o===Ve}))}#P(e){for(let t of this.#g(e.partitionKey))if(this.#A(t,e))throw new Error(`Function signature '${e.signature}' overlaps with existing overload '${t.signature}'.`)}#k(e,t,n){if(!n)return{type:this.getFunctionType(t),name:`arg${e}`,description:null};let s=n.type||t;if(!s)throw new Error(`params[${e}].type is required`);if(t&&s!==t)throw new Error(`params[${e}].type not equal to signature type`);return{name:n.name||`arg${e}`,type:this.getFunctionType(s),description:n.description??null}}registerFunctionOverload(e,t,n){if(this.#d)throw new Error("Cannot modify frozen registry");typeof e=="object"?n=e:typeof t=="object"?n=t:n||(n={});let s=typeof e=="string"?e:n.signature??void 0,i=s!==void 0?this.#I(s):void 0,o=i?.name||n.name,a=i?.receiverType||n.receiverType,c=i?.argTypes,l=i?.returnType||n.returnType,h=n.params;t=typeof t=="function"?t:n.handler;let f;try{if(!o)throw new Error("signature or name are required");if(!l)throw new Error("must have a returnType");if(h){if(c&&h.length!==c.length)throw new Error("mismatched length in params and args in signature")}else if(!c)throw new Error("signature or params are required");f=new ud({name:o,async:n?.async,receiverType:a?this.getType(a):null,returnType:this.getType(l),handler:t,description:n.description,params:(c||h).map((d,p)=>this.#k(p,c?.[p],h?.[p]))})}catch(d){throw typeof s=="string"?d.message=`Invalid function declaration '${s}': ${d.message}`:o?d.message=`Invalid function declaration '${o}': ${d.message}`:d.message=`Invalid function declaration: ${d.message}`,d}this.#P(f),this.#E(f)}registerOperatorOverload(e,t,n){let s=e.match(/^([-!])([\w.<>]+)(?::\s*([\w.<>]+))?$/);if(s){let[,h,f,d]=s;return this.unaryOverload(h,f,t,d,n?.async)}let i=e.match(/^([\w.<>]+) ([-+*%/]|==|!=|<|<=|>|>=|in) ([\w.<>]+)(?::\s*([\w.<>]+))?$/);if(!i)throw new Error(`Operator overload invalid: ${e}`);let[,o,a,c,l]=i;return this.binaryOverload(o,a,c,t,l)}unaryOverload(e,t,n,s,i){if(this.#d)throw new Error("Cannot modify frozen registry");let o=this.assertType(t,"type",`${e}${t}`),a=this.assertType(s||t,"return type",`${e}${t}: ${s||t}`),c=new Gr({op:`${e}_`,leftType:o,returnType:a,handler:n,async:i});this.#y(this.#_(c))}#C(e){for(let t of this.operatorCandidates(e.operator))if(e.equals(t))return!0;return!1}#_(e){if(!this.#C(e))return e;throw new Error(`Operator overload already registered: ${e.signature}`)}binaryOverload(e,t,n,s,i,o){if(this.#d)throw new Error("Cannot modify frozen registry");i??=pv.has(t)?"bool":e;let a=`${e} ${t} ${n}: ${i}`,c=this.assertType(e,"left type",a),l=this.assertType(n,"right type",a),h=this.assertType(i,"return type",a);if(c.kind==="dyn"&&c.valueType?l=l.wrappedType:l.kind==="dyn"&&l.valueType&&(c=c.wrappedType),pv.has(t)&&h.type!=="bool")throw new Error(`Comparison operator '${t}' must return 'bool', got '${h.type}'`);let f=new Gr({op:t,leftType:c,rightType:l,returnType:h,handler:s,async:o});if(f.hasPlaceholderType&&!(l.hasPlaceholderType&&c.hasPlaceholderType))throw new Error(`Operator overload with placeholders must use them in both left and right types: ${a}`);if(this.#_(f),t==="=="){let d=[new Gr({op:"!=",leftType:c,rightType:l,handler(p,y,u,m){return!s(p,y,u,m)},returnType:h,async:o})];c!==l&&d.push(new Gr({op:"==",leftType:l,rightType:c,handler(p,y,u,m){return s(y,p,u,m)},returnType:h,async:o}),new Gr({op:"!=",leftType:l,rightType:c,handler(p,y,u,m){return!s(y,p,u,m)},returnType:h,async:o}));for(let p of d)this.#_(p);for(let p of d)this.#y(p)}this.#y(f)}},pv=new Set(["<","<=",">",">=","==","!=","in"]);Fn=class{#e;#t;#n;#s;constructor(e,t){if(this.#e=e.variables,t!=null){if(typeof t!="object")throw L("invalid_context","Context must be an object");t instanceof Map?this.#n=t:this.#t=t}}getValue(e){return this.#s?.get(e)||(this.#t?this.#t[e]:this.#n?.get(e))}getVariable(e){return this.#e.get(e)??(this.#e.dyn&&!Mn.has(e)?new hi(e,Ve):void 0)}getCheckedValue(e,t){let n=this.getValue(t.args);if(n===void 0)throw e.createError("unknown_variable",`Unknown variable: ${t.args}`,t);if(t.checkedType.matchesValueType(n,e))return n;let s=t.checkedType,i=e.debugType(n);if(s.kind==="message"&&i.kind==="map"){let o=e.objectTypes.get(s.name)?.convert?.(n);if(o)return(this.#s??=new Map).set(t.args,o),o}throw e.createError("variable_type_mismatch",`Variable '${t.args}' is not of type '${s}', got '${i}'`,t)}forkWithVariable(e,t){return new pd(this,e,t)}},pd=class r{#e;accuType;accuValue;iterValue;constructor(e,t,n){this.#e=e,this.iterVar=t,this.iterType=n}forkWithVariable(e,t){return new r(this,e,t)}reuse(e){if(!this.async)return this.#e=e,this;let t=new r(e,this.iterVar,this.iterType);return t.accuType=this.accuType,t}setIterValue(e,t){if(this.iterType.matchesValueType(e,t))return this.iterValue=e,this;let n=this.iterType,s=t.debugType(e);if(n.kind==="message"&&s.kind==="map"){let i=t.objectTypes.get(n.name)?.convert?.(e);if(i)return this.iterValue=i,this}throw t.createError("variable_type_mismatch",`Variable '${this.iterVar}' is not of type '${n}', got '${s}'`)}setAccuType(e){return this.accuType=e,this}setAccuValue(e){return this.accuValue=e,this}getValue(e){return this.iterVar===e?this.iterValue:this.#e.getValue(e)}getCheckedValue(e,t){return this.iterVar===t.args?this.iterValue:this.#e.getCheckedValue(e,t)}getVariable(e){return this.iterVar===e?new hi(e,this.iterType):this.#e.getVariable(e)}}});function gd(r,e){throw r.createError("unsupported_type",`Unsupported type: ${e}`)}function kt(r,e,t){return e===!0||e&&(e?.maybeAsync||vv(e))?NL(t):r===!0||r&&(r?.maybeAsync||vv(r))?IL(t):t}function NL(r){return r.__asyncBoth??=function(t,n,s,i){return t instanceof Promise||n instanceof Promise?n instanceof Promise?t instanceof Promise?Promise.all([t,n]).then(o=>r(o[0],o[1],s,i)):n.then(o=>r(t,o,s,i)):t.then(o=>r(o,n,s,i)):r(t,n,s,i)}}function IL(r){return r.__asyncFirst??=function(t,n,s,i){return t instanceof Promise?t.then(o=>r(o,n,s,i)):r(t,n,s,i)}}function bv(r,e,t){e.right=e.args[1];let n=r.check(e.left=e.args[0],t);return e.op==="[]"&&r.check(e.right,t),e.handle=kt(e.left,e.op==="[]"?e.right:!1,n!==Av?zL:HL),n.kind!=="optional"?r.checkAccessOnType(e,t,n):r.registry.getOptionalType(r.checkAccessOnType(e,t,n.valueType,!0))}function wv(r,e,t){e.right=e.args[1];let n=r.check(e.left=e.args[0],t);e.op==="[?]"&&r.check(e.right,t),e.handle=kt(e.left,e.op==="[?]"?e.right:!1,VL);let s=n.kind==="optional"?n.valueType:n;return r.registry.getOptionalType(r.checkAccessOnType(e,t,s,!0))}function Ev(r,e,t,n,s){let i=r.check(n,e);if(i===t||t.isEmpty())return i;if(i.isEmpty())return t;throw r.createError(s,`${AL[s]} expected type '${r.formatType(t)}' but found '${r.formatType(i)}'`,n)}function $v(r,e,t,n){return t.unify(r.registry,r.check(n,e))||Av}function PL(r,e,t){let n=r.debugRuntimeType(e);return r.createError("invalid_condition_type",`${t.meta.label||"Ternary condition must be bool"}, got '${n}'`,t)}function kL(r,e,t,n){if(r===!0)return e.run(t.left,n);if(r===!1)return e.run(t.right,n);throw PL(e,r,t.condition)}function vd(r,e,t){let n=r.debugRuntimeType(e);return r.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${n}'`,t)}function Pv(r,e,t){return e instanceof Error?e:vd(r,e,t)}function Un(r,e,t,n,s){if(s===r)return r;if(s===!r){if(n===s)return s;throw Pv(e,n,t.left)}if(s instanceof Promise)return s.then(i=>CL(r,e,t,n,i));throw vd(e,s,t.left)}function CL(r,e,t,n,s){if(s===r)return r;if(typeof s!="boolean")throw vd(e,s,t.right);if(typeof n!="boolean")throw Pv(e,n,t.left);return!r}function Sv(r,e,t){let n=r.check(e.left=e.args[0],t),s=r.check(e.right=e.args[1],t);if(!n.isDynOrBool())throw r.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${r.formatType(n)}'`,e);if(!s.isDynOrBool())throw r.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${r.formatType(s)}'`,e);return r.boolType}function Tv(r,e,t){let n=e.op,s=r.check(e.args,t);if(e.candidates=r.registry.operatorCandidates(n),s.kind==="dyn")return e.handle=kt(e.args,!1,LL),e.candidates.returnType;let i=e.candidates.findUnaryOverload(s);if(!i)throw r.createError("no_such_overload",`no such overload: ${n[0]}${r.formatType(s)}`,e);return e.handle=kt(e.args,!1,i.handler),i.returnType}function LL(r,e,t){let n=t.debugRuntimeType(r,e.args.checkedType),s=e.candidates.findUnaryOverload(n);if(s)return s.handler(r);throw t.createError("no_such_overload",`no such overload: ${e.op[0]}${n}`,e)}function Ov(r,e,t){return e.handle(r.run(e.args,t),e,r)}function DL(r,e,t){let n=e.op,s=r.check(e.left=e.args[0],t),i=r.check(e.right=e.args[1],t);e.candidates=r.registry.operatorCandidates(n);let o=s.hasDynType||i.hasDynType?void 0:e.candidates.findBinaryOverload(s,i);if(e.handle=kt(e.left,e.right,o?.handler||qL),o)return o.returnType;let a=e.candidates.checkBinaryOverload(s,i);if(s.hasDynType||(e.leftStaticType=s),i.hasDynType||(e.rightStaticType=i),a)return a;throw r.createError("no_such_overload",`no such overload: ${r.formatType(s)} ${n} ${r.formatType(i)}`,e)}function _d(r,e,t){return e.handle(r.run(e.left,t),r.run(e.right,t),e,r)}function Nv(r,e,t){return e.handle(r.run(e.left,t),e.right,e,r)}function qL(r,e,t,n){let s=t.leftStaticType||n.debugTypeDeep(r).wrappedType,i=t.rightStaticType||n.debugTypeDeep(e).wrappedType,o=t.candidates.findBinaryOverload(s,i);if(o)return o.handler(r,e,t,n);throw n.createError("no_such_overload",`no such overload: ${s} ${t.op} ${i}`,t)}function wa(r,e,t,n){try{let s=r.apply(e,t);return s instanceof Promise?s.catch(i=>{throw ui(i,n)}):s}catch(s){throw ui(s,n)}}function ML(r,e,t){let n=e.args[1],s=e.argTypes,i=n.length;for(;i--;)s[i]=t.debugRuntimeType(r[i],n[i].checkedType);let o=e.candidates.findFunction(s);if(o)return wa(o.handler,t,r,e);throw t.createError("no_matching_overload",`found no matching overload for '${e.args[0]}(${s.map(a=>a.unwrappedType).join(", ")})'`,e)}function jL(r,e,t){let[,n,s]=t.args,i=t.argTypes;for(let c=0;c<i.length;c++)i[c]=e.debugRuntimeType(r[c+1],s[c].checkedType);let o=e.debugRuntimeType(r[0],n.checkedType),a=t.candidates.findFunction(i,o);if(a)return wa(a.handler,e,r,t);throw e.createError("no_matching_overload",`found no matching overload for '${o.type}.${t.args[0]}(${i.map(c=>c.unwrappedType).join(", ")})'`,t)}function yd(r,e,t,n=e.length){if(n===0)return[];let s,i=new Array(n);for(;n--;)(i[n]=r.run(e[n],t))instanceof Promise&&(s??=!0);return s?Promise.all(i):i}function Iv(r){let e={};for(let t=0;t<r.length;t++){let[n,s]=r[t];n==="__proto__"||n==="constructor"||n==="prototype"||(e[n]=s)}return e}function RL(r,e,t){let n=r.check(e,t);if(n.kind==="dyn")return n;if(n.kind==="list")return n.valueType;if(n.kind==="map")return n.keyType;throw r.createError("invalid_comprehension_range",`Expression of type '${r.formatType(n)}' cannot be range of a comprehension (must be list, map, or dynamic).`,e)}function kv(r,e,t){if(t instanceof Set)return[...t];if(t instanceof Map)return[...t.keys()];if(t&&typeof t=="object")return Se(t);throw r.createError("invalid_comprehension_range",`Expression of type '${r.debugType(t)}' cannot be range of a comprehension (must be list, map, or dynamic).`,e.iterable)}function xL(r,e,t,n){zr(r)||(r=kv(t,e,r));let s=t.run(e.init,n=e.iterCtx.reuse(n));return n.accuValue=s,n===e.iterCtx?BL(t,n,e,r,s,0):Lv(t,n,e,r,s,0)}function FL(r,e,t,n){zr(r)||(r=kv(t,e,r));let s=t.run(e.init,n=e.iterCtx.reuse(n));return n.accuValue=s,n===e.iterCtx?UL(t,n,e,r,s,0):Cv(t,n,e,r,s,0)}function UL(r,e,t,n,s,i){let o=t.condition,a=t.step,c=n.length;for(;i<c&&!(o&&!o(s));)if(s=r.run(a,e.setIterValue(n[i++],r)),s instanceof Promise)return Cv(r,e,t,n,s,i);return t.result(s)}async function Cv(r,e,t,n,s,i){e===t.iterCtx&&(e.async=!0);let o=t.condition,a=t.step,c=n.length;for(s=await s;i<c;){if(o&&!o(s))return t.result(s);s=r.run(a,e.setIterValue(n[i++],r)),s instanceof Promise&&(s=await s)}return t.result(s)}function BL(r,e,t,n,s,i,o,a){let c=t.condition,l=t.step,h=n.length;for(;i<h;){if(!c(s))return t.result(s);if(a=r.tryEval(l,e.setIterValue(n[i++],r)),a instanceof Promise)return Lv(r,e,t,n,s,i,o,a);a instanceof Error&&(o??=a)||(s=a)}if(o&&c(s))throw o;return t.result(s)}async function Lv(r,e,t,n,s,i,o,a){e===t.iterCtx&&(e.async=!0);let c=t.condition,l=t.step,h=n.length;for(a=await a,a instanceof Error?o??=a:s=a;i<h;){if(!c(s))return t.result(s);a=r.tryEval(l,e.setIterValue(n[i++],r)),a instanceof Promise&&(a=await a),!(a instanceof Error&&(o??=a))&&(s=a)}if(o&&c(s))throw o;return t.result(s)}function VL(r,e,t,n){return n.optionalType.field(r,e,t,n)}function zL(r,e,t,n){return t.left.checkedType.field(r,e,t,n)}function HL(r,e,t,n){switch(r?.constructor){case void 0:case Object:{let i=qn(r||KL,e)?r[e]:void 0;if(i!==void 0)return n.debugType(i),i;break}case Map:{let i=r.get(e);if(i!==void 0)return n.debugType(i),i;break}case Array:case Set:return n.listType.field(r,e,t,n);default:let s=n.objectTypesByConstructor.get(r.constructor);if(s)return s.type.field(r,e,t,n);typeof r=="object"&&gd(n,r.constructor.name)}throw n.createError("no_such_key",`No such key: ${e}`,t)}var Av,Bn,vv,AL,KL,GL,YL,P,ZL,mi=Me(()=>{"use strict";ga();Hr();gt();Av=ee.dyn,Bn=class{dynType=ee.dyn;optionalType=ee.optional;stringType=ee.string;intType=ee.int;doubleType=ee.double;boolType=ee.bool;nullType=ee.null;listType=ee.list;mapType=ee.map;constructor(e){this.opts=e.opts,this.registry=e.registry,this.objectTypes=this.registry.objectTypes,this.objectTypesByConstructor=this.registry.objectTypesByConstructor}getType(e){return this.registry.getType(e)}debugType(e){switch(typeof e){case"string":return this.stringType;case"bigint":return this.intType;case"number":return this.doubleType;case"boolean":return this.boolType;case"object":if(e===null)return this.nullType;switch(e.constructor){case void 0:case Object:case Map:return this.mapType;case Array:case Set:return this.listType;default:return this.objectTypesByConstructor.get(e.constructor)?.type||gd(this,e.constructor?.name||typeof e)}default:gd(this,typeof e)}}};vv=r=>Array.isArray(r)?r.some(e=>e.maybeAsync):!1;AL={heterogeneous_list_element:"List elements must have the same type,",heterogeneous_map_key:"Map key uses wrong type,",heterogeneous_map_value:"Map value uses wrong type,"};KL=Object.create(null);GL=()=>[],YL=()=>({}),P={value:{check(r,e){return r.debugType(e.args)},evaluate(r,e){return e.args}},id:{check(r,e,t){let n=t.getVariable(e.args);if(!n)throw r.createError("unknown_variable",`Unknown variable: ${e.args}`,e);if(n.constant){let s=e.clone(P.value,n.value);return e.setMeta("alternate",s),r.check(s,t)}return n.type},evaluate(r,e,t){return t.getCheckedValue(r,e)}},".":{alias:"fieldAccess",check:bv,evaluate:Nv},".?":{alias:"optionalFieldAccess",check:wv,evaluate:Nv},"[]":{alias:"bracketAccess",check:bv,evaluate:_d},"[?]":{alias:"optionalBracketAccess",check:wv,evaluate:_d},call:{check(r,e,t){let[n,s]=e.args,i=e.candidates=r.registry.functionCandidates(!1,n,s.length),o=e.argTypes=s.map(l=>r.check(l,t)),a=i.findFunction(o);if(!a)throw r.createError("no_matching_overload",`found no matching overload for '${n}(${r.formatTypeList(o)})'`,e);let c=o.some(l=>l.hasDynType)?ML:a.handler.__handle??=(l,h,f)=>wa(a.handler,f,l,h);return e.handle=kt(s,!1,c),a.returnType},evaluate(r,e,t){return e.handle(yd(r,e.args[1],t),e,r)}},rcall:{check(r,e,t){let[n,s,i]=e.args,o=r.check(s,t),a=e.candidates=r.registry.functionCandidates(!0,n,i.length),c=e.argTypes=i.map(h=>r.check(h,t));if(e.receiverWithArgs=[s,...i],e.handle=kt(e.receiverWithArgs,!1,jL),o.kind==="dyn"&&a.returnType)return a.returnType;let l=a.findFunction(c,o);if(!l)throw r.createError("no_matching_overload",`found no matching overload for '${o.type}.${n}(${r.formatTypeList(c)})'`,e);if(!o.hasPlaceholderType&&!c.some(h=>h.hasDynType)){let h=l.handler,f=h.__handle??=(d,p,y)=>wa(h,p,d,y);e.handle=kt(e.receiverWithArgs,!1,f)}return l.returnType},evaluate(r,e,t){return e.handle(yd(r,e.receiverWithArgs,t),r,e)}},list:{check(r,e,t){let n=e.args,s=n.length;if(s===0)return e.setMeta("evaluate",GL)&&r.getType("list<T>");let i=r.check(n[0],t),o=r.opts.homogeneousAggregateLiterals?Ev:$v;for(let a=1;a<s;a++)i=o(r,t,i,n[a],"heterogeneous_list_element");return r.registry.getListType(i)},evaluate(r,e,t){return yd(r,e.args,t)}},map:{check(r,e,t){let n=e.args,s=n.length;if(s===0)return e.setMeta("evaluate",YL)&&r.getType("map<K, V>");let i=r.opts.homogeneousAggregateLiterals?Ev:$v,o=r.check(n[0][0],t),a=r.check(n[0][1],t);for(let c=1;c<s;c++){let l=n[c];o=i(r,t,o,l[0],"heterogeneous_map_key"),a=i(r,t,a,l[1],"heterogeneous_map_value")}return r.registry.getMapType(o,a)},evaluate(r,e,t){let n=e.args,s=n.length,i=new Array(s),o;for(let a=0;a<s;a++){let c=n[a],l=r.run(c[0],t),h=r.run(c[1],t);l instanceof Promise||h instanceof Promise?(i[a]=Promise.all([l,h]),o??=!0):i[a]=[l,h]}return o?Promise.all(i).then(Iv):Iv(i)}},comprehension:{check(r,e,t){let n=e.args;n.iterCtx=t.forkWithVariable(n.iterVarName,RL(r,n.iterable,t)).setAccuType(r.check(n.init,t));let s=r.check(n.step,n.iterCtx),i=n.errorsAreFatal?FL:xL;return e.handle=kt(n.iterable,!1,i),n.kind==="quantifier"?r.boolType:s},evaluate(r,e,t){return e.handle(r.run(e.args.iterable,t),e.args,r,t)}},accuValue:{check(r,e,t){return t.accuType},evaluate(r,e,t){return t.accuValue}},accuInc:{check(r,e,t){return t.accuType},evaluate(r,e,t){return t.accuValue+=1}},accuPush:{check(r,e,t){let n=t.accuType,s=r.check(e.args,t);return e.args.maybeAsync||e.setMeta("evaluate",P.accuPush.evaluateSync),n.kind==="list"&&n.valueType.kind!=="param"?n:r.registry.getListType(s)},evaluateSync(r,e,t){return t.accuValue.push(r.run(e.args,t)),t.accuValue},evaluate(r,e,t){let n=t.accuValue,s=r.run(e.args,t);return s instanceof Promise?s.then(i=>n.push(i)&&n):(n.push(s),n)}},"?:":{alias:"ternary",check(r,e,t){let n=e.condition=e.args[0],s=e.left=e.args[1],i=e.right=e.args[2],o=r.check(n,t);if(!o.isDynOrBool())throw r.createError("invalid_condition_type",`${n.meta.label||"Ternary condition must be bool"}, got '${r.formatType(o)}'`,n);let a=r.check(s,t),c=r.check(i,t),l=a.unify(r.registry,c);if(e.handle=kt(n,!1,kL),l)return l;throw r.createError("incompatible_ternary_branches",`Ternary branches must have the same type, got '${r.formatType(a)}' and '${r.formatType(c)}'`,e)},evaluate(r,e,t){return e.handle(r.run(e.condition,t),r,e,t)}},"||":{check:Sv,evaluate(r,e,t){let n=r.tryEval(e.left,t);if(n===!0)return!0;if(n===!1){let s=r.run(e.right,t);return typeof s=="boolean"?s:Un(!0,r,e,n,s)}return n instanceof Promise?n.then(s=>s===!0?s:Un(!0,r,e,s,r.run(e.right,t))):Un(!0,r,e,n,r.run(e.right,t))}},"&&":{check:Sv,evaluate(r,e,t){let n=r.tryEval(e.left,t);if(n===!1)return!1;if(n===!0){let s=r.run(e.right,t);return typeof s=="boolean"?s:Un(!1,r,e,n,s)}return n instanceof Promise?n.then(s=>s===!1?s:Un(!1,r,e,s,r.run(e.right,t))):Un(!1,r,e,n,r.run(e.right,t))}},"!_":{alias:"unaryNot",check:Tv,evaluate:Ov},"-_":{alias:"unaryMinus",check:Tv,evaluate:Ov}},ZL=["!=","==","in","+","-","*","/","%","<","<=",">",">="];for(let r of ZL)P[r]={check:DL,evaluate:_d};for(let r of Se(P)){let e=P[r];e.name=r,e.alias&&(P[e.alias]=e)}});function $a(r,e){if(r.op==="id")return r.args;throw $e("invalid_macro_argument",e,r)}function Dv(r){let e=r?"map(var, filter, transform)":"map(var, transform)",t=`${e} invalid predicate iteration variable`,n=`${e} filter predicate must return bool`;return({args:s,receiver:i,ast:o})=>{let[a,c,l]=r?s:[s[0],null,s[1]],h=l.clone(P.accuPush,l);if(c){let f=c.clone(P.accuValue);h=c.clone(P.ternary,[c.setMeta("label",n),h,f])}return{callAst:o.clone(P.comprehension,{errorsAreFatal:!0,iterable:i,iterVarName:$a(a,t),init:o.clone(P.list,[]),step:h,result:Ea})}}}function JL(){let r="filter(var, predicate)",e=`${r} invalid predicate iteration variable`,t=`${r} predicate must return bool`;return({args:n,receiver:s,ast:i})=>{let o=$a(n[0],e),a=i.clone(P.accuValue),c=n[1].setMeta("label",t),l=i.clone(P.accuPush,i.clone(P.id,o)),h=c.clone(P.ternary,[c,l,a]);return{callAst:i.clone(P.comprehension,{errorsAreFatal:!0,iterable:s,iterVarName:o,init:i.clone(P.list,[]),step:h,result:Ea})}}}function bd(r){let e=`${r.name}(var, predicate) invalid predicate iteration variable`,t=`${r.name}(var, predicate) predicate must return bool`;return({args:n,receiver:s,ast:i})=>{let o=n[1].setMeta("label",t),a=r.transform({args:n,ast:i,predicate:o,opts:r});return{callAst:i.clone(P.comprehension,{kind:"quantifier",errorsAreFatal:r.errorsAreFatal||!1,iterable:s,iterVarName:$a(n[0],e),init:a.init,condition:a.condition,step:a.step,result:a.result||Ea})}}}function WL(){let r="has() invalid argument";function e(n,s,i){let o=s.macroHasProps,a=o.length,c=n.run(o[--a],i),l;for(;a--;){let h=o[a];if(h.op===".?"&&(l??=!0),c=n.debugType(c).fieldLazy(c,h.args[1],h,n),c===void 0){if(!(!l&&a&&h.op==="."))break;throw L("no_such_key",`No such key: ${h.args[1]}`,h)}}return c!==void 0}function t(n,s,i){let o=s.args[0];if(o.op!==".")throw n.createError("invalid_macro_argument",r,o);if(!s.macroHasProps){let a=[];for(;o.op==="."||o.op===".?";)o=a.push(o)&&o.args[0];if(o.op!=="id")throw n.createError("invalid_macro_argument",r,o);n.check(o,i),a.push(o),s.macroHasProps=a}return n.getType("bool")}return function({args:n}){return{args:n,evaluate:e,typeCheck:t,async:!1}}}function qv(r){let e=(c,l)=>r.registerFunctionOverload(c,l);e("has(ast): bool",WL()),e("list.all(ast, ast): bool",bd({name:"all",transform({ast:c,predicate:l,opts:h}){return{init:c.clone(P.value,!0),condition:Ea,step:l.clone(P.ternary,[l,l.clone(P.value,!0),l.clone(P.value,!1)])}}})),e("list.exists(ast, ast): bool",bd({name:"exists",condition(c){return!c},transform({ast:c,predicate:l,opts:h}){return{init:c.clone(P.value,!1),condition:h.condition,step:l.clone(P.ternary,[l,l.clone(P.value,!0),l.clone(P.value,!1)])}}})),e("list.exists_one(ast, ast): bool",bd({name:"exists_one",errorsAreFatal:!0,result(c){return c===1},transform({ast:c,predicate:l,opts:h}){let f=c.clone(P.accuValue);return{init:c.clone(P.value,0),step:l.clone(P.ternary,[l,c.clone(P.accuInc),f]),result:h.result}}})),e("list.map(ast, ast): list<dyn>",Dv(!1)),e("list.map(ast, ast, ast): list<dyn>",Dv(!0)),e("list.filter(ast, ast): list<dyn>",JL());class t{}let n=new t;r.registerType("CelNamespace",t),r.registerConstant("cel","CelNamespace",n);function s(c,l,h){l.bindCtx=h.forkWithVariable(l.var,c.check(l.val,h));let f=c.check(l.exp,l.bindCtx);return l.val.maybeAsync||l.exp.maybeAsync||(l.ast.setMeta("async",!1),l.evaluate=a),f}function i(c,l,h,f,d){let p=c.run(l,f=h.reuse(f).setIterValue(d,c));return p instanceof Promise&&f===h&&(f.async=!0),p}function o(c,{val:l,exp:h,bindCtx:f},d){let p=c.run(l,d);return p instanceof Promise?p.then(y=>i(c,h,f,d,y)):i(c,h,f,d,p)}function a(c,{val:l,exp:h,bindCtx:f},d){return c.run(h,f.reuse(d).setIterValue(c.run(l,d),c))}e("CelNamespace.bind(ast, dyn, ast): dyn",({ast:c,args:l})=>({ast:c,var:$a(l[0],"invalid variable argument"),val:l[1],exp:l[2],bindCtx:void 0,typeCheck:s,evaluate:o}))}var Ea,Mv=Me(()=>{"use strict";gt();mi();Ea=r=>r});function jv(r){let e=(f,d,p,y)=>r.unaryOverload(f,d,p,y,!1),t=(f,d,p,y,u)=>r.binaryOverload(f,d,p,y,u,!1);function n(f,d){if(f<=ma&&f>=ya)return f;throw L("numeric_overflow",`integer overflow: ${f}`,d)}function s(f){throw L("division_by_zero","division by zero",f)}function i(f){throw L("modulo_by_zero","modulo by zero",f)}e("!","bool",f=>!f),e("-","int",f=>-f),t("dyn<int>","==","double",(f,d)=>f==d),t("dyn<int>","==","uint",(f,d)=>f==d.valueOf()),t("int","*","int",(f,d,p)=>n(f*d,p)),t("int","+","int",(f,d,p)=>n(f+d,p)),t("int","-","int",(f,d,p)=>n(f-d,p)),t("int","/","int",(f,d,p)=>d===Kr?s(p):f/d),t("int","%","int",(f,d,p)=>d===Kr?i(p):f%d),e("-","double",f=>-f),t("double","*","double",(f,d)=>f*d),t("double","+","double",(f,d)=>f+d),t("double","-","double",(f,d)=>f-d),t("double","/","double",(f,d)=>f/d),t("string","+","string",(f,d)=>f+d),t("list<V>","+","list<V>",(f,d)=>[...f,...d]),t("bytes","+","bytes",(f,d)=>{if(!f.length)return d;if(!d.length)return f;let p=new Uint8Array(f.length+d.length);return p.set(f,0),p.set(d,f.length),p});let o="google.protobuf.Duration";t(o,"+",o,(f,d)=>f.addDuration(d)),t(o,"-",o,(f,d)=>f.subtractDuration(d)),t(o,"==",o,(f,d)=>f.seconds===d.seconds&&f.nanos===d.nanos);let a="google.protobuf.Timestamp";t(a,"==",a,(f,d)=>f.getTime()===d.getTime()),t(a,"-",a,(f,d)=>yr.fromMilliseconds(f.getTime()-d.getTime()),o),t(a,"-",o,(f,d)=>d.subtractTimestamp(f)),t(a,"+",o,(f,d)=>d.extendTimestamp(f)),t(o,"+",a,(f,d)=>f.extendTimestamp(d));function c(f,d,p,y){if(d instanceof Set&&d.has(f))return!0;for(let u of d)if(yi(f,u,p,y))return!0;return!1}function l(f,d){return d instanceof Map?d.get(f)!==void 0:qn(d,f)?d[f]!==void 0:!1}function h(f,d,p,y){return c(f,d,p,y)}t("V","in","list<V>",h),t("K","in","map<K, V>",l);for(let f of["type","null","bool","string","int","double"])t(f,"==",f,(d,p)=>d===p);t("bytes","==","bytes",(f,d)=>{if(f===d)return!0;let p=f.length;if(p!==d.length)return!1;for(;p--;)if(f[p]!==d[p])return!1;return!0}),t("list<V>","==","list<V>",(f,d,p,y)=>{if(f===d)return!0;if(zr(f)&&zr(d)){let _=f.length;if(_!==d.length)return!1;for(let v=0;v<_;v++)if(!yi(f[v],d[v],p,y))return!1;return!0}if(f instanceof Set&&d instanceof Set){if(f.size!==d.size)return!1;for(let _ of f)if(!d.has(_))return!1;return!0}let u=f instanceof Set?d:f,m=f instanceof Set?f:d;if(!zr(u)||u.length!==m?.size)return!1;for(let _=0;_<u.length;_++)if(!m.has(u[_]))return!1;return!0}),t("map<K, V>","==","map<K, V>",(f,d,p,y)=>{if(f===d)return!0;if(f instanceof Map&&d instanceof Map){if(f.size!==d.size)return!1;for(let[_,v]of f)if(!(d.has(_)&&yi(v,d.get(_),p,y)))return!1;return!0}if(f instanceof Map||d instanceof Map){let _=f instanceof Map?d:f,v=f instanceof Map?f:d,g=Se(_);if(v.size!==g.length)return!1;for(let[b,E]of v)if(!(b in _&&yi(E,_[b],p,y)))return!1;return!0}let u=Se(f),m=Se(d);if(u.length!==m.length)return!1;for(let _=0;_<u.length;_++){let v=u[_];if(!(v in d&&yi(f[v],d[v],p,y)))return!1}return!0}),t("uint","==","uint",(f,d)=>f.valueOf()===d.valueOf()),t("dyn<uint>","==","double",(f,d)=>f.valueOf()==d),t("uint","+","uint",(f,d)=>new ge(f.valueOf()+d.valueOf())),t("uint","-","uint",(f,d)=>new ge(f.valueOf()-d.valueOf())),t("uint","*","uint",(f,d)=>new ge(f.valueOf()*d.valueOf())),t("uint","/","uint",(f,d,p)=>d.valueOf()===Kr?s(p):new ge(f.valueOf()/d.valueOf())),t("uint","%","uint",(f,d,p)=>d.valueOf()===Kr?i(p):new ge(f.valueOf()%d.valueOf()));for(let[f,d]of[["bool","bool"],["int","int"],["uint","uint"],["double","double"],["string","string"],["google.protobuf.Timestamp","google.protobuf.Timestamp"],["google.protobuf.Duration","google.protobuf.Duration"],["int","uint"],["int","double"],["double","int"],["double","uint"],["uint","int"],["uint","double"]])t(f,"<",d,(p,y)=>p<y),t(f,"<=",d,(p,y)=>p<=y),t(f,">",d,(p,y)=>p>y),t(f,">=",d,(p,y)=>p>=y)}function yi(r,e,t,n){if(r===e)return!0;switch(typeof r){case"undefined":case"string":case"boolean":return!1;case"bigint":return typeof e=="number"?r==e:!1;case"number":return typeof e=="bigint"?r==e:!1;case"object":if(typeof e!="object")return!1;let s=n.debugType(r),i=n.debugType(e);if(s!==i)return!1;let o=n.registry.findBinaryOverload("==",s,i);return o?o.handler(r,e,t,n):!1}throw L("invalid_comparison_type",`Cannot compare values of type ${typeof r}`,t)}var Rv=Me(()=>{"use strict";xn();gt();Hr()});var XL,gi,xv=Me(()=>{"use strict";gt();mi();XL=new Map().set("A","dyn").set("T","dyn").set("K","dyn").set("V","dyn"),gi=class extends Bn{constructor(e,t){super(e),this.createError=t?L:rv}check(e,t){try{return e.checkedType??=e.check(this,e,t)}catch(n){throw ui(n,e)}}checkAccessOnType(e,t,n,s=!1){if(n===this.dynType)return n;let i=(e.op==="[]"||e.op==="[?]"?this.check(e.args[1],t):this.stringType).type;if(n.kind==="list"){if(i==="int"||i==="dyn")return n.valueType;throw this.createError("invalid_index_type",`List index must be int, got '${i}'`,e)}if(n.kind==="map")return n.valueType;let o=this.objectTypes.get(n.name);if(o){if(!(i==="string"||i==="dyn"))throw this.createError("invalid_index_type",`Cannot index type '${n.name}' with type '${i}'`,e);if(o.fields){let a;if(e.op==="."||e.op===".?"?a=e.args[1]:e.args[1].op==="value"&&(a=e.args[1].args),typeof a=="string"){let c=o.fields[a];if(c)return c;if(s)return this.dynType;throw this.createError("no_such_key",`No such key: ${a}`,e)}}return this.dynType}throw this.createError("cannot_index_type",`Cannot index type '${this.formatType(n)}'`,e)}formatType(e){return e.hasPlaceholderType?e.templated(this.registry,XL).name:e.name}formatTypeList(e){return e.map(t=>this.formatType(t)).join(", ")}}});var T,Sa,Ta,Uv,QL,Fv,wd,Ed,eD,Oa,Bv=Me(()=>{"use strict";xn();gt();mi();Hr();T={EOF:0,NUMBER:1,STRING:2,BOOLEAN:3,NULL:4,IDENTIFIER:5,PLUS:6,MINUS:7,MULTIPLY:8,DIVIDE:9,MODULO:10,EQ:11,NE:12,LT:13,LE:14,GT:15,GE:16,AND:17,OR:18,NOT:19,IN:20,LPAREN:21,RPAREN:22,LBRACKET:23,RBRACKET:24,LBRACE:25,RBRACE:26,DOT:27,COMMA:28,COLON:29,QUESTION:30,BYTES:31},Sa={[T.EQ]:P["=="],[T.PLUS]:P["+"],[T.MINUS]:P["-"],[T.MULTIPLY]:P["*"],[T.DIVIDE]:P["/"],[T.MODULO]:P["%"],[T.LE]:P["<="],[T.LT]:P["<"],[T.GE]:P[">="],[T.GT]:P[">"],[T.NE]:P["!="],[T.IN]:P.in},Ta={};for(let r in T)Ta[T[r]]=r;Uv=new Uint8Array(128);for(let r of"0123456789abcdefABCDEF")Uv[r.charCodeAt(0)]=1;QL={bytes_unicode_escape:r=>`\\${r} not allowed in bytes literals`,invalid_unicode_escape:r=>`Invalid Unicode escape: \\${r}`,invalid_unicode_surrogate:r=>`Invalid Unicode surrogate: \\${r}`,invalid_hex_escape:r=>`Invalid hex escape: \\${r}`,invalid_octal_escape:()=>"Octal escape must be 3 digits",octal_escape_out_of_range:r=>`Octal escape out of range: \\${r}`,invalid_escape_sequence:r=>`Invalid escape sequence: \\${r}`},Fv={"\\":"\\","?":"?",'"':'"',"'":"'","`":"`",a:"\x07",b:"\b",f:"\f",n:`
|
|
153
|
+
${f}`}function ui(r,e){return r instanceof Dn?r.withAst(e):r}var Dn,Br,Kt,Vr,gt=Me(()=>{"use strict";Dn=class extends Error{#e;#t;#n;#s;constructor({name:e,code:t,message:n,node:s,cause:i,range:o}){super(n,i?{cause:i}:void 0),this.name=e,this.#t=t,this.#s=n,this.#e=s,this.#n=o&&od(o)||od(s),s?.input&&(this.message=ev(this.#s,s,this.#n))}get node(){return this.#e}get code(){return this.#t}get range(){return this.#n}get summary(){return this.#s}withAst(e){return this.#e||!e?.input?this:(this.#e=e,this.#n??=od(e),this.message=ev(this.#s,e,this.#n),this)}};Br=class extends Dn{constructor(e,t,n){super(ad("ParseError","parse_error",e,t,n))}},Kt=class extends Dn{constructor(e,t,n){super(ad("EvaluationError","evaluation_error",e,t,n))}},Vr=class extends Dn{constructor(e,t,n){super(ad("TypeError","type_error",e,t,n))}}});function nv(r,e){let t=e?rv:void 0;r.deleteVariable("optional"),r.registerConstant("optional","OptionalNamespace",t)}function sv(r){let e={async:!1},t=(d,p)=>r.registerFunctionOverload(d,p,e),n=r.enableOptionalTypes?rv:void 0;r.registerType("OptionalNamespace",ha),r.registerConstant("optional","OptionalNamespace",n),t("optional.hasValue(): bool",d=>d.hasValue()),t("optional<A>.value(): A",d=>d.value()),r.registerFunctionOverload("OptionalNamespace.none(): optional<T>",()=>Ie.none()),t("OptionalNamespace.of(A): optional<A>",(d,p)=>Ie.of(p));function s(d,p,y){if(d instanceof Ie)return d;throw L("optional_expected",`${y} must be optional`,p)}function i(d,p,y){let u=d.run(p.receiver,y);return u instanceof Promise?u.then(m=>o(m,d,p,y)):o(u,d,p,y)}function o(d,p,y,u){let m=s(d,y.receiver,`${y.functionDesc} receiver`);return m.hasValue()?y.onHasValue(m):y.onEmpty(p,y,u)}function a(d,p,y,u){let m=d.check(p,y);if(m.kind==="optional")return m;if(m.kind==="dyn")return d.getType("optional");throw d.createError("optional_expected",`${u} must be optional, got '${m}'`,p)}function c({functionDesc:d,evaluate:p,typeCheck:y,onHasValue:u,onEmpty:m}){return({ast:_,args:v,receiver:g})=>({ast:_,functionDesc:d,receiver:g,arg:v[0],evaluate:p,typeCheck:y,onHasValue:u,onEmpty:m})}let l="optional.orValue() receiver",h="optional.or(optional) receiver",f="optional.or(optional) argument";r.registerFunctionOverload("optional.or(ast): optional<dyn>",c({functionDesc:"optional.or(optional)",evaluate:i,typeCheck(d,p,y){let u=a(d,p.receiver,y,h),m=a(d,p.arg,y,f);p.receiver.maybeAsync||p.arg.maybeAsync||p.ast.setMeta("async",!1);let _=u.unify(d.registry,m);if(_)return _;throw d.createError("incompatible_argument_type",`${p.functionDesc} argument must be compatible type, got '${u}' and '${m}'`,p.arg)},onHasValue:d=>d,onEmpty(d,p,y){let u=p.arg,m=d.run(u,y);return m instanceof Promise?m.then(_=>s(_,u,f)):s(m,u,f)}})),r.registerFunctionOverload("optional.orValue(ast): dyn",c({functionDesc:"optional.orValue(value)",onHasValue:d=>d.value(),onEmpty(d,p,y){return d.run(p.arg,y)},evaluate:i,typeCheck(d,p,y){let u=a(d,p.receiver,y,l).valueType,m=d.check(p.arg,y);p.receiver.maybeAsync||p.arg.maybeAsync||p.ast.setMeta("async",!1);let _=u.unify(d.registry,m);if(_)return _;throw d.createError("incompatible_argument_type",`${p.functionDesc} argument must be compatible type, got '${u}' and '${m}'`,p.arg)}}))}var Ie,fi,ha,rv,di=Me(()=>{"use strict";gt();Ie=class r{#e;constructor(e){this.#e=e}static of(e){return e===void 0?fi:new r(e)}static none(){return fi}hasValue(){return this.#e!==void 0}value(){if(this.#e===void 0)throw L("optional_value_missing","Optional value is not present");return this.#e}or(e){if(this.#e!==void 0)return this;if(e instanceof r)return e;throw L("invalid_optional_argument","Optional.or must be called with an Optional argument")}orValue(e){return this.#e===void 0?e:this.#e}get[Symbol.toStringTag](){return"optional"}[Symbol.for("nodejs.util.inspect.custom")](){return this.#e===void 0?"Optional { none }":`Optional { value: ${JSON.stringify(this.#e)} }`}},fi=Object.freeze(new Ie),ha=class{},rv=new ha});function pi(r,e){return r?.[Symbol.toStringTag]==="AsyncFunction"?!0:typeof e=="boolean"?e:!0}var qn,Se,_t,iv,zr,cd,Kr,ov,ma,ya,Mn,Hr=Me(()=>{"use strict";qn=Object.hasOwn,Se=Object.keys,_t=Object.freeze,iv=Object.entries,zr=Array.isArray,cd=Array.from,Kr=0n,ov=18446744073709551615n,ma=9223372036854775807n,ya=-9223372036854775808n;Mn=new Set(["as","break","const","continue","else","for","function","if","import","let","loop","package","namespace","return","var","void","while","__proto__","prototype"])});function cv(r){let e={async:!1},t=(u,m)=>r.registerFunctionOverload(u,m,e),n=u=>u;t("dyn(dyn): dyn",n);for(let u in Ht){let m=Ht[u];m instanceof ve&&t(`type(${m.name}): type`,()=>m)}t("bool(bool): bool",n),t("bool(string): bool",u=>{switch(u){case"1":case"t":case"true":case"TRUE":case"True":return!0;case"0":case"f":case"false":case"FALSE":case"False":return!1;default:throw L("bool_conversion_error",`bool() conversion error: invalid string value "${u}"`)}}),t("size(string): int",u=>BigInt(av(u))),t("size(bytes): int",u=>BigInt(u.length)),t("size(list): int",u=>BigInt(u.length??u.size)),t("size(map): int",u=>BigInt(u instanceof Map?u.size:Se(u).length)),t("string.size(): int",u=>BigInt(av(u))),t("bytes.size(): int",u=>BigInt(u.length)),t("list.size(): int",u=>BigInt(u.length??u.size)),t("map.size(): int",u=>BigInt(u instanceof Map?u.size:Se(u).length)),t("bytes(string): bytes",u=>o.fromString(u)),t("bytes(bytes): bytes",n),t("double(double): double",n),t("double(int): double",u=>Number(u)),t("double(uint): double",u=>Number(u)),t("double(string): double",u=>{if(!u||u!==u.trim())throw L("double_conversion_error","double() type error: cannot convert to double");switch(u.toLowerCase()){case"inf":case"+inf":case"infinity":case"+infinity":return Number.POSITIVE_INFINITY;case"-inf":case"-infinity":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:{let _=Number(u);if(!Number.isNaN(_))return _;throw L("double_conversion_error","double() type error: cannot convert to double")}}}),t("int(int): int",n),t("int(double): int",u=>{if(Number.isFinite(u))return BigInt(Math.trunc(u));throw L("numeric_overflow","int() type error: integer overflow")}),t("int(string): int",u=>{if(u!==u.trim()||u.length>20||u.includes("0x"))throw L("int_conversion_error","int() type error: cannot convert to int");try{let m=BigInt(u);if(m<=ma&&m>=ya)return m}catch{}throw L("int_conversion_error","int() type error: cannot convert to int")}),t("uint(uint): uint",n),t("uint(int): uint",u=>{try{return new ge(u)}catch{throw L("uint_conversion_error","uint() type error: cannot convert to uint")}}),t("uint(double): uint",u=>{try{return new ge(Math.trunc(u))}catch{throw L("numeric_overflow","uint() type error: unsigned integer overflow")}}),t("uint(string): uint",u=>{if(u!==u.trim()||u.length>20||u.includes("0x"))throw L("uint_conversion_error","uint() type error: cannot convert to uint");try{return new ge(u)}catch{throw L("uint_conversion_error","uint() type error: cannot convert to uint")}}),t("string(string): string",n),t("string(bool): string",u=>`${u}`),t("string(int): string",u=>`${u}`),t("string(uint): string",u=>`${u}`),t("string(bytes): string",u=>o.toUtf8(u)),t("string(double): string",u=>u===1/0?"+Inf":u===-1/0?"-Inf":`${u}`),t("string.startsWith(string): bool",(u,m)=>u.startsWith(m)),t("string.endsWith(string): bool",(u,m)=>u.endsWith(m)),t("string.contains(string): bool",(u,m)=>u.includes(m)),t("string.lowerAscii(): string",u=>u.toLowerCase()),t("string.upperAscii(): string",u=>u.toUpperCase()),t("string.trim(): string",u=>u.trim()),t("string.indexOf(string): int",(u,m)=>BigInt(u.indexOf(m))),t("string.indexOf(string, int): int",(u,m,_)=>{if(m==="")return _;if(_=Number(_),_<0||_>=u.length)throw L("index_out_of_range","string.indexOf(search, fromIndex): fromIndex out of range");return BigInt(u.indexOf(m,_))}),t("string.lastIndexOf(string): int",(u,m)=>BigInt(u.lastIndexOf(m))),t("string.lastIndexOf(string, int): int",(u,m,_)=>{if(m==="")return _;if(_=Number(_),_<0||_>=u.length)throw L("index_out_of_range","string.lastIndexOf(search, fromIndex): fromIndex out of range");return BigInt(u.lastIndexOf(m,_))}),t("string.substring(int): string",(u,m)=>{if(m=Number(m),m<0||m>u.length)throw L("index_out_of_range","string.substring(start, end): start index out of range");return u.substring(m)}),t("string.substring(int, int): string",(u,m,_)=>{if(m=Number(m),m<0||m>u.length)throw L("index_out_of_range","string.substring(start, end): start index out of range");if(_=Number(_),_<m||_>u.length)throw L("index_out_of_range","string.substring(start, end): end index out of range");return u.substring(m,_)}),t("string.matches(string): bool",(u,m)=>{try{return new RegExp(m).test(u)}catch{throw L("invalid_regular_expression",`Invalid regular expression: ${m}`)}}),t("string.split(string): list<string>",(u,m)=>u.split(m)),t("string.split(string, int): list<string>",(u,m,_)=>{if(_=Number(_),_===0)return[];let v=u.split(m);if(_<0||v.length<=_)return v;let g=v.slice(0,_-1);return g.push(v.slice(_-1).join(m)),g}),t("list<string>.join(): string",u=>{for(let m=0;m<u.length;m++)if(typeof u[m]!="string")throw L("invalid_list_element_type","string.join(): list must contain only strings");return u.join("")}),t("list<string>.join(string): string",(u,m)=>{for(let _=0;_<u.length;_++)if(typeof u[_]!="string")throw L("invalid_list_element_type","string.join(separator): list must contain only strings");return u.join(m)});let s=new TextEncoder("utf8"),i=new TextDecoder("utf8"),o=typeof Buffer<"u"?{byteLength:u=>Buffer.byteLength(u),fromString:u=>Buffer.from(u,"utf8"),toHex:u=>Buffer.prototype.hexSlice.call(u,0,u.length),toBase64:u=>Buffer.prototype.base64Slice.call(u,0,u.length),toUtf8:u=>Buffer.prototype.utf8Slice.call(u,0,u.length),jsonParse:u=>JSON.parse(u)}:{textEncoder:new TextEncoder("utf8"),byteLength:u=>s.encode(u).length,fromString:u=>s.encode(u),toHex:Uint8Array.prototype.toHex?u=>u.toHex():u=>cd(u,m=>m.toString(16).padStart(2,"0")).join(""),toBase64:Uint8Array.prototype.toBase64?u=>u.toBase64():u=>btoa(cd(u,m=>String.fromCodePoint(m)).join("")),toUtf8:u=>i.decode(u),jsonParse:u=>JSON.parse(s.decode(u))};t("bytes.json(): map",o.jsonParse),t("bytes.hex(): string",o.toHex),t("bytes.string(): string",o.toUtf8),t("bytes.base64(): string",o.toBase64),t("bytes.at(int): int",(u,m)=>{if(m<0||m>=u.length)throw L("index_out_of_range","Bytes index out of range");return BigInt(u[m])});let a="google.protobuf.Timestamp",c="google.protobuf.Duration",l=r.registerType(a,Date).typeType,h=r.registerType(c,yr).typeType;r.registerConstant("google","map<string, map<string, type>>",{protobuf:{Duration:h,Timestamp:l}});function f(u,m){return new Date(u.toLocaleString("en-US",{timeZone:m}))}function d(u,m){let _=m?f(u,m):new Date(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),v=new Date(_.getFullYear(),0,0);return BigInt(Math.floor((_-v)/864e5)-1)}t(`timestamp(string): ${a}`,u=>{if(u.length<20||u.length>30)throw L("invalid_timestamp","timestamp() requires a string in ISO 8601 format");let m=new Date(u);if(m<=0xe677d21fdbff&&m>=-621355968e5)return m;throw L("invalid_timestamp","timestamp() requires a string in ISO 8601 format")}),t(`timestamp(int): ${a}`,u=>{if(u=Number(u)*1e3,u<=0xe677d21fdbff&&u>=-621355968e5)return new Date(u);throw L("invalid_timestamp","timestamp() requires a valid integer unix timestamp")}),t(`${a}.getDate(): int`,u=>BigInt(u.getUTCDate())),t(`${a}.getDate(string): int`,(u,m)=>BigInt(f(u,m).getDate())),t(`${a}.getDayOfMonth(): int`,u=>BigInt(u.getUTCDate()-1)),t(`${a}.getDayOfMonth(string): int`,(u,m)=>BigInt(f(u,m).getDate()-1)),t(`${a}.getDayOfWeek(): int`,u=>BigInt(u.getUTCDay())),t(`${a}.getDayOfWeek(string): int`,(u,m)=>BigInt(f(u,m).getDay())),t(`${a}.getDayOfYear(): int`,d),t(`${a}.getDayOfYear(string): int`,d),t(`${a}.getFullYear(): int`,u=>BigInt(u.getUTCFullYear())),t(`${a}.getFullYear(string): int`,(u,m)=>BigInt(f(u,m).getFullYear())),t(`${a}.getHours(): int`,u=>BigInt(u.getUTCHours())),t(`${a}.getHours(string): int`,(u,m)=>BigInt(f(u,m).getHours())),t(`${a}.getMilliseconds(): int`,u=>BigInt(u.getUTCMilliseconds())),t(`${a}.getMilliseconds(string): int`,u=>BigInt(u.getUTCMilliseconds())),t(`${a}.getMinutes(): int`,u=>BigInt(u.getUTCMinutes())),t(`${a}.getMinutes(string): int`,(u,m)=>BigInt(f(u,m).getMinutes())),t(`${a}.getMonth(): int`,u=>BigInt(u.getUTCMonth())),t(`${a}.getMonth(string): int`,(u,m)=>BigInt(f(u,m).getMonth())),t(`${a}.getSeconds(): int`,u=>BigInt(u.getUTCSeconds())),t(`${a}.getSeconds(string): int`,(u,m)=>BigInt(f(u,m).getSeconds()));let p=/(\d*\.?\d*)(ns|us|µs|ms|s|m|h)/;function y(u){if(!u)throw L("invalid_duration","Invalid duration string: ''");let m=u[0]==="-";(u[0]==="-"||u[0]==="+")&&(u=u.slice(1));let _=BigInt(0);for(;;){let b=p.exec(u);if(!b)throw L("invalid_duration",`Invalid duration string: ${u}`);if(b.index!==0)throw L("invalid_duration",`Invalid duration string: ${u}`);u=u.slice(b[0].length);let E=mL[b[2]],[$="0",S=""]=b[1].split("."),O=BigInt($)*E,A=S?BigInt(S.slice(0,13).padEnd(13,"0"))*E/10000000000000n:0n;if(_+=O+A,u==="")break}let v=_>=Rn?_/Rn:0n,g=Number(_%Rn);return m?new yr(-v,-g):new yr(v,g)}t("duration(string): google.protobuf.Duration",u=>y(u)),t("google.protobuf.Duration.getHours(): int",u=>u.getHours()),t("google.protobuf.Duration.getMinutes(): int",u=>u.getMinutes()),t("google.protobuf.Duration.getSeconds(): int",u=>u.getSeconds()),t("google.protobuf.Duration.getMilliseconds(): int",u=>u.getMilliseconds()),sv(r)}function av(r){let e=0;for(let t of r)e++;return e}var ge,jn,Rn,mL,yr,xn=Me(()=>{"use strict";gt();ga();di();Hr();ge=class{#e;constructor(e){this.verify(typeof e=="bigint"?e:BigInt(e))}get value(){return this.#e}valueOf(){return this.#e}toString(){return`${this.#e}`}verify(e){if(e<Kr||e>ov)throw L("numeric_overflow","Unsigned integer overflow");this.#e=e}get[Symbol.toStringTag](){return`value = ${this.#e}`}[Symbol.for("nodejs.util.inspect.custom")](){return`UnsignedInteger { value: ${this.#e} }`}},jn=1e9,Rn=1000000000n,mL={h:3600000000000n,m:60000000000n,s:Rn,ms:1000000n,us:1000n,\u00B5s:1000n,ns:1n},yr=class r{#e;#t;constructor(e,t=0){this.#e=BigInt(e),this.#t=t}get seconds(){return this.#e}get nanos(){return this.#t}valueOf(){return Number(this.#e)*1e3+this.#t/1e6}static fromMilliseconds(e){let t=BigInt(Math.trunc(e*1e6)),n=t/Rn,s=Number(t%Rn);return new r(n,s)}addDuration(e){let t=this.#t+e.nanos;return new r(this.#e+e.seconds+BigInt(Math.floor(t/jn)),t%jn)}subtractDuration(e){let t=this.#t-e.nanos;return new r(this.#e-e.seconds+BigInt(Math.floor(t/jn)),(t+jn)%jn)}extendTimestamp(e){return new Date(e.getTime()+Number(this.#e)*1e3+Math.floor(this.#t/1e6))}subtractTimestamp(e){return new Date(e.getTime()-Number(this.#e)*1e3-Math.floor(this.#t/1e6))}toString(){let e=this.#t?(this.#t/jn).toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:9}).slice(1):"";return`${this.#e}${e}s`}getHours(){return this.#e/3600n}getMinutes(){return this.#e/60n}getSeconds(){return this.#e}getMilliseconds(){return this.#e*1000n+BigInt(Math.floor(this.#t/1e6))}get[Symbol.toStringTag](){return"google.protobuf.Duration"}[Symbol.for("nodejs.util.inspect.custom")](){return`google.protobuf.Duration { seconds: ${this.#e}, nanos: ${this.#t} }`}}});function vL(r,e){let t=`Macro '${r}' must`;return function(s){let i=e(s);if(!i||typeof i!="object")throw new Error(`${t} return an object.`);if(i.callAst)return i;if(!i.evaluate)throw new Error(`${t} ${gL}`);if(!i.typeCheck)throw new Error(`${t} ${_L}`);return i}}function hd(r){return new vt({kind:"list",name:`list<${r}>`,type:"list",valueType:r})}function Gt(r){return new vt({kind:"primitive",name:r,type:r})}function bL(r){return new vt({kind:"message",name:r,type:r})}function pv(r){let e=r?`dyn<${r}>`:"dyn";return new vt({kind:"dyn",name:e,type:e,valueType:r})}function hv(r){let e=`optional<${r}>`;return new vt({kind:"optional",name:e,type:"optional",valueType:r})}function md(r,e){return new vt({kind:"map",name:`map<${r}, ${e}>`,type:"map",keyType:r,valueType:e})}function wL(r){return new vt({kind:"param",name:r,type:r})}function fv(r){let e=[],t="",n=0;for(let s of r){if(s==="<")n++;else if(s===">")n--;else if(s===","&&n===0){e.push(t.trim()),t="";continue}t+=s}return t&&e.push(t.trim()),e}function gv(r){return new dd(r)}function TL(r){let e;if(r.map){let t=ld(r.keyType,r.resolvedKeyType),n=ld(r.type,r.resolvedType);e=`map<${t}, ${n}>`}else e=ld(r.type,r.resolvedType);return{type:r.repeated?`list<${e}>`:e}}function ld(r,e){switch(r){case"string":return"string";case"bytes":return"bytes";case"bool":return"bool";case"double":case"float":case"int32":case"int64":case"sint32":case"sint64":case"sfixed32":case"sfixed64":case"uint32":case"uint64":case"fixed32":case"fixed64":return"double";default:switch(e?.constructor.name){case"Type":return e.fullName.slice(1);case"Enum":return"int"}return r?.includes(".")?r:"dyn"}}var ve,Ht,yL,ba,vt,gL,_L,hi,ud,Gr,Ve,mv,lv,uv,ee,fd,yv,EL,$L,_a,va,SL,dd,dv,Fn,pd,ga=Me(()=>{"use strict";gt();xn();di();Hr();ve=class{#e;constructor(e){this.#e=e,_t(this)}get name(){return this.#e}get[Symbol.toStringTag](){return`Type<${this.#e}>`}toString(){return`Type<${this.#e}>`}},Ht={string:new ve("string"),bool:new ve("bool"),int:new ve("int"),uint:new ve("uint"),double:new ve("double"),map:new ve("map"),list:new ve("list"),bytes:new ve("bytes"),null_type:new ve("null"),type:new ve("type")},yL=new ve("optional"),ba={dyn(r,e){switch(typeof r){case"string":case"bigint":case"number":case"boolean":return!0;case"object":switch(r&&r.constructor){case null:case void 0:case Object:case Map:case Array:case Set:return!0;default:if(e.objectTypesByConstructor.get(r.constructor))return!0}}return!!e.debugType(r)},string(r){return typeof r=="string"},int(r){return typeof r=="bigint"},double(r){return typeof r=="number"},bool(r){return typeof r=="boolean"},null(r){return r===null},bytes(r){return r instanceof Uint8Array},uint(r){return r instanceof ge},type(r){return r instanceof ve},list(r){switch(r?.constructor){case Array:case Set:return!0;default:return!1}},map(r){switch(typeof r=="object"&&r?r.constructor:null){case void 0:case Object:case Map:return!0;default:return!1}},optional(r){return r instanceof Ie},message(r,e){return this===e.debugType(r)}};ba.param=ba.dyn;vt=class{#e=new WeakMap;constructor({kind:e,type:t,name:n,keyType:s,valueType:i}){this.kind=e,this.type=t,this.name=n,this.keyType=s,this.valueType=i,this.unwrappedType=e==="dyn"&&i?i.unwrappedType:this,this.wrappedType=e==="dyn"?this:pv(this.unwrappedType),this.hasDynType=this.kind==="dyn"||this.valueType?.hasDynType||this.keyType?.hasDynType||!1,this.hasPlaceholderType=this.kind==="param"||this.keyType?.hasPlaceholderType||this.valueType?.hasPlaceholderType||!1,e==="list"?this.fieldLazy=this.#o:e==="map"?this.fieldLazy=this.#s:e==="message"?this.fieldLazy=this.#n:e==="optional"&&(this.fieldLazy=this.#t),this.matchesValueType=ba[n]||ba[e],_t(this)}isDynOrBool(){return this.type==="bool"||this.kind==="dyn"}isEmpty(){return this.valueType&&this.valueType.kind==="param"}unify(e,t){let n=this;if(n===t||n.kind==="dyn"||t.kind==="param")return n;if(t.kind==="dyn"||n.kind==="param")return t;if(n.kind!==t.kind||!(n.hasPlaceholderType||t.hasPlaceholderType||n.hasDynType||t.hasDynType))return null;let s=n.valueType.unify(e,t.valueType);if(!s)return null;switch(n.kind){case"optional":return e.getOptionalType(s);case"list":return e.getListType(s);case"map":let i=n.keyType.unify(e,t.keyType);return i?e.getMapType(i,s):null}}templated(e,t){if(!this.hasPlaceholderType)return this;switch(this.kind){case"dyn":return this.valueType.templated(e,t);case"param":return t?.get(this.name)||this;case"map":return e.getMapType(this.keyType.templated(e,t),this.valueType.templated(e,t));case"list":return e.getListType(this.valueType.templated(e,t));case"optional":return e.getOptionalType(this.valueType.templated(e,t));default:return this}}toString(){return this.name}#t(e,t,n,s){if(e=e instanceof Ie?e.orValue():e,e===void 0)return fi;let i=s.debugType(e);try{return Ie.of(i.fieldLazy(e,t,n,s))}catch(o){if(o instanceof Kt)return fi;throw o}}#n(e,t,n,s){let i=e?s.objectTypesByConstructor.get(e.constructor):void 0;if(!i)return;let o=i.fields?i.fields[t]:Ve;if(!o)return;let a=e instanceof Map?e.get(t):e[t];if(a!==void 0){if(o.matchesValueType(a,s))return a;throw L("field_type_mismatch",`Field '${t}' is not of type '${o}', got '${s.debugType(a)}'`,n)}}#s(e,t,n,s){let i=e instanceof Map?e.get(t):e&&qn(e,t)?e[t]:void 0;if(i!==void 0){if(this.valueType.matchesValueType(i,s))return i;throw L("field_type_mismatch",`Field '${t}' is not of type '${this.valueType}', got '${s.debugType(i)}'`,n)}}#i(e,t){switch(e?.constructor){case Array:return e[t];case Set:{let n=0;for(let s of e)if(n++===t)return s}}}#o(e,t,n,s){if(typeof t=="bigint")t=Number(t);else if(typeof t!="number")return;let i=this.#i(e,t);if(i===void 0){if(!e)return;throw L("index_out_of_bounds",`No such key: index out of bounds, index ${t} ${t<0?"< 0":`>= size ${e.length||e.size}`}`,n)}if(this.valueType.matchesValueType(i,s))return i;throw L("list_item_type_mismatch",`List item with index '${t}' is not of type '${this.valueType}', got '${s.debugType(i)}'`,n)}fieldLazy(){}field(e,t,n,s){let i=this.fieldLazy(e,t,n,s);if(i!==void 0)return i;throw L("no_such_key",`No such key: ${t}`,n)}matchesBoth(e){return this.matches(e)&&e.matches(this)}matches(e){let t=this.unwrappedType;return e=e.unwrappedType,t===e||t.kind==="dyn"||e.kind==="dyn"||e.kind==="param"?!0:this.#e.get(e)??this.#e.set(e,this.#r(t,e)).get(e)}#r(e,t){switch(e.kind){case"dyn":case"param":return!0;case"list":return t.kind==="list"&&e.valueType.matches(t.valueType);case"map":return t.kind==="map"&&e.keyType.matches(t.keyType)&&e.valueType.matches(t.valueType);case"optional":return t.kind==="optional"&&e.valueType.matches(t.valueType);default:return e.name===t.name}}},gL="have a .callAst property or .evaluate(checker, macro, ctx) method.",_L="have a .callAst property or .typeCheck(checker, macro, ctx) method.";hi=class{constructor(e,t,n,s){this.name=e,this.type=t,this.description=n??null,this.constant=s!==void 0,this.value=s,_t(this)}},ud=class{constructor({name:e,receiverType:t,returnType:n,handler:s,description:i,params:o,async:a}){if(typeof e!="string")throw new Error("name must be a string");if(typeof s!="function")throw new Error("handler must be a function");this.name=e,this.async=pi(s,a),this.receiverType=t??null,this.returnType=n,this.description=i??null,this.params=o,this.argTypes=o.map(l=>l.type),this.macro=this.argTypes.includes(mv);let c=t?`${t}.`:"";this.signature=`${c}${e}(${this.argTypes.join(", ")}): ${n}`,this.handler=this.macro?vL(this.signature,s):s,this.partitionKey=`${t?"rcall":"call"}:${e}:${o.length}`,this.hasPlaceholderType=this.returnType.hasPlaceholderType||this.receiverType?.hasPlaceholderType||this.argTypes.some(l=>l.hasPlaceholderType)||!1,_t(this)}matchesArgs(e){return e.length===this.argTypes.length&&this.argTypes.every((t,n)=>t.matches(e[n]))?this:null}},Gr=class{constructor({op:e,leftType:t,rightType:n,handler:s,returnType:i,async:o}){this.operator=e,this.leftType=t,this.rightType=n||null,this.handler=s,this.async=pi(s,o),this.returnType=i,n?this.signature=`${t} ${e} ${n}: ${i}`:this.signature=`${e}${t}: ${i}`,this.hasPlaceholderType=this.leftType.hasPlaceholderType||this.rightType?.hasPlaceholderType||!1,_t(this)}equals(e){return this.operator===e.operator&&this.leftType===e.leftType&&this.rightType===e.rightType}};Ve=pv(),mv=Gt("ast"),lv=hd(Ve),uv=md(Ve,Ve),ee={string:Gt("string"),bool:Gt("bool"),int:Gt("int"),uint:Gt("uint"),double:Gt("double"),bytes:Gt("bytes"),dyn:Ve,null:Gt("null"),type:Gt("type"),optional:hv(Ve),list:lv,"list<dyn>":lv,map:uv,"map<dyn, dyn>":uv};for(let r of[ee.string,ee.double,ee.int]){let e=hd(r),t=md(ee.string,r);ee[e.name]=e,ee[t.name]=t}Object.freeze(ee);fd=class{returnType=null;async=!1;macro=!1;#e=null;#t=null;declarations=[];constructor(e){this.registry=e}[Symbol.iterator](){return this.declarations[Symbol.iterator]()}add(e){this.returnType=(this.returnType||e.returnType).unify(this.registry,e.returnType)||Ve,e.macro&&(this.macro=e),e.async&&!this.async&&(this.async=!0),this.declarations.push(e),this.#e?.clear(),this.#t?.clear()}findFunction(e,t=null){for(let n=0;n<this.declarations.length;n++){let s=this.#a(this.declarations[n],e,t);if(s)return s}return null}findUnaryOverload(e){let t=(this.#e??=new Map).get(e);if(t!==void 0)return t;let n=!1;for(let s of this.declarations)if(s.leftType===e){n=s;break}return this.#e.set(e,n),n}findBinaryOverload(e,t){return e.kind==="dyn"&&e.valueType?t=t.wrappedType:t.kind==="dyn"&&t.valueType&&(e=e.wrappedType),(this.#e??=new Map).get(e)?.get(t)??this.#n(this.#e,e,t,this.#s(e,t))}checkBinaryOverload(e,t){return(this.#t??=new Map).get(e)?.get(t)??this.#n(this.#t,e,t,this.#i(e,t))}#n(e,t,n,s){return(e.get(t)||e.set(t,new Map).get(t)).set(n,s),s}#s(e,t){let n=this.#o(e,t);if(n.length===0)return!1;if(n.length===1)return n[0];throw new Error(`Operator overload '${n[0].signature}' overlaps with '${n[1].signature}'.`)}#i(e,t){let n=this.#o(e,t);if(n.length===0)return!1;let s=n[0].returnType;for(let i=1;i<n.length;i++)s=s.unify(this.registry,n[i].returnType)||Ve;return s}#o(e,t){let n=[];for(let s of this.declarations){if(s.leftType===e&&s.rightType===t)return[s];let i=this.#r(s,e,t);i&&n.push(i)}if(n.length===0){let s=this.declarations[0]?.operator;if((s==="=="||s==="!=")&&e.kind==="dyn")return SL[s]}return n}#r(e,t,n){let s=e.hasPlaceholderType?new Map:null,i=this.#l(e.leftType,t,s);if(!i)return;let o=this.#l(e.rightType,n,s);if(o)return(e.operator==="=="||e.operator==="!=")&&e.leftType.kind==="dyn"&&e.leftType.valueType&&t.kind!=="dyn"&&n.kind!=="dyn"?!1:e.hasPlaceholderType?{async:e.async,signature:e.signature,handler:e.handler,leftType:i,rightType:o,returnType:e.returnType.templated(this.registry,s)}:e}#a(e,t,n){if(e.hasPlaceholderType)return this.#f(e,t,n);if(!(n&&e.receiverType&&!n.matches(e.receiverType)))return e.matchesArgs(t)}#f(e,t,n){let s=new Map;if(n&&e.receiverType&&!this.#l(e.receiverType,n,s))return null;for(let i=0;i<t.length;i++)if(!this.#l(e.argTypes[i],t[i],s))return null;return{async:e.async,handler:e.handler,signature:e.signature,returnType:e.returnType.templated(this.registry,s)}}#l(e,t,n){if(!e.hasPlaceholderType)return t.matches(e)?t:null;let s=t.kind==="dyn";return this.#u(e,t,n,s)&&(s||t.matches(e.templated(this.registry,n)))?t:null}#u(e,t,n,s=!1){if(!e.hasPlaceholderType)return!0;if(!t)return!1;let i=s||t.kind==="dyn";switch(t=t.unwrappedType,e.kind){case"param":{let o=i?Ve:t,a=n.get(e.name);return a?a.kind==="dyn"||o.kind==="dyn"?!0:a.matchesBoth(o):n.set(e.name,o)&&!0}case"list":return t.name==="dyn"&&(t=e),t.kind!=="list"?!1:this.#u(e.valueType,t.valueType,n,i);case"map":return t.name==="dyn"&&(t=e),t.kind!=="map"?!1:this.#u(e.keyType,t.keyType,n,i)&&this.#u(e.valueType,t.valueType,n,i);case"optional":return t.name==="dyn"&&(t=e),t.kind!=="optional"?!1:this.#u(e.valueType,t.valueType,n,i)}return!0}};yv=[[ge,"uint",Ht.uint,ee.uint],[ve,"type",Ht.type,ee.type],[Ie,"optional",yL,ee.optional],[Uint8Array,"bytes",Ht.bytes,ee.bytes],...typeof Buffer<"u"?[[Buffer,"bytes",Ht.bytes,ee.bytes]]:[]].map(([r,e,t,n])=>Object.freeze({name:e,typeType:t,type:n,ctor:r})),EL=yv.map(r=>[r.name,r]),$L=yv.map(r=>[r.ctor,r]),_a=r=>new Error(`Invalid variable declaration: ${r}`),va=r=>new Error(`Invalid type declaration: ${r}`),SL={"==":[{handler:(r,e)=>r===e,returnType:ee.bool}],"!=":[{handler:(r,e)=>r!==e,returnType:ee.bool}]},dd=class r{#e=null;#t;#n=!0;#s=null;#i=null;#o=null;#r=null;#a=null;#f=null;#l=null;#u=null;#d=!1;constructor(e={}){this.enableOptionalTypes=e.enableOptionalTypes??!1,this.unlistedVariablesAreDyn=e.unlistedVariablesAreDyn??!1;let t=e.parent instanceof r?e.parent:null;if(t){this.#e=t;let n=t;for(;n&&!n.#s;)n=n.#e;let s=t;for(;s&&!s.#i;)s=s.#e;this.#o=t.#o,this.#r=t.#r,this.#u={operators:n.#s,functions:s.#i},this.objectTypes=new Map(t.objectTypes),this.objectTypesByConstructor=new Map(t.objectTypesByConstructor),this.variables=t.variables,this.#n=!1,this.#t=t.#t,this.#a=t.#a,this.#f=t.#f,this.#l=t.#l,(this.enableOptionalTypes!==t.enableOptionalTypes||this.unlistedVariablesAreDyn!==t.unlistedVariablesAreDyn)&&nv(this,this.enableOptionalTypes)}else{this.#s=[],this.#i=[],this.objectTypes=new Map(EL),this.objectTypesByConstructor=new Map($L),this.#t=new Map(iv(ee)),this.#a=new Map,this.#f=new Map,this.#l=new Map,this.variables=new Map,this.variables.dyn=this.unlistedVariablesAreDyn;for(let n in Ht)this.registerConstant(n,"type",Ht[n])}}#v(){this.#n||(this.variables=new Map(this.variables),this.variables.dyn=this.unlistedVariablesAreDyn,this.#n=!0)}deleteVariable(e){this.#v(),this.variables.delete(e)}#y(e){this.#s||(this.#o=null),this.operatorCandidates(e.operator).add(e),this.#s.push(e)}#E(e){this.#i||(this.#r=null),this.#g(e.partitionKey).add(e),this.#i.push(e)}#p(e,t){return e.get(t)||e.set(t,new fd(this)).get(t)}#$(){return this.#s?this.#s:this.#s=[...this.#u.operators]}#b(){return this.#i?this.#i:this.#i=[...this.#u.functions]}operatorCandidates(e){if(this.#o)return this.#p(this.#o,e);let t=this.#o=new Map;for(let n of this.#$())this.#p(t,n.operator).add(n);return this.#p(t,e)}functionCandidates(e,t,n){return this.#g(`${e?"rcall":"call"}:${t}:${n}`)}#g(e){if(this.#r)return this.#p(this.#r,e);let t=this.#r=new Map;for(let n of this.#b())this.#p(t,n.partitionKey).add(n);return this.#p(t,e)}registerVariable(e,t,n){if(this.#d)throw new Error("Cannot modify frozen registry");let s=n?.description,i;if(typeof e=="string"&&typeof t=="object"&&!(t instanceof vt)?(s=t.description,i=t.value,t.schema?t=this.registerType({name:`$${e}`,schema:t.schema}).type:t=t.type):typeof e=="object"&&(e.schema?t=this.registerType({name:`$${e.name}`,schema:e.schema}).type:t=e.type,s=e.description,i=e.value,e=e.name),typeof e!="string"||!e)throw _a("name must be a string");if(Mn.has(e))throw _a(`'${e}' is a reserved name`);if(this.variables.get(e)!==void 0)throw _a(`'${e}' is already registered`);if(typeof t=="string")t=this.getType(t);else if(!(t instanceof vt))throw _a("type is required");return this.#v(),this.variables.set(e,new hi(e,t,s,i)),this}#S(e,t){let n=Object.create(null);for(let s of Se(t)){let i=t[s];if(typeof i=="object"&&i)n[s]=this.registerType({name:`${e}.${s}`,schema:i}).type.name;else if(typeof i=="string")n[s]=i;else throw new Error(`Invalid field definition for '${e}.${s}'`)}return n}registerConstant(e,t,n){return typeof e=="object"?this.registerVariable(e):this.registerVariable({name:e,type:t,value:n}),this}getType(e){return this.#c(e,!0)}getListType(e){return this.#a.get(e)||this.#a.set(e,this.#c(`list<${e}>`,!0)).get(e)}getMapType(e,t){return this.#f.get(e)?.get(t)||(this.#f.get(e)||this.#f.set(e,new Map).get(e)).set(t,this.#c(`map<${e}, ${t}>`,!0)).get(t)}getOptionalType(e){return this.#l.get(e)||this.#l.set(e,this.#c(`optional<${e}>`,!0)).get(e)}assertType(e,t,n){try{return this.#c(e,!0)}catch(s){throw s.message=`Invalid ${t} '${s.unknownType||e}' in '${n}'`,s}}getFunctionType(e){if(e==="ast")return mv;let t=this.#c(e,!0);if(t.kind==="dyn"&&t.valueType)throw new Error(`type '${t.name}' is not supported`);return t}registerType(e,t){if(this.#d)throw new Error("Cannot modify frozen registry");if(typeof e=="object"&&(t=e,e=t.fullName||t.name||t.ctor?.name),typeof e=="string"&&e[0]==="."&&(e=e.slice(1)),typeof e!="string"||e.length<2||Mn.has(e))throw va(`name '${e}' is not valid`);if(this.objectTypes.has(e))throw va(`type '${e}' already registered`);let n=this.#c(e,!1);if(n.kind!=="message")throw va(`type '${e}' is not valid`);let s={name:e,typeType:new ve(e),type:n,ctor:typeof t=="function"?t:t?.ctor,convert:typeof t=="function"?void 0:t?.convert,fields:typeof t?.schema=="object"?this.#w(e,this.#S(e,t.schema)):this.#w(e,typeof t=="function"?void 0:t?.fields)};if(typeof s.ctor!="function"){if(!s.fields)throw va(`type '${e}' requires a constructor or fields`);Object.assign(s,this.#N(e,s.fields))}return this.objectTypes.set(e,Object.freeze(s)),this.objectTypesByConstructor.set(s.ctor,s),this.registerFunctionOverload(`type(${e}): type`,()=>s.typeType,{async:!1}),s}#c(e,t=!0){let n=this.#t.get(e);if(n)return n;if(typeof e!="string"||!e.length)throw new Error("Invalid type: must be a string");if(n=e.match(/^[A-Z]$/),n)return this.#h(wL,e,e);if(n=e.match(/^(dyn|list|map|optional)<(.+)>$/),!n){if(t){let o=new Error(`Unknown type: ${e}`);throw o.unknownType=e,o}return this.#h(bL,e,e)}let s=n[1],i=n[2].trim();switch(s){case"dyn":{let o=this.#c(i,t).wrappedType;return this.#t.set(o.name,o),o}case"list":{let o=this.#c(i,t);return this.#h(hd,`list<${o}>`,o)}case"map":{let o=fv(i);if(o.length!==2)throw new Error(`Invalid map type: ${e}`);let a=this.#c(o[0],t),c=this.#c(o[1],t);return this.#h(md,`map<${a}, ${c}>`,a,c)}case"optional":{let o=this.#c(i,t);return this.#h(hv,`optional<${o}>`,o)}}}#h(e,t,...n){return this.#t.get(t)||this.#t.set(t,e(...n)).get(t)}findMacro(e,t,n){return this.functionCandidates(t,e,n).macro}findUnaryOverload(e,t){return this.operatorCandidates(e).findUnaryOverload(t)}findBinaryOverload(e,t,n){return this.operatorCandidates(e).findBinaryOverload(t,n)}#T(e){return typeof e=="string"?{type:e}:e.id?TL(e):e}#O(e,t,n,s=!1){try{let i=this.#T(t[n]);if(typeof i?.type!="string")throw new Error("unsupported declaration");return this.#c(i.type,s)}catch(i){throw i.message=`Field '${n}' in type '${e}' has unsupported declaration: ${JSON.stringify(t[n])}`,i}}#w(e,t){if(!t)return;let n=Object.create(null);for(let s of Se(t))n[s]=this.#O(e,t,s);return n}#N(e,t){let n=Se(t),s=Object.create(null);for(let o of n){let a=t[o],c=a.kind==="message"&&this.objectTypes.get(a.name);c===!1?s[o]=!1:s[o]=c.convert?c:!1}let i={[e]:class extends Map{#m;constructor(o){super(),this.#m=o}[Symbol.iterator](){if(this.size!==n.length)for(let o of n)this.get(o);return super[Symbol.iterator]()}get(o){let a=super.get(o);if(a!==void 0||this.has(o))return a;let c=s[o];if(c!==void 0){if(a=this.#m instanceof Map?this.#m.get(o):this.#m?.[o],c&&a&&typeof a=="object")switch(a.constructor){case void 0:case Object:case Map:a=c.convert(a)}return super.set(o,a),a}}}}[e];return{ctor:i,convert(o){if(o)return o.constructor===i?o:new i(o)}}}clone(e){return this.#d=!0,new r({parent:this,unlistedVariablesAreDyn:e.unlistedVariablesAreDyn,enableOptionalTypes:e.enableOptionalTypes})}getDefinitions(){let e=[],t=[];for(let[,n]of this.variables)n&&e.push({name:n.name,description:n.description||null,type:n.type.name});for(let n of this.#b())t.push({signature:n.signature,name:n.name,description:n.description,receiverType:n.receiverType?n.receiverType.name:null,returnType:n.returnType.name,params:n.params.map(s=>({name:s.name,type:s.type.name,description:s.description}))});return{variables:e,functions:t}}#I(e){if(typeof e!="string")throw new Error("Invalid signature: must be a string");let t=e.match(/^(?:([a-zA-Z0-9.<>]+)\.)?(\w+)\(([^)]*)\):(.*)$/);if(!t)throw new Error(`Invalid signature: ${e}`);let n=t[4].trim();if(!n)throw new Error(`Invalid signature: ${e}`);return{receiverType:t[1]||null,name:t[2],argTypes:fv(t[3]),returnType:n}}#A(e,t){return e.name!==t.name||e.argTypes.length!==t.argTypes.length||(e.receiverType||t.receiverType)&&(!e.receiverType||!t.receiverType)?!1:!(e.receiverType!==t.receiverType&&e.receiverType!==Ve&&t.receiverType!==Ve)&&(t.macro||e.macro||t.argTypes.every((s,i)=>{let o=e.argTypes[i];return s===o||s===Ve||o===Ve}))}#P(e){for(let t of this.#g(e.partitionKey))if(this.#A(t,e))throw new Error(`Function signature '${e.signature}' overlaps with existing overload '${t.signature}'.`)}#k(e,t,n){if(!n)return{type:this.getFunctionType(t),name:`arg${e}`,description:null};let s=n.type||t;if(!s)throw new Error(`params[${e}].type is required`);if(t&&s!==t)throw new Error(`params[${e}].type not equal to signature type`);return{name:n.name||`arg${e}`,type:this.getFunctionType(s),description:n.description??null}}registerFunctionOverload(e,t,n){if(this.#d)throw new Error("Cannot modify frozen registry");typeof e=="object"?n=e:typeof t=="object"?n=t:n||(n={});let s=typeof e=="string"?e:n.signature??void 0,i=s!==void 0?this.#I(s):void 0,o=i?.name||n.name,a=i?.receiverType||n.receiverType,c=i?.argTypes,l=i?.returnType||n.returnType,h=n.params;t=typeof t=="function"?t:n.handler;let f;try{if(!o)throw new Error("signature or name are required");if(!l)throw new Error("must have a returnType");if(h){if(c&&h.length!==c.length)throw new Error("mismatched length in params and args in signature")}else if(!c)throw new Error("signature or params are required");f=new ud({name:o,async:n?.async,receiverType:a?this.getType(a):null,returnType:this.getType(l),handler:t,description:n.description,params:(c||h).map((d,p)=>this.#k(p,c?.[p],h?.[p]))})}catch(d){throw typeof s=="string"?d.message=`Invalid function declaration '${s}': ${d.message}`:o?d.message=`Invalid function declaration '${o}': ${d.message}`:d.message=`Invalid function declaration: ${d.message}`,d}this.#P(f),this.#E(f)}registerOperatorOverload(e,t,n){let s=e.match(/^([-!])([\w.<>]+)(?::\s*([\w.<>]+))?$/);if(s){let[,h,f,d]=s;return this.unaryOverload(h,f,t,d,n?.async)}let i=e.match(/^([\w.<>]+) ([-+*%/]|==|!=|<|<=|>|>=|in) ([\w.<>]+)(?::\s*([\w.<>]+))?$/);if(!i)throw new Error(`Operator overload invalid: ${e}`);let[,o,a,c,l]=i;return this.binaryOverload(o,a,c,t,l)}unaryOverload(e,t,n,s,i){if(this.#d)throw new Error("Cannot modify frozen registry");let o=this.assertType(t,"type",`${e}${t}`),a=this.assertType(s||t,"return type",`${e}${t}: ${s||t}`),c=new Gr({op:`${e}_`,leftType:o,returnType:a,handler:n,async:i});this.#y(this.#_(c))}#C(e){for(let t of this.operatorCandidates(e.operator))if(e.equals(t))return!0;return!1}#_(e){if(!this.#C(e))return e;throw new Error(`Operator overload already registered: ${e.signature}`)}binaryOverload(e,t,n,s,i,o){if(this.#d)throw new Error("Cannot modify frozen registry");i??=dv.has(t)?"bool":e;let a=`${e} ${t} ${n}: ${i}`,c=this.assertType(e,"left type",a),l=this.assertType(n,"right type",a),h=this.assertType(i,"return type",a);if(c.kind==="dyn"&&c.valueType?l=l.wrappedType:l.kind==="dyn"&&l.valueType&&(c=c.wrappedType),dv.has(t)&&h.type!=="bool")throw new Error(`Comparison operator '${t}' must return 'bool', got '${h.type}'`);let f=new Gr({op:t,leftType:c,rightType:l,returnType:h,handler:s,async:o});if(f.hasPlaceholderType&&!(l.hasPlaceholderType&&c.hasPlaceholderType))throw new Error(`Operator overload with placeholders must use them in both left and right types: ${a}`);if(this.#_(f),t==="=="){let d=[new Gr({op:"!=",leftType:c,rightType:l,handler(p,y,u,m){return!s(p,y,u,m)},returnType:h,async:o})];c!==l&&d.push(new Gr({op:"==",leftType:l,rightType:c,handler(p,y,u,m){return s(y,p,u,m)},returnType:h,async:o}),new Gr({op:"!=",leftType:l,rightType:c,handler(p,y,u,m){return!s(y,p,u,m)},returnType:h,async:o}));for(let p of d)this.#_(p);for(let p of d)this.#y(p)}this.#y(f)}},dv=new Set(["<","<=",">",">=","==","!=","in"]);Fn=class{#e;#t;#n;#s;constructor(e,t){if(this.#e=e.variables,t!=null){if(typeof t!="object")throw L("invalid_context","Context must be an object");t instanceof Map?this.#n=t:this.#t=t}}getValue(e){return this.#s?.get(e)||(this.#t?this.#t[e]:this.#n?.get(e))}getVariable(e){return this.#e.get(e)??(this.#e.dyn&&!Mn.has(e)?new hi(e,Ve):void 0)}getCheckedValue(e,t){let n=this.getValue(t.args);if(n===void 0)throw e.createError("unknown_variable",`Unknown variable: ${t.args}`,t);if(t.checkedType.matchesValueType(n,e))return n;let s=t.checkedType,i=e.debugType(n);if(s.kind==="message"&&i.kind==="map"){let o=e.objectTypes.get(s.name)?.convert?.(n);if(o)return(this.#s??=new Map).set(t.args,o),o}throw e.createError("variable_type_mismatch",`Variable '${t.args}' is not of type '${s}', got '${i}'`,t)}forkWithVariable(e,t){return new pd(this,e,t)}},pd=class r{#e;accuType;accuValue;iterValue;constructor(e,t,n){this.#e=e,this.iterVar=t,this.iterType=n}forkWithVariable(e,t){return new r(this,e,t)}reuse(e){if(!this.async)return this.#e=e,this;let t=new r(e,this.iterVar,this.iterType);return t.accuType=this.accuType,t}setIterValue(e,t){if(this.iterType.matchesValueType(e,t))return this.iterValue=e,this;let n=this.iterType,s=t.debugType(e);if(n.kind==="message"&&s.kind==="map"){let i=t.objectTypes.get(n.name)?.convert?.(e);if(i)return this.iterValue=i,this}throw t.createError("variable_type_mismatch",`Variable '${this.iterVar}' is not of type '${n}', got '${s}'`)}setAccuType(e){return this.accuType=e,this}setAccuValue(e){return this.accuValue=e,this}getValue(e){return this.iterVar===e?this.iterValue:this.#e.getValue(e)}getCheckedValue(e,t){return this.iterVar===t.args?this.iterValue:this.#e.getCheckedValue(e,t)}getVariable(e){return this.iterVar===e?new hi(e,this.iterType):this.#e.getVariable(e)}}});function gd(r,e){throw r.createError("unsupported_type",`Unsupported type: ${e}`)}function kt(r,e,t){return e===!0||e&&(e?.maybeAsync||_v(e))?OL(t):r===!0||r&&(r?.maybeAsync||_v(r))?NL(t):t}function OL(r){return r.__asyncBoth??=function(t,n,s,i){return t instanceof Promise||n instanceof Promise?n instanceof Promise?t instanceof Promise?Promise.all([t,n]).then(o=>r(o[0],o[1],s,i)):n.then(o=>r(t,o,s,i)):t.then(o=>r(o,n,s,i)):r(t,n,s,i)}}function NL(r){return r.__asyncFirst??=function(t,n,s,i){return t instanceof Promise?t.then(o=>r(o,n,s,i)):r(t,n,s,i)}}function vv(r,e,t){e.right=e.args[1];let n=r.check(e.left=e.args[0],t);return e.op==="[]"&&r.check(e.right,t),e.handle=kt(e.left,e.op==="[]"?e.right:!1,n!==Iv?VL:KL),n.kind!=="optional"?r.checkAccessOnType(e,t,n):r.registry.getOptionalType(r.checkAccessOnType(e,t,n.valueType,!0))}function bv(r,e,t){e.right=e.args[1];let n=r.check(e.left=e.args[0],t);e.op==="[?]"&&r.check(e.right,t),e.handle=kt(e.left,e.op==="[?]"?e.right:!1,BL);let s=n.kind==="optional"?n.valueType:n;return r.registry.getOptionalType(r.checkAccessOnType(e,t,s,!0))}function wv(r,e,t,n,s){let i=r.check(n,e);if(i===t||t.isEmpty())return i;if(i.isEmpty())return t;throw r.createError(s,`${IL[s]} expected type '${r.formatType(t)}' but found '${r.formatType(i)}'`,n)}function Ev(r,e,t,n){return t.unify(r.registry,r.check(n,e))||Iv}function AL(r,e,t){let n=r.debugRuntimeType(e);return r.createError("invalid_condition_type",`${t.meta.label||"Ternary condition must be bool"}, got '${n}'`,t)}function PL(r,e,t,n){if(r===!0)return e.run(t.left,n);if(r===!1)return e.run(t.right,n);throw AL(e,r,t.condition)}function vd(r,e,t){let n=r.debugRuntimeType(e);return r.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${n}'`,t)}function Av(r,e,t){return e instanceof Error?e:vd(r,e,t)}function Un(r,e,t,n,s){if(s===r)return r;if(s===!r){if(n===s)return s;throw Av(e,n,t.left)}if(s instanceof Promise)return s.then(i=>kL(r,e,t,n,i));throw vd(e,s,t.left)}function kL(r,e,t,n,s){if(s===r)return r;if(typeof s!="boolean")throw vd(e,s,t.right);if(typeof n!="boolean")throw Av(e,n,t.left);return!r}function $v(r,e,t){let n=r.check(e.left=e.args[0],t),s=r.check(e.right=e.args[1],t);if(!n.isDynOrBool())throw r.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${r.formatType(n)}'`,e);if(!s.isDynOrBool())throw r.createError("invalid_logical_operand",`Logical operator requires bool operands, got '${r.formatType(s)}'`,e);return r.boolType}function Sv(r,e,t){let n=e.op,s=r.check(e.args,t);if(e.candidates=r.registry.operatorCandidates(n),s.kind==="dyn")return e.handle=kt(e.args,!1,CL),e.candidates.returnType;let i=e.candidates.findUnaryOverload(s);if(!i)throw r.createError("no_such_overload",`no such overload: ${n[0]}${r.formatType(s)}`,e);return e.handle=kt(e.args,!1,i.handler),i.returnType}function CL(r,e,t){let n=t.debugRuntimeType(r,e.args.checkedType),s=e.candidates.findUnaryOverload(n);if(s)return s.handler(r);throw t.createError("no_such_overload",`no such overload: ${e.op[0]}${n}`,e)}function Tv(r,e,t){return e.handle(r.run(e.args,t),e,r)}function LL(r,e,t){let n=e.op,s=r.check(e.left=e.args[0],t),i=r.check(e.right=e.args[1],t);e.candidates=r.registry.operatorCandidates(n);let o=s.hasDynType||i.hasDynType?void 0:e.candidates.findBinaryOverload(s,i);if(e.handle=kt(e.left,e.right,o?.handler||DL),o)return o.returnType;let a=e.candidates.checkBinaryOverload(s,i);if(s.hasDynType||(e.leftStaticType=s),i.hasDynType||(e.rightStaticType=i),a)return a;throw r.createError("no_such_overload",`no such overload: ${r.formatType(s)} ${n} ${r.formatType(i)}`,e)}function _d(r,e,t){return e.handle(r.run(e.left,t),r.run(e.right,t),e,r)}function Ov(r,e,t){return e.handle(r.run(e.left,t),e.right,e,r)}function DL(r,e,t,n){let s=t.leftStaticType||n.debugTypeDeep(r).wrappedType,i=t.rightStaticType||n.debugTypeDeep(e).wrappedType,o=t.candidates.findBinaryOverload(s,i);if(o)return o.handler(r,e,t,n);throw n.createError("no_such_overload",`no such overload: ${s} ${t.op} ${i}`,t)}function wa(r,e,t,n){try{let s=r.apply(e,t);return s instanceof Promise?s.catch(i=>{throw ui(i,n)}):s}catch(s){throw ui(s,n)}}function qL(r,e,t){let n=e.args[1],s=e.argTypes,i=n.length;for(;i--;)s[i]=t.debugRuntimeType(r[i],n[i].checkedType);let o=e.candidates.findFunction(s);if(o)return wa(o.handler,t,r,e);throw t.createError("no_matching_overload",`found no matching overload for '${e.args[0]}(${s.map(a=>a.unwrappedType).join(", ")})'`,e)}function ML(r,e,t){let[,n,s]=t.args,i=t.argTypes;for(let c=0;c<i.length;c++)i[c]=e.debugRuntimeType(r[c+1],s[c].checkedType);let o=e.debugRuntimeType(r[0],n.checkedType),a=t.candidates.findFunction(i,o);if(a)return wa(a.handler,e,r,t);throw e.createError("no_matching_overload",`found no matching overload for '${o.type}.${t.args[0]}(${i.map(c=>c.unwrappedType).join(", ")})'`,t)}function yd(r,e,t,n=e.length){if(n===0)return[];let s,i=new Array(n);for(;n--;)(i[n]=r.run(e[n],t))instanceof Promise&&(s??=!0);return s?Promise.all(i):i}function Nv(r){let e={};for(let t=0;t<r.length;t++){let[n,s]=r[t];n==="__proto__"||n==="constructor"||n==="prototype"||(e[n]=s)}return e}function jL(r,e,t){let n=r.check(e,t);if(n.kind==="dyn")return n;if(n.kind==="list")return n.valueType;if(n.kind==="map")return n.keyType;throw r.createError("invalid_comprehension_range",`Expression of type '${r.formatType(n)}' cannot be range of a comprehension (must be list, map, or dynamic).`,e)}function Pv(r,e,t){if(t instanceof Set)return[...t];if(t instanceof Map)return[...t.keys()];if(t&&typeof t=="object")return Se(t);throw r.createError("invalid_comprehension_range",`Expression of type '${r.debugType(t)}' cannot be range of a comprehension (must be list, map, or dynamic).`,e.iterable)}function RL(r,e,t,n){zr(r)||(r=Pv(t,e,r));let s=t.run(e.init,n=e.iterCtx.reuse(n));return n.accuValue=s,n===e.iterCtx?UL(t,n,e,r,s,0):Cv(t,n,e,r,s,0)}function xL(r,e,t,n){zr(r)||(r=Pv(t,e,r));let s=t.run(e.init,n=e.iterCtx.reuse(n));return n.accuValue=s,n===e.iterCtx?FL(t,n,e,r,s,0):kv(t,n,e,r,s,0)}function FL(r,e,t,n,s,i){let o=t.condition,a=t.step,c=n.length;for(;i<c&&!(o&&!o(s));)if(s=r.run(a,e.setIterValue(n[i++],r)),s instanceof Promise)return kv(r,e,t,n,s,i);return t.result(s)}async function kv(r,e,t,n,s,i){e===t.iterCtx&&(e.async=!0);let o=t.condition,a=t.step,c=n.length;for(s=await s;i<c;){if(o&&!o(s))return t.result(s);s=r.run(a,e.setIterValue(n[i++],r)),s instanceof Promise&&(s=await s)}return t.result(s)}function UL(r,e,t,n,s,i,o,a){let c=t.condition,l=t.step,h=n.length;for(;i<h;){if(!c(s))return t.result(s);if(a=r.tryEval(l,e.setIterValue(n[i++],r)),a instanceof Promise)return Cv(r,e,t,n,s,i,o,a);a instanceof Error&&(o??=a)||(s=a)}if(o&&c(s))throw o;return t.result(s)}async function Cv(r,e,t,n,s,i,o,a){e===t.iterCtx&&(e.async=!0);let c=t.condition,l=t.step,h=n.length;for(a=await a,a instanceof Error?o??=a:s=a;i<h;){if(!c(s))return t.result(s);a=r.tryEval(l,e.setIterValue(n[i++],r)),a instanceof Promise&&(a=await a),!(a instanceof Error&&(o??=a))&&(s=a)}if(o&&c(s))throw o;return t.result(s)}function BL(r,e,t,n){return n.optionalType.field(r,e,t,n)}function VL(r,e,t,n){return t.left.checkedType.field(r,e,t,n)}function KL(r,e,t,n){switch(r?.constructor){case void 0:case Object:{let i=qn(r||zL,e)?r[e]:void 0;if(i!==void 0)return n.debugType(i),i;break}case Map:{let i=r.get(e);if(i!==void 0)return n.debugType(i),i;break}case Array:case Set:return n.listType.field(r,e,t,n);default:let s=n.objectTypesByConstructor.get(r.constructor);if(s)return s.type.field(r,e,t,n);typeof r=="object"&&gd(n,r.constructor.name)}throw n.createError("no_such_key",`No such key: ${e}`,t)}var Iv,Bn,_v,IL,zL,HL,GL,P,YL,mi=Me(()=>{"use strict";ga();Hr();gt();Iv=ee.dyn,Bn=class{dynType=ee.dyn;optionalType=ee.optional;stringType=ee.string;intType=ee.int;doubleType=ee.double;boolType=ee.bool;nullType=ee.null;listType=ee.list;mapType=ee.map;constructor(e){this.opts=e.opts,this.registry=e.registry,this.objectTypes=this.registry.objectTypes,this.objectTypesByConstructor=this.registry.objectTypesByConstructor}getType(e){return this.registry.getType(e)}debugType(e){switch(typeof e){case"string":return this.stringType;case"bigint":return this.intType;case"number":return this.doubleType;case"boolean":return this.boolType;case"object":if(e===null)return this.nullType;switch(e.constructor){case void 0:case Object:case Map:return this.mapType;case Array:case Set:return this.listType;default:return this.objectTypesByConstructor.get(e.constructor)?.type||gd(this,e.constructor?.name||typeof e)}default:gd(this,typeof e)}}};_v=r=>Array.isArray(r)?r.some(e=>e.maybeAsync):!1;IL={heterogeneous_list_element:"List elements must have the same type,",heterogeneous_map_key:"Map key uses wrong type,",heterogeneous_map_value:"Map value uses wrong type,"};zL=Object.create(null);HL=()=>[],GL=()=>({}),P={value:{check(r,e){return r.debugType(e.args)},evaluate(r,e){return e.args}},id:{check(r,e,t){let n=t.getVariable(e.args);if(!n)throw r.createError("unknown_variable",`Unknown variable: ${e.args}`,e);if(n.constant){let s=e.clone(P.value,n.value);return e.setMeta("alternate",s),r.check(s,t)}return n.type},evaluate(r,e,t){return t.getCheckedValue(r,e)}},".":{alias:"fieldAccess",check:vv,evaluate:Ov},".?":{alias:"optionalFieldAccess",check:bv,evaluate:Ov},"[]":{alias:"bracketAccess",check:vv,evaluate:_d},"[?]":{alias:"optionalBracketAccess",check:bv,evaluate:_d},call:{check(r,e,t){let[n,s]=e.args,i=e.candidates=r.registry.functionCandidates(!1,n,s.length),o=e.argTypes=s.map(l=>r.check(l,t)),a=i.findFunction(o);if(!a)throw r.createError("no_matching_overload",`found no matching overload for '${n}(${r.formatTypeList(o)})'`,e);let c=o.some(l=>l.hasDynType)?qL:a.handler.__handle??=(l,h,f)=>wa(a.handler,f,l,h);return e.handle=kt(s,!1,c),a.returnType},evaluate(r,e,t){return e.handle(yd(r,e.args[1],t),e,r)}},rcall:{check(r,e,t){let[n,s,i]=e.args,o=r.check(s,t),a=e.candidates=r.registry.functionCandidates(!0,n,i.length),c=e.argTypes=i.map(h=>r.check(h,t));if(e.receiverWithArgs=[s,...i],e.handle=kt(e.receiverWithArgs,!1,ML),o.kind==="dyn"&&a.returnType)return a.returnType;let l=a.findFunction(c,o);if(!l)throw r.createError("no_matching_overload",`found no matching overload for '${o.type}.${n}(${r.formatTypeList(c)})'`,e);if(!o.hasPlaceholderType&&!c.some(h=>h.hasDynType)){let h=l.handler,f=h.__handle??=(d,p,y)=>wa(h,p,d,y);e.handle=kt(e.receiverWithArgs,!1,f)}return l.returnType},evaluate(r,e,t){return e.handle(yd(r,e.receiverWithArgs,t),r,e)}},list:{check(r,e,t){let n=e.args,s=n.length;if(s===0)return e.setMeta("evaluate",HL)&&r.getType("list<T>");let i=r.check(n[0],t),o=r.opts.homogeneousAggregateLiterals?wv:Ev;for(let a=1;a<s;a++)i=o(r,t,i,n[a],"heterogeneous_list_element");return r.registry.getListType(i)},evaluate(r,e,t){return yd(r,e.args,t)}},map:{check(r,e,t){let n=e.args,s=n.length;if(s===0)return e.setMeta("evaluate",GL)&&r.getType("map<K, V>");let i=r.opts.homogeneousAggregateLiterals?wv:Ev,o=r.check(n[0][0],t),a=r.check(n[0][1],t);for(let c=1;c<s;c++){let l=n[c];o=i(r,t,o,l[0],"heterogeneous_map_key"),a=i(r,t,a,l[1],"heterogeneous_map_value")}return r.registry.getMapType(o,a)},evaluate(r,e,t){let n=e.args,s=n.length,i=new Array(s),o;for(let a=0;a<s;a++){let c=n[a],l=r.run(c[0],t),h=r.run(c[1],t);l instanceof Promise||h instanceof Promise?(i[a]=Promise.all([l,h]),o??=!0):i[a]=[l,h]}return o?Promise.all(i).then(Nv):Nv(i)}},comprehension:{check(r,e,t){let n=e.args;n.iterCtx=t.forkWithVariable(n.iterVarName,jL(r,n.iterable,t)).setAccuType(r.check(n.init,t));let s=r.check(n.step,n.iterCtx),i=n.errorsAreFatal?xL:RL;return e.handle=kt(n.iterable,!1,i),n.kind==="quantifier"?r.boolType:s},evaluate(r,e,t){return e.handle(r.run(e.args.iterable,t),e.args,r,t)}},accuValue:{check(r,e,t){return t.accuType},evaluate(r,e,t){return t.accuValue}},accuInc:{check(r,e,t){return t.accuType},evaluate(r,e,t){return t.accuValue+=1}},accuPush:{check(r,e,t){let n=t.accuType,s=r.check(e.args,t);return e.args.maybeAsync||e.setMeta("evaluate",P.accuPush.evaluateSync),n.kind==="list"&&n.valueType.kind!=="param"?n:r.registry.getListType(s)},evaluateSync(r,e,t){return t.accuValue.push(r.run(e.args,t)),t.accuValue},evaluate(r,e,t){let n=t.accuValue,s=r.run(e.args,t);return s instanceof Promise?s.then(i=>n.push(i)&&n):(n.push(s),n)}},"?:":{alias:"ternary",check(r,e,t){let n=e.condition=e.args[0],s=e.left=e.args[1],i=e.right=e.args[2],o=r.check(n,t);if(!o.isDynOrBool())throw r.createError("invalid_condition_type",`${n.meta.label||"Ternary condition must be bool"}, got '${r.formatType(o)}'`,n);let a=r.check(s,t),c=r.check(i,t),l=a.unify(r.registry,c);if(e.handle=kt(n,!1,PL),l)return l;throw r.createError("incompatible_ternary_branches",`Ternary branches must have the same type, got '${r.formatType(a)}' and '${r.formatType(c)}'`,e)},evaluate(r,e,t){return e.handle(r.run(e.condition,t),r,e,t)}},"||":{check:$v,evaluate(r,e,t){let n=r.tryEval(e.left,t);if(n===!0)return!0;if(n===!1){let s=r.run(e.right,t);return typeof s=="boolean"?s:Un(!0,r,e,n,s)}return n instanceof Promise?n.then(s=>s===!0?s:Un(!0,r,e,s,r.run(e.right,t))):Un(!0,r,e,n,r.run(e.right,t))}},"&&":{check:$v,evaluate(r,e,t){let n=r.tryEval(e.left,t);if(n===!1)return!1;if(n===!0){let s=r.run(e.right,t);return typeof s=="boolean"?s:Un(!1,r,e,n,s)}return n instanceof Promise?n.then(s=>s===!1?s:Un(!1,r,e,s,r.run(e.right,t))):Un(!1,r,e,n,r.run(e.right,t))}},"!_":{alias:"unaryNot",check:Sv,evaluate:Tv},"-_":{alias:"unaryMinus",check:Sv,evaluate:Tv}},YL=["!=","==","in","+","-","*","/","%","<","<=",">",">="];for(let r of YL)P[r]={check:LL,evaluate:_d};for(let r of Se(P)){let e=P[r];e.name=r,e.alias&&(P[e.alias]=e)}});function $a(r,e){if(r.op==="id")return r.args;throw $e("invalid_macro_argument",e,r)}function Lv(r){let e=r?"map(var, filter, transform)":"map(var, transform)",t=`${e} invalid predicate iteration variable`,n=`${e} filter predicate must return bool`;return({args:s,receiver:i,ast:o})=>{let[a,c,l]=r?s:[s[0],null,s[1]],h=l.clone(P.accuPush,l);if(c){let f=c.clone(P.accuValue);h=c.clone(P.ternary,[c.setMeta("label",n),h,f])}return{callAst:o.clone(P.comprehension,{errorsAreFatal:!0,iterable:i,iterVarName:$a(a,t),init:o.clone(P.list,[]),step:h,result:Ea})}}}function ZL(){let r="filter(var, predicate)",e=`${r} invalid predicate iteration variable`,t=`${r} predicate must return bool`;return({args:n,receiver:s,ast:i})=>{let o=$a(n[0],e),a=i.clone(P.accuValue),c=n[1].setMeta("label",t),l=i.clone(P.accuPush,i.clone(P.id,o)),h=c.clone(P.ternary,[c,l,a]);return{callAst:i.clone(P.comprehension,{errorsAreFatal:!0,iterable:s,iterVarName:o,init:i.clone(P.list,[]),step:h,result:Ea})}}}function bd(r){let e=`${r.name}(var, predicate) invalid predicate iteration variable`,t=`${r.name}(var, predicate) predicate must return bool`;return({args:n,receiver:s,ast:i})=>{let o=n[1].setMeta("label",t),a=r.transform({args:n,ast:i,predicate:o,opts:r});return{callAst:i.clone(P.comprehension,{kind:"quantifier",errorsAreFatal:r.errorsAreFatal||!1,iterable:s,iterVarName:$a(n[0],e),init:a.init,condition:a.condition,step:a.step,result:a.result||Ea})}}}function JL(){let r="has() invalid argument";function e(n,s,i){let o=s.macroHasProps,a=o.length,c=n.run(o[--a],i),l;for(;a--;){let h=o[a];if(h.op===".?"&&(l??=!0),c=n.debugType(c).fieldLazy(c,h.args[1],h,n),c===void 0){if(!(!l&&a&&h.op==="."))break;throw L("no_such_key",`No such key: ${h.args[1]}`,h)}}return c!==void 0}function t(n,s,i){let o=s.args[0];if(o.op!==".")throw n.createError("invalid_macro_argument",r,o);if(!s.macroHasProps){let a=[];for(;o.op==="."||o.op===".?";)o=a.push(o)&&o.args[0];if(o.op!=="id")throw n.createError("invalid_macro_argument",r,o);n.check(o,i),a.push(o),s.macroHasProps=a}return n.getType("bool")}return function({args:n}){return{args:n,evaluate:e,typeCheck:t,async:!1}}}function Dv(r){let e=(c,l)=>r.registerFunctionOverload(c,l);e("has(ast): bool",JL()),e("list.all(ast, ast): bool",bd({name:"all",transform({ast:c,predicate:l,opts:h}){return{init:c.clone(P.value,!0),condition:Ea,step:l.clone(P.ternary,[l,l.clone(P.value,!0),l.clone(P.value,!1)])}}})),e("list.exists(ast, ast): bool",bd({name:"exists",condition(c){return!c},transform({ast:c,predicate:l,opts:h}){return{init:c.clone(P.value,!1),condition:h.condition,step:l.clone(P.ternary,[l,l.clone(P.value,!0),l.clone(P.value,!1)])}}})),e("list.exists_one(ast, ast): bool",bd({name:"exists_one",errorsAreFatal:!0,result(c){return c===1},transform({ast:c,predicate:l,opts:h}){let f=c.clone(P.accuValue);return{init:c.clone(P.value,0),step:l.clone(P.ternary,[l,c.clone(P.accuInc),f]),result:h.result}}})),e("list.map(ast, ast): list<dyn>",Lv(!1)),e("list.map(ast, ast, ast): list<dyn>",Lv(!0)),e("list.filter(ast, ast): list<dyn>",ZL());class t{}let n=new t;r.registerType("CelNamespace",t),r.registerConstant("cel","CelNamespace",n);function s(c,l,h){l.bindCtx=h.forkWithVariable(l.var,c.check(l.val,h));let f=c.check(l.exp,l.bindCtx);return l.val.maybeAsync||l.exp.maybeAsync||(l.ast.setMeta("async",!1),l.evaluate=a),f}function i(c,l,h,f,d){let p=c.run(l,f=h.reuse(f).setIterValue(d,c));return p instanceof Promise&&f===h&&(f.async=!0),p}function o(c,{val:l,exp:h,bindCtx:f},d){let p=c.run(l,d);return p instanceof Promise?p.then(y=>i(c,h,f,d,y)):i(c,h,f,d,p)}function a(c,{val:l,exp:h,bindCtx:f},d){return c.run(h,f.reuse(d).setIterValue(c.run(l,d),c))}e("CelNamespace.bind(ast, dyn, ast): dyn",({ast:c,args:l})=>({ast:c,var:$a(l[0],"invalid variable argument"),val:l[1],exp:l[2],bindCtx:void 0,typeCheck:s,evaluate:o}))}var Ea,qv=Me(()=>{"use strict";gt();mi();Ea=r=>r});function Mv(r){let e=(f,d,p,y)=>r.unaryOverload(f,d,p,y,!1),t=(f,d,p,y,u)=>r.binaryOverload(f,d,p,y,u,!1);function n(f,d){if(f<=ma&&f>=ya)return f;throw L("numeric_overflow",`integer overflow: ${f}`,d)}function s(f){throw L("division_by_zero","division by zero",f)}function i(f){throw L("modulo_by_zero","modulo by zero",f)}e("!","bool",f=>!f),e("-","int",f=>-f),t("dyn<int>","==","double",(f,d)=>f==d),t("dyn<int>","==","uint",(f,d)=>f==d.valueOf()),t("int","*","int",(f,d,p)=>n(f*d,p)),t("int","+","int",(f,d,p)=>n(f+d,p)),t("int","-","int",(f,d,p)=>n(f-d,p)),t("int","/","int",(f,d,p)=>d===Kr?s(p):f/d),t("int","%","int",(f,d,p)=>d===Kr?i(p):f%d),e("-","double",f=>-f),t("double","*","double",(f,d)=>f*d),t("double","+","double",(f,d)=>f+d),t("double","-","double",(f,d)=>f-d),t("double","/","double",(f,d)=>f/d),t("string","+","string",(f,d)=>f+d),t("list<V>","+","list<V>",(f,d)=>[...f,...d]),t("bytes","+","bytes",(f,d)=>{if(!f.length)return d;if(!d.length)return f;let p=new Uint8Array(f.length+d.length);return p.set(f,0),p.set(d,f.length),p});let o="google.protobuf.Duration";t(o,"+",o,(f,d)=>f.addDuration(d)),t(o,"-",o,(f,d)=>f.subtractDuration(d)),t(o,"==",o,(f,d)=>f.seconds===d.seconds&&f.nanos===d.nanos);let a="google.protobuf.Timestamp";t(a,"==",a,(f,d)=>f.getTime()===d.getTime()),t(a,"-",a,(f,d)=>yr.fromMilliseconds(f.getTime()-d.getTime()),o),t(a,"-",o,(f,d)=>d.subtractTimestamp(f)),t(a,"+",o,(f,d)=>d.extendTimestamp(f)),t(o,"+",a,(f,d)=>f.extendTimestamp(d));function c(f,d,p,y){if(d instanceof Set&&d.has(f))return!0;for(let u of d)if(yi(f,u,p,y))return!0;return!1}function l(f,d){return d instanceof Map?d.get(f)!==void 0:qn(d,f)?d[f]!==void 0:!1}function h(f,d,p,y){return c(f,d,p,y)}t("V","in","list<V>",h),t("K","in","map<K, V>",l);for(let f of["type","null","bool","string","int","double"])t(f,"==",f,(d,p)=>d===p);t("bytes","==","bytes",(f,d)=>{if(f===d)return!0;let p=f.length;if(p!==d.length)return!1;for(;p--;)if(f[p]!==d[p])return!1;return!0}),t("list<V>","==","list<V>",(f,d,p,y)=>{if(f===d)return!0;if(zr(f)&&zr(d)){let _=f.length;if(_!==d.length)return!1;for(let v=0;v<_;v++)if(!yi(f[v],d[v],p,y))return!1;return!0}if(f instanceof Set&&d instanceof Set){if(f.size!==d.size)return!1;for(let _ of f)if(!d.has(_))return!1;return!0}let u=f instanceof Set?d:f,m=f instanceof Set?f:d;if(!zr(u)||u.length!==m?.size)return!1;for(let _=0;_<u.length;_++)if(!m.has(u[_]))return!1;return!0}),t("map<K, V>","==","map<K, V>",(f,d,p,y)=>{if(f===d)return!0;if(f instanceof Map&&d instanceof Map){if(f.size!==d.size)return!1;for(let[_,v]of f)if(!(d.has(_)&&yi(v,d.get(_),p,y)))return!1;return!0}if(f instanceof Map||d instanceof Map){let _=f instanceof Map?d:f,v=f instanceof Map?f:d,g=Se(_);if(v.size!==g.length)return!1;for(let[b,E]of v)if(!(b in _&&yi(E,_[b],p,y)))return!1;return!0}let u=Se(f),m=Se(d);if(u.length!==m.length)return!1;for(let _=0;_<u.length;_++){let v=u[_];if(!(v in d&&yi(f[v],d[v],p,y)))return!1}return!0}),t("uint","==","uint",(f,d)=>f.valueOf()===d.valueOf()),t("dyn<uint>","==","double",(f,d)=>f.valueOf()==d),t("uint","+","uint",(f,d)=>new ge(f.valueOf()+d.valueOf())),t("uint","-","uint",(f,d)=>new ge(f.valueOf()-d.valueOf())),t("uint","*","uint",(f,d)=>new ge(f.valueOf()*d.valueOf())),t("uint","/","uint",(f,d,p)=>d.valueOf()===Kr?s(p):new ge(f.valueOf()/d.valueOf())),t("uint","%","uint",(f,d,p)=>d.valueOf()===Kr?i(p):new ge(f.valueOf()%d.valueOf()));for(let[f,d]of[["bool","bool"],["int","int"],["uint","uint"],["double","double"],["string","string"],["google.protobuf.Timestamp","google.protobuf.Timestamp"],["google.protobuf.Duration","google.protobuf.Duration"],["int","uint"],["int","double"],["double","int"],["double","uint"],["uint","int"],["uint","double"]])t(f,"<",d,(p,y)=>p<y),t(f,"<=",d,(p,y)=>p<=y),t(f,">",d,(p,y)=>p>y),t(f,">=",d,(p,y)=>p>=y)}function yi(r,e,t,n){if(r===e)return!0;switch(typeof r){case"undefined":case"string":case"boolean":return!1;case"bigint":return typeof e=="number"?r==e:!1;case"number":return typeof e=="bigint"?r==e:!1;case"object":if(typeof e!="object")return!1;let s=n.debugType(r),i=n.debugType(e);if(s!==i)return!1;let o=n.registry.findBinaryOverload("==",s,i);return o?o.handler(r,e,t,n):!1}throw L("invalid_comparison_type",`Cannot compare values of type ${typeof r}`,t)}var jv=Me(()=>{"use strict";xn();gt();Hr()});var WL,gi,Rv=Me(()=>{"use strict";gt();mi();WL=new Map().set("A","dyn").set("T","dyn").set("K","dyn").set("V","dyn"),gi=class extends Bn{constructor(e,t){super(e),this.createError=t?L:tv}check(e,t){try{return e.checkedType??=e.check(this,e,t)}catch(n){throw ui(n,e)}}checkAccessOnType(e,t,n,s=!1){if(n===this.dynType)return n;let i=(e.op==="[]"||e.op==="[?]"?this.check(e.args[1],t):this.stringType).type;if(n.kind==="list"){if(i==="int"||i==="dyn")return n.valueType;throw this.createError("invalid_index_type",`List index must be int, got '${i}'`,e)}if(n.kind==="map")return n.valueType;let o=this.objectTypes.get(n.name);if(o){if(!(i==="string"||i==="dyn"))throw this.createError("invalid_index_type",`Cannot index type '${n.name}' with type '${i}'`,e);if(o.fields){let a;if(e.op==="."||e.op===".?"?a=e.args[1]:e.args[1].op==="value"&&(a=e.args[1].args),typeof a=="string"){let c=o.fields[a];if(c)return c;if(s)return this.dynType;throw this.createError("no_such_key",`No such key: ${a}`,e)}}return this.dynType}throw this.createError("cannot_index_type",`Cannot index type '${this.formatType(n)}'`,e)}formatType(e){return e.hasPlaceholderType?e.templated(this.registry,WL).name:e.name}formatTypeList(e){return e.map(t=>this.formatType(t)).join(", ")}}});var T,Sa,Ta,Fv,XL,xv,wd,Ed,QL,Oa,Uv=Me(()=>{"use strict";xn();gt();mi();Hr();T={EOF:0,NUMBER:1,STRING:2,BOOLEAN:3,NULL:4,IDENTIFIER:5,PLUS:6,MINUS:7,MULTIPLY:8,DIVIDE:9,MODULO:10,EQ:11,NE:12,LT:13,LE:14,GT:15,GE:16,AND:17,OR:18,NOT:19,IN:20,LPAREN:21,RPAREN:22,LBRACKET:23,RBRACKET:24,LBRACE:25,RBRACE:26,DOT:27,COMMA:28,COLON:29,QUESTION:30,BYTES:31},Sa={[T.EQ]:P["=="],[T.PLUS]:P["+"],[T.MINUS]:P["-"],[T.MULTIPLY]:P["*"],[T.DIVIDE]:P["/"],[T.MODULO]:P["%"],[T.LE]:P["<="],[T.LT]:P["<"],[T.GE]:P[">="],[T.GT]:P[">"],[T.NE]:P["!="],[T.IN]:P.in},Ta={};for(let r in T)Ta[T[r]]=r;Fv=new Uint8Array(128);for(let r of"0123456789abcdefABCDEF")Fv[r.charCodeAt(0)]=1;XL={bytes_unicode_escape:r=>`\\${r} not allowed in bytes literals`,invalid_unicode_escape:r=>`Invalid Unicode escape: \\${r}`,invalid_unicode_surrogate:r=>`Invalid Unicode surrogate: \\${r}`,invalid_hex_escape:r=>`Invalid hex escape: \\${r}`,invalid_octal_escape:()=>"Octal escape must be 3 digits",octal_escape_out_of_range:r=>`Octal escape out of range: \\${r}`,invalid_escape_sequence:r=>`Invalid escape sequence: \\${r}`},xv={"\\":"\\","?":"?",'"':'"',"'":"'","`":"`",a:"\x07",b:"\b",f:"\f",n:`
|
|
154
154
|
`,r:"\r",t:" ",v:"\v"},wd=class r{#e;#t;constructor(e,t,n,s,i,o){this.#e={check:i.check,evaluate:i.evaluate},this.#t=e,this.op=i.name,this.args=o,this.pos=t,this.start=n,this.end=s}clone(e,t){return new r(this.#t,this.pos,this.start,this.end,e,t)}get meta(){return this.#e}get input(){return this.#t}#n(){let e=this.#e.alternate??this;switch(e.op){case"value":case"id":case"accuValue":case"accuInc":return!1;case"accuPush":return e.args.maybeAsync;case"!_":case"-_":return e.candidates?.async!==!1?!0:e.args.maybeAsync;case"!=":case"==":case"in":case"+":case"-":case"*":case"/":case"%":case"<":case"<=":case">":case">=":return e.candidates?.async!==!1?!0:e.args.some(t=>t.maybeAsync);case"call":case"rcall":return e.candidates?.async!==!1?!0:(e.receiverWithArgs||e.args[1]).some(t=>t.maybeAsync);case"comprehension":return e.args.iterable.maybeAsync||e.args.step.maybeAsync;case".":case".?":return e.args[0].maybeAsync;case"?:":case"list":case"[]":case"[?]":return e.args.some(t=>t.maybeAsync);case"||":case"&&":return e.args.some(t=>t.maybeAsync);case"map":return e.args.some(t=>t[0].maybeAsync||t[1].maybeAsync);default:return!0}}get maybeAsync(){return this.#e.async??=this.#n()}check(e,t,n){let s=this.#e;return s.alternate?e.check(s.alternate,n):s.macro?s.macro.typeCheck(e,s.macro,n):s.check(e,t,n)}evaluate(e,t,n){let s=this.#e;return s.alternate?this.evaluate=this.#s:s.macro?this.evaluate=this.#i:this.evaluate=s.evaluate,this.evaluate(e,t,n)}#s(e,t,n){return(t=this.#e.alternate).evaluate(e,t,n)}#i(e,t,n){return(t=this.#e.macro).evaluate(e,t,n)}setMeta(e,t){return this.#e[e]=t,this}get range(){return{start:this.start,end:this.end}}toOldStructure(){let e=Array.isArray(this.args)?this.args:[this.args];return[this.op,...e.map(t=>t instanceof r?t.toOldStructure():t)]}},Ed=class{input;pos;length;tokenPos;tokenType;tokenValue;reset(e){return this.pos=0,this.input=e,this.length=e.length,e}token(e,t,n){return this.tokenPos=e,this.tokenType=t,this.tokenValue=n,this}nextToken(){for(;;){let{pos:e,input:t,length:n}=this;if(e>=n)return this.token(e,T.EOF);let s=t[e];switch(s){case" ":case" ":case`
|
|
155
155
|
`:case"\r":this.pos++;continue;case"=":if(t[e+1]!=="=")break;return this.token((this.pos+=2)-2,T.EQ);case"&":if(t[e+1]!=="&")break;return this.token((this.pos+=2)-2,T.AND);case"|":if(t[e+1]!=="|")break;return this.token((this.pos+=2)-2,T.OR);case"+":return this.token(this.pos++,T.PLUS);case"-":return this.token(this.pos++,T.MINUS);case"*":return this.token(this.pos++,T.MULTIPLY);case"/":if(t[e+1]==="/"){for(;this.pos<n&&this.input[this.pos]!==`
|
|
156
|
-
`;)this.pos++;continue}return this.token(this.pos++,T.DIVIDE);case"%":return this.token(this.pos++,T.MODULO);case"<":return t[e+1]==="="?this.token((this.pos+=2)-2,T.LE):this.token(this.pos++,T.LT);case">":return t[e+1]==="="?this.token((this.pos+=2)-2,T.GE):this.token(this.pos++,T.GT);case"!":return t[e+1]==="="?this.token((this.pos+=2)-2,T.NE):this.token(this.pos++,T.NOT);case"(":return this.token(this.pos++,T.LPAREN);case")":return this.token(this.pos++,T.RPAREN);case"[":return this.token(this.pos++,T.LBRACKET);case"]":return this.token(this.pos++,T.RBRACKET);case"{":return this.token(this.pos++,T.LBRACE);case"}":return this.token(this.pos++,T.RBRACE);case".":return this.token(this.pos++,T.DOT);case",":return this.token(this.pos++,T.COMMA);case":":return this.token(this.pos++,T.COLON);case"?":return this.token(this.pos++,T.QUESTION);case'"':case"'":return this.readString(s);case"b":case"B":case"r":case"R":{let i=t[e+1];return i==='"'||i==="'"?++this.pos&&this.readString(i,s):this.readIdentifier()}default:{let i=s.charCodeAt(0);if(i<=57&&i>=48)return this.readNumber();if(this._isIdentifierCharCode(i))return this.readIdentifier()}}throw $e("unexpected_character",`Unexpected character: ${s}`,{pos:e,start:e,end:e+1,input:t})}}_isIdentifierCharCode(e){return e<48||e>122?!1:e>=97||e>=65&&e<=90||e<=57||e===95}_parseAsDouble(e,t){let n=Number(this.input.substring(e,t));if(Number.isFinite(n))return this.token(e,T.NUMBER,n);throw $e("invalid_number",`Invalid number: ${n}`,{pos:e,start:e,end:t,input:this.input})}_parseAsBigInt(e,t,n,s){let i=this.input.substring(e,t);if(s==="u"||s==="U"){this.pos++;try{return this.token(e,T.NUMBER,new ge(i))}catch{}}else try{return this.token(e,T.NUMBER,BigInt(i))}catch{}throw $e(n?"invalid_hex_integer":"invalid_integer",n?`Invalid hex integer: ${i}`:`Invalid integer: ${i}`,{pos:e,start:e,end:this.pos,input:this.input})}_readDigits(e,t,n,s){for(;n<t&&(s=e.charCodeAt(n))&&!(s>57||s<48);)n++;return n}_readExponent(e,t,n){let s=n<t&&e[n];if(s==="e"||s==="E"){s=++n<t&&e[n],(s==="-"||s==="+")&&n++;let i=n;if(n=this._readDigits(e,t,n),i===n)throw $e("invalid_exponent","Invalid exponent",{pos:n,start:n,end:Math.min(n+1,e.length),input:e})}return n}readNumber(){let{input:e,length:t,pos:n}=this,s=n;if(e[s]==="0"&&(e[s+1]==="x"||e[s+1]==="X")){for(s+=2;s<t&&
|
|
157
|
-
`:case"\r":throw $e("newline_in_string","Newlines not allowed in single-quoted strings",{pos:a,start:a,end:a+1,input:n});case"\\":a++}a++}throw $e("unterminated_string","Unterminated string",{pos:i,start:i,end:n.length,input:n})}readTripleQuotedString(e,t){let{input:n,length:s,pos:i}=this,o,a=this.pos+3;for(;a<s&&(o=n[a]);){switch(o){case e:if(n[a+1]===e&&n[a+2]===e){let c=i+3,l=n.slice(c,a);return this.pos=a+3,this._closeQuotedString(c,l,t,i)}break;case"\\":a++}a++}throw $e("unterminated_triple_quoted_string","Unterminated triple-quoted string",{pos:i,start:i,end:n.length,input:n})}#e(e,t,n,s,i,o){let a=t+s;return $e(e,QL[e](o),{input:this.input,pos:a,start:a,end:Math.min(a+i,t+n)})}processEscapes(e,t,n){if(!t.includes("\\"))return t;let s=t.length,i="",o=0;for(;o<s;){if(t[o]!=="\\"||o+1>=s){i+=t[o++];continue}let a=t[o+1];if(Fv[a])i+=Fv[a],o+=2;else if(a==="u"||a==="U"){if(n)throw this.#e("bytes_unicode_escape",e,s,o,2,a);let c=a==="u"?4:8,l=t.substring(o+2,o+2+c),h=Number.parseInt(l,16);if(l.length!==c||!/^[0-9a-fA-F]+$/.test(l)||h>1114111)throw this.#e("invalid_unicode_escape",e,s,o,2+c,a+l);if(h>=55296&&h<=57343)throw this.#e("invalid_unicode_surrogate",e,s,o,2+c,a+l);i+=String.fromCodePoint(h),o+=2+c}else if(a==="x"||a==="X"){let c=t.substring(o+2,o+4);if(!/^[0-9a-fA-F]{2}$/.test(c))throw this.#e("invalid_hex_escape",e,s,o,4,a+c);i+=String.fromCharCode(Number.parseInt(c,16)),o+=4}else if(a>="0"&&a<="7"){let c=t.substring(o+1,o+4);if(!/^[0-7]{3}$/.test(c))throw this.#e("invalid_octal_escape",e,s,o,4);let l=Number.parseInt(c,8);if(l>255)throw this.#e("octal_escape_out_of_range",e,s,o,4,c);i+=String.fromCharCode(l),o+=4}else throw this.#e("invalid_escape_sequence",e,s,o,2,a)}return i}readIdentifier(){let{pos:e,input:t,length:n}=this,s=e;for(;s<n&&this._isIdentifierCharCode(t[s].charCodeAt(0));)s++;let i=t.substring(e,this.pos=s);switch(i){case"true":return this.token(e,T.BOOLEAN,!0);case"false":return this.token(e,T.BOOLEAN,!1);case"null":return this.token(e,T.NULL,null);case"in":return this.token(e,T.IN);default:return this.token(e,T.IDENTIFIER,i)}}},eD=new Ed,Oa=class{lexer=eD;input=null;maxDepthRemaining=null;astNodesRemaining=null;type=null;pos=null;constructor(e,t){this.limits=e,this.registry=t}#e(e,t=this.pos){throw $e("limit_exceeded",`Exceeded ${e} (${this.limits[e]})`,{pos:t,start:t,end:t,input:this.input})}#t(e,t,n,s,i=e){let o=new wd(this.input,i,e,t,n,s);return this.astNodesRemaining--||this.#e("maxAstNodes",i),o}#n(e,t,n){return this.#t(t.start,n.end,e,[t,n])}#s(e,t,n){return this.#t(e.start,n.end,P.ternary,[e,t,n])}#i(e,t,n){return this.#t(e,n.end,t,n)}#o(e,t,n,s,i=t.start){return this.#t(t.start,s,e,[t,n],i)}#r(e=this.pos){let t=this.lexer.nextToken();return this.pos=t.tokenPos,this.type=t.tokenType,e}get value(){return this.lexer.tokenValue}consume(e){if(this.type===e)return this.#r();throw $e("expected_token",`Expected ${Ta[e]}, got ${Ta[this.type]}`,{pos:this.pos,start:this.pos,end:this.lexer.pos,input:this.input})}match(e){return this.type===e}parse(e){if(typeof e!="string")throw $e("expression_must_be_string","Expression must be a string");this.input=this.lexer.reset(e),this.#r(),this.maxDepthRemaining=this.limits.maxDepth,this.astNodesRemaining=this.limits.maxAstNodes;let t=this.parseExpression();if(this.match(T.EOF))return t;throw $e("unexpected_character",`Unexpected character: '${this.input[this.lexer.pos-1]}'`,{pos:this.pos,start:this.pos,end:this.lexer.pos,input:this.input})}#a(e,t,n,s){let i=s[0],o=n===P.rcall?s[1]:null,a=n===P.rcall?s[2]:s[1],c=this.registry.findMacro(i,!!o,a.length),l=this.#t(e,t,n,s);if(!c)return l;let h=c.handler({ast:l,args:a,receiver:o,methodName:i,parser:this});return h.callAst?l.setMeta("alternate",h.callAst):l.setMeta("macro",h).setMeta("async",pi(h.evaluate,h.async))}parseExpression(){this.maxDepthRemaining--||this.#e("maxDepth");let e=this.parseLogicalOr();if(!this.match(T.QUESTION))return++this.maxDepthRemaining&&e;this.#r();let t=this.parseExpression();this.consume(T.COLON);let n=this.parseExpression();return this.maxDepthRemaining++,this.#s(e,t,n)}parseLogicalOr(){let e=this.parseLogicalAnd();for(;this.match(T.OR);)this.#r(),e=this.#n(P["||"],e,this.parseLogicalAnd());return e}parseLogicalAnd(){let e=this.parseEquality();for(;this.match(T.AND);)this.#r(),e=this.#n(P["&&"],e,this.parseEquality());return e}parseEquality(){let e=this.parseRelational();for(;this.match(T.EQ)||this.match(T.NE);){let t=Sa[this.type];this.#r(),e=this.#n(t,e,this.parseRelational())}return e}parseRelational(){let e=this.parseAdditive();for(;this.match(T.LT)||this.match(T.LE)||this.match(T.GT)||this.match(T.GE)||this.match(T.IN);){let t=Sa[this.type];this.#r(),e=this.#n(t,e,this.parseAdditive())}return e}parseAdditive(){let e=this.parseMultiplicative();for(;this.match(T.PLUS)||this.match(T.MINUS);){let t=Sa[this.type];this.#r(),e=this.#n(t,e,this.parseMultiplicative())}return e}parseMultiplicative(){let e=this.parseUnary();for(;this.match(T.MULTIPLY)||this.match(T.DIVIDE)||this.match(T.MODULO);){let t=Sa[this.type];this.#r(),e=this.#n(t,e,this.parseUnary())}return e}parseUnary(){return this.type===T.NOT?this.#i(this.#r(),P.unaryNot,this.parseUnary()):this.type===T.MINUS?this.#i(this.#r(),P.unaryMinus,this.parseUnary()):this.parsePostfix()}parsePostfix(){let e=this.parsePrimary(),t=this.maxDepthRemaining;for(;;){if(this.match(T.DOT)){let n=this.#r();this.maxDepthRemaining--||this.#e("maxDepth",n);let s=this.match(T.QUESTION)&&this.registry.enableOptionalTypes&&this.#r()?P.optionalFieldAccess:P.fieldAccess,i=this.value,o=this.pos,a=this.lexer.pos;if(this.consume(T.IDENTIFIER),s===P.fieldAccess&&this.match(T.LPAREN)&&this.#r()){let c=this.parseArgumentList(),l=this.lexer.pos;this.consume(T.RPAREN),e=this.#a(e.start,l,P.rcall,[i,e,c])}else e=this.#o(s,e,i,a,o);continue}if(this.match(T.LBRACKET)){let n=this.#r();this.maxDepthRemaining--||this.#e("maxDepth",n);let s=this.match(T.QUESTION)&&this.registry.enableOptionalTypes&&this.#r()?P.optionalBracketAccess:P.bracketAccess,i=this.parseExpression(),o=this.lexer.pos;this.consume(T.RBRACKET),e=this.#o(s,e,i,o);continue}break}return this.maxDepthRemaining=t,e}parsePrimary(){switch(this.type){case T.NUMBER:case T.STRING:case T.BYTES:case T.BOOLEAN:case T.NULL:return this.#f();case T.IDENTIFIER:return this.#l();case T.LPAREN:return this.#u();case T.LBRACKET:return this.parseList();case T.LBRACE:return this.parseMap()}throw $e("unexpected_token",`Unexpected token: ${Ta[this.type]}`,{pos:this.pos,start:this.pos,end:this.lexer.pos,input:this.input})}#f(){return this.#r(this.#t(this.pos,this.lexer.pos,P.value,this.value))}#l(){let e=this.value,t=this.lexer.pos,n=this.consume(T.IDENTIFIER);if(Mn.has(e))throw $e("reserved_identifier",`Reserved identifier: ${e}`,{pos:n,start:n,end:t,input:this.input});if(!this.match(T.LPAREN))return this.#t(n,t,P.id,e);this.#r();let s=this.parseArgumentList(),i=this.lexer.pos;return this.consume(T.RPAREN),this.#a(n,i,P.call,[e,s])}#u(){this.consume(T.LPAREN);let e=this.parseExpression();return this.consume(T.RPAREN),e}parseList(){let e=this.consume(T.LBRACKET),t=[],n=this.limits.maxListElements;if(!this.match(T.RBRACKET))for(t.push(this.parseExpression()),n--||this.#e("maxListElements",t.at(-1).pos);this.match(T.COMMA)&&(this.#r(),!this.match(T.RBRACKET));)t.push(this.parseExpression()),n--||this.#e("maxListElements",t.at(-1).pos);let s=this.lexer.pos;return this.consume(T.RBRACKET),this.#t(e,s,P.list,t)}parseMap(){let e=this.consume(T.LBRACE),t=[],n=this.limits.maxMapEntries;if(!this.match(T.RBRACE))for(t.push(this.parseProperty()),n--||this.#e("maxMapEntries",t.at(-1)[0].pos);this.match(T.COMMA)&&(this.#r(),!this.match(T.RBRACE));)t.push(this.parseProperty()),n--||this.#e("maxMapEntries",t.at(-1)[0].pos);let s=this.lexer.pos;return this.consume(T.RBRACE),this.#t(e,s,P.map,t)}parseProperty(){return[this.parseExpression(),(this.consume(T.COLON),this.parseExpression())]}parseArgumentList(){let e=[],t=this.limits.maxCallArguments;if(!this.match(T.RPAREN))for(e.push(this.parseExpression()),t--||this.#e("maxCallArguments",e.at(-1).pos);this.match(T.COMMA)&&(this.#r(),!this.match(T.RPAREN));)e.push(this.parseExpression()),t--||this.#e("maxCallArguments",e.at(-1).pos);return e}}});function rD(r,e=Sd){let t=r?Se(r):void 0;if(!t?.length)return e;let n={...e};for(let s of t){if(!tD.has(s))throw new TypeError(`Unknown limits option: ${s}`);let i=r[s];typeof i=="number"&&(n[s]=i)}return _t(n)}function $d(r,e,t){let n=r?.[t]??e?.[t];if(typeof n!="boolean")throw new TypeError(`Invalid option: ${t}`);return n}function Vv(r,e=nD){return r?_t({unlistedVariablesAreDyn:$d(r,e,"unlistedVariablesAreDyn"),homogeneousAggregateLiterals:$d(r,e,"homogeneousAggregateLiterals"),enableOptionalTypes:$d(r,e,"enableOptionalTypes"),limits:rD(r.limits,e.limits)}):e}var Sd,tD,nD,zv=Me(()=>{"use strict";Hr();Sd=_t({maxAstNodes:1e5,maxDepth:250,maxListElements:1e3,maxMapEntries:1e3,maxCallArguments:32}),tD=new Set(Se(Sd));nD=_t({unlistedVariablesAreDyn:!1,homogeneousAggregateLiterals:!0,enableOptionalTypes:!1,limits:Sd})});function Nd(r){return Od.parse(r)}function Id(r,e){return Od.evaluate(r,e)}function Ad(r){return Od.check(r)}var Na,Vn,Td,Od,Kv=Me(()=>{"use strict";ga();gt();xn();Mv();Rv();xv();Bv();zv();mi();Na=_v({enableOptionalTypes:!1});lv(Na);jv(Na);qv(Na);Vn=class r{#e;#t;#n;#s;#i;constructor(e,t){this.opts=Vv(e,t?.opts),this.#e=(t instanceof r?t.#e:Na).clone(this.opts);let n={registry:this.#e,opts:this.opts};this.#n=new gi(n),this.#s=new gi(n,!0),this.#t=new Td(n),this.#i=new Oa(this.opts.limits,this.#e),Object.freeze(this)}clone(e){return new r(e,this)}registerFunction(e,t,n){return this.#e.registerFunctionOverload(e,t,n),this}registerOperator(e,t,n){return this.#e.registerOperatorOverload(e,t,n),this}registerType(e,t){return this.#e.registerType(e,t),this}registerVariable(e,t,n){return this.#e.registerVariable(e,t,n),this}registerConstant(e,t,n){return this.#e.registerConstant(e,t,n),this}hasVariable(e){return this.#e.variables.has(e)}getDefinitions(){return this.#e.getDefinitions()}check(e){try{return this.#o(this.#i.parse(e))}catch(t){return{valid:!1,error:t}}}#o(e){try{let t=this.#n.check(e,new Fn(this.#e));return{valid:!0,type:this.#r(t)}}catch(t){return{valid:!1,error:t}}}#r(e){return e.name==="list<dyn>"?"list":e.name==="map<dyn, dyn>"?"map":e.name}parse(e){let t=this.#i.parse(e),n=this.#a.bind(this,t);return n.check=this.#o.bind(this,t),n.ast=t,n}evaluate(e,t){return this.#a(this.#i.parse(e),t)}#a(e,t){return e.checkedType?e.evaluate(this.#t,e,new Fn(this.#e,t)):(this.#s.check(e,t=new Fn(this.#e,t)),e.evaluate(this.#t,e,t))}},Td=class extends Bn{constructor(e){super(e),this.createError=L}#e(e){if(e instanceof Map)return e.entries().next().value;for(let t in e)return[t,e[t]]}debugRuntimeType(e,t){return t?.hasDynType===!1?t:this.debugTypeDeep(e)}debugTypeDeep(e){let t=this.debugType(e);switch(t.kind){case"list":{let n=e instanceof Array?e[0]:e.values().next().value;return n===void 0?t:this.registry.getListType(this.debugTypeDeep(n))}case"map":{let n=this.#e(e);return n?this.registry.getMapType(t.keyType.hasDynType?this.debugTypeDeep(n[0]):t.keyType,t.valueType.hasDynType?this.debugTypeDeep(n[1]):t.valueType):t}default:return t}}tryEval(e,t){try{let n=this.run(e,t);return n instanceof Promise?n.catch(s=>s):n}catch(n){return n}}run(e,t){return e.evaluate(this,e,t)}},Od=new Vn({unlistedVariablesAreDyn:!0})});function Yv(r){if(r===null)return"null";if(typeof r=="boolean"||typeof r=="bigint")return String(r);if(typeof r=="string")return sD(r);if(r instanceof Uint8Array)return Hv(r);if(r instanceof ge)return`${r.value}u`;if(r instanceof Ie)return r.hasValue()?`optional.of(${Yv(r.value())})`:"optional.none()";if(typeof r=="number")return r%1===0?`${r}.0`:r.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:9});if(typeof r=="object"){let e=Object.keys(r);if(e.every(t=>/^\d+$/.test(t))){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=r[n];return Hv(t)}}return String(r)}function Le(r){let{op:e,args:t}=r;switch(e){case"value":return Yv(t);case"id":return t;case"||":case"&&":case"==":case"!=":case"<":case"<=":case">":case">=":case"in":case"+":case"-":case"*":case"/":case"%":return`${Ct(t[0],e)} ${e} ${Ct(t[1],e)}`;case"!_":return`!${Ct(t,e)}`;case"-_":return["+","-","*","/","%"].includes(t.op)?`-(${Le(t)})`:`-${Le(t)}`;case".":return`${Ct(t[0],e)}.${t[1]}`;case".?":return`${Ct(t[0],e)}.?${t[1]}`;case"[]":return`${Ct(t[0],e)}[${Le(t[1])}]`;case"[?]":return`${Ct(t[0],e)}[?${Le(t[1])}]`;case"call":return`${t[0]}(${t[1].map(Le).join(", ")})`;case"rcall":return`${Ct(t[1],e)}.${t[0]}(${t[2].map(Le).join(", ")})`;case"list":return`[${t.map(Le).join(", ")}]`;case"map":return`{${t.map(([n,s])=>`${Le(n)}: ${Le(s)}`).join(", ")}}`;case"?:":return`${Ct(t[0],e)} ? ${Ct(t[1],e)} : ${Le(t[2])}`;default:throw new Error(`Unknown AST operation: ${e}`)}}function sD(r){let e=r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/[\b]/g,"\\b").replace(/\v/g,"\\v"),t="";for(let n=0;n<e.length;n++){let s=e.charCodeAt(n);s<32||s>126?t+=s<=65535?`\\u${s.toString(16).padStart(4,"0")}`:`\\U${s.toString(16).padStart(8,"0")}`:t+=e[n]}return`"${t}"`}function Hv(r){let e='b"';for(let t of r)t===92?e+="\\\\":t===34?e+='\\"':t===10?e+="\\n":t===13?e+="\\r":t===9?e+="\\t":t>=32&&t<=126?e+=String.fromCharCode(t):e+=`\\x${t.toString(16).padStart(2,"0")}`;return`${e}"`}function iD(r,e){let t=r.op,n=Gv[e]||0,s=Gv[t]||0;return t==="value"||t==="id"||t==="call"||t==="rcall"||t==="list"||t==="map"||(e==="*"||e==="/"||e==="%")&&t==="-_"||e==="*"&&t==="*"&&r.args[0].op==="-_"||(t==="."||t==="[]"||t===".?"||t==="[?]")&&(e==="."||e==="[]"||e===".?"||e==="[?]"||e==="rcall")?!1:e==="?:"?t==="?:":e==="!_"||e==="-_"?s<n:!!(e==="/"&&(t==="*"||t==="+"||t==="-")||t==="/"&&e!==void 0||(e==="*"||e==="/")&&["+","-","*","/"].includes(t)||s<n||s===n&&(e==="/"||e==="%")&&(t==="/"||t==="%"))}function Ct(r,e){return iD(r,e)?`(${Le(r)})`:Le(r)}var Gv,Zv=Me(()=>{"use strict";xn();di();Gv={"?:":1,"||":2,"&&":3,"==":4,"!=":4,"<":5,"<=":5,">":5,">=":5,in:5,"+":6,"-":6,"-_":6,"*":7,"/":7,"%":7,"!_":8,".":9,".?":9,"[]":9,"[?]":9,call:9,rcall:9}});var Jv={};fw(Jv,{Environment:()=>Vn,EvaluationError:()=>Kt,Optional:()=>Ie,ParseError:()=>Br,TypeError:()=>Vr,check:()=>Ad,default:()=>oD,evaluate:()=>Id,parse:()=>Nd,serialize:()=>Le});var oD,Wv=Me(()=>{"use strict";gt();Kv();Zv();di();oD={parse:Nd,evaluate:Id,check:Ad,Environment:Vn,ParseError:Br,EvaluationError:Kt,TypeError:Vr,serialize:Le,Optional:Ie}});var _i=w(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.ExprEvalError=_e.EXPR_LIMITS=void 0;_e.percentile=nb;_e.compileExpr=hD;_e.makeFacts=mD;_e.evalExpr=yD;var aD=(Wv(),dw(Jv)),cD=jt();_e.EXPR_LIMITS={maxAstNodes:1e3,maxDepth:32,maxElementReads:1e6,maxSteps:5e6};var eb={pack:[["run","map"],["tests","list<map>"],["totals","map<string, int>"],["failures","list<map>"]],test:[["test","map"],["file","dyn"],["run","map"]]},Lt=class extends Error{code="verdict.expr_error"};_e.ExprEvalError=Lt;function tb(r,e){if(e.every(t=>typeof t=="bigint"))return{ints:e};if(e.every(t=>typeof t=="number"))return{doubles:e};throw e.every(t=>typeof t=="bigint"||typeof t=="number")?new Error(`${r}() mixes int and double values; convert with double()`):new Error(`${r}() needs a list of numbers`)}function lD(r){let e=tb("sum",r);return"ints"in e?e.ints.reduce((t,n)=>t+n,0n):e.doubles.reduce((t,n)=>t+n,0)}function rb(r,e){let t=tb(r,e),n="ints"in t?t.ints.map(Number):t.doubles;if(n.length===0)throw new Error(`${r}() of an empty list`);return n}function uD(r){let e=rb("mean",r);return e.reduce((t,n)=>t+n,0)/e.length}function nb(r,e){let t=[...rb("percentile",r)].sort((i,o)=>i-o),n=Number(e);if(!(n>=0&&n<=100))throw new Error(`percentile() needs p in [0, 100], got ${n}`);let s=Math.max(1,Math.ceil(n/100*t.length));return t[s-1]}function Xv(r){let e=new aD.Environment({limits:{maxAstNodes:_e.EXPR_LIMITS.maxAstNodes,maxDepth:_e.EXPR_LIMITS.maxDepth}});for(let[t,n]of eb[r])e.registerVariable(t,n);for(let t of["int","double"]){e.registerFunction(`sum(list<${t}>): ${t}`,lD),e.registerFunction(`mean(list<${t}>): double`,uD);for(let n of["int","double"])e.registerFunction(`percentile(list<${t}>, ${n}): double`,nb)}return e}var fD={pack:Xv("pack"),test:Xv("test")},Ia=null;function dD(r){if(Object.hasOwn(r,"run"))return;let e=r.run;r.run=function(t,n){if(Ia&&--Ia.steps<0)throw new Lt(`evaluation cost limit exceeded (${_e.EXPR_LIMITS.maxSteps} steps)`);return e.call(this,t,n)}}function pD(r){return eb[r].map(([e])=>e).join(", ")}function Qv(r,e,t,n){let s=typeof t?.summary=="string"?t.summary:String(t?.message??t).split(`
|
|
158
|
-
`)[0],i=typeof t?.range?.start=="number"?` at column ${t.range.start+1}`:"",o=(0,
|
|
159
|
-
`)[0];throw new Lt(`${s} in "${r.src}"`)}finally{Ia=null}if(e.meter.steps<0)throw new Lt(`evaluation cost limit exceeded (${_e.EXPR_LIMITS.maxSteps} steps)`);return Pd(t)}});var kd=w(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.parseSemver=_D;Aa.compareSemver=vD;var gD=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;function _D(r){if(typeof r!="string")return null;let e=gD.exec(r.trim());return e?{core:[Number(e[1]),Number(e[2]),Number(e[3])],pre:e[4]?e[4].split("."):[]}:null}function vD(r,e){for(let t=0;t<3;t++)if(r.core[t]!==e.core[t])return r.core[t]-e.core[t];if(r.pre.length===0||e.pre.length===0)return e.pre.length-r.pre.length;for(let t=0;t<Math.max(r.pre.length,e.pre.length);t++){let n=r.pre[t],s=e.pre[t];if(n===void 0)return-1;if(s===void 0)return 1;let i=/^\d+$/.test(n),o=/^\d+$/.test(s);if(i&&o&&Number(n)!==Number(s))return Number(n)-Number(s);if(i!==o)return i?-1:1;if(n!==s)return n<s?-1:1}return 0}});var gr=w(oe=>{"use strict";var bD=oe&&oe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oe,"__esModule",{value:!0});oe.CORE_CATALOG=oe.CatalogLoadError=oe.STRING_TYPES=oe.INTEGER_TYPES=oe.OPS_BY_TYPE=oe.DEFAULT_OVER=oe.CATALOG_SNAPSHOT_PATH=oe.CORE_CATALOG_ID=void 0;oe.own=OD;oe.lintCatalog=ab;oe.loadCatalog=ND;var wD=V("crypto"),He=jt(),Ld=bD(ev()),ED=Cs(),sb=pa(),$D=ht(),SD=_i(),TD=kd();oe.CORE_CATALOG_ID="evidence-core";oe.CATALOG_SNAPSHOT_PATH="meta/metrics-catalog.yaml";oe.DEFAULT_OVER="tests/*/result.yaml";oe.OPS_BY_TYPE={count:["equals","min","max","range","in"],integer:["equals","min","max","range","in"],ms:["equals","min","max","range","in"],bytes:["equals","min","max","range","in"],currency:["equals","min","max","range","in"],ratio:["min","max","range"],percentage:["min","max","range"],decimal:["min","max","range"],string:["equals","in"],enum:["equals","in"]};oe.INTEGER_TYPES=new Set(["count","integer","bytes"]);oe.STRING_TYPES=new Set(["string","enum"]);function OD(r,e){return r!=null&&typeof r=="object"&&Object.hasOwn(r,e)?r[e]:void 0}var Pa=class extends Error{diagnostics;code="USAGE";constructor(e,t){super(e),this.diagnostics=t}};oe.CatalogLoadError=Pa;function ib(r){return(0,wD.createHash)("sha256").update(r,"utf8").digest("hex")}function Cd(r,e,t,n,s={}){if(typeof r!="string")return;let i=(0,SD.compileExpr)(r,e);if(!("run"in i)){n.push({...i,code:"catalog.expr",location:t});return}if(s.bool&&i.type!=="bool"&&i.type!=="dyn"){n.push((0,He.err)("catalog.expr",t,`where must be a bool, but "${r}" is ${i.type}`));return}return i}function ob(r,e,t,n){let s=[],i=(0,ED.loadToolSchema)("metrics-catalog");if(!i(r)){for(let c of i.errors??[])c.keyword!=="oneOf"&&s.push((0,He.err)("catalog.schema",`${n}#${c.instancePath}`,`${c.instancePath||"/"} ${c.message??"schema violation"}`));return{catalog:null,diagnostics:s}}let o=r,a={};for(let[c,l]of Object.entries(o.metrics)){let h=`${n}#/metrics/${c}`;if(!t&&ID.has(c)){s.push((0,He.err)("catalog.reserved_name",h,`"${c}" is a built-in metric name and cannot be redefined by a producer catalog`));continue}let f,d=l.verify;if(d==="stored")f={kind:"stored"},t&&s.push((0,He.err)("catalog.schema",`${h}/verify`,`built-in metric "${c}" must be recomputed, not stored`));else if("file"in d)(0,sb.isContained)(d.file)?f={kind:"file",file:d.file,path:d.path}:s.push((0,He.err)("catalog.path_escape",`${h}/verify/file`,`file "${d.file}" escapes the pack`));else if("aggregate"in d){let y=d.over??oe.DEFAULT_OVER;(0,sb.isContained)(y.replace("*","x"))||s.push((0,He.err)("catalog.path_escape",`${h}/verify/over`,`over "${y}" escapes the pack`));let u=Cd(d.value,"test",`${h}/verify/value`,s),m=Cd(d.where,"test",`${h}/verify/where`,s,{bool:!0});d.aggregate!=="count"&&d.path===void 0&&d.value===void 0&&s.push((0,He.err)("catalog.schema",`${h}/verify`,`aggregate ${d.aggregate} needs a "path" or a "value" to fold`)),f={kind:"aggregate",aggregate:d.aggregate,over:y,path:d.path,value:u,where:m}}else{let y=Cd(d.expr,"pack",`${h}/verify/expr`,s);y&&(f={kind:"expr",expr:y})}let p=l.merge??"none";p==="recompute"&&f&&(f.kind==="stored"||f.kind==="file")&&s.push((0,He.err)("catalog.merge_rule",`${h}/merge`,`merge: recompute needs an aggregate or expr verify; "${c}" is ${f.kind}`)),l.per_test===!0&&f&&f.kind!=="aggregate"&&f.kind!=="expr"&&s.push((0,He.err)("catalog.schema",`${h}/per_test`,`per_test needs an aggregate or expr verify; "${c}" is ${f.kind}`)),Array.isArray(l.range)&&l.range[0]>l.range[1]&&s.push((0,He.err)("catalog.schema",`${h}/range`,`range [${l.range[0]}, ${l.range[1]}] has lo > hi`)),l.min_producer!==void 0&&!(0,TD.parseSemver)(l.min_producer)&&s.push((0,He.err)("catalog.schema",`${h}/min_producer`,`min_producer "${l.min_producer}" is not a semantic version`)),l.values!==void 0&&l.type!=="enum"&&s.push((0,He.err)("catalog.schema",`${h}/values`,"values is only allowed on an enum metric")),f&&(a[c]={name:c,type:l.type,unit:l.unit,label:l.label,description:l.description,range:l.range,values:l.values,per_test:l.per_test===!0,verify:f,merge:p,...l.min_producer!==void 0?{min_producer:l.min_producer}:{}})}return s.length>0?{catalog:null,diagnostics:s}:{catalog:{id:o.catalog,version:o.version,sha256:e,builtin:t,metrics:a},diagnostics:[]}}function ab(r,e={}){let t=e.location??"catalog",n;try{n=(0,$D.parseYaml)(r)}catch(s){return{catalog:null,diagnostics:[(0,He.err)("catalog.parse",t,`catalog is not valid YAML: ${s?.message??s}`)]}}return ob(n,ib(r),!1,t)}function ND(r){let{catalog:e,diagnostics:t}=ab(r);if(!e)throw new Pa(`invalid metric catalog: ${t.map(n=>n.message).join("; ")}`,t);return e}var ID=new Set(Object.keys(Ld.default.metrics));function AD(){let r=JSON.stringify(Ld.default),{catalog:e,diagnostics:t}=ob(Ld.default,ib(r),!0,"evidence-core");if(!e)throw new Error(`built-in catalog is invalid: ${t.map(n=>n.message).join("; ")}`);return e}oe.CORE_CATALOG=AD()});var cb=w(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.runCatalogChecks=kD;var PD=V("crypto"),ka=Mt(),Ca=jt(),zn=gr();async function kD(r){let e=r.run?.metrics_catalog,t=await r.container.readFileBytes(zn.CATALOG_SNAPSHOT_PATH);if(e==null||typeof e!="object")return t==null?[]:[(0,Ca.warn)(ka.Codes.CATALOG_UNREFERENCED,zn.CATALOG_SNAPSHOT_PATH,`${zn.CATALOG_SNAPSHOT_PATH} is present but run.yaml has no metrics_catalog block`)];if(t==null)return[(0,Ca.err)(ka.Codes.CATALOG_MISSING,"run.yaml#/metrics_catalog",`run.yaml names catalog "${e.id}" but ${zn.CATALOG_SNAPSHOT_PATH} is missing`)];let n=[],s=(0,PD.createHash)("sha256").update(t).digest("hex");typeof e.sha256=="string"&&/^[0-9a-f]{64}$/.test(e.sha256)&&e.sha256!==s&&n.push((0,Ca.err)(ka.Codes.CATALOG_HASH_MISMATCH,"run.yaml#/metrics_catalog/sha256",`metrics_catalog.sha256 ${e.sha256} does not match the snapshot hash ${s}`));let{catalog:i,diagnostics:o}=(0,zn.lintCatalog)(t.toString("utf8"),{location:zn.CATALOG_SNAPSHOT_PATH});return n.push(...o),i&&(i.id!==e.id||String(i.version)!==String(e.version))&&n.push((0,Ca.err)(ka.Codes.CATALOG_IDENTITY_MISMATCH,"run.yaml#/metrics_catalog",`run.yaml names catalog ${e.id} v${e.version} but the snapshot is ${i.id} v${i.version}`)),n}});var lb=w(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.runL1Checks=LD;var te=Mt(),re=jt(),CD=Cs(),La=ht(),qd=pa();async function LD(r){let e=[],t=r.status==="finalized",{logsMeta:n,video:s,failure:i,failureIndex:o}=(0,CD.loadL1Schemas)(r.version);t&&!await r.container.isDir("coverage")&&e.push((0,re.err)(te.Codes.L1_COVERAGE_MISSING,"coverage/","L1 requires a global coverage/ directory"));let a=new Set;for(let{testId:c,result:l}of r.tests){let h=`tests/${c}`;await DD(r.container,e,h,t,n),await qD(r.container,e,h,t,l),await xD(r.container,e,h,s),await jD(r.container,e,h,t,l,i,a)}return await RD(r.container,e,t,a,o),e}async function DD(r,e,t,n,s){let i=`${t}/logs`;if(!await r.isDir(i)){n&&e.push((0,re.err)(te.Codes.L1_LOGS_MISSING,`${i}/`,"L1 requires a logs/ directory"));return}let o=`${i}/meta.yaml`,a=await r.readText(o);if(a==null){n&&e.push((0,re.err)(te.Codes.L1_LOGS_META_MISSING,o,"logs/ is present but logs/meta.yaml is missing"));return}let c;try{c=(0,La.parseYaml)(a)}catch(l){e.push((0,re.err)(te.Codes.L1_LOGS_META_INVALID,o,`logs/meta.yaml is not valid YAML: ${l?.message??l}`));return}if(!s(c)){for(let l of s.errors??[])e.push((0,re.err)(te.Codes.L1_LOGS_META_INVALID,`${o}${l.instancePath||""}`,`${l.instancePath||"/"} ${l.message??"schema violation"}`));return}for(let l of c.logs){let h=l?.file;if(typeof h=="string"){if(!(0,qd.isContained)(h)){e.push((0,re.err)(te.Codes.L1_LOG_PATH_ESCAPE,o,`declared log file "${h}" escapes logs/`));continue}await r.exists(`${i}/${h}`)||e.push((0,re.err)(te.Codes.L1_LOG_FILE_MISSING,`${i}/${h}`,`declared log file "${h}" does not exist`))}}}async function qD(r,e,t,n,s){let i=`${t}/steps`;if(!await r.isDir(i)){n&&e.push((0,re.err)(te.Codes.L1_STEPS_MISSING,`${i}/`,"L1 requires a steps/ directory"));return}let o=Array.isArray(s?.steps)?s.steps:[],a=new Set(o.map(c=>`${c?.ordinal}-${c?.id}`));for(let c of await r.listDir(i)){if(!c.isDir)continue;let l=c.name.match(/^(\d+)-(.+)$/);if(!l){e.push((0,re.err)(te.Codes.L1_STEPS_MALFORMED,`${i}/${c.name}`,`step folder "${c.name}" is not <ordinal>-<id>`));continue}if(!a.has(`${Number(l[1])}-${l[2]}`)){e.push((0,re.err)(te.Codes.L1_STEPS_UNMATCHED,`${i}/${c.name}`,`step folder "${c.name}" matches no result.yaml step`));continue}(await r.listDir(`${i}/${c.name}`)).some(d=>!d.isDir&&/^screenshot\.[^.]+$/i.test(d.name))||e.push((0,re.warn)(te.Codes.L1_STEPS_SCREENSHOT_MISSING,`${i}/${c.name}`,`step folder "${c.name}" has no screenshot.<ext>`))}}function MD(r){let e=[],t=(s,i)=>{typeof i=="string"&&i.length>0&&e.push({pointer:s,ref:i})};t("/repro/definition",r?.repro?.definition),t("/repro/resolved",r?.repro?.resolved),t("/page_state/dom",r?.page_state?.dom),t("/page_state/a11y",r?.page_state?.a11y),t("/page_state/screenshot",r?.page_state?.screenshot),t("/console_at_failure/ref",r?.console_at_failure?.ref),t("/network_at_failure/ref",r?.network_at_failure?.ref),t("/triage/suggested_fix/patch",r?.triage?.suggested_fix?.patch);let n=r?.triage?.rca?.evidence;return Array.isArray(n)&&n.forEach((s,i)=>t(`/triage/rca/evidence/${i}`,s)),e}async function jD(r,e,t,n,s,i,o){let a=`${t}/steps`,c=Array.isArray(s?.steps)?s.steps:[],l=new Map(c.map(h=>[`${h?.ordinal}-${h?.id}`,h]));if(await r.isDir(a))for(let h of await r.listDir(a)){if(!h.isDir)continue;let f=h.name.match(/^(\d+)-(.+)$/);if(!f)continue;let d=`${a}/${h.name}/failure.yaml`,p=await r.readText(d);if(p==null)continue;o.add(d);let y;try{y=(0,La.parseYaml)(p)}catch(v){e.push((0,re.err)(te.Codes.L1_FAILURE_INVALID,d,`failure.yaml is not valid YAML: ${v?.message??v}`));continue}if(!i(y)){for(let v of i.errors??[])e.push((0,re.err)(te.Codes.L1_FAILURE_INVALID,`${d}${v.instancePath||""}`,`${v.instancePath||"/"} ${v.message??"schema violation"}`));continue}let u=y,m=`${Number(f[1])}-${f[2]}`,_=l.get(m);u.step!==f[2]||_===void 0?e.push((0,re.err)(te.Codes.L1_FAILURE_UNMATCHED,d,`failure record step "${u.step}" does not match a result.yaml step for folder "${h.name}"`)):typeof _?.status=="string"&&_.status!==u.status&&e.push((0,re.warn)(te.Codes.L1_FAILURE_STATUS_DISAGREES,d,`failure record status "${u.status}" disagrees with result.yaml step status "${_.status}"`));for(let{pointer:v,ref:g}of MD(u))(0,qd.isContained)(g)?await r.exists(`${t}/${g}`)||e.push((0,re.err)(te.Codes.L1_FAILURE_REF_MISSING,`${d}#${v}`,`referenced file "${g}" does not exist`)):e.push((0,re.err)(te.Codes.L1_FAILURE_REF_ESCAPE,`${d}#${v}`,`referenced file "${g}" escapes the test directory`))}if(n)for(let h of c){if(h?.status!=="failed"&&h?.status!=="broken"||typeof h?.ordinal!="number"||typeof h?.id!="string")continue;let f=`${a}/${h.ordinal}-${h.id}/failure.yaml`;o.has(f)||e.push((0,re.warn)(te.Codes.L1_FAILURE_MISSING,f,`step "${h.id}" is "${h.status}" but has no failure.yaml`))}}async function RD(r,e,t,n,s){let i="failure.yaml",o=await r.readText(i);if(o==null){t&&e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_MISSING,i,"L1 requires the finalize-generated failure.yaml index at the pack root"));return}let a;try{a=(0,La.parseYaml)(o)}catch(h){e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_INVALID,i,`failure.yaml is not valid YAML: ${h?.message??h}`));return}if(!s(a)){for(let h of s.errors??[])e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_INVALID,`${i}${h.instancePath||""}`,`${h.instancePath||"/"} ${h.message??"schema violation"}`));return}let c=new Set,l=a.failures;for(let h=0;h<l.length;h++){let f=l[h],d=`tests/${f.test}/steps/${f.ordinal}-${f.step}/failure.yaml`;f.path!==d&&e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_INVALID,`${i}#/failures/${h}/path`,`path "${f.path}" does not agree with its row (expected "${d}")`)),c.add(f.path),(!(0,qd.isContained)(f.path)||!await r.exists(f.path))&&e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_DANGLING,`${i}#/failures/${h}/path`,`indexed record "${f.path}" does not exist`))}for(let h of n)c.has(h)||e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_INCOMPLETE,i,`step record "${h}" exists but is not indexed`))}async function xD(r,e,t,n){let s=`${t}/video.yaml`,i=await r.readText(s);if(i==null)return;let o;try{o=(0,La.parseYaml)(i)}catch(a){e.push((0,re.err)(te.Codes.L1_VIDEO_INVALID,s,`video.yaml is not valid YAML: ${a?.message??a}`));return}if(!n(o))for(let a of n.errors??[])e.push((0,re.err)(te.Codes.L1_VIDEO_INVALID,`${s}${a.instancePath||""}`,`${a.instancePath||"/"} ${a.message??"schema violation"}`))}});var Da=w(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.validate=KD;var Ge=Mt(),Kn=jt(),FD=es(),UD=Cs(),ub=ht(),BD=cb(),VD=pa(),zD=lb();async function KD(r,e={}){let t=e.profile??Ge.DEFAULT_PROFILE,n=(0,Ge.profileChain)(t);if(!n){let y=new Error(`unknown profile "${t}"`);throw y.code="USAGE",y}let s=[],i=null,o=()=>({valid:!s.some(y=>y.severity==="error"),profile:t,version:Ge.CONTRACT_VERSION,status:i,diagnostics:s}),a=await(0,FD.openContainer)(r),c=await a.readManifest();if(c==null)return s.push((0,Kn.err)(Ge.Codes.MANIFEST_MISSING,"run.yaml","no top-level run.yaml \u2014 not a valid evidence pack")),o();let l;try{l=(0,ub.parseYaml)(c)}catch(y){return s.push((0,Kn.err)(Ge.Codes.MANIFEST_PARSE,"run.yaml",`run.yaml is not valid YAML: ${y?.message??y}`)),o()}i=typeof l?.status=="string"?l.status:null;let h=fb(l,"run.yaml");if(h)return s.push(h),o();let f=(0,UD.loadSchemas)(Ge.CONTRACT_VERSION,"L0");s.push(...db(f.run,l,"run.yaml"));let d=await a.listTestIds(),p=[];for(let y of d){let u=`tests/${y}/result.yaml`,m=await a.readResult(y);if(m==null){s.push((0,Kn.err)(Ge.Codes.RESULT_MISSING,u,`missing result.yaml for test "${y}"`));continue}let _;try{_=(0,ub.parseYaml)(m)}catch(g){s.push((0,Kn.err)(Ge.Codes.RESULT_PARSE,u,`result.yaml is not valid YAML: ${g?.message??g}`));continue}let v=fb(_,u);if(v){s.push(v);continue}s.push(...db(f.result,_,u)),p.push({testId:y,result:_})}return s.push(...await(0,VD.runCrossChecks)({run:l,tests:p,container:a})),s.push(...await(0,BD.runCatalogChecks)({run:l,container:a})),n.includes("L1")&&s.push(...await(0,zD.runL1Checks)({container:a,status:i,tests:p,version:Ge.CONTRACT_VERSION})),o()}function fb(r,e){let t=r?.evidence;return t==null?null:t!==Ge.CONTRACT_VERSION?(0,Kn.err)(Ge.Codes.VERSION_UNSUPPORTED,e,`pack declares evidence ${JSON.stringify(t)}; this validator implements ${Ge.CONTRACT_VERSION} \u2014 cannot validate`):null}function db(r,e,t){return r(e)?[]:(r.errors??[]).map(n=>(0,Kn.err)(Ge.Codes.SCHEMA,`${t}${n.instancePath||""}`,`${n.instancePath||"/"} ${n.message??"schema violation"}`))}});var pb=w(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.retryTransient=YD;var HD=new Set(["EPERM","EACCES","EBUSY"]),GD=r=>new Promise(e=>setTimeout(e,r));async function YD(r,e={}){let t=e.attempts??10,n=e.delayMs??100,s=e.sleep??GD;for(let i=1;;i++)try{return await r()}catch(o){let a=o?.code;if(!a||!HD.has(a)||i>=t)throw o;await s(Math.min(i*n,1e3))}}});var xd=w(it=>{"use strict";var ZD=it&&it.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),JD=it&&it.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),WD=it&&it.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&ZD(t,e,n[s]);return JD(t,e),t}})(),XD=it&&it.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(it,"__esModule",{value:!0});it.finalize=eq;it.sweepIncomplete=nq;var fe=V("fs"),De=WD(V("path")),hb=V("crypto"),QD=XD(tc()),Yr=ht(),qa=pb();async function eq(r,e){let t=await fe.promises.stat(r).catch(()=>null);if(!t||!t.isDirectory()){let E=new Error("finalize requires the live <name>.evidence/ directory, not a sealed zip");throw E.code="USAGE",E}let n=De.join(r,"tests"),s=(await fe.promises.readdir(n,{withFileTypes:!0}).catch(()=>[])).filter(E=>E.isDirectory()).map(E=>E.name).sort(),i={tests:0,passed:0,failed:0,broken:0,skipped:0},o=[];for(let E of s){let $=De.join(n,E,"result.yaml"),S=await fe.promises.readFile($,"utf8"),O=(0,Yr.parseYaml)(S);i.tests++;let A=O?.status;(A==="passed"||A==="failed"||A==="broken"||A==="skipped")&&i[A]++;let x=O?.definition?.path;if(typeof x=="string"&&x.length>0){let j=await fe.promises.readFile(De.join(n,E,x)),B=`sha256:${(0,hb.createHash)("sha256").update(j).digest("hex")}`,de=(0,Yr.parseDoc)(S);de.setIn(["definition","sha256"],B),await fe.promises.writeFile($,(0,Yr.stringifyDoc)(de),"utf8")}o.push(...await tq(n,E))}o.sort((E,$)=>E.test===$.test?E.ordinal-$.ordinal:E.test<$.test?-1:1);let a=o.filter(E=>!E.triage_status||E.triage_status==="untriaged").length,c={generated:e.endedAt,totals:{failures:o.length,triaged:o.length-a,untriaged:a},failures:o};await fe.promises.writeFile(De.join(r,"failure.yaml"),(0,Yr.stringifyYaml)(c),"utf8");let l=De.join(r,"run.yaml"),h=(0,Yr.parseDoc)(await fe.promises.readFile(l,"utf8"));h.setIn(["status"],"finalized"),h.setIn(["ended"],e.endedAt),h.setIn(["totals"],i),await fe.promises.writeFile(l,(0,Yr.stringifyDoc)(h),"utf8");let f=new QD.default;await mb(f,r,"");let d=f.toBuffer(),p=De.dirname(r),y=De.basename(r),u=r,m=(0,hb.randomBytes)(6).toString("hex"),_=De.join(p,`${y}.tmp-${m}`),v=De.join(p,`${y}.bak-${m}`),g=await fe.promises.open(_,"w");try{await g.writeFile(d),await g.sync()}finally{await g.close()}let b={attempts:20};await(0,qa.retryTransient)(()=>fe.promises.rename(r,v),b),await(0,qa.retryTransient)(()=>fe.promises.rename(_,u),b),await rq(p);try{await fe.promises.rm(v,{recursive:!0,force:!0,maxRetries:10,retryDelay:100})}catch{}return{totals:i,sealedPath:u}}async function tq(r,e){let t=[],n=De.join(r,e,"steps"),s=(await fe.promises.readdir(n,{withFileTypes:!0}).catch(()=>[])).filter(i=>i.isDirectory()).map(i=>i.name);for(let i of s){let o=i.match(/^(\d+)-(.+)$/);if(!o)continue;let a=`tests/${e}/steps/${i}/failure.yaml`,c=await fe.promises.readFile(De.join(n,i,"failure.yaml"),"utf8").catch(()=>null);if(c==null)continue;let l;try{l=(0,Yr.parseYaml)(c)}catch(d){throw new Error(`finalize: ${a} is not valid YAML: ${d?.message??d}`)}if(typeof l?.status!="string"||l.status.length===0)throw new Error(`finalize: ${a} has no string \`status\` \u2014 cannot index it`);let h={test:e,ordinal:Number(o[1]),step:o[2],status:l.status,path:a};typeof l?.title=="string"&&l.title.length>0&&(h.title=l.title);let f=l?.triage?.status;typeof f=="string"&&f.length>0&&(h.triage_status=f),t.push(h)}return t}async function rq(r){try{let e=await fe.promises.open(r,"r");try{await e.sync()}finally{await e.close()}}catch{}}async function nq(r){let e=[],t=[],n;try{n=await fe.promises.readdir(r)}catch{return{restored:e,removed:t}}for(let s of n){let i=s.match(/^(.+\.evidence)\.bak-[0-9a-f]+$/);if(!i)continue;let o=i[1],a=De.join(r,o),c=De.join(r,s);await sq(a)?(await fe.promises.rm(c,{recursive:!0,force:!0,maxRetries:10,retryDelay:100}),t.push(s)):(await(0,qa.retryTransient)(()=>fe.promises.rename(c,a)),e.push(o))}for(let s of n)/\.evidence\.tmp-[0-9a-f]+$/.test(s)&&(await(0,qa.retryTransient)(()=>fe.promises.rm(De.join(r,s),{force:!0})),t.push(s));return{restored:e,removed:t}}async function sq(r){try{return await fe.promises.stat(r),!0}catch{return!1}}async function mb(r,e,t){let n=await fe.promises.readdir(e,{withFileTypes:!0});for(let s of n){let i=De.join(e,s.name),o=t?`${t}/${s.name}`:s.name;s.isDirectory()?await mb(r,i,o):r.addFile(o,await fe.promises.readFile(i))}}});var yb=w((oU,iq)=>{iq.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/merge-rules.schema.json",title:"merge-rules.yaml",description:"The declarative policy passed to `evidence merge` (--rules). TOOL INPUT, not pack contract \u2014 it lives beside the versioned 0.1/ tree because it configures a command rather than shaping a pack. Fixed knobs gate packs and set the default collision policy; the flat `rules` list adds generic {file, key, must, on_violation} predicates. Scope is implied by `file`: run.yaml rules gate PACKS (compared across all eligible packs), result.yaml rules resolve COLLISIONS (compared between the two colliding tests). Unlike pack declarations, unknown keys are rejected \u2014 a typo'd knob must fail loudly. See decision 0045.",type:"object",properties:{packs:{type:"object",properties:{require_status:{description:"Run status every input pack must have. Default finalized \u2014 shards arrive sealed.",enum:["finalized","running","any"]},require_valid:{description:"Validation profile every input pack must pass (any error diagnostic fails the gate), or off.",enum:["L0","L1","off"]},on_ineligible:{description:"What an ineligible pack does to the merge: abort the whole merge, or skip the pack (recorded in the report).",enum:["abort","skip"]}},additionalProperties:!1},tests:{type:"object",properties:{on_collision:{description:"Default policy when two packs carry the same test id and no result.yaml rule fires. discard tombstones the id.",enum:["error","prefer_first","prefer_latest","discard"]},identity:{description:"Optional identity policy (decision 0046). Runs only when no result.yaml rule fired, so guard rules still abort first. `keys` name what makes two copies of a test id THE SAME test \u2014 the caller's vocabulary; evidence-cli never interprets a key. Same identity resolves by on_same (nest keeps every copy: latest canonical, superseded archived as 1/, 2/ \u2026); different identity by on_different (split allocates a suffixed sibling folder).",type:"object",required:["keys","on_same","on_different"],properties:{keys:{description:"Dot-paths into the parsed result.yaml, compared by canonical deep equality. Absent==absent counts as same, matching the generic rules.",type:"array",minItems:1,items:{type:"string",minLength:1}},on_same:{enum:["nest","prefer_latest","prefer_first","error"]},on_different:{enum:["split","error"]}},additionalProperties:!1}},additionalProperties:!1},rules:{description:"Generic key predicates, evaluated in file order. `must: same` anchors on the first eligible pack; `must: different` keeps the first occurrence. Absent==absent counts as same; absent vs present counts as different.",type:"array",items:{type:"object",required:["file","key","must","on_violation"],properties:{file:{enum:["run.yaml","result.yaml"]},key:{description:"Dot-path into the parsed YAML (e.g. environment.producer.name).",type:"string",minLength:1},must:{enum:["same","different"]},on_violation:{description:"Action on violation. Scope-checked by the conditional below: pack rules (file: run.yaml) take abort|skip; collision rules (file: result.yaml) take error|prefer_first|prefer_latest|discard.",type:"string"}},if:{properties:{file:{const:"run.yaml"}}},then:{properties:{on_violation:{enum:["abort","skip"]}}},else:{properties:{on_violation:{enum:["error","prefer_first","prefer_latest","discard"]}}},additionalProperties:!1}}},additionalProperties:!1}});var Hn=w(Ye=>{"use strict";var Ud=Ye&&Ye.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.DEFAULT_RULES=void 0;Ye.loadRules=fq;Ye.getKey=dq;Ye.deepEqual=vi;Ye.violates=pq;var oq=V("fs"),aq=Ud(uu()),cq=Ud(bu()),lq=Ud(yb()),uq=ht();Ye.DEFAULT_RULES={packs:{require_status:"finalized",require_valid:"L0",on_ineligible:"abort"},tests:{on_collision:"error"},rules:[]};var _b=new aq.default({allErrors:!0,strict:!1});(0,cq.default)(_b);var gb=_b.compile(lq.default);function Fd(r){let e=new Error(r);throw e.code="USAGE",e}async function fq(r){if(!r)return Ye.DEFAULT_RULES;let e;try{e=await oq.promises.readFile(r,"utf8")}catch{Fd(`cannot read merge-rules file "${r}"`)}let t;try{t=(0,uq.parseYaml)(e)}catch(n){Fd(`merge-rules file is not valid YAML: ${n?.message??n}`)}if(!gb(t)){let n=gb.errors?.[0];Fd(`merge-rules.yaml${n?.instancePath??""}: ${n?.message??"schema violation"}`)}return{packs:{...Ye.DEFAULT_RULES.packs,...t.packs},tests:{...Ye.DEFAULT_RULES.tests,...t.tests},rules:t.rules??[]}}function dq(r,e){return e.split(".").reduce((t,n)=>{if(!(t==null||typeof t!="object"||!Object.hasOwn(t,n)))return t[n]},r)}function vi(r,e){if(Object.is(r,e))return!0;if(Array.isArray(r)&&Array.isArray(e))return r.length===e.length&&r.every((t,n)=>vi(t,e[n]));if(r!=null&&e!=null&&typeof r=="object"&&typeof e=="object"&&!Array.isArray(r)&&!Array.isArray(e)){let t=Object.keys(r),n=Object.keys(e);return t.length===n.length&&t.every(s=>vi(r[s],e[s]))}return!1}function pq(r,e,t){return r==="same"?!vi(e,t):vi(e,t)}});var Ma=w(bt=>{"use strict";var hq=bt&&bt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),mq=bt&&bt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),yq=bt&&bt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&hq(t,e,n[s]);return mq(t,e),t}})();Object.defineProperty(bt,"__esModule",{value:!0});bt.abortErr=Bd;bt.sanitizeLabel=bb;bt.gatePacks=wq;var gq=yq(V("path")),vb=Mt(),_q=es(),vq=Da(),bq=ht(),bi=Hn();function Bd(r){let e=new Error(r);return e.code="ABORT",e}function bb(r){return r.replace(/[^A-Za-z0-9_.-]/g,"-")}async function wq(r,e){let t=[],n=[],s=(i,o,a,c)=>{if(c==="abort")throw Bd(`pack "${i}": ${a} [${o}]`);n.push({runId:i,rule:o,reason:a})};for(let i of r){let o=gq.basename(i).replace(/\.evidence$/,""),a;try{a=await(0,_q.openContainer)(i)}catch{s(o,"packs.manifest","unreadable pack",e.packs.on_ineligible);continue}let c=await a.readManifest();if(c==null){s(o,"packs.manifest","no run.yaml",e.packs.on_ineligible);continue}let l;try{l=(0,bq.parseYaml)(c)}catch{s(o,"packs.manifest","run.yaml does not parse",e.packs.on_ineligible);continue}let h=typeof l?.run_id=="string"?l.run_id:o;if(l?.evidence!==vb.CONTRACT_VERSION){s(h,"packs.version",`evidence ${JSON.stringify(l?.evidence)} != ${vb.CONTRACT_VERSION}`,e.packs.on_ineligible);continue}if(e.packs.require_status!=="any"&&l?.status!==e.packs.require_status){s(h,`packs.require_status=${e.packs.require_status}`,`status is ${l?.status}`,e.packs.on_ineligible);continue}if(e.packs.require_valid!=="off"){let d=await(0,vq.validate)(i,{profile:e.packs.require_valid});if(!d.valid){let p=d.diagnostics.filter(y=>y.severity==="error").length;s(h,`packs.require_valid=${e.packs.require_valid}`,`${p} validation error(s)`,e.packs.on_ineligible);continue}}let f=!1;for(let d of e.rules){if(d.file!=="run.yaml")continue;let p=(0,bi.getKey)(l,d.key);if(d.must==="same"?t.length>0&&(0,bi.violates)("same",(0,bi.getKey)(t[0].run,d.key),p):t.some(u=>(0,bi.violates)("different",(0,bi.getKey)(u.run,d.key),p))){s(h,`run.yaml ${d.key} must ${d.must}`,`value ${JSON.stringify(p)}`,d.on_violation),f=!0;break}}f||t.push({inputPath:i,container:a,run:l,label:""})}if(t.length===0)throw Bd("no eligible packs to merge");return t.forEach((i,o)=>{i.label=`${o+1}-${bb(i.run.run_id)}`}),{eligible:t,skipped:n}}});var zd=w(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.resolveCollisions=Sq;wi.orderMembers=wb;wi.latestOf=Eb;var Eq=ht(),$q=Ma(),Gn=Hn();async function Sq(r,e){let t=new Map,n=new Set,s=[],i=new Set;for(let c of r)for(let l of await c.container.listTestIds())i.add(l);let o=new Set,a=c=>{for(let l=1;;l++){let h=`${c}-${l}`;if(!i.has(h)&&!o.has(h))return h}};for(let c of r)for(let l of await c.container.listTestIds()){if(n.has(l))continue;let h=t.get(l);if(!h){t.set(l,[{baseId:l,folder:l,members:[c]}]),o.add(l);continue}let f=h[0],[d,p]=await Promise.all([Vd(Yn(f),l),Vd(c,l)]),y=e.tests.on_collision,u=`tests.on_collision=${y}`,m=!1;for(let g of e.rules)if(g.file==="result.yaml"&&(0,Gn.violates)(g.must,(0,Gn.getKey)(d,g.key),(0,Gn.getKey)(p,g.key))){y=g.on_violation,u=`result.yaml ${g.key} must ${g.must}`,m=!0;break}let _=e.tests.identity,v=f;if(!m&&_){let g;for(let b of h){let E=await Vd(Yn(b),b.baseId);if(_.keys.every($=>(0,Gn.deepEqual)((0,Gn.getKey)(E,$),(0,Gn.getKey)(p,$)))){g=b;break}}y=g?_.on_same:_.on_different,u=g?`tests.identity.on_same=${y}`:`tests.identity.on_different=${y}`,g&&(v=g)}switch(y){case"error":throw(0,$q.abortErr)(`test "${l}" collides between packs "${Yn(v).run.run_id}" and "${c.run.run_id}" [${u}]`);case"prefer_first":s.push({test:l,winner:Yn(v).run.run_id,rule:u});break;case"prefer_latest":{let g=Tq(Yn(v),c)===c?c:Yn(v);g===c&&(v.members=[c]),s.push({test:l,winner:g.run.run_id,rule:u});break}case"nest":v.members.push(c),s.push({test:l,winner:Eb(v.members).run.run_id,rule:u,action:"nest",folder:v.folder});break;case"split":{let g=a(l);o.add(g),h.push({baseId:l,folder:g,members:[c]}),s.push({test:l,winner:c.run.run_id,rule:u,action:"split",folder:g});break}case"discard":t.delete(l),n.add(l),s.push({test:l,winner:"",rule:u});break}}return{groups:[...t.values()].flat(),collisions:s,discarded:[...n].sort()}}function wb(r){return[...r].sort((e,t)=>ja(e)-ja(t))}function Eb(r){let e=wb(r);return e[e.length-1]}function ja(r){let e=typeof r.run?.ended=="string"?r.run.ended:r.run?.started,t=typeof e=="string"?Date.parse(e):NaN;return Number.isNaN(t)?-1/0:t}function Yn(r){return r.members[0]}async function Vd(r,e){let t=await r.container.readResult(e);if(t!=null)try{return(0,Eq.parseYaml)(t)}catch{return}}function Tq(r,e){return ja(e)>ja(r)?e:r}});var Tb=w(Zt=>{"use strict";var Oq=Zt&&Zt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Nq=Zt&&Zt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Iq=Zt&&Zt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&Oq(t,e,n[s]);return Nq(t,e),t}})();Object.defineProperty(Zt,"__esModule",{value:!0});Zt.assemble=kq;var Yt=V("fs"),wt=Iq(V("path")),Aq=Mt(),Kd=gr(),Ra=ht(),Pq=zd(),$b=Hn();async function kq(r,e,t,n){try{await Yt.promises.access(r);let p=new Error(`output path "${r}" already exists`);throw p.code="USAGE",p}catch(p){if(p?.code==="USAGE")throw p}await Yt.promises.mkdir(r,{recursive:!0});let s=[];for(let p of n){let y=(0,Pq.orderMembers)(p.members),u=y[y.length-1],m=wt.join(r,"tests",p.folder);await xa(u.container,`tests/${p.baseId}`,m),s.push({pack:u,resultPath:wt.join(m,"result.yaml")});for(let _=0;_<y.length-1;_++){let v=wt.join(m,String(_+1));await xa(y[_].container,`tests/${p.baseId}`,v),s.push({pack:y[_],resultPath:wt.join(v,"result.yaml")})}p.folder!==p.baseId&&await Sb(wt.join(m,"result.yaml"),_=>(_.set("test",p.folder),!0))}for(let p of t)await p.container.isDir("coverage")&&await xa(p.container,"coverage",wt.join(r,"coverage",p.label));let i=await Promise.all(t.map(p=>p.container.readFileBytes(Kd.CATALOG_SNAPSHOT_PATH))),o=i.every(p=>p!=null&&p.equals(i[0]))?i[0]:null;o&&(await Yt.promises.mkdir(wt.join(r,wt.dirname(Kd.CATALOG_SNAPSHOT_PATH)),{recursive:!0}),await Yt.promises.writeFile(wt.join(r,Kd.CATALOG_SNAPSHOT_PATH),o));let a=t.map(p=>p.run?.environment&&typeof p.run.environment=="object"?p.run.environment:{}),c={},l=new Set;for(let p of new Set(a.flatMap(y=>Object.keys(y)))){let y=a[0][p];a.every(u=>p in u&&(0,$b.deepEqual)(u[p],y))?c[p]=y:l.add(p)}for(let{pack:p,resultPath:y}of s){let u=p.run?.environment??{},m=[...l].filter(_=>_ in u);m.length!==0&&await Sb(y,(_,v)=>{let g=!1;for(let b of m)(0,$b.getKey)(v,`environment.${b}`)===void 0&&(_.setIn(["environment",b],u[b]),g=!0);return g})}let h={};for(let p of t){let y=p.run?.metrics;if(!(!y||typeof y!="object"))for(let[u,m]of Object.entries(y))h[`${p.label}/${u}`]=m}let f=t.map(p=>p.run?.started).filter(p=>typeof p=="string").sort((p,y)=>Date.parse(p)-Date.parse(y))[0],d={evidence:Aq.CONTRACT_VERSION,run_id:e.runId,status:"running",title:e.title??t[0].run?.title,started:f,merged_from:t.map(p=>p.run.run_id)};Object.keys(h).length>0&&(d.metrics=h),o&&t[0].run?.metrics_catalog&&(d.metrics_catalog=t[0].run.metrics_catalog),Object.keys(c).length>0&&(d.environment=c),await Yt.promises.writeFile(wt.join(r,"run.yaml"),(0,Ra.stringifyYaml)(d),"utf8")}async function Sb(r,e){let t=await Yt.promises.readFile(r,"utf8"),n=(0,Ra.parseDoc)(t);e(n,(0,Ra.parseYaml)(t))&&await Yt.promises.writeFile(r,(0,Ra.stringifyDoc)(n),"utf8")}async function xa(r,e,t){await Yt.promises.mkdir(t,{recursive:!0});for(let n of await r.listDir(e)){let s=`${e}/${n.name}`,i=wt.join(t,n.name);if(n.isDir)await xa(r,s,i);else{let o=await r.readFileBytes(s);o!=null&&await Yt.promises.writeFile(i,o)}}}});var Ob=w(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.merge=jq;var Cq=xd(),Lq=Tb(),Dq=zd(),qq=Ma(),Mq=Hn();async function jq(r,e){let t=await(0,Mq.loadRules)(e.rulesPath),{eligible:n,skipped:s}=await(0,qq.gatePacks)(r,t),{groups:i,collisions:o,discarded:a}=await(0,Dq.resolveCollisions)(n,t);await(0,Lq.assemble)(e.out,{runId:e.runId,title:e.title},n,i);let c=Rq(n),l=!1;return e.finalize&&(await(0,Cq.finalize)(e.out,{endedAt:c}),l=!0),{packs:{eligible:n.map(h=>h.run.run_id),skipped:s},tests:{merged:i.length,collisions:o,discarded:a},output:{path:e.out,runId:e.runId,finalized:l,endedAt:c}}}function Rq(r){let e="",t=-1/0;for(let n of r){let s=typeof n.run?.ended=="string"?n.run.ended:n.run?.started;if(typeof s!="string")continue;let i=Date.parse(s);!Number.isNaN(i)&&i>t&&(t=i,e=s)}return e}});var Ab=w(Et=>{"use strict";var xq=Et&&Et.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Fq=Et&&Et.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Nb=Et&&Et.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&xq(t,e,n[s]);return Fq(t,e),t}})();Object.defineProperty(Et,"__esModule",{value:!0});Et.configPath=Ib;Et.loadConfig=Kq;Et.resolveProfile=Hq;var Uq=V("fs"),Bq=Nb(V("os")),Vq=Nb(V("path")),zq=Mt();function Ib(r){return r||(process.env.EVIDENCE_CONFIG?process.env.EVIDENCE_CONFIG:Vq.join(Bq.homedir(),".testmuai","evidence","config.json"))}async function Kq(r){let e=Ib(r),t;try{t=await Uq.promises.readFile(e,"utf8")}catch{return{}}try{return JSON.parse(t)}catch{let n=new Error(`config at ${e} is not valid JSON`);throw n.code="USAGE",n}}function Hq(r,e){return r??e.defaultProfile??zq.DEFAULT_PROFILE}});var Pb=w(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.RemoteZipContainer=void 0;Ei.openRemoteZip=lM;var Gq=V("zlib"),Yq=V("util"),Zq=(0,Yq.promisify)(Gq.inflateRaw),Jq=101010256,Wq=101075792,Xq=117853008,Qq=33639248,eM=67324752,Gd=22,tM=65535,_r=4294967295,rM=65535,nM=0,sM=8;function Zr(r,e){return Number(r.readBigUInt64LE(e))}function iM(r){return r.replace(/\.evidence$/,"")}async function oM(r){let e=await r.size(),t=Math.min(e,Gd+tM),n=await r.read(e-t,t),s=-1;for(let l=n.length-Gd;l>=0;l--){if(n.readUInt32LE(l)!==Jq)continue;let h=n.readUInt16LE(l+20);if(l+Gd+h===n.length){s=l;break}}if(s===-1)throw new Error("not a zip: end-of-central-directory not found");let i=n.readUInt16LE(s+10),o=n.readUInt32LE(s+12),a=n.readUInt32LE(s+16);if(i===rM||o===_r||a===_r){let l=s-20,h=e-t;if(l>=0&&n.readUInt32LE(l)===Xq){let f=Zr(n,l+8),d=f-h,p=d>=0&&d+56<=n.length?n.subarray(d,d+56):await r.read(f,56);p.readUInt32LE(0)===Wq&&(i=Zr(p,32),o=Zr(p,40),a=Zr(p,48))}}return{cdOffset:a,cdSize:o,count:i}}function aM(r,e){let t=0;for(;t+4<=r.length;){let n=r.readUInt16LE(t),s=r.readUInt16LE(t+2),i=t+4;if(n===1){let o=i;e.uncompressedSize===_r&&o+8<=i+s&&(e.uncompressedSize=Zr(r,o),o+=8),e.compressedSize===_r&&o+8<=i+s&&(e.compressedSize=Zr(r,o),o+=8),e.localHeaderOffset===_r&&o+8<=i+s&&(e.localHeaderOffset=Zr(r,o),o+=8);return}t=i+s}}function cM(r){let e=[],t=0;for(;t+46<=r.length&&r.readUInt32LE(t)===Qq;){let n=r.readUInt16LE(t+10),s=r.readUInt32LE(t+20),i=r.readUInt32LE(t+24),o=r.readUInt16LE(t+28),a=r.readUInt16LE(t+30),c=r.readUInt16LE(t+32),l=r.readUInt32LE(t+42),h=r.toString("utf8",t+46,t+46+o),f=r.subarray(t+46+o,t+46+o+a),d={name:h,method:n,compressedSize:s,uncompressedSize:i,localHeaderOffset:l};(s===_r||i===_r||l===_r)&&aM(f,d),e.push(d),t+=46+o+a+c}return e}var Fa=class{src;packName;kind="zip";byName;names;constructor(e,t,n){this.src=e,this.packName=t,this.byName=new Map,this.names=[];for(let s of n)this.names.push(s.name),s.name.endsWith("/")||this.byName.set(s.name,s)}get name(){return iM(this.packName)}async readEntryBytes(e){let t=this.byName.get(e);if(!t)return null;let n=await this.src.read(t.localHeaderOffset,30);if(n.length<30||n.readUInt32LE(0)!==eM)throw new Error(`corrupt local header for ${e}`);let s=n.readUInt16LE(26),i=n.readUInt16LE(28),o=t.localHeaderOffset+30+s+i,a=await this.src.read(o,t.compressedSize);if(t.method===nM)return a;if(t.method===sM)return Buffer.from(await Zq(a));throw new Error(`unsupported compression method ${t.method} for ${e}`)}async readEntryText(e){let t=await this.readEntryBytes(e);return t?t.toString("utf8"):null}hasPrefix(e){let t=e.endsWith("/")?e:`${e}/`;return this.names.some(n=>n.startsWith(t))}async readManifest(){return this.readEntryText("run.yaml")}async listTestIds(){let e=new Set;for(let t of this.names){let n=t.match(/^tests\/([^/]+)\//);n&&e.add(n[1])}return[...e].sort()}async readResult(e){return this.readEntryText(`tests/${e}/result.yaml`)}async fileExists(e,t){return this.byName.has(`tests/${e}/${t}`)}async readBytes(e,t){return this.readEntryBytes(`tests/${e}/${t}`)}async exists(e){return this.byName.has(e)||this.hasPrefix(e)}async isDir(e){return this.hasPrefix(e)}async listDir(e){let t=e===""?"":e.endsWith("/")?e:`${e}/`,n=new Map;for(let s of this.names){if(!s.startsWith(t))continue;let i=s.slice(t.length);if(i==="")continue;let o=i.indexOf("/");o===-1?n.has(i)||n.set(i,!1):n.set(i.slice(0,o),!0)}return[...n.entries()].map(([s,i])=>({name:s,isDir:i})).sort((s,i)=>s.name.localeCompare(i.name))}async readText(e){return this.readEntryText(e)}async readFileBytes(e){return this.readEntryBytes(e)}};Ei.RemoteZipContainer=Fa;async function lM(r,e){let{cdOffset:t,cdSize:n}=await oM(r),s=await r.read(t,n),i=cM(s);return new Fa(r,e,i)}});var Cb=w(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.FileByteSource=void 0;var kb=V("fs"),Yd=class{path;handle=null;cachedSize=null;constructor(e){this.path=e}async open(){return this.handle||(this.handle=await kb.promises.open(this.path,"r")),this.handle}async size(){return this.cachedSize===null&&(this.cachedSize=(await kb.promises.stat(this.path)).size),this.cachedSize}async read(e,t){if(t<=0)return Buffer.alloc(0);let n=await this.size(),s=Math.max(0,Math.min(e,n)),i=Math.max(0,Math.min(t,n-s));if(i===0)return Buffer.alloc(0);let o=Buffer.alloc(i),a=await this.open(),{bytesRead:c}=await a.read(o,0,i,s);return c===i?o:o.subarray(0,c)}async close(){this.handle&&(await this.handle.close(),this.handle=null)}};Ua.FileByteSource=Yd});var Lb=w((mU,uM)=>{uM.exports={name:"@testmuai/evidence-cli",version:"0.2.0",description:"An open, framework-agnostic format for what a test run produced \u2014 the .evidence pack, and the library + CLI that validate, seal, merge and judge it.",license:"Apache-2.0",author:"TestMu AI (formerly LambdaTest)",homepage:"https://github.com/LambdaTest/evidence-cli#readme",repository:{type:"git",url:"git+https://github.com/LambdaTest/evidence-cli.git"},bugs:{url:"https://github.com/LambdaTest/evidence-cli/issues"},keywords:["evidence","test-results","test-report","conformance","json-schema","validation","ci","test-automation","framework-agnostic"],engines:{node:">=20.19"},bin:{evidence:"dist/cli.js"},main:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"},"./package.json":"./package.json"},files:["dist"],publishConfig:{access:"public"},scripts:{build:"tsc -p tsconfig.build.json && node scripts/copy-schemas.mjs",prepack:"npm run build",test:"vitest run","test:watch":"vitest",docs:"npm --prefix design/web run dev","docs:build":"npm --prefix design/web run build","docs:install":"npm --prefix design/web install"},dependencies:{"@marcbachmann/cel-js":"^8.0.0","adm-zip":"^0.5.14",ajv:"^8.17.1","ajv-formats":"^3.0.1",commander:"^12.1.0",picocolors:"^1.0.1",yaml:"^2.5.0"},devDependencies:{"@types/adm-zip":"^0.5.5","@types/node":"^20.14.0",typescript:"^5.5.0",vitest:"^2.0.0"}}});var Zd=w(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.VERSION=void 0;var fM=Lb();Ba.VERSION=fM.version});var za=w(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.OPS=void 0;Ze.closest=jb;Ze.didYouMean=Rb;Ze.policyDiag=Zn;Ze.loadPolicy=EM;Ze.satisfiesVersion=SM;var dM=V("crypto"),qb=sd(),Mb=jt(),pM=Cs(),hM=ht();Ze.OPS=["equals","min","max","range","in"];var mM=["policy","requires","gates"],yM=["catalog","version"],gM=["id","metric","expr","where",...Ze.OPS,"severity","message"];function _M(r,e){let t=Array.from({length:r.length+1},(n,s)=>[s,...Array(e.length).fill(0)]);for(let n=1;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=r.length;n++)for(let s=1;s<=e.length;s++)t[n][s]=Math.min(t[n-1][s]+1,t[n][s-1]+1,t[n-1][s-1]+(r[n-1]===e[s-1]?0:1));return t[r.length][e.length]}function jb(r,e){let t=Math.max(2,Math.floor(r.length/3));return[...e].map(n=>({c:n,d:n.startsWith(r)||r.startsWith(n)?.5:_M(r,n)})).filter(n=>n.d<=t).sort((n,s)=>n.d-s.d||n.c.localeCompare(s.c)).slice(0,3).map(n=>n.c)}function Rb(r,e){let t=jb(r,e);return t.length>0?`did you mean ${t.map(n=>`"${n}"`).join(" or ")}?`:void 0}function vM(r,e){return(t,n)=>{let s;if(n&&t.length>0){let o=t.length===1?r.contents:r.getIn(t.slice(0,-1),!0);(0,qb.isMap)(o)&&(s=o.items.find(c=>c.key?.value===t[t.length-1])?.key?.range?.[0])}else s=(t.length===0?r.contents:r.getIn(t,!0))?.range?.[0];if(s===void 0)return;let i=e.linePos(s);return{line:i.line,column:i.col}}}function Zn(r,e,t,n,s={}){let i=(0,Mb.err)(e,`${r.source}#/${t.join("/")}`,n);s.severity&&(i.severity=s.severity),s.hint&&(i.hint=s.hint);let o=r.locate(t,s.key)??r.locate(t.slice(0,-1));return o&&(i.line=o.line,i.column=o.column),i}function Va(r,e){return typeof r?.id=="string"?`gates[${e}] "${r.id}"`:`gates[${e}]`}function bM(r,e){let t=r.instancePath.split("/").slice(1),n=t[0]==="gates"&&t.length>=2?Va(e?.gates?.[Number(t[1])],Number(t[1])):"policy",s=t[0]==="gates"?t.slice(2).join("."):t.join("."),i=s?`${n} ${s}`:n;return r.keyword==="required"?`${i}: missing "${r.params.missingProperty}"`:r.keyword==="enum"?`${i}: must be one of ${r.params.allowedValues.join(", ")}`:`${i}: ${r.message??"schema violation"}`}function wM(r){let e=Ze.OPS.filter(s=>r[s]!==void 0),t=r.metric!==void 0,n=r.expr!==void 0;if(t&&n)return['has both "metric" and "expr"; a gate is one or the other'];if(!t&&!n)return['needs "metric" or "expr"'];if(n){let s=[...e,...r.where!==void 0?["where"]:[]];return s.length>0?[`is an expression gate and takes no operator or where (found ${s.join(", ")})`]:[]}return e.length===0?[`needs one operator: ${Ze.OPS.join(", ")}`]:e.length>1?[`has several operators (${e.join(", ")}); use one, or range: [lo, hi]`]:[]}function EM(r,e={}){let t=e.source??"policy",{doc:n,lines:s}=(0,hM.parseDocWithLines)(r),i=vM(n,s),o={source:t,locate:i},a=[];if(n.errors.length>0){for(let m of n.errors){let _=(0,Mb.err)("policy.parse",t,`policy is not valid YAML: ${m.message.split(`
|
|
160
|
-
`)[0]}`),v=m.linePos?.[0];v&&(_.line=v.line,_.column=v.col),a.push(_)}return{policy:null,diagnostics:a}}let c=n.toJS();if(!(0,qb.isMap)(n.contents))return a.push(Zn(o,"policy.schema",[],"a policy must be a mapping with `policy` and `gates`")),{policy:null,diagnostics:a};let l=(m,_,v,g)=>{if(!(m===null||typeof m!="object"||Array.isArray(m)))for(let b of Object.keys(m))_.includes(b)||a.push(Zn(o,"policy.unknown_key",[...v,b],`${g}: unknown key "${b}"`,{key:!0,hint:Rb(b,_)??`allowed keys: ${_.join(", ")}`}))};l(c,mM,[],"policy"),l(c.requires,yM,["requires"],"requires");let h=Array.isArray(c.gates)?c.gates:[];h.forEach((m,_)=>l(m,gM,["gates",_],Va(m,_)));let f=(0,pM.loadToolSchema)("policy");if(!f(c))for(let m of f.errors??[]){if(m.keyword==="additionalProperties"||/\/(oneOf|not|anyOf)(\/|$)/.test(m.schemaPath))continue;let _=m.instancePath.split("/").slice(1).map(v=>/^\d+$/.test(v)?Number(v):v);a.push(Zn(o,"policy.schema",_,bM(m,c)))}let d=[],p=new Map;h.forEach((m,_)=>{if(m===null||typeof m!="object"||Array.isArray(m))return;for(let b of wM(m))a.push(Zn(o,"policy.schema",["gates",_],`${Va(m,_)} ${b}`));if(typeof m.id!="string")return;let v=i(["gates",_])?.line;if(p.has(m.id)){let b=p.get(m.id);a.push(Zn(o,"policy.duplicate_gate",["gates",_,"id"],`${Va(m,_)}: gate id "${m.id}" is already used${b?` on line ${b}`:""}`,{hint:"give every gate a unique id"}));return}p.set(m.id,v);let g=Ze.OPS.find(b=>m[b]!==void 0);d.push({id:m.id,index:_,metric:typeof m.metric=="string"?m.metric:void 0,expr:typeof m.expr=="string"?m.expr:void 0,where:typeof m.where=="string"?m.where:void 0,op:g,expected:g?m[g]:void 0,severity:m.severity==="warning"?"warning":"blocking",message:typeof m.message=="string"?m.message:void 0,line:v})});let y=c.requires&&typeof c.requires=="object"&&typeof c.requires.catalog=="string"?{catalog:c.requires.catalog,...typeof c.requires.version=="string"?{version:c.requires.version}:{}}:void 0;return{policy:{id:typeof c.policy=="string"?c.policy:"",requires:y,gates:d,sha256:(0,dM.createHash)("sha256").update(r,"utf8").digest("hex"),source:t,locate:i},diagnostics:a}}function Db(r){return r.split(".").map(Number)}function $M(r,e){let t=Db(r),n=Db(e);for(let s=0;s<Math.max(t.length,n.length);s++){let i=(t[s]??0)-(n[s]??0);if(i!==0)return i}return 0}function SM(r,e){let t=String(r);return(e.match(/(>=|<=|>|<|=)?\s*[0-9]+(?:\.[0-9]+)*/g)??[]).every(s=>{let i=s.match(/^(>=|<=|>|<|=)?\s*(.+)$/),o=$M(t,i[2]);switch(i[1]){case">=":return o>=0;case"<=":return o<=0;case">":return o>0;case"<":return o<0;default:return o===0}})}});var $i=w(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.PRODUCER_PREFIX=void 0;Ke.lookupMetric=Ub;Ke.checkPolicy=Bb;Ke.lintPolicy=IM;var ot=gr(),TM=_i(),ze=za();Ke.PRODUCER_PREFIX="metrics.";function Jd(r){return`${r.id} catalog v${r.version}`}function Ub(r,e){let t=(0,ot.own)(ot.CORE_CATALOG.metrics,r);if(t)return{def:t,builtin:!0};if(r.startsWith(Ke.PRODUCER_PREFIX)){let n=r.slice(Ke.PRODUCER_PREFIX.length);if((0,ot.own)(ot.CORE_CATALOG.metrics,n))return{problem:"builtin_prefixed"};if(!e)return{problem:"no_catalog"};let s=(0,ot.own)(e.metrics,n);return s?{def:s,builtin:!1}:{problem:"unknown"}}return{problem:"unknown"}}function OM(r){return[...Object.keys(ot.CORE_CATALOG.metrics),...r?Object.keys(r.metrics).map(e=>Ke.PRODUCER_PREFIX+e):[]]}function xb(r){return JSON.stringify(r)}function NM(r,e,t){let n=[],s=e==="range"||e==="in"?Array.isArray(t)?t:[t]:[t];if(ot.STRING_TYPES.has(r.type)){for(let i of s)typeof i!="string"?n.push({message:`${xb(i)} is not a string, but ${r.name} is ${r.type}`}):r.values&&!r.values.includes(i)&&n.push({message:`"${i}" is not a value of ${r.name}`,hint:`values: ${r.values.join(", ")}`});return n}for(let i of s)typeof i!="number"?n.push({message:`${xb(i)} is not a number, but ${r.name} is ${r.type}`}):ot.INTEGER_TYPES.has(r.type)&&!Number.isInteger(i)?n.push({message:`${i} is not an integer, but ${r.name} is ${r.type}`}):r.range&&(i<r.range[0]||i>r.range[1])&&n.push({message:`${i} is outside the range of ${r.name} [${r.range[0]}, ${r.range[1]}]`});return e==="range"&&Array.isArray(t)&&typeof t[0]=="number"&&typeof t[1]=="number"&&t[0]>t[1]&&n.push({message:`range [${t[0]}, ${t[1]}] has lo > hi`}),n}function Fb(r,e,t,n,s){let i=e[t],o=["gates",e.index,t],a=(0,TM.compileExpr)(i,n);return"run"in a?a.type!=="bool"&&a.type!=="dyn"?[(0,ze.policyDiag)(r,"policy.expr_type",o,`${s}: ${t} must be a bool, but "${i}" is ${a.type}`,{hint:t==="where"?"e.g. 'checkout' in test.tags":"compare or test something, e.g. totals.failed == 0"})]:[]:[(0,ze.policyDiag)(r,a.code,o,`${s}: ${a.message}`,{hint:a.hint})]}function Bb(r,e={}){let t=e.catalog??null,n=[],s=`searched evidence-core ${ot.CORE_CATALOG.version}${t?` and ${Jd(t)}`:""}`;if(r.requires){let i=["requires"],o=`${r.requires.catalog}${r.requires.version?` ${r.requires.version}`:""}`;t?(t.id!==r.requires.catalog||r.requires.version&&!(0,ze.satisfiesVersion)(t.version,r.requires.version))&&n.push((0,ze.policyDiag)(r,"policy.catalog_required",i,`policy requires catalog ${o}, but the catalog is ${Jd(t)}`,{hint:`the pack carries ${Jd(t)}`})):e.pack?n.push((0,ze.policyDiag)(r,"policy.catalog_required",i,`policy requires catalog ${o}, but the pack carries no metric catalog`,{hint:"seal the pack with its producer's catalog snapshot"})):n.push((0,ze.policyDiag)(r,"policy.catalog_needed",i,`policy requires catalog ${o}; no catalog was given to check it against`,{severity:"warning",hint:"pass --catalog <file>, or use kane-cli evidence lint-policy"}))}for(let i of r.gates){let o=`gates[${i.index}] "${i.id}"`;if(i.expr!==void 0){n.push(...Fb(r,i,"expr","pack",o));continue}if(i.metric===void 0)continue;let a=["gates",i.index,"metric"],c=Ub(i.metric,t);if("problem"in c){if(c.problem==="no_catalog")e.pack||n.push((0,ze.policyDiag)(r,"policy.catalog_needed",a,`${o}: "${i.metric}" is a producer metric and no catalog was given to check it against`,{severity:"warning",hint:"pass --catalog <file>, or use kane-cli evidence lint-policy"}));else if(c.problem==="builtin_prefixed"){let f=i.metric.slice(Ke.PRODUCER_PREFIX.length);n.push((0,ze.policyDiag)(r,"policy.builtin_prefixed",a,`${o}: "${i.metric}" does not exist; "${f}" is built-in`,{hint:`write metric: ${f}`}))}else{let f=!i.metric.startsWith(Ke.PRODUCER_PREFIX)&&(0,ot.own)(t?.metrics,i.metric)?Ke.PRODUCER_PREFIX+i.metric:void 0,d=f?[]:(0,ze.closest)(i.metric,OM(t)),p=f?`producer metrics are always prefixed: write metric: ${f}`:`${d.length>0?`did you mean ${d.map(y=>`"${y}"`).join(" or ")}? `:""}(${s})`;n.push((0,ze.policyDiag)(r,"policy.unknown_metric",a,`${o}: unknown metric "${i.metric}"`,{hint:p}))}continue}let l=c.def,h=ot.OPS_BY_TYPE[l.type];if(i.op&&!h.includes(i.op))n.push((0,ze.policyDiag)(r,"policy.op_not_allowed",["gates",i.index,i.op],`${o}: "${i.op}" is not allowed on "${i.metric}" (type ${l.type})`,{key:!0,hint:`use one of: ${h.join(", ")}`}));else if(i.op)for(let f of NM(l,i.op,i.expected))n.push((0,ze.policyDiag)(r,"policy.value_type",["gates",i.index,i.op],`${o}: ${f.message}`,{hint:f.hint??`expected ${l.type}${l.range?` within [${l.range[0]}, ${l.range[1]}]`:""}`}));if(i.where!==void 0)if(l.per_test)n.push(...Fb(r,i,"where","test",o));else{let f=[...Object.values(ot.CORE_CATALOG.metrics).filter(d=>d.per_test).map(d=>d.name),...t?Object.values(t.metrics).filter(d=>d.per_test).map(d=>Ke.PRODUCER_PREFIX+d.name):[]];n.push((0,ze.policyDiag)(r,"policy.where_not_per_test",["gates",i.index,"where"],`${o}: "${i.metric}" is a whole-run metric and cannot be narrowed with where`,{hint:`per-test metrics: ${f.join(", ")}`}))}}return n}function IM(r,e={}){let{policy:t,diagnostics:n}=(0,ze.loadPolicy)(r,{source:e.source});return(t?[...Bb(t,{catalog:e.catalog}),...n]:n).map((i,o)=>({d:i,i:o})).sort((i,o)=>(i.d.line??1/0)-(o.d.line??1/0)||i.i-o.i).map(i=>i.d)}});var Xb=w(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.testFact=zb;Jn.countTotals=Kb;Jn.failureRows=Zb;Jn.resolveMetric=jM;var AM=jt(),PM=Ma(),Vb=Hn(),vr=gr(),Jr=_i(),kM=$i(),Wd=kd();function zb(r){let e=r.result&&typeof r.result=="object"?r.result:{};return{...e,id:r.id,tags:Array.isArray(e.tags)?e.tags:[],requirements:Array.isArray(e.requirements)?e.requirements:[],steps:Array.isArray(e.steps)?e.steps:[],flaky:typeof e.flaky=="boolean"?e.flaky:!1}}function Kb(r){let e={tests:0n,passed:0n,failed:0n,broken:0n,skipped:0n};for(let t of r){e.tests++;let n=t.status;(n==="passed"||n==="failed"||n==="broken"||n==="skipped")&&e[n]++}return e}function J(r,e,t,n={}){let s=(0,AM.err)(r,e,t);return n.hint&&(s.hint=n.hint),{error:s,trust:n.trust??null,actual:n.actual??null,stored:n.stored??null}}var W=class extends Error{resolution;constructor(e){super("unresolved"),this.resolution=e}};function Ka(r,e,t){try{return(0,Jr.evalExpr)(e,(0,Jr.makeFacts)(t))}catch(n){throw n instanceof Jr.ExprEvalError?new W(J("verdict.expr_error",r,`${r}: ${n.message}`,{trust:"recomputed"})):n}}function Hb(r,e,t){let n=e.tests.map(zb),s=e.tests.map(a=>a.id);if(t===void 0)return{tests:n,ids:s};let i=(0,Jr.compileExpr)(t,"test");if(!("run"in i))throw new W(J(i.code,r,`${r}: where ${i.message}`,{hint:i.hint}));let o=[];return n.forEach((a,c)=>{let l=Ka(r,i,{test:a,file:e.tests[c].result,run:e.run??{}});if(typeof l!="boolean")throw new W(J("verdict.expr_error",r,`${r}: where gave ${JSON.stringify(l)} for test "${s[c]}", not a bool`));l&&o.push(c)}),{tests:o.map(a=>n[a]),ids:o.map(a=>s[a])}}function Gb(r,e,t){if(e==="sum")return t.reduce((n,s)=>n+s,0);if(t.length===0)throw new W(J("verdict.metric_missing",r,`${r}: no test has a value to take the ${e} of`,{trust:"recomputed"}));switch(e){case"min":return Math.min(...t);case"max":return Math.max(...t);case"mean":return t.reduce((n,s)=>n+s,0)/t.length;case"p50":return(0,Jr.percentile)(t,50);case"p90":return(0,Jr.percentile)(t,90);default:return(0,Jr.percentile)(t,95)}}function Yb(r,e,t,n){let s=r.verify;if(s.kind==="expr")return{value:Ka(e,s.expr,{run:t.run??{},tests:n.tests,totals:Kb(n.tests),failures:Zb(t)}),trust:"recomputed"};if(s.kind==="aggregate"){let i=[],o=0;return n.tests.forEach((a,c)=>{let l=n.ids[c],h;if(s.over===vr.DEFAULT_OVER)h=t.tests.find(p=>p.id===l)?.result;else{let p=`tests/${l}/${s.over.slice(8)}`,y=(0,vr.own)(t.files,p);if(!y)return;if("error"in y)throw new W(J("verdict.metric_missing",e,`${e}: ${y.error}`,{trust:"recomputed"}));h=y.value}let f={test:a,file:h,run:t.run??{}};if(s.where){let p=Ka(e,s.where,f);if(typeof p!="boolean")throw new W(J("verdict.expr_error",e,`${e}: where gave ${JSON.stringify(p)} for test "${l}", not a bool`,{trust:"recomputed"}));if(!p)return}let d;if(s.path!==void 0?d=(0,Vb.getKey)(h,s.path):s.value&&(d=Ka(e,s.value,f)),s.aggregate==="count"){(s.path===void 0&&!s.value||d!=null)&&o++;return}if(d==null){let p=s.path!==void 0?s.path:`value ${s.value.src}`;throw new W(J("verdict.metric_missing",e,`${e}: test "${l}" has no ${p}`,{trust:"recomputed",hint:s.path!==void 0?`when only some tests carry ${s.path}, the catalog narrows the metric with where: has(test.${s.path})`:void 0}))}if(typeof d!="number")throw new W(J("verdict.value_type",e,`${e}: test "${l}" gives ${JSON.stringify(d)}, not a number`,{trust:"recomputed"}));i.push(d)}),{value:s.aggregate==="count"?o:Gb(e,s.aggregate,i),trust:"recomputed"}}if(s.kind==="file"){let i=(0,vr.own)(t.files,s.file);if(!i)throw new W(J("verdict.metric_missing",e,`${e}: ${s.file} is not in the pack`,{trust:"file"}));if("error"in i)throw new W(J("verdict.metric_missing",e,`${e}: ${i.error}`,{trust:"file"}));let o=(0,Vb.getKey)(i.value,s.path);if(o==null)throw new W(J("verdict.metric_missing",e,`${e}: ${s.file} has no ${s.path}`,{trust:"file"}));return{value:o,trust:"file"}}return{value:CM(r,e,t),trust:"stored"}}function Zb(r){let e=(0,vr.own)(r.files,"failure.yaml"),t=e&&"value"in e?e.value?.failures:void 0;return Array.isArray(t)?t:[]}function Jb(r,e,t,n){if(n.type!==r.type)throw new W(J("verdict.stored_type",e,`${e}: ${t} type "${n.type}" is not the catalog's "${r.type}"`,{trust:"stored",actual:n.value}));if(r.unit&&n.unit!==void 0&&n.unit!==r.unit)throw new W(J("verdict.stored_type",e,`${e}: ${t} unit "${n.unit}" is not the catalog's "${r.unit}"`,{trust:"stored",actual:n.value}));return n.value}function CM(r,e,t){let n=(0,vr.own)(t.run?.metrics,r.name);if(!n||typeof n!="object"||n.value===void 0)throw new W(J("verdict.metric_missing",e,`${e}: run.yaml has no metrics.${r.name}`,{trust:"stored"}));return Jb(r,e,"stored",n)}function LM(r,e,t){let n=Array.isArray(t.run?.merged_from)?t.run.merged_from:[],s=Object.entries(t.run?.metrics??{}),i=[];if(n.forEach((o,a)=>{let c=`${a+1}-${(0,PM.sanitizeLabel)(String(o))}`,l=s.filter(([h])=>h===`${c}/${r.name}`||h.startsWith(`${c}/`)&&h.endsWith(`/${r.name}`));if(l.length===0)throw new W(J("verdict.metric_missing",e,`${e}: merged source ${c} stored no metrics.${r.name}`,{trust:"stored",hint:`every merged pack must store metrics.${r.name} for a merge: ${r.merge} metric`}));for(let[h,f]of l){if(!f||typeof f!="object"||typeof f.value!="number")throw new W(J("verdict.stored_type",e,`${e}: ${h} is not a number`,{trust:"stored"}));i.push(Wb(r,e,Jb(r,e,h,f),"stored",`${e}: ${h}`))}}),i.length===0)throw new W(J("verdict.metric_missing",e,`${e}: the merged pack lists no merged_from sources`,{trust:"stored"}));return i}function Wb(r,e,t,n,s=e){if(vr.STRING_TYPES.has(r.type)){if(typeof t!="string")throw new W(J("verdict.value_type",e,`${s}: ${JSON.stringify(t)} is not a string (type ${r.type})`,{trust:n,actual:t}));if(r.values&&!r.values.includes(t))throw new W(J("verdict.out_of_range",e,`${s}: "${t}" is not one of ${r.values.join(", ")}`,{trust:n,actual:t}));return t}if(typeof t!="number"||!Number.isFinite(t))throw new W(J("verdict.value_type",e,`${s}: ${JSON.stringify(t)} is not a number (type ${r.type})`,{trust:n,actual:t}));if(vr.INTEGER_TYPES.has(r.type)&&!Number.isInteger(t))throw new W(J("verdict.value_type",e,`${s}: ${t} is not an integer (type ${r.type})`,{trust:n,actual:t}));if(r.range&&(t<r.range[0]||t>r.range[1]))throw new W(J("verdict.out_of_range",e,`${s}: ${t} is outside [${r.range[0]}, ${r.range[1]}]`,{trust:n,actual:t}));return t}function DM(r,e){return typeof r=="number"&&typeof e=="number"?Math.abs(r-e)<=1e-9*Math.max(1,Math.abs(r),Math.abs(e)):r===e}function qM(r,e,t,n){if(r.merge==="none")throw new W(J("verdict.merge_none",e,`${e} cannot be judged on a merged pack: its merge rule is none`,{hint:"the catalog must give it a merge rule (sum, min, max, mean or recompute)"}));if(r.merge==="recompute")return Yb(r,e,t,Hb(e,t,n));if(n!==void 0)throw new W(J("verdict.merge_unsupported",e,`${e}: where cannot narrow a merged stored value (merge: ${r.merge})`));let s=LM(r,e,t);return{value:Gb(e,r.merge,s),trust:"stored"}}function MM(r,e,t){let n=(0,Wd.parseSemver)(r.min_producer);if(!n)return;let s=t.run?.environment?.producer,i=t.tests.length>0?t.tests.map(o=>o.result?.environment?.producer?.version??s?.version):[s?.version];for(let o of new Set(i)){let a=(0,Wd.parseSemver)(o);if(!a)throw new W(J("verdict.producer_version",e,`${e}: the pack records no producer version${o===void 0?"":` it can read (${JSON.stringify(o)})`}, and the metric needs ${r.min_producer} or later`,{hint:"the producer writes environment.producer.version into run.yaml"}));if((0,Wd.compareSemver)(a,n)<0)throw new W(J("verdict.producer_version",e,`${e}: needs a producer at ${r.min_producer} or later, but the pack was written by ${o}`,{hint:"judge a pack written by a newer producer, or gate on a metric this producer writes"}))}}function jM(r,e,t,n){let s=t.find(a=>!a.builtin)??null,i=(0,kM.lookupMetric)(r,s);if("problem"in i)return i.problem==="no_catalog"?J("verdict.catalog_missing",r,`pack has no metric catalog; ${r} can't be checked`,{hint:"the producer must seal the pack with its catalog snapshot"}):J("policy.unknown_metric",r,`unknown metric "${r}"`);let o=i.def;try{i.builtin||MM(o,r,e);let{value:a,trust:c}=!i.builtin&&e.merged?qM(o,r,e,n):Yb(o,r,e,Hb(r,e,n)),l=Wb(o,r,a,c);if(!i.builtin&&!e.merged&&n===void 0&&c!=="stored"){let h=(0,vr.own)(e.run?.metrics,o.name);if(h&&typeof h=="object"&&h.value!==void 0&&!DM(l,h.value))return J("verdict.stored_mismatch",r,`${r}: the stored value ${JSON.stringify(h.value)} disagrees with the recomputed ${JSON.stringify(l)}`,{trust:c,actual:l,stored:h.value,hint:`the producer's run.yaml metrics.${o.name} does not match the pack's own files`})}return{value:l,trust:c}}catch(a){if(a instanceof W)return a.resolution;throw a}}});var Xd=w(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.EXIT_CODES=Dt.EVALUATOR=void 0;Dt.judge=zM;var RM=Zd(),Qb=gr(),Ha=_i(),xM=$i(),Ga=Xb();Dt.EVALUATOR=`evidence-cli ${RM.VERSION}`;Dt.EXIT_CODES={pass:0,fail:1,errored:3};function ew(r){return{code:r.code,message:r.message,hint:r.hint??null}}function FM(r,e,t){switch(r){case"equals":return t===e;case"min":return t>=e;case"max":return t<=e;case"range":{let[n,s]=e;return t>=n&&t<=s}case"in":return e.includes(t)}}function tw(r,e){return r?"pass":e==="blocking"?"fail":"warn"}function UM(r,e,t){let n={id:r.id,metric:r.metric,where:r.where??null,op:r.op,expected:r.expected,severity:r.severity,message:r.message??null},s=(0,Ga.resolveMetric)(r.metric,e,t,r.where);return"error"in s?{...n,actual:s.actual,status:"errored",trust:s.trust,error:ew(s.error),stored:s.stored}:{...n,actual:s.value,status:tw(FM(r.op,r.expected,s.value),r.severity),trust:s.trust,error:null,stored:null}}function BM(r,e){let t={id:r.id,expr:r.expr,where:null,op:"expr",expected:!0,severity:r.severity,message:r.message??null,stored:null},n=(a,c,l)=>({...t,actual:null,status:"errored",trust:null,error:{code:a,message:c,hint:l??null}}),s=(0,Ha.compileExpr)(r.expr,"pack");if(!("run"in s))return n(s.code,s.message,s.hint);let i=e.tests.map(Ga.testFact),o;try{o=(0,Ha.evalExpr)(s,(0,Ha.makeFacts)({run:e.run??{},tests:i,totals:(0,Ga.countTotals)(i),failures:(0,Ga.failureRows)(e)}))}catch(a){if(a instanceof Ha.ExprEvalError)return n(a.code,a.message);throw a}return typeof o!="boolean"?n("verdict.expr_error",`expr gave ${JSON.stringify(o)}, not a bool`):{...t,actual:o,status:tw(o,r.severity),trust:"recomputed",error:null}}function VM(r){if(r.status!=="finalized")return{code:"verdict.unfinalized",message:`the pack is ${r.status??"unreadable"}, not finalized; only a sealed pack can be judged`,hint:"run evidence finalize first"};if(!r.validation.valid){let e=r.validation.diagnostics.filter(n=>n.severity==="error"),t=e[0];return{code:"verdict.pack_invalid",message:`the pack fails L0 validation with ${e.length} error(s)${t?`; first: ${t.location}: ${t.message} [${t.code}]`:""}`,hint:"run evidence validate on the pack"}}return null}function zM(r,e,t=r.catalog?[Qb.CORE_CATALOG,r.catalog]:[Qb.CORE_CATALOG],n={}){let s=t.find(c=>!c.builtin)??null,i={result:"pass",evaluated_at:n.evaluatedAt??new Date().toISOString(),evaluator:Dt.EVALUATOR,pack:{run_id:r.runId,sha256:r.sha256,contract:r.contract},policy:{id:e.id,sha256:e.sha256},catalog:r.catalogProvenance,error:null,gates:[],failed_gates:[],warnings:[],errored_gates:[],exit_code:0},o=(0,xM.checkPolicy)(e,{catalog:s,pack:!0}).filter(c=>c.severity==="error"),a=VM(r)??(o.length>0?ew({code:o[0].code,message:o.length===1?o[0].message:`${o.length} policy problems against this pack: ${o.map(c=>`${c.message} [${c.code}]`).join("; ")}`,hint:o[0].hint}):null);if(a)return i.error=a,i.result="errored",i.exit_code=Dt.EXIT_CODES.errored,i;for(let c of e.gates){let l=c.expr!==void 0?BM(c,r):UM(c,r,t);i.gates.push(l),l.status==="fail"&&i.failed_gates.push(l.id),l.status==="warn"&&i.warnings.push(l.id),l.status==="errored"&&i.errored_gates.push(l.id)}return i.result=i.errored_gates.length>0?"errored":i.failed_gates.length>0?"fail":"pass",i.exit_code=Dt.EXIT_CODES[i.result],i}});var tp=w(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.loadPackFacts=WM;var rw=V("crypto"),nw=V("fs"),KM=es(),HM=Da(),Qd=ht(),Wn=gr();async function GM(r){let e=(0,rw.createHash)("sha256");for await(let t of(0,nw.createReadStream)(r))e.update(t);return e.digest("hex")}function YM(r,e){try{return{value:r.endsWith(".json")?JSON.parse(e):(0,Qd.parseYaml)(e)}}catch(t){return{error:`${r} does not parse: ${t?.message??t}`}}}function ZM(r,e){let t=new Set(["failure.yaml"]);for(let n of r)for(let s of Object.values(n.metrics))if(s.verify.kind==="file"&&t.add(s.verify.file),s.verify.kind==="aggregate"&&s.verify.over!==Wn.DEFAULT_OVER){let i=s.verify.over.slice(8);for(let o of e)t.add(`tests/${o}/${i}`)}return[...t].sort()}async function JM(r,e){let t={};for(let n of e){let s=await r.readText(n);s!=null&&(t[n]=YM(n,s))}return t}async function WM(r){let e=await nw.promises.stat(r),t=await(0,KM.openContainer)(r),n=await(0,HM.validate)(r,{profile:"L0"}),s=await t.readManifest(),i=null;if(s!=null)try{i=(0,Qd.parseYaml)(s)}catch{i=null}let o=[];for(let d of await t.listTestIds()){let p=await t.readResult(d);if(p!=null)try{o.push({id:d,result:(0,Qd.parseYaml)(p)})}catch{}}let a=null,c=null,l=await t.readFileBytes(Wn.CATALOG_SNAPSHOT_PATH);if(l!=null&&(a=(0,Wn.lintCatalog)(l.toString("utf8"),{location:Wn.CATALOG_SNAPSHOT_PATH}).catalog,a)){let d=i?.metrics_catalog?.source;c={id:a.id,version:a.version,sha256:(0,rw.createHash)("sha256").update(l).digest("hex"),source:typeof d=="string"?d:null}}let h=a?[Wn.CORE_CATALOG,a]:[Wn.CORE_CATALOG],f=await JM(t,ZM(h,o.map(d=>d.id)));return{target:r,sha256:e.isDirectory()?null:await GM(r),runId:typeof i?.run_id=="string"?i.run_id:null,contract:typeof i?.evidence=="string"?i.evidence:null,status:typeof i?.status=="string"?i.status:null,run:i,merged:Array.isArray(i?.merged_from),tests:o,catalog:a,catalogProvenance:c,files:f,validation:n}}});var aw=w(qe=>{"use strict";var XM=qe&&qe.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),QM=qe&&qe.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),ej=qe&&qe.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&XM(t,e,n[s]);return QM(t,e),t}})();Object.defineProperty(qe,"__esModule",{value:!0});qe.PolicyUsageError=void 0;qe.loadPolicies=iw;qe.verdict=aj;qe.verdictFileName=ow;qe.writeVerdicts=cj;qe.combinedExitCode=lj;var sw=V("fs"),tj=ej(V("path")),rj=Xd(),nj=tp(),sj=$i(),ij=za(),Ya=class extends Error{problems;code="USAGE";constructor(e,t=[]){super(e),this.problems=t}};qe.PolicyUsageError=Ya;function Si(r,e=[]){throw new Ya(r,e)}function iw(r){r.length===0&&Si("at least one policy is required");let e=[],t=[];if(r.forEach((s,i)=>{let o=s.path??`policy[${i}]`,{policy:a,diagnostics:c}=(0,ij.loadPolicy)(s.content,{source:o}),l=c.filter(h=>h.severity==="error");!a||l.length>0?t.push({source:o,diagnostics:l}):e.push(a)}),t.length>0){let s=t.reduce((i,o)=>i+o.diagnostics.length,0);Si(`${s} problem(s) in ${t.length} policy file(s); nothing was judged`,t)}let n=new Set;for(let s of e)n.has(s.id)&&Si(`two policies are named "${s.id}"; each verdict is written to <policy-id>.verdict.json, so ids must differ`),n.add(s.id);return e}function oj(r,e){let t=[];for(let n of r){let s=(0,sj.checkPolicy)(n,{catalog:e.catalog,pack:!0}).filter(i=>i.severity==="error"&&i.code!=="policy.catalog_required");s.length>0&&t.push({source:n.source,diagnostics:s})}if(t.length>0){let n=t.reduce((s,i)=>s+i.diagnostics.length,0);Si(`${n} problem(s) in ${t.length} policy file(s) against the pack's metric catalog; nothing was judged`,t)}}async function aj(r,e){let t=iw(e.policies),n;try{n=await(0,nj.loadPackFacts)(r)}catch(i){Si(`cannot read pack "${r}": ${i?.message??i}`)}oj(t,n);let s=e.evaluatedAt??new Date().toISOString();return t.map(i=>(0,rj.judge)(n,i,void 0,{evaluatedAt:s}))}function ow(r){return`${r.policy.id}.verdict.json`}async function cj(r,e){await sw.promises.mkdir(e,{recursive:!0});let t=[];for(let n of r){let s=tj.join(e,ow(n));await sw.promises.writeFile(s,JSON.stringify(n,null,2)+`
|
|
161
|
-
`,"utf8"),t.push(s)}return t}function
|
|
156
|
+
`;)this.pos++;continue}return this.token(this.pos++,T.DIVIDE);case"%":return this.token(this.pos++,T.MODULO);case"<":return t[e+1]==="="?this.token((this.pos+=2)-2,T.LE):this.token(this.pos++,T.LT);case">":return t[e+1]==="="?this.token((this.pos+=2)-2,T.GE):this.token(this.pos++,T.GT);case"!":return t[e+1]==="="?this.token((this.pos+=2)-2,T.NE):this.token(this.pos++,T.NOT);case"(":return this.token(this.pos++,T.LPAREN);case")":return this.token(this.pos++,T.RPAREN);case"[":return this.token(this.pos++,T.LBRACKET);case"]":return this.token(this.pos++,T.RBRACKET);case"{":return this.token(this.pos++,T.LBRACE);case"}":return this.token(this.pos++,T.RBRACE);case".":return this.token(this.pos++,T.DOT);case",":return this.token(this.pos++,T.COMMA);case":":return this.token(this.pos++,T.COLON);case"?":return this.token(this.pos++,T.QUESTION);case'"':case"'":return this.readString(s);case"b":case"B":case"r":case"R":{let i=t[e+1];return i==='"'||i==="'"?++this.pos&&this.readString(i,s):this.readIdentifier()}default:{let i=s.charCodeAt(0);if(i<=57&&i>=48)return this.readNumber();if(this._isIdentifierCharCode(i))return this.readIdentifier()}}throw $e("unexpected_character",`Unexpected character: ${s}`,{pos:e,start:e,end:e+1,input:t})}}_isIdentifierCharCode(e){return e<48||e>122?!1:e>=97||e>=65&&e<=90||e<=57||e===95}_parseAsDouble(e,t){let n=Number(this.input.substring(e,t));if(Number.isFinite(n))return this.token(e,T.NUMBER,n);throw $e("invalid_number",`Invalid number: ${n}`,{pos:e,start:e,end:t,input:this.input})}_parseAsBigInt(e,t,n,s){let i=this.input.substring(e,t);if(s==="u"||s==="U"){this.pos++;try{return this.token(e,T.NUMBER,new ge(i))}catch{}}else try{return this.token(e,T.NUMBER,BigInt(i))}catch{}throw $e(n?"invalid_hex_integer":"invalid_integer",n?`Invalid hex integer: ${i}`:`Invalid integer: ${i}`,{pos:e,start:e,end:this.pos,input:this.input})}_readDigits(e,t,n,s){for(;n<t&&(s=e.charCodeAt(n))&&!(s>57||s<48);)n++;return n}_readExponent(e,t,n){let s=n<t&&e[n];if(s==="e"||s==="E"){s=++n<t&&e[n],(s==="-"||s==="+")&&n++;let i=n;if(n=this._readDigits(e,t,n),i===n)throw $e("invalid_exponent","Invalid exponent",{pos:n,start:n,end:Math.min(n+1,e.length),input:e})}return n}readNumber(){let{input:e,length:t,pos:n}=this,s=n;if(e[s]==="0"&&(e[s+1]==="x"||e[s+1]==="X")){for(s+=2;s<t&&Fv[e[s].charCodeAt(0)];)s++;return this._parseAsBigInt(n,this.pos=s,!0,e[s])}if(s=this._readDigits(e,t,s),s+1<t){let i=!1,o=e[s]==="."?this._readDigits(e,t,s+1):s+1;if(o!==s+1&&(i=!0)&&(s=o),o=this._readExponent(e,t,s),o!==s&&(i=!0)&&(s=o),i)return this._parseAsDouble(n,this.pos=s)}return this._parseAsBigInt(n,this.pos=s,!1,e[s])}readString(e,t){let{input:n,pos:s}=this;return n[s+1]===e&&n[s+2]===e?this.readTripleQuotedString(e,t):this.readSingleQuotedString(e,t)}_closeQuotedString(e,t,n,s){switch(n){case"b":case"B":{let i=this.processEscapes(e,t,!0),o=new Uint8Array(i.length);for(let a=0;a<i.length;a++)o[a]=i.charCodeAt(a)&255;return this.token(s-1,T.BYTES,o)}case"r":case"R":return this.token(s-1,T.STRING,t);default:{let i=this.processEscapes(e,t,!1);return this.token(s,T.STRING,i)}}}readSingleQuotedString(e,t){let{input:n,length:s,pos:i}=this,o,a=this.pos+1;for(;a<s&&(o=n[a]);){switch(o){case e:let c=i+1,l=n.slice(c,a);return this.pos=++a,this._closeQuotedString(c,l,t,i);case`
|
|
157
|
+
`:case"\r":throw $e("newline_in_string","Newlines not allowed in single-quoted strings",{pos:a,start:a,end:a+1,input:n});case"\\":a++}a++}throw $e("unterminated_string","Unterminated string",{pos:i,start:i,end:n.length,input:n})}readTripleQuotedString(e,t){let{input:n,length:s,pos:i}=this,o,a=this.pos+3;for(;a<s&&(o=n[a]);){switch(o){case e:if(n[a+1]===e&&n[a+2]===e){let c=i+3,l=n.slice(c,a);return this.pos=a+3,this._closeQuotedString(c,l,t,i)}break;case"\\":a++}a++}throw $e("unterminated_triple_quoted_string","Unterminated triple-quoted string",{pos:i,start:i,end:n.length,input:n})}#e(e,t,n,s,i,o){let a=t+s;return $e(e,XL[e](o),{input:this.input,pos:a,start:a,end:Math.min(a+i,t+n)})}processEscapes(e,t,n){if(!t.includes("\\"))return t;let s=t.length,i="",o=0;for(;o<s;){if(t[o]!=="\\"||o+1>=s){i+=t[o++];continue}let a=t[o+1];if(xv[a])i+=xv[a],o+=2;else if(a==="u"||a==="U"){if(n)throw this.#e("bytes_unicode_escape",e,s,o,2,a);let c=a==="u"?4:8,l=t.substring(o+2,o+2+c),h=Number.parseInt(l,16);if(l.length!==c||!/^[0-9a-fA-F]+$/.test(l)||h>1114111)throw this.#e("invalid_unicode_escape",e,s,o,2+c,a+l);if(h>=55296&&h<=57343)throw this.#e("invalid_unicode_surrogate",e,s,o,2+c,a+l);i+=String.fromCodePoint(h),o+=2+c}else if(a==="x"||a==="X"){let c=t.substring(o+2,o+4);if(!/^[0-9a-fA-F]{2}$/.test(c))throw this.#e("invalid_hex_escape",e,s,o,4,a+c);i+=String.fromCharCode(Number.parseInt(c,16)),o+=4}else if(a>="0"&&a<="7"){let c=t.substring(o+1,o+4);if(!/^[0-7]{3}$/.test(c))throw this.#e("invalid_octal_escape",e,s,o,4);let l=Number.parseInt(c,8);if(l>255)throw this.#e("octal_escape_out_of_range",e,s,o,4,c);i+=String.fromCharCode(l),o+=4}else throw this.#e("invalid_escape_sequence",e,s,o,2,a)}return i}readIdentifier(){let{pos:e,input:t,length:n}=this,s=e;for(;s<n&&this._isIdentifierCharCode(t[s].charCodeAt(0));)s++;let i=t.substring(e,this.pos=s);switch(i){case"true":return this.token(e,T.BOOLEAN,!0);case"false":return this.token(e,T.BOOLEAN,!1);case"null":return this.token(e,T.NULL,null);case"in":return this.token(e,T.IN);default:return this.token(e,T.IDENTIFIER,i)}}},QL=new Ed,Oa=class{lexer=QL;input=null;maxDepthRemaining=null;astNodesRemaining=null;type=null;pos=null;constructor(e,t){this.limits=e,this.registry=t}#e(e,t=this.pos){throw $e("limit_exceeded",`Exceeded ${e} (${this.limits[e]})`,{pos:t,start:t,end:t,input:this.input})}#t(e,t,n,s,i=e){let o=new wd(this.input,i,e,t,n,s);return this.astNodesRemaining--||this.#e("maxAstNodes",i),o}#n(e,t,n){return this.#t(t.start,n.end,e,[t,n])}#s(e,t,n){return this.#t(e.start,n.end,P.ternary,[e,t,n])}#i(e,t,n){return this.#t(e,n.end,t,n)}#o(e,t,n,s,i=t.start){return this.#t(t.start,s,e,[t,n],i)}#r(e=this.pos){let t=this.lexer.nextToken();return this.pos=t.tokenPos,this.type=t.tokenType,e}get value(){return this.lexer.tokenValue}consume(e){if(this.type===e)return this.#r();throw $e("expected_token",`Expected ${Ta[e]}, got ${Ta[this.type]}`,{pos:this.pos,start:this.pos,end:this.lexer.pos,input:this.input})}match(e){return this.type===e}parse(e){if(typeof e!="string")throw $e("expression_must_be_string","Expression must be a string");this.input=this.lexer.reset(e),this.#r(),this.maxDepthRemaining=this.limits.maxDepth,this.astNodesRemaining=this.limits.maxAstNodes;let t=this.parseExpression();if(this.match(T.EOF))return t;throw $e("unexpected_character",`Unexpected character: '${this.input[this.lexer.pos-1]}'`,{pos:this.pos,start:this.pos,end:this.lexer.pos,input:this.input})}#a(e,t,n,s){let i=s[0],o=n===P.rcall?s[1]:null,a=n===P.rcall?s[2]:s[1],c=this.registry.findMacro(i,!!o,a.length),l=this.#t(e,t,n,s);if(!c)return l;let h=c.handler({ast:l,args:a,receiver:o,methodName:i,parser:this});return h.callAst?l.setMeta("alternate",h.callAst):l.setMeta("macro",h).setMeta("async",pi(h.evaluate,h.async))}parseExpression(){this.maxDepthRemaining--||this.#e("maxDepth");let e=this.parseLogicalOr();if(!this.match(T.QUESTION))return++this.maxDepthRemaining&&e;this.#r();let t=this.parseExpression();this.consume(T.COLON);let n=this.parseExpression();return this.maxDepthRemaining++,this.#s(e,t,n)}parseLogicalOr(){let e=this.parseLogicalAnd();for(;this.match(T.OR);)this.#r(),e=this.#n(P["||"],e,this.parseLogicalAnd());return e}parseLogicalAnd(){let e=this.parseEquality();for(;this.match(T.AND);)this.#r(),e=this.#n(P["&&"],e,this.parseEquality());return e}parseEquality(){let e=this.parseRelational();for(;this.match(T.EQ)||this.match(T.NE);){let t=Sa[this.type];this.#r(),e=this.#n(t,e,this.parseRelational())}return e}parseRelational(){let e=this.parseAdditive();for(;this.match(T.LT)||this.match(T.LE)||this.match(T.GT)||this.match(T.GE)||this.match(T.IN);){let t=Sa[this.type];this.#r(),e=this.#n(t,e,this.parseAdditive())}return e}parseAdditive(){let e=this.parseMultiplicative();for(;this.match(T.PLUS)||this.match(T.MINUS);){let t=Sa[this.type];this.#r(),e=this.#n(t,e,this.parseMultiplicative())}return e}parseMultiplicative(){let e=this.parseUnary();for(;this.match(T.MULTIPLY)||this.match(T.DIVIDE)||this.match(T.MODULO);){let t=Sa[this.type];this.#r(),e=this.#n(t,e,this.parseUnary())}return e}parseUnary(){return this.type===T.NOT?this.#i(this.#r(),P.unaryNot,this.parseUnary()):this.type===T.MINUS?this.#i(this.#r(),P.unaryMinus,this.parseUnary()):this.parsePostfix()}parsePostfix(){let e=this.parsePrimary(),t=this.maxDepthRemaining;for(;;){if(this.match(T.DOT)){let n=this.#r();this.maxDepthRemaining--||this.#e("maxDepth",n);let s=this.match(T.QUESTION)&&this.registry.enableOptionalTypes&&this.#r()?P.optionalFieldAccess:P.fieldAccess,i=this.value,o=this.pos,a=this.lexer.pos;if(this.consume(T.IDENTIFIER),s===P.fieldAccess&&this.match(T.LPAREN)&&this.#r()){let c=this.parseArgumentList(),l=this.lexer.pos;this.consume(T.RPAREN),e=this.#a(e.start,l,P.rcall,[i,e,c])}else e=this.#o(s,e,i,a,o);continue}if(this.match(T.LBRACKET)){let n=this.#r();this.maxDepthRemaining--||this.#e("maxDepth",n);let s=this.match(T.QUESTION)&&this.registry.enableOptionalTypes&&this.#r()?P.optionalBracketAccess:P.bracketAccess,i=this.parseExpression(),o=this.lexer.pos;this.consume(T.RBRACKET),e=this.#o(s,e,i,o);continue}break}return this.maxDepthRemaining=t,e}parsePrimary(){switch(this.type){case T.NUMBER:case T.STRING:case T.BYTES:case T.BOOLEAN:case T.NULL:return this.#f();case T.IDENTIFIER:return this.#l();case T.LPAREN:return this.#u();case T.LBRACKET:return this.parseList();case T.LBRACE:return this.parseMap()}throw $e("unexpected_token",`Unexpected token: ${Ta[this.type]}`,{pos:this.pos,start:this.pos,end:this.lexer.pos,input:this.input})}#f(){return this.#r(this.#t(this.pos,this.lexer.pos,P.value,this.value))}#l(){let e=this.value,t=this.lexer.pos,n=this.consume(T.IDENTIFIER);if(Mn.has(e))throw $e("reserved_identifier",`Reserved identifier: ${e}`,{pos:n,start:n,end:t,input:this.input});if(!this.match(T.LPAREN))return this.#t(n,t,P.id,e);this.#r();let s=this.parseArgumentList(),i=this.lexer.pos;return this.consume(T.RPAREN),this.#a(n,i,P.call,[e,s])}#u(){this.consume(T.LPAREN);let e=this.parseExpression();return this.consume(T.RPAREN),e}parseList(){let e=this.consume(T.LBRACKET),t=[],n=this.limits.maxListElements;if(!this.match(T.RBRACKET))for(t.push(this.parseExpression()),n--||this.#e("maxListElements",t.at(-1).pos);this.match(T.COMMA)&&(this.#r(),!this.match(T.RBRACKET));)t.push(this.parseExpression()),n--||this.#e("maxListElements",t.at(-1).pos);let s=this.lexer.pos;return this.consume(T.RBRACKET),this.#t(e,s,P.list,t)}parseMap(){let e=this.consume(T.LBRACE),t=[],n=this.limits.maxMapEntries;if(!this.match(T.RBRACE))for(t.push(this.parseProperty()),n--||this.#e("maxMapEntries",t.at(-1)[0].pos);this.match(T.COMMA)&&(this.#r(),!this.match(T.RBRACE));)t.push(this.parseProperty()),n--||this.#e("maxMapEntries",t.at(-1)[0].pos);let s=this.lexer.pos;return this.consume(T.RBRACE),this.#t(e,s,P.map,t)}parseProperty(){return[this.parseExpression(),(this.consume(T.COLON),this.parseExpression())]}parseArgumentList(){let e=[],t=this.limits.maxCallArguments;if(!this.match(T.RPAREN))for(e.push(this.parseExpression()),t--||this.#e("maxCallArguments",e.at(-1).pos);this.match(T.COMMA)&&(this.#r(),!this.match(T.RPAREN));)e.push(this.parseExpression()),t--||this.#e("maxCallArguments",e.at(-1).pos);return e}}});function tD(r,e=Sd){let t=r?Se(r):void 0;if(!t?.length)return e;let n={...e};for(let s of t){if(!eD.has(s))throw new TypeError(`Unknown limits option: ${s}`);let i=r[s];typeof i=="number"&&(n[s]=i)}return _t(n)}function $d(r,e,t){let n=r?.[t]??e?.[t];if(typeof n!="boolean")throw new TypeError(`Invalid option: ${t}`);return n}function Bv(r,e=rD){return r?_t({unlistedVariablesAreDyn:$d(r,e,"unlistedVariablesAreDyn"),homogeneousAggregateLiterals:$d(r,e,"homogeneousAggregateLiterals"),enableOptionalTypes:$d(r,e,"enableOptionalTypes"),limits:tD(r.limits,e.limits)}):e}var Sd,eD,rD,Vv=Me(()=>{"use strict";Hr();Sd=_t({maxAstNodes:1e5,maxDepth:250,maxListElements:1e3,maxMapEntries:1e3,maxCallArguments:32}),eD=new Set(Se(Sd));rD=_t({unlistedVariablesAreDyn:!1,homogeneousAggregateLiterals:!0,enableOptionalTypes:!1,limits:Sd})});function Nd(r){return Od.parse(r)}function Id(r,e){return Od.evaluate(r,e)}function Ad(r){return Od.check(r)}var Na,Vn,Td,Od,zv=Me(()=>{"use strict";ga();gt();xn();qv();jv();Rv();Uv();Vv();mi();Na=gv({enableOptionalTypes:!1});cv(Na);Mv(Na);Dv(Na);Vn=class r{#e;#t;#n;#s;#i;constructor(e,t){this.opts=Bv(e,t?.opts),this.#e=(t instanceof r?t.#e:Na).clone(this.opts);let n={registry:this.#e,opts:this.opts};this.#n=new gi(n),this.#s=new gi(n,!0),this.#t=new Td(n),this.#i=new Oa(this.opts.limits,this.#e),Object.freeze(this)}clone(e){return new r(e,this)}registerFunction(e,t,n){return this.#e.registerFunctionOverload(e,t,n),this}registerOperator(e,t,n){return this.#e.registerOperatorOverload(e,t,n),this}registerType(e,t){return this.#e.registerType(e,t),this}registerVariable(e,t,n){return this.#e.registerVariable(e,t,n),this}registerConstant(e,t,n){return this.#e.registerConstant(e,t,n),this}hasVariable(e){return this.#e.variables.has(e)}getDefinitions(){return this.#e.getDefinitions()}check(e){try{return this.#o(this.#i.parse(e))}catch(t){return{valid:!1,error:t}}}#o(e){try{let t=this.#n.check(e,new Fn(this.#e));return{valid:!0,type:this.#r(t)}}catch(t){return{valid:!1,error:t}}}#r(e){return e.name==="list<dyn>"?"list":e.name==="map<dyn, dyn>"?"map":e.name}parse(e){let t=this.#i.parse(e),n=this.#a.bind(this,t);return n.check=this.#o.bind(this,t),n.ast=t,n}evaluate(e,t){return this.#a(this.#i.parse(e),t)}#a(e,t){return e.checkedType?e.evaluate(this.#t,e,new Fn(this.#e,t)):(this.#s.check(e,t=new Fn(this.#e,t)),e.evaluate(this.#t,e,t))}},Td=class extends Bn{constructor(e){super(e),this.createError=L}#e(e){if(e instanceof Map)return e.entries().next().value;for(let t in e)return[t,e[t]]}debugRuntimeType(e,t){return t?.hasDynType===!1?t:this.debugTypeDeep(e)}debugTypeDeep(e){let t=this.debugType(e);switch(t.kind){case"list":{let n=e instanceof Array?e[0]:e.values().next().value;return n===void 0?t:this.registry.getListType(this.debugTypeDeep(n))}case"map":{let n=this.#e(e);return n?this.registry.getMapType(t.keyType.hasDynType?this.debugTypeDeep(n[0]):t.keyType,t.valueType.hasDynType?this.debugTypeDeep(n[1]):t.valueType):t}default:return t}}tryEval(e,t){try{let n=this.run(e,t);return n instanceof Promise?n.catch(s=>s):n}catch(n){return n}}run(e,t){return e.evaluate(this,e,t)}},Od=new Vn({unlistedVariablesAreDyn:!0})});function Gv(r){if(r===null)return"null";if(typeof r=="boolean"||typeof r=="bigint")return String(r);if(typeof r=="string")return nD(r);if(r instanceof Uint8Array)return Kv(r);if(r instanceof ge)return`${r.value}u`;if(r instanceof Ie)return r.hasValue()?`optional.of(${Gv(r.value())})`:"optional.none()";if(typeof r=="number")return r%1===0?`${r}.0`:r.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:9});if(typeof r=="object"){let e=Object.keys(r);if(e.every(t=>/^\d+$/.test(t))){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=r[n];return Kv(t)}}return String(r)}function Le(r){let{op:e,args:t}=r;switch(e){case"value":return Gv(t);case"id":return t;case"||":case"&&":case"==":case"!=":case"<":case"<=":case">":case">=":case"in":case"+":case"-":case"*":case"/":case"%":return`${Ct(t[0],e)} ${e} ${Ct(t[1],e)}`;case"!_":return`!${Ct(t,e)}`;case"-_":return["+","-","*","/","%"].includes(t.op)?`-(${Le(t)})`:`-${Le(t)}`;case".":return`${Ct(t[0],e)}.${t[1]}`;case".?":return`${Ct(t[0],e)}.?${t[1]}`;case"[]":return`${Ct(t[0],e)}[${Le(t[1])}]`;case"[?]":return`${Ct(t[0],e)}[?${Le(t[1])}]`;case"call":return`${t[0]}(${t[1].map(Le).join(", ")})`;case"rcall":return`${Ct(t[1],e)}.${t[0]}(${t[2].map(Le).join(", ")})`;case"list":return`[${t.map(Le).join(", ")}]`;case"map":return`{${t.map(([n,s])=>`${Le(n)}: ${Le(s)}`).join(", ")}}`;case"?:":return`${Ct(t[0],e)} ? ${Ct(t[1],e)} : ${Le(t[2])}`;default:throw new Error(`Unknown AST operation: ${e}`)}}function nD(r){let e=r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\f/g,"\\f").replace(/[\b]/g,"\\b").replace(/\v/g,"\\v"),t="";for(let n=0;n<e.length;n++){let s=e.charCodeAt(n);s<32||s>126?t+=s<=65535?`\\u${s.toString(16).padStart(4,"0")}`:`\\U${s.toString(16).padStart(8,"0")}`:t+=e[n]}return`"${t}"`}function Kv(r){let e='b"';for(let t of r)t===92?e+="\\\\":t===34?e+='\\"':t===10?e+="\\n":t===13?e+="\\r":t===9?e+="\\t":t>=32&&t<=126?e+=String.fromCharCode(t):e+=`\\x${t.toString(16).padStart(2,"0")}`;return`${e}"`}function sD(r,e){let t=r.op,n=Hv[e]||0,s=Hv[t]||0;return t==="value"||t==="id"||t==="call"||t==="rcall"||t==="list"||t==="map"||(e==="*"||e==="/"||e==="%")&&t==="-_"||e==="*"&&t==="*"&&r.args[0].op==="-_"||(t==="."||t==="[]"||t===".?"||t==="[?]")&&(e==="."||e==="[]"||e===".?"||e==="[?]"||e==="rcall")?!1:e==="?:"?t==="?:":e==="!_"||e==="-_"?s<n:!!(e==="/"&&(t==="*"||t==="+"||t==="-")||t==="/"&&e!==void 0||(e==="*"||e==="/")&&["+","-","*","/"].includes(t)||s<n||s===n&&(e==="/"||e==="%")&&(t==="/"||t==="%"))}function Ct(r,e){return sD(r,e)?`(${Le(r)})`:Le(r)}var Hv,Yv=Me(()=>{"use strict";xn();di();Hv={"?:":1,"||":2,"&&":3,"==":4,"!=":4,"<":5,"<=":5,">":5,">=":5,in:5,"+":6,"-":6,"-_":6,"*":7,"/":7,"%":7,"!_":8,".":9,".?":9,"[]":9,"[?]":9,call:9,rcall:9}});var Zv={};uw(Zv,{Environment:()=>Vn,EvaluationError:()=>Kt,Optional:()=>Ie,ParseError:()=>Br,TypeError:()=>Vr,check:()=>Ad,default:()=>iD,evaluate:()=>Id,parse:()=>Nd,serialize:()=>Le});var iD,Jv=Me(()=>{"use strict";gt();zv();Yv();di();iD={parse:Nd,evaluate:Id,check:Ad,Environment:Vn,ParseError:Br,EvaluationError:Kt,TypeError:Vr,serialize:Le,Optional:Ie}});var _i=w(_e=>{"use strict";Object.defineProperty(_e,"__esModule",{value:!0});_e.ExprEvalError=_e.EXPR_LIMITS=void 0;_e.percentile=rb;_e.compileExpr=pD;_e.makeFacts=hD;_e.evalExpr=mD;var oD=(Jv(),fw(Zv)),aD=jt();_e.EXPR_LIMITS={maxAstNodes:1e3,maxDepth:32,maxElementReads:1e6,maxSteps:5e6};var Qv={pack:[["run","map"],["tests","list<map>"],["totals","map<string, int>"],["failures","list<map>"]],test:[["test","map"],["file","dyn"],["run","map"]]},Lt=class extends Error{code="verdict.expr_error"};_e.ExprEvalError=Lt;function eb(r,e){if(e.every(t=>typeof t=="bigint"))return{ints:e};if(e.every(t=>typeof t=="number"))return{doubles:e};throw e.every(t=>typeof t=="bigint"||typeof t=="number")?new Error(`${r}() mixes int and double values; convert with double()`):new Error(`${r}() needs a list of numbers`)}function cD(r){let e=eb("sum",r);return"ints"in e?e.ints.reduce((t,n)=>t+n,0n):e.doubles.reduce((t,n)=>t+n,0)}function tb(r,e){let t=eb(r,e),n="ints"in t?t.ints.map(Number):t.doubles;if(n.length===0)throw new Error(`${r}() of an empty list`);return n}function lD(r){let e=tb("mean",r);return e.reduce((t,n)=>t+n,0)/e.length}function rb(r,e){let t=[...tb("percentile",r)].sort((i,o)=>i-o),n=Number(e);if(!(n>=0&&n<=100))throw new Error(`percentile() needs p in [0, 100], got ${n}`);let s=Math.max(1,Math.ceil(n/100*t.length));return t[s-1]}function Wv(r){let e=new oD.Environment({limits:{maxAstNodes:_e.EXPR_LIMITS.maxAstNodes,maxDepth:_e.EXPR_LIMITS.maxDepth}});for(let[t,n]of Qv[r])e.registerVariable(t,n);for(let t of["int","double"]){e.registerFunction(`sum(list<${t}>): ${t}`,cD),e.registerFunction(`mean(list<${t}>): double`,lD);for(let n of["int","double"])e.registerFunction(`percentile(list<${t}>, ${n}): double`,rb)}return e}var uD={pack:Wv("pack"),test:Wv("test")},Ia=null;function fD(r){if(Object.hasOwn(r,"run"))return;let e=r.run;r.run=function(t,n){if(Ia&&--Ia.steps<0)throw new Lt(`evaluation cost limit exceeded (${_e.EXPR_LIMITS.maxSteps} steps)`);return e.call(this,t,n)}}function dD(r){return Qv[r].map(([e])=>e).join(", ")}function Xv(r,e,t,n){let s=typeof t?.summary=="string"?t.summary:String(t?.message??t).split(`
|
|
158
|
+
`)[0],i=typeof t?.range?.start=="number"?` at column ${t.range.start+1}`:"",o=(0,aD.err)(r,"expr",`${s}${i} in "${e}"`);return o.hint=`available variables: ${dD(n)}; functions include size, sum, mean, percentile`,o}function pD(r,e){let t;try{t=uD[e].parse(r)}catch(o){return Xv("policy.expr_syntax",r,o,e)}let n=t.check();if(!n.valid){let o=n.error?.name==="ParseError"?"policy.expr_syntax":"policy.expr_type";return Xv(o,r,n.error,e)}let s=t.ast,i=s.evaluate;return s.evaluate=(o,a,c)=>(fD(o),i.call(s,o,a,c)),{src:r,env:e,type:n.type??"dyn",run:o=>t(o)}}function hD(r){let e={left:_e.EXPR_LIMITS.maxElementReads,steps:_e.EXPR_LIMITS.maxSteps},t=s=>{if(Array.isArray(s)){let i=s.map(t);return new Proxy(i,{get(o,a,c){if(typeof a=="string"&&/^\d+$/.test(a)&&--e.left<0)throw new Lt(`evaluation cost limit exceeded (${_e.EXPR_LIMITS.maxElementReads} list reads)`);return Reflect.get(o,a,c)}})}return s!==null&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,o])=>[i,t(o)])):s},n={};for(let[s,i]of Object.entries(r))n[s]=t(i);return{vars:n,meter:e}}function Pd(r){if(typeof r=="bigint"){let e=Number(r);if(!Number.isSafeInteger(e))throw new Lt(`result ${r} is outside the safe integer range`);return e}if(typeof r=="number"&&!Number.isFinite(r))throw new Lt(`result is not a finite number (${r})`);return Array.isArray(r)?r.map(Pd):r!==null&&typeof r=="object"&&Object.getPrototypeOf(r)===Object.prototype?Object.fromEntries(Object.entries(r).map(([e,t])=>[e,Pd(t)])):r}function mD(r,e){e.meter.left=_e.EXPR_LIMITS.maxElementReads,e.meter.steps=_e.EXPR_LIMITS.maxSteps;let t;Ia=e.meter;try{t=r.run(e.vars)}catch(n){if(n instanceof Lt)throw n;let s=typeof n?.summary=="string"?n.summary:String(n?.message??n).split(`
|
|
159
|
+
`)[0];throw new Lt(`${s} in "${r.src}"`)}finally{Ia=null}if(e.meter.steps<0)throw new Lt(`evaluation cost limit exceeded (${_e.EXPR_LIMITS.maxSteps} steps)`);return Pd(t)}});var kd=w(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.parseSemver=gD;Aa.compareSemver=_D;var yD=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;function gD(r){if(typeof r!="string")return null;let e=yD.exec(r.trim());return e?{core:[Number(e[1]),Number(e[2]),Number(e[3])],pre:e[4]?e[4].split("."):[]}:null}function _D(r,e){for(let t=0;t<3;t++)if(r.core[t]!==e.core[t])return r.core[t]-e.core[t];if(r.pre.length===0||e.pre.length===0)return e.pre.length-r.pre.length;for(let t=0;t<Math.max(r.pre.length,e.pre.length);t++){let n=r.pre[t],s=e.pre[t];if(n===void 0)return-1;if(s===void 0)return 1;let i=/^\d+$/.test(n),o=/^\d+$/.test(s);if(i&&o&&Number(n)!==Number(s))return Number(n)-Number(s);if(i!==o)return i?-1:1;if(n!==s)return n<s?-1:1}return 0}});var gr=w(oe=>{"use strict";var vD=oe&&oe.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oe,"__esModule",{value:!0});oe.CORE_CATALOG=oe.CatalogLoadError=oe.STRING_TYPES=oe.INTEGER_TYPES=oe.OPS_BY_TYPE=oe.DEFAULT_OVER=oe.CATALOG_SNAPSHOT_PATH=oe.CORE_CATALOG_ID=void 0;oe.own=TD;oe.lintCatalog=ob;oe.loadCatalog=OD;var bD=V("crypto"),He=jt(),Ld=vD(Q_()),wD=Cs(),nb=pa(),ED=ht(),$D=_i(),SD=kd();oe.CORE_CATALOG_ID="evidence-core";oe.CATALOG_SNAPSHOT_PATH="meta/metrics-catalog.yaml";oe.DEFAULT_OVER="tests/*/result.yaml";oe.OPS_BY_TYPE={count:["equals","min","max","range","in"],integer:["equals","min","max","range","in"],ms:["equals","min","max","range","in"],bytes:["equals","min","max","range","in"],currency:["equals","min","max","range","in"],ratio:["min","max","range"],percentage:["min","max","range"],decimal:["min","max","range"],string:["equals","in"],enum:["equals","in"]};oe.INTEGER_TYPES=new Set(["count","integer","bytes"]);oe.STRING_TYPES=new Set(["string","enum"]);function TD(r,e){return r!=null&&typeof r=="object"&&Object.hasOwn(r,e)?r[e]:void 0}var Pa=class extends Error{diagnostics;code="USAGE";constructor(e,t){super(e),this.diagnostics=t}};oe.CatalogLoadError=Pa;function sb(r){return(0,bD.createHash)("sha256").update(r,"utf8").digest("hex")}function Cd(r,e,t,n,s={}){if(typeof r!="string")return;let i=(0,$D.compileExpr)(r,e);if(!("run"in i)){n.push({...i,code:"catalog.expr",location:t});return}if(s.bool&&i.type!=="bool"&&i.type!=="dyn"){n.push((0,He.err)("catalog.expr",t,`where must be a bool, but "${r}" is ${i.type}`));return}return i}function ib(r,e,t,n){let s=[],i=(0,wD.loadToolSchema)("metrics-catalog");if(!i(r)){for(let c of i.errors??[])c.keyword!=="oneOf"&&s.push((0,He.err)("catalog.schema",`${n}#${c.instancePath}`,`${c.instancePath||"/"} ${c.message??"schema violation"}`));return{catalog:null,diagnostics:s}}let o=r,a={};for(let[c,l]of Object.entries(o.metrics)){let h=`${n}#/metrics/${c}`;if(!t&&ND.has(c)){s.push((0,He.err)("catalog.reserved_name",h,`"${c}" is a built-in metric name and cannot be redefined by a producer catalog`));continue}let f,d=l.verify;if(d==="stored")f={kind:"stored"},t&&s.push((0,He.err)("catalog.schema",`${h}/verify`,`built-in metric "${c}" must be recomputed, not stored`));else if("file"in d)(0,nb.isContained)(d.file)?f={kind:"file",file:d.file,path:d.path}:s.push((0,He.err)("catalog.path_escape",`${h}/verify/file`,`file "${d.file}" escapes the pack`));else if("aggregate"in d){let y=d.over??oe.DEFAULT_OVER;(0,nb.isContained)(y.replace("*","x"))||s.push((0,He.err)("catalog.path_escape",`${h}/verify/over`,`over "${y}" escapes the pack`));let u=Cd(d.value,"test",`${h}/verify/value`,s),m=Cd(d.where,"test",`${h}/verify/where`,s,{bool:!0});d.aggregate!=="count"&&d.path===void 0&&d.value===void 0&&s.push((0,He.err)("catalog.schema",`${h}/verify`,`aggregate ${d.aggregate} needs a "path" or a "value" to fold`)),f={kind:"aggregate",aggregate:d.aggregate,over:y,path:d.path,value:u,where:m}}else{let y=Cd(d.expr,"pack",`${h}/verify/expr`,s);y&&(f={kind:"expr",expr:y})}let p=l.merge??"none";p==="recompute"&&f&&(f.kind==="stored"||f.kind==="file")&&s.push((0,He.err)("catalog.merge_rule",`${h}/merge`,`merge: recompute needs an aggregate or expr verify; "${c}" is ${f.kind}`)),l.per_test===!0&&f&&f.kind!=="aggregate"&&f.kind!=="expr"&&s.push((0,He.err)("catalog.schema",`${h}/per_test`,`per_test needs an aggregate or expr verify; "${c}" is ${f.kind}`)),Array.isArray(l.range)&&l.range[0]>l.range[1]&&s.push((0,He.err)("catalog.schema",`${h}/range`,`range [${l.range[0]}, ${l.range[1]}] has lo > hi`)),l.min_producer!==void 0&&!(0,SD.parseSemver)(l.min_producer)&&s.push((0,He.err)("catalog.schema",`${h}/min_producer`,`min_producer "${l.min_producer}" is not a semantic version`)),l.values!==void 0&&l.type!=="enum"&&s.push((0,He.err)("catalog.schema",`${h}/values`,"values is only allowed on an enum metric")),f&&(a[c]={name:c,type:l.type,unit:l.unit,label:l.label,description:l.description,range:l.range,values:l.values,per_test:l.per_test===!0,verify:f,merge:p,...l.min_producer!==void 0?{min_producer:l.min_producer}:{}})}return s.length>0?{catalog:null,diagnostics:s}:{catalog:{id:o.catalog,version:o.version,sha256:e,builtin:t,metrics:a},diagnostics:[]}}function ob(r,e={}){let t=e.location??"catalog",n;try{n=(0,ED.parseYaml)(r)}catch(s){return{catalog:null,diagnostics:[(0,He.err)("catalog.parse",t,`catalog is not valid YAML: ${s?.message??s}`)]}}return ib(n,sb(r),!1,t)}function OD(r){let{catalog:e,diagnostics:t}=ob(r);if(!e)throw new Pa(`invalid metric catalog: ${t.map(n=>n.message).join("; ")}`,t);return e}var ND=new Set(Object.keys(Ld.default.metrics));function ID(){let r=JSON.stringify(Ld.default),{catalog:e,diagnostics:t}=ib(Ld.default,sb(r),!0,"evidence-core");if(!e)throw new Error(`built-in catalog is invalid: ${t.map(n=>n.message).join("; ")}`);return e}oe.CORE_CATALOG=ID()});var ab=w(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.runCatalogChecks=PD;var AD=V("crypto"),ka=Mt(),Ca=jt(),zn=gr();async function PD(r){let e=r.run?.metrics_catalog,t=await r.container.readFileBytes(zn.CATALOG_SNAPSHOT_PATH);if(e==null||typeof e!="object")return t==null?[]:[(0,Ca.warn)(ka.Codes.CATALOG_UNREFERENCED,zn.CATALOG_SNAPSHOT_PATH,`${zn.CATALOG_SNAPSHOT_PATH} is present but run.yaml has no metrics_catalog block`)];if(t==null)return[(0,Ca.err)(ka.Codes.CATALOG_MISSING,"run.yaml#/metrics_catalog",`run.yaml names catalog "${e.id}" but ${zn.CATALOG_SNAPSHOT_PATH} is missing`)];let n=[],s=(0,AD.createHash)("sha256").update(t).digest("hex");typeof e.sha256=="string"&&/^[0-9a-f]{64}$/.test(e.sha256)&&e.sha256!==s&&n.push((0,Ca.err)(ka.Codes.CATALOG_HASH_MISMATCH,"run.yaml#/metrics_catalog/sha256",`metrics_catalog.sha256 ${e.sha256} does not match the snapshot hash ${s}`));let{catalog:i,diagnostics:o}=(0,zn.lintCatalog)(t.toString("utf8"),{location:zn.CATALOG_SNAPSHOT_PATH});return n.push(...o),i&&(i.id!==e.id||String(i.version)!==String(e.version))&&n.push((0,Ca.err)(ka.Codes.CATALOG_IDENTITY_MISMATCH,"run.yaml#/metrics_catalog",`run.yaml names catalog ${e.id} v${e.version} but the snapshot is ${i.id} v${i.version}`)),n}});var cb=w(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});Md.runL1Checks=CD;var te=Mt(),re=jt(),kD=Cs(),La=ht(),qd=pa();async function CD(r){let e=[],t=r.status==="finalized",{logsMeta:n,video:s,failure:i,failureIndex:o}=(0,kD.loadL1Schemas)(r.version);t&&!await r.container.isDir("coverage")&&e.push((0,re.err)(te.Codes.L1_COVERAGE_MISSING,"coverage/","L1 requires a global coverage/ directory"));let a=new Set;for(let{testId:c,result:l}of r.tests){let h=`tests/${c}`;await LD(r.container,e,h,t,n),await DD(r.container,e,h,t,l),await RD(r.container,e,h,s),await MD(r.container,e,h,t,l,i,a)}return await jD(r.container,e,t,a,o),e}async function LD(r,e,t,n,s){let i=`${t}/logs`;if(!await r.isDir(i)){n&&e.push((0,re.err)(te.Codes.L1_LOGS_MISSING,`${i}/`,"L1 requires a logs/ directory"));return}let o=`${i}/meta.yaml`,a=await r.readText(o);if(a==null){n&&e.push((0,re.err)(te.Codes.L1_LOGS_META_MISSING,o,"logs/ is present but logs/meta.yaml is missing"));return}let c;try{c=(0,La.parseYaml)(a)}catch(l){e.push((0,re.err)(te.Codes.L1_LOGS_META_INVALID,o,`logs/meta.yaml is not valid YAML: ${l?.message??l}`));return}if(!s(c)){for(let l of s.errors??[])e.push((0,re.err)(te.Codes.L1_LOGS_META_INVALID,`${o}${l.instancePath||""}`,`${l.instancePath||"/"} ${l.message??"schema violation"}`));return}for(let l of c.logs){let h=l?.file;if(typeof h=="string"){if(!(0,qd.isContained)(h)){e.push((0,re.err)(te.Codes.L1_LOG_PATH_ESCAPE,o,`declared log file "${h}" escapes logs/`));continue}await r.exists(`${i}/${h}`)||e.push((0,re.err)(te.Codes.L1_LOG_FILE_MISSING,`${i}/${h}`,`declared log file "${h}" does not exist`))}}}async function DD(r,e,t,n,s){let i=`${t}/steps`;if(!await r.isDir(i)){n&&e.push((0,re.err)(te.Codes.L1_STEPS_MISSING,`${i}/`,"L1 requires a steps/ directory"));return}let o=Array.isArray(s?.steps)?s.steps:[],a=new Set(o.map(c=>`${c?.ordinal}-${c?.id}`));for(let c of await r.listDir(i)){if(!c.isDir)continue;let l=c.name.match(/^(\d+)-(.+)$/);if(!l){e.push((0,re.err)(te.Codes.L1_STEPS_MALFORMED,`${i}/${c.name}`,`step folder "${c.name}" is not <ordinal>-<id>`));continue}if(!a.has(`${Number(l[1])}-${l[2]}`)){e.push((0,re.err)(te.Codes.L1_STEPS_UNMATCHED,`${i}/${c.name}`,`step folder "${c.name}" matches no result.yaml step`));continue}(await r.listDir(`${i}/${c.name}`)).some(d=>!d.isDir&&/^screenshot\.[^.]+$/i.test(d.name))||e.push((0,re.warn)(te.Codes.L1_STEPS_SCREENSHOT_MISSING,`${i}/${c.name}`,`step folder "${c.name}" has no screenshot.<ext>`))}}function qD(r){let e=[],t=(s,i)=>{typeof i=="string"&&i.length>0&&e.push({pointer:s,ref:i})};t("/repro/definition",r?.repro?.definition),t("/repro/resolved",r?.repro?.resolved),t("/page_state/dom",r?.page_state?.dom),t("/page_state/a11y",r?.page_state?.a11y),t("/page_state/screenshot",r?.page_state?.screenshot),t("/console_at_failure/ref",r?.console_at_failure?.ref),t("/network_at_failure/ref",r?.network_at_failure?.ref),t("/triage/suggested_fix/patch",r?.triage?.suggested_fix?.patch);let n=r?.triage?.rca?.evidence;return Array.isArray(n)&&n.forEach((s,i)=>t(`/triage/rca/evidence/${i}`,s)),e}async function MD(r,e,t,n,s,i,o){let a=`${t}/steps`,c=Array.isArray(s?.steps)?s.steps:[],l=new Map(c.map(h=>[`${h?.ordinal}-${h?.id}`,h]));if(await r.isDir(a))for(let h of await r.listDir(a)){if(!h.isDir)continue;let f=h.name.match(/^(\d+)-(.+)$/);if(!f)continue;let d=`${a}/${h.name}/failure.yaml`,p=await r.readText(d);if(p==null)continue;o.add(d);let y;try{y=(0,La.parseYaml)(p)}catch(v){e.push((0,re.err)(te.Codes.L1_FAILURE_INVALID,d,`failure.yaml is not valid YAML: ${v?.message??v}`));continue}if(!i(y)){for(let v of i.errors??[])e.push((0,re.err)(te.Codes.L1_FAILURE_INVALID,`${d}${v.instancePath||""}`,`${v.instancePath||"/"} ${v.message??"schema violation"}`));continue}let u=y,m=`${Number(f[1])}-${f[2]}`,_=l.get(m);u.step!==f[2]||_===void 0?e.push((0,re.err)(te.Codes.L1_FAILURE_UNMATCHED,d,`failure record step "${u.step}" does not match a result.yaml step for folder "${h.name}"`)):typeof _?.status=="string"&&_.status!==u.status&&e.push((0,re.warn)(te.Codes.L1_FAILURE_STATUS_DISAGREES,d,`failure record status "${u.status}" disagrees with result.yaml step status "${_.status}"`));for(let{pointer:v,ref:g}of qD(u))(0,qd.isContained)(g)?await r.exists(`${t}/${g}`)||e.push((0,re.err)(te.Codes.L1_FAILURE_REF_MISSING,`${d}#${v}`,`referenced file "${g}" does not exist`)):e.push((0,re.err)(te.Codes.L1_FAILURE_REF_ESCAPE,`${d}#${v}`,`referenced file "${g}" escapes the test directory`))}if(n)for(let h of c){if(h?.status!=="failed"&&h?.status!=="broken"||typeof h?.ordinal!="number"||typeof h?.id!="string")continue;let f=`${a}/${h.ordinal}-${h.id}/failure.yaml`;o.has(f)||e.push((0,re.warn)(te.Codes.L1_FAILURE_MISSING,f,`step "${h.id}" is "${h.status}" but has no failure.yaml`))}}async function jD(r,e,t,n,s){let i="failure.yaml",o=await r.readText(i);if(o==null){t&&e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_MISSING,i,"L1 requires the finalize-generated failure.yaml index at the pack root"));return}let a;try{a=(0,La.parseYaml)(o)}catch(h){e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_INVALID,i,`failure.yaml is not valid YAML: ${h?.message??h}`));return}if(!s(a)){for(let h of s.errors??[])e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_INVALID,`${i}${h.instancePath||""}`,`${h.instancePath||"/"} ${h.message??"schema violation"}`));return}let c=new Set,l=a.failures;for(let h=0;h<l.length;h++){let f=l[h],d=`tests/${f.test}/steps/${f.ordinal}-${f.step}/failure.yaml`;f.path!==d&&e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_INVALID,`${i}#/failures/${h}/path`,`path "${f.path}" does not agree with its row (expected "${d}")`)),c.add(f.path),(!(0,qd.isContained)(f.path)||!await r.exists(f.path))&&e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_DANGLING,`${i}#/failures/${h}/path`,`indexed record "${f.path}" does not exist`))}for(let h of n)c.has(h)||e.push((0,re.err)(te.Codes.L1_FAILURE_INDEX_INCOMPLETE,i,`step record "${h}" exists but is not indexed`))}async function RD(r,e,t,n){let s=`${t}/video.yaml`,i=await r.readText(s);if(i==null)return;let o;try{o=(0,La.parseYaml)(i)}catch(a){e.push((0,re.err)(te.Codes.L1_VIDEO_INVALID,s,`video.yaml is not valid YAML: ${a?.message??a}`));return}if(!n(o))for(let a of n.errors??[])e.push((0,re.err)(te.Codes.L1_VIDEO_INVALID,`${s}${a.instancePath||""}`,`${a.instancePath||"/"} ${a.message??"schema violation"}`))}});var Da=w(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.validate=zD;var Ge=Mt(),Kn=jt(),xD=es(),FD=Cs(),lb=ht(),UD=ab(),BD=pa(),VD=cb();async function zD(r,e={}){let t=e.profile??Ge.DEFAULT_PROFILE,n=(0,Ge.profileChain)(t);if(!n){let y=new Error(`unknown profile "${t}"`);throw y.code="USAGE",y}let s=[],i=null,o=()=>({valid:!s.some(y=>y.severity==="error"),profile:t,version:Ge.CONTRACT_VERSION,status:i,diagnostics:s}),a=await(0,xD.openContainer)(r),c=await a.readManifest();if(c==null)return s.push((0,Kn.err)(Ge.Codes.MANIFEST_MISSING,"run.yaml","no top-level run.yaml \u2014 not a valid evidence pack")),o();let l;try{l=(0,lb.parseYaml)(c)}catch(y){return s.push((0,Kn.err)(Ge.Codes.MANIFEST_PARSE,"run.yaml",`run.yaml is not valid YAML: ${y?.message??y}`)),o()}i=typeof l?.status=="string"?l.status:null;let h=ub(l,"run.yaml");if(h)return s.push(h),o();let f=(0,FD.loadSchemas)(Ge.CONTRACT_VERSION,"L0");s.push(...fb(f.run,l,"run.yaml"));let d=await a.listTestIds(),p=[];for(let y of d){let u=`tests/${y}/result.yaml`,m=await a.readResult(y);if(m==null){s.push((0,Kn.err)(Ge.Codes.RESULT_MISSING,u,`missing result.yaml for test "${y}"`));continue}let _;try{_=(0,lb.parseYaml)(m)}catch(g){s.push((0,Kn.err)(Ge.Codes.RESULT_PARSE,u,`result.yaml is not valid YAML: ${g?.message??g}`));continue}let v=ub(_,u);if(v){s.push(v);continue}s.push(...fb(f.result,_,u)),p.push({testId:y,result:_})}return s.push(...await(0,BD.runCrossChecks)({run:l,tests:p,container:a})),s.push(...await(0,UD.runCatalogChecks)({run:l,container:a})),n.includes("L1")&&s.push(...await(0,VD.runL1Checks)({container:a,status:i,tests:p,version:Ge.CONTRACT_VERSION})),o()}function ub(r,e){let t=r?.evidence;return t==null?null:t!==Ge.CONTRACT_VERSION?(0,Kn.err)(Ge.Codes.VERSION_UNSUPPORTED,e,`pack declares evidence ${JSON.stringify(t)}; this validator implements ${Ge.CONTRACT_VERSION} \u2014 cannot validate`):null}function fb(r,e,t){return r(e)?[]:(r.errors??[]).map(n=>(0,Kn.err)(Ge.Codes.SCHEMA,`${t}${n.instancePath||""}`,`${n.instancePath||"/"} ${n.message??"schema violation"}`))}});var db=w(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.retryTransient=GD;var KD=new Set(["EPERM","EACCES","EBUSY"]),HD=r=>new Promise(e=>setTimeout(e,r));async function GD(r,e={}){let t=e.attempts??10,n=e.delayMs??100,s=e.sleep??HD;for(let i=1;;i++)try{return await r()}catch(o){let a=o?.code;if(!a||!KD.has(a)||i>=t)throw o;await s(Math.min(i*n,1e3))}}});var xd=w(it=>{"use strict";var YD=it&&it.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),ZD=it&&it.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),JD=it&&it.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&YD(t,e,n[s]);return ZD(t,e),t}})(),WD=it&&it.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(it,"__esModule",{value:!0});it.finalize=QD;it.sweepIncomplete=rq;var fe=V("fs"),De=JD(V("path")),pb=V("crypto"),XD=WD(tc()),Yr=ht(),qa=db();async function QD(r,e){let t=await fe.promises.stat(r).catch(()=>null);if(!t||!t.isDirectory()){let E=new Error("finalize requires the live <name>.evidence/ directory, not a sealed zip");throw E.code="USAGE",E}let n=De.join(r,"tests"),s=(await fe.promises.readdir(n,{withFileTypes:!0}).catch(()=>[])).filter(E=>E.isDirectory()).map(E=>E.name).sort(),i={tests:0,passed:0,failed:0,broken:0,skipped:0},o=[];for(let E of s){let $=De.join(n,E,"result.yaml"),S=await fe.promises.readFile($,"utf8"),O=(0,Yr.parseYaml)(S);i.tests++;let A=O?.status;(A==="passed"||A==="failed"||A==="broken"||A==="skipped")&&i[A]++;let x=O?.definition?.path;if(typeof x=="string"&&x.length>0){let j=await fe.promises.readFile(De.join(n,E,x)),B=`sha256:${(0,pb.createHash)("sha256").update(j).digest("hex")}`,de=(0,Yr.parseDoc)(S);de.setIn(["definition","sha256"],B),await fe.promises.writeFile($,(0,Yr.stringifyDoc)(de),"utf8")}o.push(...await eq(n,E))}o.sort((E,$)=>E.test===$.test?E.ordinal-$.ordinal:E.test<$.test?-1:1);let a=o.filter(E=>!E.triage_status||E.triage_status==="untriaged").length,c={generated:e.endedAt,totals:{failures:o.length,triaged:o.length-a,untriaged:a},failures:o};await fe.promises.writeFile(De.join(r,"failure.yaml"),(0,Yr.stringifyYaml)(c),"utf8");let l=De.join(r,"run.yaml"),h=(0,Yr.parseDoc)(await fe.promises.readFile(l,"utf8"));h.setIn(["status"],"finalized"),h.setIn(["ended"],e.endedAt),h.setIn(["totals"],i),await fe.promises.writeFile(l,(0,Yr.stringifyDoc)(h),"utf8");let f=new XD.default;await hb(f,r,"");let d=f.toBuffer(),p=De.dirname(r),y=De.basename(r),u=r,m=(0,pb.randomBytes)(6).toString("hex"),_=De.join(p,`${y}.tmp-${m}`),v=De.join(p,`${y}.bak-${m}`),g=await fe.promises.open(_,"w");try{await g.writeFile(d),await g.sync()}finally{await g.close()}let b={attempts:20};await(0,qa.retryTransient)(()=>fe.promises.rename(r,v),b),await(0,qa.retryTransient)(()=>fe.promises.rename(_,u),b),await tq(p);try{await fe.promises.rm(v,{recursive:!0,force:!0,maxRetries:10,retryDelay:100})}catch{}return{totals:i,sealedPath:u}}async function eq(r,e){let t=[],n=De.join(r,e,"steps"),s=(await fe.promises.readdir(n,{withFileTypes:!0}).catch(()=>[])).filter(i=>i.isDirectory()).map(i=>i.name);for(let i of s){let o=i.match(/^(\d+)-(.+)$/);if(!o)continue;let a=`tests/${e}/steps/${i}/failure.yaml`,c=await fe.promises.readFile(De.join(n,i,"failure.yaml"),"utf8").catch(()=>null);if(c==null)continue;let l;try{l=(0,Yr.parseYaml)(c)}catch(d){throw new Error(`finalize: ${a} is not valid YAML: ${d?.message??d}`)}if(typeof l?.status!="string"||l.status.length===0)throw new Error(`finalize: ${a} has no string \`status\` \u2014 cannot index it`);let h={test:e,ordinal:Number(o[1]),step:o[2],status:l.status,path:a};typeof l?.title=="string"&&l.title.length>0&&(h.title=l.title);let f=l?.triage?.status;typeof f=="string"&&f.length>0&&(h.triage_status=f),t.push(h)}return t}async function tq(r){try{let e=await fe.promises.open(r,"r");try{await e.sync()}finally{await e.close()}}catch{}}async function rq(r){let e=[],t=[],n;try{n=await fe.promises.readdir(r)}catch{return{restored:e,removed:t}}for(let s of n){let i=s.match(/^(.+\.evidence)\.bak-[0-9a-f]+$/);if(!i)continue;let o=i[1],a=De.join(r,o),c=De.join(r,s);await nq(a)?(await fe.promises.rm(c,{recursive:!0,force:!0,maxRetries:10,retryDelay:100}),t.push(s)):(await(0,qa.retryTransient)(()=>fe.promises.rename(c,a)),e.push(o))}for(let s of n)/\.evidence\.tmp-[0-9a-f]+$/.test(s)&&(await(0,qa.retryTransient)(()=>fe.promises.rm(De.join(r,s),{force:!0})),t.push(s));return{restored:e,removed:t}}async function nq(r){try{return await fe.promises.stat(r),!0}catch{return!1}}async function hb(r,e,t){let n=await fe.promises.readdir(e,{withFileTypes:!0});for(let s of n){let i=De.join(e,s.name),o=t?`${t}/${s.name}`:s.name;s.isDirectory()?await hb(r,i,o):r.addFile(o,await fe.promises.readFile(i))}}});var mb=w((iU,sq)=>{sq.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://evidence-cli.dev/schemas/merge-rules.schema.json",title:"merge-rules.yaml",description:"The declarative policy passed to `evidence merge` (--rules). TOOL INPUT, not pack contract \u2014 it lives beside the versioned 0.1/ tree because it configures a command rather than shaping a pack. Fixed knobs gate packs and set the default collision policy; the flat `rules` list adds generic {file, key, must, on_violation} predicates. Scope is implied by `file`: run.yaml rules gate PACKS (compared across all eligible packs), result.yaml rules resolve COLLISIONS (compared between the two colliding tests). Unlike pack declarations, unknown keys are rejected \u2014 a typo'd knob must fail loudly. See decision 0045.",type:"object",properties:{packs:{type:"object",properties:{require_status:{description:"Run status every input pack must have. Default finalized \u2014 shards arrive sealed.",enum:["finalized","running","any"]},require_valid:{description:"Validation profile every input pack must pass (any error diagnostic fails the gate), or off.",enum:["L0","L1","off"]},on_ineligible:{description:"What an ineligible pack does to the merge: abort the whole merge, or skip the pack (recorded in the report).",enum:["abort","skip"]}},additionalProperties:!1},tests:{type:"object",properties:{on_collision:{description:"Default policy when two packs carry the same test id and no result.yaml rule fires. discard tombstones the id.",enum:["error","prefer_first","prefer_latest","discard"]},identity:{description:"Optional identity policy (decision 0046). Runs only when no result.yaml rule fired, so guard rules still abort first. `keys` name what makes two copies of a test id THE SAME test \u2014 the caller's vocabulary; evidence-cli never interprets a key. Same identity resolves by on_same (nest keeps every copy: latest canonical, superseded archived as 1/, 2/ \u2026); different identity by on_different (split allocates a suffixed sibling folder).",type:"object",required:["keys","on_same","on_different"],properties:{keys:{description:"Dot-paths into the parsed result.yaml, compared by canonical deep equality. Absent==absent counts as same, matching the generic rules.",type:"array",minItems:1,items:{type:"string",minLength:1}},on_same:{enum:["nest","prefer_latest","prefer_first","error"]},on_different:{enum:["split","error"]}},additionalProperties:!1}},additionalProperties:!1},rules:{description:"Generic key predicates, evaluated in file order. `must: same` anchors on the first eligible pack; `must: different` keeps the first occurrence. Absent==absent counts as same; absent vs present counts as different.",type:"array",items:{type:"object",required:["file","key","must","on_violation"],properties:{file:{enum:["run.yaml","result.yaml"]},key:{description:"Dot-path into the parsed YAML (e.g. environment.producer.name).",type:"string",minLength:1},must:{enum:["same","different"]},on_violation:{description:"Action on violation. Scope-checked by the conditional below: pack rules (file: run.yaml) take abort|skip; collision rules (file: result.yaml) take error|prefer_first|prefer_latest|discard.",type:"string"}},if:{properties:{file:{const:"run.yaml"}}},then:{properties:{on_violation:{enum:["abort","skip"]}}},else:{properties:{on_violation:{enum:["error","prefer_first","prefer_latest","discard"]}}},additionalProperties:!1}}},additionalProperties:!1}});var Hn=w(Ye=>{"use strict";var Ud=Ye&&Ye.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.DEFAULT_RULES=void 0;Ye.loadRules=uq;Ye.getKey=fq;Ye.deepEqual=vi;Ye.violates=dq;var iq=V("fs"),oq=Ud(uu()),aq=Ud(bu()),cq=Ud(mb()),lq=ht();Ye.DEFAULT_RULES={packs:{require_status:"finalized",require_valid:"L0",on_ineligible:"abort"},tests:{on_collision:"error"},rules:[]};var gb=new oq.default({allErrors:!0,strict:!1});(0,aq.default)(gb);var yb=gb.compile(cq.default);function Fd(r){let e=new Error(r);throw e.code="USAGE",e}async function uq(r){if(!r)return Ye.DEFAULT_RULES;let e;try{e=await iq.promises.readFile(r,"utf8")}catch{Fd(`cannot read merge-rules file "${r}"`)}let t;try{t=(0,lq.parseYaml)(e)}catch(n){Fd(`merge-rules file is not valid YAML: ${n?.message??n}`)}if(!yb(t)){let n=yb.errors?.[0];Fd(`merge-rules.yaml${n?.instancePath??""}: ${n?.message??"schema violation"}`)}return{packs:{...Ye.DEFAULT_RULES.packs,...t.packs},tests:{...Ye.DEFAULT_RULES.tests,...t.tests},rules:t.rules??[]}}function fq(r,e){return e.split(".").reduce((t,n)=>{if(!(t==null||typeof t!="object"||!Object.hasOwn(t,n)))return t[n]},r)}function vi(r,e){if(Object.is(r,e))return!0;if(Array.isArray(r)&&Array.isArray(e))return r.length===e.length&&r.every((t,n)=>vi(t,e[n]));if(r!=null&&e!=null&&typeof r=="object"&&typeof e=="object"&&!Array.isArray(r)&&!Array.isArray(e)){let t=Object.keys(r),n=Object.keys(e);return t.length===n.length&&t.every(s=>vi(r[s],e[s]))}return!1}function dq(r,e,t){return r==="same"?!vi(e,t):vi(e,t)}});var Ma=w(bt=>{"use strict";var pq=bt&&bt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),hq=bt&&bt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),mq=bt&&bt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&pq(t,e,n[s]);return hq(t,e),t}})();Object.defineProperty(bt,"__esModule",{value:!0});bt.abortErr=Bd;bt.sanitizeLabel=vb;bt.gatePacks=bq;var yq=mq(V("path")),_b=Mt(),gq=es(),_q=Da(),vq=ht(),bi=Hn();function Bd(r){let e=new Error(r);return e.code="ABORT",e}function vb(r){return r.replace(/[^A-Za-z0-9_.-]/g,"-")}async function bq(r,e){let t=[],n=[],s=(i,o,a,c)=>{if(c==="abort")throw Bd(`pack "${i}": ${a} [${o}]`);n.push({runId:i,rule:o,reason:a})};for(let i of r){let o=yq.basename(i).replace(/\.evidence$/,""),a;try{a=await(0,gq.openContainer)(i)}catch{s(o,"packs.manifest","unreadable pack",e.packs.on_ineligible);continue}let c=await a.readManifest();if(c==null){s(o,"packs.manifest","no run.yaml",e.packs.on_ineligible);continue}let l;try{l=(0,vq.parseYaml)(c)}catch{s(o,"packs.manifest","run.yaml does not parse",e.packs.on_ineligible);continue}let h=typeof l?.run_id=="string"?l.run_id:o;if(l?.evidence!==_b.CONTRACT_VERSION){s(h,"packs.version",`evidence ${JSON.stringify(l?.evidence)} != ${_b.CONTRACT_VERSION}`,e.packs.on_ineligible);continue}if(e.packs.require_status!=="any"&&l?.status!==e.packs.require_status){s(h,`packs.require_status=${e.packs.require_status}`,`status is ${l?.status}`,e.packs.on_ineligible);continue}if(e.packs.require_valid!=="off"){let d=await(0,_q.validate)(i,{profile:e.packs.require_valid});if(!d.valid){let p=d.diagnostics.filter(y=>y.severity==="error").length;s(h,`packs.require_valid=${e.packs.require_valid}`,`${p} validation error(s)`,e.packs.on_ineligible);continue}}let f=!1;for(let d of e.rules){if(d.file!=="run.yaml")continue;let p=(0,bi.getKey)(l,d.key);if(d.must==="same"?t.length>0&&(0,bi.violates)("same",(0,bi.getKey)(t[0].run,d.key),p):t.some(u=>(0,bi.violates)("different",(0,bi.getKey)(u.run,d.key),p))){s(h,`run.yaml ${d.key} must ${d.must}`,`value ${JSON.stringify(p)}`,d.on_violation),f=!0;break}}f||t.push({inputPath:i,container:a,run:l,label:""})}if(t.length===0)throw Bd("no eligible packs to merge");return t.forEach((i,o)=>{i.label=`${o+1}-${vb(i.run.run_id)}`}),{eligible:t,skipped:n}}});var zd=w(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.resolveCollisions=$q;wi.orderMembers=bb;wi.latestOf=wb;var wq=ht(),Eq=Ma(),Gn=Hn();async function $q(r,e){let t=new Map,n=new Set,s=[],i=new Set;for(let c of r)for(let l of await c.container.listTestIds())i.add(l);let o=new Set,a=c=>{for(let l=1;;l++){let h=`${c}-${l}`;if(!i.has(h)&&!o.has(h))return h}};for(let c of r)for(let l of await c.container.listTestIds()){if(n.has(l))continue;let h=t.get(l);if(!h){t.set(l,[{baseId:l,folder:l,members:[c]}]),o.add(l);continue}let f=h[0],[d,p]=await Promise.all([Vd(Yn(f),l),Vd(c,l)]),y=e.tests.on_collision,u=`tests.on_collision=${y}`,m=!1;for(let g of e.rules)if(g.file==="result.yaml"&&(0,Gn.violates)(g.must,(0,Gn.getKey)(d,g.key),(0,Gn.getKey)(p,g.key))){y=g.on_violation,u=`result.yaml ${g.key} must ${g.must}`,m=!0;break}let _=e.tests.identity,v=f;if(!m&&_){let g;for(let b of h){let E=await Vd(Yn(b),b.baseId);if(_.keys.every($=>(0,Gn.deepEqual)((0,Gn.getKey)(E,$),(0,Gn.getKey)(p,$)))){g=b;break}}y=g?_.on_same:_.on_different,u=g?`tests.identity.on_same=${y}`:`tests.identity.on_different=${y}`,g&&(v=g)}switch(y){case"error":throw(0,Eq.abortErr)(`test "${l}" collides between packs "${Yn(v).run.run_id}" and "${c.run.run_id}" [${u}]`);case"prefer_first":s.push({test:l,winner:Yn(v).run.run_id,rule:u});break;case"prefer_latest":{let g=Sq(Yn(v),c)===c?c:Yn(v);g===c&&(v.members=[c]),s.push({test:l,winner:g.run.run_id,rule:u});break}case"nest":v.members.push(c),s.push({test:l,winner:wb(v.members).run.run_id,rule:u,action:"nest",folder:v.folder});break;case"split":{let g=a(l);o.add(g),h.push({baseId:l,folder:g,members:[c]}),s.push({test:l,winner:c.run.run_id,rule:u,action:"split",folder:g});break}case"discard":t.delete(l),n.add(l),s.push({test:l,winner:"",rule:u});break}}return{groups:[...t.values()].flat(),collisions:s,discarded:[...n].sort()}}function bb(r){return[...r].sort((e,t)=>ja(e)-ja(t))}function wb(r){let e=bb(r);return e[e.length-1]}function ja(r){let e=typeof r.run?.ended=="string"?r.run.ended:r.run?.started,t=typeof e=="string"?Date.parse(e):NaN;return Number.isNaN(t)?-1/0:t}function Yn(r){return r.members[0]}async function Vd(r,e){let t=await r.container.readResult(e);if(t!=null)try{return(0,wq.parseYaml)(t)}catch{return}}function Sq(r,e){return ja(e)>ja(r)?e:r}});var Sb=w(Zt=>{"use strict";var Tq=Zt&&Zt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Oq=Zt&&Zt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Nq=Zt&&Zt.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&Tq(t,e,n[s]);return Oq(t,e),t}})();Object.defineProperty(Zt,"__esModule",{value:!0});Zt.assemble=Pq;var Yt=V("fs"),wt=Nq(V("path")),Iq=Mt(),Kd=gr(),Ra=ht(),Aq=zd(),Eb=Hn();async function Pq(r,e,t,n){try{await Yt.promises.access(r);let p=new Error(`output path "${r}" already exists`);throw p.code="USAGE",p}catch(p){if(p?.code==="USAGE")throw p}await Yt.promises.mkdir(r,{recursive:!0});let s=[];for(let p of n){let y=(0,Aq.orderMembers)(p.members),u=y[y.length-1],m=wt.join(r,"tests",p.folder);await xa(u.container,`tests/${p.baseId}`,m),s.push({pack:u,resultPath:wt.join(m,"result.yaml")});for(let _=0;_<y.length-1;_++){let v=wt.join(m,String(_+1));await xa(y[_].container,`tests/${p.baseId}`,v),s.push({pack:y[_],resultPath:wt.join(v,"result.yaml")})}p.folder!==p.baseId&&await $b(wt.join(m,"result.yaml"),_=>(_.set("test",p.folder),!0))}for(let p of t)await p.container.isDir("coverage")&&await xa(p.container,"coverage",wt.join(r,"coverage",p.label));let i=await Promise.all(t.map(p=>p.container.readFileBytes(Kd.CATALOG_SNAPSHOT_PATH))),o=i.every(p=>p!=null&&p.equals(i[0]))?i[0]:null;o&&(await Yt.promises.mkdir(wt.join(r,wt.dirname(Kd.CATALOG_SNAPSHOT_PATH)),{recursive:!0}),await Yt.promises.writeFile(wt.join(r,Kd.CATALOG_SNAPSHOT_PATH),o));let a=t.map(p=>p.run?.environment&&typeof p.run.environment=="object"?p.run.environment:{}),c={},l=new Set;for(let p of new Set(a.flatMap(y=>Object.keys(y)))){let y=a[0][p];a.every(u=>p in u&&(0,Eb.deepEqual)(u[p],y))?c[p]=y:l.add(p)}for(let{pack:p,resultPath:y}of s){let u=p.run?.environment??{},m=[...l].filter(_=>_ in u);m.length!==0&&await $b(y,(_,v)=>{let g=!1;for(let b of m)(0,Eb.getKey)(v,`environment.${b}`)===void 0&&(_.setIn(["environment",b],u[b]),g=!0);return g})}let h={};for(let p of t){let y=p.run?.metrics;if(!(!y||typeof y!="object"))for(let[u,m]of Object.entries(y))h[`${p.label}/${u}`]=m}let f=t.map(p=>p.run?.started).filter(p=>typeof p=="string").sort((p,y)=>Date.parse(p)-Date.parse(y))[0],d={evidence:Iq.CONTRACT_VERSION,run_id:e.runId,status:"running",title:e.title??t[0].run?.title,started:f,merged_from:t.map(p=>p.run.run_id)};Object.keys(h).length>0&&(d.metrics=h),o&&t[0].run?.metrics_catalog&&(d.metrics_catalog=t[0].run.metrics_catalog),Object.keys(c).length>0&&(d.environment=c),await Yt.promises.writeFile(wt.join(r,"run.yaml"),(0,Ra.stringifyYaml)(d),"utf8")}async function $b(r,e){let t=await Yt.promises.readFile(r,"utf8"),n=(0,Ra.parseDoc)(t);e(n,(0,Ra.parseYaml)(t))&&await Yt.promises.writeFile(r,(0,Ra.stringifyDoc)(n),"utf8")}async function xa(r,e,t){await Yt.promises.mkdir(t,{recursive:!0});for(let n of await r.listDir(e)){let s=`${e}/${n.name}`,i=wt.join(t,n.name);if(n.isDir)await xa(r,s,i);else{let o=await r.readFileBytes(s);o!=null&&await Yt.promises.writeFile(i,o)}}}});var Tb=w(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.merge=Mq;var kq=xd(),Cq=Sb(),Lq=zd(),Dq=Ma(),qq=Hn();async function Mq(r,e){let t=await(0,qq.loadRules)(e.rulesPath),{eligible:n,skipped:s}=await(0,Dq.gatePacks)(r,t),{groups:i,collisions:o,discarded:a}=await(0,Lq.resolveCollisions)(n,t);await(0,Cq.assemble)(e.out,{runId:e.runId,title:e.title},n,i);let c=jq(n),l=!1;return e.finalize&&(await(0,kq.finalize)(e.out,{endedAt:c}),l=!0),{packs:{eligible:n.map(h=>h.run.run_id),skipped:s},tests:{merged:i.length,collisions:o,discarded:a},output:{path:e.out,runId:e.runId,finalized:l,endedAt:c}}}function jq(r){let e="",t=-1/0;for(let n of r){let s=typeof n.run?.ended=="string"?n.run.ended:n.run?.started;if(typeof s!="string")continue;let i=Date.parse(s);!Number.isNaN(i)&&i>t&&(t=i,e=s)}return e}});var Ib=w(Et=>{"use strict";var Rq=Et&&Et.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),xq=Et&&Et.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Ob=Et&&Et.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&Rq(t,e,n[s]);return xq(t,e),t}})();Object.defineProperty(Et,"__esModule",{value:!0});Et.configPath=Nb;Et.loadConfig=zq;Et.resolveProfile=Kq;var Fq=V("fs"),Uq=Ob(V("os")),Bq=Ob(V("path")),Vq=Mt();function Nb(r){return r||(process.env.EVIDENCE_CONFIG?process.env.EVIDENCE_CONFIG:Bq.join(Uq.homedir(),".testmuai","evidence","config.json"))}async function zq(r){let e=Nb(r),t;try{t=await Fq.promises.readFile(e,"utf8")}catch{return{}}try{return JSON.parse(t)}catch{let n=new Error(`config at ${e} is not valid JSON`);throw n.code="USAGE",n}}function Kq(r,e){return r??e.defaultProfile??Vq.DEFAULT_PROFILE}});var Ab=w(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.RemoteZipContainer=void 0;Ei.openRemoteZip=cM;var Hq=V("zlib"),Gq=V("util"),Yq=(0,Gq.promisify)(Hq.inflateRaw),Zq=101010256,Jq=101075792,Wq=117853008,Xq=33639248,Qq=67324752,Gd=22,eM=65535,_r=4294967295,tM=65535,rM=0,nM=8;function Zr(r,e){return Number(r.readBigUInt64LE(e))}function sM(r){return r.replace(/\.evidence$/,"")}async function iM(r){let e=await r.size(),t=Math.min(e,Gd+eM),n=await r.read(e-t,t),s=-1;for(let l=n.length-Gd;l>=0;l--){if(n.readUInt32LE(l)!==Zq)continue;let h=n.readUInt16LE(l+20);if(l+Gd+h===n.length){s=l;break}}if(s===-1)throw new Error("not a zip: end-of-central-directory not found");let i=n.readUInt16LE(s+10),o=n.readUInt32LE(s+12),a=n.readUInt32LE(s+16);if(i===tM||o===_r||a===_r){let l=s-20,h=e-t;if(l>=0&&n.readUInt32LE(l)===Wq){let f=Zr(n,l+8),d=f-h,p=d>=0&&d+56<=n.length?n.subarray(d,d+56):await r.read(f,56);p.readUInt32LE(0)===Jq&&(i=Zr(p,32),o=Zr(p,40),a=Zr(p,48))}}return{cdOffset:a,cdSize:o,count:i}}function oM(r,e){let t=0;for(;t+4<=r.length;){let n=r.readUInt16LE(t),s=r.readUInt16LE(t+2),i=t+4;if(n===1){let o=i;e.uncompressedSize===_r&&o+8<=i+s&&(e.uncompressedSize=Zr(r,o),o+=8),e.compressedSize===_r&&o+8<=i+s&&(e.compressedSize=Zr(r,o),o+=8),e.localHeaderOffset===_r&&o+8<=i+s&&(e.localHeaderOffset=Zr(r,o),o+=8);return}t=i+s}}function aM(r){let e=[],t=0;for(;t+46<=r.length&&r.readUInt32LE(t)===Xq;){let n=r.readUInt16LE(t+10),s=r.readUInt32LE(t+20),i=r.readUInt32LE(t+24),o=r.readUInt16LE(t+28),a=r.readUInt16LE(t+30),c=r.readUInt16LE(t+32),l=r.readUInt32LE(t+42),h=r.toString("utf8",t+46,t+46+o),f=r.subarray(t+46+o,t+46+o+a),d={name:h,method:n,compressedSize:s,uncompressedSize:i,localHeaderOffset:l};(s===_r||i===_r||l===_r)&&oM(f,d),e.push(d),t+=46+o+a+c}return e}var Fa=class{src;packName;kind="zip";byName;names;constructor(e,t,n){this.src=e,this.packName=t,this.byName=new Map,this.names=[];for(let s of n)this.names.push(s.name),s.name.endsWith("/")||this.byName.set(s.name,s)}get name(){return sM(this.packName)}async readEntryBytes(e){let t=this.byName.get(e);if(!t)return null;let n=await this.src.read(t.localHeaderOffset,30);if(n.length<30||n.readUInt32LE(0)!==Qq)throw new Error(`corrupt local header for ${e}`);let s=n.readUInt16LE(26),i=n.readUInt16LE(28),o=t.localHeaderOffset+30+s+i,a=await this.src.read(o,t.compressedSize);if(t.method===rM)return a;if(t.method===nM)return Buffer.from(await Yq(a));throw new Error(`unsupported compression method ${t.method} for ${e}`)}async readEntryText(e){let t=await this.readEntryBytes(e);return t?t.toString("utf8"):null}hasPrefix(e){let t=e.endsWith("/")?e:`${e}/`;return this.names.some(n=>n.startsWith(t))}async readManifest(){return this.readEntryText("run.yaml")}async listTestIds(){let e=new Set;for(let t of this.names){let n=t.match(/^tests\/([^/]+)\//);n&&e.add(n[1])}return[...e].sort()}async readResult(e){return this.readEntryText(`tests/${e}/result.yaml`)}async fileExists(e,t){return this.byName.has(`tests/${e}/${t}`)}async readBytes(e,t){return this.readEntryBytes(`tests/${e}/${t}`)}async exists(e){return this.byName.has(e)||this.hasPrefix(e)}async isDir(e){return this.hasPrefix(e)}async listDir(e){let t=e===""?"":e.endsWith("/")?e:`${e}/`,n=new Map;for(let s of this.names){if(!s.startsWith(t))continue;let i=s.slice(t.length);if(i==="")continue;let o=i.indexOf("/");o===-1?n.has(i)||n.set(i,!1):n.set(i.slice(0,o),!0)}return[...n.entries()].map(([s,i])=>({name:s,isDir:i})).sort((s,i)=>s.name.localeCompare(i.name))}async readText(e){return this.readEntryText(e)}async readFileBytes(e){return this.readEntryBytes(e)}};Ei.RemoteZipContainer=Fa;async function cM(r,e){let{cdOffset:t,cdSize:n}=await iM(r),s=await r.read(t,n),i=aM(s);return new Fa(r,e,i)}});var kb=w(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.FileByteSource=void 0;var Pb=V("fs"),Yd=class{path;handle=null;cachedSize=null;constructor(e){this.path=e}async open(){return this.handle||(this.handle=await Pb.promises.open(this.path,"r")),this.handle}async size(){return this.cachedSize===null&&(this.cachedSize=(await Pb.promises.stat(this.path)).size),this.cachedSize}async read(e,t){if(t<=0)return Buffer.alloc(0);let n=await this.size(),s=Math.max(0,Math.min(e,n)),i=Math.max(0,Math.min(t,n-s));if(i===0)return Buffer.alloc(0);let o=Buffer.alloc(i),a=await this.open(),{bytesRead:c}=await a.read(o,0,i,s);return c===i?o:o.subarray(0,c)}async close(){this.handle&&(await this.handle.close(),this.handle=null)}};Ua.FileByteSource=Yd});var Cb=w((hU,lM)=>{lM.exports={name:"@testmuai/evidence-cli",version:"0.2.0",description:"An open, framework-agnostic format for what a test run produced \u2014 the .evidence pack, and the library + CLI that validate, seal, merge and judge it.",license:"Apache-2.0",author:"TestMu AI (formerly LambdaTest)",homepage:"https://github.com/LambdaTest/evidence-cli#readme",repository:{type:"git",url:"git+https://github.com/LambdaTest/evidence-cli.git"},bugs:{url:"https://github.com/LambdaTest/evidence-cli/issues"},keywords:["evidence","test-results","test-report","conformance","json-schema","validation","ci","test-automation","framework-agnostic"],engines:{node:">=20.19"},bin:{evidence:"dist/cli.js"},main:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.js"},"./package.json":"./package.json"},files:["dist"],publishConfig:{access:"public"},scripts:{build:"tsc -p tsconfig.build.json && node scripts/copy-schemas.mjs",prepack:"npm run build",test:"vitest run","test:watch":"vitest",docs:"npm --prefix design/web run dev","docs:build":"npm --prefix design/web run build","docs:install":"npm --prefix design/web install"},dependencies:{"@marcbachmann/cel-js":"^8.0.0","adm-zip":"^0.5.14",ajv:"^8.17.1","ajv-formats":"^3.0.1",commander:"^12.1.0",picocolors:"^1.0.1",yaml:"^2.5.0"},devDependencies:{"@types/adm-zip":"^0.5.5","@types/node":"^20.14.0",typescript:"^5.5.0",vitest:"^2.0.0"}}});var Zd=w(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.VERSION=void 0;var uM=Cb();Ba.VERSION=uM.version});var za=w(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.OPS=void 0;Ze.closest=Mb;Ze.didYouMean=jb;Ze.policyDiag=Zn;Ze.loadPolicy=wM;Ze.satisfiesVersion=$M;var fM=V("crypto"),Db=sd(),qb=jt(),dM=Cs(),pM=ht();Ze.OPS=["equals","min","max","range","in"];var hM=["policy","requires","gates"],mM=["catalog","version"],yM=["id","metric","expr","where",...Ze.OPS,"severity","message"];function gM(r,e){let t=Array.from({length:r.length+1},(n,s)=>[s,...Array(e.length).fill(0)]);for(let n=1;n<=e.length;n++)t[0][n]=n;for(let n=1;n<=r.length;n++)for(let s=1;s<=e.length;s++)t[n][s]=Math.min(t[n-1][s]+1,t[n][s-1]+1,t[n-1][s-1]+(r[n-1]===e[s-1]?0:1));return t[r.length][e.length]}function Mb(r,e){let t=Math.max(2,Math.floor(r.length/3));return[...e].map(n=>({c:n,d:n.startsWith(r)||r.startsWith(n)?.5:gM(r,n)})).filter(n=>n.d<=t).sort((n,s)=>n.d-s.d||n.c.localeCompare(s.c)).slice(0,3).map(n=>n.c)}function jb(r,e){let t=Mb(r,e);return t.length>0?`did you mean ${t.map(n=>`"${n}"`).join(" or ")}?`:void 0}function _M(r,e){return(t,n)=>{let s;if(n&&t.length>0){let o=t.length===1?r.contents:r.getIn(t.slice(0,-1),!0);(0,Db.isMap)(o)&&(s=o.items.find(c=>c.key?.value===t[t.length-1])?.key?.range?.[0])}else s=(t.length===0?r.contents:r.getIn(t,!0))?.range?.[0];if(s===void 0)return;let i=e.linePos(s);return{line:i.line,column:i.col}}}function Zn(r,e,t,n,s={}){let i=(0,qb.err)(e,`${r.source}#/${t.join("/")}`,n);s.severity&&(i.severity=s.severity),s.hint&&(i.hint=s.hint);let o=r.locate(t,s.key)??r.locate(t.slice(0,-1));return o&&(i.line=o.line,i.column=o.column),i}function Va(r,e){return typeof r?.id=="string"?`gates[${e}] "${r.id}"`:`gates[${e}]`}function vM(r,e){let t=r.instancePath.split("/").slice(1),n=t[0]==="gates"&&t.length>=2?Va(e?.gates?.[Number(t[1])],Number(t[1])):"policy",s=t[0]==="gates"?t.slice(2).join("."):t.join("."),i=s?`${n} ${s}`:n;return r.keyword==="required"?`${i}: missing "${r.params.missingProperty}"`:r.keyword==="enum"?`${i}: must be one of ${r.params.allowedValues.join(", ")}`:`${i}: ${r.message??"schema violation"}`}function bM(r){let e=Ze.OPS.filter(s=>r[s]!==void 0),t=r.metric!==void 0,n=r.expr!==void 0;if(t&&n)return['has both "metric" and "expr"; a gate is one or the other'];if(!t&&!n)return['needs "metric" or "expr"'];if(n){let s=[...e,...r.where!==void 0?["where"]:[]];return s.length>0?[`is an expression gate and takes no operator or where (found ${s.join(", ")})`]:[]}return e.length===0?[`needs one operator: ${Ze.OPS.join(", ")}`]:e.length>1?[`has several operators (${e.join(", ")}); use one, or range: [lo, hi]`]:[]}function wM(r,e={}){let t=e.source??"policy",{doc:n,lines:s}=(0,pM.parseDocWithLines)(r),i=_M(n,s),o={source:t,locate:i},a=[];if(n.errors.length>0){for(let m of n.errors){let _=(0,qb.err)("policy.parse",t,`policy is not valid YAML: ${m.message.split(`
|
|
160
|
+
`)[0]}`),v=m.linePos?.[0];v&&(_.line=v.line,_.column=v.col),a.push(_)}return{policy:null,diagnostics:a}}let c=n.toJS();if(!(0,Db.isMap)(n.contents))return a.push(Zn(o,"policy.schema",[],"a policy must be a mapping with `policy` and `gates`")),{policy:null,diagnostics:a};let l=(m,_,v,g)=>{if(!(m===null||typeof m!="object"||Array.isArray(m)))for(let b of Object.keys(m))_.includes(b)||a.push(Zn(o,"policy.unknown_key",[...v,b],`${g}: unknown key "${b}"`,{key:!0,hint:jb(b,_)??`allowed keys: ${_.join(", ")}`}))};l(c,hM,[],"policy"),l(c.requires,mM,["requires"],"requires");let h=Array.isArray(c.gates)?c.gates:[];h.forEach((m,_)=>l(m,yM,["gates",_],Va(m,_)));let f=(0,dM.loadToolSchema)("policy");if(!f(c))for(let m of f.errors??[]){if(m.keyword==="additionalProperties"||/\/(oneOf|not|anyOf)(\/|$)/.test(m.schemaPath))continue;let _=m.instancePath.split("/").slice(1).map(v=>/^\d+$/.test(v)?Number(v):v);a.push(Zn(o,"policy.schema",_,vM(m,c)))}let d=[],p=new Map;h.forEach((m,_)=>{if(m===null||typeof m!="object"||Array.isArray(m))return;for(let b of bM(m))a.push(Zn(o,"policy.schema",["gates",_],`${Va(m,_)} ${b}`));if(typeof m.id!="string")return;let v=i(["gates",_])?.line;if(p.has(m.id)){let b=p.get(m.id);a.push(Zn(o,"policy.duplicate_gate",["gates",_,"id"],`${Va(m,_)}: gate id "${m.id}" is already used${b?` on line ${b}`:""}`,{hint:"give every gate a unique id"}));return}p.set(m.id,v);let g=Ze.OPS.find(b=>m[b]!==void 0);d.push({id:m.id,index:_,metric:typeof m.metric=="string"?m.metric:void 0,expr:typeof m.expr=="string"?m.expr:void 0,where:typeof m.where=="string"?m.where:void 0,op:g,expected:g?m[g]:void 0,severity:m.severity==="warning"?"warning":"blocking",message:typeof m.message=="string"?m.message:void 0,line:v})});let y=c.requires&&typeof c.requires=="object"&&typeof c.requires.catalog=="string"?{catalog:c.requires.catalog,...typeof c.requires.version=="string"?{version:c.requires.version}:{}}:void 0;return{policy:{id:typeof c.policy=="string"?c.policy:"",requires:y,gates:d,sha256:(0,fM.createHash)("sha256").update(r,"utf8").digest("hex"),source:t,locate:i},diagnostics:a}}function Lb(r){return r.split(".").map(Number)}function EM(r,e){let t=Lb(r),n=Lb(e);for(let s=0;s<Math.max(t.length,n.length);s++){let i=(t[s]??0)-(n[s]??0);if(i!==0)return i}return 0}function $M(r,e){let t=String(r);return(e.match(/(>=|<=|>|<|=)?\s*[0-9]+(?:\.[0-9]+)*/g)??[]).every(s=>{let i=s.match(/^(>=|<=|>|<|=)?\s*(.+)$/),o=EM(t,i[2]);switch(i[1]){case">=":return o>=0;case"<=":return o<=0;case">":return o>0;case"<":return o<0;default:return o===0}})}});var $i=w(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.PRODUCER_PREFIX=void 0;Ke.lookupMetric=Fb;Ke.checkPolicy=Ub;Ke.lintPolicy=NM;var ot=gr(),SM=_i(),ze=za();Ke.PRODUCER_PREFIX="metrics.";function Jd(r){return`${r.id} catalog v${r.version}`}function Fb(r,e){let t=(0,ot.own)(ot.CORE_CATALOG.metrics,r);if(t)return{def:t,builtin:!0};if(r.startsWith(Ke.PRODUCER_PREFIX)){let n=r.slice(Ke.PRODUCER_PREFIX.length);if((0,ot.own)(ot.CORE_CATALOG.metrics,n))return{problem:"builtin_prefixed"};if(!e)return{problem:"no_catalog"};let s=(0,ot.own)(e.metrics,n);return s?{def:s,builtin:!1}:{problem:"unknown"}}return{problem:"unknown"}}function TM(r){return[...Object.keys(ot.CORE_CATALOG.metrics),...r?Object.keys(r.metrics).map(e=>Ke.PRODUCER_PREFIX+e):[]]}function Rb(r){return JSON.stringify(r)}function OM(r,e,t){let n=[],s=e==="range"||e==="in"?Array.isArray(t)?t:[t]:[t];if(ot.STRING_TYPES.has(r.type)){for(let i of s)typeof i!="string"?n.push({message:`${Rb(i)} is not a string, but ${r.name} is ${r.type}`}):r.values&&!r.values.includes(i)&&n.push({message:`"${i}" is not a value of ${r.name}`,hint:`values: ${r.values.join(", ")}`});return n}for(let i of s)typeof i!="number"?n.push({message:`${Rb(i)} is not a number, but ${r.name} is ${r.type}`}):ot.INTEGER_TYPES.has(r.type)&&!Number.isInteger(i)?n.push({message:`${i} is not an integer, but ${r.name} is ${r.type}`}):r.range&&(i<r.range[0]||i>r.range[1])&&n.push({message:`${i} is outside the range of ${r.name} [${r.range[0]}, ${r.range[1]}]`});return e==="range"&&Array.isArray(t)&&typeof t[0]=="number"&&typeof t[1]=="number"&&t[0]>t[1]&&n.push({message:`range [${t[0]}, ${t[1]}] has lo > hi`}),n}function xb(r,e,t,n,s){let i=e[t],o=["gates",e.index,t],a=(0,SM.compileExpr)(i,n);return"run"in a?a.type!=="bool"&&a.type!=="dyn"?[(0,ze.policyDiag)(r,"policy.expr_type",o,`${s}: ${t} must be a bool, but "${i}" is ${a.type}`,{hint:t==="where"?"e.g. 'checkout' in test.tags":"compare or test something, e.g. totals.failed == 0"})]:[]:[(0,ze.policyDiag)(r,a.code,o,`${s}: ${a.message}`,{hint:a.hint})]}function Ub(r,e={}){let t=e.catalog??null,n=[],s=`searched evidence-core ${ot.CORE_CATALOG.version}${t?` and ${Jd(t)}`:""}`;if(r.requires){let i=["requires"],o=`${r.requires.catalog}${r.requires.version?` ${r.requires.version}`:""}`;t?(t.id!==r.requires.catalog||r.requires.version&&!(0,ze.satisfiesVersion)(t.version,r.requires.version))&&n.push((0,ze.policyDiag)(r,"policy.catalog_required",i,`policy requires catalog ${o}, but the catalog is ${Jd(t)}`,{hint:`the pack carries ${Jd(t)}`})):e.pack?n.push((0,ze.policyDiag)(r,"policy.catalog_required",i,`policy requires catalog ${o}, but the pack carries no metric catalog`,{hint:"seal the pack with its producer's catalog snapshot"})):n.push((0,ze.policyDiag)(r,"policy.catalog_needed",i,`policy requires catalog ${o}; no catalog was given to check it against`,{severity:"warning",hint:"pass --catalog <file>, or use kane-cli evidence lint-policy"}))}for(let i of r.gates){let o=`gates[${i.index}] "${i.id}"`;if(i.expr!==void 0){n.push(...xb(r,i,"expr","pack",o));continue}if(i.metric===void 0)continue;let a=["gates",i.index,"metric"],c=Fb(i.metric,t);if("problem"in c){if(c.problem==="no_catalog")e.pack||n.push((0,ze.policyDiag)(r,"policy.catalog_needed",a,`${o}: "${i.metric}" is a producer metric and no catalog was given to check it against`,{severity:"warning",hint:"pass --catalog <file>, or use kane-cli evidence lint-policy"}));else if(c.problem==="builtin_prefixed"){let f=i.metric.slice(Ke.PRODUCER_PREFIX.length);n.push((0,ze.policyDiag)(r,"policy.builtin_prefixed",a,`${o}: "${i.metric}" does not exist; "${f}" is built-in`,{hint:`write metric: ${f}`}))}else{let f=!i.metric.startsWith(Ke.PRODUCER_PREFIX)&&(0,ot.own)(t?.metrics,i.metric)?Ke.PRODUCER_PREFIX+i.metric:void 0,d=f?[]:(0,ze.closest)(i.metric,TM(t)),p=f?`producer metrics are always prefixed: write metric: ${f}`:`${d.length>0?`did you mean ${d.map(y=>`"${y}"`).join(" or ")}? `:""}(${s})`;n.push((0,ze.policyDiag)(r,"policy.unknown_metric",a,`${o}: unknown metric "${i.metric}"`,{hint:p}))}continue}let l=c.def,h=ot.OPS_BY_TYPE[l.type];if(i.op&&!h.includes(i.op))n.push((0,ze.policyDiag)(r,"policy.op_not_allowed",["gates",i.index,i.op],`${o}: "${i.op}" is not allowed on "${i.metric}" (type ${l.type})`,{key:!0,hint:`use one of: ${h.join(", ")}`}));else if(i.op)for(let f of OM(l,i.op,i.expected))n.push((0,ze.policyDiag)(r,"policy.value_type",["gates",i.index,i.op],`${o}: ${f.message}`,{hint:f.hint??`expected ${l.type}${l.range?` within [${l.range[0]}, ${l.range[1]}]`:""}`}));if(i.where!==void 0)if(l.per_test)n.push(...xb(r,i,"where","test",o));else{let f=[...Object.values(ot.CORE_CATALOG.metrics).filter(d=>d.per_test).map(d=>d.name),...t?Object.values(t.metrics).filter(d=>d.per_test).map(d=>Ke.PRODUCER_PREFIX+d.name):[]];n.push((0,ze.policyDiag)(r,"policy.where_not_per_test",["gates",i.index,"where"],`${o}: "${i.metric}" is a whole-run metric and cannot be narrowed with where`,{hint:`per-test metrics: ${f.join(", ")}`}))}}return n}function NM(r,e={}){let{policy:t,diagnostics:n}=(0,ze.loadPolicy)(r,{source:e.source});return(t?[...Ub(t,{catalog:e.catalog}),...n]:n).map((i,o)=>({d:i,i:o})).sort((i,o)=>(i.d.line??1/0)-(o.d.line??1/0)||i.i-o.i).map(i=>i.d)}});var Wb=w(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.testFact=Vb;Jn.countTotals=zb;Jn.failureRows=Yb;Jn.resolveMetric=MM;var IM=jt(),AM=Ma(),Bb=Hn(),vr=gr(),Jr=_i(),PM=$i(),Wd=kd();function Vb(r){let e=r.result&&typeof r.result=="object"?r.result:{};return{...e,id:r.id,tags:Array.isArray(e.tags)?e.tags:[],requirements:Array.isArray(e.requirements)?e.requirements:[],steps:Array.isArray(e.steps)?e.steps:[],flaky:typeof e.flaky=="boolean"?e.flaky:!1}}function zb(r){let e={tests:0n,passed:0n,failed:0n,broken:0n,skipped:0n};for(let t of r){e.tests++;let n=t.status;(n==="passed"||n==="failed"||n==="broken"||n==="skipped")&&e[n]++}return e}function J(r,e,t,n={}){let s=(0,IM.err)(r,e,t);return n.hint&&(s.hint=n.hint),{error:s,trust:n.trust??null,actual:n.actual??null,stored:n.stored??null}}var W=class extends Error{resolution;constructor(e){super("unresolved"),this.resolution=e}};function Ka(r,e,t){try{return(0,Jr.evalExpr)(e,(0,Jr.makeFacts)(t))}catch(n){throw n instanceof Jr.ExprEvalError?new W(J("verdict.expr_error",r,`${r}: ${n.message}`,{trust:"recomputed"})):n}}function Kb(r,e,t){let n=e.tests.map(Vb),s=e.tests.map(a=>a.id);if(t===void 0)return{tests:n,ids:s};let i=(0,Jr.compileExpr)(t,"test");if(!("run"in i))throw new W(J(i.code,r,`${r}: where ${i.message}`,{hint:i.hint}));let o=[];return n.forEach((a,c)=>{let l=Ka(r,i,{test:a,file:e.tests[c].result,run:e.run??{}});if(typeof l!="boolean")throw new W(J("verdict.expr_error",r,`${r}: where gave ${JSON.stringify(l)} for test "${s[c]}", not a bool`));l&&o.push(c)}),{tests:o.map(a=>n[a]),ids:o.map(a=>s[a])}}function Hb(r,e,t){if(e==="sum")return t.reduce((n,s)=>n+s,0);if(t.length===0)throw new W(J("verdict.metric_missing",r,`${r}: no test has a value to take the ${e} of`,{trust:"recomputed"}));switch(e){case"min":return Math.min(...t);case"max":return Math.max(...t);case"mean":return t.reduce((n,s)=>n+s,0)/t.length;case"p50":return(0,Jr.percentile)(t,50);case"p90":return(0,Jr.percentile)(t,90);default:return(0,Jr.percentile)(t,95)}}function Gb(r,e,t,n){let s=r.verify;if(s.kind==="expr")return{value:Ka(e,s.expr,{run:t.run??{},tests:n.tests,totals:zb(n.tests),failures:Yb(t)}),trust:"recomputed"};if(s.kind==="aggregate"){let i=[],o=0;return n.tests.forEach((a,c)=>{let l=n.ids[c],h;if(s.over===vr.DEFAULT_OVER)h=t.tests.find(p=>p.id===l)?.result;else{let p=`tests/${l}/${s.over.slice(8)}`,y=(0,vr.own)(t.files,p);if(!y)return;if("error"in y)throw new W(J("verdict.metric_missing",e,`${e}: ${y.error}`,{trust:"recomputed"}));h=y.value}let f={test:a,file:h,run:t.run??{}};if(s.where){let p=Ka(e,s.where,f);if(typeof p!="boolean")throw new W(J("verdict.expr_error",e,`${e}: where gave ${JSON.stringify(p)} for test "${l}", not a bool`,{trust:"recomputed"}));if(!p)return}let d;if(s.path!==void 0?d=(0,Bb.getKey)(h,s.path):s.value&&(d=Ka(e,s.value,f)),s.aggregate==="count"){(s.path===void 0&&!s.value||d!=null)&&o++;return}if(d==null){let p=s.path!==void 0?s.path:`value ${s.value.src}`;throw new W(J("verdict.metric_missing",e,`${e}: test "${l}" has no ${p}`,{trust:"recomputed",hint:s.path!==void 0?`when only some tests carry ${s.path}, the catalog narrows the metric with where: has(test.${s.path})`:void 0}))}if(typeof d!="number")throw new W(J("verdict.value_type",e,`${e}: test "${l}" gives ${JSON.stringify(d)}, not a number`,{trust:"recomputed"}));i.push(d)}),{value:s.aggregate==="count"?o:Hb(e,s.aggregate,i),trust:"recomputed"}}if(s.kind==="file"){let i=(0,vr.own)(t.files,s.file);if(!i)throw new W(J("verdict.metric_missing",e,`${e}: ${s.file} is not in the pack`,{trust:"file"}));if("error"in i)throw new W(J("verdict.metric_missing",e,`${e}: ${i.error}`,{trust:"file"}));let o=(0,Bb.getKey)(i.value,s.path);if(o==null)throw new W(J("verdict.metric_missing",e,`${e}: ${s.file} has no ${s.path}`,{trust:"file"}));return{value:o,trust:"file"}}return{value:kM(r,e,t),trust:"stored"}}function Yb(r){let e=(0,vr.own)(r.files,"failure.yaml"),t=e&&"value"in e?e.value?.failures:void 0;return Array.isArray(t)?t:[]}function Zb(r,e,t,n){if(n.type!==r.type)throw new W(J("verdict.stored_type",e,`${e}: ${t} type "${n.type}" is not the catalog's "${r.type}"`,{trust:"stored",actual:n.value}));if(r.unit&&n.unit!==void 0&&n.unit!==r.unit)throw new W(J("verdict.stored_type",e,`${e}: ${t} unit "${n.unit}" is not the catalog's "${r.unit}"`,{trust:"stored",actual:n.value}));return n.value}function kM(r,e,t){let n=(0,vr.own)(t.run?.metrics,r.name);if(!n||typeof n!="object"||n.value===void 0)throw new W(J("verdict.metric_missing",e,`${e}: run.yaml has no metrics.${r.name}`,{trust:"stored"}));return Zb(r,e,"stored",n)}function CM(r,e,t){let n=Array.isArray(t.run?.merged_from)?t.run.merged_from:[],s=Object.entries(t.run?.metrics??{}),i=[];if(n.forEach((o,a)=>{let c=`${a+1}-${(0,AM.sanitizeLabel)(String(o))}`,l=s.filter(([h])=>h===`${c}/${r.name}`||h.startsWith(`${c}/`)&&h.endsWith(`/${r.name}`));if(l.length===0)throw new W(J("verdict.metric_missing",e,`${e}: merged source ${c} stored no metrics.${r.name}`,{trust:"stored",hint:`every merged pack must store metrics.${r.name} for a merge: ${r.merge} metric`}));for(let[h,f]of l){if(!f||typeof f!="object"||typeof f.value!="number")throw new W(J("verdict.stored_type",e,`${e}: ${h} is not a number`,{trust:"stored"}));i.push(Jb(r,e,Zb(r,e,h,f),"stored",`${e}: ${h}`))}}),i.length===0)throw new W(J("verdict.metric_missing",e,`${e}: the merged pack lists no merged_from sources`,{trust:"stored"}));return i}function Jb(r,e,t,n,s=e){if(vr.STRING_TYPES.has(r.type)){if(typeof t!="string")throw new W(J("verdict.value_type",e,`${s}: ${JSON.stringify(t)} is not a string (type ${r.type})`,{trust:n,actual:t}));if(r.values&&!r.values.includes(t))throw new W(J("verdict.out_of_range",e,`${s}: "${t}" is not one of ${r.values.join(", ")}`,{trust:n,actual:t}));return t}if(typeof t!="number"||!Number.isFinite(t))throw new W(J("verdict.value_type",e,`${s}: ${JSON.stringify(t)} is not a number (type ${r.type})`,{trust:n,actual:t}));if(vr.INTEGER_TYPES.has(r.type)&&!Number.isInteger(t))throw new W(J("verdict.value_type",e,`${s}: ${t} is not an integer (type ${r.type})`,{trust:n,actual:t}));if(r.range&&(t<r.range[0]||t>r.range[1]))throw new W(J("verdict.out_of_range",e,`${s}: ${t} is outside [${r.range[0]}, ${r.range[1]}]`,{trust:n,actual:t}));return t}function LM(r,e){return typeof r=="number"&&typeof e=="number"?Math.abs(r-e)<=1e-9*Math.max(1,Math.abs(r),Math.abs(e)):r===e}function DM(r,e,t,n){if(r.merge==="none")throw new W(J("verdict.merge_none",e,`${e} cannot be judged on a merged pack: its merge rule is none`,{hint:"the catalog must give it a merge rule (sum, min, max, mean or recompute)"}));if(r.merge==="recompute")return Gb(r,e,t,Kb(e,t,n));if(n!==void 0)throw new W(J("verdict.merge_unsupported",e,`${e}: where cannot narrow a merged stored value (merge: ${r.merge})`));let s=CM(r,e,t);return{value:Hb(e,r.merge,s),trust:"stored"}}function qM(r,e,t){let n=(0,Wd.parseSemver)(r.min_producer);if(!n)return;let s=t.run?.environment?.producer,i=t.tests.length>0?t.tests.map(o=>o.result?.environment?.producer?.version??s?.version):[s?.version];for(let o of new Set(i)){let a=(0,Wd.parseSemver)(o);if(!a)throw new W(J("verdict.producer_version",e,`${e}: the pack records no producer version${o===void 0?"":` it can read (${JSON.stringify(o)})`}, and the metric needs ${r.min_producer} or later`,{hint:"the producer writes environment.producer.version into run.yaml"}));if((0,Wd.compareSemver)(a,n)<0)throw new W(J("verdict.producer_version",e,`${e}: needs a producer at ${r.min_producer} or later, but the pack was written by ${o}`,{hint:"judge a pack written by a newer producer, or gate on a metric this producer writes"}))}}function MM(r,e,t,n){let s=t.find(a=>!a.builtin)??null,i=(0,PM.lookupMetric)(r,s);if("problem"in i)return i.problem==="no_catalog"?J("verdict.catalog_missing",r,`pack has no metric catalog; ${r} can't be checked`,{hint:"the producer must seal the pack with its catalog snapshot"}):J("policy.unknown_metric",r,`unknown metric "${r}"`);let o=i.def;try{i.builtin||qM(o,r,e);let{value:a,trust:c}=!i.builtin&&e.merged?DM(o,r,e,n):Gb(o,r,e,Kb(r,e,n)),l=Jb(o,r,a,c);if(!i.builtin&&!e.merged&&n===void 0&&c!=="stored"){let h=(0,vr.own)(e.run?.metrics,o.name);if(h&&typeof h=="object"&&h.value!==void 0&&!LM(l,h.value))return J("verdict.stored_mismatch",r,`${r}: the stored value ${JSON.stringify(h.value)} disagrees with the recomputed ${JSON.stringify(l)}`,{trust:c,actual:l,stored:h.value,hint:`the producer's run.yaml metrics.${o.name} does not match the pack's own files`})}return{value:l,trust:c}}catch(a){if(a instanceof W)return a.resolution;throw a}}});var Xd=w(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.EXIT_CODES=Dt.EVALUATOR=void 0;Dt.judge=VM;var jM=Zd(),Xb=gr(),Ha=_i(),RM=$i(),Ga=Wb();Dt.EVALUATOR=`evidence-cli ${jM.VERSION}`;Dt.EXIT_CODES={pass:0,fail:1,errored:3};function Qb(r){return{code:r.code,message:r.message,hint:r.hint??null}}function xM(r,e,t){switch(r){case"equals":return t===e;case"min":return t>=e;case"max":return t<=e;case"range":{let[n,s]=e;return t>=n&&t<=s}case"in":return e.includes(t)}}function ew(r,e){return r?"pass":e==="blocking"?"fail":"warn"}function FM(r,e,t){let n={id:r.id,metric:r.metric,where:r.where??null,op:r.op,expected:r.expected,severity:r.severity,message:r.message??null},s=(0,Ga.resolveMetric)(r.metric,e,t,r.where);return"error"in s?{...n,actual:s.actual,status:"errored",trust:s.trust,error:Qb(s.error),stored:s.stored}:{...n,actual:s.value,status:ew(xM(r.op,r.expected,s.value),r.severity),trust:s.trust,error:null,stored:null}}function UM(r,e){let t={id:r.id,expr:r.expr,where:null,op:"expr",expected:!0,severity:r.severity,message:r.message??null,stored:null},n=(a,c,l)=>({...t,actual:null,status:"errored",trust:null,error:{code:a,message:c,hint:l??null}}),s=(0,Ha.compileExpr)(r.expr,"pack");if(!("run"in s))return n(s.code,s.message,s.hint);let i=e.tests.map(Ga.testFact),o;try{o=(0,Ha.evalExpr)(s,(0,Ha.makeFacts)({run:e.run??{},tests:i,totals:(0,Ga.countTotals)(i),failures:(0,Ga.failureRows)(e)}))}catch(a){if(a instanceof Ha.ExprEvalError)return n(a.code,a.message);throw a}return typeof o!="boolean"?n("verdict.expr_error",`expr gave ${JSON.stringify(o)}, not a bool`):{...t,actual:o,status:ew(o,r.severity),trust:"recomputed",error:null}}function BM(r){if(r.status!=="finalized")return{code:"verdict.unfinalized",message:`the pack is ${r.status??"unreadable"}, not finalized; only a sealed pack can be judged`,hint:"run evidence finalize first"};if(!r.validation.valid){let e=r.validation.diagnostics.filter(n=>n.severity==="error"),t=e[0];return{code:"verdict.pack_invalid",message:`the pack fails L0 validation with ${e.length} error(s)${t?`; first: ${t.location}: ${t.message} [${t.code}]`:""}`,hint:"run evidence validate on the pack"}}return null}function VM(r,e,t=r.catalog?[Xb.CORE_CATALOG,r.catalog]:[Xb.CORE_CATALOG],n={}){let s=t.find(c=>!c.builtin)??null,i={result:"pass",evaluated_at:n.evaluatedAt??new Date().toISOString(),evaluator:Dt.EVALUATOR,pack:{run_id:r.runId,sha256:r.sha256,contract:r.contract},policy:{id:e.id,sha256:e.sha256},catalog:r.catalogProvenance,error:null,gates:[],failed_gates:[],warnings:[],errored_gates:[],exit_code:0},o=(0,RM.checkPolicy)(e,{catalog:s,pack:!0}).filter(c=>c.severity==="error"),a=BM(r)??(o.length>0?Qb({code:o[0].code,message:o.length===1?o[0].message:`${o.length} policy problems against this pack: ${o.map(c=>`${c.message} [${c.code}]`).join("; ")}`,hint:o[0].hint}):null);if(a)return i.error=a,i.result="errored",i.exit_code=Dt.EXIT_CODES.errored,i;for(let c of e.gates){let l=c.expr!==void 0?UM(c,r):FM(c,r,t);i.gates.push(l),l.status==="fail"&&i.failed_gates.push(l.id),l.status==="warn"&&i.warnings.push(l.id),l.status==="errored"&&i.errored_gates.push(l.id)}return i.result=i.errored_gates.length>0?"errored":i.failed_gates.length>0?"fail":"pass",i.exit_code=Dt.EXIT_CODES[i.result],i}});var tp=w(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.loadPackFacts=JM;var tw=V("crypto"),rw=V("fs"),zM=es(),KM=Da(),Qd=ht(),Wn=gr();async function HM(r){let e=(0,tw.createHash)("sha256");for await(let t of(0,rw.createReadStream)(r))e.update(t);return e.digest("hex")}function GM(r,e){try{return{value:r.endsWith(".json")?JSON.parse(e):(0,Qd.parseYaml)(e)}}catch(t){return{error:`${r} does not parse: ${t?.message??t}`}}}function YM(r,e){let t=new Set(["failure.yaml"]);for(let n of r)for(let s of Object.values(n.metrics))if(s.verify.kind==="file"&&t.add(s.verify.file),s.verify.kind==="aggregate"&&s.verify.over!==Wn.DEFAULT_OVER){let i=s.verify.over.slice(8);for(let o of e)t.add(`tests/${o}/${i}`)}return[...t].sort()}async function ZM(r,e){let t={};for(let n of e){let s=await r.readText(n);s!=null&&(t[n]=GM(n,s))}return t}async function JM(r){let e=await rw.promises.stat(r),t=await(0,zM.openContainer)(r),n=await(0,KM.validate)(r,{profile:"L0"}),s=await t.readManifest(),i=null;if(s!=null)try{i=(0,Qd.parseYaml)(s)}catch{i=null}let o=[];for(let d of await t.listTestIds()){let p=await t.readResult(d);if(p!=null)try{o.push({id:d,result:(0,Qd.parseYaml)(p)})}catch{}}let a=null,c=null,l=await t.readFileBytes(Wn.CATALOG_SNAPSHOT_PATH);if(l!=null&&(a=(0,Wn.lintCatalog)(l.toString("utf8"),{location:Wn.CATALOG_SNAPSHOT_PATH}).catalog,a)){let d=i?.metrics_catalog?.source;c={id:a.id,version:a.version,sha256:(0,tw.createHash)("sha256").update(l).digest("hex"),source:typeof d=="string"?d:null}}let h=a?[Wn.CORE_CATALOG,a]:[Wn.CORE_CATALOG],f=await ZM(t,YM(h,o.map(d=>d.id)));return{target:r,sha256:e.isDirectory()?null:await HM(r),runId:typeof i?.run_id=="string"?i.run_id:null,contract:typeof i?.evidence=="string"?i.evidence:null,status:typeof i?.status=="string"?i.status:null,run:i,merged:Array.isArray(i?.merged_from),tests:o,catalog:a,catalogProvenance:c,files:f,validation:n}}});var ow=w(qe=>{"use strict";var WM=qe&&qe.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),XM=qe&&qe.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),QM=qe&&qe.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&WM(t,e,n[s]);return XM(t,e),t}})();Object.defineProperty(qe,"__esModule",{value:!0});qe.PolicyUsageError=void 0;qe.loadPolicies=sw;qe.verdict=oj;qe.verdictFileName=iw;qe.writeVerdicts=aj;qe.combinedExitCode=cj;var nw=V("fs"),ej=QM(V("path")),tj=Xd(),rj=tp(),nj=$i(),sj=za(),Ya=class extends Error{problems;code="USAGE";constructor(e,t=[]){super(e),this.problems=t}};qe.PolicyUsageError=Ya;function Si(r,e=[]){throw new Ya(r,e)}function sw(r){r.length===0&&Si("at least one policy is required");let e=[],t=[];if(r.forEach((s,i)=>{let o=s.path??`policy[${i}]`,{policy:a,diagnostics:c}=(0,sj.loadPolicy)(s.content,{source:o}),l=c.filter(h=>h.severity==="error");!a||l.length>0?t.push({source:o,diagnostics:l}):e.push(a)}),t.length>0){let s=t.reduce((i,o)=>i+o.diagnostics.length,0);Si(`${s} problem(s) in ${t.length} policy file(s); nothing was judged`,t)}let n=new Set;for(let s of e)n.has(s.id)&&Si(`two policies are named "${s.id}"; each verdict is written to <policy-id>.verdict.json, so ids must differ`),n.add(s.id);return e}function ij(r,e){let t=[];for(let n of r){let s=(0,nj.checkPolicy)(n,{catalog:e.catalog,pack:!0}).filter(i=>i.severity==="error"&&i.code!=="policy.catalog_required");s.length>0&&t.push({source:n.source,diagnostics:s})}if(t.length>0){let n=t.reduce((s,i)=>s+i.diagnostics.length,0);Si(`${n} problem(s) in ${t.length} policy file(s) against the pack's metric catalog; nothing was judged`,t)}}async function oj(r,e){let t=sw(e.policies),n;try{n=await(0,rj.loadPackFacts)(r)}catch(i){Si(`cannot read pack "${r}": ${i?.message??i}`)}ij(t,n);let s=e.evaluatedAt??new Date().toISOString();return t.map(i=>(0,tj.judge)(n,i,void 0,{evaluatedAt:s}))}function iw(r){return`${r.policy.id}.verdict.json`}async function aj(r,e){await nw.promises.mkdir(e,{recursive:!0});let t=[];for(let n of r){let s=ej.join(e,iw(n));await nw.promises.writeFile(s,JSON.stringify(n,null,2)+`
|
|
161
|
+
`,"utf8"),t.push(s)}return t}function cj(r){return r.some(e=>e.result==="errored")?3:r.some(e=>e.result==="fail")?1:0}});var sp=w(I=>{"use strict";var lj=I&&I.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),uj=I&&I.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&lj(e,r,t)};Object.defineProperty(I,"__esModule",{value:!0});I.VERSION=I.loadPackFacts=I.CatalogLoadError=I.CATALOG_SNAPSHOT_PATH=I.CORE_CATALOG=I.lintCatalog=I.loadCatalog=I.loadPolicy=I.lintPolicy=I.EVALUATOR=I.judge=I.PolicyUsageError=I.combinedExitCode=I.verdictFileName=I.writeVerdicts=I.loadPolicies=I.verdict=I.FileByteSource=I.openRemoteZip=I.RemoteZipContainer=I.ZipContainer=I.DirectoryContainer=I.openContainer=I.configPath=I.resolveProfile=I.loadConfig=I.merge=I.sweepIncomplete=I.finalize=I.validate=void 0;var fj=Da();Object.defineProperty(I,"validate",{enumerable:!0,get:function(){return fj.validate}});var aw=xd();Object.defineProperty(I,"finalize",{enumerable:!0,get:function(){return aw.finalize}});Object.defineProperty(I,"sweepIncomplete",{enumerable:!0,get:function(){return aw.sweepIncomplete}});var dj=Tb();Object.defineProperty(I,"merge",{enumerable:!0,get:function(){return dj.merge}});var rp=Ib();Object.defineProperty(I,"loadConfig",{enumerable:!0,get:function(){return rp.loadConfig}});Object.defineProperty(I,"resolveProfile",{enumerable:!0,get:function(){return rp.resolveProfile}});Object.defineProperty(I,"configPath",{enumerable:!0,get:function(){return rp.configPath}});uj(Mt(),I);var np=es();Object.defineProperty(I,"openContainer",{enumerable:!0,get:function(){return np.openContainer}});Object.defineProperty(I,"DirectoryContainer",{enumerable:!0,get:function(){return np.DirectoryContainer}});Object.defineProperty(I,"ZipContainer",{enumerable:!0,get:function(){return np.ZipContainer}});var cw=Ab();Object.defineProperty(I,"RemoteZipContainer",{enumerable:!0,get:function(){return cw.RemoteZipContainer}});Object.defineProperty(I,"openRemoteZip",{enumerable:!0,get:function(){return cw.openRemoteZip}});var pj=kb();Object.defineProperty(I,"FileByteSource",{enumerable:!0,get:function(){return pj.FileByteSource}});var Xn=ow();Object.defineProperty(I,"verdict",{enumerable:!0,get:function(){return Xn.verdict}});Object.defineProperty(I,"loadPolicies",{enumerable:!0,get:function(){return Xn.loadPolicies}});Object.defineProperty(I,"writeVerdicts",{enumerable:!0,get:function(){return Xn.writeVerdicts}});Object.defineProperty(I,"verdictFileName",{enumerable:!0,get:function(){return Xn.verdictFileName}});Object.defineProperty(I,"combinedExitCode",{enumerable:!0,get:function(){return Xn.combinedExitCode}});Object.defineProperty(I,"PolicyUsageError",{enumerable:!0,get:function(){return Xn.PolicyUsageError}});var lw=Xd();Object.defineProperty(I,"judge",{enumerable:!0,get:function(){return lw.judge}});Object.defineProperty(I,"EVALUATOR",{enumerable:!0,get:function(){return lw.EVALUATOR}});var hj=$i();Object.defineProperty(I,"lintPolicy",{enumerable:!0,get:function(){return hj.lintPolicy}});var mj=za();Object.defineProperty(I,"loadPolicy",{enumerable:!0,get:function(){return mj.loadPolicy}});var Ti=gr();Object.defineProperty(I,"loadCatalog",{enumerable:!0,get:function(){return Ti.loadCatalog}});Object.defineProperty(I,"lintCatalog",{enumerable:!0,get:function(){return Ti.lintCatalog}});Object.defineProperty(I,"CORE_CATALOG",{enumerable:!0,get:function(){return Ti.CORE_CATALOG}});Object.defineProperty(I,"CATALOG_SNAPSHOT_PATH",{enumerable:!0,get:function(){return Ti.CATALOG_SNAPSHOT_PATH}});Object.defineProperty(I,"CatalogLoadError",{enumerable:!0,get:function(){return Ti.CatalogLoadError}});var yj=tp();Object.defineProperty(I,"loadPackFacts",{enumerable:!0,get:function(){return yj.loadPackFacts}});var gj=Zd();Object.defineProperty(I,"VERSION",{enumerable:!0,get:function(){return gj.VERSION}})});var ip=ap(sp(),1),qt=ap(sp(),1);function Oi(r){let e=ip[r];if(typeof e!="function")throw new Error(`this kane-cli build's evidence-cli has no ${r} (needs @testmuai/evidence-cli 0.2.0)`);return e}async function $U(r,e="L1"){let t=await(0,qt.validate)(r,{profile:e});return{valid:t.valid,status:t.status??null,diagnostics:t.diagnostics??[]}}async function SU(r,e){let t=await(0,qt.finalize)(r,{endedAt:e});return{totals:t.totals,sealedPath:t.sealedPath}}async function TU(r){return(0,qt.sweepIncomplete)(r)}async function OU(r,e){return(0,qt.merge)(r,e)}function NU(r){let e=r.output.endedAt;if(typeof e!="string")throw new Error("this kane-cli build's evidence-cli reports no merge end time (needs @testmuai/evidence-cli 0.2.0)");return e}async function IU(r,e){return(await(0,qt.openContainer)(r)).readText(e)}async function AU(r,e){return Oi("verdict")(r,{policies:e})}async function PU(r,e){return Oi("lintPolicy")(r,{source:e.source,...e.catalogYaml!==void 0?{catalog:Oi("loadCatalog")(e.catalogYaml)}:{}})}function kU(){let r=ip.CORE_CATALOG;if(!r)throw new Error("this kane-cli build's evidence-cli has no CORE_CATALOG (needs @testmuai/evidence-cli 0.2.0)");return r}function CU(r){return Oi("loadCatalog")(r)}async function LU(r,e){return Oi("writeVerdicts")(r,e)}export{$U as a,SU as b,TU as c,OU as d,NU as e,IU as f,AU as g,PU as h,kU as i,CU as j,LU as k};
|