@highstate/designer 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +4 -4
- package/.output/public/_nuxt/{f3TOpYbw.js → -OnKOwAh.js} +1 -1
- package/.output/public/_nuxt/32ctXXKs.js +1 -0
- package/.output/public/_nuxt/{DCR009rv.js → 5gjbd9sK.js} +1 -1
- package/.output/public/_nuxt/{DQHHT9y-.js → 9OHRRPkh.js} +1 -1
- package/.output/public/_nuxt/{Dbwml2gB.js → B-dJABhs.js} +1 -1
- package/.output/public/_nuxt/{rcFevLEP.js → B2SoM2pd.js} +1 -1
- package/.output/public/_nuxt/{G13IRnB2.js → B4FDp1sn.js} +1 -1
- package/.output/public/_nuxt/{BxaP9l2T.js → B7RpoNQl.js} +1 -1
- package/.output/public/_nuxt/BA47KaF1.js +1 -0
- package/.output/public/_nuxt/{Cm-2nZ05.js → BArXRmKu.js} +1 -1
- package/.output/public/_nuxt/{ziXKbM2N.js → BCJKqJxW.js} +1 -1
- package/.output/public/_nuxt/{BDs6uo3D.js → BD_Kvn-W.js} +1 -1
- package/.output/public/_nuxt/{CV5MeYf9.js → BIPWeF69.js} +1 -1
- package/.output/public/_nuxt/{DxERyYWQ.js → BKIVPvZX.js} +1 -1
- package/.output/public/_nuxt/BN7gUcg9.js +1 -0
- package/.output/public/_nuxt/{CcOKGYBt.js → BTd2ZN65.js} +1 -1
- package/.output/public/_nuxt/{D6fh7rEe.js → BXphdu9w.js} +1 -1
- package/.output/public/_nuxt/{BuJgCY_C.js → BYmSxWA_.js} +1 -1
- package/.output/public/_nuxt/{BkNNRtnm.js → BdRuKvw2.js} +1 -1
- package/.output/public/_nuxt/{BA0jw7CM.js → Bdd5S2WL.js} +1 -1
- package/.output/public/_nuxt/BeH2EWoN.js +1 -0
- package/.output/public/_nuxt/{CPZSvMBB.js → BhozkjGO.js} +1 -1
- package/.output/public/_nuxt/{xp27HhqZ.js → Bl_Sz9PU.js} +1 -1
- package/.output/public/_nuxt/{ChaZkl1J.js → Bs8TB6Bu.js} +1 -1
- package/.output/public/_nuxt/{DsS90Fp6.js → BtrNScOx.js} +1 -1
- package/.output/public/_nuxt/{DyMmfYiE.js → Bu1xs0Fv.js} +1 -1
- package/.output/public/_nuxt/{o_m1mZtJ.js → BupMEc6X.js} +1 -1
- package/.output/public/_nuxt/{GDxZ_Nvm.js → Bv_vOb-Y.js} +1 -1
- package/.output/public/_nuxt/{rgN_MdZl.js → BwKAHWnp.js} +1 -1
- package/.output/public/_nuxt/{CaJ-zn_Z.js → ByE1aAlg.js} +1 -1
- package/.output/public/_nuxt/{BDAHnC4j.js → BzhaMbyl.js} +1 -1
- package/.output/public/_nuxt/{Aopv2gwH.js → C2zyO9uX.js} +1 -1
- package/.output/public/_nuxt/{DOMRsNpU.js → C4XpvUuq.js} +1 -1
- package/.output/public/_nuxt/C5BYcBs_.js +1 -0
- package/.output/public/_nuxt/{tsyQDnRt.js → C973_vs5.js} +1 -1
- package/.output/public/_nuxt/{BlfjmxyP.js → CBIEPWAA.js} +1 -1
- package/.output/public/_nuxt/{BUNf2Yb8.js → CBVcjGJL.js} +1 -1
- package/.output/public/_nuxt/CENFIVCM.js +1 -0
- package/.output/public/_nuxt/{DCinzvm1.js → CJN4g-3R.js} +1 -1
- package/.output/public/_nuxt/{DCBCRx0O.js → CPsHsqGU.js} +1 -1
- package/.output/public/_nuxt/{DWQRqdcR.js → CTRkBkra.js} +1 -1
- package/.output/public/_nuxt/{BLF3u89x.js → CYL3VlR9.js} +1 -1
- package/.output/public/_nuxt/CYpkKp66.js +1 -0
- package/.output/public/_nuxt/{D27ZAKIj.js → CaehGOgh.js} +1 -1
- package/.output/public/_nuxt/{CxEW7TG8.js → CemiMtCX.js} +1 -1
- package/.output/public/_nuxt/{CGscLIrv.js → CgK0fS9t.js} +1 -1
- package/.output/public/_nuxt/{n0RAZLbO.js → CmJE87KM.js} +1 -1
- package/.output/public/_nuxt/Cn-bp-IR.js +1 -0
- package/.output/public/_nuxt/{xdsXwj_J.js → CnhVSb6R.js} +1 -1
- package/.output/public/_nuxt/{9I37tBe7.js → CpGRan2R.js} +1 -1
- package/.output/public/_nuxt/{C1FLL1Qz.js → CqQg8Ldy.js} +1 -1
- package/.output/public/_nuxt/{BJK6uMxG.js → Cs-GjQ8R.js} +1 -1
- package/.output/public/_nuxt/{BPcwi1q2.js → CtbC3i8L.js} +1 -1
- package/.output/public/_nuxt/{xA6NntuA.js → CvSiusML.js} +1 -1
- package/.output/public/_nuxt/CxoCegAs.js +13 -0
- package/.output/public/_nuxt/{BpkvlDNi.js → Cz-197mS.js} +1 -1
- package/.output/public/_nuxt/Cz2AlsmD.js +1 -0
- package/.output/public/_nuxt/{CJWmG4YP.js → D-7HtdRe.js} +1 -1
- package/.output/public/_nuxt/{Dg5xB15N.js → D82vCrfD.js} +1 -1
- package/.output/public/_nuxt/D8l8udqQ.js +1 -0
- package/.output/public/_nuxt/{mUFnM-_q.js → DCK6hB22.js} +1 -1
- package/.output/public/_nuxt/{RNghxpo_.js → DDvzSYfr.js} +1 -1
- package/.output/public/_nuxt/{BEEt8Am7.js → DEtIJe2u.js} +1 -1
- package/.output/public/_nuxt/{BDa1f6PF.js → DHJ62FKo.js} +1 -1
- package/.output/public/_nuxt/{DiTMzCP2.js → DKWXhhCy.js} +1 -1
- package/.output/public/_nuxt/DPOp833l.js +1 -0
- package/.output/public/_nuxt/DRJZaHtK.js +1 -0
- package/.output/public/_nuxt/{RCBWmVHz.js → DSDbyhpJ.js} +1 -1
- package/.output/public/_nuxt/{TsXTqZ29.js → DSeZwD4N.js} +1 -1
- package/.output/public/_nuxt/{DNqd6Nek.js → DSpiceQe.js} +1 -1
- package/.output/public/_nuxt/{CzSiA7V6.js → DTPYfUid.js} +1 -1
- package/.output/public/_nuxt/{BCVaR2pQ.js → DUHba1vY.js} +1 -1
- package/.output/public/_nuxt/{D2obegTF.js → DXyfavJr.js} +1 -1
- package/.output/public/_nuxt/DYE7WIF3.js +1 -0
- package/.output/public/_nuxt/{ZbicA1ry.js → D_wY_uke.js} +1 -1
- package/.output/public/_nuxt/{DKhcu7kD.js → Dahes9VH.js} +1 -1
- package/.output/public/_nuxt/{D-wGZMZP.js → DdvHdmGh.js} +1 -1
- package/.output/public/_nuxt/DgsIRcX7.js +1 -0
- package/.output/public/_nuxt/{BtvRca6l.js → DjAJT7YJ.js} +1 -1
- package/.output/public/_nuxt/{DzWdbJvx.js → Djg8J2AC.js} +1 -1
- package/.output/public/_nuxt/{CudFwYib.js → DkkrdwgN.js} +1 -1
- package/.output/public/_nuxt/{pxXmJ8QX.js → DnpKvmH_.js} +1 -1
- package/.output/public/_nuxt/{B8nw2aST.js → DrWe3t51.js} +1 -1
- package/.output/public/_nuxt/{D2aToa54.js → DsG1SoRB.js} +1 -1
- package/.output/public/_nuxt/{8MSfy8uY.js → DtBrxin9.js} +1 -1
- package/.output/public/_nuxt/{B13uiJCv.js → EnN6XTXK.js} +1 -1
- package/.output/public/_nuxt/{DJN0y8jO.js → Fcs-0n6A.js} +1 -1
- package/.output/public/_nuxt/{DQwYQDb2.js → FtFNcQmh.js} +1 -1
- package/.output/public/_nuxt/{C8lm7lgC.js → GXzlut8R.js} +1 -1
- package/.output/public/_nuxt/{xrNU8mHG.js → Lks7C8cK.js} +1 -1
- package/.output/public/_nuxt/M0WOzN-S.js +269 -0
- package/.output/public/_nuxt/{d-NZQb9b.js → OuCcJFrZ.js} +1 -1
- package/.output/public/_nuxt/{GgtqCdye.js → UD_auLNX.js} +1 -1
- package/.output/public/_nuxt/Ve4PFQV2.js +1 -0
- package/.output/public/_nuxt/{57B6Rca8.js → ZpmLW6rw.js} +1 -1
- package/.output/public/_nuxt/_H4v1dQx.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/d356de5d-6230-4e66-aba2-c48f455ae207.json +1 -0
- package/.output/public/_nuxt/builds/meta/ed797280-2bf0-44e6-a601-2ff2462bfbbc.json +1 -0
- package/.output/public/_nuxt/{CPpO8vcZ.js → c6k-jVO-.js} +1 -1
- package/.output/public/_nuxt/eo99z4R2.js +1 -0
- package/.output/public/_nuxt/error-404.iOXvqd5J.css +1 -0
- package/.output/public/_nuxt/error-500.D0BgXBui.css +1 -0
- package/.output/public/_nuxt/graph-resolver-E9RSC1Ga.js +180 -0
- package/.output/public/_nuxt/{DWa2aw6r.js → hAFXcJ2_.js} +1 -1
- package/.output/public/_nuxt/monaco-editor.DOXZIHvr.css +1 -0
- package/.output/public/_nuxt/oH_c3LbQ.js +1 -0
- package/.output/public/_nuxt/rZm6bMo-.js +1 -0
- package/.output/public/_nuxt/{ByBNG4eo.js → rscZxuQ2.js} +1 -1
- package/.output/public/_nuxt/sB5TSp0H.js +18 -0
- package/.output/public/_nuxt/{DOPqH6_T.js → wCosSBIO.js} +1 -1
- package/.output/public/_nuxt/{DRfxs3PN.js → xnReCuE4.js} +1 -1
- package/.output/public/_nuxt/{D5z-4QVk.js → y0GN4iGv.js} +1 -1
- package/.output/public/_nuxt/{yaml.worker-C1Cl1y5J.js → yaml.worker-CYOhFCVP.js} +248 -252
- package/.output/server/index.mjs +3959 -9221
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/@babel/parser/lib/index.js +1 -1
- package/.output/server/node_modules/@babel/parser/package.json +1 -1
- package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.cjs +57 -0
- package/.output/server/node_modules/@trpc/server/dist/adapters/fetch/index.mjs +2 -2
- package/.output/server/node_modules/@trpc/server/dist/codes-BfZsPdy-.cjs +222 -0
- package/.output/server/node_modules/@trpc/server/dist/{contentTypeParsers-SN4WL9ze.mjs → contentTypeParsers-iAFF_pJG.cjs} +7 -2
- package/.output/server/node_modules/@trpc/server/dist/getErrorShape-MR4DZeb7.cjs +341 -0
- package/.output/server/node_modules/@trpc/server/dist/http.cjs +14 -0
- package/.output/server/node_modules/@trpc/server/dist/index.cjs +22 -0
- package/.output/server/node_modules/@trpc/server/dist/index.mjs +2 -2
- package/.output/server/node_modules/@trpc/server/dist/{initTRPC-RoZMIBeA.mjs → initTRPC-B1ggxyJl.mjs} +2 -2
- package/.output/server/node_modules/@trpc/server/dist/initTRPC-BXPPV9Tx.cjs +416 -0
- package/.output/server/node_modules/@trpc/server/dist/observable/index.cjs +13 -0
- package/.output/server/node_modules/@trpc/server/dist/observable-B1Nk6r1H.cjs +181 -0
- package/.output/server/node_modules/@trpc/server/dist/{observable-CUiPknO-.mjs → observable-BVzLuBs6.cjs} +42 -8
- package/.output/server/node_modules/@trpc/server/dist/{parseTRPCMessage-CTow-umk.mjs → parseTRPCMessage-7Ltmq-Fb.cjs} +14 -4
- package/.output/server/node_modules/@trpc/server/dist/resolveResponse-B0CCg8nq.cjs +2365 -0
- package/.output/server/node_modules/@trpc/server/dist/{resolveResponse-BVDlNZwN.mjs → resolveResponse-C5I6V_wc.mjs} +67 -18
- package/.output/server/node_modules/@trpc/server/dist/rpc.cjs +6 -0
- package/.output/server/node_modules/@trpc/server/dist/{tracked-Bjtgv3wJ.mjs → tracked-DiE3uR1B.mjs} +12 -3
- package/.output/server/node_modules/@trpc/server/dist/tracked-Dj_dpOJE.cjs +486 -0
- package/.output/server/node_modules/@trpc/server/package.json +15 -5
- package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +2 -2
- package/.output/server/node_modules/@vue/compiler-core/package.json +3 -3
- package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +1 -1
- package/.output/server/node_modules/@vue/compiler-dom/package.json +3 -3
- package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1 -1
- package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
- package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +31 -13
- package/.output/server/node_modules/@vue/reactivity/package.json +2 -2
- package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +144 -81
- package/.output/server/node_modules/@vue/runtime-core/package.json +3 -3
- package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +70 -9
- package/.output/server/node_modules/@vue/runtime-dom/package.json +4 -4
- package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +6 -2
- package/.output/server/node_modules/@vue/server-renderer/package.json +4 -4
- package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +1 -1
- package/.output/server/node_modules/@vue/shared/package.json +1 -1
- package/.output/server/node_modules/devalue/package.json +5 -2
- package/.output/server/node_modules/devalue/src/base64.js +46 -96
- package/.output/server/node_modules/devalue/src/parse.js +32 -10
- package/.output/server/node_modules/devalue/src/stringify.js +13 -28
- package/.output/server/node_modules/devalue/src/uneval.js +117 -55
- package/.output/server/node_modules/devalue/src/utils.js +3 -7
- package/.output/server/node_modules/hookable/dist/index.mjs +5 -14
- package/.output/server/node_modules/hookable/package.json +24 -23
- package/.output/server/node_modules/trpc-bun-adapter/dist/index.js +406 -0
- package/.output/server/node_modules/trpc-bun-adapter/package.json +44 -0
- package/.output/server/node_modules/unhead/dist/plugins.mjs +3 -3
- package/.output/server/node_modules/unhead/dist/server.mjs +2 -2
- package/.output/server/node_modules/unhead/dist/shared/{unhead.eK9_7LaY.mjs → unhead.B5FWS6X0.mjs} +22 -13
- package/.output/server/node_modules/unhead/dist/shared/{unhead.BFfcxOoW.mjs → unhead.Ct24BOby.mjs} +4 -2
- package/.output/server/node_modules/unhead/dist/shared/unhead.D4vSFytZ.mjs +236 -0
- package/.output/server/node_modules/unhead/dist/shared/{unhead.ckV6dpEQ.mjs → unhead.TxTMM7cM.mjs} +1 -1
- package/.output/server/node_modules/unhead/dist/utils.mjs +1 -1
- package/.output/server/node_modules/unhead/package.json +1 -1
- package/.output/server/node_modules/vue/dist/vue.cjs.js +1 -1
- package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +1 -1
- package/.output/server/node_modules/vue/package.json +7 -7
- package/.output/server/package.json +16 -16
- package/package.json +20 -14
- package/.output/public/_nuxt/83L43bj1.js +0 -1
- package/.output/public/_nuxt/B93PlW-d.js +0 -1
- package/.output/public/_nuxt/BE_Meo09.js +0 -269
- package/.output/public/_nuxt/Ba13S78F.js +0 -1
- package/.output/public/_nuxt/BhRPY-oY.js +0 -1
- package/.output/public/_nuxt/Bhrxn6JZ.js +0 -1
- package/.output/public/_nuxt/Bo8jzlL1.js +0 -18
- package/.output/public/_nuxt/BrzmwbiE.js +0 -1
- package/.output/public/_nuxt/C-sUppwS.js +0 -1
- package/.output/public/_nuxt/C47S-Tmv.js +0 -1
- package/.output/public/_nuxt/CMjwMIkn.js +0 -1
- package/.output/public/_nuxt/CQ8jqdy-.js +0 -1
- package/.output/public/_nuxt/CjoLj4QM.js +0 -1
- package/.output/public/_nuxt/D91rOou-.js +0 -13
- package/.output/public/_nuxt/DMwsHuHA.js +0 -1
- package/.output/public/_nuxt/DYoxhk2S.js +0 -1
- package/.output/public/_nuxt/Dv7Oe6Be.js +0 -1
- package/.output/public/_nuxt/VCDPK7BO.js +0 -1
- package/.output/public/_nuxt/builds/meta/a1fec520-0c95-4ae0-af5e-964780fad341.json +0 -1
- package/.output/public/_nuxt/error-404.X7H_YhdC.css +0 -1
- package/.output/public/_nuxt/error-500.BOQe1fsk.css +0 -1
- package/.output/public/_nuxt/graph-resolver-DKNtntr2.js +0 -180
- package/.output/public/_nuxt/monaco-editor.D_J4ItrK.css +0 -1
- package/.output/server/node_modules/@trpc/server/dist/adapters/ws.mjs +0 -15
- package/.output/server/node_modules/@trpc/server/dist/node-http-DtA2iLK9.mjs +0 -224
- package/.output/server/node_modules/@trpc/server/dist/unstable-core-do-not-import-9NNw8uQM.mjs +0 -31
- package/.output/server/node_modules/@trpc/server/dist/ws-CJgZE7Hg.mjs +0 -460
- package/.output/server/node_modules/unhead/dist/shared/unhead.CApf5sj3.mjs +0 -148
- package/.output/server/node_modules/ws/lib/buffer-util.js +0 -131
- package/.output/server/node_modules/ws/lib/constants.js +0 -19
- package/.output/server/node_modules/ws/lib/event-target.js +0 -292
- package/.output/server/node_modules/ws/lib/extension.js +0 -203
- package/.output/server/node_modules/ws/lib/limiter.js +0 -55
- package/.output/server/node_modules/ws/lib/permessage-deflate.js +0 -528
- package/.output/server/node_modules/ws/lib/receiver.js +0 -706
- package/.output/server/node_modules/ws/lib/sender.js +0 -602
- package/.output/server/node_modules/ws/lib/stream.js +0 -161
- package/.output/server/node_modules/ws/lib/subprotocol.js +0 -62
- package/.output/server/node_modules/ws/lib/validation.js +0 -152
- package/.output/server/node_modules/ws/lib/websocket-server.js +0 -554
- package/.output/server/node_modules/ws/lib/websocket.js +0 -1393
- package/.output/server/node_modules/ws/package.json +0 -69
- package/.output/server/node_modules/ws/wrapper.mjs +0 -8
- package/LICENSE +0 -21
- /package/.output/public/_nuxt/{XEA9GSJd.js → B69Z0Xk1.js} +0 -0
- /package/.output/server/node_modules/@trpc/server/dist/{http-CWyjOa1l.mjs → http-DXy3XyhL.cjs} +0 -0
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
function U(t,e,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);const l=o.prototype,d=Object.keys(l);for(let p=0;p<d.length;p++){const h=d[p];h in a||(a[h]=l[h].bind(a))}}const s=n?.Parent??Object;class i extends s{}Object.defineProperty(i,"name",{value:t});function o(a){var c;const l=n?.Parent?new i:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const d of l._zod.deferred)d();return l}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}class Xt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Oa extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Aa={};function kt(t){return Aa}function Na(t){const e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,s])=>e.indexOf(+r)===-1).map(([r,s])=>s)}function Ds(t,e){return typeof e=="bigint"?e.toString():e}function Gr(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function Vs(t){return t==null}function Ks(t){const e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function bu(t,e){const n=(t.toString().split(".")[1]||"").length,r=e.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const i=n>s?n:s,o=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return o%a/10**i}const bi=Symbol("evaluating");function me(t,e,n){let r;Object.defineProperty(t,e,{get(){if(r!==bi)return r===void 0&&(r=bi,r=n()),r},set(s){Object.defineProperty(t,e,{value:s})},configurable:!0})}function Mt(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ot(...t){const e={};for(const n of t){const r=Object.getOwnPropertyDescriptors(n);Object.assign(e,r)}return Object.defineProperties({},e)}function $i(t){return JSON.stringify(t)}function $u(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ta="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Nn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const Su=Gr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function sn(t){if(Nn(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(Nn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Pa(t){return sn(t)?{...t}:Array.isArray(t)?[...t]:t}const Eu=new Set(["string","number","symbol"]),ku=new Set(["string","number","bigint","boolean","symbol","undefined"]);function jt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function At(t,e,n){const r=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(r._zod.parent=t),r}function te(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function Iu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const Ou={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Au(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=Ot(t._zod.def,{get shape(){const o={};for(const a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(o[a]=n.shape[a])}return Mt(this,"shape",o),o},checks:[]});return At(t,i)}function Nu(t,e){const n=t._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Ot(t._zod.def,{get shape(){const o={...t._zod.def.shape};for(const a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete o[a]}return Mt(this,"shape",o),o},checks:[]});return At(t,i)}function Tu(t,e){if(!sn(e))throw new Error("Invalid input to extend: expected a plain object");const n=t._zod.def.checks;if(n&&n.length>0){const i=t._zod.def.shape;for(const o in e)if(Object.getOwnPropertyDescriptor(i,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Ot(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e};return Mt(this,"shape",i),i}});return At(t,s)}function Pu(t,e){if(!sn(e))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ot(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return Mt(this,"shape",r),r}});return At(t,n)}function Cu(t,e){const n=Ot(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e._zod.def.shape};return Mt(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return At(t,n)}function xu(t,e,n){const s=e._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Ot(e._zod.def,{get shape(){const a=e._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=t?new t({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=t?new t({type:"optional",innerType:a[l]}):a[l];return Mt(this,"shape",c),c},checks:[]});return At(e,o)}function Bu(t,e,n){const r=Ot(e._zod.def,{get shape(){const s=e._zod.def.shape,i={...s};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=new t({type:"nonoptional",innerType:s[o]}))}else for(const o in s)i[o]=new t({type:"nonoptional",innerType:s[o]});return Mt(this,"shape",i),i}});return At(e,r)}function Ht(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function Gt(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function jn(t){return typeof t=="string"?t:t?.message}function It(t,e,n){const r={...t,path:t.path??[]};if(!t.message){const s=jn(t.inst?._zod.def?.error?.(t))??jn(e?.error?.(t))??jn(n.customError?.(t))??jn(n.localeError?.(t))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,e?.reportInput||delete r.input,r}function Js(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Tn(...t){const[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}const Ca=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Ds,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},xa=U("$ZodError",Ca),Ba=U("$ZodError",Ca,{Parent:Error});function Du(t,e=n=>n.message){const n={},r=[];for(const s of t.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):r.push(e(s));return{formErrors:r,fieldErrors:n}}function zu(t,e=n=>n.message){const n={_errors:[]},r=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(o=>r({issues:o}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(e(i));else{let o=n,a=0;for(;a<i.path.length;){const c=i.path[a];a===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(e(i))):o[c]=o[c]||{_errors:[]},o=o[c],a++}}};return r(t),n}const Hs=t=>(e,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=e._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Xt;if(o.issues.length){const a=new(s?.Err??t)(o.issues.map(c=>It(c,i,kt())));throw Ta(a,s?.callee),a}return o.value},Gs=t=>async(e,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=e._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(s?.Err??t)(o.issues.map(c=>It(c,i,kt())));throw Ta(a,s?.callee),a}return o.value},Wr=t=>(e,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=e._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Xt;return i.issues.length?{success:!1,error:new(t??xa)(i.issues.map(o=>It(o,s,kt())))}:{success:!0,data:i.value}},Ru=Wr(Ba),Yr=t=>async(e,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=e._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new t(i.issues.map(o=>It(o,s,kt())))}:{success:!0,data:i.value}},ju=Yr(Ba),Fu=t=>(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Hs(t)(e,n,s)},Mu=t=>(e,n,r)=>Hs(t)(e,n,r),Uu=t=>async(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Gs(t)(e,n,s)},Lu=t=>async(e,n,r)=>Gs(t)(e,n,r),qu=t=>(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Wr(t)(e,n,s)},Zu=t=>(e,n,r)=>Wr(t)(e,n,r),Vu=t=>async(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Yr(t)(e,n,s)},Ku=t=>async(e,n,r)=>Yr(t)(e,n,r),Ju=/^[cC][^\s-]{8,}$/,Hu=/^[0-9a-z]+$/,Gu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Wu=/^[0-9a-vA-V]{20}$/,Yu=/^[A-Za-z0-9]{27}$/,Qu=/^[a-zA-Z0-9_-]{21}$/,Xu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,el=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Si=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,nl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function rl(){return new RegExp(nl,"u")}const sl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,il=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ol=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,al=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,cl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Da=/^[A-Za-z0-9_-]*$/,ul=/^\+[1-9]\d{6,14}$/,za="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ll=new RegExp(`^${za}$`);function Ra(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function fl(t){return new RegExp(`^${Ra(t)}$`)}function dl(t){const e=Ra({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${e}(?:${n.join("|")})`;return new RegExp(`^${za}T(?:${r})$`)}const hl=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},pl=/^-?\d+$/,ja=/^-?\d+(?:\.\d+)?$/,ml=/^(?:true|false)$/i,gl=/^[^A-Z]*$/,yl=/^[^a-z]*$/,Xe=U("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Fa={number:"number",bigint:"bigint",object:"date"},Ma=U("$ZodCheckLessThan",(t,e)=>{Xe.init(t,e);const n=Fa[typeof e.value];t._zod.onattach.push(r=>{const s=r._zod.bag,i=(e.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<i&&(e.inclusive?s.maximum=e.value:s.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Ua=U("$ZodCheckGreaterThan",(t,e)=>{Xe.init(t,e);const n=Fa[typeof e.value];t._zod.onattach.push(r=>{const s=r._zod.bag,i=(e.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>i&&(e.inclusive?s.minimum=e.value:s.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),wl=U("$ZodCheckMultipleOf",(t,e)=>{Xe.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):bu(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),vl=U("$ZodCheckNumberFormat",(t,e)=>{Xe.init(t,e),e.format=e.format||"float64";const n=e.format?.includes("int"),r=n?"int":"number",[s,i]=Ou[e.format];t._zod.onattach.push(o=>{const a=o._zod.bag;a.format=e.format,a.minimum=s,a.maximum=i,n&&(a.pattern=pl)}),t._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort});return}}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:t,continue:!e.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),_l=U("$ZodCheckMaxLength",(t,e)=>{var n;Xe.init(t,e),(n=t._zod.def).when??(n.when=r=>{const s=r.value;return!Vs(s)&&s.length!==void 0}),t._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<s&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const s=r.value;if(s.length<=e.maximum)return;const o=Js(s);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),bl=U("$ZodCheckMinLength",(t,e)=>{var n;Xe.init(t,e),(n=t._zod.def).when??(n.when=r=>{const s=r.value;return!Vs(s)&&s.length!==void 0}),t._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>s&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const s=r.value;if(s.length>=e.minimum)return;const o=Js(s);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),$l=U("$ZodCheckLengthEquals",(t,e)=>{var n;Xe.init(t,e),(n=t._zod.def).when??(n.when=r=>{const s=r.value;return!Vs(s)&&s.length!==void 0}),t._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=e.length,s.maximum=e.length,s.length=e.length}),t._zod.check=r=>{const s=r.value,i=s.length;if(i===e.length)return;const o=Js(s),a=i>e.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Qr=U("$ZodCheckStringFormat",(t,e)=>{var n,r;Xe.init(t,e),t._zod.onattach.push(s=>{const i=s._zod.bag;i.format=e.format,e.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=s=>{e.pattern.lastIndex=0,!e.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:e.format,input:s.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),Sl=U("$ZodCheckRegex",(t,e)=>{Qr.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),El=U("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=gl),Qr.init(t,e)}),kl=U("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=yl),Qr.init(t,e)}),Il=U("$ZodCheckIncludes",(t,e)=>{Xe.init(t,e);const n=jt(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=s=>{s.value.includes(e.includes,e.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:s.value,inst:t,continue:!e.abort})}}),Ol=U("$ZodCheckStartsWith",(t,e)=>{Xe.init(t,e);const n=new RegExp(`^${jt(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Al=U("$ZodCheckEndsWith",(t,e)=>{Xe.init(t,e);const n=new RegExp(`.*${jt(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),Nl=U("$ZodCheckOverwrite",(t,e)=>{Xe.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class Tl{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
|
|
2
|
-
`).filter(o=>o),s=Math.min(...r.map(o=>o.length-o.trimStart().length)),i=r.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of i)this.content.push(o)}compile(){const e=Function,n=this?.args,s=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...n,s.join(`
|
|
3
|
-
`))}}const Pl={major:4,minor:3,patch:6},Ee=U("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Pl;const r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(const s of r)for(const i of s._zod.onattach)i(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const s=(o,a,c)=>{let l=Ht(o),d;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(l)continue;const h=o.issues.length,m=p._zod.check(o);if(m instanceof Promise&&c?.async===!1)throw new Xt;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,o.issues.length!==h&&(l||(l=Ht(o,h)))});else{if(o.issues.length===h)continue;l||(l=Ht(o,h))}}return d?d.then(()=>o):o},i=(o,a,c)=>{if(Ht(o))return o.aborted=!0,o;const l=s(a,r,c);if(l instanceof Promise){if(c.async===!1)throw new Xt;return l.then(d=>t._zod.parse(d,c))}return t._zod.parse(l,c)};t._zod.run=(o,a)=>{if(a.skipChecks)return t._zod.parse(o,a);if(a.direction==="backward"){const l=t._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(d=>i(d,o,a)):i(l,o,a)}const c=t._zod.parse(o,a);if(c instanceof Promise){if(a.async===!1)throw new Xt;return c.then(l=>s(l,r,a))}return s(c,r,a)}}me(t,"~standard",()=>({validate:s=>{try{const i=Ru(t,s);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ju(t,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),Ws=U("$ZodString",(t,e)=>{Ee.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??hl(t._zod.bag),t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Ae=U("$ZodStringFormat",(t,e)=>{Qr.init(t,e),Ws.init(t,e)}),Cl=U("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=el),Ae.init(t,e)}),xl=U("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Si(r))}else e.pattern??(e.pattern=Si());Ae.init(t,e)}),Bl=U("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=tl),Ae.init(t,e)}),Dl=U("$ZodURL",(t,e)=>{Ae.init(t,e),t._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=s.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),zl=U("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=rl()),Ae.init(t,e)}),Rl=U("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Qu),Ae.init(t,e)}),jl=U("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Ju),Ae.init(t,e)}),Fl=U("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Hu),Ae.init(t,e)}),Ml=U("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Gu),Ae.init(t,e)}),Ul=U("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Wu),Ae.init(t,e)}),Ll=U("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Yu),Ae.init(t,e)}),ql=U("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=dl(e)),Ae.init(t,e)}),Zl=U("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=ll),Ae.init(t,e)}),Vl=U("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=fl(e)),Ae.init(t,e)}),Kl=U("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Xu),Ae.init(t,e)}),Jl=U("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=sl),Ae.init(t,e),t._zod.bag.format="ipv4"}),Hl=U("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=il),Ae.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),Gl=U("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=ol),Ae.init(t,e)}),Wl=U("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=al),Ae.init(t,e),t._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,i]=r;if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function La(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const Yl=U("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=cl),Ae.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{La(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function Ql(t){if(!Da.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return La(n)}const Xl=U("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Da),Ae.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{Ql(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),ef=U("$ZodE164",(t,e)=>{e.pattern??(e.pattern=ul),Ae.init(t,e)});function tf(t,e=null){try{const n=t.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||e&&(!("alg"in s)||s.alg!==e))}catch{return!1}}const nf=U("$ZodJWT",(t,e)=>{Ae.init(t,e),t._zod.check=n=>{tf(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),qa=U("$ZodNumber",(t,e)=>{Ee.init(t,e),t._zod.pattern=t._zod.bag.pattern??ja,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:t,...i?{received:i}:{}}),n}}),rf=U("$ZodNumberFormat",(t,e)=>{vl.init(t,e),qa.init(t,e)}),sf=U("$ZodBoolean",(t,e)=>{Ee.init(t,e),t._zod.pattern=ml,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:t}),n}}),of=U("$ZodUnknown",(t,e)=>{Ee.init(t,e),t._zod.parse=n=>n}),af=U("$ZodNever",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),cf=U("$ZodDate",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}const s=n.value,i=s instanceof Date;return i&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...i?{received:"Invalid Date"}:{},inst:t}),n}});function Ei(t,e,n){t.issues.length&&e.issues.push(...Gt(n,t.issues)),e.value[n]=t.value}const uf=U("$ZodArray",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:t}),n;n.value=Array(s.length);const i=[];for(let o=0;o<s.length;o++){const a=s[o],c=e.element._zod.run({value:a,issues:[]},r);c instanceof Promise?i.push(c.then(l=>Ei(l,n,o))):Ei(c,n,o)}return i.length?Promise.all(i).then(()=>n):n}});function Ur(t,e,n,r,s){if(t.issues.length){if(s&&!(n in r))return;e.issues.push(...Gt(n,t.issues))}t.value===void 0?n in r&&(e.value[n]=void 0):e.value[n]=t.value}function Za(t){const e=Object.keys(t.shape);for(const r of e)if(!t.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Iu(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function Va(t,e,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,l=c.def.type,d=c.optout==="optional";for(const p in e){if(a.has(p))continue;if(l==="never"){o.push(p);continue}const h=c.run({value:e[p],issues:[]},r);h instanceof Promise?t.push(h.then(m=>Ur(m,n,p,e,d))):Ur(h,n,p,e,d)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:i}),t.length?Promise.all(t).then(()=>n):n}const lf=U("$ZodObject",(t,e)=>{if(Ee.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){const a=e.shape;Object.defineProperty(e,"shape",{get:()=>{const c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}const r=Gr(()=>Za(e));me(t._zod,"propValues",()=>{const a=e.shape,c={};for(const l in a){const d=a[l]._zod;if(d.values){c[l]??(c[l]=new Set);for(const p of d.values)c[l].add(p)}}return c});const s=Nn,i=e.catchall;let o;t._zod.parse=(a,c)=>{o??(o=r.value);const l=a.value;if(!s(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),a;a.value={};const d=[],p=o.shape;for(const h of o.keys){const m=p[h],_=m._zod.optout==="optional",g=m._zod.run({value:l[h],issues:[]},c);g instanceof Promise?d.push(g.then(w=>Ur(w,a,h,l,_))):Ur(g,a,h,l,_)}return i?Va(d,l,a,c,r.value,t):d.length?Promise.all(d).then(()=>a):a}}),ff=U("$ZodObjectJIT",(t,e)=>{lf.init(t,e);const n=t._zod.parse,r=Gr(()=>Za(e)),s=h=>{const m=new Tl(["shape","payload","ctx"]),_=r.value,g=b=>{const I=$i(b);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};m.write("const input = payload.value;");const w=Object.create(null);let $=0;for(const b of _.keys)w[b]=`key_${$++}`;m.write("const newResult = {};");for(const b of _.keys){const I=w[b],v=$i(b),A=h[b]?._zod?.optout==="optional";m.write(`const ${I} = ${g(b)};`),A?m.write(`
|
|
4
|
-
if (${I}.issues.length) {
|
|
5
|
-
if (${v} in input) {
|
|
6
|
-
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
7
|
-
...iss,
|
|
8
|
-
path: iss.path ? [${v}, ...iss.path] : [${v}]
|
|
9
|
-
})));
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (${I}.value === undefined) {
|
|
14
|
-
if (${v} in input) {
|
|
15
|
-
newResult[${v}] = undefined;
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
newResult[${v}] = ${I}.value;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
`):m.write(`
|
|
22
|
-
if (${I}.issues.length) {
|
|
23
|
-
payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
|
|
24
|
-
...iss,
|
|
25
|
-
path: iss.path ? [${v}, ...iss.path] : [${v}]
|
|
26
|
-
})));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (${I}.value === undefined) {
|
|
30
|
-
if (${v} in input) {
|
|
31
|
-
newResult[${v}] = undefined;
|
|
32
|
-
}
|
|
33
|
-
} else {
|
|
34
|
-
newResult[${v}] = ${I}.value;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
`)}m.write("payload.value = newResult;"),m.write("return payload;");const y=m.compile();return(b,I)=>y(h,b,I)};let i;const o=Nn,a=!Aa.jitless,l=a&&Su.value,d=e.catchall;let p;t._zod.parse=(h,m)=>{p??(p=r.value);const _=h.value;return o(_)?a&&l&&m?.async===!1&&m.jitless!==!0?(i||(i=s(e.shape)),h=i(h,m),d?Va([],_,h,m,p,t):h):n(h,m):(h.issues.push({expected:"object",code:"invalid_type",input:_,inst:t}),h)}});function ki(t,e,n,r){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;const s=t.filter(i=>!Ht(i));return s.length===1?(e.value=s[0].value,s[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(o=>It(o,r,kt())))}),e)}const Ka=U("$ZodUnion",(t,e)=>{Ee.init(t,e),me(t._zod,"optin",()=>e.options.some(s=>s._zod.optin==="optional")?"optional":void 0),me(t._zod,"optout",()=>e.options.some(s=>s._zod.optout==="optional")?"optional":void 0),me(t._zod,"values",()=>{if(e.options.every(s=>s._zod.values))return new Set(e.options.flatMap(s=>Array.from(s._zod.values)))}),me(t._zod,"pattern",()=>{if(e.options.every(s=>s._zod.pattern)){const s=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>Ks(i.source)).join("|")})$`)}});const n=e.options.length===1,r=e.options[0]._zod.run;t._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const c of e.options){const l=c._zod.run({value:s.value,issues:[]},i);if(l instanceof Promise)a.push(l),o=!0;else{if(l.issues.length===0)return l;a.push(l)}}return o?Promise.all(a).then(c=>ki(c,s,t,i)):ki(a,s,t,i)}}),df=U("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ka.init(t,e);const n=t._zod.parse;me(t._zod,"propValues",()=>{const s={};for(const i of e.options){const o=i._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(const[a,c]of Object.entries(o)){s[a]||(s[a]=new Set);for(const l of c)s[a].add(l)}}return s});const r=Gr(()=>{const s=e.options,i=new Map;for(const o of s){const a=o._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,o)}}return i});t._zod.parse=(s,i)=>{const o=s.value;if(!Nn(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),s;const a=r.value.get(o?.[e.discriminator]);return a?a._zod.run(s,i):e.unionFallback?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:o,path:[e.discriminator],inst:t}),s)}}),hf=U("$ZodIntersection",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>{const s=n.value,i=e.left._zod.run({value:s,issues:[]},r),o=e.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([c,l])=>Ii(n,c,l)):Ii(n,i,o)}});function zs(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(sn(t)&&sn(e)){const n=Object.keys(e),r=Object.keys(t).filter(i=>n.indexOf(i)!==-1),s={...t,...e};for(const i of r){const o=zs(t[i],e[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const s=t[r],i=e[r],o=zs(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ii(t,e,n){const r=new Map;let s;for(const a of e.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else t.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else t.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&s&&t.issues.push({...s,keys:i}),Ht(t))return t;const o=zs(e.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return t.value=o.data,t}const pf=U("$ZodRecord",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>{const s=n.value;if(!sn(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:t}),n;const i=[],o=e.keyType._zod.values;if(o){n.value={};const a=new Set;for(const l of o)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);const d=e.valueType._zod.run({value:s[l],issues:[]},r);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&n.issues.push(...Gt(l,p.issues)),n.value[l]=p.value})):(d.issues.length&&n.issues.push(...Gt(l,d.issues)),n.value[l]=d.value)}let c;for(const l in s)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;let c=e.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ja.test(a)&&c.issues.length){const p=e.keyType._zod.run({value:Number(a),issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){e.mode==="loose"?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>It(p,r,kt())),input:a,path:[a],inst:t});continue}const d=e.valueType._zod.run({value:s[a],issues:[]},r);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&n.issues.push(...Gt(a,p.issues)),n.value[c.value]=p.value})):(d.issues.length&&n.issues.push(...Gt(a,d.issues)),n.value[c.value]=d.value)}}return i.length?Promise.all(i).then(()=>n):n}}),mf=U("$ZodEnum",(t,e)=>{Ee.init(t,e);const n=Na(e.entries),r=new Set(n);t._zod.values=r,t._zod.pattern=new RegExp(`^(${n.filter(s=>Eu.has(typeof s)).map(s=>typeof s=="string"?jt(s):s.toString()).join("|")})$`),t._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:t}),s}}),gf=U("$ZodLiteral",(t,e)=>{if(Ee.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?jt(r):r?jt(r.toString()):String(r)).join("|")})$`),t._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),r}}),yf=U("$ZodTransform",(t,e)=>{Ee.init(t,e),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Oa(t.constructor.name);const s=e.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new Xt;return n.value=s,n}});function Oi(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}const Ja=U("$ZodOptional",(t,e)=>{Ee.init(t,e),t._zod.optin="optional",t._zod.optout="optional",me(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),me(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${Ks(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>{if(e.innerType._zod.optin==="optional"){const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Oi(i,n.value)):Oi(s,n.value)}return n.value===void 0?n:e.innerType._zod.run(n,r)}}),wf=U("$ZodExactOptional",(t,e)=>{Ja.init(t,e),me(t._zod,"values",()=>e.innerType._zod.values),me(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,r)=>e.innerType._zod.run(n,r)}),vf=U("$ZodNullable",(t,e)=>{Ee.init(t,e),me(t._zod,"optin",()=>e.innerType._zod.optin),me(t._zod,"optout",()=>e.innerType._zod.optout),me(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${Ks(n.source)}|null)$`):void 0}),me(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),_f=U("$ZodDefault",(t,e)=>{Ee.init(t,e),t._zod.optin="optional",me(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);if(n.value===void 0)return n.value=e.defaultValue,n;const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Ai(i,e)):Ai(s,e)}});function Ai(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const bf=U("$ZodPrefault",(t,e)=>{Ee.init(t,e),t._zod.optin="optional",me(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),$f=U("$ZodNonOptional",(t,e)=>{Ee.init(t,e),me(t._zod,"values",()=>{const n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Ni(i,t)):Ni(s,t)}});function Ni(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const Sf=U("$ZodCatch",(t,e)=>{Ee.init(t,e),me(t._zod,"optin",()=>e.innerType._zod.optin),me(t._zod,"optout",()=>e.innerType._zod.optout),me(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(o=>It(o,r,kt()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=e.catchValue({...n,error:{issues:s.issues.map(i=>It(i,r,kt()))},input:n.value}),n.issues=[]),n)}}),Ef=U("$ZodPipe",(t,e)=>{Ee.init(t,e),me(t._zod,"values",()=>e.in._zod.values),me(t._zod,"optin",()=>e.in._zod.optin),me(t._zod,"optout",()=>e.out._zod.optout),me(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=e.out._zod.run(n,r);return i instanceof Promise?i.then(o=>Fn(o,e.in,r)):Fn(i,e.in,r)}const s=e.in._zod.run(n,r);return s instanceof Promise?s.then(i=>Fn(i,e.out,r)):Fn(s,e.out,r)}});function Fn(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},n)}const kf=U("$ZodCodec",(t,e)=>{Ee.init(t,e),me(t._zod,"values",()=>e.in._zod.values),me(t._zod,"optin",()=>e.in._zod.optin),me(t._zod,"optout",()=>e.out._zod.optout),me(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){const i=e.in._zod.run(n,r);return i instanceof Promise?i.then(o=>Mn(o,e,r)):Mn(i,e,r)}else{const i=e.out._zod.run(n,r);return i instanceof Promise?i.then(o=>Mn(o,e,r)):Mn(i,e,r)}}});function Mn(t,e,n){if(t.issues.length)return t.aborted=!0,t;if((n.direction||"forward")==="forward"){const s=e.transform(t.value,t);return s instanceof Promise?s.then(i=>Un(t,i,e.out,n)):Un(t,s,e.out,n)}else{const s=e.reverseTransform(t.value,t);return s instanceof Promise?s.then(i=>Un(t,i,e.in,n)):Un(t,s,e.in,n)}}function Un(t,e,n,r){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},r)}const If=U("$ZodReadonly",(t,e)=>{Ee.init(t,e),me(t._zod,"propValues",()=>e.innerType._zod.propValues),me(t._zod,"values",()=>e.innerType._zod.values),me(t._zod,"optin",()=>e.innerType?._zod?.optin),me(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(n,r)=>{if(r.direction==="backward")return e.innerType._zod.run(n,r);const s=e.innerType._zod.run(n,r);return s instanceof Promise?s.then(Ti):Ti(s)}});function Ti(t){return t.value=Object.freeze(t.value),t}const Of=U("$ZodTemplateLiteral",(t,e)=>{Ee.init(t,e);const n=[];for(const r of e.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);const s=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!s)throw new Error(`Invalid template literal part: ${r._zod.traits}`);const i=s.startsWith("^")?1:0,o=s.endsWith("$")?s.length-1:s.length;n.push(s.slice(i,o))}else if(r===null||ku.has(typeof r))n.push(jt(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(r,s)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:t,expected:"string",code:"invalid_type"}),r):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),r)}),Af=U("$ZodCustom",(t,e)=>{Xe.init(t,e),Ee.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,s=e.fn(r);if(s instanceof Promise)return s.then(i=>Pi(i,n,r,t));Pi(s,n,r,t)}});function Pi(t,e,n,r){if(!t){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),e.issues.push(Tn(s))}}var Ci;class Nf{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){const r=n[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(e)};return Object.keys(s).length?s:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Tf(){return new Nf}(Ci=globalThis).__zod_globalRegistry??(Ci.__zod_globalRegistry=Tf());const En=globalThis.__zod_globalRegistry;function Pf(t,e){return new t({type:"string",...te(e)})}function Cf(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...te(e)})}function xi(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...te(e)})}function xf(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...te(e)})}function Bf(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(e)})}function Df(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(e)})}function zf(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(e)})}function Ha(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...te(e)})}function Rf(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...te(e)})}function jf(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(e)})}function Ff(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...te(e)})}function Ga(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(e)})}function Mf(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...te(e)})}function Uf(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...te(e)})}function Lf(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(e)})}function qf(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(e)})}function Zf(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(e)})}function Vf(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(e)})}function Kf(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(e)})}function Jf(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...te(e)})}function Hf(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...te(e)})}function Gf(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...te(e)})}function Wf(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...te(e)})}function Yf(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(e)})}function Qf(t,e){return new t({type:"string",format:"date",check:"string_format",...te(e)})}function Xf(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...te(e)})}function ed(t,e){return new t({type:"string",format:"duration",check:"string_format",...te(e)})}function td(t,e){return new t({type:"number",checks:[],...te(e)})}function nd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...te(e)})}function rd(t,e){return new t({type:"boolean",...te(e)})}function sd(t,e){return new t({type:"boolean",coerce:!0,...te(e)})}function id(t){return new t({type:"unknown"})}function od(t,e){return new t({type:"never",...te(e)})}function ad(t,e){return new t({type:"date",...te(e)})}function Bi(t,e){return new Ma({check:"less_than",...te(e),value:t,inclusive:!1})}function Br(t,e){return new Ma({check:"less_than",...te(e),value:t,inclusive:!0})}function Di(t,e){return new Ua({check:"greater_than",...te(e),value:t,inclusive:!1})}function Dr(t,e){return new Ua({check:"greater_than",...te(e),value:t,inclusive:!0})}function zi(t,e){return new wl({check:"multiple_of",...te(e),value:t})}function Wa(t,e){return new _l({check:"max_length",...te(e),maximum:t})}function Lr(t,e){return new bl({check:"min_length",...te(e),minimum:t})}function Ya(t,e){return new $l({check:"length_equals",...te(e),length:t})}function cd(t,e){return new Sl({check:"string_format",format:"regex",...te(e),pattern:t})}function ud(t){return new El({check:"string_format",format:"lowercase",...te(t)})}function ld(t){return new kl({check:"string_format",format:"uppercase",...te(t)})}function fd(t,e){return new Il({check:"string_format",format:"includes",...te(e),includes:t})}function dd(t,e){return new Ol({check:"string_format",format:"starts_with",...te(e),prefix:t})}function hd(t,e){return new Al({check:"string_format",format:"ends_with",...te(e),suffix:t})}function cn(t){return new Nl({check:"overwrite",tx:t})}function pd(t){return cn(e=>e.normalize(t))}function md(){return cn(t=>t.trim())}function gd(){return cn(t=>t.toLowerCase())}function yd(){return cn(t=>t.toUpperCase())}function wd(){return cn(t=>$u(t))}function vd(t,e,n){return new t({type:"array",element:e,...te(n)})}function _d(t,e,n){const r=te(n);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function bd(t,e,n){return new t({type:"custom",check:"custom",fn:e,...te(n)})}function $d(t){const e=Sd(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Tn(r,n.value,e._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!e._zod.def.abort),n.issues.push(Tn(s))}},t(n.value,n)));return e}function Sd(t,e){const n=new Xe({check:"custom",...te(e)});return n._zod.check=t,n}function Qa(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??En,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function ze(t,e,n={path:[],schemaPath:[]}){var r;const s=t._zod.def,i=e.seen.get(t);if(i)return i.count++,n.schemaPath.includes(t)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,o);const a=t._zod.toJSONSchema?.();if(a)o.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,d);else{const h=o.schema,m=e.processors[s.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);m(t,e,h,d)}const p=t._zod.parent;p&&(o.ref||(o.ref=p),ze(p,e,d),e.seen.get(p).isParent=!0)}const c=e.metadataRegistry.get(t);return c&&Object.assign(o.schema,c),e.io==="input"&&He(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function Xa(t,e){const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of t.seen.entries()){const a=t.metadataRegistry.get(o[0])?.id;if(a){const c=r.get(a);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,o[0])}}const s=o=>{const a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const p=t.external.registry.get(o[0])?.id,h=t.external.uri??(_=>_);if(p)return{ref:h(p)};const m=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=m,{defId:m,ref:`${h("__shared")}#/${a}/${m}`}}if(o[1]===n)return{ref:"#"};const l=`#/${a}/`,d=o[1].schema.id??`__schema${t.counter++}`;return{defId:d,ref:l+d}},i=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:c,defId:l}=s(o);a.def={...a.schema},l&&(a.defId=l);const d=a.schema;for(const p in d)delete d[p];d.$ref=c};if(t.cycles==="throw")for(const o of t.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
38
|
-
|
|
39
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of t.seen.entries()){const a=o[1];if(e===o[0]){i(o);continue}if(t.external){const l=t.external.registry.get(o[0])?.id;if(e!==o[0]&&l){i(o);continue}}if(t.metadataRegistry.get(o[0])?.id){i(o);continue}if(a.cycle){i(o);continue}if(a.count>1&&t.reused==="ref"){i(o);continue}}}function ec(t,e){const n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const a=t.seen.get(o);if(a.ref===null)return;const c=a.def??a.schema,l={...c},d=a.ref;if(a.ref=null,d){r(d);const h=t.seen.get(d),m=h.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,l),o._zod.parent===d)for(const g in c)g==="$ref"||g==="allOf"||g in l||delete c[g];if(m.$ref&&h.def)for(const g in c)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(c[g])===JSON.stringify(h.def[g])&&delete c[g]}const p=o._zod.parent;if(p&&p!==d){r(p);const h=t.seen.get(p);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(const m in c)m==="$ref"||m==="allOf"||m in h.def&&JSON.stringify(c[m])===JSON.stringify(h.def[m])&&delete c[m]}t.override({zodSchema:o,jsonSchema:c,path:a.path??[]})};for(const o of[...t.seen.entries()].reverse())r(o[0]);const s={};if(t.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){const o=t.external.registry.get(e)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=t.external.uri(o)}Object.assign(s,n.def??n.schema);const i=t.external?.defs??{};for(const o of t.seen.entries()){const a=o[1];a.def&&a.defId&&(i[a.defId]=a.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...e["~standard"],jsonSchema:{input:qr(e,"input",t.processors),output:qr(e,"output",t.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function He(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return He(r.element,n);if(r.type==="set")return He(r.valueType,n);if(r.type==="lazy")return He(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return He(r.innerType,n);if(r.type==="intersection")return He(r.left,n)||He(r.right,n);if(r.type==="record"||r.type==="map")return He(r.keyType,n)||He(r.valueType,n);if(r.type==="pipe")return He(r.in,n)||He(r.out,n);if(r.type==="object"){for(const s in r.shape)if(He(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(He(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(He(s,n))return!0;return!!(r.rest&&He(r.rest,n))}return!1}const Ed=(t,e={})=>n=>{const r=Qa({...n,processors:e});return ze(t,r),Xa(r,t),ec(r,t)},qr=(t,e,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=Qa({...s??{},target:i,io:e,processors:n});return ze(t,o),Xa(o,t),ec(o,t)},kd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Id=(t,e,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),a&&(s.format=kd[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),l&&(s.contentEncoding=l),c&&c.size>0){const d=[...c];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Od=(t,e,n,r)=>{const s=n,{minimum:i,maximum:o,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:d}=t._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof d=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d),typeof i=="number"&&(s.minimum=i,typeof d=="number"&&e.target!=="draft-04"&&(d>=i?delete s.minimum:delete s.exclusiveMinimum)),typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(s.maximum=l,s.exclusiveMaximum=!0):s.exclusiveMaximum=l),typeof o=="number"&&(s.maximum=o,typeof l=="number"&&e.target!=="draft-04"&&(l<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},Ad=(t,e,n,r)=>{n.type="boolean"},Nd=(t,e,n,r)=>{n.not={}},Td=(t,e,n,r)=>{},Pd=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Cd=(t,e,n,r)=>{const s=t._zod.def,i=Na(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},xd=(t,e,n,r)=>{const s=t._zod.def,i=[];for(const o of s.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},Bd=(t,e,n,r)=>{const s=n,i=t._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=i.source},Dd=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},zd=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Rd=(t,e,n,r)=>{const s=n,i=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;typeof o=="number"&&(s.minItems=o),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=ze(i.element,e,{...r,path:[...r.path,"items"]})},jd=(t,e,n,r)=>{const s=n,i=t._zod.def;s.type="object",s.properties={};const o=i.shape;for(const l in o)s.properties[l]=ze(o[l],e,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(l=>{const d=i.shape[l]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(s.required=Array.from(c)),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=ze(i.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(s.additionalProperties=!1)},Fd=(t,e,n,r)=>{const s=t._zod.def,i=s.inclusive===!1,o=s.options.map((a,c)=>ze(a,e,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=o:n.anyOf=o},Md=(t,e,n,r)=>{const s=t._zod.def,i=ze(s.left,e,{...r,path:[...r.path,"allOf",0]}),o=ze(s.right,e,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=c},Ud=(t,e,n,r)=>{const s=n,i=t._zod.def;s.type="object";const o=i.keyType,c=o._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){const d=ze(i.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const p of c)s.patternProperties[p.source]=d}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(s.propertyNames=ze(i.keyType,e,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=ze(i.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const l=o._zod.values;if(l){const d=[...l].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(s.required=d)}},Ld=(t,e,n,r)=>{const s=t._zod.def,i=ze(s.innerType,e,r),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},qd=(t,e,n,r)=>{const s=t._zod.def;ze(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},Zd=(t,e,n,r)=>{const s=t._zod.def;ze(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},Vd=(t,e,n,r)=>{const s=t._zod.def;ze(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},Kd=(t,e,n,r)=>{const s=t._zod.def;ze(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},Jd=(t,e,n,r)=>{const s=t._zod.def,i=e.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;ze(i,e,r);const o=e.seen.get(t);o.ref=i},Hd=(t,e,n,r)=>{const s=t._zod.def;ze(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,n.readOnly=!0},tc=(t,e,n,r)=>{const s=t._zod.def;ze(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},Gd=U("ZodISODateTime",(t,e)=>{ql.init(t,e),Ne.init(t,e)});function Wd(t){return Yf(Gd,t)}const Yd=U("ZodISODate",(t,e)=>{Zl.init(t,e),Ne.init(t,e)});function Qd(t){return Qf(Yd,t)}const Xd=U("ZodISOTime",(t,e)=>{Vl.init(t,e),Ne.init(t,e)});function eh(t){return Xf(Xd,t)}const th=U("ZodISODuration",(t,e)=>{Kl.init(t,e),Ne.init(t,e)});function nh(t){return ed(th,t)}const rh=(t,e)=>{xa.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>zu(t,n)},flatten:{value:n=>Du(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Ds,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Ds,2)}},isEmpty:{get(){return t.issues.length===0}}})},it=U("ZodError",rh,{Parent:Error}),sh=Hs(it),ih=Gs(it),oh=Wr(it),ah=Yr(it),ch=Fu(it),uh=Mu(it),lh=Uu(it),fh=Lu(it),dh=qu(it),hh=Zu(it),ph=Vu(it),mh=Ku(it),ke=U("ZodType",(t,e)=>(Ee.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:qr(t,"input"),output:qr(t,"output")}}),t.toJSONSchema=Ed(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone(Ot(e,{checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),t.with=t.check,t.clone=(n,r)=>At(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>sh(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>oh(t,n,r),t.parseAsync=async(n,r)=>ih(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>ah(t,n,r),t.spa=t.safeParseAsync,t.encode=(n,r)=>ch(t,n,r),t.decode=(n,r)=>uh(t,n,r),t.encodeAsync=async(n,r)=>lh(t,n,r),t.decodeAsync=async(n,r)=>fh(t,n,r),t.safeEncode=(n,r)=>dh(t,n,r),t.safeDecode=(n,r)=>hh(t,n,r),t.safeEncodeAsync=async(n,r)=>ph(t,n,r),t.safeDecodeAsync=async(n,r)=>mh(t,n,r),t.refine=(n,r)=>t.check(cp(n,r)),t.superRefine=n=>t.check(up(n)),t.overwrite=n=>t.check(cn(n)),t.optional=()=>Fi(t),t.exactOptional=()=>Hh(t),t.nullable=()=>Mi(t),t.nullish=()=>Fi(Mi(t)),t.nonoptional=n=>ep(t,n),t.array=()=>Ve(t),t.or=n=>Ut([t,n]),t.and=n=>Lh(t,n),t.transform=n=>Ui(t,Kh(n)),t.default=n=>Yh(t,n),t.prefault=n=>Xh(t,n),t.catch=n=>np(t,n),t.pipe=n=>Ui(t,n),t.readonly=()=>op(t),t.describe=n=>{const r=t.clone();return En.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){return En.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return En.get(t);const r=t.clone();return En.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=n=>n(t),t)),nc=U("_ZodString",(t,e)=>{Ws.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Id(t,r,s);const n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check(cd(...r)),t.includes=(...r)=>t.check(fd(...r)),t.startsWith=(...r)=>t.check(dd(...r)),t.endsWith=(...r)=>t.check(hd(...r)),t.min=(...r)=>t.check(Lr(...r)),t.max=(...r)=>t.check(Wa(...r)),t.length=(...r)=>t.check(Ya(...r)),t.nonempty=(...r)=>t.check(Lr(1,...r)),t.lowercase=r=>t.check(ud(r)),t.uppercase=r=>t.check(ld(r)),t.trim=()=>t.check(md()),t.normalize=(...r)=>t.check(pd(...r)),t.toLowerCase=()=>t.check(gd()),t.toUpperCase=()=>t.check(yd()),t.slugify=()=>t.check(wd())}),gh=U("ZodString",(t,e)=>{Ws.init(t,e),nc.init(t,e),t.email=n=>t.check(Cf(yh,n)),t.url=n=>t.check(Ha(rc,n)),t.jwt=n=>t.check(Wf(Ch,n)),t.emoji=n=>t.check(Rf(vh,n)),t.guid=n=>t.check(xi(Ri,n)),t.uuid=n=>t.check(xf(Ln,n)),t.uuidv4=n=>t.check(Bf(Ln,n)),t.uuidv6=n=>t.check(Df(Ln,n)),t.uuidv7=n=>t.check(zf(Ln,n)),t.nanoid=n=>t.check(jf(_h,n)),t.guid=n=>t.check(xi(Ri,n)),t.cuid=n=>t.check(Ff(bh,n)),t.cuid2=n=>t.check(Ga(sc,n)),t.ulid=n=>t.check(Mf($h,n)),t.base64=n=>t.check(Jf(Nh,n)),t.base64url=n=>t.check(Hf(Th,n)),t.xid=n=>t.check(Uf(Sh,n)),t.ksuid=n=>t.check(Lf(Eh,n)),t.ipv4=n=>t.check(qf(kh,n)),t.ipv6=n=>t.check(Zf(Ih,n)),t.cidrv4=n=>t.check(Vf(Oh,n)),t.cidrv6=n=>t.check(Kf(Ah,n)),t.e164=n=>t.check(Gf(Ph,n)),t.datetime=n=>t.check(Wd(n)),t.date=n=>t.check(Qd(n)),t.time=n=>t.check(eh(n)),t.duration=n=>t.check(nh(n))});function z(t){return Pf(gh,t)}const Ne=U("ZodStringFormat",(t,e)=>{Ae.init(t,e),nc.init(t,e)}),yh=U("ZodEmail",(t,e)=>{Bl.init(t,e),Ne.init(t,e)}),Ri=U("ZodGUID",(t,e)=>{Cl.init(t,e),Ne.init(t,e)}),Ln=U("ZodUUID",(t,e)=>{xl.init(t,e),Ne.init(t,e)}),rc=U("ZodURL",(t,e)=>{Dl.init(t,e),Ne.init(t,e)});function wh(t){return Ha(rc,t)}const vh=U("ZodEmoji",(t,e)=>{zl.init(t,e),Ne.init(t,e)}),_h=U("ZodNanoID",(t,e)=>{Rl.init(t,e),Ne.init(t,e)}),bh=U("ZodCUID",(t,e)=>{jl.init(t,e),Ne.init(t,e)}),sc=U("ZodCUID2",(t,e)=>{Fl.init(t,e),Ne.init(t,e)});function ye(t){return Ga(sc,t)}const $h=U("ZodULID",(t,e)=>{Ml.init(t,e),Ne.init(t,e)}),Sh=U("ZodXID",(t,e)=>{Ul.init(t,e),Ne.init(t,e)}),Eh=U("ZodKSUID",(t,e)=>{Ll.init(t,e),Ne.init(t,e)}),kh=U("ZodIPv4",(t,e)=>{Jl.init(t,e),Ne.init(t,e)}),Ih=U("ZodIPv6",(t,e)=>{Hl.init(t,e),Ne.init(t,e)}),Oh=U("ZodCIDRv4",(t,e)=>{Gl.init(t,e),Ne.init(t,e)}),Ah=U("ZodCIDRv6",(t,e)=>{Wl.init(t,e),Ne.init(t,e)}),Nh=U("ZodBase64",(t,e)=>{Yl.init(t,e),Ne.init(t,e)}),Th=U("ZodBase64URL",(t,e)=>{Xl.init(t,e),Ne.init(t,e)}),Ph=U("ZodE164",(t,e)=>{ef.init(t,e),Ne.init(t,e)}),Ch=U("ZodJWT",(t,e)=>{nf.init(t,e),Ne.init(t,e)}),ic=U("ZodNumber",(t,e)=>{qa.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Od(t,r,s),t.gt=(r,s)=>t.check(Di(r,s)),t.gte=(r,s)=>t.check(Dr(r,s)),t.min=(r,s)=>t.check(Dr(r,s)),t.lt=(r,s)=>t.check(Bi(r,s)),t.lte=(r,s)=>t.check(Br(r,s)),t.max=(r,s)=>t.check(Br(r,s)),t.int=r=>t.check(ji(r)),t.safe=r=>t.check(ji(r)),t.positive=r=>t.check(Di(0,r)),t.nonnegative=r=>t.check(Dr(0,r)),t.negative=r=>t.check(Bi(0,r)),t.nonpositive=r=>t.check(Br(0,r)),t.multipleOf=(r,s)=>t.check(zi(r,s)),t.step=(r,s)=>t.check(zi(r,s)),t.finite=()=>t;const n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function Qe(t){return td(ic,t)}const xh=U("ZodNumberFormat",(t,e)=>{rf.init(t,e),ic.init(t,e)});function ji(t){return nd(xh,t)}const oc=U("ZodBoolean",(t,e)=>{sf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Ad(t,n,r)});function $e(t){return rd(oc,t)}const Bh=U("ZodUnknown",(t,e)=>{of.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Td()});function wt(){return id(Bh)}const Dh=U("ZodNever",(t,e)=>{af.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Nd(t,n,r)});function zh(t){return od(Dh,t)}const Rh=U("ZodDate",(t,e)=>{cf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Pd(t,r),t.min=(r,s)=>t.check(Dr(r,s)),t.max=(r,s)=>t.check(Br(r,s));const n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});function ve(t){return ad(Rh,t)}const jh=U("ZodArray",(t,e)=>{uf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Rd(t,n,r,s),t.element=e.element,t.min=(n,r)=>t.check(Lr(n,r)),t.nonempty=n=>t.check(Lr(1,n)),t.max=(n,r)=>t.check(Wa(n,r)),t.length=(n,r)=>t.check(Ya(n,r)),t.unwrap=()=>t.element});function Ve(t,e){return vd(jh,t,e)}const Fh=U("ZodObject",(t,e)=>{ff.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>jd(t,n,r,s),me(t,"shape",()=>e.shape),t.keyof=()=>vt(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:wt()}),t.loose=()=>t.clone({...t._zod.def,catchall:wt()}),t.strict=()=>t.clone({...t._zod.def,catchall:zh()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>Tu(t,n),t.safeExtend=n=>Pu(t,n),t.merge=n=>Cu(t,n),t.pick=n=>Au(t,n),t.omit=n=>Nu(t,n),t.partial=(...n)=>xu(cc,t,n[0]),t.required=(...n)=>Bu(uc,t,n[0])});function K(t,e){const n={type:"object",shape:t??{},...te(e)};return new Fh(n)}const ac=U("ZodUnion",(t,e)=>{Ka.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Fd(t,n,r,s),t.options=e.options});function Ut(t,e){return new ac({type:"union",options:t,...te(e)})}const Mh=U("ZodDiscriminatedUnion",(t,e)=>{ac.init(t,e),df.init(t,e)});function Nt(t,e,n){return new Mh({type:"union",options:e,discriminator:t,...te(n)})}const Uh=U("ZodIntersection",(t,e)=>{hf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Md(t,n,r,s)});function Lh(t,e){return new Uh({type:"intersection",left:t,right:e})}const qh=U("ZodRecord",(t,e)=>{pf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Ud(t,n,r,s),t.keyType=e.keyType,t.valueType=e.valueType});function je(t,e,n){return new qh({type:"record",keyType:t,valueType:e,...te(n)})}const Rs=U("ZodEnum",(t,e)=>{mf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Cd(t,r,s),t.enum=e.entries,t.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));t.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Rs({...e,checks:[],...te(s),entries:i})},t.exclude=(r,s)=>{const i={...e.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new Rs({...e,checks:[],...te(s),entries:i})}});function vt(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Rs({type:"enum",entries:n,...te(e)})}const Zh=U("ZodLiteral",(t,e)=>{gf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>xd(t,n,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function pe(t,e){return new Zh({type:"literal",values:Array.isArray(t)?t:[t],...te(e)})}const Vh=U("ZodTransform",(t,e)=>{yf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>zd(t,n),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Oa(t.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Tn(i,n.value,e));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),n.issues.push(Tn(o))}};const s=e.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function Kh(t){return new Vh({type:"transform",transform:t})}const cc=U("ZodOptional",(t,e)=>{Ja.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>tc(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Fi(t){return new cc({type:"optional",innerType:t})}const Jh=U("ZodExactOptional",(t,e)=>{wf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>tc(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Hh(t){return new Jh({type:"optional",innerType:t})}const Gh=U("ZodNullable",(t,e)=>{vf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Ld(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Mi(t){return new Gh({type:"nullable",innerType:t})}const Wh=U("ZodDefault",(t,e)=>{_f.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Zd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Yh(t,e){return new Wh({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():Pa(e)}})}const Qh=U("ZodPrefault",(t,e)=>{bf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Vd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Xh(t,e){return new Qh({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():Pa(e)}})}const uc=U("ZodNonOptional",(t,e)=>{$f.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>qd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function ep(t,e){return new uc({type:"nonoptional",innerType:t,...te(e)})}const tp=U("ZodCatch",(t,e)=>{Sf.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Kd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function np(t,e){return new tp({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const lc=U("ZodPipe",(t,e)=>{Ef.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Jd(t,n,r,s),t.in=e.in,t.out=e.out});function Ui(t,e){return new lc({type:"pipe",in:t,out:e})}const rp=U("ZodCodec",(t,e)=>{lc.init(t,e),kf.init(t,e)});function sp(t,e,n){return new rp({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}const ip=U("ZodReadonly",(t,e)=>{If.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Hd(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function op(t){return new ip({type:"readonly",innerType:t})}const ap=U("ZodTemplateLiteral",(t,e)=>{Of.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Bd(t,n,r)});function zr(t,e){return new ap({type:"template_literal",parts:t,...te(e)})}const Ys=U("ZodCustom",(t,e)=>{Af.init(t,e),ke.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Dd(t,n)});function en(t,e){return _d(Ys,(()=>!0),e)}function cp(t,e={}){return bd(Ys,t,e)}function up(t){return $d(t)}function lp(t,e={}){const n=new Ys({type:"custom",check:"custom",fn:r=>r instanceof t,abort:!0,...te(e)});return n._zod.bag.Class=t,n._zod.check=r=>{r.value instanceof t||r.issues.push({code:"invalid_type",expected:t.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function fp(t){return sd(oc,t)}function dp(t,e,n){let r=s=>t(s,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function fc(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return dp(t,e,n);throw Error("Wrong number of arguments")}const dc={done:!1,hasNext:!1};function Li(t,...e){let n=t,r=e.map(i=>"lazy"in i?hp(i):void 0),s=0;for(;s<e.length;){if(r[s]===void 0||!pp(n)){let c=e[s];n=c(n),s+=1;continue}let i=[];for(let c=s;c<e.length;c++){let l=r[c];if(l===void 0||(i.push(l),l.isSingle))break}let o=[];for(let c of n)if(hc(c,o,i))break;let{isSingle:a}=i.at(-1);n=a?o[0]:o,s+=i.length}return n}function hc(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,s=dc,i=!1;for(let[o,a]of n.entries()){let{index:c,items:l}=a;if(l.push(r),s=a(r,c,l),a.index+=1,s.hasNext){if(s.hasMany??!1){for(let d of s.next)if(hc(d,e,n.slice(o+1)))return!0;return i}r=s.next}if(!s.hasNext)break;s.done&&(i=!0)}return s.hasNext&&e.push(r),i}function hp(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function pp(t){return typeof t=="string"||typeof t=="object"&&!!t&&Symbol.iterator in t}function mp(t,e){let n=e.length-t.length;if(n===1){let[r,...s]=e;return Li(r,{lazy:t,lazyArgs:s})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(s=>Li(s,r),r)}throw Error("Wrong number of arguments")}function gp(...t){return fc(Object.fromEntries,t)}function yp(...t){return fc(wp,t)}function wp(t,e){let n={};for(let[r,s]of Object.entries(t))n[r]=e(s,r,t);return n}function vp(...t){return mp(_p,t)}function _p(){let t=new Set;return e=>t.has(e)?dc:(t.add(e),{done:!1,hasNext:!0,next:e})}const Qs=Symbol.for("yaml.alias"),js=Symbol.for("yaml.document"),St=Symbol.for("yaml.map"),pc=Symbol.for("yaml.pair"),ft=Symbol.for("yaml.scalar"),un=Symbol.for("yaml.seq"),st=Symbol.for("yaml.node.type"),Lt=t=>!!t&&typeof t=="object"&&t[st]===Qs,Xr=t=>!!t&&typeof t=="object"&&t[st]===js,Bn=t=>!!t&&typeof t=="object"&&t[st]===St,De=t=>!!t&&typeof t=="object"&&t[st]===pc,Se=t=>!!t&&typeof t=="object"&&t[st]===ft,Dn=t=>!!t&&typeof t=="object"&&t[st]===un;function xe(t){if(t&&typeof t=="object")switch(t[st]){case St:case un:return!0}return!1}function Be(t){if(t&&typeof t=="object")switch(t[st]){case Qs:case St:case ft:case un:return!0}return!1}const mc=t=>(Se(t)||xe(t))&&!!t.anchor,Dt=Symbol("break visit"),bp=Symbol("skip children"),On=Symbol("remove node");function ln(t,e){const n=$p(e);Xr(t)?Wt(null,t.contents,n,Object.freeze([t]))===On&&(t.contents=null):Wt(null,t,n,Object.freeze([]))}ln.BREAK=Dt;ln.SKIP=bp;ln.REMOVE=On;function Wt(t,e,n,r){const s=Sp(t,e,n,r);if(Be(s)||De(s))return Ep(t,r,s),Wt(t,s,n,r);if(typeof s!="symbol"){if(xe(e)){r=Object.freeze(r.concat(e));for(let i=0;i<e.items.length;++i){const o=Wt(i,e.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===Dt)return Dt;o===On&&(e.items.splice(i,1),i-=1)}}}else if(De(e)){r=Object.freeze(r.concat(e));const i=Wt("key",e.key,n,r);if(i===Dt)return Dt;i===On&&(e.key=null);const o=Wt("value",e.value,n,r);if(o===Dt)return Dt;o===On&&(e.value=null)}}return s}function $p(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function Sp(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(Bn(e))return n.Map?.(t,e,r);if(Dn(e))return n.Seq?.(t,e,r);if(De(e))return n.Pair?.(t,e,r);if(Se(e))return n.Scalar?.(t,e,r);if(Lt(e))return n.Alias?.(t,e,r)}function Ep(t,e,n){const r=e[e.length-1];if(xe(r))r.items[t]=n;else if(De(r))t==="key"?r.key=n:r.value=n;else if(Xr(r))r.contents=n;else{const s=Lt(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const kp={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ip=t=>t.replace(/[!,[\]{}]/g,e=>kp[e]);class Ge{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ge.defaultYaml,e),this.tags=Object.assign({},Ge.defaultTags,n)}clone(){const e=new Ge(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Ge(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ge.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ge.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:Ge.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ge.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),s=r.shift();switch(s){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[i,o]=r;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=r;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const o=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,o),!1}}default:return n(0,`Unknown directive ${s}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,s]=e.match(/^(.*!)([^!]*)$/s);s||n(`The ${e} tag has no suffix`);const i=this.tags[r];if(i)try{return i+decodeURIComponent(s)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+Ip(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let s;if(e&&r.length>0&&Be(e.contents)){const i={};ln(e.contents,(o,a)=>{Be(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,o]of r)i==="!!"&&o==="tag:yaml.org,2002:"||(!e||s.some(a=>a.startsWith(o)))&&n.push(`%TAG ${i} ${o}`);return n.join(`
|
|
40
|
-
`)}}Ge.defaultYaml={explicit:!1,version:"1.2"};Ge.defaultTags={"!!":"tag:yaml.org,2002:"};function gc(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function yc(t){const e=new Set;return ln(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function wc(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function Op(t,e){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=yc(t));const o=wc(e,s);return s.add(o),o},setAnchors:()=>{for(const i of n){const o=r.get(i);if(typeof o=="object"&&o.anchor&&(Se(o.node)||xe(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:r}}function Yt(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){const o=r[s],a=Yt(t,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const i=r.get(s),o=Yt(t,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(const s of Array.from(r)){const i=Yt(t,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(const[s,i]of Object.entries(r)){const o=Yt(t,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return t.call(e,n,r)}function rt(t,e,n){if(Array.isArray(t))return t.map((r,s)=>rt(r,String(s),n));if(t&&typeof t.toJSON=="function"){if(!n||!mc(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=t.toJSON(e,n);return n.onCreate&&n.onCreate(s),s}return typeof t=="bigint"&&!n?.keep?Number(t):t}class Xs{constructor(e){Object.defineProperty(this,st,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!Xr(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=rt(this,"",o);if(typeof s=="function")for(const{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?Yt(i,{"":a},"",a):a}}class ei extends Xs{constructor(e){super(Qs),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],ln(e,{Node:(i,o)=>{(Lt(o)||mc(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(e,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,o=this.resolve(s,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(rt(o,null,n),a=r.get(o)),a?.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Rr(s,o,r)),a.count*a.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,r){const s=`*${this.source}`;if(e){if(gc(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const 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 Rr(t,e,n){if(Lt(e)){const r=e.resolve(t),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(xe(e)){let r=0;for(const s of e.items){const i=Rr(t,s,n);i>r&&(r=i)}return r}else if(De(e)){const r=Rr(t,e.key,n),s=Rr(t,e.value,n);return Math.max(r,s)}return 1}const vc=t=>!t||typeof t!="function"&&typeof t!="object";class ce extends Xs{constructor(e){super(ft),this.value=e}toJSON(e,n){return n?.keep?this.value:rt(this.value,e,n)}toString(){return String(this.value)}}ce.BLOCK_FOLDED="BLOCK_FOLDED";ce.BLOCK_LITERAL="BLOCK_LITERAL";ce.PLAIN="PLAIN";ce.QUOTE_DOUBLE="QUOTE_DOUBLE";ce.QUOTE_SINGLE="QUOTE_SINGLE";const Ap="tag:yaml.org,2002:";function Np(t,e,n){if(e){const r=n.filter(i=>i.tag===e),s=r.find(i=>!i.format)??r[0];if(!s)throw new Error(`Tag ${e} not found`);return s}return n.find(r=>r.identify?.(t)&&!r.format)}function Pn(t,e,n){if(Xr(t)&&(t=t.contents),Be(t))return t;if(De(t)){const p=n.schema[St].createNode?.(n.schema,null,n);return p.items.push(t),p}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n;let c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=s(t)),new ei(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Ap+e.slice(2));let l=Np(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new ce(t);return c&&(c.node=p),p}l=t instanceof Map?o[St]:Symbol.iterator in Object(t)?o[un]:o[St]}i&&(i(l),delete n.onTagObj);const d=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new ce(t);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}function Zr(t,e,n){let r=n;for(let s=e.length-1;s>=0;--s){const i=e[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return Pn(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const kn=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class _c extends Xs{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>Be(r)||De(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(kn(e))this.add(n);else{const[r,...s]=e,i=this.get(r,!0);if(xe(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Zr(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(e){const[n,...r]=e;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(xe(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...s]=e,i=this.get(r,!0);return s.length===0?!n&&Se(i)?i.value:i:xe(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!De(n))return!1;const r=n.value;return r==null||e&&Se(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(r.length===0)return this.has(n);const s=this.get(n,!0);return xe(s)?s.hasIn(r):!1}setIn(e,n){const[r,...s]=e;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(xe(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Zr(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const Tp=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function gt(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const zt=(t,e,n)=>t.endsWith(`
|
|
41
|
-
`)?gt(n,e):n.includes(`
|
|
42
|
-
`)?`
|
|
43
|
-
`+gt(n,e):(t.endsWith(" ")?"":" ")+n,bc="flow",Fs="block",jr="quoted";function es(t,e,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return t;s<i&&(i=0);const c=Math.max(1+i,1+s-e.length);if(t.length<=c)return t;const l=[],d={};let p=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):p=s-r);let h,m,_=!1,g=-1,w=-1,$=-1;n===Fs&&(g=qi(t,g,e.length),g!==-1&&(p=g+c));for(let b;b=t[g+=1];){if(n===jr&&b==="\\"){switch(w=g,t[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}$=g}if(b===`
|
|
44
|
-
`)n===Fs&&(g=qi(t,g,e.length)),p=g+e.length+c,h=void 0;else{if(b===" "&&m&&m!==" "&&m!==`
|
|
45
|
-
`&&m!==" "){const I=t[g+1];I&&I!==" "&&I!==`
|
|
46
|
-
`&&I!==" "&&(h=g)}if(g>=p)if(h)l.push(h),p=h+c,h=void 0;else if(n===jr){for(;m===" "||m===" ";)m=b,b=t[g+=1],_=!0;const I=g>$+1?g-2:w-1;if(d[I])return t;l.push(I),d[I]=!0,p=I+c,h=void 0}else _=!0}m=b}if(_&&a&&a(),l.length===0)return t;o&&o();let y=t.slice(0,l[0]);for(let b=0;b<l.length;++b){const I=l[b],v=l[b+1]||t.length;I===0?y=`
|
|
47
|
-
${e}${t.slice(0,v)}`:(n===jr&&d[I]&&(y+=`${t[I]}\\`),y+=`
|
|
48
|
-
${e}${t.slice(I+1,v)}`)}return y}function qi(t,e,n){let r=e,s=e+1,i=t[s];for(;i===" "||i===" ";)if(e<s+n)i=t[++e];else{do i=t[++e];while(i&&i!==`
|
|
49
|
-
`);r=e,s=e+1,i=t[s]}return r}const ts=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),ns=t=>/^(%|---|\.\.\.)/m.test(t);function Pp(t,e,n){if(!e||e<0)return!1;const r=e-n,s=t.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(t[i]===`
|
|
50
|
-
`){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function An(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(ns(t)?" ":"");let o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);const d=n.substr(c+2,4);switch(d){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:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<s)c+=1;else{for(o+=n.slice(a,c)+`
|
|
51
|
-
|
|
52
|
-
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
|
|
53
|
-
`,c+=2;o+=i,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,r?o:es(o,i,jr,ts(e,!1))}function Ms(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
54
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return An(t,e);const n=e.indent||(ns(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
55
|
-
${n}`)+"'";return e.implicitKey?r:es(r,n,bc,ts(e,!1))}function Qt(t,e){const{singleQuote:n}=e.options;let r;if(n===!1)r=An;else{const s=t.includes('"'),i=t.includes("'");s&&!i?r=Ms:i&&!s?r=An:r=n?Ms:An}return r(t,e)}let Us;try{Us=new RegExp(`(^|(?<!
|
|
56
|
-
))
|
|
57
|
-
+(?!
|
|
58
|
-
|$)`,"g")}catch{Us=/\n+(?!\n|$)/g}function Fr({comment:t,type:e,value:n},r,s,i){const{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return Qt(n,r);const l=r.indent||(r.forceBlockIndent||ns(n)?" ":""),d=o==="literal"?!0:o==="folded"||e===ce.BLOCK_FOLDED?!1:e===ce.BLOCK_LITERAL?!0:!Pp(n,c,l.length);if(!n)return d?`|
|
|
59
|
-
`:`>
|
|
60
|
-
`;let p,h;for(h=n.length;h>0;--h){const v=n[h-1];if(v!==`
|
|
61
|
-
`&&v!==" "&&v!==" ")break}let m=n.substring(h);const _=m.indexOf(`
|
|
62
|
-
`);_===-1?p="-":n===m||_!==m.length-1?(p="+",i&&i()):p="",m&&(n=n.slice(0,-m.length),m[m.length-1]===`
|
|
63
|
-
`&&(m=m.slice(0,-1)),m=m.replace(Us,`$&${l}`));let g=!1,w,$=-1;for(w=0;w<n.length;++w){const v=n[w];if(v===" ")g=!0;else if(v===`
|
|
64
|
-
`)$=w;else break}let y=n.substring(0,$<w?$+1:w);y&&(n=n.substring(y.length),y=y.replace(/\n+/g,`$&${l}`));let I=(g?l?"2":"1":"")+p;if(t&&(I+=" "+a(t.replace(/ ?[\r\n]+/g," ")),s&&s()),!d){const v=n.replace(/\n+/g,`
|
|
65
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);let k=!1;const A=ts(r,!0);o!=="folded"&&e!==ce.BLOCK_FOLDED&&(A.onOverflow=()=>{k=!0});const T=es(`${y}${v}${m}`,l,Fs,A);if(!k)return`>${I}
|
|
66
|
-
${l}${T}`}return n=n.replace(/\n+/g,`$&${l}`),`|${I}
|
|
67
|
-
${l}${y}${n}${m}`}function Cp(t,e,n,r){const{type:s,value:i}=t,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:d}=e;if(a&&i.includes(`
|
|
68
|
-
`)||d&&/[[\]{},]/.test(i))return Qt(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||d||!i.includes(`
|
|
69
|
-
`)?Qt(i,e):Fr(t,e,n,r);if(!a&&!d&&s!==ce.PLAIN&&i.includes(`
|
|
70
|
-
`))return Fr(t,e,n,r);if(ns(i)){if(c==="")return e.forceBlockIndent=!0,Fr(t,e,n,r);if(a&&c===l)return Qt(i,e)}const p=i.replace(/\n+/g,`$&
|
|
71
|
-
${c}`);if(o){const h=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(p),{compat:m,tags:_}=e.doc.schema;if(_.some(h)||m?.some(h))return Qt(i,e)}return a?p:es(p,c,bc,ts(e,!1))}function ti(t,e,n,r){const{implicitKey:s,inFlow:i}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:a}=t;a!==ce.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ce.QUOTE_DOUBLE);const c=d=>{switch(d){case ce.BLOCK_FOLDED:case ce.BLOCK_LITERAL:return s||i?Qt(o.value,e):Fr(o,e,n,r);case ce.QUOTE_DOUBLE:return An(o.value,e);case ce.QUOTE_SINGLE:return Ms(o.value,e);case ce.PLAIN:return Cp(o,e,n,r);default:return null}};let l=c(a);if(l===null){const{defaultKeyType:d,defaultStringType:p}=e.options,h=s&&d||p;if(l=c(h),l===null)throw new Error(`Unsupported default string type ${h}`)}return l}function $c(t,e){const n=Object.assign({blockQuote:!0,commentString:Tp,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function xp(t,e){if(e.tag){const s=t.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let n,r;if(Se(e)){r=e.value;let s=t.filter(i=>i.identify?.(r));if(s.length>1){const i=s.filter(o=>o.test);i.length>0&&(s=i)}n=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,n=t.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){const s=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function Bp(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(Se(t)||xe(t))&&t.anchor;i&&gc(i)&&(n.add(i),s.push(`&${i}`));const o=t.tag??(e.default?null:e.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}function on(t,e,n,r){if(De(t))return t.toString(e,n,r);if(Lt(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let s;const i=Be(t)?t:e.doc.createNode(t,{onTagObj:c=>s=c});s??(s=xp(e.doc.schema.tags,i));const o=Bp(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof s.stringify=="function"?s.stringify(i,e,n,r):Se(i)?ti(i,e,n,r):i.toString(e,n,r);return o?Se(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
72
|
-
${e.indent}${a}`:a}function Dp({key:t,value:e},n,r,s){const{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:p}}=n;let h=Be(t)&&t.comment||null;if(p){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(xe(t)||!Be(t)&&typeof t=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let m=!p&&(!t||h&&e==null&&!n.inFlow||xe(t)||(Se(t)?t.type===ce.BLOCK_FOLDED||t.type===ce.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(p||!i),indent:a+c});let _=!1,g=!1,w=on(t,n,()=>_=!0,()=>g=!0);if(!m&&!n.inFlow&&w.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(i||e==null)return _&&r&&r(),w===""?"?":m?`? ${w}`:w}else if(i&&!p||e==null&&m)return w=`? ${w}`,h&&!_?w+=zt(w,n.indent,l(h)):g&&s&&s(),w;_&&(h=null),m?(h&&(w+=zt(w,n.indent,l(h))),w=`? ${w}
|
|
73
|
-
${a}:`):(w=`${w}:`,h&&(w+=zt(w,n.indent,l(h))));let $,y,b;Be(e)?($=!!e.spaceBefore,y=e.commentBefore,b=e.comment):($=!1,y=null,b=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!m&&!h&&Se(e)&&(n.indentAtStart=w.length+1),g=!1,!d&&c.length>=2&&!n.inFlow&&!m&&Dn(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let I=!1;const v=on(e,n,()=>I=!0,()=>g=!0);let k=" ";if(h||$||y){if(k=$?`
|
|
74
|
-
`:"",y){const A=l(y);k+=`
|
|
75
|
-
${gt(A,n.indent)}`}v===""&&!n.inFlow?k===`
|
|
76
|
-
`&&b&&(k=`
|
|
77
|
-
|
|
78
|
-
`):k+=`
|
|
79
|
-
${n.indent}`}else if(!m&&xe(e)){const A=v[0],T=v.indexOf(`
|
|
80
|
-
`),L=T!==-1,H=n.inFlow??e.flow??e.items.length===0;if(L||!H){let G=!1;if(L&&(A==="&"||A==="!")){let Y=v.indexOf(" ");A==="&"&&Y!==-1&&Y<T&&v[Y+1]==="!"&&(Y=v.indexOf(" ",Y+1)),(Y===-1||T<Y)&&(G=!0)}G||(k=`
|
|
81
|
-
${n.indent}`)}}else(v===""||v[0]===`
|
|
82
|
-
`)&&(k="");return w+=k+v,n.inFlow?I&&r&&r():b&&!I?w+=zt(w,n.indent,l(b)):g&&s&&s(),w}function Sc(t,e){(t==="debug"||t==="warn")&&console.warn(e)}const qn="<<",yt={identify:t=>t===qn||typeof t=="symbol"&&t.description===qn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ce(Symbol(qn)),{addToJSMap:Ec}),stringify:()=>qn},zp=(t,e)=>(yt.identify(e)||Se(e)&&(!e.type||e.type===ce.PLAIN)&&yt.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===yt.tag&&n.default);function Ec(t,e,n){if(n=t&&Lt(n)?n.resolve(t.doc):n,Dn(n))for(const r of n.items)hs(t,e,r);else if(Array.isArray(n))for(const r of n)hs(t,e,r);else hs(t,e,n)}function hs(t,e,n){const r=t&&Lt(n)?n.resolve(t.doc):n;if(!Bn(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,t,Map);for(const[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 kc(t,e,{key:n,value:r}){if(Be(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(zp(t,n))Ec(t,e,r);else{const s=rt(n,"",t);if(e instanceof Map)e.set(s,rt(r,s,t));else if(e instanceof Set)e.add(s);else{const i=Rp(n,s,t),o=rt(r,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function Rp(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Be(t)&&n?.doc){const r=$c(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=t.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),Sc(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(e)}function ni(t,e,n){const r=Pn(t,void 0,n),s=Pn(e,void 0,n);return new We(r,s)}class We{constructor(e,n=null){Object.defineProperty(this,st,{value:pc}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return Be(n)&&(n=n.clone(e)),Be(r)&&(r=r.clone(e)),new We(n,r)}toJSON(e,n){const r=n?.mapAsMap?new Map:{};return kc(n,r,this)}toString(e,n,r){return e?.doc?Dp(this,e,n,r):JSON.stringify(this)}}function Ic(t,e,n){return(e.inFlow??t.flow?Fp:jp)(t,e,n)}function jp({comment:t,items:e},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:l}}=n,d=Object.assign({},n,{indent:i,type:null});let p=!1;const h=[];for(let _=0;_<e.length;++_){const g=e[_];let w=null;if(Be(g))!p&&g.spaceBefore&&h.push(""),Vr(n,h,g.commentBefore,p),g.comment&&(w=g.comment);else if(De(g)){const y=Be(g.key)?g.key:null;y&&(!p&&y.spaceBefore&&h.push(""),Vr(n,h,y.commentBefore,p))}p=!1;let $=on(g,d,()=>w=null,()=>p=!0);w&&($+=zt($,i,l(w))),p&&w&&(p=!1),h.push(r+$)}let m;if(h.length===0)m=s.start+s.end;else{m=h[0];for(let _=1;_<h.length;++_){const g=h[_];m+=g?`
|
|
83
|
-
${c}${g}`:`
|
|
84
|
-
`}}return t?(m+=`
|
|
85
|
-
`+gt(l(t),c),a&&a()):p&&o&&o(),m}function Fp({items:t},e,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=e;r+=i;const c=Object.assign({},e,{indent:r,inFlow:!0,type:null});let l=!1,d=0;const p=[];for(let _=0;_<t.length;++_){const g=t[_];let w=null;if(Be(g))g.spaceBefore&&p.push(""),Vr(e,p,g.commentBefore,!1),g.comment&&(w=g.comment);else if(De(g)){const y=Be(g.key)?g.key:null;y&&(y.spaceBefore&&p.push(""),Vr(e,p,y.commentBefore,!1),y.comment&&(l=!0));const b=Be(g.value)?g.value:null;b?(b.comment&&(w=b.comment),b.commentBefore&&(l=!0)):g.value==null&&y?.comment&&(w=y.comment)}w&&(l=!0);let $=on(g,c,()=>w=null);_<t.length-1&&($+=","),w&&($+=zt($,r,a(w))),!l&&(p.length>d||$.includes(`
|
|
86
|
-
`))&&(l=!0),p.push($),d=p.length}const{start:h,end:m}=n;if(p.length===0)return h+m;if(!l){const _=p.reduce((g,w)=>g+w.length+2,2);l=e.options.lineWidth>0&&_>e.options.lineWidth}if(l){let _=h;for(const g of p)_+=g?`
|
|
87
|
-
${i}${s}${g}`:`
|
|
88
|
-
`;return`${_}
|
|
89
|
-
${s}${m}`}else return`${h}${o}${p.join(" ")}${o}${m}`}function Vr({indent:t,options:{commentString:e}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=gt(e(r),t);n.push(i.trimStart())}}function Rt(t,e){const n=Se(e)?e.value:e;for(const r of t)if(De(r)&&(r.key===e||r.key===n||Se(r.key)&&r.key.value===n))return r}class nt extends _c{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(St,e),this.items=[]}static from(e,n,r){const{keepUndefined:s,replacer:i}=r,o=new this(e),a=(c,l)=>{if(typeof i=="function")l=i.call(n,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(ni(c,l,r))};if(n instanceof Map)for(const[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(const c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let r;De(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new We(e,e?.value):r=new We(e.key,e.value);const s=Rt(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Se(s.value)&&vc(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){const n=Rt(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const s=Rt(this.items,e)?.value;return(!n&&Se(s)?s.value:s)??void 0}has(e){return!!Rt(this.items,e)}set(e,n){this.add(new We(e,n),!0)}toJSON(e,n,r){const s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const i of this.items)kc(n,s,i);return s}toString(e,n,r){if(!e)return JSON.stringify(this);for(const s of this.items)if(!De(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ic(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}}const fn={collection:"map",default:!0,nodeClass:nt,tag:"tag:yaml.org,2002:map",resolve(t,e){return Bn(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>nt.from(t,e,n)};class Ft extends _c{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(un,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=Zn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const r=Zn(e);if(typeof r!="number")return;const s=this.items[r];return!n&&Se(s)?s.value:s}has(e){const n=Zn(e);return typeof n=="number"&&n<this.items.length}set(e,n){const r=Zn(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);const s=this.items[r];Se(s)&&vc(n)?s.value=n:this.items[r]=n}toJSON(e,n){const r=[];n?.onCreate&&n.onCreate(r);let s=0;for(const i of this.items)r.push(rt(i,String(s++),n));return r}toString(e,n,r){return e?Ic(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){const{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){const c=n instanceof Set?a:String(o++);a=s.call(n,c,a)}i.items.push(Pn(a,void 0,r))}}return i}}function Zn(t){let e=Se(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const dn={collection:"seq",default:!0,nodeClass:Ft,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Dn(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Ft.from(t,e,n)},rs={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),ti(t,e,n,r)}},ss={identify:t=>t==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ce(null),stringify:({source:t},e)=>typeof t=="string"&&ss.test.test(t)?t:e.options.nullStr},ri={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new ce(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&ri.test.test(t)){const r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};function ut({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);const s=typeof r=="number"?r:Number(r);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(r,-0)?"-0":JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(i)){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}const Oc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ut},Ac={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ut(t)}},Nc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const e=new ce(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:ut},is=t=>typeof t=="bigint"||Number.isInteger(t),si=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function Tc(t,e,n){const{value:r}=t;return is(r)&&r>=0?n+r.toString(e):ut(t)}const Pc={identify:t=>is(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>si(t,2,8,n),stringify:t=>Tc(t,8,"0o")},Cc={identify:is,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>si(t,0,10,n),stringify:ut},xc={identify:t=>is(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>si(t,2,16,n),stringify:t=>Tc(t,16,"0x")},Mp=[fn,dn,rs,ss,ri,Pc,Cc,xc,Oc,Ac,Nc];function Zi(t){return typeof t=="bigint"||Number.isInteger(t)}const Vn=({value:t})=>JSON.stringify(t),Up=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Vn},{identify:t=>t==null,createNode:()=>new ce(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Vn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Vn},{identify:Zi,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>Zi(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Vn}],Lp={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},qp=[fn,dn].concat(Up,Lp),ii={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){const n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,s,i){if(!n)return"";const o=n;let a;if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=ce.BLOCK_LITERAL),e!==ce.QUOTE_DOUBLE){const c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(a.length/c),d=new Array(l);for(let p=0,h=0;p<l;++p,h+=c)d[p]=a.substr(h,c);a=d.join(e===ce.BLOCK_LITERAL?`
|
|
90
|
-
`:" ")}return ti({comment:t,type:e,value:a},r,s,i)}};function Bc(t,e){if(Dn(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!De(r)){if(Bn(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");const s=r.items[0]||new We(new ce(null));if(r.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${r.commentBefore}
|
|
91
|
-
${s.key.commentBefore}`:r.commentBefore),r.comment){const i=s.value??s.key;i.comment=i.comment?`${r.comment}
|
|
92
|
-
${i.comment}`:r.comment}r=s}t.items[n]=De(r)?r:new We(r)}}else e("Expected a sequence for this tag");return t}function Dc(t,e,n){const{replacer:r}=n,s=new Ft(t);s.tag="tag:yaml.org,2002:pairs";let i=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.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){const l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(ni(a,c,n))}return s}const oi={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Bc,createNode:Dc};class tn extends Ft{constructor(){super(),this.add=nt.prototype.add.bind(this),this.delete=nt.prototype.delete.bind(this),this.get=nt.prototype.get.bind(this),this.has=nt.prototype.has.bind(this),this.set=nt.prototype.set.bind(this),this.tag=tn.tag}toJSON(e,n){if(!n)return super.toJSON(e);const r=new Map;n?.onCreate&&n.onCreate(r);for(const s of this.items){let i,o;if(De(s)?(i=rt(s.key,"",n),o=rt(s.value,i,n)):i=rt(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(e,n,r){const s=Dc(e,n,r),i=new this;return i.items=s.items,i}}tn.tag="tag:yaml.org,2002:omap";const ai={collection:"seq",identify:t=>t instanceof Map,nodeClass:tn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=Bc(t,e),r=[];for(const{key:s}of n.items)Se(s)&&(r.includes(s.value)?e(`Ordered maps must not include duplicate keys: ${s.value}`):r.push(s.value));return Object.assign(new tn,n)},createNode:(t,e,n)=>tn.from(t,e,n)};function zc({value:t,source:e},n){return e&&(t?Rc:jc).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const Rc={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ce(!0),stringify:zc},jc={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ce(!1),stringify:zc},Zp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ut},Vp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const e=Number(t.value);return isFinite(e)?e.toExponential():ut(t)}},Kp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const e=new ce(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){const r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:ut},zn=t=>typeof t=="bigint"||Number.isInteger(t);function os(t,e,n,{intAsBigInt:r}){const s=t[0];if((s==="-"||s==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const o=BigInt(t);return s==="-"?BigInt(-1)*o:o}const i=parseInt(t,n);return s==="-"?-1*i:i}function ci(t,e,n){const{value:r}=t;if(zn(r)){const s=r.toString(e);return r<0?"-"+n+s.substr(1):n+s}return ut(t)}const Jp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>os(t,2,2,n),stringify:t=>ci(t,2,"0b")},Hp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>os(t,1,8,n),stringify:t=>ci(t,8,"0")},Gp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>os(t,0,10,n),stringify:ut},Wp={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>os(t,2,16,n),stringify:t=>ci(t,16,"0x")};class nn extends nt{constructor(e){super(e),this.tag=nn.tag}add(e){let n;De(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new We(e.key,null):n=new We(e,null),Rt(this.items,n.key)||this.items.push(n)}get(e,n){const r=Rt(this.items,e);return!n&&De(r)?Se(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Rt(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new We(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){const{replacer:s}=r,i=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(ni(o,null,r));return i}}nn.tag="tag:yaml.org,2002:set";const ui={collection:"map",identify:t=>t instanceof Set,nodeClass:nn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>nn.from(t,e,n),resolve(t,e){if(Bn(t)){if(t.hasAllNullValues(!0))return Object.assign(new nn,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function li(t,e){const n=t[0],r=n==="-"||n==="+"?t.substring(1):t,s=o=>e?BigInt(o):Number(o),i=r.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return n==="-"?s(-1)*i:i}function Fc(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ut(t);let r="";e<0&&(r="-",e*=n(-1));const s=n(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))),r+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Mc={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>li(t,n),stringify:Fc},Uc={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>li(t,!1),stringify:Fc},as={identify:t=>t 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(t){const e=t.match(as.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,s,i,o,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0;let l=Date.UTC(n,r-1,s,i||0,o||0,a||0,c);const d=e[8];if(d&&d!=="Z"){let p=li(d,!1);Math.abs(p)<30&&(p*=60),l-=6e4*p}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Vi=[fn,dn,rs,ss,Rc,jc,Jp,Hp,Gp,Wp,Zp,Vp,Kp,ii,yt,ai,oi,ui,Mc,Uc,as],Ki=new Map([["core",Mp],["failsafe",[fn,dn,rs]],["json",qp],["yaml11",Vi],["yaml-1.1",Vi]]),Ji={binary:ii,bool:ri,float:Nc,floatExp:Ac,floatNaN:Oc,floatTime:Uc,int:Cc,intHex:xc,intOct:Pc,intTime:Mc,map:fn,merge:yt,null:ss,omap:ai,pairs:oi,seq:dn,set:ui,timestamp:as},Yp={"tag:yaml.org,2002:binary":ii,"tag:yaml.org,2002:merge":yt,"tag:yaml.org,2002:omap":ai,"tag:yaml.org,2002:pairs":oi,"tag:yaml.org,2002:set":ui,"tag:yaml.org,2002:timestamp":as};function ps(t,e,n){const r=Ki.get(e);if(r&&!t)return n&&!r.includes(yt)?r.concat(yt):r.slice();let s=r;if(!s)if(Array.isArray(t))s=[];else{const i=Array.from(Ki.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(t))for(const i of t)s=s.concat(i);else typeof t=="function"&&(s=t(s.slice()));return n&&(s=s.concat(yt)),s.reduce((i,o)=>{const a=typeof o=="string"?Ji[o]:o;if(!a){const c=JSON.stringify(o),l=Object.keys(Ji).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}const Qp=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0;class fi{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?ps(e,"compat"):e?ps(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?Yp:{},this.tags=ps(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,St,{value:fn}),Object.defineProperty(this,ft,{value:rs}),Object.defineProperty(this,un,{value:dn}),this.sortMapEntries=typeof o=="function"?o:o===!0?Qp:null}clone(){const e=Object.create(fi.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Xp(t,e){const n=[];let r=e.directives===!0;if(e.directives!==!1&&t.directives){const c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");const s=$c(t,e),{commentString:i}=s.options;if(t.commentBefore){n.length!==1&&n.unshift("");const c=i(t.commentBefore);n.unshift(gt(c,""))}let o=!1,a=null;if(t.contents){if(Be(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const d=i(t.contents.commentBefore);n.push(gt(d,""))}s.forceBlockIndent=!!t.comment,a=t.contents.comment}const c=a?void 0:()=>o=!0;let l=on(t.contents,s,()=>a=null,c);a&&(l+=zt(l,"",i(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(on(t.contents,s));if(t.directives?.docEnd)if(t.comment){const c=i(t.comment);c.includes(`
|
|
93
|
-
`)?(n.push("..."),n.push(gt(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&n[n.length-1]!==""&&n.push(""),n.push(gt(i(c),"")))}return n.join(`
|
|
94
|
-
`)+`
|
|
95
|
-
`}class cs{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,st,{value:js});let s=null;typeof n=="function"||Array.isArray(n)?s=n:r===void 0&&n&&(r=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=i;let{version:o}=i;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ge({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){const e=Object.create(cs.prototype,{[st]:{value:js}});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=Be(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){qt(this.contents)&&this.contents.add(e)}addIn(e,n){qt(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){const r=yc(this);e.anchor=!n||r.has(n)?wc(n||"a",r):n}return new ei(e.anchor)}createNode(e,n,r){let s;if(typeof n=="function")e=n.call({"":e},"",e),s=n;else if(Array.isArray(n)){const w=y=>typeof y=="number"||y instanceof String||y instanceof Number,$=n.filter(w).map(String);$.length>0&&(n=n.concat($)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:d}=r??{},{onAnchor:p,setAnchors:h,sourceObjects:m}=Op(this,o||"a"),_={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:p,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:m},g=Pn(e,d,_);return a&&xe(g)&&(g.flow=!0),h(),g}createPair(e,n,r={}){const s=this.createNode(e,null,r),i=this.createNode(n,null,r);return new We(s,i)}delete(e){return qt(this.contents)?this.contents.delete(e):!1}deleteIn(e){return kn(e)?this.contents==null?!1:(this.contents=null,!0):qt(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return xe(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return kn(e)?!n&&Se(this.contents)?this.contents.value:this.contents:xe(this.contents)?this.contents.getIn(e,n):void 0}has(e){return xe(this.contents)?this.contents.has(e):!1}hasIn(e){return kn(e)?this.contents!==void 0:xe(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Zr(this.schema,[e],n):qt(this.contents)&&this.contents.set(e,n)}setIn(e,n){kn(e)?this.contents=n:this.contents==null?this.contents=Zr(this.schema,Array.from(e),n):qt(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ge({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ge({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const s=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new fi(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:s,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=rt(this.contents,n??"",a);if(typeof i=="function")for(const{count:l,res:d}of a.anchors.values())i(d,l);return typeof o=="function"?Yt(o,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}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)){const n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return Xp(this,e)}}function qt(t){if(xe(t))return!0;throw new Error("Expected a YAML collection as document contents")}class Lc extends Error{constructor(e,n,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=n}}class In extends Lc{constructor(e,n,r){super("YAMLParseError",e,n,r)}}class em extends Lc{constructor(e,n,r){super("YAMLWarning",e,n,r)}}const Hi=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));const{line:r,col:s}=n.linePos[0];n.message+=` at line ${r}, column ${s}`;let i=s-1,o=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const a=Math.min(i-39,o.length-79);o="…"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,i))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
96
|
-
`),o=a+o}if(/[^ ]/.test(o)){let a=1;const c=n.linePos[1];c?.line===r&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));const l=" ".repeat(i)+"^".repeat(a);n.message+=`:
|
|
97
|
-
|
|
98
|
-
${o}
|
|
99
|
-
${l}
|
|
100
|
-
`}};function an(t,{flow:e,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,d=a,p="",h="",m=!1,_=!1,g=null,w=null,$=null,y=null,b=null,I=null,v=null;for(const T of t)switch(_&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&i(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),g&&(l&&T.type!=="comment"&&T.type!=="newline"&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),T.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&T.source.includes(" ")&&(g=T),d=!0;break;case"comment":{d||i(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const L=T.source.substring(1)||" ";p?p+=h+L:p=L,h="",l=!1;break}case"newline":l?p?p+=T.source:(!I||n!=="seq-item-ind")&&(c=!0):h+=T.source,l=!0,m=!0,(w||$)&&(y=T),d=!0;break;case"anchor":w&&i(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&i(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),w=T,v??(v=T.offset),l=!1,d=!1,_=!0;break;case"tag":{$&&i(T,"MULTIPLE_TAGS","A node can have at most one tag"),$=T,v??(v=T.offset),l=!1,d=!1,_=!0;break}case n:(w||$)&&i(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),I&&i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${e??"collection"}`),I=T,l=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(e){b&&i(T,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=T,l=!1,d=!1;break}default:i(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),l=!1,d=!1}const k=t[t.length-1],A=k?k.offset+k.source.length:s;return _&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&i(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(l&&g.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:I,spaceBefore:c,comment:p,hasNewline:m,anchor:w,tag:$,newlineAfterProp:y,end:A,start:v??A}}function Cn(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
101
|
-
`))return!0;if(t.end){for(const e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of t.items){for(const n of e.start)if(n.type==="newline")return!0;if(e.sep){for(const n of e.sep)if(n.type==="newline")return!0}if(Cn(e.key)||Cn(e.value))return!0}return!1;default:return!0}}function Ls(t,e,n){if(e?.type==="flow-collection"){const r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&Cn(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function qc(t,e,n){const{uniqueKeys:r}=t.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,o)=>i===o||Se(i)&&Se(o)&&i.value===o.value;return e.some(i=>s(i.key,n))}const Gi="All mapping items must start at the same column";function tm({composeNode:t,composeEmptyNode:e},n,r,s,i){const o=i?.nodeClass??nt,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(const d of r.items){const{start:p,key:h,sep:m,value:_}=d,g=an(p,{indicator:"explicit-key-ind",next:h??m?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),w=!g.found;if(w){if(h&&(h.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==r.indent&&s(c,"BAD_INDENT",Gi)),!g.anchor&&!g.tag&&!m){l=g.end,g.comment&&(a.comment?a.comment+=`
|
|
102
|
-
`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||Cn(h))&&s(h??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==r.indent&&s(c,"BAD_INDENT",Gi);n.atKey=!0;const $=g.end,y=h?t(n,h,g,s):e(n,$,p,null,g,s);n.schema.compat&&Ls(r.indent,h,s),n.atKey=!1,qc(n,a.items,y)&&s($,"DUPLICATE_KEY","Map keys must be unique");const b=an(m??[],{indicator:"map-value-ind",next:_,offset:y.range[2],onError:s,parentIndent:r.indent,startOnNewline:!h||h.type==="block-scalar"});if(c=b.end,b.found){w&&(_?.type==="block-map"&&!b.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start<b.found.offset-1024&&s(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const I=_?t(n,_,b,s):e(n,c,m,null,b,s);n.schema.compat&&Ls(r.indent,_,s),c=I.range[2];const v=new We(y,I);n.options.keepSourceTokens&&(v.srcToken=d),a.items.push(v)}else{w&&s(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),b.comment&&(y.comment?y.comment+=`
|
|
103
|
-
`+b.comment:y.comment=b.comment);const I=new We(y);n.options.keepSourceTokens&&(I.srcToken=d),a.items.push(I)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}function nm({composeNode:t,composeEmptyNode:e},n,r,s,i){const o=i?.nodeClass??Ft,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(const{start:d,value:p}of r.items){const h=an(d,{indicator:"seq-item-ind",next:p,offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||p)p?.type==="block-seq"?s(h.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=h.end,h.comment&&(a.comment=h.comment);continue}const m=p?t(n,p,h,s):e(n,h.end,d,null,h,s);n.schema.compat&&Ls(r.indent,p,s),c=m.range[2],a.items.push(m)}return a.range=[r.offset,c,l??c],a}function Rn(t,e,n,r){let s="";if(t){let i=!1,o="";for(const a of t){const{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{n&&!i&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=c.substring(1)||" ";s?s+=o+d:s=d,o="";break}case"newline":s&&(o+=c),i=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:s,offset:e}}const ms="Block collections are not allowed within flow collections",gs=t=>t&&(t.type==="block-map"||t.type==="block-seq");function rm({composeNode:t,composeEmptyNode:e},n,r,s,i){const o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?nt:Ft),l=new c(n.schema);l.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let p=r.offset+r.start.source.length;for(let w=0;w<r.items.length;++w){const $=r.items[w],{start:y,key:b,sep:I,value:v}=$,k=an(y,{flow:a,indicator:"explicit-key-ind",next:b??I?.[0],offset:p,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!k.found){if(!k.anchor&&!k.tag&&!I&&!v){w===0&&k.comma?s(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):w<r.items.length-1&&s(k.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),k.comment&&(l.comment?l.comment+=`
|
|
104
|
-
`+k.comment:l.comment=k.comment),p=k.end;continue}!o&&n.options.strict&&Cn(b)&&s(b,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(w===0)k.comma&&s(k.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(k.comma||s(k.start,"MISSING_CHAR",`Missing , between ${a} items`),k.comment){let A="";e:for(const T of y)switch(T.type){case"comma":case"space":break;case"comment":A=T.source.substring(1);break e;default:break e}if(A){let T=l.items[l.items.length-1];De(T)&&(T=T.value??T.key),T.comment?T.comment+=`
|
|
105
|
-
`+A:T.comment=A,k.comment=k.comment.substring(A.length+1)}}if(!o&&!I&&!k.found){const A=v?t(n,v,k,s):e(n,k.end,I,null,k,s);l.items.push(A),p=A.range[2],gs(v)&&s(A.range,"BLOCK_IN_FLOW",ms)}else{n.atKey=!0;const A=k.end,T=b?t(n,b,k,s):e(n,A,y,null,k,s);gs(b)&&s(T.range,"BLOCK_IN_FLOW",ms),n.atKey=!1;const L=an(I??[],{flow:a,indicator:"map-value-ind",next:v,offset:T.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(L.found){if(!o&&!k.found&&n.options.strict){if(I)for(const Y of I){if(Y===L.found)break;if(Y.type==="newline"){s(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}k.start<L.found.offset-1024&&s(L.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else v&&("source"in v&&v.source?.[0]===":"?s(v,"MISSING_CHAR",`Missing space after : in ${a}`):s(L.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const H=v?t(n,v,L,s):L.found?e(n,L.end,I,null,L,s):null;H?gs(v)&&s(H.range,"BLOCK_IN_FLOW",ms):L.comment&&(T.comment?T.comment+=`
|
|
106
|
-
`+L.comment:T.comment=L.comment);const G=new We(T,H);if(n.options.keepSourceTokens&&(G.srcToken=$),o){const Y=l;qc(n,Y.items,T)&&s(A,"DUPLICATE_KEY","Map keys must be unique"),Y.items.push(G)}else{const Y=new nt(n.schema);Y.flow=!0,Y.items.push(G);const se=(H??T).range;Y.range=[T.range[0],se[1],se[2]],l.items.push(Y)}p=H?H.range[2]:L.end}}const h=o?"}":"]",[m,..._]=r.end;let g=p;if(m?.source===h)g=m.offset+m.source.length;else{const w=a[0].toUpperCase()+a.substring(1),$=d?`${w} must end with a ${h}`:`${w} in block collection must be sufficiently indented and end with a ${h}`;s(p,d?"MISSING_CHAR":"BAD_INDENT",$),m&&m.source.length!==1&&_.unshift(m)}if(_.length>0){const w=Rn(_,g,n.options.strict,s);w.comment&&(l.comment?l.comment+=`
|
|
107
|
-
`+w.comment:l.comment=w.comment),l.range=[r.offset,g,w.offset]}else l.range=[r.offset,g,g];return l}function ys(t,e,n,r,s,i){const o=n.type==="block-map"?tm(t,e,n,r,i):n.type==="block-seq"?nm(t,e,n,r,i):rm(t,e,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function sm(t,e,n,r,s){const i=r.tag,o=i?e.directives.tagName(i.source,h=>s(i,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){const{anchor:h,newlineAfterProp:m}=r,_=h&&i?h.offset>i.offset?h:i:h??i;_&&(!m||m.offset<_.offset)&&s(_,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===nt.tagName&&a==="map"||o===Ft.tagName&&a==="seq")return ys(t,e,n,s,o);let c=e.schema.tags.find(h=>h.tag===o&&h.collection===a);if(!c){const h=e.schema.knownTags[o];if(h?.collection===a)e.schema.tags.push(Object.assign({},h,{default:!1})),c=h;else return h?s(i,"BAD_COLLECTION_TYPE",`${h.tag} used for ${a} collection, but expects ${h.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),ys(t,e,n,s,o)}const l=ys(t,e,n,s,o,c),d=c.resolve?.(l,h=>s(i,"TAG_RESOLVE_FAILED",h),e.options)??l,p=Be(d)?d:new ce(d);return p.range=l.range,p.tag=o,c?.format&&(p.format=c.format),p}function im(t,e,n){const r=e.offset,s=om(e,t.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?ce.BLOCK_FOLDED:ce.BLOCK_LITERAL,o=e.source?am(e.source):[];let a=o.length;for(let g=o.length-1;g>=0;--g){const w=o[g][1];if(w===""||w==="\r")a=g;else break}if(a===0){const g=s.chomp==="+"&&o.length>0?`
|
|
108
|
-
`.repeat(Math.max(1,o.length-1)):"";let w=r+s.length;return e.source&&(w+=e.source.length),{value:g,type:i,comment:s.comment,range:[r,w,w]}}let c=e.indent+s.indent,l=e.offset+s.length,d=0;for(let g=0;g<a;++g){const[w,$]=o[g];if($===""||$==="\r")s.indent===0&&w.length>c&&(c=w.length);else{w.length<c&&n(l+w.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=w.length),d=g,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=w.length+$.length+1}for(let g=o.length-1;g>=a;--g)o[g][0].length>c&&(a=g+1);let p="",h="",m=!1;for(let g=0;g<d;++g)p+=o[g][0].slice(c)+`
|
|
109
|
-
`;for(let g=d;g<a;++g){let[w,$]=o[g];l+=w.length+$.length+1;const y=$[$.length-1]==="\r";if(y&&($=$.slice(0,-1)),$&&w.length<c){const I=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(l-$.length-(y?2:1),"BAD_INDENT",I),w=""}i===ce.BLOCK_LITERAL?(p+=h+w.slice(c)+$,h=`
|
|
110
|
-
`):w.length>c||$[0]===" "?(h===" "?h=`
|
|
111
|
-
`:!m&&h===`
|
|
112
|
-
`&&(h=`
|
|
113
|
-
|
|
114
|
-
`),p+=h+w.slice(c)+$,h=`
|
|
115
|
-
`,m=!0):$===""?h===`
|
|
116
|
-
`?p+=`
|
|
117
|
-
`:h=`
|
|
118
|
-
`:(p+=h+$,h=" ",m=!1)}switch(s.chomp){case"-":break;case"+":for(let g=a;g<o.length;++g)p+=`
|
|
119
|
-
`+o[g][0].slice(c);p[p.length-1]!==`
|
|
120
|
-
`&&(p+=`
|
|
121
|
-
`);break;default:p+=`
|
|
122
|
-
`}const _=r+s.length+e.source.length;return{value:p,type:i,comment:s.comment,range:[r,_,_]}}function om({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=e[0],i=s[0];let o=0,a="",c=-1;for(let h=1;h<s.length;++h){const m=s[h];if(!a&&(m==="-"||m==="+"))a=m;else{const _=Number(m);!o&&_?o=_:c===-1&&(c=t+h)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,d="",p=s.length;for(let h=1;h<e.length;++h){const m=e[h];switch(m.type){case"space":l=!0;case"newline":p+=m.source.length;break;case"comment":n&&!l&&r(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=m.source.length,d=m.source.substring(1);break;case"error":r(m,"UNEXPECTED_TOKEN",m.message),p+=m.source.length;break;default:{const _=`Unexpected token in block scalar header: ${m.type}`;r(m,"UNEXPECTED_TOKEN",_);const g=m.source;g&&typeof g=="string"&&(p+=g.length)}}}return{mode:i,indent:o,chomp:a,comment:d,length:p}}function am(t){const e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)i.push([e[o],e[o+1]]);return i}function cm(t,e,n){const{offset:r,type:s,source:i,end:o}=t;let a,c;const l=(h,m,_)=>n(r+h,m,_);switch(s){case"scalar":a=ce.PLAIN,c=um(i,l);break;case"single-quoted-scalar":a=ce.QUOTE_SINGLE,c=lm(i,l);break;case"double-quoted-scalar":a=ce.QUOTE_DOUBLE,c=fm(i,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[r,r+i.length,r+i.length]}}const d=r+i.length,p=Rn(o,d,e,n);return{value:c,type:a,comment:p.comment,range:[r,d,p.offset]}}function um(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Zc(t)}function lm(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Zc(t.slice(1,-1)).replace(/''/g,"'")}function Zc(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
123
|
-
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
124
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let s=r[1],i=" ",o=e.lastIndex;for(n.lastIndex=o;r=n.exec(t);)r[1]===""?i===`
|
|
125
|
-
`?s+=i:i=`
|
|
126
|
-
`:(s+=i+r[1],i=" "),o=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(t),s+i+(r?.[1]??"")}function fm(t,e){let n="";for(let r=1;r<t.length-1;++r){const s=t[r];if(!(s==="\r"&&t[r+1]===`
|
|
127
|
-
`))if(s===`
|
|
128
|
-
`){const{fold:i,offset:o}=dm(t,r);n+=i,r=o}else if(s==="\\"){let i=t[++r];const o=hm[i];if(o)n+=o;else if(i===`
|
|
129
|
-
`)for(i=t[r+1];i===" "||i===" ";)i=t[++r+1];else if(i==="\r"&&t[r+1]===`
|
|
130
|
-
`)for(i=t[++r+1];i===" "||i===" ";)i=t[++r+1];else if(i==="x"||i==="u"||i==="U"){const a={x:2,u:4,U:8}[i];n+=pm(t,r+1,a,e),r+=a}else{const a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(s===" "||s===" "){const i=r;let o=t[r+1];for(;o===" "||o===" ";)o=t[++r+1];o!==`
|
|
131
|
-
`&&!(o==="\r"&&t[r+2]===`
|
|
132
|
-
`)&&(n+=r>i?t.slice(i,r+1):s)}else n+=s}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function dm(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
|
|
133
|
-
`||r==="\r")&&!(r==="\r"&&t[e+2]!==`
|
|
134
|
-
`);)r===`
|
|
135
|
-
`&&(n+=`
|
|
136
|
-
`),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}const hm={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
137
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function pm(t,e,n,r){const s=t.substr(e,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;if(isNaN(o)){const a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function Vc(t,e,n,r){const{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?im(t,e,r):cm(e,t.options.strict,r),c=n?t.directives.tagName(n.source,p=>r(n,"TAG_RESOLVE_FAILED",p)):null;let l;t.options.stringKeys&&t.atKey?l=t.schema[ft]:c?l=mm(t.schema,s,c,n,r):e.type==="scalar"?l=gm(t,s,e,r):l=t.schema[ft];let d;try{const p=l.resolve(s,h=>r(n??e,"TAG_RESOLVE_FAILED",h),t.options);d=Se(p)?p:new ce(p)}catch(p){const h=p instanceof Error?p.message:String(p);r(n??e,"TAG_RESOLVE_FAILED",h),d=new ce(s)}return d.range=a,d.source=s,i&&(d.type=i),c&&(d.tag=c),l.format&&(d.format=l.format),o&&(d.comment=o),d}function mm(t,e,n,r,s){if(n==="!")return t[ft];const i=[];for(const a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)i.push(a);else return a;for(const a of i)if(a.test?.test(e))return a;const o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[ft])}function gm({atKey:t,directives:e,schema:n},r,s,i){const o=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[ft];if(n.compat){const a=n.compat.find(c=>c.default&&c.test?.test(r))??n[ft];if(o.tag!==a.tag){const c=e.tagString(o.tag),l=e.tagString(a.tag),d=`Value may be parsed as either ${c} or ${l}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return o}function ym(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let s=e[r];switch(s.type){case"space":case"comment":case"newline":t-=s.source.length;continue}for(s=e[++r];s?.type==="space";)t+=s.source.length,s=e[++r];break}}return t}const wm={composeNode:Kc,composeEmptyNode:di};function Kc(t,e,n,r){const s=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=n;let l,d=!0;switch(e.type){case"alias":l=vm(t,e,r),(a||c)&&r(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=Vc(t,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=sm(wm,t,e,n,r),a&&(l.anchor=a.source.substring(1));break;default:{const p=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",p),l=di(t,e.offset,void 0,null,n,r),d=!1}}return a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&t.options.stringKeys&&(!Se(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(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),t.options.keepSourceTokens&&d&&(l.srcToken=e),l}function di(t,e,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){const d={type:"scalar",offset:ym(e,n,r),indent:-1,source:""},p=Vc(t,d,a,l);return o&&(p.anchor=o.source.substring(1),p.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(p.spaceBefore=!0),i&&(p.comment=i,p.range[2]=c),p}function vm({options:t},{offset:e,source:n,end:r},s){const i=new ei(n.substring(1));i.source===""&&s(e,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+n.length,a=Rn(r,o,t.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}function _m(t,e,{offset:n,start:r,value:s,end:i},o){const a=Object.assign({_directives:e},t),c=new cs(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=an(r,{indicator:"doc-start",next:s??i?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?Kc(l,s,d,o):di(l,d.end,r,null,d,o);const p=c.contents.range[2],h=Rn(i,p,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,p,h.offset],c}function gn(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function Wi(t){let e="",n=!1,r=!1;for(let s=0;s<t.length;++s){const i=t[s];switch(i[0]){case"#":e+=(e===""?"":r?`
|
|
138
|
-
|
|
139
|
-
`:`
|
|
140
|
-
`)+(i.substring(1)||" "),n=!0,r=!1;break;case"%":t[s+1]?.[0]!=="#"&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}class bm{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const o=gn(n);i?this.warnings.push(new em(o,r,s)):this.errors.push(new In(o,r,s))},this.directives=new Ge({version:e.version||"1.2"}),this.options=e}decorate(e,n){const{comment:r,afterEmptyLine:s}=Wi(this.prelude);if(r){const i=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
141
|
-
${r}`:r;else if(s||e.directives.docStart||!i)e.commentBefore=r;else if(xe(i)&&!i.flow&&i.items.length>0){let o=i.items[0];De(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${r}
|
|
142
|
-
${a}`:r}else{const o=i.commentBefore;i.commentBefore=o?`${r}
|
|
143
|
-
${o}`:r}}n?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Wi(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(const s of e)yield*this.next(s);yield*this.end(n,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,r,s)=>{const i=gn(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const n=_m(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new In(gn(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new In(gn(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Rn(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
144
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new In(gn(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const r=Object.assign({_directives:this.directives},this.options),s=new cs(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,n,n],this.decorate(s,!1),yield s}}}const Jc="\uFEFF",Hc="",Gc="",qs="";function $m(t){switch(t){case Jc:return"byte-order-mark";case Hc:return"doc-mode";case Gc:return"flow-error-end";case qs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
145
|
-
`:case`\r
|
|
146
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ot(t){switch(t){case void 0:case" ":case`
|
|
147
|
-
`:case"\r":case" ":return!0;default:return!1}}const Yi=new Set("0123456789ABCDEFabcdef"),Sm=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Kn=new Set(",[]{}"),Em=new Set(` ,[]{}
|
|
148
|
-
\r `),ws=t=>!t||Em.has(t);class km{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!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=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
|
|
149
|
-
`?!0:n==="\r"?this.buffer[e+1]===`
|
|
150
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){const s=this.buffer[r+e+1];if(s===`
|
|
151
|
-
`||!s&&!this.atEnd)return e+r+1}return n===`
|
|
152
|
-
`||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&ot(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
153
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Jc&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){const i=e[r-1];if(i===" "||i===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){const i=e[n-1];if(i===" "||i===" ")n-=1;else break}const s=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-s),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Hc,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&ot(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ot(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ot(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(ws),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);const s=this.getLine();if(s===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&s[0]!=="#"||r===0&&(s.startsWith("---")||s.startsWith("..."))&&ot(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield Gc,yield*this.parseLineStart();let i=0;for(;s[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),s[i]){case void 0:return"flow";case"#":return yield*this.pushCount(s.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(ws),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||ot(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let s=r.indexOf(`
|
|
154
|
-
`,this.pos);if(s!==-1){for(;s!==-1;){const i=this.continueScalar(s+1);if(i===-1)break;s=r.indexOf(`
|
|
155
|
-
`,i)}s!==-1&&(n=s-(r[s-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ot(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let i=this.pos;r=this.buffer[i];++i)switch(r){case" ":n+=1;break;case`
|
|
156
|
-
`:e=i,n=0;break;case"\r":{const o=this.buffer[i+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
157
|
-
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const i=this.continueScalar(e+1);if(i===-1)break;e=this.buffer.indexOf(`
|
|
158
|
-
`,i)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let s=e+1;for(r=this.buffer[s];r===" ";)r=this.buffer[++s];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
159
|
-
`;)r=this.buffer[++s];e=s-1}else if(!this.blockScalarKeep)do{let i=e-1,o=this.buffer[i];o==="\r"&&(o=this.buffer[--i]);const a=i;for(;o===" ";)o=this.buffer[--i];if(o===`
|
|
160
|
-
`&&i>=this.pos&&i+1+n>a)e=i;else break}while(!0);return yield qs,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,s;for(;s=this.buffer[++r];)if(s===":"){const i=this.buffer[r+1];if(ot(i)||e&&Kn.has(i))break;n=r}else if(ot(s)){let i=this.buffer[r+1];if(s==="\r"&&(i===`
|
|
161
|
-
`?(r+=1,s=`
|
|
162
|
-
`,i=this.buffer[r+1]):n=r),i==="#"||e&&Kn.has(i))break;if(s===`
|
|
163
|
-
`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&Kn.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield qs,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){const r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(ws))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,n=this.charAt(1);if(ot(n)||e&&Kn.has(n))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ot(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(Sm.has(n))n=this.buffer[++e];else if(n==="%"&&Yi.has(this.buffer[e+1])&&Yi.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
164
|
-
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
165
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class Im{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){const i=n+r>>1;this.lineStarts[i]<e?n=i+1:r=i}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};const s=this.lineStarts[n-1];return{line:n,col:e-s+1}}}}function $t(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Qi(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Wc(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Jn(t){switch(t.type){case"document":return t.start;case"block-map":{const e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Zt(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Xi(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!$t(e.start,"explicit-key-ind")&&!$t(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Wc(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Om{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 km,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const n=$m(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+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{const r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,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(){const 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){const n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Xi(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const s=r.items[r.items.length-1];if(s.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=n;else{Object.assign(s,{key:n,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=r.items[r.items.length-1];s.value?r.items.push({start:[],value:n}):s.value=n;break}case"flow-collection":{const s=r.items[r.items.length-1];!s||s.value?r.items.push({start:[],key:n,sep:[]}):s.sep?s.value=n:Object.assign(s,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const s=n.items[n.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Qi(s.start)===-1&&(n.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<n.indent))&&(r.type==="document"?r.end=s.start:r.items.push({start:s.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const 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":{Qi(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}const n=this.startBlockValue(e);n?this.stack.push(n):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"){const n=Jn(this.peek(2)),r=Zt(n);let s;e.end?(s=e.end,s.push(this.sourceToken),delete e.end):s=[this.sourceToken];const i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,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 n=this.source.indexOf(`
|
|
166
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
167
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const r=!this.onKeyLine&&this.indent===e.indent,s=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let i=[];if(s&&n.sep&&!n.value){const o=[];for(let a=0;a<n.sep.length;++a){const c=n.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||n.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):s||n.value?(i.push(this.sourceToken),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(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if($t(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Wc(n.key)&&!$t(n.sep,"newline")){const o=Zt(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?n.sep=n.sep.concat(i,this.sourceToken):n.sep.push(this.sourceToken);else if($t(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Zt(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):$t(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);s||n.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!$t(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const s=e.items[e.items.length-2]?.value?.end;if(Array.isArray(s)){Array.prototype.push.apply(s,n.start),s.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||$t(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){const r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:s,sep:[]}):n.sep?this.stack.push(s):Object.assign(n,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const s=Jn(r),i=Zt(s);Xi(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const 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 n=this.source.indexOf(`
|
|
168
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
169
|
-
`,n)+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;const n=Jn(e),r=Zt(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Jn(e),r=Zt(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.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())}}}function Am(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Im||null,prettyErrors:e}}function Nm(t,e={}){const{lineCounter:n,prettyErrors:r}=Am(e),s=new Om(n?.addNewLine),i=new bm(e);let o=null;for(const a of i.compose(s.parse(t),!0,t.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new In(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(Hi(t,n)),o.warnings.forEach(Hi(t,n))),o}function Tm(t,e,n){let r;const s=Nm(t,n);if(!s)return null;if(s.warnings.forEach(i=>Sc(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}var Ke=K({title:z().optional(),globalTitle:z().optional(),description:z().optional(),color:z().optional(),icon:z().optional(),iconColor:z().optional(),avatarUrl:z().optional(),secondaryIcon:z().optional(),secondaryIconColor:z().optional()}),Fe=Ke.pick({title:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),Yc=Ke.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),hn=Ke.pick({title:!0,description:!0,avatarUrl:!0,icon:!0,iconColor:!0}).required({title:!0}),Pm=K({createdAt:ve(),updatedAt:ve()}),ct=z().regex(/^[a-z][a-z0-9-.]+$/,"Name must start with a letter and can only contain lowercase letters, numbers, dashes (-) and dots (.)").min(2).max(64),pn=Ut([zr([ct,pe("."),pe("v"),Qe().int().min(1)]),zr([ct,pe("."),ct,pe("."),pe("v"),Qe().int().min(1)]),zr([ct,pe("."),ct,pe("."),ct,pe("."),pe("v"),Qe().int().min(1)])]),Mr=z().regex(/^[a-z][a-zA-Z0-9]+$/,"Field name must start with a letter and be in camelCase format").min(2).max(64),eo=K({type:pn,required:$e(),multiple:$e(),field:z()});K({type:pn,extensions:z().array().optional(),directExtensions:z().array().optional(),inclusions:eo.array().optional(),directInclusions:eo.array().optional(),schema:en(),meta:Ke.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0}),definitionHash:Qe()});var Cm=K({type:pn,identity:z(),references:je(z(),z().array()).optional(),...Ke.pick({title:!0,description:!0,icon:!0,iconColor:!0}).shape});K({$meta:Cm});var xm=Symbol("runtimeSchema"),Qc=vt(["composite","unit"]),Xc=K({schema:en(),[xm]:lp(ke).optional(),required:$e(),meta:Ke.required({title:!0}).pick({title:!0,globalTitle:!0,description:!0,color:!0,icon:!0,iconColor:!0})}),to=K({type:pn,fromInput:Mr.optional(),required:$e(),multiple:$e(),meta:Ke.required({title:!0}).pick({title:!0,description:!0})}),Bm=K({type:ct,kind:Qc,args:je(Mr,Xc),inputs:je(Mr,to),outputs:je(Mr,to),meta:Ke.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0,secondaryIcon:!0,secondaryIconColor:!0}).extend({category:z().optional(),defaultNamePrefix:z()}),definitionHash:Qe()});function yn(t){return t.path?`${t.instanceId}:${t.output}:${t.path}`:`${t.instanceId}:${t.output}`}var eu=K({x:Qe(),y:Qe()}),Et=zr([pn,":",ct]),rn=K({instanceId:Et,output:z(),path:z().optional()}),Zs=K({hubId:z()}),Dm=K({args:je(z(),wt()).optional(),inputs:je(z(),Ve(rn)).optional(),hubInputs:je(z(),Ve(Zs)).optional(),injectionInputs:Ve(Zs).optional(),position:eu.optional()}),vs=K({id:Et,kind:Qc,type:pn,name:ct,...Dm.shape,resolvedInputs:je(z(),Ve(rn)).optional(),parentId:Et.optional(),outputs:je(z(),Ve(rn)).optional(),resolvedOutputs:je(z(),Ve(rn)).optional()}),zm=K({position:eu.optional(),inputs:Ve(rn).optional(),injectionInputs:Ve(Zs).optional()}),Rm=K({id:ye(),...zm.shape}),jm=K({"c857cac5-caa6-4421-b82c-e561fbce6367":pe(!0),value:z()}),Fm=K({name:z(),contentType:z().optional(),size:Qe().optional(),mode:Qe().optional()}),Mm=Ut([z(),Qe(),$e(),z().array()]);K({name:z(),meta:Ke.pick({title:!0,icon:!0,iconColor:!0}).required({title:!0}),complementaryTo:z().optional(),value:Mm.optional()});function Um(t){const e=K({"240e5789-6ae4-4b22-b9d8-87169e8b4bab":pe(!0),value:t});return sp(Ut([e,t]),e,{decode:n=>typeof n=="object"&&n!==null&&"240e5789-6ae4-4b22-b9d8-87169e8b4bab"in n?n:{"240e5789-6ae4-4b22-b9d8-87169e8b4bab":!0,value:n},encode:n=>n})}var Lm=Xc.extend({readonly:$e(),computed:$e()}),qm=K({package:z(),path:z().optional()});K({...Bm.shape,source:qm,secrets:je(z(),Lm)});function hi(t){return"source"in t}var Zm=Ut([K({type:pe("before-destroy")})]);K({name:z(),meta:Ke.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:Zm});var Vm=K({name:z()}),Km=K({...rn.shape}),Jm=K({value:wt(),source:Km.optional()});K({instanceId:z(),stateId:z(),args:je(z(),wt()),inputs:je(z(),Jm.array()),invokedTriggers:Vm.array(),secretValues:je(z(),wt()),importBasePath:z()});var no=new WeakMap;function Hm(t){const e=jm.safeParse(t);if(!e.success)return t;const n=no.get(t);if(n!==void 0)return n;const r=Tm(e.data.value);return no.set(t,r),r}var Gm=Symbol("unitArtifactId"),Wm=K({"d55c63ac-3174-4756-808f-f778e99af0d1":pe(!0),[Gm]:z().optional(),hash:z(),meta:Fe.optional()}),Ym=Ut([K({type:pe("embedded"),isBinary:$e().optional(),value:z()}),K({type:pe("embedded-secret"),isBinary:$e().optional(),value:Um(z())}),K({type:pe("artifact"),...Wm.shape})]),tu=K({meta:Fm,content:Ym}),nu=K({image:z(),command:z().array(),cwd:z().optional(),env:je(z(),z()).optional(),files:je(z(),tu).optional()});K({name:z(),meta:Ke.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:nu});var ru=Ut([K({type:pe("markdown"),content:z()}),K({type:pe("qr"),content:z(),showContent:fp(),language:z().optional()}),K({type:pe("file"),file:tu})]);K({name:z(),meta:Ke.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),content:ru.array()});K({name:z(),image:z(),params:je(z(),wt())});K({projectId:ye(),workerVersionId:ye(),apiUrl:wh(),apiKey:z()});Nt("type",[K({type:pe("host")})]);const Qm={id:"q8xbilhwpsn65zjlv5kz44qh"},Xm={id:"n0rfvpl9o77iqf29ff4kk5gf"},eg={id:"pmn9y901jeiz2ydh93045l39"},tg={id:"qppfcerovu3h22o0x8rlpc3g"};Nt("type",[K({type:pe("codebase")}),K({type:pe("database")})]);K({name:ct,spaceId:ye().default(Qm.id),modelStorageId:ye().default(tg.id),libraryId:ye().default(Xm.id),pulumiBackendId:ye().default(eg.id),meta:Fe});K({id:z(),name:ct,meta:Fe,spaceId:ye(),modelStorageId:ye(),libraryId:ye(),pulumiBackendId:ye(),...Pm.shape});const ng=K({encryptedIdentities:Ve(z()),hasPasskey:$e()});Nt("type",[K({type:pe("locked"),unlockSuite:ng.optional()}),K({type:pe("unlocked")})]);Nt("type",[K({type:pe("host")})]);const rg=Ke.pick({title:!0,description:!0}).required({title:!0});K({meta:rg,recipient:z()});const sg=K({key:z(),order:vt(["asc","desc"])}),_t=K({search:z().optional(),sortBy:Ve(sg).optional(),skip:Qe().int().nonnegative().default(0).optional(),count:Qe().int().positive().max(100).default(20).optional()}),ig=Ke.pick({title:!0,description:!0}).required({title:!0});K({id:ye(),meta:Fe,serviceAccountId:ye(),serviceAccountMeta:hn.nullable(),createdAt:ve()});_t.extend({serviceAccountId:z().optional()});K({id:ye(),hash:z(),size:Qe(),meta:Fe,createdAt:ve(),updatedAt:ve()});_t.extend({stateId:z().optional(),serviceAccountId:z().optional(),terminalId:z().optional(),pageId:z().optional()});K({name:z(),meta:Fe,value:z(),message:z().optional(),order:Qe().min(0).max(100).optional()});K({identity:z().optional(),title:z().optional(),description:z().optional(),icon:z().optional(),iconColor:z().optional()}).passthrough();const og=K({id:z(),type:z(),identity:z(),meta:Fe,snapshotId:z().optional(),createdAt:ve().optional()});_t.extend({type:z().optional()});const su=K({id:z(),meta:Fe,content:wt(),operationId:z(),stateId:z(),referencedInOutputs:z().array(),exportedInOutputs:z().array(),createdAt:ve()});K({id:z(),meta:Fe,operationId:z(),stateId:z(),createdAt:ve()});K({entity:K({id:z(),type:z(),identity:z()}),snapshot:su});K({...og.shape,lastSnapshot:su.nullable()});K({id:z(),meta:Fe,group:z(),fromSnapshotId:z(),fromEntityId:z(),fromEntityType:z(),fromEntityIdentity:z(),fromEntityMeta:Fe,toSnapshotId:z(),toEntityId:z(),toEntityType:z(),toEntityIdentity:z(),toEntityMeta:Fe});const ag=K({stateId:ye(),meta:Fe,acquiredAt:ve()});Nt("type",[K({type:pe("locked"),locks:ag.array()}),K({type:pe("unlocked"),stateIds:Ve(z())})]);K({updatedInstances:vs.array().optional(),updatedHubs:Rm.array().optional(),updatedVirtualInstances:vs.array().optional(),updatedGhostInstances:vs.array().optional(),deletedInstanceIds:Et.array().optional(),deletedHubIds:z().array().optional(),deletedVirtualInstanceIds:Et.array().optional(),deletedGhostInstanceIds:Et.array().optional()});const cg=vt(["destroy","preview","update","refresh"]),ug=K({id:Et,parentId:z().optional(),message:z()}),lg=K({type:cg,instances:Ve(ug)}),fg=K({forceUpdateDependencies:$e().default(!1),ignoreChangedDependencies:$e().default(!1),ignoreDependencies:$e().default(!1),forceUpdateChildren:$e().default(!1),onlyDestroyGhosts:$e().default(!1),firstDestroyGhosts:$e().default(!1),ignoreGhosts:$e().default(!1),destroyDependentInstances:$e().default(!0),invokeDestroyTriggers:$e().default(!0),deleteUnreachableResources:$e().default(!1),forceDeleteState:$e().default(!1),allowPartialCompositeInstanceUpdate:$e().default(!1),allowPartialCompositeInstanceDestruction:$e().default(!1),refresh:$e().default(!1),debug:$e().default(!1)}).partial(),iu=vt(["update","preview","destroy","recreate","refresh"]),dg=vt(["pending","running","failing","completed","failed","cancelled","cancelling"]),ou=Ke.pick({title:!0,description:!0}).required({title:!0}),hg=K({projectId:z(),type:iu,instanceIds:Ve(Et).min(1),options:fg.partial().optional()});hg.extend({meta:ou,plan:lg.array().optional()});Nt("type",[K({type:pe("updated"),operation:en()}),K({type:pe("deleted"),operationId:z()})]);K({id:ye(),type:iu,status:dg,meta:ou,startedAt:ve(),updatedAt:ve(),finishedAt:ve().nullable()});const pg=K({id:ye(),meta:Fe,name:z().nullable(),stateId:ye().nullable(),serviceAccountId:ye().nullable(),serviceAccountMeta:hn.nullable(),createdAt:ve(),updatedAt:ve()});_t.extend({serviceAccountId:z().optional(),stateId:z().optional(),artifactId:z().optional()});K({...pg.shape,content:Ve(ru)});K({id:ye(),meta:Yc,name:z().nullable(),systemName:z().nullable(),stateId:ye().nullable(),serviceAccountId:ye().nullable(),serviceAccountMeta:hn.nullable(),createdAt:ve(),updatedAt:ve()});_t.extend({serviceAccountId:z().optional(),stateId:z().optional()});K({id:ye(),meta:hn,createdAt:ve(),updatedAt:ve()});_t.extend({artifactId:z().optional()});K({stateId:z(),output:z(),path:z().optional()});Nt("type",[K({type:pe("updated"),state:en()}),K({type:pe("patched"),stateId:z(),patch:en()}),K({type:pe("patched-batch"),patches:Ve(K({stateId:z(),patch:en()}))}),K({type:pe("deleted"),stateId:z()})]);Nt("type",[K({type:pe("registered"),instanceId:z(),params:je(z(),wt())}),K({type:pe("deregistered"),instanceId:z()})]);const mg=vt(["active","unavailable"]);K({id:ye(),terminalId:ye(),meta:Yc,startedAt:ve(),finishedAt:ve().nullable()});const gg=K({id:ye(),name:z().nullable(),meta:Fe,status:mg,stateId:z().nullable(),serviceAccountId:z().nullable(),serviceAccountMeta:hn.nullable(),createdAt:ve(),updatedAt:ve()});_t.extend({serviceAccountId:z().optional(),stateId:z().optional(),artifactId:z().optional()});K({...gg.shape,spec:nu});K({id:ye(),meta:Fe,name:z(),stateId:ye(),createdAt:ve(),updatedAt:ve()});_t.extend({stateId:z().optional()});const au=vt(["password","passkey"]),cu=Ke.pick({title:!0,description:!0}).required({title:!0});K({meta:cu,type:au,encryptedIdentity:z(),recipient:z()});K({id:ye(),type:au,meta:cu,recipient:z(),createdAt:ve(),updatedAt:ve()});const uu=vt(["unknown","starting","running","stopping","stopped","error"]);K({workerVersionId:ye(),status:uu});K({id:ye(),digest:z(),meta:Fe,status:uu,enabled:$e(),apiKeyId:z(),apiKeyMeta:ig,createdAt:ve(),updatedAt:ve()});K({id:ye(),identity:z(),meta:Fe,serviceAccountId:z(),serviceAccountMeta:hn,createdAt:ve()});_t.extend({serviceAccountId:z().optional()});function lu(t){const e=t.visited??new Set,n=t.getInstanceContext(t.input.instanceId);if(!n)return _s({rootType:t.fallbackType,path:t.input.path,entities:void 0,fallbackType:t.fallbackType});const r=n.component.outputs[t.input.output];if(!r)return _s({rootType:t.fallbackType,path:t.input.path,entities:n.entities,fallbackType:t.fallbackType});let s=r.type;if(r.fromInput){const i=`${n.instance.id}:${t.input.output}`;if(!e.has(i)){e.add(i);const o=r.fromInput,a=n.component.inputs[o]?.type??s,c=(n.instance.hubInputs?.[o]?.length??0)>0,l=(n.instance.injectionInputs?.length??0)>0,d=n.instance.inputs?.[o]??[];if(!c&&!l&&d.length===1){const p=d[0];p?s=lu({input:p,fallbackType:a,getInstanceContext:t.getInstanceContext,visited:e}):s=a}else s=a}}return _s({rootType:s,path:t.input.path,entities:n.entities,fallbackType:t.fallbackType})}function _s(t){const{rootType:e,path:n,entities:r,fallbackType:s}=t;if(!n||!r)return yg(e,s,r);let i=e;const o=n.split(".");for(const a of o){const c=r[i];if(!c)return e;const l=c.inclusions?.find(d=>d.field===a);if(!l)return e;i=l.type}return i}function yg(t,e,n){if(!n||t===e)return t;const r=n[t];return!r||r.extensions?.includes(e)?t:r.inclusions?.find(i=>i.type===e)?e:t}class pi{constructor(e,n,r,s){this.nodes=e,this.logger=n,this.outputHandler=r,this.dependentSetHandler=s}workset=new Set;dependencyMap=new Map;dependentMap=new Map;outputMap=new Map;addToWorkset(e){this.workset.add(e)}addAllNodesToWorkset(){for(const e of this.nodes.keys())this.workset.add(e)}get outputs(){return this.outputMap}get dependents(){return this.dependentMap}requireOutput(e){const n=this.outputMap.get(e);if(!n)throw new Error(`Output for node ${e} is not available`);return n}getDependents(e){const n=this.dependentMap.get(e);return n?Array.from(n):[]}invalidate(e){const n=[e];for(;n.length>0;){const r=n.pop();if(!this.nodes.has(r))continue;this.outputMap.delete(r),this.workset.add(r);const s=this.dependentMap.get(r);if(s)for(const i of s)this.outputMap.has(i)&&n.push(i)}}invalidateSingle(e){this.nodes.has(e)&&(this.outputMap.delete(e),this.workset.add(e))}async process(e){for(;this.workset.size>0;){const n=this.workset.values().next().value,r=[{nodeId:n,resolved:!1,dependencies:[]}];for(;r.length>0;){const s=r[r.length-1],{nodeId:i,resolved:o}=s,a=this.nodes.get(i);if(!a){this.logger.warn({nodeId:i},"node not found in the graph, skipping"),r.pop();continue}if(this.outputMap.has(i)){r.pop();continue}if(!o){s.dependencies=vp(this.getNodeDependencies(a));let p=!1;for(const h of s.dependencies){if(!this.nodes.has(h)){this.logger.warn({depId:h,nodeId:i},"dependency not found in the graph, skipping");continue}this.outputMap.has(h)||(r.push({nodeId:h,resolved:!1,dependencies:[]}),p=!0)}if(p){s.resolved=!0;continue}}const c=await this.processNode(a,this.logger);if(e?.aborted){this.logger.warn({nodeId:i},"processing aborted, skipping output");return}const l=new Set,d=this.dependencyMap.get(i)??[];for(const p of d){const h=this.dependentMap.get(p);h&&(h.delete(i),l.add(p),h.size===0&&this.dependentMap.delete(p))}for(const p of s.dependencies){let h=this.dependentMap.get(p);h||(h=new Set,this.dependentMap.set(p,h)),h.add(i),l.add(p)}if(this.dependentSetHandler)for(const p of l){const h=this.dependentMap.get(p);this.dependentSetHandler(p,h)}this.outputMap.set(i,c),this.outputHandler?.(i,c),this.dependencyMap.set(i,s.dependencies),r.pop()}this.workset.delete(n)}}}class wg extends pi{getNodeDependencies(e){const n=[];if(e.kind==="hub"){for(const r of e.hub.inputs??[])n.push(`instance:${r.instanceId}`);for(const r of e.hub.injectionInputs??[])n.push(`hub:${r.hubId}`);return n}for(const r of Object.values(e.instance.inputs??{}))for(const s of r)n.push(`instance:${s.instanceId}`);for(const r of Object.values(e.instance.hubInputs??{}))for(const s of r)n.push(`hub:${s.hubId}`);for(const r of e.instance.injectionInputs??[])n.push(`hub:${r.hubId}`);return n}resolveOutputTypeForInput(e,n){return lu({input:e,fallbackType:n,getInstanceContext:r=>{const s=this.outputs.get(`instance:${r}`);if(!(!s||s.kind!=="instance"))return{instance:s.instance,component:s.component,entities:s.entities}}})}processNode(e){const n=d=>{const p=this.outputs.get(`hub:${d.hubId}`);if(!p)return{resolvedInputs:[]};if(p.kind!=="hub")throw new Error("Expected hub node");return p},r=d=>{const p=this.outputs.get(`instance:${d.instanceId}`);if(!p)return{component:null,resolvedInputs:[],resolvedOutputs:[]};if(p.kind!=="instance")throw new Error("Expected instance node");return{component:p.component,resolvedInputs:p.resolvedInputs[d.output]??[],resolvedOutputs:p.resolvedOutputs?.[d.output]}};if(e.kind==="hub"){const d=new Map,p=h=>{d.set(yn(h.input),h)};for(const h of e.hub.inputs??[]){const{component:m}=r(h),_=m?.outputs[h.output];if(!_){this.logger.warn({msg:"output not found in the component",input:h,component:m});continue}p({input:h,type:this.resolveOutputTypeForInput(h,_.type)})}for(const h of e.hub.injectionInputs??[]){const{resolvedInputs:m}=n(h);for(const _ of m)p(_)}return{kind:"hub",hub:e.hub,resolvedInputs:Array.from(d.values())}}if(e.instance.resolvedInputs)return{kind:"instance",instance:e.instance,component:e.component,entities:e.entities,resolvedInputs:yp(e.instance.resolvedInputs,(d,p)=>{const h=e.component.inputs[p];return h?d.map(m=>({input:m,type:h.type})):(this.logger.warn({msg:"input not found in the component",inputName:p,component:e.component}),[])}),resolvedOutputs:e.instance.resolvedOutputs??{},resolvedInjectionInputs:[],matchedInjectionInputs:[]};const s=new Map,i=(d,p)=>{let h=s.get(d);h||(h=new Map,s.set(d,h)),h.set(yn(p.input),p)},o=(d,p)=>{const h=e.component.inputs[d];if(!h){this.logger.warn({msg:"input not found in the component",input:p,component:e.component});return}const{component:m,resolvedOutputs:_}=r(p);if(!m){this.logger.warn({instanceId:e.instance.id,input:p},"no output found for the input");return}if(hi(m)){i(d,{input:p,type:this.resolveOutputTypeForInput(p,h.type)});return}if(_)for(const g of _)i(d,{input:{...g,path:p.path??g.path},type:this.resolveOutputTypeForInput({instanceId:p.instanceId,output:p.output,path:p.path??g.path},h.type)});else i(d,{input:p,type:this.resolveOutputTypeForInput(p,h.type)})};for(const[d,p]of Object.entries(e.instance.inputs??{}))for(const h of p)o(d,h);const a=new Map,c=new Map;for(const d of e.instance.injectionInputs??[]){const{resolvedInputs:p}=n(d);for(const h of p)a.set(yn(h.input),h)}for(const[d,p]of Object.entries(e.component.inputs??{})){const h=new Map(a),m=e.instance.hubInputs?.[d]??[];for(const _ of m){const{resolvedInputs:g}=n(_);for(const w of g)h.set(yn(w.input),w)}for(const _ of h.values())if(_.type===p.type){o(d,_.input);const g=yn(_.input);a.has(g)&&c.set(g,_)}}const l=gp(Array.from(s.entries()).map(([d,p])=>[d,Array.from(p.values())]));return{kind:"instance",instance:e.instance,component:e.component,entities:e.entities,resolvedInputs:l,resolvedOutputs:e.instance.resolvedOutputs,resolvedInjectionInputs:Array.from(a.values()),matchedInjectionInputs:Array.from(c.values())}}}function vg(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}const _g=t=>new TextEncoder().encode(t);typeof Buffer<"u"&&Buffer.from;function bg(t){if(!Uint32Array.from){for(var e=new Uint32Array(t.length),n=0;n<t.length;)e[n]=t[n],n+=1;return e}return Uint32Array.from(t)}function bs(t){return new $g().update(t).digest()}var $g=(function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var n,r;try{for(var s=vg(e),i=s.next();!i.done;i=s.next()){var o=i.value;this.checksum=this.checksum>>>8^Eg[(this.checksum^o)&255]}}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return this},t.prototype.digest=function(){return(this.checksum^4294967295)>>>0},t})(),Sg=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],Eg=bg(Sg);function kg(t){const e=t.length;let n=0,r=0;for(;r<e;){let s=t.charCodeAt(r++);if((s&4294967168)===0){n++;continue}else if((s&4294965248)===0)n+=2;else{if(s>=55296&&s<=56319&&r<e){const i=t.charCodeAt(r);(i&64512)===56320&&(++r,s=((s&1023)<<10)+(i&1023)+65536)}(s&4294901760)===0?n+=3:n+=4}}return n}function Ig(t,e,n){const r=t.length;let s=n,i=0;for(;i<r;){let o=t.charCodeAt(i++);if((o&4294967168)===0){e[s++]=o;continue}else if((o&4294965248)===0)e[s++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&i<r){const a=t.charCodeAt(i);(a&64512)===56320&&(++i,o=((o&1023)<<10)+(a&1023)+65536)}(o&4294901760)===0?(e[s++]=o>>12&15|224,e[s++]=o>>6&63|128):(e[s++]=o>>18&7|240,e[s++]=o>>12&63|128,e[s++]=o>>6&63|128)}e[s++]=o&63|128}}const Og=new TextEncoder,Ag=50;function Ng(t,e,n){Og.encodeInto(t,e.subarray(n))}function Tg(t,e,n){t.length>Ag?Ng(t,e,n):Ig(t,e,n)}new TextDecoder;class Hn{type;data;constructor(e,n){this.type=e,this.data=n}}class Kr extends Error{constructor(e){super(e);const n=Object.create(Kr.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:Kr.name})}}function Pg(t,e,n){const r=n/4294967296,s=n;t.setUint32(e,r),t.setUint32(e+4,s)}function fu(t,e,n){const r=Math.floor(n/4294967296),s=n;t.setUint32(e,r),t.setUint32(e+4,s)}function Cg(t,e){const n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}const xg=-1,Bg=4294967296-1,Dg=17179869184-1;function zg({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Dg)if(e===0&&t<=Bg){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t),n}else{const n=t/4294967296,r=t&4294967295,s=new Uint8Array(8),i=new DataView(s.buffer);return i.setUint32(0,e<<2|n&3),i.setUint32(4,r),s}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,e),fu(r,4,t),n}}function Rg(t){const e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,s=Math.floor(r/1e9);return{sec:n+s,nsec:r-s*1e9}}function jg(t){if(t instanceof Date){const e=Rg(t);return zg(e)}else return null}function Fg(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),r=e.getUint32(4),s=(n&3)*4294967296+r,i=n>>>2;return{sec:s,nsec:i}}case 12:{const n=Cg(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new Kr(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Mg(t){const e=Fg(t);return new Date(e.sec*1e3+e.nsec/1e6)}const Ug={type:xg,encode:jg,decode:Mg};class mi{static defaultCodec=new mi;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(Ug)}register({type:e,encode:n,decode:r}){if(e>=0)this.encoders[e]=n,this.decoders[e]=r;else{const s=-1-e;this.builtInEncoders[s]=n,this.builtInDecoders[s]=r}}tryToEncode(e,n){for(let r=0;r<this.builtInEncoders.length;r++){const s=this.builtInEncoders[r];if(s!=null){const i=s(e,n);if(i!=null){const o=-1-r;return new Hn(o,i)}}}for(let r=0;r<this.encoders.length;r++){const s=this.encoders[r];if(s!=null){const i=s(e,n);if(i!=null){const o=r;return new Hn(o,i)}}}return e instanceof Hn?e:null}decode(e,n,r){const s=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return s?s(e,n,r):new Hn(n,e)}}function Lg(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function qg(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Lg(t)?new Uint8Array(t):Uint8Array.from(t)}const Zg=100,Vg=2048;class gi{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??mi.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??Zg,this.initialBufferSize=e?.initialBufferSize??Vg,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new gi({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)}ensureBufferSizeToWrite(e){const n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(e){const n=new ArrayBuffer(e),r=new Uint8Array(n),s=new DataView(n);r.set(this.bytes),this.view=s,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const r=kg(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),Tg(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,n){const r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=qg(e);this.writeU8a(r)}encodeArray(e,n){const r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const s of e)this.doEncode(s,n+1)}countWithoutUndefined(e,n){let r=0;for(const s of n)e[s]!==void 0&&r++;return r}encodeMap(e,n){const r=Object.keys(e);this.sortKeys&&r.sort();const s=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(s<16)this.writeU8(128+s);else if(s<65536)this.writeU8(222),this.writeU16(s);else if(s<4294967296)this.writeU8(223),this.writeU32(s);else throw new Error(`Too large map object: ${s}`);for(const i of r){const o=e[i];this.ignoreUndefined&&o===void 0||(this.encodeString(i),this.doEncode(o,n+1))}}encodeExtension(e){if(typeof e.data=="function"){const r=e.data(this.pos+6),s=r.length;if(s>=4294967296)throw new Error(`Too large extension object: ${s}`);this.writeU8(201),this.writeU32(s),this.writeI8(e.type),this.writeU8a(r);return}const n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),Pg(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),fu(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function Kg(t,e){return new gi(e).encodeSharedRef(t)}var $s={},wn={},ro;function Jg(){if(ro)return wn;ro=1,wn.byteLength=a,wn.toByteArray=l,wn.fromByteArray=h;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,i=r.length;s<i;++s)t[s]=r[s],e[r.charCodeAt(s)]=s;e[45]=62,e[95]=63;function o(m){var _=m.length;if(_%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=m.indexOf("=");g===-1&&(g=_);var w=g===_?0:4-g%4;return[g,w]}function a(m){var _=o(m),g=_[0],w=_[1];return(g+w)*3/4-w}function c(m,_,g){return(_+g)*3/4-g}function l(m){var _,g=o(m),w=g[0],$=g[1],y=new n(c(m,w,$)),b=0,I=$>0?w-4:w,v;for(v=0;v<I;v+=4)_=e[m.charCodeAt(v)]<<18|e[m.charCodeAt(v+1)]<<12|e[m.charCodeAt(v+2)]<<6|e[m.charCodeAt(v+3)],y[b++]=_>>16&255,y[b++]=_>>8&255,y[b++]=_&255;return $===2&&(_=e[m.charCodeAt(v)]<<2|e[m.charCodeAt(v+1)]>>4,y[b++]=_&255),$===1&&(_=e[m.charCodeAt(v)]<<10|e[m.charCodeAt(v+1)]<<4|e[m.charCodeAt(v+2)]>>2,y[b++]=_>>8&255,y[b++]=_&255),y}function d(m){return t[m>>18&63]+t[m>>12&63]+t[m>>6&63]+t[m&63]}function p(m,_,g){for(var w,$=[],y=_;y<g;y+=3)w=(m[y]<<16&16711680)+(m[y+1]<<8&65280)+(m[y+2]&255),$.push(d(w));return $.join("")}function h(m){for(var _,g=m.length,w=g%3,$=[],y=16383,b=0,I=g-w;b<I;b+=y)$.push(p(m,b,b+y>I?I:b+y));return w===1?(_=m[g-1],$.push(t[_>>2]+t[_<<4&63]+"==")):w===2&&(_=(m[g-2]<<8)+m[g-1],$.push(t[_>>10]+t[_>>4&63]+t[_<<2&63]+"=")),$.join("")}return wn}var Gn={};var so;function Hg(){return so||(so=1,Gn.read=function(t,e,n,r,s){var i,o,a=s*8-r-1,c=(1<<a)-1,l=c>>1,d=-7,p=n?s-1:0,h=n?-1:1,m=t[e+p];for(p+=h,i=m&(1<<-d)-1,m>>=-d,d+=a;d>0;i=i*256+t[e+p],p+=h,d-=8);for(o=i&(1<<-d)-1,i>>=-d,d+=r;d>0;o=o*256+t[e+p],p+=h,d-=8);if(i===0)i=1-l;else{if(i===c)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-l}return(m?-1:1)*o*Math.pow(2,i-r)},Gn.write=function(t,e,n,r,s,i){var o,a,c,l=i*8-s-1,d=(1<<l)-1,p=d>>1,h=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,_=r?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+p>=1?e+=h/c:e+=h*Math.pow(2,1-p),e*c>=2&&(o++,c/=2),o+p>=d?(a=0,o=d):o+p>=1?(a=(e*c-1)*Math.pow(2,s),o=o+p):(a=e*Math.pow(2,p-1)*Math.pow(2,s),o=0));s>=8;t[n+m]=a&255,m+=_,a/=256,s-=8);for(o=o<<s|a,l+=s;l>0;t[n+m]=o&255,m+=_,o/=256,l-=8);t[n+m-_]|=g*128}),Gn}var io;function Gg(){return io||(io=1,(function(t){const e=Jg(),n=Hg(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=y,t.INSPECT_MAX_BYTES=50;const s=2147483647;t.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=i(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const S=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(S,u),S.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(S){if(S>s)throw new RangeError('The value "'+S+'" is invalid for option "size"');const u=new Uint8Array(S);return Object.setPrototypeOf(u,a.prototype),u}function a(S,u,f){if(typeof S=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(S)}return c(S,u,f)}a.poolSize=8192;function c(S,u,f){if(typeof S=="string")return h(S,u);if(ArrayBuffer.isView(S))return _(S);if(S==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S);if(Ue(S,ArrayBuffer)||S&&Ue(S.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ue(S,SharedArrayBuffer)||S&&Ue(S.buffer,SharedArrayBuffer)))return g(S,u,f);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const O=S.valueOf&&S.valueOf();if(O!=null&&O!==S)return a.from(O,u,f);const C=w(S);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return a.from(S[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S)}a.from=function(S,u,f){return c(S,u,f)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(S){if(typeof S!="number")throw new TypeError('"size" argument must be of type number');if(S<0)throw new RangeError('The value "'+S+'" is invalid for option "size"')}function d(S,u,f){return l(S),S<=0?o(S):u!==void 0?typeof f=="string"?o(S).fill(u,f):o(S).fill(u):o(S)}a.alloc=function(S,u,f){return d(S,u,f)};function p(S){return l(S),o(S<0?0:$(S)|0)}a.allocUnsafe=function(S){return p(S)},a.allocUnsafeSlow=function(S){return p(S)};function h(S,u){if((typeof u!="string"||u==="")&&(u="utf8"),!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);const f=b(S,u)|0;let O=o(f);const C=O.write(S,u);return C!==f&&(O=O.slice(0,C)),O}function m(S){const u=S.length<0?0:$(S.length)|0,f=o(u);for(let O=0;O<u;O+=1)f[O]=S[O]&255;return f}function _(S){if(Ue(S,Uint8Array)){const u=new Uint8Array(S);return g(u.buffer,u.byteOffset,u.byteLength)}return m(S)}function g(S,u,f){if(u<0||S.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(S.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let O;return u===void 0&&f===void 0?O=new Uint8Array(S):f===void 0?O=new Uint8Array(S,u):O=new Uint8Array(S,u,f),Object.setPrototypeOf(O,a.prototype),O}function w(S){if(a.isBuffer(S)){const u=$(S.length)|0,f=o(u);return f.length===0||S.copy(f,0,0,u),f}if(S.length!==void 0)return typeof S.length!="number"||Ze(S.length)?o(0):m(S);if(S.type==="Buffer"&&Array.isArray(S.data))return m(S.data)}function $(S){if(S>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return S|0}function y(S){return+S!=S&&(S=0),a.alloc(+S)}a.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==a.prototype},a.compare=function(u,f){if(Ue(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),Ue(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(u)||!a.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===f)return 0;let O=u.length,C=f.length;for(let R=0,Z=Math.min(O,C);R<Z;++R)if(u[R]!==f[R]){O=u[R],C=f[R];break}return O<C?-1:C<O?1:0},a.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(u,f){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return a.alloc(0);let O;if(f===void 0)for(f=0,O=0;O<u.length;++O)f+=u[O].length;const C=a.allocUnsafe(f);let R=0;for(O=0;O<u.length;++O){let Z=u[O];if(Ue(Z,Uint8Array))R+Z.length>C.length?(a.isBuffer(Z)||(Z=a.from(Z)),Z.copy(C,R)):Uint8Array.prototype.set.call(C,Z,R);else if(a.isBuffer(Z))Z.copy(C,R);else throw new TypeError('"list" argument must be an Array of Buffers');R+=Z.length}return C};function b(S,u){if(a.isBuffer(S))return S.length;if(ArrayBuffer.isView(S)||Ue(S,ArrayBuffer))return S.byteLength;if(typeof S!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof S);const f=S.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&f===0)return 0;let C=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return _e(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Me(S).length;default:if(C)return O?-1:_e(S).length;u=(""+u).toLowerCase(),C=!0}}a.byteLength=b;function I(S,u,f){let O=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,u>>>=0,f<=u))return"";for(S||(S="utf8");;)switch(S){case"hex":return oe(this,u,f);case"utf8":case"utf-8":return le(this,u,f);case"ascii":return re(this,u,f);case"latin1":case"binary":return ne(this,u,f);case"base64":return se(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,u,f);default:if(O)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),O=!0}}a.prototype._isBuffer=!0;function v(S,u,f){const O=S[u];S[u]=S[f],S[f]=O}a.prototype.swap16=function(){const u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<u;f+=2)v(this,f,f+1);return this},a.prototype.swap32=function(){const u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<u;f+=4)v(this,f,f+3),v(this,f+1,f+2);return this},a.prototype.swap64=function(){const u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<u;f+=8)v(this,f,f+7),v(this,f+1,f+6),v(this,f+2,f+5),v(this,f+3,f+4);return this},a.prototype.toString=function(){const u=this.length;return u===0?"":arguments.length===0?le(this,0,u):I.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(u){if(!a.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:a.compare(this,u)===0},a.prototype.inspect=function(){let u="";const f=t.INSPECT_MAX_BYTES;return u=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(u+=" ... "),"<Buffer "+u+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(u,f,O,C,R){if(Ue(u,Uint8Array)&&(u=a.from(u,u.offset,u.byteLength)),!a.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(f===void 0&&(f=0),O===void 0&&(O=u?u.length:0),C===void 0&&(C=0),R===void 0&&(R=this.length),f<0||O>u.length||C<0||R>this.length)throw new RangeError("out of range index");if(C>=R&&f>=O)return 0;if(C>=R)return-1;if(f>=O)return 1;if(f>>>=0,O>>>=0,C>>>=0,R>>>=0,this===u)return 0;let Z=R-C,de=O-f;const Pe=Math.min(Z,de),Ie=this.slice(C,R),Ce=u.slice(f,O);for(let be=0;be<Pe;++be)if(Ie[be]!==Ce[be]){Z=Ie[be],de=Ce[be];break}return Z<de?-1:de<Z?1:0};function k(S,u,f,O,C){if(S.length===0)return-1;if(typeof f=="string"?(O=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Ze(f)&&(f=C?0:S.length-1),f<0&&(f=S.length+f),f>=S.length){if(C)return-1;f=S.length-1}else if(f<0)if(C)f=0;else return-1;if(typeof u=="string"&&(u=a.from(u,O)),a.isBuffer(u))return u.length===0?-1:A(S,u,f,O,C);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?C?Uint8Array.prototype.indexOf.call(S,u,f):Uint8Array.prototype.lastIndexOf.call(S,u,f):A(S,[u],f,O,C);throw new TypeError("val must be string, number or Buffer")}function A(S,u,f,O,C){let R=1,Z=S.length,de=u.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(S.length<2||u.length<2)return-1;R=2,Z/=2,de/=2,f/=2}function Pe(Ce,be){return R===1?Ce[be]:Ce.readUInt16BE(be*R)}let Ie;if(C){let Ce=-1;for(Ie=f;Ie<Z;Ie++)if(Pe(S,Ie)===Pe(u,Ce===-1?0:Ie-Ce)){if(Ce===-1&&(Ce=Ie),Ie-Ce+1===de)return Ce*R}else Ce!==-1&&(Ie-=Ie-Ce),Ce=-1}else for(f+de>Z&&(f=Z-de),Ie=f;Ie>=0;Ie--){let Ce=!0;for(let be=0;be<de;be++)if(Pe(S,Ie+be)!==Pe(u,be)){Ce=!1;break}if(Ce)return Ie}return-1}a.prototype.includes=function(u,f,O){return this.indexOf(u,f,O)!==-1},a.prototype.indexOf=function(u,f,O){return k(this,u,f,O,!0)},a.prototype.lastIndexOf=function(u,f,O){return k(this,u,f,O,!1)};function T(S,u,f,O){f=Number(f)||0;const C=S.length-f;O?(O=Number(O),O>C&&(O=C)):O=C;const R=u.length;O>R/2&&(O=R/2);let Z;for(Z=0;Z<O;++Z){const de=parseInt(u.substr(Z*2,2),16);if(Ze(de))return Z;S[f+Z]=de}return Z}function L(S,u,f,O){return Te(_e(u,S.length-f),S,f,O)}function H(S,u,f,O){return Te(Re(u),S,f,O)}function G(S,u,f,O){return Te(Me(u),S,f,O)}function Y(S,u,f,O){return Te(qe(u,S.length-f),S,f,O)}a.prototype.write=function(u,f,O,C){if(f===void 0)C="utf8",O=this.length,f=0;else if(O===void 0&&typeof f=="string")C=f,O=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(O)?(O=O>>>0,C===void 0&&(C="utf8")):(C=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const R=this.length-f;if((O===void 0||O>R)&&(O=R),u.length>0&&(O<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");C||(C="utf8");let Z=!1;for(;;)switch(C){case"hex":return T(this,u,f,O);case"utf8":case"utf-8":return L(this,u,f,O);case"ascii":case"latin1":case"binary":return H(this,u,f,O);case"base64":return G(this,u,f,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,u,f,O);default:if(Z)throw new TypeError("Unknown encoding: "+C);C=(""+C).toLowerCase(),Z=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function se(S,u,f){return u===0&&f===S.length?e.fromByteArray(S):e.fromByteArray(S.slice(u,f))}function le(S,u,f){f=Math.min(S.length,f);const O=[];let C=u;for(;C<f;){const R=S[C];let Z=null,de=R>239?4:R>223?3:R>191?2:1;if(C+de<=f){let Pe,Ie,Ce,be;switch(de){case 1:R<128&&(Z=R);break;case 2:Pe=S[C+1],(Pe&192)===128&&(be=(R&31)<<6|Pe&63,be>127&&(Z=be));break;case 3:Pe=S[C+1],Ie=S[C+2],(Pe&192)===128&&(Ie&192)===128&&(be=(R&15)<<12|(Pe&63)<<6|Ie&63,be>2047&&(be<55296||be>57343)&&(Z=be));break;case 4:Pe=S[C+1],Ie=S[C+2],Ce=S[C+3],(Pe&192)===128&&(Ie&192)===128&&(Ce&192)===128&&(be=(R&15)<<18|(Pe&63)<<12|(Ie&63)<<6|Ce&63,be>65535&&be<1114112&&(Z=be))}}Z===null?(Z=65533,de=1):Z>65535&&(Z-=65536,O.push(Z>>>10&1023|55296),Z=56320|Z&1023),O.push(Z),C+=de}return W(O)}const M=4096;function W(S){const u=S.length;if(u<=M)return String.fromCharCode.apply(String,S);let f="",O=0;for(;O<u;)f+=String.fromCharCode.apply(String,S.slice(O,O+=M));return f}function re(S,u,f){let O="";f=Math.min(S.length,f);for(let C=u;C<f;++C)O+=String.fromCharCode(S[C]&127);return O}function ne(S,u,f){let O="";f=Math.min(S.length,f);for(let C=u;C<f;++C)O+=String.fromCharCode(S[C]);return O}function oe(S,u,f){const O=S.length;(!u||u<0)&&(u=0),(!f||f<0||f>O)&&(f=O);let C="";for(let R=u;R<f;++R)C+=mn[S[R]];return C}function V(S,u,f){const O=S.slice(u,f);let C="";for(let R=0;R<O.length-1;R+=2)C+=String.fromCharCode(O[R]+O[R+1]*256);return C}a.prototype.slice=function(u,f){const O=this.length;u=~~u,f=f===void 0?O:~~f,u<0?(u+=O,u<0&&(u=0)):u>O&&(u=O),f<0?(f+=O,f<0&&(f=0)):f>O&&(f=O),f<u&&(f=u);const C=this.subarray(u,f);return Object.setPrototypeOf(C,a.prototype),C};function P(S,u,f){if(S%1!==0||S<0)throw new RangeError("offset is not uint");if(S+u>f)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(u,f,O){u=u>>>0,f=f>>>0,O||P(u,f,this.length);let C=this[u],R=1,Z=0;for(;++Z<f&&(R*=256);)C+=this[u+Z]*R;return C},a.prototype.readUintBE=a.prototype.readUIntBE=function(u,f,O){u=u>>>0,f=f>>>0,O||P(u,f,this.length);let C=this[u+--f],R=1;for(;f>0&&(R*=256);)C+=this[u+--f]*R;return C},a.prototype.readUint8=a.prototype.readUInt8=function(u,f){return u=u>>>0,f||P(u,1,this.length),this[u]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(u,f){return u=u>>>0,f||P(u,2,this.length),this[u]|this[u+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(u,f){return u=u>>>0,f||P(u,2,this.length),this[u]<<8|this[u+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(u,f){return u=u>>>0,f||P(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(u,f){return u=u>>>0,f||P(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},a.prototype.readBigUInt64LE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],O=this[u+7];(f===void 0||O===void 0)&&J(u,this.length-8);const C=f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,R=this[++u]+this[++u]*2**8+this[++u]*2**16+O*2**24;return BigInt(C)+(BigInt(R)<<BigInt(32))}),a.prototype.readBigUInt64BE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],O=this[u+7];(f===void 0||O===void 0)&&J(u,this.length-8);const C=f*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],R=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+O;return(BigInt(C)<<BigInt(32))+BigInt(R)}),a.prototype.readIntLE=function(u,f,O){u=u>>>0,f=f>>>0,O||P(u,f,this.length);let C=this[u],R=1,Z=0;for(;++Z<f&&(R*=256);)C+=this[u+Z]*R;return R*=128,C>=R&&(C-=Math.pow(2,8*f)),C},a.prototype.readIntBE=function(u,f,O){u=u>>>0,f=f>>>0,O||P(u,f,this.length);let C=f,R=1,Z=this[u+--C];for(;C>0&&(R*=256);)Z+=this[u+--C]*R;return R*=128,Z>=R&&(Z-=Math.pow(2,8*f)),Z},a.prototype.readInt8=function(u,f){return u=u>>>0,f||P(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},a.prototype.readInt16LE=function(u,f){u=u>>>0,f||P(u,2,this.length);const O=this[u]|this[u+1]<<8;return O&32768?O|4294901760:O},a.prototype.readInt16BE=function(u,f){u=u>>>0,f||P(u,2,this.length);const O=this[u+1]|this[u]<<8;return O&32768?O|4294901760:O},a.prototype.readInt32LE=function(u,f){return u=u>>>0,f||P(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},a.prototype.readInt32BE=function(u,f){return u=u>>>0,f||P(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},a.prototype.readBigInt64LE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],O=this[u+7];(f===void 0||O===void 0)&&J(u,this.length-8);const C=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(O<<24);return(BigInt(C)<<BigInt(32))+BigInt(f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),a.prototype.readBigInt64BE=tt(function(u){u=u>>>0,q(u,"offset");const f=this[u],O=this[u+7];(f===void 0||O===void 0)&&J(u,this.length-8);const C=(f<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(C)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+O)}),a.prototype.readFloatLE=function(u,f){return u=u>>>0,f||P(u,4,this.length),n.read(this,u,!0,23,4)},a.prototype.readFloatBE=function(u,f){return u=u>>>0,f||P(u,4,this.length),n.read(this,u,!1,23,4)},a.prototype.readDoubleLE=function(u,f){return u=u>>>0,f||P(u,8,this.length),n.read(this,u,!0,52,8)},a.prototype.readDoubleBE=function(u,f){return u=u>>>0,f||P(u,8,this.length),n.read(this,u,!1,52,8)};function j(S,u,f,O,C,R){if(!a.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>C||u<R)throw new RangeError('"value" argument is out of bounds');if(f+O>S.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(u,f,O,C){if(u=+u,f=f>>>0,O=O>>>0,!C){const de=Math.pow(2,8*O)-1;j(this,u,f,O,de,0)}let R=1,Z=0;for(this[f]=u&255;++Z<O&&(R*=256);)this[f+Z]=u/R&255;return f+O},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(u,f,O,C){if(u=+u,f=f>>>0,O=O>>>0,!C){const de=Math.pow(2,8*O)-1;j(this,u,f,O,de,0)}let R=O-1,Z=1;for(this[f+R]=u&255;--R>=0&&(Z*=256);)this[f+R]=u/Z&255;return f+O},a.prototype.writeUint8=a.prototype.writeUInt8=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,1,255,0),this[f]=u&255,f+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,2,65535,0),this[f]=u&255,this[f+1]=u>>>8,f+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,2,65535,0),this[f]=u>>>8,this[f+1]=u&255,f+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,4,4294967295,0),this[f+3]=u>>>24,this[f+2]=u>>>16,this[f+1]=u>>>8,this[f]=u&255,f+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,4,4294967295,0),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4};function B(S,u,f,O,C){D(u,O,C,S,f,7);let R=Number(u&BigInt(4294967295));S[f++]=R,R=R>>8,S[f++]=R,R=R>>8,S[f++]=R,R=R>>8,S[f++]=R;let Z=Number(u>>BigInt(32)&BigInt(4294967295));return S[f++]=Z,Z=Z>>8,S[f++]=Z,Z=Z>>8,S[f++]=Z,Z=Z>>8,S[f++]=Z,f}function E(S,u,f,O,C){D(u,O,C,S,f,7);let R=Number(u&BigInt(4294967295));S[f+7]=R,R=R>>8,S[f+6]=R,R=R>>8,S[f+5]=R,R=R>>8,S[f+4]=R;let Z=Number(u>>BigInt(32)&BigInt(4294967295));return S[f+3]=Z,Z=Z>>8,S[f+2]=Z,Z=Z>>8,S[f+1]=Z,Z=Z>>8,S[f]=Z,f+8}a.prototype.writeBigUInt64LE=tt(function(u,f=0){return B(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=tt(function(u,f=0){return E(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(u,f,O,C){if(u=+u,f=f>>>0,!C){const Pe=Math.pow(2,8*O-1);j(this,u,f,O,Pe-1,-Pe)}let R=0,Z=1,de=0;for(this[f]=u&255;++R<O&&(Z*=256);)u<0&&de===0&&this[f+R-1]!==0&&(de=1),this[f+R]=(u/Z>>0)-de&255;return f+O},a.prototype.writeIntBE=function(u,f,O,C){if(u=+u,f=f>>>0,!C){const Pe=Math.pow(2,8*O-1);j(this,u,f,O,Pe-1,-Pe)}let R=O-1,Z=1,de=0;for(this[f+R]=u&255;--R>=0&&(Z*=256);)u<0&&de===0&&this[f+R+1]!==0&&(de=1),this[f+R]=(u/Z>>0)-de&255;return f+O},a.prototype.writeInt8=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,1,127,-128),u<0&&(u=255+u+1),this[f]=u&255,f+1},a.prototype.writeInt16LE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,2,32767,-32768),this[f]=u&255,this[f+1]=u>>>8,f+2},a.prototype.writeInt16BE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,2,32767,-32768),this[f]=u>>>8,this[f+1]=u&255,f+2},a.prototype.writeInt32LE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,4,2147483647,-2147483648),this[f]=u&255,this[f+1]=u>>>8,this[f+2]=u>>>16,this[f+3]=u>>>24,f+4},a.prototype.writeInt32BE=function(u,f,O){return u=+u,f=f>>>0,O||j(this,u,f,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4},a.prototype.writeBigInt64LE=tt(function(u,f=0){return B(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=tt(function(u,f=0){return E(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function N(S,u,f,O,C,R){if(f+O>S.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function F(S,u,f,O,C){return u=+u,f=f>>>0,C||N(S,u,f,4),n.write(S,u,f,O,23,4),f+4}a.prototype.writeFloatLE=function(u,f,O){return F(this,u,f,!0,O)},a.prototype.writeFloatBE=function(u,f,O){return F(this,u,f,!1,O)};function X(S,u,f,O,C){return u=+u,f=f>>>0,C||N(S,u,f,8),n.write(S,u,f,O,52,8),f+8}a.prototype.writeDoubleLE=function(u,f,O){return X(this,u,f,!0,O)},a.prototype.writeDoubleBE=function(u,f,O){return X(this,u,f,!1,O)},a.prototype.copy=function(u,f,O,C){if(!a.isBuffer(u))throw new TypeError("argument should be a Buffer");if(O||(O=0),!C&&C!==0&&(C=this.length),f>=u.length&&(f=u.length),f||(f=0),C>0&&C<O&&(C=O),C===O||u.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("sourceEnd out of bounds");C>this.length&&(C=this.length),u.length-f<C-O&&(C=u.length-f+O);const R=C-O;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,O,C):Uint8Array.prototype.set.call(u,this.subarray(O,C),f),R},a.prototype.fill=function(u,f,O,C){if(typeof u=="string"){if(typeof f=="string"?(C=f,f=0,O=this.length):typeof O=="string"&&(C=O,O=this.length),C!==void 0&&typeof C!="string")throw new TypeError("encoding must be a string");if(typeof C=="string"&&!a.isEncoding(C))throw new TypeError("Unknown encoding: "+C);if(u.length===1){const Z=u.charCodeAt(0);(C==="utf8"&&Z<128||C==="latin1")&&(u=Z)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(f<0||this.length<f||this.length<O)throw new RangeError("Out of range index");if(O<=f)return this;f=f>>>0,O=O===void 0?this.length:O>>>0,u||(u=0);let R;if(typeof u=="number")for(R=f;R<O;++R)this[R]=u;else{const Z=a.isBuffer(u)?u:a.from(u,C),de=Z.length;if(de===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(R=0;R<O-f;++R)this[R+f]=Z[R%de]}return this};const Q={};function fe(S,u,f){Q[S]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${S}]`,this.stack,delete this.name}get code(){return S}set code(C){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:C,writable:!0})}toString(){return`${this.name} [${S}]: ${this.message}`}}}fe("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),fe("ERR_INVALID_ARG_TYPE",function(S,u){return`The "${S}" argument must be of type number. Received type ${typeof u}`},TypeError),fe("ERR_OUT_OF_RANGE",function(S,u,f){let O=`The value of "${S}" is out of range.`,C=f;return Number.isInteger(f)&&Math.abs(f)>2**32?C=ie(String(f)):typeof f=="bigint"&&(C=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(C=ie(C)),C+="n"),O+=` It must be ${u}. Received ${C}`,O},RangeError);function ie(S){let u="",f=S.length;const O=S[0]==="-"?1:0;for(;f>=O+4;f-=3)u=`_${S.slice(f-3,f)}${u}`;return`${S.slice(0,f)}${u}`}function x(S,u,f){q(u,"offset"),(S[u]===void 0||S[u+f]===void 0)&&J(u,S.length-(f+1))}function D(S,u,f,O,C,R){if(S>f||S<u){const Z=typeof u=="bigint"?"n":"";let de;throw u===0||u===BigInt(0)?de=`>= 0${Z} and < 2${Z} ** ${(R+1)*8}${Z}`:de=`>= -(2${Z} ** ${(R+1)*8-1}${Z}) and < 2 ** ${(R+1)*8-1}${Z}`,new Q.ERR_OUT_OF_RANGE("value",de,S)}x(O,C,R)}function q(S,u){if(typeof S!="number")throw new Q.ERR_INVALID_ARG_TYPE(u,"number",S)}function J(S,u,f){throw Math.floor(S)!==S?(q(S,f),new Q.ERR_OUT_OF_RANGE("offset","an integer",S)):u<0?new Q.ERR_BUFFER_OUT_OF_BOUNDS:new Q.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${u}`,S)}const ee=/[^+/0-9A-Za-z-_]/g;function ae(S){if(S=S.split("=")[0],S=S.trim().replace(ee,""),S.length<2)return"";for(;S.length%4!==0;)S=S+"=";return S}function _e(S,u){u=u||1/0;let f;const O=S.length;let C=null;const R=[];for(let Z=0;Z<O;++Z){if(f=S.charCodeAt(Z),f>55295&&f<57344){if(!C){if(f>56319){(u-=3)>-1&&R.push(239,191,189);continue}else if(Z+1===O){(u-=3)>-1&&R.push(239,191,189);continue}C=f;continue}if(f<56320){(u-=3)>-1&&R.push(239,191,189),C=f;continue}f=(C-55296<<10|f-56320)+65536}else C&&(u-=3)>-1&&R.push(239,191,189);if(C=null,f<128){if((u-=1)<0)break;R.push(f)}else if(f<2048){if((u-=2)<0)break;R.push(f>>6|192,f&63|128)}else if(f<65536){if((u-=3)<0)break;R.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((u-=4)<0)break;R.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return R}function Re(S){const u=[];for(let f=0;f<S.length;++f)u.push(S.charCodeAt(f)&255);return u}function qe(S,u){let f,O,C;const R=[];for(let Z=0;Z<S.length&&!((u-=2)<0);++Z)f=S.charCodeAt(Z),O=f>>8,C=f%256,R.push(C),R.push(O);return R}function Me(S){return e.toByteArray(ae(S))}function Te(S,u,f,O){let C;for(C=0;C<O&&!(C+f>=u.length||C>=S.length);++C)u[C+f]=S[C];return C}function Ue(S,u){return S instanceof u||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===u.name}function Ze(S){return S!==S}const mn=(function(){const S="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){const O=f*16;for(let C=0;C<16;++C)u[O+C]=S[f]+S[C]}return u})();function tt(S){return typeof BigInt>"u"?Pt:S}function Pt(){throw new Error("BigInt not supported")}})($s)),$s}var vn=Gg();function Vt(t){const e=new ArrayBuffer(4);return new DataView(e).setInt32(0,t,!0),new Uint8Array(e)}class Wg extends pi{getNodeDependencies({resolvedInputs:e}){const n=[];for(const r of Object.values(e??{}))for(const s of r)n.push(s.input.instanceId);return n}processNode({instance:e,component:n,resolvedInputs:r,sourceHash:s,state:i}){const o=[];o.push(vn.Buffer.from(e.id)),o.push(Vt(n.definitionHash)),i?.inputHashNonce&&o.push(Vt(i.inputHashNonce)),e.args&&o.push(Kg(e.args)),s?o.push(Vt(s)):hi(n)&&this.logger.warn({instanceId:e.id},"missing source hash for unit model, this may lead to incorrect input hash");const a=[...o],c=Object.entries(r).sort(([h],[m])=>h.localeCompare(m)),l=new Set;for(const[h,m]of c){if(Object.keys(m).length===0)continue;a.push(vn.Buffer.from(h));const _=m.map(g=>g.input.instanceId).sort();for(const g of _){const w=this.outputs.get(g);if(!w){this.logger.warn({instanceId:g,dependentInstanceId:e.id},"missing dependency when calculating input hash, this may lead to incorrect input hash");continue}a.push(Vt(w.inputHash)),a.push(Vt(w.outputHash)),l.add(g)}}const d=[],p=Array.from(l).sort();for(const h of p){const m=this.outputs.get(h);if(!m){this.logger.warn({instanceId:h,dependentInstanceId:e.id},"missing dependency when calculating dependency output hash, this may lead to incorrect input hash");continue}d.push(Vt(m.outputHash))}return{selfHash:bs(vn.Buffer.concat(o)),inputHash:bs(vn.Buffer.concat(a)),dependencyOutputHash:bs(vn.Buffer.concat(d)),outputHash:i?.outputHash??0}}}var Wn={exports:{}},Ss={},dt={},Ct={},Es={},ks={},Is={},oo;function Jr(){return oo||(oo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends e{constructor(y){if(super(),!t.IDENTIFIER.test(y))throw new Error("CodeGen: name must be a valid identifier");this.str=y}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class r extends e{constructor(y){super(),this._items=typeof y=="string"?[y]:y}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const y=this._items[0];return y===""||y==='""'}get str(){var y;return(y=this._str)!==null&&y!==void 0?y:this._str=this._items.reduce((b,I)=>`${b}${I}`,"")}get names(){var y;return(y=this._names)!==null&&y!==void 0?y:this._names=this._items.reduce((b,I)=>(I instanceof n&&(b[I.str]=(b[I.str]||0)+1),b),{})}}t._Code=r,t.nil=new r("");function s($,...y){const b=[$[0]];let I=0;for(;I<y.length;)a(b,y[I]),b.push($[++I]);return new r(b)}t._=s;const i=new r("+");function o($,...y){const b=[m($[0])];let I=0;for(;I<y.length;)b.push(i),a(b,y[I]),b.push(i,m($[++I]));return c(b),new r(b)}t.str=o;function a($,y){y instanceof r?$.push(...y._items):y instanceof n?$.push(y):$.push(p(y))}t.addCodeArg=a;function c($){let y=1;for(;y<$.length-1;){if($[y]===i){const b=l($[y-1],$[y+1]);if(b!==void 0){$.splice(y-1,3,b);continue}$[y++]="+"}y++}}function l($,y){if(y==='""')return $;if($==='""')return y;if(typeof $=="string")return y instanceof n||$[$.length-1]!=='"'?void 0:typeof y!="string"?`${$.slice(0,-1)}${y}"`:y[0]==='"'?$.slice(0,-1)+y.slice(1):void 0;if(typeof y=="string"&&y[0]==='"'&&!($ instanceof n))return`"${$}${y.slice(1)}`}function d($,y){return y.emptyStr()?$:$.emptyStr()?y:o`${$}${y}`}t.strConcat=d;function p($){return typeof $=="number"||typeof $=="boolean"||$===null?$:m(Array.isArray($)?$.join(","):$)}function h($){return new r(m($))}t.stringify=h;function m($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=m;function _($){return typeof $=="string"&&t.IDENTIFIER.test($)?new r(`.${$}`):s`[${$}]`}t.getProperty=_;function g($){if(typeof $=="string"&&t.IDENTIFIER.test($))return new r(`${$}`);throw new Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}t.getEsmExportName=g;function w($){return new r($.toString())}t.regexpCode=w})(Is)),Is}var Os={},ao;function co(){return ao||(ao=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=Jr();class n extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var r;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(r||(t.UsedValueState=r={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class s{constructor({prefixes:l,parent:d}={}){this._names={},this._prefixes=l,this._parent=d}toName(l){return l instanceof e.Name?l:this.name(l)}name(l){return new e.Name(this._newName(l))}_newName(l){const d=this._names[l]||this._nameGroup(l);return`${l}${d.index++}`}_nameGroup(l){var d,p;if(!((p=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||p===void 0)&&p.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}t.Scope=s;class i extends e.Name{constructor(l,d){super(d),this.prefix=l}setValue(l,{property:d,itemIndex:p}){this.value=l,this.scopePath=(0,e._)`.${new e.Name(d)}[${p}]`}}t.ValueScopeName=i;const o=(0,e._)`\n`;class a extends s{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?o:e.nil}}get(){return this._scope}name(l){return new i(l,this._newName(l))}value(l,d){var p;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(l),{prefix:m}=h,_=(p=d.key)!==null&&p!==void 0?p:d.ref;let g=this._values[m];if(g){const y=g.get(_);if(y)return y}else g=this._values[m]=new Map;g.set(_,h);const w=this._scope[m]||(this._scope[m]=[]),$=w.length;return w[$]=d.ref,h.setValue(d,{property:m,itemIndex:$}),h}getValue(l,d){const p=this._values[l];if(p)return p.get(d)}scopeRefs(l,d=this._values){return this._reduceValues(d,p=>{if(p.scopePath===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return(0,e._)`${l}${p.scopePath}`})}scopeCode(l=this._values,d,p){return this._reduceValues(l,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},d,p)}_reduceValues(l,d,p={},h){let m=e.nil;for(const _ in l){const g=l[_];if(!g)continue;const w=p[_]=p[_]||new Map;g.forEach($=>{if(w.has($))return;w.set($,r.Started);let y=d($);if(y){const b=this.opts.es5?t.varKinds.var:t.varKinds.const;m=(0,e._)`${m}${b} ${$} = ${y};${this.opts._n}`}else if(y=h?.($))m=(0,e._)`${m}${y}${this.opts._n}`;else throw new n($);w.set($,r.Completed)})}return m}}t.ValueScope=a})(Os)),Os}var uo;function he(){return uo||(uo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=Jr(),n=co();var r=Jr();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var s=co();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class i{optimizeNodes(){return this}optimizeNames(E,N){return this}}class o extends i{constructor(E,N,F){super(),this.varKind=E,this.name=N,this.rhs=F}render({es5:E,_n:N}){const F=E?n.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${F} ${this.name}${X};`+N}optimizeNames(E,N){if(E[this.name.str])return this.rhs&&(this.rhs=le(this.rhs,E,N)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(E,N,F){super(),this.lhs=E,this.rhs=N,this.sideEffects=F}render({_n:E}){return`${this.lhs} = ${this.rhs};`+E}optimizeNames(E,N){if(!(this.lhs instanceof e.Name&&!E[this.lhs.str]&&!this.sideEffects))return this.rhs=le(this.rhs,E,N),this}get names(){const E=this.lhs instanceof e.Name?{}:{...this.lhs.names};return se(E,this.rhs)}}class c extends a{constructor(E,N,F,X){super(E,F,X),this.op=N}render({_n:E}){return`${this.lhs} ${this.op}= ${this.rhs};`+E}}class l extends i{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`${this.label}:`+E}}class d extends i{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`break${this.label?` ${this.label}`:""};`+E}}class p extends i{constructor(E){super(),this.error=E}render({_n:E}){return`throw ${this.error};`+E}get names(){return this.error.names}}class h extends i{constructor(E){super(),this.code=E}render({_n:E}){return`${this.code};`+E}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(E,N){return this.code=le(this.code,E,N),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class m extends i{constructor(E=[]){super(),this.nodes=E}render(E){return this.nodes.reduce((N,F)=>N+F.render(E),"")}optimizeNodes(){const{nodes:E}=this;let N=E.length;for(;N--;){const F=E[N].optimizeNodes();Array.isArray(F)?E.splice(N,1,...F):F?E[N]=F:E.splice(N,1)}return E.length>0?this:void 0}optimizeNames(E,N){const{nodes:F}=this;let X=F.length;for(;X--;){const Q=F[X];Q.optimizeNames(E,N)||(M(E,Q.names),F.splice(X,1))}return F.length>0?this:void 0}get names(){return this.nodes.reduce((E,N)=>Y(E,N.names),{})}}class _ extends m{render(E){return"{"+E._n+super.render(E)+"}"+E._n}}class g extends m{}class w extends _{}w.kind="else";class $ extends _{constructor(E,N){super(N),this.condition=E}render(E){let N=`if(${this.condition})`+super.render(E);return this.else&&(N+="else "+this.else.render(E)),N}optimizeNodes(){super.optimizeNodes();const E=this.condition;if(E===!0)return this.nodes;let N=this.else;if(N){const F=N.optimizeNodes();N=this.else=Array.isArray(F)?new w(F):F}if(N)return E===!1?N instanceof $?N:N.nodes:this.nodes.length?this:new $(W(E),N instanceof $?[N]:N.nodes);if(!(E===!1||!this.nodes.length))return this}optimizeNames(E,N){var F;if(this.else=(F=this.else)===null||F===void 0?void 0:F.optimizeNames(E,N),!!(super.optimizeNames(E,N)||this.else))return this.condition=le(this.condition,E,N),this}get names(){const E=super.names;return se(E,this.condition),this.else&&Y(E,this.else.names),E}}$.kind="if";class y extends _{}y.kind="for";class b extends y{constructor(E){super(),this.iteration=E}render(E){return`for(${this.iteration})`+super.render(E)}optimizeNames(E,N){if(super.optimizeNames(E,N))return this.iteration=le(this.iteration,E,N),this}get names(){return Y(super.names,this.iteration.names)}}class I extends y{constructor(E,N,F,X){super(),this.varKind=E,this.name=N,this.from=F,this.to=X}render(E){const N=E.es5?n.varKinds.var:this.varKind,{name:F,from:X,to:Q}=this;return`for(${N} ${F}=${X}; ${F}<${Q}; ${F}++)`+super.render(E)}get names(){const E=se(super.names,this.from);return se(E,this.to)}}class v extends y{constructor(E,N,F,X){super(),this.loop=E,this.varKind=N,this.name=F,this.iterable=X}render(E){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(E)}optimizeNames(E,N){if(super.optimizeNames(E,N))return this.iterable=le(this.iterable,E,N),this}get names(){return Y(super.names,this.iterable.names)}}class k extends _{constructor(E,N,F){super(),this.name=E,this.args=N,this.async=F}render(E){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(E)}}k.kind="func";class A extends m{render(E){return"return "+super.render(E)}}A.kind="return";class T extends _{render(E){let N="try"+super.render(E);return this.catch&&(N+=this.catch.render(E)),this.finally&&(N+=this.finally.render(E)),N}optimizeNodes(){var E,N;return super.optimizeNodes(),(E=this.catch)===null||E===void 0||E.optimizeNodes(),(N=this.finally)===null||N===void 0||N.optimizeNodes(),this}optimizeNames(E,N){var F,X;return super.optimizeNames(E,N),(F=this.catch)===null||F===void 0||F.optimizeNames(E,N),(X=this.finally)===null||X===void 0||X.optimizeNames(E,N),this}get names(){const E=super.names;return this.catch&&Y(E,this.catch.names),this.finally&&Y(E,this.finally.names),E}}class L extends _{constructor(E){super(),this.error=E}render(E){return`catch(${this.error})`+super.render(E)}}L.kind="catch";class H extends _{render(E){return"finally"+super.render(E)}}H.kind="finally";class G{constructor(E,N={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...N,_n:N.lines?`
|
|
170
|
-
`:""},this._extScope=E,this._scope=new n.Scope({parent:E}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(E){return this._scope.name(E)}scopeName(E){return this._extScope.name(E)}scopeValue(E,N){const F=this._extScope.value(E,N);return(this._values[F.prefix]||(this._values[F.prefix]=new Set)).add(F),F}getScopeValue(E,N){return this._extScope.getValue(E,N)}scopeRefs(E){return this._extScope.scopeRefs(E,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(E,N,F,X){const Q=this._scope.toName(N);return F!==void 0&&X&&(this._constants[Q.str]=F),this._leafNode(new o(E,Q,F)),Q}const(E,N,F){return this._def(n.varKinds.const,E,N,F)}let(E,N,F){return this._def(n.varKinds.let,E,N,F)}var(E,N,F){return this._def(n.varKinds.var,E,N,F)}assign(E,N,F){return this._leafNode(new a(E,N,F))}add(E,N){return this._leafNode(new c(E,t.operators.ADD,N))}code(E){return typeof E=="function"?E():E!==e.nil&&this._leafNode(new h(E)),this}object(...E){const N=["{"];for(const[F,X]of E)N.length>1&&N.push(","),N.push(F),(F!==X||this.opts.es5)&&(N.push(":"),(0,e.addCodeArg)(N,X));return N.push("}"),new e._Code(N)}if(E,N,F){if(this._blockNode(new $(E)),N&&F)this.code(N).else().code(F).endIf();else if(N)this.code(N).endIf();else if(F)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(E){return this._elseNode(new $(E))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode($,w)}_for(E,N){return this._blockNode(E),N&&this.code(N).endFor(),this}for(E,N){return this._for(new b(E),N)}forRange(E,N,F,X,Q=this.opts.es5?n.varKinds.var:n.varKinds.let){const fe=this._scope.toName(E);return this._for(new I(Q,fe,N,F),()=>X(fe))}forOf(E,N,F,X=n.varKinds.const){const Q=this._scope.toName(E);if(this.opts.es5){const fe=N instanceof e.Name?N:this.var("_arr",N);return this.forRange("_i",0,(0,e._)`${fe}.length`,ie=>{this.var(Q,(0,e._)`${fe}[${ie}]`),F(Q)})}return this._for(new v("of",X,Q,N),()=>F(Q))}forIn(E,N,F,X=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(E,(0,e._)`Object.keys(${N})`,F);const Q=this._scope.toName(E);return this._for(new v("in",X,Q,N),()=>F(Q))}endFor(){return this._endBlockNode(y)}label(E){return this._leafNode(new l(E))}break(E){return this._leafNode(new d(E))}return(E){const N=new A;if(this._blockNode(N),this.code(E),N.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(A)}try(E,N,F){if(!N&&!F)throw new Error('CodeGen: "try" without "catch" and "finally"');const X=new T;if(this._blockNode(X),this.code(E),N){const Q=this.name("e");this._currNode=X.catch=new L(Q),N(Q)}return F&&(this._currNode=X.finally=new H,this.code(F)),this._endBlockNode(L,H)}throw(E){return this._leafNode(new p(E))}block(E,N){return this._blockStarts.push(this._nodes.length),E&&this.code(E).endBlock(N),this}endBlock(E){const N=this._blockStarts.pop();if(N===void 0)throw new Error("CodeGen: not in self-balancing block");const F=this._nodes.length-N;if(F<0||E!==void 0&&F!==E)throw new Error(`CodeGen: wrong number of nodes: ${F} vs ${E} expected`);return this._nodes.length=N,this}func(E,N=e.nil,F,X){return this._blockNode(new k(E,N,F)),X&&this.code(X).endFunc(),this}endFunc(){return this._endBlockNode(k)}optimize(E=1){for(;E-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(E){return this._currNode.nodes.push(E),this}_blockNode(E){this._currNode.nodes.push(E),this._nodes.push(E)}_endBlockNode(E,N){const F=this._currNode;if(F instanceof E||N&&F instanceof N)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${N?`${E.kind}/${N.kind}`:E.kind}"`)}_elseNode(E){const N=this._currNode;if(!(N instanceof $))throw new Error('CodeGen: "else" without "if"');return this._currNode=N.else=E,this}get _root(){return this._nodes[0]}get _currNode(){const E=this._nodes;return E[E.length-1]}set _currNode(E){const N=this._nodes;N[N.length-1]=E}}t.CodeGen=G;function Y(B,E){for(const N in E)B[N]=(B[N]||0)+(E[N]||0);return B}function se(B,E){return E instanceof e._CodeOrName?Y(B,E.names):B}function le(B,E,N){if(B instanceof e.Name)return F(B);if(!X(B))return B;return new e._Code(B._items.reduce((Q,fe)=>(fe instanceof e.Name&&(fe=F(fe)),fe instanceof e._Code?Q.push(...fe._items):Q.push(fe),Q),[]));function F(Q){const fe=N[Q.str];return fe===void 0||E[Q.str]!==1?Q:(delete E[Q.str],fe)}function X(Q){return Q instanceof e._Code&&Q._items.some(fe=>fe instanceof e.Name&&E[fe.str]===1&&N[fe.str]!==void 0)}}function M(B,E){for(const N in E)B[N]=(B[N]||0)-(E[N]||0)}function W(B){return typeof B=="boolean"||typeof B=="number"||B===null?!B:(0,e._)`!${j(B)}`}t.not=W;const re=P(t.operators.AND);function ne(...B){return B.reduce(re)}t.and=ne;const oe=P(t.operators.OR);function V(...B){return B.reduce(oe)}t.or=V;function P(B){return(E,N)=>E===e.nil?N:N===e.nil?E:(0,e._)`${j(E)} ${B} ${j(N)}`}function j(B){return B instanceof e.Name?B:(0,e._)`(${B})`}})(ks)),ks}var ue={},lo;function ge(){if(lo)return ue;lo=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.checkStrictMode=ue.getErrorPath=ue.Type=ue.useFunc=ue.setEvaluated=ue.evaluatedPropsToName=ue.mergeEvaluated=ue.eachItem=ue.unescapeJsonPointer=ue.escapeJsonPointer=ue.escapeFragment=ue.unescapeFragment=ue.schemaRefOrVal=ue.schemaHasRulesButRef=ue.schemaHasRules=ue.checkUnknownRules=ue.alwaysValidSchema=ue.toHash=void 0;const t=he(),e=Jr();function n(v){const k={};for(const A of v)k[A]=!0;return k}ue.toHash=n;function r(v,k){return typeof k=="boolean"?k:Object.keys(k).length===0?!0:(s(v,k),!i(k,v.self.RULES.all))}ue.alwaysValidSchema=r;function s(v,k=v.schema){const{opts:A,self:T}=v;if(!A.strictSchema||typeof k=="boolean")return;const L=T.RULES.keywords;for(const H in k)L[H]||I(v,`unknown keyword: "${H}"`)}ue.checkUnknownRules=s;function i(v,k){if(typeof v=="boolean")return!v;for(const A in v)if(k[A])return!0;return!1}ue.schemaHasRules=i;function o(v,k){if(typeof v=="boolean")return!v;for(const A in v)if(A!=="$ref"&&k.all[A])return!0;return!1}ue.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:k},A,T,L){if(!L){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return(0,t._)`${A}`}return(0,t._)`${v}${k}${(0,t.getProperty)(T)}`}ue.schemaRefOrVal=a;function c(v){return p(decodeURIComponent(v))}ue.unescapeFragment=c;function l(v){return encodeURIComponent(d(v))}ue.escapeFragment=l;function d(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}ue.escapeJsonPointer=d;function p(v){return v.replace(/~1/g,"/").replace(/~0/g,"~")}ue.unescapeJsonPointer=p;function h(v,k){if(Array.isArray(v))for(const A of v)k(A);else k(v)}ue.eachItem=h;function m({mergeNames:v,mergeToName:k,mergeValues:A,resultToName:T}){return(L,H,G,Y)=>{const se=G===void 0?H:G instanceof t.Name?(H instanceof t.Name?v(L,H,G):k(L,H,G),G):H instanceof t.Name?(k(L,G,H),H):A(H,G);return Y===t.Name&&!(se instanceof t.Name)?T(L,se):se}}ue.mergeEvaluated={props:m({mergeNames:(v,k,A)=>v.if((0,t._)`${A} !== true && ${k} !== undefined`,()=>{v.if((0,t._)`${k} === true`,()=>v.assign(A,!0),()=>v.assign(A,(0,t._)`${A} || {}`).code((0,t._)`Object.assign(${A}, ${k})`))}),mergeToName:(v,k,A)=>v.if((0,t._)`${A} !== true`,()=>{k===!0?v.assign(A,!0):(v.assign(A,(0,t._)`${A} || {}`),g(v,A,k))}),mergeValues:(v,k)=>v===!0?!0:{...v,...k},resultToName:_}),items:m({mergeNames:(v,k,A)=>v.if((0,t._)`${A} !== true && ${k} !== undefined`,()=>v.assign(A,(0,t._)`${k} === true ? true : ${A} > ${k} ? ${A} : ${k}`)),mergeToName:(v,k,A)=>v.if((0,t._)`${A} !== true`,()=>v.assign(A,k===!0?!0:(0,t._)`${A} > ${k} ? ${A} : ${k}`)),mergeValues:(v,k)=>v===!0?!0:Math.max(v,k),resultToName:(v,k)=>v.var("items",k)})};function _(v,k){if(k===!0)return v.var("props",!0);const A=v.var("props",(0,t._)`{}`);return k!==void 0&&g(v,A,k),A}ue.evaluatedPropsToName=_;function g(v,k,A){Object.keys(A).forEach(T=>v.assign((0,t._)`${k}${(0,t.getProperty)(T)}`,!0))}ue.setEvaluated=g;const w={};function $(v,k){return v.scopeValue("func",{ref:k,code:w[k.code]||(w[k.code]=new e._Code(k.code))})}ue.useFunc=$;var y;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(y||(ue.Type=y={}));function b(v,k,A){if(v instanceof t.Name){const T=k===y.Num;return A?T?(0,t._)`"[" + ${v} + "]"`:(0,t._)`"['" + ${v} + "']"`:T?(0,t._)`"/" + ${v}`:(0,t._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,t.getProperty)(v).toString():"/"+d(v)}ue.getErrorPath=b;function I(v,k,A=v.opts.strictSchema){if(A){if(k=`strict mode: ${k}`,A===!0)throw new Error(k);v.self.logger.warn(k)}}return ue.checkStrictMode=I,ue}var Yn={},fo;function Tt(){if(fo)return Yn;fo=1,Object.defineProperty(Yn,"__esModule",{value:!0});const t=he(),e={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};return Yn.default=e,Yn}var ho;function us(){return ho||(ho=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=he(),n=ge(),r=Tt();t.keywordError={message:({keyword:w})=>(0,e.str)`must pass "${w}" keyword validation`},t.keyword$DataError={message:({keyword:w,schemaType:$})=>$?(0,e.str)`"${w}" keyword must be ${$} ($data)`:(0,e.str)`"${w}" keyword is invalid ($data)`};function s(w,$=t.keywordError,y,b){const{it:I}=w,{gen:v,compositeRule:k,allErrors:A}=I,T=p(w,$,y);b??(k||A)?c(v,T):l(I,(0,e._)`[${T}]`)}t.reportError=s;function i(w,$=t.keywordError,y){const{it:b}=w,{gen:I,compositeRule:v,allErrors:k}=b,A=p(w,$,y);c(I,A),v||k||l(b,r.default.vErrors)}t.reportExtraError=i;function o(w,$){w.assign(r.default.errors,$),w.if((0,e._)`${r.default.vErrors} !== null`,()=>w.if($,()=>w.assign((0,e._)`${r.default.vErrors}.length`,$),()=>w.assign(r.default.vErrors,null)))}t.resetErrorsCount=o;function a({gen:w,keyword:$,schemaValue:y,data:b,errsCount:I,it:v}){if(I===void 0)throw new Error("ajv implementation error");const k=w.name("err");w.forRange("i",I,r.default.errors,A=>{w.const(k,(0,e._)`${r.default.vErrors}[${A}]`),w.if((0,e._)`${k}.instancePath === undefined`,()=>w.assign((0,e._)`${k}.instancePath`,(0,e.strConcat)(r.default.instancePath,v.errorPath))),w.assign((0,e._)`${k}.schemaPath`,(0,e.str)`${v.errSchemaPath}/${$}`),v.opts.verbose&&(w.assign((0,e._)`${k}.schema`,y),w.assign((0,e._)`${k}.data`,b))})}t.extendErrors=a;function c(w,$){const y=w.const("err",$);w.if((0,e._)`${r.default.vErrors} === null`,()=>w.assign(r.default.vErrors,(0,e._)`[${y}]`),(0,e._)`${r.default.vErrors}.push(${y})`),w.code((0,e._)`${r.default.errors}++`)}function l(w,$){const{gen:y,validateName:b,schemaEnv:I}=w;I.$async?y.throw((0,e._)`new ${w.ValidationError}(${$})`):(y.assign((0,e._)`${b}.errors`,$),y.return(!1))}const d={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function p(w,$,y){const{createErrors:b}=w.it;return b===!1?(0,e._)`{}`:h(w,$,y)}function h(w,$,y={}){const{gen:b,it:I}=w,v=[m(I,y),_(w,y)];return g(w,$,v),b.object(...v)}function m({errorPath:w},{instancePath:$}){const y=$?(0,e.str)`${w}${(0,n.getErrorPath)($,n.Type.Str)}`:w;return[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,y)]}function _({keyword:w,it:{errSchemaPath:$}},{schemaPath:y,parentSchema:b}){let I=b?$:(0,e.str)`${$}/${w}`;return y&&(I=(0,e.str)`${I}${(0,n.getErrorPath)(y,n.Type.Str)}`),[d.schemaPath,I]}function g(w,{params:$,message:y},b){const{keyword:I,data:v,schemaValue:k,it:A}=w,{opts:T,propertyName:L,topSchemaRef:H,schemaPath:G}=A;b.push([d.keyword,I],[d.params,typeof $=="function"?$(w):$||(0,e._)`{}`]),T.messages&&b.push([d.message,typeof y=="function"?y(w):y]),T.verbose&&b.push([d.schema,k],[d.parentSchema,(0,e._)`${H}${G}`],[r.default.data,v]),L&&b.push([d.propertyName,L])}})(Es)),Es}var po;function Yg(){if(po)return Ct;po=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.boolOrEmptySchema=Ct.topBoolOrEmptySchema=void 0;const t=us(),e=he(),n=Tt(),r={message:"boolean schema is false"};function s(a){const{gen:c,schema:l,validateName:d}=a;l===!1?o(a,!1):typeof l=="object"&&l.$async===!0?c.return(n.default.data):(c.assign((0,e._)`${d}.errors`,null),c.return(!0))}Ct.topBoolOrEmptySchema=s;function i(a,c){const{gen:l,schema:d}=a;d===!1?(l.var(c,!1),o(a)):l.var(c,!0)}Ct.boolOrEmptySchema=i;function o(a,c){const{gen:l,data:d}=a,p={gen:l,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(p,r,void 0,c)}return Ct}var Le={},xt={},mo;function du(){if(mo)return xt;mo=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.getRules=xt.isJSONType=void 0;const t=["string","number","integer","boolean","null","object","array"],e=new Set(t);function n(s){return typeof s=="string"&&e.has(s)}xt.isJSONType=n;function r(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return xt.getRules=r,xt}var ht={},go;function hu(){if(go)return ht;go=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.shouldUseRule=ht.shouldUseGroup=ht.schemaHasRulesForType=void 0;function t({schema:r,self:s},i){const o=s.RULES.types[i];return o&&o!==!0&&e(r,o)}ht.schemaHasRulesForType=t;function e(r,s){return s.rules.some(i=>n(r,i))}ht.shouldUseGroup=e;function n(r,s){var i;return r[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(o=>r[o]!==void 0))}return ht.shouldUseRule=n,ht}var yo;function Hr(){if(yo)return Le;yo=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.reportTypeError=Le.checkDataTypes=Le.checkDataType=Le.coerceAndCheckDataType=Le.getJSONTypes=Le.getSchemaTypes=Le.DataType=void 0;const t=du(),e=hu(),n=us(),r=he(),s=ge();var i;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(i||(Le.DataType=i={}));function o(y){const b=a(y.type);if(b.includes("null")){if(y.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!b.length&&y.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');y.nullable===!0&&b.push("null")}return b}Le.getSchemaTypes=o;function a(y){const b=Array.isArray(y)?y:y?[y]:[];if(b.every(t.isJSONType))return b;throw new Error("type must be JSONType or JSONType[]: "+b.join(","))}Le.getJSONTypes=a;function c(y,b){const{gen:I,data:v,opts:k}=y,A=d(b,k.coerceTypes),T=b.length>0&&!(A.length===0&&b.length===1&&(0,e.schemaHasRulesForType)(y,b[0]));if(T){const L=_(b,v,k.strictNumbers,i.Wrong);I.if(L,()=>{A.length?p(y,b,A):w(y)})}return T}Le.coerceAndCheckDataType=c;const l=new Set(["string","number","integer","boolean","null"]);function d(y,b){return b?y.filter(I=>l.has(I)||b==="array"&&I==="array"):[]}function p(y,b,I){const{gen:v,data:k,opts:A}=y,T=v.let("dataType",(0,r._)`typeof ${k}`),L=v.let("coerced",(0,r._)`undefined`);A.coerceTypes==="array"&&v.if((0,r._)`${T} == 'object' && Array.isArray(${k}) && ${k}.length == 1`,()=>v.assign(k,(0,r._)`${k}[0]`).assign(T,(0,r._)`typeof ${k}`).if(_(b,k,A.strictNumbers),()=>v.assign(L,k))),v.if((0,r._)`${L} !== undefined`);for(const G of I)(l.has(G)||G==="array"&&A.coerceTypes==="array")&&H(G);v.else(),w(y),v.endIf(),v.if((0,r._)`${L} !== undefined`,()=>{v.assign(k,L),h(y,L)});function H(G){switch(G){case"string":v.elseIf((0,r._)`${T} == "number" || ${T} == "boolean"`).assign(L,(0,r._)`"" + ${k}`).elseIf((0,r._)`${k} === null`).assign(L,(0,r._)`""`);return;case"number":v.elseIf((0,r._)`${T} == "boolean" || ${k} === null
|
|
171
|
-
|| (${T} == "string" && ${k} && ${k} == +${k})`).assign(L,(0,r._)`+${k}`);return;case"integer":v.elseIf((0,r._)`${T} === "boolean" || ${k} === null
|
|
172
|
-
|| (${T} === "string" && ${k} && ${k} == +${k} && !(${k} % 1))`).assign(L,(0,r._)`+${k}`);return;case"boolean":v.elseIf((0,r._)`${k} === "false" || ${k} === 0 || ${k} === null`).assign(L,!1).elseIf((0,r._)`${k} === "true" || ${k} === 1`).assign(L,!0);return;case"null":v.elseIf((0,r._)`${k} === "" || ${k} === 0 || ${k} === false`),v.assign(L,null);return;case"array":v.elseIf((0,r._)`${T} === "string" || ${T} === "number"
|
|
173
|
-
|| ${T} === "boolean" || ${k} === null`).assign(L,(0,r._)`[${k}]`)}}}function h({gen:y,parentData:b,parentDataProperty:I},v){y.if((0,r._)`${b} !== undefined`,()=>y.assign((0,r._)`${b}[${I}]`,v))}function m(y,b,I,v=i.Correct){const k=v===i.Correct?r.operators.EQ:r.operators.NEQ;let A;switch(y){case"null":return(0,r._)`${b} ${k} null`;case"array":A=(0,r._)`Array.isArray(${b})`;break;case"object":A=(0,r._)`${b} && typeof ${b} == "object" && !Array.isArray(${b})`;break;case"integer":A=T((0,r._)`!(${b} % 1) && !isNaN(${b})`);break;case"number":A=T();break;default:return(0,r._)`typeof ${b} ${k} ${y}`}return v===i.Correct?A:(0,r.not)(A);function T(L=r.nil){return(0,r.and)((0,r._)`typeof ${b} == "number"`,L,I?(0,r._)`isFinite(${b})`:r.nil)}}Le.checkDataType=m;function _(y,b,I,v){if(y.length===1)return m(y[0],b,I,v);let k;const A=(0,s.toHash)(y);if(A.array&&A.object){const T=(0,r._)`typeof ${b} != "object"`;k=A.null?T:(0,r._)`!${b} || ${T}`,delete A.null,delete A.array,delete A.object}else k=r.nil;A.number&&delete A.integer;for(const T in A)k=(0,r.and)(k,m(T,b,I,v));return k}Le.checkDataTypes=_;const g={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:b})=>typeof y=="string"?(0,r._)`{type: ${y}}`:(0,r._)`{type: ${b}}`};function w(y){const b=$(y);(0,n.reportError)(b,g)}Le.reportTypeError=w;function $(y){const{gen:b,data:I,schema:v}=y,k=(0,s.schemaRefOrVal)(y,v,"type");return{gen:b,keyword:"type",data:I,schema:v.type,schemaCode:k,schemaValue:k,parentSchema:v,params:{},it:y}}return Le}var _n={},wo;function Qg(){if(wo)return _n;wo=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.assignDefaults=void 0;const t=he(),e=ge();function n(s,i){const{properties:o,items:a}=s.schema;if(i==="object"&&o)for(const c in o)r(s,c,o[c].default);else i==="array"&&Array.isArray(a)&&a.forEach((c,l)=>r(s,l,c.default))}_n.assignDefaults=n;function r(s,i,o){const{gen:a,compositeRule:c,data:l,opts:d}=s;if(o===void 0)return;const p=(0,t._)`${l}${(0,t.getProperty)(i)}`;if(c){(0,e.checkStrictMode)(s,`default is ignored for: ${p}`);return}let h=(0,t._)`${p} === undefined`;d.useDefaults==="empty"&&(h=(0,t._)`${h} || ${p} === null || ${p} === ""`),a.if(h,(0,t._)`${p} = ${(0,t.stringify)(o)}`)}return _n}var at={},we={},vo;function lt(){if(vo)return we;vo=1,Object.defineProperty(we,"__esModule",{value:!0}),we.validateUnion=we.validateArray=we.usePattern=we.callValidateCode=we.schemaProperties=we.allSchemaProperties=we.noPropertyInData=we.propertyInData=we.isOwnProperty=we.hasPropFunc=we.reportMissingProp=we.checkMissingProp=we.checkReportMissingProp=void 0;const t=he(),e=ge(),n=Tt(),r=ge();function s(y,b){const{gen:I,data:v,it:k}=y;I.if(d(I,v,b,k.opts.ownProperties),()=>{y.setParams({missingProperty:(0,t._)`${b}`},!0),y.error()})}we.checkReportMissingProp=s;function i({gen:y,data:b,it:{opts:I}},v,k){return(0,t.or)(...v.map(A=>(0,t.and)(d(y,b,A,I.ownProperties),(0,t._)`${k} = ${A}`)))}we.checkMissingProp=i;function o(y,b){y.setParams({missingProperty:b},!0),y.error()}we.reportMissingProp=o;function a(y){return y.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}we.hasPropFunc=a;function c(y,b,I){return(0,t._)`${a(y)}.call(${b}, ${I})`}we.isOwnProperty=c;function l(y,b,I,v){const k=(0,t._)`${b}${(0,t.getProperty)(I)} !== undefined`;return v?(0,t._)`${k} && ${c(y,b,I)}`:k}we.propertyInData=l;function d(y,b,I,v){const k=(0,t._)`${b}${(0,t.getProperty)(I)} === undefined`;return v?(0,t.or)(k,(0,t.not)(c(y,b,I))):k}we.noPropertyInData=d;function p(y){return y?Object.keys(y).filter(b=>b!=="__proto__"):[]}we.allSchemaProperties=p;function h(y,b){return p(b).filter(I=>!(0,e.alwaysValidSchema)(y,b[I]))}we.schemaProperties=h;function m({schemaCode:y,data:b,it:{gen:I,topSchemaRef:v,schemaPath:k,errorPath:A},it:T},L,H,G){const Y=G?(0,t._)`${y}, ${b}, ${v}${k}`:b,se=[[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,A)],[n.default.parentData,T.parentData],[n.default.parentDataProperty,T.parentDataProperty],[n.default.rootData,n.default.rootData]];T.opts.dynamicRef&&se.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const le=(0,t._)`${Y}, ${I.object(...se)}`;return H!==t.nil?(0,t._)`${L}.call(${H}, ${le})`:(0,t._)`${L}(${le})`}we.callValidateCode=m;const _=(0,t._)`new RegExp`;function g({gen:y,it:{opts:b}},I){const v=b.unicodeRegExp?"u":"",{regExp:k}=b.code,A=k(I,v);return y.scopeValue("pattern",{key:A.toString(),ref:A,code:(0,t._)`${k.code==="new RegExp"?_:(0,r.useFunc)(y,k)}(${I}, ${v})`})}we.usePattern=g;function w(y){const{gen:b,data:I,keyword:v,it:k}=y,A=b.name("valid");if(k.allErrors){const L=b.let("valid",!0);return T(()=>b.assign(L,!1)),L}return b.var(A,!0),T(()=>b.break()),A;function T(L){const H=b.const("len",(0,t._)`${I}.length`);b.forRange("i",0,H,G=>{y.subschema({keyword:v,dataProp:G,dataPropType:e.Type.Num},A),b.if((0,t.not)(A),L)})}}we.validateArray=w;function $(y){const{gen:b,schema:I,keyword:v,it:k}=y;if(!Array.isArray(I))throw new Error("ajv implementation error");if(I.some(H=>(0,e.alwaysValidSchema)(k,H))&&!k.opts.unevaluated)return;const T=b.let("valid",!1),L=b.name("_valid");b.block(()=>I.forEach((H,G)=>{const Y=y.subschema({keyword:v,schemaProp:G,compositeRule:!0},L);b.assign(T,(0,t._)`${T} || ${L}`),y.mergeValidEvaluated(Y,L)||b.if((0,t.not)(T))})),y.result(T,()=>y.reset(),()=>y.error(!0))}return we.validateUnion=$,we}var _o;function Xg(){if(_o)return at;_o=1,Object.defineProperty(at,"__esModule",{value:!0}),at.validateKeywordUsage=at.validSchemaType=at.funcKeywordCode=at.macroKeywordCode=void 0;const t=he(),e=Tt(),n=lt(),r=us();function s(h,m){const{gen:_,keyword:g,schema:w,parentSchema:$,it:y}=h,b=m.macro.call(y.self,w,$,y),I=l(_,g,b);y.opts.validateSchema!==!1&&y.self.validateSchema(b,!0);const v=_.name("valid");h.subschema({schema:b,schemaPath:t.nil,errSchemaPath:`${y.errSchemaPath}/${g}`,topSchemaRef:I,compositeRule:!0},v),h.pass(v,()=>h.error(!0))}at.macroKeywordCode=s;function i(h,m){var _;const{gen:g,keyword:w,schema:$,parentSchema:y,$data:b,it:I}=h;c(I,m);const v=!b&&m.compile?m.compile.call(I.self,$,y,I):m.validate,k=l(g,w,v),A=g.let("valid");h.block$data(A,T),h.ok((_=m.valid)!==null&&_!==void 0?_:A);function T(){if(m.errors===!1)G(),m.modifying&&o(h),Y(()=>h.error());else{const se=m.async?L():H();m.modifying&&o(h),Y(()=>a(h,se))}}function L(){const se=g.let("ruleErrs",null);return g.try(()=>G((0,t._)`await `),le=>g.assign(A,!1).if((0,t._)`${le} instanceof ${I.ValidationError}`,()=>g.assign(se,(0,t._)`${le}.errors`),()=>g.throw(le))),se}function H(){const se=(0,t._)`${k}.errors`;return g.assign(se,null),G(t.nil),se}function G(se=m.async?(0,t._)`await `:t.nil){const le=I.opts.passContext?e.default.this:e.default.self,M=!("compile"in m&&!b||m.schema===!1);g.assign(A,(0,t._)`${se}${(0,n.callValidateCode)(h,k,le,M)}`,m.modifying)}function Y(se){var le;g.if((0,t.not)((le=m.valid)!==null&&le!==void 0?le:A),se)}}at.funcKeywordCode=i;function o(h){const{gen:m,data:_,it:g}=h;m.if(g.parentData,()=>m.assign(_,(0,t._)`${g.parentData}[${g.parentDataProperty}]`))}function a(h,m){const{gen:_}=h;_.if((0,t._)`Array.isArray(${m})`,()=>{_.assign(e.default.vErrors,(0,t._)`${e.default.vErrors} === null ? ${m} : ${e.default.vErrors}.concat(${m})`).assign(e.default.errors,(0,t._)`${e.default.vErrors}.length`),(0,r.extendErrors)(h)},()=>h.error())}function c({schemaEnv:h},m){if(m.async&&!h.$async)throw new Error("async keyword in sync schema")}function l(h,m,_){if(_===void 0)throw new Error(`keyword "${m}" failed to compile`);return h.scopeValue("keyword",typeof _=="function"?{ref:_}:{ref:_,code:(0,t.stringify)(_)})}function d(h,m,_=!1){return!m.length||m.some(g=>g==="array"?Array.isArray(h):g==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==g||_&&typeof h>"u")}at.validSchemaType=d;function p({schema:h,opts:m,self:_,errSchemaPath:g},w,$){if(Array.isArray(w.keyword)?!w.keyword.includes($):w.keyword!==$)throw new Error("ajv implementation error");const y=w.dependencies;if(y?.some(b=>!Object.prototype.hasOwnProperty.call(h,b)))throw new Error(`parent schema must have dependencies of ${$}: ${y.join(",")}`);if(w.validateSchema&&!w.validateSchema(h[$])){const I=`keyword "${$}" value is invalid at path "${g}": `+_.errorsText(w.validateSchema.errors);if(m.validateSchema==="log")_.logger.error(I);else throw new Error(I)}}return at.validateKeywordUsage=p,at}var pt={},bo;function ey(){if(bo)return pt;bo=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.extendSubschemaMode=pt.extendSubschemaData=pt.getSubschema=void 0;const t=he(),e=ge();function n(i,{keyword:o,schemaProp:a,schema:c,schemaPath:l,errSchemaPath:d,topSchemaRef:p}){if(o!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const h=i.schema[o];return a===void 0?{schema:h,schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${o}`}:{schema:h[a],schemaPath:(0,t._)`${i.schemaPath}${(0,t.getProperty)(o)}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${o}/${(0,e.escapeFragment)(a)}`}}if(c!==void 0){if(l===void 0||d===void 0||p===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:l,topSchemaRef:p,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}pt.getSubschema=n;function r(i,o,{dataProp:a,dataPropType:c,data:l,dataTypes:d,propertyName:p}){if(l!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=o;if(a!==void 0){const{errorPath:_,dataPathArr:g,opts:w}=o,$=h.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0);m($),i.errorPath=(0,t.str)`${_}${(0,e.getErrorPath)(a,c,w.jsPropertySyntax)}`,i.parentDataProperty=(0,t._)`${a}`,i.dataPathArr=[...g,i.parentDataProperty]}if(l!==void 0){const _=l instanceof t.Name?l:h.let("data",l,!0);m(_),p!==void 0&&(i.propertyName=p)}d&&(i.dataTypes=d);function m(_){i.data=_,i.dataLevel=o.dataLevel+1,i.dataTypes=[],o.definedProperties=new Set,i.parentData=o.data,i.dataNames=[...o.dataNames,_]}}pt.extendSubschemaData=r;function s(i,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:c,createErrors:l,allErrors:d}){c!==void 0&&(i.compositeRule=c),l!==void 0&&(i.createErrors=l),d!==void 0&&(i.allErrors=d),i.jtdDiscriminator=o,i.jtdMetadata=a}return pt.extendSubschemaMode=s,pt}var Je={},As,$o;function pu(){return $o||($o=1,As=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,s,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(s=r;s--!==0;)if(!t(e[s],n[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[s]))return!1;for(s=r;s--!==0;){var o=i[s];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n}),As}var Ns={exports:{}},So;function ty(){if(So)return Ns.exports;So=1;var t=Ns.exports=function(r,s,i){typeof s=="function"&&(i=s,s={}),i=s.cb||i;var o=typeof i=="function"?i:i.pre||function(){},a=i.post||function(){};e(s,o,a,r,"",r)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.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 e(r,s,i,o,a,c,l,d,p,h){if(o&&typeof o=="object"&&!Array.isArray(o)){s(o,a,c,l,d,p,h);for(var m in o){var _=o[m];if(Array.isArray(_)){if(m in t.arrayKeywords)for(var g=0;g<_.length;g++)e(r,s,i,_[g],a+"/"+m+"/"+g,c,a,m,o,g)}else if(m in t.propsKeywords){if(_&&typeof _=="object")for(var w in _)e(r,s,i,_[w],a+"/"+m+"/"+n(w),c,a,m,o,w)}else(m in t.keywords||r.allKeys&&!(m in t.skipKeywords))&&e(r,s,i,_,a+"/"+m,c,a,m,o)}i(o,a,c,l,d,p,h)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return Ns.exports}var Eo;function ls(){if(Eo)return Je;Eo=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.getSchemaRefs=Je.resolveUrl=Je.normalizeId=Je._getFullPath=Je.getFullPath=Je.inlineRef=void 0;const t=ge(),e=pu(),n=ty(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(g,w=!0){return typeof g=="boolean"?!0:w===!0?!o(g):w?a(g)<=w:!1}Je.inlineRef=s;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(g){for(const w in g){if(i.has(w))return!0;const $=g[w];if(Array.isArray($)&&$.some(o)||typeof $=="object"&&o($))return!0}return!1}function a(g){let w=0;for(const $ in g){if($==="$ref")return 1/0;if(w++,!r.has($)&&(typeof g[$]=="object"&&(0,t.eachItem)(g[$],y=>w+=a(y)),w===1/0))return 1/0}return w}function c(g,w="",$){$!==!1&&(w=p(w));const y=g.parse(w);return l(g,y)}Je.getFullPath=c;function l(g,w){return g.serialize(w).split("#")[0]+"#"}Je._getFullPath=l;const d=/#\/?$/;function p(g){return g?g.replace(d,""):""}Je.normalizeId=p;function h(g,w,$){return $=p($),g.resolve(w,$)}Je.resolveUrl=h;const m=/^[a-z_][-a-z0-9._]*$/i;function _(g,w){if(typeof g=="boolean")return{};const{schemaId:$,uriResolver:y}=this.opts,b=p(g[$]||w),I={"":b},v=c(y,b,!1),k={},A=new Set;return n(g,{allKeys:!0},(H,G,Y,se)=>{if(se===void 0)return;const le=v+G;let M=I[se];typeof H[$]=="string"&&(M=W.call(this,H[$])),re.call(this,H.$anchor),re.call(this,H.$dynamicAnchor),I[G]=M;function W(ne){const oe=this.opts.uriResolver.resolve;if(ne=p(M?oe(M,ne):ne),A.has(ne))throw L(ne);A.add(ne);let V=this.refs[ne];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?T(H,V.schema,ne):ne!==p(le)&&(ne[0]==="#"?(T(H,k[ne],ne),k[ne]=H):this.refs[ne]=le),ne}function re(ne){if(typeof ne=="string"){if(!m.test(ne))throw new Error(`invalid anchor "${ne}"`);W.call(this,`#${ne}`)}}}),k;function T(H,G,Y){if(G!==void 0&&!e(H,G))throw L(Y)}function L(H){return new Error(`reference "${H}" resolves to more than one schema`)}}return Je.getSchemaRefs=_,Je}var ko;function fs(){if(ko)return dt;ko=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.getData=dt.KeywordCxt=dt.validateFunctionCode=void 0;const t=Yg(),e=Hr(),n=hu(),r=Hr(),s=Qg(),i=Xg(),o=ey(),a=he(),c=Tt(),l=ls(),d=ge(),p=us();function h(x){if(v(x)&&(A(x),I(x))){w(x);return}m(x,()=>(0,t.topBoolOrEmptySchema)(x))}dt.validateFunctionCode=h;function m({gen:x,validateName:D,schema:q,schemaEnv:J,opts:ee},ae){ee.code.es5?x.func(D,(0,a._)`${c.default.data}, ${c.default.valCxt}`,J.$async,()=>{x.code((0,a._)`"use strict"; ${y(q,ee)}`),g(x,ee),x.code(ae)}):x.func(D,(0,a._)`${c.default.data}, ${_(ee)}`,J.$async,()=>x.code(y(q,ee)).code(ae))}function _(x){return(0,a._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${x.dynamicRef?(0,a._)`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}function g(x,D){x.if(c.default.valCxt,()=>{x.var(c.default.instancePath,(0,a._)`${c.default.valCxt}.${c.default.instancePath}`),x.var(c.default.parentData,(0,a._)`${c.default.valCxt}.${c.default.parentData}`),x.var(c.default.parentDataProperty,(0,a._)`${c.default.valCxt}.${c.default.parentDataProperty}`),x.var(c.default.rootData,(0,a._)`${c.default.valCxt}.${c.default.rootData}`),D.dynamicRef&&x.var(c.default.dynamicAnchors,(0,a._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{x.var(c.default.instancePath,(0,a._)`""`),x.var(c.default.parentData,(0,a._)`undefined`),x.var(c.default.parentDataProperty,(0,a._)`undefined`),x.var(c.default.rootData,c.default.data),D.dynamicRef&&x.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function w(x){const{schema:D,opts:q,gen:J}=x;m(x,()=>{q.$comment&&D.$comment&&se(x),H(x),J.let(c.default.vErrors,null),J.let(c.default.errors,0),q.unevaluated&&$(x),T(x),le(x)})}function $(x){const{gen:D,validateName:q}=x;x.evaluated=D.const("evaluated",(0,a._)`${q}.evaluated`),D.if((0,a._)`${x.evaluated}.dynamicProps`,()=>D.assign((0,a._)`${x.evaluated}.props`,(0,a._)`undefined`)),D.if((0,a._)`${x.evaluated}.dynamicItems`,()=>D.assign((0,a._)`${x.evaluated}.items`,(0,a._)`undefined`))}function y(x,D){const q=typeof x=="object"&&x[D.schemaId];return q&&(D.code.source||D.code.process)?(0,a._)`/*# sourceURL=${q} */`:a.nil}function b(x,D){if(v(x)&&(A(x),I(x))){k(x,D);return}(0,t.boolOrEmptySchema)(x,D)}function I({schema:x,self:D}){if(typeof x=="boolean")return!x;for(const q in x)if(D.RULES.all[q])return!0;return!1}function v(x){return typeof x.schema!="boolean"}function k(x,D){const{schema:q,gen:J,opts:ee}=x;ee.$comment&&q.$comment&&se(x),G(x),Y(x);const ae=J.const("_errs",c.default.errors);T(x,ae),J.var(D,(0,a._)`${ae} === ${c.default.errors}`)}function A(x){(0,d.checkUnknownRules)(x),L(x)}function T(x,D){if(x.opts.jtd)return W(x,[],!1,D);const q=(0,e.getSchemaTypes)(x.schema),J=(0,e.coerceAndCheckDataType)(x,q);W(x,q,!J,D)}function L(x){const{schema:D,errSchemaPath:q,opts:J,self:ee}=x;D.$ref&&J.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(D,ee.RULES)&&ee.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function H(x){const{schema:D,opts:q}=x;D.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,d.checkStrictMode)(x,"default is ignored in the schema root")}function G(x){const D=x.schema[x.opts.schemaId];D&&(x.baseId=(0,l.resolveUrl)(x.opts.uriResolver,x.baseId,D))}function Y(x){if(x.schema.$async&&!x.schemaEnv.$async)throw new Error("async schema in sync schema")}function se({gen:x,schemaEnv:D,schema:q,errSchemaPath:J,opts:ee}){const ae=q.$comment;if(ee.$comment===!0)x.code((0,a._)`${c.default.self}.logger.log(${ae})`);else if(typeof ee.$comment=="function"){const _e=(0,a.str)`${J}/$comment`,Re=x.scopeValue("root",{ref:D.root});x.code((0,a._)`${c.default.self}.opts.$comment(${ae}, ${_e}, ${Re}.schema)`)}}function le(x){const{gen:D,schemaEnv:q,validateName:J,ValidationError:ee,opts:ae}=x;q.$async?D.if((0,a._)`${c.default.errors} === 0`,()=>D.return(c.default.data),()=>D.throw((0,a._)`new ${ee}(${c.default.vErrors})`)):(D.assign((0,a._)`${J}.errors`,c.default.vErrors),ae.unevaluated&&M(x),D.return((0,a._)`${c.default.errors} === 0`))}function M({gen:x,evaluated:D,props:q,items:J}){q instanceof a.Name&&x.assign((0,a._)`${D}.props`,q),J instanceof a.Name&&x.assign((0,a._)`${D}.items`,J)}function W(x,D,q,J){const{gen:ee,schema:ae,data:_e,allErrors:Re,opts:qe,self:Me}=x,{RULES:Te}=Me;if(ae.$ref&&(qe.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(ae,Te))){ee.block(()=>X(x,"$ref",Te.all.$ref.definition));return}qe.jtd||ne(x,D),ee.block(()=>{for(const Ze of Te.rules)Ue(Ze);Ue(Te.post)});function Ue(Ze){(0,n.shouldUseGroup)(ae,Ze)&&(Ze.type?(ee.if((0,r.checkDataType)(Ze.type,_e,qe.strictNumbers)),re(x,Ze),D.length===1&&D[0]===Ze.type&&q&&(ee.else(),(0,r.reportTypeError)(x)),ee.endIf()):re(x,Ze),Re||ee.if((0,a._)`${c.default.errors} === ${J||0}`))}}function re(x,D){const{gen:q,schema:J,opts:{useDefaults:ee}}=x;ee&&(0,s.assignDefaults)(x,D.type),q.block(()=>{for(const ae of D.rules)(0,n.shouldUseRule)(J,ae)&&X(x,ae.keyword,ae.definition,D.type)})}function ne(x,D){x.schemaEnv.meta||!x.opts.strictTypes||(oe(x,D),x.opts.allowUnionTypes||V(x,D),P(x,x.dataTypes))}function oe(x,D){if(D.length){if(!x.dataTypes.length){x.dataTypes=D;return}D.forEach(q=>{B(x.dataTypes,q)||N(x,`type "${q}" not allowed by context "${x.dataTypes.join(",")}"`)}),E(x,D)}}function V(x,D){D.length>1&&!(D.length===2&&D.includes("null"))&&N(x,"use allowUnionTypes to allow union type keyword")}function P(x,D){const q=x.self.RULES.all;for(const J in q){const ee=q[J];if(typeof ee=="object"&&(0,n.shouldUseRule)(x.schema,ee)){const{type:ae}=ee.definition;ae.length&&!ae.some(_e=>j(D,_e))&&N(x,`missing type "${ae.join(",")}" for keyword "${J}"`)}}}function j(x,D){return x.includes(D)||D==="number"&&x.includes("integer")}function B(x,D){return x.includes(D)||D==="integer"&&x.includes("number")}function E(x,D){const q=[];for(const J of x.dataTypes)B(D,J)?q.push(J):D.includes("integer")&&J==="number"&&q.push("integer");x.dataTypes=q}function N(x,D){const q=x.schemaEnv.baseId+x.errSchemaPath;D+=` at "${q}" (strictTypes)`,(0,d.checkStrictMode)(x,D,x.opts.strictTypes)}class F{constructor(D,q,J){if((0,i.validateKeywordUsage)(D,q,J),this.gen=D.gen,this.allErrors=D.allErrors,this.keyword=J,this.data=D.data,this.schema=D.schema[J],this.$data=q.$data&&D.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(D,this.schema,J,this.$data),this.schemaType=q.schemaType,this.parentSchema=D.schema,this.params={},this.it=D,this.def=q,this.$data)this.schemaCode=D.gen.const("vSchema",ie(this.$data,D));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${J} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=D.gen.const("_errs",c.default.errors))}result(D,q,J){this.failResult((0,a.not)(D),q,J)}failResult(D,q,J){this.gen.if(D),J?J():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(D,q){this.failResult((0,a.not)(D),void 0,q)}fail(D){if(D===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(D),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(D){if(!this.$data)return this.fail(D);const{schemaCode:q}=this;this.fail((0,a._)`${q} !== undefined && (${(0,a.or)(this.invalid$data(),D)})`)}error(D,q,J){if(q){this.setParams(q),this._error(D,J),this.setParams({});return}this._error(D,J)}_error(D,q){(D?p.reportExtraError:p.reportError)(this,this.def.error,q)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(D){this.allErrors||this.gen.if(D)}setParams(D,q){q?Object.assign(this.params,D):this.params=D}block$data(D,q,J=a.nil){this.gen.block(()=>{this.check$data(D,J),q()})}check$data(D=a.nil,q=a.nil){if(!this.$data)return;const{gen:J,schemaCode:ee,schemaType:ae,def:_e}=this;J.if((0,a.or)((0,a._)`${ee} === undefined`,q)),D!==a.nil&&J.assign(D,!0),(ae.length||_e.validateSchema)&&(J.elseIf(this.invalid$data()),this.$dataError(),D!==a.nil&&J.assign(D,!1)),J.else()}invalid$data(){const{gen:D,schemaCode:q,schemaType:J,def:ee,it:ae}=this;return(0,a.or)(_e(),Re());function _e(){if(J.length){if(!(q instanceof a.Name))throw new Error("ajv implementation error");const qe=Array.isArray(J)?J:[J];return(0,a._)`${(0,r.checkDataTypes)(qe,q,ae.opts.strictNumbers,r.DataType.Wrong)}`}return a.nil}function Re(){if(ee.validateSchema){const qe=D.scopeValue("validate$data",{ref:ee.validateSchema});return(0,a._)`!${qe}(${q})`}return a.nil}}subschema(D,q){const J=(0,o.getSubschema)(this.it,D);(0,o.extendSubschemaData)(J,this.it,D),(0,o.extendSubschemaMode)(J,D);const ee={...this.it,...J,items:void 0,props:void 0};return b(ee,q),ee}mergeEvaluated(D,q){const{it:J,gen:ee}=this;J.opts.unevaluated&&(J.props!==!0&&D.props!==void 0&&(J.props=d.mergeEvaluated.props(ee,D.props,J.props,q)),J.items!==!0&&D.items!==void 0&&(J.items=d.mergeEvaluated.items(ee,D.items,J.items,q)))}mergeValidEvaluated(D,q){const{it:J,gen:ee}=this;if(J.opts.unevaluated&&(J.props!==!0||J.items!==!0))return ee.if(q,()=>this.mergeEvaluated(D,a.Name)),!0}}dt.KeywordCxt=F;function X(x,D,q,J){const ee=new F(x,q,D);"code"in q?q.code(ee,J):ee.$data&&q.validate?(0,i.funcKeywordCode)(ee,q):"macro"in q?(0,i.macroKeywordCode)(ee,q):(q.compile||q.validate)&&(0,i.funcKeywordCode)(ee,q)}const Q=/^\/(?:[^~]|~0|~1)*$/,fe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ie(x,{dataLevel:D,dataNames:q,dataPathArr:J}){let ee,ae;if(x==="")return c.default.rootData;if(x[0]==="/"){if(!Q.test(x))throw new Error(`Invalid JSON-pointer: ${x}`);ee=x,ae=c.default.rootData}else{const Me=fe.exec(x);if(!Me)throw new Error(`Invalid JSON-pointer: ${x}`);const Te=+Me[1];if(ee=Me[2],ee==="#"){if(Te>=D)throw new Error(qe("property/index",Te));return J[D-Te]}if(Te>D)throw new Error(qe("data",Te));if(ae=q[D-Te],!ee)return ae}let _e=ae;const Re=ee.split("/");for(const Me of Re)Me&&(ae=(0,a._)`${ae}${(0,a.getProperty)((0,d.unescapeJsonPointer)(Me))}`,_e=(0,a._)`${_e} && ${ae}`);return _e;function qe(Me,Te){return`Cannot access ${Me} ${Te} levels up, current level is ${D}`}}return dt.getData=ie,dt}var Qn={},Io;function yi(){if(Io)return Qn;Io=1,Object.defineProperty(Qn,"__esModule",{value:!0});class t extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Qn.default=t,Qn}var Xn={},Oo;function ds(){if(Oo)return Xn;Oo=1,Object.defineProperty(Xn,"__esModule",{value:!0});const t=ls();class e extends Error{constructor(r,s,i,o){super(o||`can't resolve reference ${i} from id ${s}`),this.missingRef=(0,t.resolveUrl)(r,s,i),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(r,this.missingRef))}}return Xn.default=e,Xn}var et={},Ao;function wi(){if(Ao)return et;Ao=1,Object.defineProperty(et,"__esModule",{value:!0}),et.resolveSchema=et.getCompilingSchema=et.resolveRef=et.compileSchema=et.SchemaEnv=void 0;const t=he(),e=yi(),n=Tt(),r=ls(),s=ge(),i=fs();class o{constructor($){var y;this.refs={},this.dynamicAnchors={};let b;typeof $.schema=="object"&&(b=$.schema),this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(y=$.baseId)!==null&&y!==void 0?y:(0,r.normalizeId)(b?.[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=b?.$async,this.refs={}}}et.SchemaEnv=o;function a(w){const $=d.call(this,w);if($)return $;const y=(0,r.getFullPath)(this.opts.uriResolver,w.root.baseId),{es5:b,lines:I}=this.opts.code,{ownProperties:v}=this.opts,k=new t.CodeGen(this.scope,{es5:b,lines:I,ownProperties:v});let A;w.$async&&(A=k.scopeValue("Error",{ref:e.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));const T=k.scopeName("validate");w.validateName=T;const L={gen:k,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:k.scopeValue("schema",this.opts.code.source===!0?{ref:w.schema,code:(0,t.stringify)(w.schema)}:{ref:w.schema}),validateName:T,ValidationError:A,schema:w.schema,schemaEnv:w,rootId:y,baseId:w.baseId||y,schemaPath:t.nil,errSchemaPath:w.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};let H;try{this._compilations.add(w),(0,i.validateFunctionCode)(L),k.optimize(this.opts.code.optimize);const G=k.toString();H=`${k.scopeRefs(n.default.scope)}return ${G}`,this.opts.code.process&&(H=this.opts.code.process(H,w));const se=new Function(`${n.default.self}`,`${n.default.scope}`,H)(this,this.scope.get());if(this.scope.value(T,{ref:se}),se.errors=null,se.schema=w.schema,se.schemaEnv=w,w.$async&&(se.$async=!0),this.opts.code.source===!0&&(se.source={validateName:T,validateCode:G,scopeValues:k._values}),this.opts.unevaluated){const{props:le,items:M}=L;se.evaluated={props:le instanceof t.Name?void 0:le,items:M instanceof t.Name?void 0:M,dynamicProps:le instanceof t.Name,dynamicItems:M instanceof t.Name},se.source&&(se.source.evaluated=(0,t.stringify)(se.evaluated))}return w.validate=se,w}catch(G){throw delete w.validate,delete w.validateName,H&&this.logger.error("Error compiling schema, function code:",H),G}finally{this._compilations.delete(w)}}et.compileSchema=a;function c(w,$,y){var b;y=(0,r.resolveUrl)(this.opts.uriResolver,$,y);const I=w.refs[y];if(I)return I;let v=h.call(this,w,y);if(v===void 0){const k=(b=w.localRefs)===null||b===void 0?void 0:b[y],{schemaId:A}=this.opts;k&&(v=new o({schema:k,schemaId:A,root:w,baseId:$}))}if(v!==void 0)return w.refs[y]=l.call(this,v)}et.resolveRef=c;function l(w){return(0,r.inlineRef)(w.schema,this.opts.inlineRefs)?w.schema:w.validate?w:a.call(this,w)}function d(w){for(const $ of this._compilations)if(p($,w))return $}et.getCompilingSchema=d;function p(w,$){return w.schema===$.schema&&w.root===$.root&&w.baseId===$.baseId}function h(w,$){let y;for(;typeof(y=this.refs[$])=="string";)$=y;return y||this.schemas[$]||m.call(this,w,$)}function m(w,$){const y=this.opts.uriResolver.parse($),b=(0,r._getFullPath)(this.opts.uriResolver,y);let I=(0,r.getFullPath)(this.opts.uriResolver,w.baseId,void 0);if(Object.keys(w.schema).length>0&&b===I)return g.call(this,y,w);const v=(0,r.normalizeId)(b),k=this.refs[v]||this.schemas[v];if(typeof k=="string"){const A=m.call(this,w,k);return typeof A?.schema!="object"?void 0:g.call(this,y,A)}if(typeof k?.schema=="object"){if(k.validate||a.call(this,k),v===(0,r.normalizeId)($)){const{schema:A}=k,{schemaId:T}=this.opts,L=A[T];return L&&(I=(0,r.resolveUrl)(this.opts.uriResolver,I,L)),new o({schema:A,schemaId:T,root:w,baseId:I})}return g.call(this,y,k)}}et.resolveSchema=m;const _=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(w,{baseId:$,schema:y,root:b}){var I;if(((I=w.fragment)===null||I===void 0?void 0:I[0])!=="/")return;for(const A of w.fragment.slice(1).split("/")){if(typeof y=="boolean")return;const T=y[(0,s.unescapeFragment)(A)];if(T===void 0)return;y=T;const L=typeof y=="object"&&y[this.opts.schemaId];!_.has(A)&&L&&($=(0,r.resolveUrl)(this.opts.uriResolver,$,L))}let v;if(typeof y!="boolean"&&y.$ref&&!(0,s.schemaHasRulesButRef)(y,this.RULES)){const A=(0,r.resolveUrl)(this.opts.uriResolver,$,y.$ref);v=m.call(this,b,A)}const{schemaId:k}=this.opts;if(v=v||new o({schema:y,schemaId:k,root:b,baseId:$}),v.schema!==v.root.schema)return v}return et}const ny="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",ry="Meta-schema for $data reference (JSON AnySchema extension proposal)",sy="object",iy=["$data"],oy={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ay=!1;var cy={$id:ny,description:ry,type:sy,required:iy,properties:oy,additionalProperties:ay},er={},bn={exports:{}},Ts,No;function mu(){if(No)return Ts;No=1;const t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),e=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(h){let m="",_=0,g=0;for(g=0;g<h.length;g++)if(_=h[g].charCodeAt(0),_!==48){if(!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";m+=h[g];break}for(g+=1;g<h.length;g++){if(_=h[g].charCodeAt(0),!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";m+=h[g]}return m}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(h){return h.length=0,!0}function i(h,m,_){if(h.length){const g=n(h);if(g!=="")m.push(g);else return _.error=!0,!1;h.length=0}return!0}function o(h){let m=0;const _={error:!1,address:"",zone:""},g=[],w=[];let $=!1,y=!1,b=i;for(let I=0;I<h.length;I++){const v=h[I];if(!(v==="["||v==="]"))if(v===":"){if($===!0&&(y=!0),!b(w,g,_))break;if(++m>7){_.error=!0;break}I>0&&h[I-1]===":"&&($=!0),g.push(":");continue}else if(v==="%"){if(!b(w,g,_))break;b=s}else{w.push(v);continue}}return w.length&&(b===s?_.zone=w.join(""):y?g.push(w.join("")):g.push(n(w))),_.address=g.join(""),_}function a(h){if(c(h,":")<2)return{host:h,isIPV6:!1};const m=o(h);if(m.error)return{host:h,isIPV6:!1};{let _=m.address,g=m.address;return m.zone&&(_+="%"+m.zone,g+="%25"+m.zone),{host:_,isIPV6:!0,escapedHost:g}}}function c(h,m){let _=0;for(let g=0;g<h.length;g++)h[g]===m&&_++;return _}function l(h){let m=h;const _=[];let g=-1,w=0;for(;w=m.length;){if(w===1){if(m===".")break;if(m==="/"){_.push("/");break}else{_.push(m);break}}else if(w===2){if(m[0]==="."){if(m[1]===".")break;if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&(m[1]==="."||m[1]==="/")){_.push("/");break}}else if(w===3&&m==="/.."){_.length!==0&&_.pop(),_.push("/");break}if(m[0]==="."){if(m[1]==="."){if(m[2]==="/"){m=m.slice(3);continue}}else if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&m[1]==="."){if(m[2]==="/"){m=m.slice(2);continue}else if(m[2]==="."&&m[3]==="/"){m=m.slice(3),_.length!==0&&_.pop();continue}}if((g=m.indexOf("/",1))===-1){_.push(m);break}else _.push(m.slice(0,g)),m=m.slice(g)}return _.join("")}function d(h,m){const _=m!==!0?escape:unescape;return h.scheme!==void 0&&(h.scheme=_(h.scheme)),h.userinfo!==void 0&&(h.userinfo=_(h.userinfo)),h.host!==void 0&&(h.host=_(h.host)),h.path!==void 0&&(h.path=_(h.path)),h.query!==void 0&&(h.query=_(h.query)),h.fragment!==void 0&&(h.fragment=_(h.fragment)),h}function p(h){const m=[];if(h.userinfo!==void 0&&(m.push(h.userinfo),m.push("@")),h.host!==void 0){let _=unescape(h.host);if(!e(_)){const g=a(_);g.isIPV6===!0?_=`[${g.escapedHost}]`:_=h.host}m.push(_)}return(typeof h.port=="number"||typeof h.port=="string")&&(m.push(":"),m.push(String(h.port))),m.length?m.join(""):void 0}return Ts={nonSimpleDomain:r,recomposeAuthority:p,normalizeComponentEncoding:d,removeDotSegments:l,isIPv4:e,isUUID:t,normalizeIPv6:a,stringArrayToHexStripped:n},Ts}var Ps,To;function uy(){if(To)return Ps;To=1;const{isUUID:t}=mu(),e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(v){return n.indexOf(v)!==-1}function s(v){return v.secure===!0?!0:v.secure===!1?!1:v.scheme?v.scheme.length===3&&(v.scheme[0]==="w"||v.scheme[0]==="W")&&(v.scheme[1]==="s"||v.scheme[1]==="S")&&(v.scheme[2]==="s"||v.scheme[2]==="S"):!1}function i(v){return v.host||(v.error=v.error||"HTTP URIs must have a host."),v}function o(v){const k=String(v.scheme).toLowerCase()==="https";return(v.port===(k?443:80)||v.port==="")&&(v.port=void 0),v.path||(v.path="/"),v}function a(v){return v.secure=s(v),v.resourceName=(v.path||"/")+(v.query?"?"+v.query:""),v.path=void 0,v.query=void 0,v}function c(v){if((v.port===(s(v)?443:80)||v.port==="")&&(v.port=void 0),typeof v.secure=="boolean"&&(v.scheme=v.secure?"wss":"ws",v.secure=void 0),v.resourceName){const[k,A]=v.resourceName.split("?");v.path=k&&k!=="/"?k:void 0,v.query=A,v.resourceName=void 0}return v.fragment=void 0,v}function l(v,k){if(!v.path)return v.error="URN can not be parsed",v;const A=v.path.match(e);if(A){const T=k.scheme||v.scheme||"urn";v.nid=A[1].toLowerCase(),v.nss=A[2];const L=`${T}:${k.nid||v.nid}`,H=I(L);v.path=void 0,H&&(v=H.parse(v,k))}else v.error=v.error||"URN can not be parsed.";return v}function d(v,k){if(v.nid===void 0)throw new Error("URN without nid cannot be serialized");const A=k.scheme||v.scheme||"urn",T=v.nid.toLowerCase(),L=`${A}:${k.nid||T}`,H=I(L);H&&(v=H.serialize(v,k));const G=v,Y=v.nss;return G.path=`${T||k.nid}:${Y}`,k.skipEscape=!0,G}function p(v,k){const A=v;return A.uuid=A.nss,A.nss=void 0,!k.tolerant&&(!A.uuid||!t(A.uuid))&&(A.error=A.error||"UUID is not valid."),A}function h(v){const k=v;return k.nss=(v.uuid||"").toLowerCase(),k}const m={scheme:"http",domainHost:!0,parse:i,serialize:o},_={scheme:"https",domainHost:m.domainHost,parse:i,serialize:o},g={scheme:"ws",domainHost:!0,parse:a,serialize:c},w={scheme:"wss",domainHost:g.domainHost,parse:g.parse,serialize:g.serialize},b={http:m,https:_,ws:g,wss:w,urn:{scheme:"urn",parse:l,serialize:d,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:p,serialize:h,skipNormalize:!0}};Object.setPrototypeOf(b,null);function I(v){return v&&(b[v]||b[v.toLowerCase()])||void 0}return Ps={wsIsSecure:s,SCHEMES:b,isValidSchemeName:r,getSchemeHandler:I},Ps}var Po;function ly(){if(Po)return bn.exports;Po=1;const{normalizeIPv6:t,removeDotSegments:e,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:s,nonSimpleDomain:i}=mu(),{SCHEMES:o,getSchemeHandler:a}=uy();function c(w,$){return typeof w=="string"?w=h(_(w,$),$):typeof w=="object"&&(w=_(h(w,$),$)),w}function l(w,$,y){const b=y?Object.assign({scheme:"null"},y):{scheme:"null"},I=d(_(w,b),_($,b),b,!0);return b.skipEscape=!0,h(I,b)}function d(w,$,y,b){const I={};return b||(w=_(h(w,y),y),$=_(h($,y),y)),y=y||{},!y.tolerant&&$.scheme?(I.scheme=$.scheme,I.userinfo=$.userinfo,I.host=$.host,I.port=$.port,I.path=e($.path||""),I.query=$.query):($.userinfo!==void 0||$.host!==void 0||$.port!==void 0?(I.userinfo=$.userinfo,I.host=$.host,I.port=$.port,I.path=e($.path||""),I.query=$.query):($.path?($.path[0]==="/"?I.path=e($.path):((w.userinfo!==void 0||w.host!==void 0||w.port!==void 0)&&!w.path?I.path="/"+$.path:w.path?I.path=w.path.slice(0,w.path.lastIndexOf("/")+1)+$.path:I.path=$.path,I.path=e(I.path)),I.query=$.query):(I.path=w.path,$.query!==void 0?I.query=$.query:I.query=w.query),I.userinfo=w.userinfo,I.host=w.host,I.port=w.port),I.scheme=w.scheme),I.fragment=$.fragment,I}function p(w,$,y){return typeof w=="string"?(w=unescape(w),w=h(r(_(w,y),!0),{...y,skipEscape:!0})):typeof w=="object"&&(w=h(r(w,!0),{...y,skipEscape:!0})),typeof $=="string"?($=unescape($),$=h(r(_($,y),!0),{...y,skipEscape:!0})):typeof $=="object"&&($=h(r($,!0),{...y,skipEscape:!0})),w.toLowerCase()===$.toLowerCase()}function h(w,$){const y={host:w.host,scheme:w.scheme,userinfo:w.userinfo,port:w.port,path:w.path,query:w.query,nid:w.nid,nss:w.nss,uuid:w.uuid,fragment:w.fragment,reference:w.reference,resourceName:w.resourceName,secure:w.secure,error:""},b=Object.assign({},$),I=[],v=a(b.scheme||y.scheme);v&&v.serialize&&v.serialize(y,b),y.path!==void 0&&(b.skipEscape?y.path=unescape(y.path):(y.path=escape(y.path),y.scheme!==void 0&&(y.path=y.path.split("%3A").join(":")))),b.reference!=="suffix"&&y.scheme&&I.push(y.scheme,":");const k=n(y);if(k!==void 0&&(b.reference!=="suffix"&&I.push("//"),I.push(k),y.path&&y.path[0]!=="/"&&I.push("/")),y.path!==void 0){let A=y.path;!b.absolutePath&&(!v||!v.absolutePath)&&(A=e(A)),k===void 0&&A[0]==="/"&&A[1]==="/"&&(A="/%2F"+A.slice(2)),I.push(A)}return y.query!==void 0&&I.push("?",y.query),y.fragment!==void 0&&I.push("#",y.fragment),I.join("")}const m=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function _(w,$){const y=Object.assign({},$),b={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let I=!1;y.reference==="suffix"&&(y.scheme?w=y.scheme+":"+w:w="//"+w);const v=w.match(m);if(v){if(b.scheme=v[1],b.userinfo=v[3],b.host=v[4],b.port=parseInt(v[5],10),b.path=v[6]||"",b.query=v[7],b.fragment=v[8],isNaN(b.port)&&(b.port=v[5]),b.host)if(s(b.host)===!1){const T=t(b.host);b.host=T.host.toLowerCase(),I=T.isIPV6}else I=!0;b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&b.query===void 0&&!b.path?b.reference="same-document":b.scheme===void 0?b.reference="relative":b.fragment===void 0?b.reference="absolute":b.reference="uri",y.reference&&y.reference!=="suffix"&&y.reference!==b.reference&&(b.error=b.error||"URI is not a "+y.reference+" reference.");const k=a(y.scheme||b.scheme);if(!y.unicodeSupport&&(!k||!k.unicodeSupport)&&b.host&&(y.domainHost||k&&k.domainHost)&&I===!1&&i(b.host))try{b.host=URL.domainToASCII(b.host.toLowerCase())}catch(A){b.error=b.error||"Host's domain name can not be converted to ASCII: "+A}(!k||k&&!k.skipNormalize)&&(w.indexOf("%")!==-1&&(b.scheme!==void 0&&(b.scheme=unescape(b.scheme)),b.host!==void 0&&(b.host=unescape(b.host))),b.path&&(b.path=escape(unescape(b.path))),b.fragment&&(b.fragment=encodeURI(decodeURIComponent(b.fragment)))),k&&k.parse&&k.parse(b,y)}else b.error=b.error||"URI can not be parsed.";return b}const g={SCHEMES:o,normalize:c,resolve:l,resolveComponent:d,equal:p,serialize:h,parse:_};return bn.exports=g,bn.exports.default=g,bn.exports.fastUri=g,bn.exports}var Co;function fy(){if(Co)return er;Co=1,Object.defineProperty(er,"__esModule",{value:!0});const t=ly();return t.code='require("ajv/dist/runtime/uri").default',er.default=t,er}var xo;function dy(){return xo||(xo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=fs();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var n=he();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=yi(),s=ds(),i=du(),o=wi(),a=he(),c=ls(),l=Hr(),d=ge(),p=cy,h=fy(),m=(V,P)=>new RegExp(V,P);m.code="new RegExp";const _=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},$={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},y=200;function b(V){var P,j,B,E,N,F,X,Q,fe,ie,x,D,q,J,ee,ae,_e,Re,qe,Me,Te,Ue,Ze,mn,tt;const Pt=V.strict,S=(P=V.code)===null||P===void 0?void 0:P.optimize,u=S===!0||S===void 0?1:S||0,f=(B=(j=V.code)===null||j===void 0?void 0:j.regExp)!==null&&B!==void 0?B:m,O=(E=V.uriResolver)!==null&&E!==void 0?E:h.default;return{strictSchema:(F=(N=V.strictSchema)!==null&&N!==void 0?N:Pt)!==null&&F!==void 0?F:!0,strictNumbers:(Q=(X=V.strictNumbers)!==null&&X!==void 0?X:Pt)!==null&&Q!==void 0?Q:!0,strictTypes:(ie=(fe=V.strictTypes)!==null&&fe!==void 0?fe:Pt)!==null&&ie!==void 0?ie:"log",strictTuples:(D=(x=V.strictTuples)!==null&&x!==void 0?x:Pt)!==null&&D!==void 0?D:"log",strictRequired:(J=(q=V.strictRequired)!==null&&q!==void 0?q:Pt)!==null&&J!==void 0?J:!1,code:V.code?{...V.code,optimize:u,regExp:f}:{optimize:u,regExp:f},loopRequired:(ee=V.loopRequired)!==null&&ee!==void 0?ee:y,loopEnum:(ae=V.loopEnum)!==null&&ae!==void 0?ae:y,meta:(_e=V.meta)!==null&&_e!==void 0?_e:!0,messages:(Re=V.messages)!==null&&Re!==void 0?Re:!0,inlineRefs:(qe=V.inlineRefs)!==null&&qe!==void 0?qe:!0,schemaId:(Me=V.schemaId)!==null&&Me!==void 0?Me:"$id",addUsedSchema:(Te=V.addUsedSchema)!==null&&Te!==void 0?Te:!0,validateSchema:(Ue=V.validateSchema)!==null&&Ue!==void 0?Ue:!0,validateFormats:(Ze=V.validateFormats)!==null&&Ze!==void 0?Ze:!0,unicodeRegExp:(mn=V.unicodeRegExp)!==null&&mn!==void 0?mn:!0,int32range:(tt=V.int32range)!==null&&tt!==void 0?tt:!0,uriResolver:O}}class I{constructor(P={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,P=this.opts={...P,...b(P)};const{es5:j,lines:B}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:g,es5:j,lines:B}),this.logger=Y(P.logger);const E=P.validateFormats;P.validateFormats=!1,this.RULES=(0,i.getRules)(),v.call(this,w,P,"NOT SUPPORTED"),v.call(this,$,P,"DEPRECATED","warn"),this._metaOpts=H.call(this),P.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),P.keywords&&L.call(this,P.keywords),typeof P.meta=="object"&&this.addMetaSchema(P.meta),A.call(this),P.validateFormats=E}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:P,meta:j,schemaId:B}=this.opts;let E=p;B==="id"&&(E={...p},E.id=E.$id,delete E.$id),j&&P&&this.addMetaSchema(E,E[B],!1)}defaultMeta(){const{meta:P,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof P=="object"?P[j]||P:void 0}validate(P,j){let B;if(typeof P=="string"){if(B=this.getSchema(P),!B)throw new Error(`no schema with key or ref "${P}"`)}else B=this.compile(P);const E=B(j);return"$async"in B||(this.errors=B.errors),E}compile(P,j){const B=this._addSchema(P,j);return B.validate||this._compileSchemaEnv(B)}compileAsync(P,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:B}=this.opts;return E.call(this,P,j);async function E(ie,x){await N.call(this,ie.$schema);const D=this._addSchema(ie,x);return D.validate||F.call(this,D)}async function N(ie){ie&&!this.getSchema(ie)&&await E.call(this,{$ref:ie},!0)}async function F(ie){try{return this._compileSchemaEnv(ie)}catch(x){if(!(x instanceof s.default))throw x;return X.call(this,x),await Q.call(this,x.missingSchema),F.call(this,ie)}}function X({missingSchema:ie,missingRef:x}){if(this.refs[ie])throw new Error(`AnySchema ${ie} is loaded but ${x} cannot be resolved`)}async function Q(ie){const x=await fe.call(this,ie);this.refs[ie]||await N.call(this,x.$schema),this.refs[ie]||this.addSchema(x,ie,j)}async function fe(ie){const x=this._loading[ie];if(x)return x;try{return await(this._loading[ie]=B(ie))}finally{delete this._loading[ie]}}}addSchema(P,j,B,E=this.opts.validateSchema){if(Array.isArray(P)){for(const F of P)this.addSchema(F,void 0,B,E);return this}let N;if(typeof P=="object"){const{schemaId:F}=this.opts;if(N=P[F],N!==void 0&&typeof N!="string")throw new Error(`schema ${F} must be string`)}return j=(0,c.normalizeId)(j||N),this._checkUnique(j),this.schemas[j]=this._addSchema(P,B,j,E,!0),this}addMetaSchema(P,j,B=this.opts.validateSchema){return this.addSchema(P,j,!0,B),this}validateSchema(P,j){if(typeof P=="boolean")return!0;let B;if(B=P.$schema,B!==void 0&&typeof B!="string")throw new Error("$schema must be a string");if(B=B||this.opts.defaultMeta||this.defaultMeta(),!B)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const E=this.validate(B,P);if(!E&&j){const N="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(N);else throw new Error(N)}return E}getSchema(P){let j;for(;typeof(j=k.call(this,P))=="string";)P=j;if(j===void 0){const{schemaId:B}=this.opts,E=new o.SchemaEnv({schema:{},schemaId:B});if(j=o.resolveSchema.call(this,E,P),!j)return;this.refs[P]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(P){if(P instanceof RegExp)return this._removeAllSchemas(this.schemas,P),this._removeAllSchemas(this.refs,P),this;switch(typeof P){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const j=k.call(this,P);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[P],delete this.refs[P],this}case"object":{const j=P;this._cache.delete(j);let B=P[this.opts.schemaId];return B&&(B=(0,c.normalizeId)(B),delete this.schemas[B],delete this.refs[B]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(P){for(const j of P)this.addKeyword(j);return this}addKeyword(P,j){let B;if(typeof P=="string")B=P,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=B);else if(typeof P=="object"&&j===void 0){if(j=P,B=j.keyword,Array.isArray(B)&&!B.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(le.call(this,B,j),!j)return(0,d.eachItem)(B,N=>M.call(this,N)),this;re.call(this,j);const E={...j,type:(0,l.getJSONTypes)(j.type),schemaType:(0,l.getJSONTypes)(j.schemaType)};return(0,d.eachItem)(B,E.type.length===0?N=>M.call(this,N,E):N=>E.type.forEach(F=>M.call(this,N,E,F))),this}getKeyword(P){const j=this.RULES.all[P];return typeof j=="object"?j.definition:!!j}removeKeyword(P){const{RULES:j}=this;delete j.keywords[P],delete j.all[P];for(const B of j.rules){const E=B.rules.findIndex(N=>N.keyword===P);E>=0&&B.rules.splice(E,1)}return this}addFormat(P,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[P]=j,this}errorsText(P=this.errors,{separator:j=", ",dataVar:B="data"}={}){return!P||P.length===0?"No errors":P.map(E=>`${B}${E.instancePath} ${E.message}`).reduce((E,N)=>E+j+N)}$dataMetaSchema(P,j){const B=this.RULES.all;P=JSON.parse(JSON.stringify(P));for(const E of j){const N=E.split("/").slice(1);let F=P;for(const X of N)F=F[X];for(const X in B){const Q=B[X];if(typeof Q!="object")continue;const{$data:fe}=Q.definition,ie=F[X];fe&&ie&&(F[X]=oe(ie))}}return P}_removeAllSchemas(P,j){for(const B in P){const E=P[B];(!j||j.test(B))&&(typeof E=="string"?delete P[B]:E&&!E.meta&&(this._cache.delete(E.schema),delete P[B]))}}_addSchema(P,j,B,E=this.opts.validateSchema,N=this.opts.addUsedSchema){let F;const{schemaId:X}=this.opts;if(typeof P=="object")F=P[X];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof P!="boolean")throw new Error("schema must be object or boolean")}let Q=this._cache.get(P);if(Q!==void 0)return Q;B=(0,c.normalizeId)(F||B);const fe=c.getSchemaRefs.call(this,P,B);return Q=new o.SchemaEnv({schema:P,schemaId:X,meta:j,baseId:B,localRefs:fe}),this._cache.set(Q.schema,Q),N&&!B.startsWith("#")&&(B&&this._checkUnique(B),this.refs[B]=Q),E&&this.validateSchema(P,!0),Q}_checkUnique(P){if(this.schemas[P]||this.refs[P])throw new Error(`schema with key or id "${P}" already exists`)}_compileSchemaEnv(P){if(P.meta?this._compileMetaSchema(P):o.compileSchema.call(this,P),!P.validate)throw new Error("ajv implementation error");return P.validate}_compileMetaSchema(P){const j=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,P)}finally{this.opts=j}}}I.ValidationError=r.default,I.MissingRefError=s.default,t.default=I;function v(V,P,j,B="error"){for(const E in V){const N=E;N in P&&this.logger[B](`${j}: option ${E}. ${V[N]}`)}}function k(V){return V=(0,c.normalizeId)(V),this.schemas[V]||this.refs[V]}function A(){const V=this.opts.schemas;if(V)if(Array.isArray(V))this.addSchema(V);else for(const P in V)this.addSchema(V[P],P)}function T(){for(const V in this.opts.formats){const P=this.opts.formats[V];P&&this.addFormat(V,P)}}function L(V){if(Array.isArray(V)){this.addVocabulary(V);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const P in V){const j=V[P];j.keyword||(j.keyword=P),this.addKeyword(j)}}function H(){const V={...this.opts};for(const P of _)delete V[P];return V}const G={log(){},warn(){},error(){}};function Y(V){if(V===!1)return G;if(V===void 0)return console;if(V.log&&V.warn&&V.error)return V;throw new Error("logger must implement log, warn and error methods")}const se=/^[a-z_$][a-z0-9_$:-]*$/i;function le(V,P){const{RULES:j}=this;if((0,d.eachItem)(V,B=>{if(j.keywords[B])throw new Error(`Keyword ${B} is already defined`);if(!se.test(B))throw new Error(`Keyword ${B} has invalid name`)}),!!P&&P.$data&&!("code"in P||"validate"in P))throw new Error('$data keyword must have "code" or "validate" function')}function M(V,P,j){var B;const E=P?.post;if(j&&E)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:N}=this;let F=E?N.post:N.rules.find(({type:Q})=>Q===j);if(F||(F={type:j,rules:[]},N.rules.push(F)),N.keywords[V]=!0,!P)return;const X={keyword:V,definition:{...P,type:(0,l.getJSONTypes)(P.type),schemaType:(0,l.getJSONTypes)(P.schemaType)}};P.before?W.call(this,F,X,P.before):F.rules.push(X),N.all[V]=X,(B=P.implements)===null||B===void 0||B.forEach(Q=>this.addKeyword(Q))}function W(V,P,j){const B=V.rules.findIndex(E=>E.keyword===j);B>=0?V.rules.splice(B,0,P):(V.rules.push(P),this.logger.warn(`rule ${j} is not defined`))}function re(V){let{metaSchema:P}=V;P!==void 0&&(V.$data&&this.opts.$data&&(P=oe(P)),V.validateSchema=this.compile(P,!0))}const ne={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function oe(V){return{anyOf:[V,ne]}}})(Ss)),Ss}var tr={},nr={},rr={},Bo;function hy(){if(Bo)return rr;Bo=1,Object.defineProperty(rr,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return rr.default=t,rr}var bt={},Do;function py(){if(Do)return bt;Do=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.callRef=bt.getValidate=void 0;const t=ds(),e=lt(),n=he(),r=Tt(),s=wi(),i=ge(),o={keyword:"$ref",schemaType:"string",code(l){const{gen:d,schema:p,it:h}=l,{baseId:m,schemaEnv:_,validateName:g,opts:w,self:$}=h,{root:y}=_;if((p==="#"||p==="#/")&&m===y.baseId)return I();const b=s.resolveRef.call($,y,m,p);if(b===void 0)throw new t.default(h.opts.uriResolver,m,p);if(b instanceof s.SchemaEnv)return v(b);return k(b);function I(){if(_===y)return c(l,g,_,_.$async);const A=d.scopeValue("root",{ref:y});return c(l,(0,n._)`${A}.validate`,y,y.$async)}function v(A){const T=a(l,A);c(l,T,A,A.$async)}function k(A){const T=d.scopeValue("schema",w.code.source===!0?{ref:A,code:(0,n.stringify)(A)}:{ref:A}),L=d.name("valid"),H=l.subschema({schema:A,dataTypes:[],schemaPath:n.nil,topSchemaRef:T,errSchemaPath:p},L);l.mergeEvaluated(H),l.ok(L)}}};function a(l,d){const{gen:p}=l;return d.validate?p.scopeValue("validate",{ref:d.validate}):(0,n._)`${p.scopeValue("wrapper",{ref:d})}.validate`}bt.getValidate=a;function c(l,d,p,h){const{gen:m,it:_}=l,{allErrors:g,schemaEnv:w,opts:$}=_,y=$.passContext?r.default.this:n.nil;h?b():I();function b(){if(!w.$async)throw new Error("async schema referenced by sync schema");const A=m.let("valid");m.try(()=>{m.code((0,n._)`await ${(0,e.callValidateCode)(l,d,y)}`),k(d),g||m.assign(A,!0)},T=>{m.if((0,n._)`!(${T} instanceof ${_.ValidationError})`,()=>m.throw(T)),v(T),g||m.assign(A,!1)}),l.ok(A)}function I(){l.result((0,e.callValidateCode)(l,d,y),()=>k(d),()=>v(d))}function v(A){const T=(0,n._)`${A}.errors`;m.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${T} : ${r.default.vErrors}.concat(${T})`),m.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function k(A){var T;if(!_.opts.unevaluated)return;const L=(T=p?.validate)===null||T===void 0?void 0:T.evaluated;if(_.props!==!0)if(L&&!L.dynamicProps)L.props!==void 0&&(_.props=i.mergeEvaluated.props(m,L.props,_.props));else{const H=m.var("props",(0,n._)`${A}.evaluated.props`);_.props=i.mergeEvaluated.props(m,H,_.props,n.Name)}if(_.items!==!0)if(L&&!L.dynamicItems)L.items!==void 0&&(_.items=i.mergeEvaluated.items(m,L.items,_.items));else{const H=m.var("items",(0,n._)`${A}.evaluated.items`);_.items=i.mergeEvaluated.items(m,H,_.items,n.Name)}}}return bt.callRef=c,bt.default=o,bt}var zo;function my(){if(zo)return nr;zo=1,Object.defineProperty(nr,"__esModule",{value:!0});const t=hy(),e=py(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,e.default];return nr.default=n,nr}var sr={},ir={},Ro;function gy(){if(Ro)return ir;Ro=1,Object.defineProperty(ir,"__esModule",{value:!0});const t=he(),e=t.operators,n={maximum:{okStr:"<=",ok:e.LTE,fail:e.GT},minimum:{okStr:">=",ok:e.GTE,fail:e.LT},exclusiveMaximum:{okStr:"<",ok:e.LT,fail:e.GTE},exclusiveMinimum:{okStr:">",ok:e.GT,fail:e.LTE}},r={message:({keyword:i,schemaCode:o})=>(0,t.str)`must be ${n[i].okStr} ${o}`,params:({keyword:i,schemaCode:o})=>(0,t._)`{comparison: ${n[i].okStr}, limit: ${o}}`},s={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(i){const{keyword:o,data:a,schemaCode:c}=i;i.fail$data((0,t._)`${a} ${n[o].fail} ${c} || isNaN(${a})`)}};return ir.default=s,ir}var or={},jo;function yy(){if(jo)return or;jo=1,Object.defineProperty(or,"__esModule",{value:!0});const t=he(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,t.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,t._)`{multipleOf: ${r}}`},code(r){const{gen:s,data:i,schemaCode:o,it:a}=r,c=a.opts.multipleOfPrecision,l=s.let("res"),d=c?(0,t._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:(0,t._)`${l} !== parseInt(${l})`;r.fail$data((0,t._)`(${o} === 0 || (${l} = ${i}/${o}, ${d}))`)}};return or.default=n,or}var ar={},cr={},Fo;function wy(){if(Fo)return cr;Fo=1,Object.defineProperty(cr,"__esModule",{value:!0});function t(e){const n=e.length;let r=0,s=0,i;for(;s<n;)r++,i=e.charCodeAt(s++),i>=55296&&i<=56319&&s<n&&(i=e.charCodeAt(s),(i&64512)===56320&&s++);return r}return cr.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',cr}var Mo;function vy(){if(Mo)return ar;Mo=1,Object.defineProperty(ar,"__esModule",{value:!0});const t=he(),e=ge(),n=wy(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:o}){const a=i==="maxLength"?"more":"fewer";return(0,t.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:i})=>(0,t._)`{limit: ${i}}`},code(i){const{keyword:o,data:a,schemaCode:c,it:l}=i,d=o==="maxLength"?t.operators.GT:t.operators.LT,p=l.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,e.useFunc)(i.gen,n.default)}(${a})`;i.fail$data((0,t._)`${p} ${d} ${c}`)}};return ar.default=s,ar}var ur={},Uo;function _y(){if(Uo)return ur;Uo=1,Object.defineProperty(ur,"__esModule",{value:!0});const t=lt(),e=ge(),n=he(),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,n.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,n._)`{pattern: ${i}}`},code(i){const{gen:o,data:a,$data:c,schema:l,schemaCode:d,it:p}=i,h=p.opts.unicodeRegExp?"u":"";if(c){const{regExp:m}=p.opts.code,_=m.code==="new RegExp"?(0,n._)`new RegExp`:(0,e.useFunc)(o,m),g=o.let("valid");o.try(()=>o.assign(g,(0,n._)`${_}(${d}, ${h}).test(${a})`),()=>o.assign(g,!1)),i.fail$data((0,n._)`!${g}`)}else{const m=(0,t.usePattern)(i,l);i.fail$data((0,n._)`!${m}.test(${a})`)}}};return ur.default=s,ur}var lr={},Lo;function by(){if(Lo)return lr;Lo=1,Object.defineProperty(lr,"__esModule",{value:!0});const t=he(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:s}){const i=r==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${i} than ${s} properties`},params:({schemaCode:r})=>(0,t._)`{limit: ${r}}`},code(r){const{keyword:s,data:i,schemaCode:o}=r,a=s==="maxProperties"?t.operators.GT:t.operators.LT;r.fail$data((0,t._)`Object.keys(${i}).length ${a} ${o}`)}};return lr.default=n,lr}var fr={},qo;function $y(){if(qo)return fr;qo=1,Object.defineProperty(fr,"__esModule",{value:!0});const t=lt(),e=he(),n=ge(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,e.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,e._)`{missingProperty: ${i}}`},code(i){const{gen:o,schema:a,schemaCode:c,data:l,$data:d,it:p}=i,{opts:h}=p;if(!d&&a.length===0)return;const m=a.length>=h.loopRequired;if(p.allErrors?_():g(),h.strictRequired){const y=i.parentSchema.properties,{definedProperties:b}=i.it;for(const I of a)if(y?.[I]===void 0&&!b.has(I)){const v=p.schemaEnv.baseId+p.errSchemaPath,k=`required property "${I}" is not defined at "${v}" (strictRequired)`;(0,n.checkStrictMode)(p,k,p.opts.strictRequired)}}function _(){if(m||d)i.block$data(e.nil,w);else for(const y of a)(0,t.checkReportMissingProp)(i,y)}function g(){const y=o.let("missing");if(m||d){const b=o.let("valid",!0);i.block$data(b,()=>$(y,b)),i.ok(b)}else o.if((0,t.checkMissingProp)(i,a,y)),(0,t.reportMissingProp)(i,y),o.else()}function w(){o.forOf("prop",c,y=>{i.setParams({missingProperty:y}),o.if((0,t.noPropertyInData)(o,l,y,h.ownProperties),()=>i.error())})}function $(y,b){i.setParams({missingProperty:y}),o.forOf(y,c,()=>{o.assign(b,(0,t.propertyInData)(o,l,y,h.ownProperties)),o.if((0,e.not)(b),()=>{i.error(),o.break()})},e.nil)}}};return fr.default=s,fr}var dr={},Zo;function Sy(){if(Zo)return dr;Zo=1,Object.defineProperty(dr,"__esModule",{value:!0});const t=he(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:s}){const i=r==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${i} than ${s} items`},params:({schemaCode:r})=>(0,t._)`{limit: ${r}}`},code(r){const{keyword:s,data:i,schemaCode:o}=r,a=s==="maxItems"?t.operators.GT:t.operators.LT;r.fail$data((0,t._)`${i}.length ${a} ${o}`)}};return dr.default=n,dr}var hr={},pr={},Vo;function vi(){if(Vo)return pr;Vo=1,Object.defineProperty(pr,"__esModule",{value:!0});const t=pu();return t.code='require("ajv/dist/runtime/equal").default',pr.default=t,pr}var Ko;function Ey(){if(Ko)return hr;Ko=1,Object.defineProperty(hr,"__esModule",{value:!0});const t=Hr(),e=he(),n=ge(),r=vi(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,j:a}})=>(0,e.str)`must NOT have duplicate items (items ## ${a} and ${o} are identical)`,params:({params:{i:o,j:a}})=>(0,e._)`{i: ${o}, j: ${a}}`},code(o){const{gen:a,data:c,$data:l,schema:d,parentSchema:p,schemaCode:h,it:m}=o;if(!l&&!d)return;const _=a.let("valid"),g=p.items?(0,t.getSchemaTypes)(p.items):[];o.block$data(_,w,(0,e._)`${h} === false`),o.ok(_);function w(){const I=a.let("i",(0,e._)`${c}.length`),v=a.let("j");o.setParams({i:I,j:v}),a.assign(_,!0),a.if((0,e._)`${I} > 1`,()=>($()?y:b)(I,v))}function $(){return g.length>0&&!g.some(I=>I==="object"||I==="array")}function y(I,v){const k=a.name("item"),A=(0,t.checkDataTypes)(g,k,m.opts.strictNumbers,t.DataType.Wrong),T=a.const("indices",(0,e._)`{}`);a.for((0,e._)`;${I}--;`,()=>{a.let(k,(0,e._)`${c}[${I}]`),a.if(A,(0,e._)`continue`),g.length>1&&a.if((0,e._)`typeof ${k} == "string"`,(0,e._)`${k} += "_"`),a.if((0,e._)`typeof ${T}[${k}] == "number"`,()=>{a.assign(v,(0,e._)`${T}[${k}]`),o.error(),a.assign(_,!1).break()}).code((0,e._)`${T}[${k}] = ${I}`)})}function b(I,v){const k=(0,n.useFunc)(a,r.default),A=a.name("outer");a.label(A).for((0,e._)`;${I}--;`,()=>a.for((0,e._)`${v} = ${I}; ${v}--;`,()=>a.if((0,e._)`${k}(${c}[${I}], ${c}[${v}])`,()=>{o.error(),a.assign(_,!1).break(A)})))}}};return hr.default=i,hr}var mr={},Jo;function ky(){if(Jo)return mr;Jo=1,Object.defineProperty(mr,"__esModule",{value:!0});const t=he(),e=ge(),n=vi(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,t._)`{allowedValue: ${i}}`},code(i){const{gen:o,data:a,$data:c,schemaCode:l,schema:d}=i;c||d&&typeof d=="object"?i.fail$data((0,t._)`!${(0,e.useFunc)(o,n.default)}(${a}, ${l})`):i.fail((0,t._)`${d} !== ${a}`)}};return mr.default=s,mr}var gr={},Ho;function Iy(){if(Ho)return gr;Ho=1,Object.defineProperty(gr,"__esModule",{value:!0});const t=he(),e=ge(),n=vi(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,t._)`{allowedValues: ${i}}`},code(i){const{gen:o,data:a,$data:c,schema:l,schemaCode:d,it:p}=i;if(!c&&l.length===0)throw new Error("enum must have non-empty array");const h=l.length>=p.opts.loopEnum;let m;const _=()=>m??(m=(0,e.useFunc)(o,n.default));let g;if(h||c)g=o.let("valid"),i.block$data(g,w);else{if(!Array.isArray(l))throw new Error("ajv implementation error");const y=o.const("vSchema",d);g=(0,t.or)(...l.map((b,I)=>$(y,I)))}i.pass(g);function w(){o.assign(g,!1),o.forOf("v",d,y=>o.if((0,t._)`${_()}(${a}, ${y})`,()=>o.assign(g,!0).break()))}function $(y,b){const I=l[b];return typeof I=="object"&&I!==null?(0,t._)`${_()}(${a}, ${y}[${b}])`:(0,t._)`${a} === ${I}`}}};return gr.default=s,gr}var Go;function Oy(){if(Go)return sr;Go=1,Object.defineProperty(sr,"__esModule",{value:!0});const t=gy(),e=yy(),n=vy(),r=_y(),s=by(),i=$y(),o=Sy(),a=Ey(),c=ky(),l=Iy(),d=[t.default,e.default,n.default,r.default,s.default,i.default,o.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return sr.default=d,sr}var yr={},Kt={},Wo;function gu(){if(Wo)return Kt;Wo=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.validateAdditionalItems=void 0;const t=he(),e=ge(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){const{parentSchema:o,it:a}=i,{items:c}=o;if(!Array.isArray(c)){(0,e.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(i,c)}};function s(i,o){const{gen:a,schema:c,data:l,keyword:d,it:p}=i;p.items=!0;const h=a.const("len",(0,t._)`${l}.length`);if(c===!1)i.setParams({len:o.length}),i.pass((0,t._)`${h} <= ${o.length}`);else if(typeof c=="object"&&!(0,e.alwaysValidSchema)(p,c)){const _=a.var("valid",(0,t._)`${h} <= ${o.length}`);a.if((0,t.not)(_),()=>m(_)),i.ok(_)}function m(_){a.forRange("i",o.length,h,g=>{i.subschema({keyword:d,dataProp:g,dataPropType:e.Type.Num},_),p.allErrors||a.if((0,t.not)(_),()=>a.break())})}}return Kt.validateAdditionalItems=s,Kt.default=r,Kt}var wr={},Jt={},Yo;function yu(){if(Yo)return Jt;Yo=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.validateTuple=void 0;const t=he(),e=ge(),n=lt(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:o,it:a}=i;if(Array.isArray(o))return s(i,"additionalItems",o);a.items=!0,!(0,e.alwaysValidSchema)(a,o)&&i.ok((0,n.validateArray)(i))}};function s(i,o,a=i.schema){const{gen:c,parentSchema:l,data:d,keyword:p,it:h}=i;g(l),h.opts.unevaluated&&a.length&&h.items!==!0&&(h.items=e.mergeEvaluated.items(c,a.length,h.items));const m=c.name("valid"),_=c.const("len",(0,t._)`${d}.length`);a.forEach((w,$)=>{(0,e.alwaysValidSchema)(h,w)||(c.if((0,t._)`${_} > ${$}`,()=>i.subschema({keyword:p,schemaProp:$,dataProp:$},m)),i.ok(m))});function g(w){const{opts:$,errSchemaPath:y}=h,b=a.length,I=b===w.minItems&&(b===w.maxItems||w[o]===!1);if($.strictTuples&&!I){const v=`"${p}" is ${b}-tuple, but minItems or maxItems/${o} are not specified or different at path "${y}"`;(0,e.checkStrictMode)(h,v,$.strictTuples)}}}return Jt.validateTuple=s,Jt.default=r,Jt}var Qo;function Ay(){if(Qo)return wr;Qo=1,Object.defineProperty(wr,"__esModule",{value:!0});const t=yu(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,t.validateTuple)(n,"items")};return wr.default=e,wr}var vr={},Xo;function Ny(){if(Xo)return vr;Xo=1,Object.defineProperty(vr,"__esModule",{value:!0});const t=he(),e=ge(),n=lt(),r=gu(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,t.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,t._)`{limit: ${o}}`},code(o){const{schema:a,parentSchema:c,it:l}=o,{prefixItems:d}=c;l.items=!0,!(0,e.alwaysValidSchema)(l,a)&&(d?(0,r.validateAdditionalItems)(o,d):o.ok((0,n.validateArray)(o)))}};return vr.default=i,vr}var _r={},ea;function Ty(){if(ea)return _r;ea=1,Object.defineProperty(_r,"__esModule",{value:!0});const t=he(),e=ge(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:i}})=>i===void 0?(0,t.str)`must contain at least ${s} valid item(s)`:(0,t.str)`must contain at least ${s} and no more than ${i} valid item(s)`,params:({params:{min:s,max:i}})=>i===void 0?(0,t._)`{minContains: ${s}}`:(0,t._)`{minContains: ${s}, maxContains: ${i}}`},code(s){const{gen:i,schema:o,parentSchema:a,data:c,it:l}=s;let d,p;const{minContains:h,maxContains:m}=a;l.opts.next?(d=h===void 0?1:h,p=m):d=1;const _=i.const("len",(0,t._)`${c}.length`);if(s.setParams({min:d,max:p}),p===void 0&&d===0){(0,e.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(p!==void 0&&d>p){(0,e.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,e.alwaysValidSchema)(l,o)){let b=(0,t._)`${_} >= ${d}`;p!==void 0&&(b=(0,t._)`${b} && ${_} <= ${p}`),s.pass(b);return}l.items=!0;const g=i.name("valid");p===void 0&&d===1?$(g,()=>i.if(g,()=>i.break())):d===0?(i.let(g,!0),p!==void 0&&i.if((0,t._)`${c}.length > 0`,w)):(i.let(g,!1),w()),s.result(g,()=>s.reset());function w(){const b=i.name("_valid"),I=i.let("count",0);$(b,()=>i.if(b,()=>y(I)))}function $(b,I){i.forRange("i",0,_,v=>{s.subschema({keyword:"contains",dataProp:v,dataPropType:e.Type.Num,compositeRule:!0},b),I()})}function y(b){i.code((0,t._)`${b}++`),p===void 0?i.if((0,t._)`${b} >= ${d}`,()=>i.assign(g,!0).break()):(i.if((0,t._)`${b} > ${p}`,()=>i.assign(g,!1).break()),d===1?i.assign(g,!0):i.if((0,t._)`${b} >= ${d}`,()=>i.assign(g,!0)))}}};return _r.default=r,_r}var Cs={},ta;function Py(){return ta||(ta=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=he(),n=ge(),r=lt();t.error={message:({params:{property:c,depsCount:l,deps:d}})=>{const p=l===1?"property":"properties";return(0,e.str)`must have ${p} ${d} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:d,missingProperty:p}})=>(0,e._)`{property: ${c},
|
|
174
|
-
missingProperty: ${p},
|
|
175
|
-
depsCount: ${l},
|
|
176
|
-
deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(c){const[l,d]=i(c);o(c,l),a(c,d)}};function i({schema:c}){const l={},d={};for(const p in c){if(p==="__proto__")continue;const h=Array.isArray(c[p])?l:d;h[p]=c[p]}return[l,d]}function o(c,l=c.schema){const{gen:d,data:p,it:h}=c;if(Object.keys(l).length===0)return;const m=d.let("missing");for(const _ in l){const g=l[_];if(g.length===0)continue;const w=(0,r.propertyInData)(d,p,_,h.opts.ownProperties);c.setParams({property:_,depsCount:g.length,deps:g.join(", ")}),h.allErrors?d.if(w,()=>{for(const $ of g)(0,r.checkReportMissingProp)(c,$)}):(d.if((0,e._)`${w} && (${(0,r.checkMissingProp)(c,g,m)})`),(0,r.reportMissingProp)(c,m),d.else())}}t.validatePropertyDeps=o;function a(c,l=c.schema){const{gen:d,data:p,keyword:h,it:m}=c,_=d.name("valid");for(const g in l)(0,n.alwaysValidSchema)(m,l[g])||(d.if((0,r.propertyInData)(d,p,g,m.opts.ownProperties),()=>{const w=c.subschema({keyword:h,schemaProp:g},_);c.mergeValidEvaluated(w,_)},()=>d.var(_,!0)),c.ok(_))}t.validateSchemaDeps=a,t.default=s})(Cs)),Cs}var br={},na;function Cy(){if(na)return br;na=1,Object.defineProperty(br,"__esModule",{value:!0});const t=he(),e=ge(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,t._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:i,schema:o,data:a,it:c}=s;if((0,e.alwaysValidSchema)(c,o))return;const l=i.name("valid");i.forIn("key",a,d=>{s.setParams({propertyName:d}),s.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},l),i.if((0,t.not)(l),()=>{s.error(!0),c.allErrors||i.break()})}),s.ok(l)}};return br.default=r,br}var $r={},ra;function wu(){if(ra)return $r;ra=1,Object.defineProperty($r,"__esModule",{value:!0});const t=lt(),e=he(),n=Tt(),r=ge(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:o})=>(0,e._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:a,schema:c,parentSchema:l,data:d,errsCount:p,it:h}=o;if(!p)throw new Error("ajv implementation error");const{allErrors:m,opts:_}=h;if(h.props=!0,_.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(h,c))return;const g=(0,t.allSchemaProperties)(l.properties),w=(0,t.allSchemaProperties)(l.patternProperties);$(),o.ok((0,e._)`${p} === ${n.default.errors}`);function $(){a.forIn("key",d,k=>{!g.length&&!w.length?I(k):a.if(y(k),()=>I(k))})}function y(k){let A;if(g.length>8){const T=(0,r.schemaRefOrVal)(h,l.properties,"properties");A=(0,t.isOwnProperty)(a,T,k)}else g.length?A=(0,e.or)(...g.map(T=>(0,e._)`${k} === ${T}`)):A=e.nil;return w.length&&(A=(0,e.or)(A,...w.map(T=>(0,e._)`${(0,t.usePattern)(o,T)}.test(${k})`))),(0,e.not)(A)}function b(k){a.code((0,e._)`delete ${d}[${k}]`)}function I(k){if(_.removeAdditional==="all"||_.removeAdditional&&c===!1){b(k);return}if(c===!1){o.setParams({additionalProperty:k}),o.error(),m||a.break();return}if(typeof c=="object"&&!(0,r.alwaysValidSchema)(h,c)){const A=a.name("valid");_.removeAdditional==="failing"?(v(k,A,!1),a.if((0,e.not)(A),()=>{o.reset(),b(k)})):(v(k,A),m||a.if((0,e.not)(A),()=>a.break()))}}function v(k,A,T){const L={keyword:"additionalProperties",dataProp:k,dataPropType:r.Type.Str};T===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(L,A)}}};return $r.default=i,$r}var Sr={},sa;function xy(){if(sa)return Sr;sa=1,Object.defineProperty(Sr,"__esModule",{value:!0});const t=fs(),e=lt(),n=ge(),r=wu(),s={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,parentSchema:c,data:l,it:d}=i;d.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&r.default.code(new t.KeywordCxt(d,r.default,"additionalProperties"));const p=(0,e.allSchemaProperties)(a);for(const w of p)d.definedProperties.add(w);d.opts.unevaluated&&p.length&&d.props!==!0&&(d.props=n.mergeEvaluated.props(o,(0,n.toHash)(p),d.props));const h=p.filter(w=>!(0,n.alwaysValidSchema)(d,a[w]));if(h.length===0)return;const m=o.name("valid");for(const w of h)_(w)?g(w):(o.if((0,e.propertyInData)(o,l,w,d.opts.ownProperties)),g(w),d.allErrors||o.else().var(m,!0),o.endIf()),i.it.definedProperties.add(w),i.ok(m);function _(w){return d.opts.useDefaults&&!d.compositeRule&&a[w].default!==void 0}function g(w){i.subschema({keyword:"properties",schemaProp:w,dataProp:w},m)}}};return Sr.default=s,Sr}var Er={},ia;function By(){if(ia)return Er;ia=1,Object.defineProperty(Er,"__esModule",{value:!0});const t=lt(),e=he(),n=ge(),r=ge(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,data:c,parentSchema:l,it:d}=i,{opts:p}=d,h=(0,t.allSchemaProperties)(a),m=h.filter(I=>(0,n.alwaysValidSchema)(d,a[I]));if(h.length===0||m.length===h.length&&(!d.opts.unevaluated||d.props===!0))return;const _=p.strictSchema&&!p.allowMatchingProperties&&l.properties,g=o.name("valid");d.props!==!0&&!(d.props instanceof e.Name)&&(d.props=(0,r.evaluatedPropsToName)(o,d.props));const{props:w}=d;$();function $(){for(const I of h)_&&y(I),d.allErrors?b(I):(o.var(g,!0),b(I),o.if(g))}function y(I){for(const v in _)new RegExp(I).test(v)&&(0,n.checkStrictMode)(d,`property ${v} matches pattern ${I} (use allowMatchingProperties)`)}function b(I){o.forIn("key",c,v=>{o.if((0,e._)`${(0,t.usePattern)(i,I)}.test(${v})`,()=>{const k=m.includes(I);k||i.subschema({keyword:"patternProperties",schemaProp:I,dataProp:v,dataPropType:r.Type.Str},g),d.opts.unevaluated&&w!==!0?o.assign((0,e._)`${w}[${v}]`,!0):!k&&!d.allErrors&&o.if((0,e.not)(g),()=>o.break())})})}}};return Er.default=s,Er}var kr={},oa;function Dy(){if(oa)return kr;oa=1,Object.defineProperty(kr,"__esModule",{value:!0});const t=ge(),e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:s,it:i}=n;if((0,t.alwaysValidSchema)(i,s)){n.fail();return}const o=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),n.failResult(o,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return kr.default=e,kr}var Ir={},aa;function zy(){if(aa)return Ir;aa=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:lt().validateUnion,error:{message:"must match a schema in anyOf"}};return Ir.default=e,Ir}var Or={},ca;function Ry(){if(ca)return Or;ca=1,Object.defineProperty(Or,"__esModule",{value:!0});const t=he(),e=ge(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,t._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:i,schema:o,parentSchema:a,it:c}=s;if(!Array.isArray(o))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;const l=o,d=i.let("valid",!1),p=i.let("passing",null),h=i.name("_valid");s.setParams({passing:p}),i.block(m),s.result(d,()=>s.reset(),()=>s.error(!0));function m(){l.forEach((_,g)=>{let w;(0,e.alwaysValidSchema)(c,_)?i.var(h,!0):w=s.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},h),g>0&&i.if((0,t._)`${h} && ${d}`).assign(d,!1).assign(p,(0,t._)`[${p}, ${g}]`).else(),i.if(h,()=>{i.assign(d,!0),i.assign(p,g),w&&s.mergeEvaluated(w,t.Name)})})}}};return Or.default=r,Or}var Ar={},ua;function jy(){if(ua)return Ar;ua=1,Object.defineProperty(Ar,"__esModule",{value:!0});const t=ge(),e={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:s,it:i}=n;if(!Array.isArray(s))throw new Error("ajv implementation error");const o=r.name("valid");s.forEach((a,c)=>{if((0,t.alwaysValidSchema)(i,a))return;const l=n.subschema({keyword:"allOf",schemaProp:c},o);n.ok(o),n.mergeEvaluated(l)})}};return Ar.default=e,Ar}var Nr={},la;function Fy(){if(la)return Nr;la=1,Object.defineProperty(Nr,"__esModule",{value:!0});const t=he(),e=ge(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,t.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,t._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:o,parentSchema:a,it:c}=i;a.then===void 0&&a.else===void 0&&(0,e.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=s(c,"then"),d=s(c,"else");if(!l&&!d)return;const p=o.let("valid",!0),h=o.name("_valid");if(m(),i.reset(),l&&d){const g=o.let("ifClause");i.setParams({ifClause:g}),o.if(h,_("then",g),_("else",g))}else l?o.if(h,_("then")):o.if((0,t.not)(h),_("else"));i.pass(p,()=>i.error(!0));function m(){const g=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);i.mergeEvaluated(g)}function _(g,w){return()=>{const $=i.subschema({keyword:g},h);o.assign(p,h),i.mergeValidEvaluated($,p),w?o.assign(w,(0,t._)`${g}`):i.setParams({ifClause:g})}}}};function s(i,o){const a=i.schema[o];return a!==void 0&&!(0,e.alwaysValidSchema)(i,a)}return Nr.default=r,Nr}var Tr={},fa;function My(){if(fa)return Tr;fa=1,Object.defineProperty(Tr,"__esModule",{value:!0});const t=ge(),e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:s}){r.if===void 0&&(0,t.checkStrictMode)(s,`"${n}" without "if" is ignored`)}};return Tr.default=e,Tr}var da;function Uy(){if(da)return yr;da=1,Object.defineProperty(yr,"__esModule",{value:!0});const t=gu(),e=Ay(),n=yu(),r=Ny(),s=Ty(),i=Py(),o=Cy(),a=wu(),c=xy(),l=By(),d=Dy(),p=zy(),h=Ry(),m=jy(),_=Fy(),g=My();function w($=!1){const y=[d.default,p.default,h.default,m.default,_.default,g.default,o.default,a.default,i.default,c.default,l.default];return $?y.push(e.default,r.default):y.push(t.default,n.default),y.push(s.default),y}return yr.default=w,yr}var Pr={},Cr={},ha;function Ly(){if(ha)return Cr;ha=1,Object.defineProperty(Cr,"__esModule",{value:!0});const t=he(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,t.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,t._)`{format: ${r}}`},code(r,s){const{gen:i,data:o,$data:a,schema:c,schemaCode:l,it:d}=r,{opts:p,errSchemaPath:h,schemaEnv:m,self:_}=d;if(!p.validateFormats)return;a?g():w();function g(){const $=i.scopeValue("formats",{ref:_.formats,code:p.code.formats}),y=i.const("fDef",(0,t._)`${$}[${l}]`),b=i.let("fType"),I=i.let("format");i.if((0,t._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>i.assign(b,(0,t._)`${y}.type || "string"`).assign(I,(0,t._)`${y}.validate`),()=>i.assign(b,(0,t._)`"string"`).assign(I,y)),r.fail$data((0,t.or)(v(),k()));function v(){return p.strictSchema===!1?t.nil:(0,t._)`${l} && !${I}`}function k(){const A=m.$async?(0,t._)`(${y}.async ? await ${I}(${o}) : ${I}(${o}))`:(0,t._)`${I}(${o})`,T=(0,t._)`(typeof ${I} == "function" ? ${A} : ${I}.test(${o}))`;return(0,t._)`${I} && ${I} !== true && ${b} === ${s} && !${T}`}}function w(){const $=_.formats[c];if(!$){v();return}if($===!0)return;const[y,b,I]=k($);y===s&&r.pass(A());function v(){if(p.strictSchema===!1){_.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${c}" ignored in schema at path "${h}"`}}function k(T){const L=T instanceof RegExp?(0,t.regexpCode)(T):p.code.formats?(0,t._)`${p.code.formats}${(0,t.getProperty)(c)}`:void 0,H=i.scopeValue("formats",{key:c,ref:T,code:L});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,t._)`${H}.validate`]:["string",T,H]}function A(){if(typeof $=="object"&&!($ instanceof RegExp)&&$.async){if(!m.$async)throw new Error("async format in sync schema");return(0,t._)`await ${I}(${o})`}return typeof b=="function"?(0,t._)`${I}(${o})`:(0,t._)`${I}.test(${o})`}}}};return Cr.default=n,Cr}var pa;function qy(){if(pa)return Pr;pa=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=[Ly().default];return Pr.default=e,Pr}var Bt={},ma;function Zy(){return ma||(ma=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.contentVocabulary=Bt.metadataVocabulary=void 0,Bt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Bt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Bt}var ga;function Vy(){if(ga)return tr;ga=1,Object.defineProperty(tr,"__esModule",{value:!0});const t=my(),e=Oy(),n=Uy(),r=qy(),s=Zy(),i=[t.default,e.default,(0,n.default)(),r.default,s.metadataVocabulary,s.contentVocabulary];return tr.default=i,tr}var xr={},$n={},ya;function Ky(){if(ya)return $n;ya=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.DiscrError=void 0;var t;return(function(e){e.Tag="tag",e.Mapping="mapping"})(t||($n.DiscrError=t={})),$n}var wa;function Jy(){if(wa)return xr;wa=1,Object.defineProperty(xr,"__esModule",{value:!0});const t=he(),e=Ky(),n=wi(),r=ds(),s=ge(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===e.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:l}})=>(0,t._)`{error: ${a}, tag: ${l}, tagValue: ${c}}`},code(a){const{gen:c,data:l,schema:d,parentSchema:p,it:h}=a,{oneOf:m}=p;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const _=d.propertyName;if(typeof _!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!m)throw new Error("discriminator: requires oneOf keyword");const g=c.let("valid",!1),w=c.const("tag",(0,t._)`${l}${(0,t.getProperty)(_)}`);c.if((0,t._)`typeof ${w} == "string"`,()=>$(),()=>a.error(!1,{discrError:e.DiscrError.Tag,tag:w,tagName:_})),a.ok(g);function $(){const I=b();c.if(!1);for(const v in I)c.elseIf((0,t._)`${w} === ${v}`),c.assign(g,y(I[v]));c.else(),a.error(!1,{discrError:e.DiscrError.Mapping,tag:w,tagName:_}),c.endIf()}function y(I){const v=c.name("valid"),k=a.subschema({keyword:"oneOf",schemaProp:I},v);return a.mergeEvaluated(k,t.Name),v}function b(){var I;const v={},k=T(p);let A=!0;for(let G=0;G<m.length;G++){let Y=m[G];if(Y?.$ref&&!(0,s.schemaHasRulesButRef)(Y,h.self.RULES)){const le=Y.$ref;if(Y=n.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,le),Y instanceof n.SchemaEnv&&(Y=Y.schema),Y===void 0)throw new r.default(h.opts.uriResolver,h.baseId,le)}const se=(I=Y?.properties)===null||I===void 0?void 0:I[_];if(typeof se!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${_}"`);A=A&&(k||T(Y)),L(se,G)}if(!A)throw new Error(`discriminator: "${_}" must be required`);return v;function T({required:G}){return Array.isArray(G)&&G.includes(_)}function L(G,Y){if(G.const)H(G.const,Y);else if(G.enum)for(const se of G.enum)H(se,Y);else throw new Error(`discriminator: "properties/${_}" must have "const" or "enum"`)}function H(G,Y){if(typeof G!="string"||G in v)throw new Error(`discriminator: "${_}" values must be unique strings`);v[G]=Y}}}};return xr.default=o,xr}const Hy="http://json-schema.org/draft-07/schema#",Gy="http://json-schema.org/draft-07/schema#",Wy="Core schema meta-schema",Yy={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:[]}},Qy=["object","boolean"],Xy={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}};var e0={$schema:Hy,$id:Gy,title:Wy,definitions:Yy,type:Qy,properties:Xy,default:!0},va;function t0(){return va||(va=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;const n=dy(),r=Vy(),s=Jy(),i=e0,o=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const _=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(_,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=fs();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var d=he();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var p=yi();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return p.default}});var h=ds();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})})(Wn,Wn.exports)),Wn.exports}var n0=t0();const xs=10,_a=(t=0)=>e=>`\x1B[${e+t}m`,ba=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,$a=(t=0)=>(e,n,r)=>`\x1B[${38+t};2;${e};${n};${r}m`,Oe={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Oe.modifier);const r0=Object.keys(Oe.color),s0=Object.keys(Oe.bgColor);[...r0,...s0];function i0(){const t=new Map;for(const[e,n]of Object.entries(Oe)){for(const[r,s]of Object.entries(n))Oe[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[r]=Oe[r],t.set(s[0],s[1]);Object.defineProperty(Oe,e,{value:n,enumerable:!1})}return Object.defineProperty(Oe,"codes",{value:t,enumerable:!1}),Oe.color.close="\x1B[39m",Oe.bgColor.close="\x1B[49m",Oe.color.ansi=_a(),Oe.color.ansi256=ba(),Oe.color.ansi16m=$a(),Oe.bgColor.ansi=_a(xs),Oe.bgColor.ansi256=ba(xs),Oe.bgColor.ansi16m=$a(xs),Object.defineProperties(Oe,{rgbToAnsi256:{value(e,n,r){return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){const n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(i=>i+i).join(""));const s=Number.parseInt(r,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>Oe.rgbToAnsi256(...Oe.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let n,r,s;if(e>=232)n=((e-232)*10+8)/255,r=n,s=n;else{e-=16;const a=e%36;n=Math.floor(e/36)/5,r=Math.floor(a/6)/5,s=a%6/5}const i=Math.max(n,r,s)*2;if(i===0)return 30;let o=30+(Math.round(s)<<2|Math.round(r)<<1|Math.round(n));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,n,r)=>Oe.ansi256ToAnsi(Oe.rgbToAnsi256(e,n,r)),enumerable:!1},hexToAnsi:{value:e=>Oe.ansi256ToAnsi(Oe.hexToAnsi256(e)),enumerable:!1}}),Oe}const Ye=i0();class o0 extends pi{getNodeDependencies({resolvedInputs:e}){const n=[];for(const r of Object.values(e))for(const s of r)n.push(s.input.instanceId);return n}processNode({instance:e,component:n,state:r,resolvedInputs:s}){const i=new n0.Ajv({strict:!1});this.logger.debug({instanceId:e.id},"validating instance");const o=[];for(const[l,d]of Object.entries(n.args))try{const p=Hm(e.args?.[l]);if(!d.required&&p===void 0)continue;i.validate(d.schema,p)||(this.logger.debug({instanceId:e.id,argumentName:l},"invalid argument"),o.push(`Invalid argument "${Ye.blueBright.open}${l}${Ye.reset.close}": `+i.errorsText()))}catch(p){this.logger.debug({instanceId:e.id,argumentName:l,error:p},"failed to validate argument"),o.push(`Failed to validate argument "${Ye.blueBright.open}${l}${Ye.reset.close}": `+(p instanceof Error?p.message:String(p)))}if(hi(n))for(const[l,d]of Object.entries(n.secrets))d.required&&!r?.secretNames?.includes(l)&&o.push(`Missing required secret "${Ye.blueBright.open}${l}${Ye.reset.close}"`);for(const[l,d]of Object.entries(s))for(const p of d)this.outputs.get(p.input.instanceId)?.status!=="ok"&&o.push(`Invalid input "${Ye.blueBright.open}${l}${Ye.reset.close}":
|
|
177
|
-
"${Ye.blueBright.open}${p.input.instanceId}${Ye.reset.close}" has validation errors`);for(const[l,d]of Object.entries(n.inputs))d.required&&(!s[l]||!s[l].length)&&o.push(`Missing required input "${Ye.blueBright.open}${l}${Ye.reset.close}" of type "${Ye.greenBright.open}${d.type}${Ye.reset.close}"`);if(o.length===0)return{status:"ok"};const a=(o.length+1).toString().length+2;return{status:"error",errorText:o.map((l,d)=>{const p=l.split(`
|
|
178
|
-
`),h=`${d+1}. `;return p.map((m,_)=>`${_===0?h:" ".repeat(a)}${m}`).join(`\r
|
|
179
|
-
`)}).join(`\r
|
|
180
|
-
`)}}}const a0={InputResolver:wg,InputHashResolver:Wg,ValidationResolver:o0};var Sn={exports:{}},Bs,Sa;function c0(){if(Sa)return Bs;Sa=1;function t(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}Bs=e;function e(n,r,s){var i=s&&s.stringify||t,o=1;if(typeof n=="object"&&n!==null){var a=r.length+o;if(a===1)return n;var c=new Array(a);c[0]=i(n);for(var l=1;l<a;l++)c[l]=i(r[l]);return c.join(" ")}if(typeof n!="string")return n;var d=r.length;if(d===0)return n;for(var p="",h=1-o,m=-1,_=n&&n.length||0,g=0;g<_;){if(n.charCodeAt(g)===37&&g+1<_){switch(m=m>-1?m:0,n.charCodeAt(g+1)){case 100:case 102:if(h>=d||r[h]==null)break;m<g&&(p+=n.slice(m,g)),p+=Number(r[h]),m=g+2,g++;break;case 105:if(h>=d||r[h]==null)break;m<g&&(p+=n.slice(m,g)),p+=Math.floor(Number(r[h])),m=g+2,g++;break;case 79:case 111:case 106:if(h>=d||r[h]===void 0)break;m<g&&(p+=n.slice(m,g));var w=typeof r[h];if(w==="string"){p+="'"+r[h]+"'",m=g+2,g++;break}if(w==="function"){p+=r[h].name||"<anonymous>",m=g+2,g++;break}p+=i(r[h]),m=g+2,g++;break;case 115:if(h>=d)break;m<g&&(p+=n.slice(m,g)),p+=String(r[h]),m=g+2,g++;break;case 37:m<g&&(p+=n.slice(m,g)),p+="%",m=g+2,g++,h--;break}++h}++g}return m===-1?n:(m<_&&(p+=n.slice(m)),p)}return Bs}var Ea;function u0(){if(Ea)return Sn.exports;Ea=1;const t=c0();Sn.exports=d;const e=le().console||{},n={mapHttpRequest:A,mapHttpResponse:A,wrapRequestSerializer:T,wrapResponseSerializer:T,wrapErrorSerializer:T,req:A,res:A,err:v,errWithCause:v};function r(M,W){return M==="silent"?1/0:W.levels.values[M]}const s=Symbol("pino.logFuncs"),i=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function a(M,W){const re={logger:W,parent:M[i]};W[i]=re}function c(M,W,re){const ne={};W.forEach(oe=>{ne[oe]=re[oe]?re[oe]:e[oe]||e[o[oe]||"log"]||L}),M[s]=ne}function l(M,W){return Array.isArray(M)?M.filter(function(ne){return ne!=="!stdSerializers.err"}):M===!0?Object.keys(W):!1}function d(M){M=M||{},M.browser=M.browser||{};const W=M.browser.transmit;if(W&&typeof W.send!="function")throw Error("pino: transmit option must have a send function");const re=M.browser.write||e;M.browser.write&&(M.browser.asObject=!0);const ne=M.serializers||{},oe=l(M.browser.serialize,ne);let V=M.browser.serialize;Array.isArray(M.browser.serialize)&&M.browser.serialize.indexOf("!stdSerializers.err")>-1&&(V=!1);const P=Object.keys(M.customLevels||{}),j=["error","fatal","warn","info","debug","trace"].concat(P);typeof re=="function"&&j.forEach(function(ie){re[ie]=re}),(M.enabled===!1||M.browser.disabled)&&(M.level="silent");const B=M.level||"info",E=Object.create(re);E.log||(E.log=L),c(E,j,re),a({},E),Object.defineProperty(E,"levelVal",{get:F}),Object.defineProperty(E,"level",{get:X,set:Q});const N={transmit:W,serialize:oe,asObject:M.browser.asObject,asObjectBindingsOnly:M.browser.asObjectBindingsOnly,formatters:M.browser.formatters,levels:j,timestamp:k(M),messageKey:M.messageKey||"msg",onChild:M.onChild||L};E.levels=p(M),E.level=B,E.isLevelEnabled=function(ie){return this.levels.values[ie]?this.levels.values[ie]>=this.levels.values[this.level]:!1},E.setMaxListeners=E.getMaxListeners=E.emit=E.addListener=E.on=E.prependListener=E.once=E.prependOnceListener=E.removeListener=E.removeAllListeners=E.listeners=E.listenerCount=E.eventNames=E.write=E.flush=L,E.serializers=ne,E._serialize=oe,E._stdErrSerialize=V,E.child=function(...ie){return fe.call(this,N,...ie)},W&&(E._logEvent=I());function F(){return r(this.level,this)}function X(){return this._level}function Q(ie){if(ie!=="silent"&&!this.levels.values[ie])throw Error("unknown level "+ie);this._level=ie,_(this,N,E,"error"),_(this,N,E,"fatal"),_(this,N,E,"warn"),_(this,N,E,"info"),_(this,N,E,"debug"),_(this,N,E,"trace"),P.forEach(x=>{_(this,N,E,x)})}function fe(ie,x,D){if(!x)throw new Error("missing bindings for child Pino");D=D||{},oe&&x.serializers&&(D.serializers=x.serializers);const q=D.serializers;if(oe&&q){var J=Object.assign({},ne,q),ee=M.browser.serialize===!0?Object.keys(J):oe;delete x.serializers,y([x],ee,J,this._stdErrSerialize)}function ae(Re){this._childLevel=(Re._childLevel|0)+1,this.bindings=x,J&&(this.serializers=J,this._serialize=ee),W&&(this._logEvent=I([].concat(Re._logEvent.bindings,x)))}ae.prototype=this;const _e=new ae(this);return a(this,_e),_e.child=function(...Re){return fe.call(this,ie,...Re)},_e.level=D.level||this.level,ie.onChild(_e),_e}return E}function p(M){const W=M.customLevels||{},re=Object.assign({},d.levels.values,W),ne=Object.assign({},d.levels.labels,h(W));return{values:re,labels:ne}}function h(M){const W={};return Object.keys(M).forEach(function(re){W[M[re]]=re}),W}d.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},d.stdSerializers=n,d.stdTimeFunctions=Object.assign({},{nullTime:H,epochTime:G,unixTime:Y,isoTime:se});function m(M){const W=[];M.bindings&&W.push(M.bindings);let re=M[i];for(;re.parent;)re=re.parent,re.logger.bindings&&W.push(re.logger.bindings);return W.reverse()}function _(M,W,re,ne){if(Object.defineProperty(M,ne,{value:r(M.level,re)>r(ne,re)?L:re[s][ne],writable:!0,enumerable:!0,configurable:!0}),M[ne]===L){if(!W.transmit)return;const V=W.transmit.level||M.level,P=r(V,re);if(r(ne,re)<P)return}M[ne]=w(M,W,re,ne);const oe=m(M);oe.length!==0&&(M[ne]=g(oe,M[ne]))}function g(M,W){return function(){return W.apply(this,[...M,...arguments])}}function w(M,W,re,ne){return(function(oe){return function(){const P=W.timestamp(),j=new Array(arguments.length),B=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var E=0;E<j.length;E++)j[E]=arguments[E];var N=!1;if(W.serialize&&(y(j,this._serialize,this.serializers,this._stdErrSerialize),N=!0),W.asObject||W.formatters?oe.call(B,...$(this,ne,j,P,W)):oe.apply(B,j),W.transmit){const F=W.transmit.level||M._level,X=r(F,re),Q=r(ne,re);if(Q<X)return;b(this,{ts:P,methodLevel:ne,methodValue:Q,transmitValue:re.levels.values[W.transmit.level||M._level],send:W.transmit.send,val:r(M._level,re)},j,N)}}})(M[s][ne])}function $(M,W,re,ne,oe){const{level:V,log:P=F=>F}=oe.formatters||{},j=re.slice();let B=j[0];const E={};let N=(M._childLevel|0)+1;if(N<1&&(N=1),ne&&(E.time=ne),V){const F=V(W,M.levels.values[W]);Object.assign(E,F)}else E.level=M.levels.values[W];if(oe.asObjectBindingsOnly){if(B!==null&&typeof B=="object")for(;N--&&typeof j[0]=="object";)Object.assign(E,j.shift());return[P(E),...j]}else{if(B!==null&&typeof B=="object"){for(;N--&&typeof j[0]=="object";)Object.assign(E,j.shift());B=j.length?t(j.shift(),j):void 0}else typeof B=="string"&&(B=t(j.shift(),j));return B!==void 0&&(E[oe.messageKey]=B),[P(E)]}}function y(M,W,re,ne){for(const oe in M)if(ne&&M[oe]instanceof Error)M[oe]=d.stdSerializers.err(M[oe]);else if(typeof M[oe]=="object"&&!Array.isArray(M[oe])&&W)for(const V in M[oe])W.indexOf(V)>-1&&V in re&&(M[oe][V]=re[V](M[oe][V]))}function b(M,W,re,ne=!1){const oe=W.send,V=W.ts,P=W.methodLevel,j=W.methodValue,B=W.val,E=M._logEvent.bindings;ne||y(re,M._serialize||Object.keys(M.serializers),M.serializers,M._stdErrSerialize===void 0?!0:M._stdErrSerialize),M._logEvent.ts=V,M._logEvent.messages=re.filter(function(N){return E.indexOf(N)===-1}),M._logEvent.level.label=P,M._logEvent.level.value=j,oe(P,M._logEvent,B),M._logEvent=I(E)}function I(M){return{ts:0,messages:[],bindings:M||[],level:{label:"",value:0}}}function v(M){const W={type:M.constructor.name,msg:M.message,stack:M.stack};for(const re in M)W[re]===void 0&&(W[re]=M[re]);return W}function k(M){return typeof M.timestamp=="function"?M.timestamp:M.timestamp===!1?H:G}function A(){return{}}function T(M){return M}function L(){}function H(){return!1}function G(){return Date.now()}function Y(){return Math.round(Date.now()/1e3)}function se(){return new Date(Date.now()).toISOString()}function le(){function M(W){return typeof W<"u"&&W}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return M(self)||M(window)||M(this)||{}}}return Sn.exports.default=d,Sn.exports.pino=d,Sn.exports}var l0=u0();const xn=(t,e)=>{t.postMessage(e)},mt=new Map,ka=128,vu=(t,e,n)=>{if(n.pendingOutputs.size===0)return;const r=Array.from(n.pendingOutputs.values());n.pendingOutputs.clear();for(let s=0;s<r.length;s+=ka)xn(t,{type:"outputs",resolverId:e,items:r.slice(s,s+ka)})},Ia=(t,e,n)=>{n.flushTimer||(n.flushTimer=setTimeout(()=>{if(n.flushTimer=null,vu(t,e,n),n.pendingDependentSets.size>0){const r=Array.from(n.pendingDependentSets.entries()).map(([s,i])=>({nodeId:s,dependents:i}));xn(t,{type:"dependent-set-batch",resolverId:e,items:r}),n.pendingDependentSets.clear()}},0))},_i=(t,e)=>{if(e.isProcessing){e.processRequested=!0;return}e.isProcessing=!0;const n=e.abortController.signal;e.resolver.process(n).catch(r=>{e.logger.error({error:r},"failed to process resolver updates")}).finally(()=>{e.isProcessing=!1,e.processRequested&&(e.processRequested=!1,_i(t,e))})},f0=async(t,e,n,r,s=!1)=>{if(mt.has(n)){console.warn(`state with id "${n}" already exists`);return}const i=l0.pino({level:"info"}).child({resolverId:n,resolverType:r}),o=(d,p)=>{const h=mt.get(n);h&&(h.pendingOutputs.set(d,{nodeId:d,output:p}),Ia(t,n,h))};let a;s&&(a=(d,p)=>{const h=mt.get(n);h&&(h.pendingDependentSets.set(d,p&&Array.from(p)),Ia(t,n,h))});const c=new a0[r](e,i,o,a);mt.set(n,{nodes:e,resolver:c,logger:i,abortController:new AbortController,isProcessing:!1,processRequested:!1,pendingOutputs:new Map,pendingDependentSets:new Map,flushTimer:null}),c.addAllNodesToWorkset(),await c.process();const l=mt.get(n);if(l&&(l.flushTimer&&(clearTimeout(l.flushTimer),l.flushTimer=null),vu(t,n,l),l.pendingDependentSets.size>0)){const d=Array.from(l.pendingDependentSets.entries()).map(([p,h])=>({nodeId:p,dependents:h}));xn(t,{type:"dependent-set-batch",resolverId:n,items:d}),l.pendingDependentSets.clear()}xn(t,{type:"resolver-ready",resolverId:n})},_u=(t,e,n)=>{t.abortController.abort(),t.abortController=new AbortController,t.nodes.set(e,n),t.resolver.invalidate(e)},d0=(t,e,n,r)=>{const s=mt.get(e);if(!s)throw new Error(`Unknown state: ${e}`);_u(s,n,r),_i(t,s)},h0=(t,e,n)=>{const r=mt.get(e);if(!r)throw new Error(`Unknown state: ${e}`);_u(r,n,void 0),_i(t,r)},p0=t=>{const e=mt.get(t);e?.flushTimer&&clearTimeout(e.flushTimer),mt.delete(t)};self.onconnect=t=>{const e=t.ports[0];e.onmessage=n=>{const r=n.data;switch(r.type){case"create-resolver":{const s=new Map(Object.entries(r.nodes));f0(e,s,r.resolverId,r.resolverType,r.syncDependentMap);break}case"update-input":{d0(e,r.resolverId,r.nodeId,r.node);break}case"delete-input":{h0(e,r.resolverId,r.nodeId);break}case"dispose-resolver":{p0(r.resolverId);break}}},xn(e,{type:"ready"})};
|