@highstate/designer 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{77UvFSdd.js → -NXdyIEV.js} +1 -1
- package/.output/public/_nuxt/2jnOiqNC.js +1 -0
- package/.output/public/_nuxt/352AptFn.js +1 -0
- package/.output/public/_nuxt/3RbcgHkU.js +14 -0
- package/.output/public/_nuxt/5-u3YHQd.js +1 -0
- package/.output/public/_nuxt/{Bn5R9WlL.js → A3pA-dEU.js} +1 -1
- package/.output/public/_nuxt/{DvCXikgN.js → B2Q2xBzH.js} +1 -1
- package/.output/public/_nuxt/B3xH1Y0W.js +1 -0
- package/.output/public/_nuxt/{Dfijnsli.js → B8N1sP4y.js} +1 -1
- package/.output/public/_nuxt/{CUu12Pr7.js → BExqDRwH.js} +1 -1
- package/.output/public/_nuxt/{CWvkRFU9.js → BGvNZ_Be.js} +101 -101
- package/.output/public/_nuxt/BKZ346WY.js +2 -0
- package/.output/public/_nuxt/{DRTFVhVr.js → BSawHEJh.js} +1 -1
- package/.output/public/_nuxt/BWDN-9Hx.js +1 -0
- package/.output/public/_nuxt/BYaYzU2p.js +1 -0
- package/.output/public/_nuxt/{-QAUKRUv.js → BbYXjaP8.js} +2 -2
- package/.output/public/_nuxt/Bc-UhGEo.js +1 -0
- package/.output/public/_nuxt/BqAcL3eq.js +1 -0
- package/.output/public/_nuxt/Bsca_muP.js +2 -0
- package/.output/public/_nuxt/BuIQ2wGk.js +1 -0
- package/.output/public/_nuxt/BwBpcI2q.js +1 -0
- package/.output/public/_nuxt/BxFuzIIZ.js +1 -0
- package/.output/public/_nuxt/BzOk-KTc.js +1 -0
- package/.output/public/_nuxt/C-mYaH7u.js +1 -0
- package/.output/public/_nuxt/C2i4Pe8_.js +1 -0
- package/.output/public/_nuxt/{C5DRPdxC.js → C7Ij7g1p.js} +1 -1
- package/.output/public/_nuxt/{CkDbYrMj.js → C7lm33JZ.js} +1 -1
- package/.output/public/_nuxt/{DWjqEyG2.js → CAGxZJ_q.js} +1 -1
- package/.output/public/_nuxt/CC9Mjlxx.js +1 -0
- package/.output/public/_nuxt/CFc9rdAS.js +2 -0
- package/.output/public/_nuxt/CJVpO6nQ.js +1 -0
- package/.output/public/_nuxt/{CWA5Cfde.js → CNrxBMAX.js} +1 -1
- package/.output/public/_nuxt/CPTDoFCr.js +1 -0
- package/.output/public/_nuxt/CSWVWBW7.js +1 -0
- package/.output/public/_nuxt/{Cds-RgoS.js → CVfWNyhe.js} +1 -1
- package/.output/public/_nuxt/CW9RwN2l.js +1 -0
- package/.output/public/_nuxt/CYKlIh8L.js +1 -0
- package/.output/public/_nuxt/{m4Sxwg8n.js → CZyQa1Zc.js} +1 -1
- package/.output/public/_nuxt/{DPQHj1GW.js → CbVegJaT.js} +1 -1
- package/.output/public/_nuxt/{BxGSDLX0.js → Cofyfw8g.js} +1 -1
- package/.output/public/_nuxt/Cq4nuP-7.js +1 -0
- package/.output/public/_nuxt/CriYd4Xu.js +1 -0
- package/.output/public/_nuxt/Ct3ssWsd.js +1 -0
- package/.output/public/_nuxt/D-LsJ2ZE.js +1 -0
- package/.output/public/_nuxt/D1nRrnR_.js +1 -0
- package/.output/public/_nuxt/{MtN3owE1.js → D3MpZ_Sw.js} +1 -1
- package/.output/public/_nuxt/{C5QFcB9K.js → D4_5UqG-.js} +3 -3
- package/.output/public/_nuxt/D5xxahUY.js +1 -0
- package/.output/public/_nuxt/D6EnKPw6.js +1 -0
- package/.output/public/_nuxt/D7ydzmTA.js +1 -0
- package/.output/public/_nuxt/{BgvYz3Nr.js → D9y446qR.js} +1 -1
- package/.output/public/_nuxt/{DVKmRHSk.js → DEdaEI2J.js} +1 -1
- package/.output/public/_nuxt/DGnuSaKc.js +1 -0
- package/.output/public/_nuxt/DH_B79BE.js +1 -0
- package/.output/public/_nuxt/DJwAKlaO.js +1 -0
- package/.output/public/_nuxt/DKbLex6i.js +1 -0
- package/.output/public/_nuxt/DOo85agn.js +1 -0
- package/.output/public/_nuxt/DS4ev0Th.js +1 -0
- package/.output/public/_nuxt/DSTHpVUV.js +1 -0
- package/.output/public/_nuxt/DT8lV676.js +1 -0
- package/.output/public/_nuxt/DXVNaud5.js +1 -0
- package/.output/public/_nuxt/DXfLpys7.js +1 -0
- package/.output/public/_nuxt/DZH0GUvg.js +1 -0
- package/.output/public/_nuxt/DZXawbDK.js +1 -0
- package/.output/public/_nuxt/DcDfdgW1.js +1 -0
- package/.output/public/_nuxt/Deh8i6lm.js +1 -0
- package/.output/public/_nuxt/Desw6Usx.js +1 -0
- package/.output/public/_nuxt/DgMGRJzb.js +1 -0
- package/.output/public/_nuxt/DhjMLkwg.js +1 -0
- package/.output/public/_nuxt/{CuEjdyyj.js → DkZkynzL.js} +1 -1
- package/.output/public/_nuxt/{B4f2rRcR.js → DmGf47KM.js} +1 -1
- package/.output/public/_nuxt/DmVwOSq5.js +1 -0
- package/.output/public/_nuxt/Doxnvpyq.js +1 -0
- package/.output/public/_nuxt/{CChinG0a.js → Dpa6A3ZD.js} +1 -1
- package/.output/public/_nuxt/DqaT_RDK.js +1 -0
- package/.output/public/_nuxt/{DR_djprF.js → Dr_haoD_.js} +1 -1
- package/.output/public/_nuxt/DsRcdFOB.js +1 -0
- package/.output/public/_nuxt/DsxZEVxb.js +12 -0
- package/.output/public/_nuxt/DwfxqiyB.js +1 -0
- package/.output/public/_nuxt/DyDuNLRY.js +6 -0
- package/.output/public/_nuxt/{BxvmPvww.js → DyhJj7Ha.js} +1 -1
- package/.output/public/_nuxt/DysjCpM9.js +1 -0
- package/.output/public/_nuxt/EKqCuazP.js +1 -0
- package/.output/public/_nuxt/Eovi5v4f.js +2 -0
- package/.output/public/_nuxt/JoXnlJ5o.js +1 -0
- package/.output/public/_nuxt/LC_ejPos.js +1 -0
- package/.output/public/_nuxt/Lo988ya0.js +1 -0
- package/.output/public/_nuxt/{B8uKU-iG.js → NdFoamgn.js} +1 -1
- package/.output/public/_nuxt/O5iT7Vr2.js +1 -0
- package/.output/public/_nuxt/{sDoJGqlK.js → SCrI01L1.js} +1 -1
- package/.output/public/_nuxt/SecretValueField.6tAshI0S.css +1 -0
- package/.output/public/_nuxt/{fbfpKHgl.js → VQuDbHHR.js} +1 -1
- package/.output/public/_nuxt/_c6GHTN4.js +1 -0
- package/.output/public/_nuxt/_pageId_.BYW_COCf.css +1 -0
- package/.output/public/_nuxt/_snapshotId_.CfPvWEua.css +1 -0
- package/.output/public/_nuxt/{UXILZBAC.js → aPAh1oAW.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/2a2896ae-2adc-4c6a-ba76-d0ee349bf1e1.json +1 -0
- package/.output/public/_nuxt/{components.a-P9dVi2.css → components.BocgLhsV.css} +1 -1
- package/.output/public/_nuxt/{C-0mRkgR.js → dYgxrjeZ.js} +1 -1
- package/.output/public/_nuxt/{entry.DRnr7AV7.css → entry.BEQZHAc0.css} +1 -1
- package/.output/public/_nuxt/error-404.q4vSXxyS.css +1 -0
- package/.output/public/_nuxt/error-500.pHxFrZvR.css +1 -0
- package/.output/public/_nuxt/graph-resolver-D1NF95s6.js +180 -0
- package/.output/public/_nuxt/{DTYY2tCY.js → hvsd0Qgg.js} +1 -1
- package/.output/public/_nuxt/index.CWmuSE1_.css +1 -0
- package/.output/public/_nuxt/k0GHL-8U.js +1 -0
- package/.output/public/_nuxt/mxKUVBjZ.js +1 -0
- package/.output/public/_nuxt/{operations.D9z3Ystv.css → operations.7Wb0kQP2.css} +1 -1
- package/.output/public/_nuxt/{-WgkZJwX.js → p1qmzON1.js} +1 -1
- package/.output/public/_nuxt/{BqJDg8iS.js → rFQVM1t8.js} +1 -1
- package/.output/public/_nuxt/settings.iYnQn2sh.css +1 -0
- package/.output/public/_nuxt/{iJghVVcV.js → u9IB9fko.js} +1 -1
- package/.output/public/_nuxt/{CaZj7sno.js → uduRkYoI.js} +1 -1
- package/.output/public/_nuxt/{ChBheQRP.js → y7qbSnME.js} +1 -1
- package/.output/public/_nuxt/zPZwXEME.js +2 -0
- package/.output/public/_nuxt/zQpq8Nlt.js +1 -0
- package/.output/server/index.mjs +1884 -1546
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +8 -4
- package/.output/public/_nuxt/0VxYR0Dz.js +0 -1
- package/.output/public/_nuxt/B8ylSe-r.js +0 -1
- package/.output/public/_nuxt/BI2f9uP-.js +0 -1
- package/.output/public/_nuxt/BLI48uDH.js +0 -1
- package/.output/public/_nuxt/BQAu9Fve.js +0 -1
- package/.output/public/_nuxt/BaXvK4sX.js +0 -1
- package/.output/public/_nuxt/BbWhHw7B.js +0 -1
- package/.output/public/_nuxt/BdOV6aLJ.js +0 -1
- package/.output/public/_nuxt/BgGQb96c.js +0 -2
- package/.output/public/_nuxt/Bh96JwGT.js +0 -1
- package/.output/public/_nuxt/Bpl7n9_r.js +0 -1
- package/.output/public/_nuxt/BqIbm1EF.js +0 -1
- package/.output/public/_nuxt/BrCpuEqM.js +0 -1
- package/.output/public/_nuxt/ByRPlNhf.js +0 -1
- package/.output/public/_nuxt/Bz5q1XLL.js +0 -14
- package/.output/public/_nuxt/BzbjXxJd.js +0 -6
- package/.output/public/_nuxt/C-IrfHdq.js +0 -1
- package/.output/public/_nuxt/C1JwrSe7.js +0 -2
- package/.output/public/_nuxt/C4dMoSm9.js +0 -1
- package/.output/public/_nuxt/CBiX8Qk6.js +0 -1
- package/.output/public/_nuxt/CC635Llr.js +0 -1
- package/.output/public/_nuxt/CGLWlIpJ.js +0 -1
- package/.output/public/_nuxt/CGaUcol_.js +0 -1
- package/.output/public/_nuxt/CKkVh4X6.js +0 -1
- package/.output/public/_nuxt/CY7tXH5c.js +0 -1
- package/.output/public/_nuxt/C_1RoKtr.js +0 -1
- package/.output/public/_nuxt/CbbOSnE0.js +0 -1
- package/.output/public/_nuxt/Cke7R5qg.js +0 -1
- package/.output/public/_nuxt/CkzH91yw.js +0 -1
- package/.output/public/_nuxt/Cv3A8XqH.js +0 -1
- package/.output/public/_nuxt/CzkxYs7G.js +0 -1
- package/.output/public/_nuxt/D-5fWV40.js +0 -1
- package/.output/public/_nuxt/D1xR8pBE.js +0 -1
- package/.output/public/_nuxt/DJ5xpYjG.js +0 -1
- package/.output/public/_nuxt/DQLKgX8r.js +0 -1
- package/.output/public/_nuxt/DR05KuQJ.js +0 -1
- package/.output/public/_nuxt/DRck-UV8.js +0 -2
- package/.output/public/_nuxt/DV7MSCWu.js +0 -1
- package/.output/public/_nuxt/Dc6WL_Gw.js +0 -2
- package/.output/public/_nuxt/DdJEKw37.js +0 -2
- package/.output/public/_nuxt/Dzc0ALmG.js +0 -1
- package/.output/public/_nuxt/FtIBRaSq.js +0 -1
- package/.output/public/_nuxt/SecretValueField.Dy80RlGP.css +0 -1
- package/.output/public/_nuxt/TXWXdcZY.js +0 -12
- package/.output/public/_nuxt/V4k_CDL-.js +0 -1
- package/.output/public/_nuxt/VRyQKyno.js +0 -1
- package/.output/public/_nuxt/XbaHEIpm.js +0 -1
- package/.output/public/_nuxt/_pageId_.Be9XJqQA.css +0 -1
- package/.output/public/_nuxt/_snapshotId_.ChuSNeNY.css +0 -1
- package/.output/public/_nuxt/as6CcDUM.js +0 -1
- package/.output/public/_nuxt/builds/meta/8e5022d6-1d1c-4861-b0b7-dc52b699526a.json +0 -1
- package/.output/public/_nuxt/error-404.DnBTUElh.css +0 -1
- package/.output/public/_nuxt/error-500.BNyYF0qG.css +0 -1
- package/.output/public/_nuxt/graph-resolver-BXlQLip4.js +0 -180
- package/.output/public/_nuxt/hunqYsQf.js +0 -1
- package/.output/public/_nuxt/index.CQwfsW5z.css +0 -1
- package/.output/public/_nuxt/mrNv5qht.js +0 -1
- package/.output/public/_nuxt/s8-NXH-d.js +0 -1
- package/.output/public/_nuxt/settings.BjxE_fKi.css +0 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
const Fu="system.export.v1";function L(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 u=o.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){const h=d[p];h in a||(a[h]=u[h].bind(a))}}const s=n?.Parent??Object;class i extends s{}Object.defineProperty(i,"name",{value:t});function o(a){var c;const u=n?.Parent?new i:this;r(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}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 Qt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class La extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const qa={};function At(t){return qa}function Va(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 qs(t,e){return typeof e=="bigint"?e.toString():e}function ns(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function ei(t){return t==null}function ti(t){const e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function Mu(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 we(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 Lt(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Tt(...t){const e={};for(const n of t){const r=Object.getOwnPropertyDescriptors(n);Object.assign(e,r)}return Object.defineProperties({},e)}function Di(t){return JSON.stringify(t)}function Uu(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Za="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Cn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const Lu=ns(()=>{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(Cn(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const n=e.prototype;return!(Cn(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ka(t){return sn(t)?{...t}:Array.isArray(t)?[...t]:t}const qu=new Set(["string","number","symbol"]),Vu=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Mt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nt(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 Zu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const Ku={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 Ju(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=Tt(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 Lt(this,"shape",o),o},checks:[]});return Nt(t,i)}function Hu(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=Tt(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 Lt(this,"shape",o),o},checks:[]});return Nt(t,i)}function Gu(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=Tt(t._zod.def,{get shape(){const i={...t._zod.def.shape,...e};return Lt(this,"shape",i),i}});return Nt(t,s)}function Wu(t,e){if(!sn(e))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Tt(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return Lt(this,"shape",r),r}});return Nt(t,n)}function Yu(t,e){const n=Tt(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e._zod.def.shape};return Lt(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return Nt(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=Tt(e._zod.def,{get shape(){const a=e._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return Lt(this,"shape",c),c},checks:[]});return Nt(e,o)}function Qu(t,e,n){const r=Tt(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 Lt(this,"shape",i),i}});return Nt(e,r)}function Gt(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 Rt(t,e){return e.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(t),n})}function Un(t){return typeof t=="string"?t:t?.message}function Ot(t,e,n){const r={...t,path:t.path??[]};if(!t.message){const s=Un(t.inst?._zod.def?.error?.(t))??Un(e?.error?.(t))??Un(n.customError?.(t))??Un(n.localeError?.(t))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,e?.reportInput||delete r.input,r}function ni(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function xn(...t){const[e,n,r]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:r}:{...e}}const Ja=(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,qs,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Ha=L("$ZodError",Ja),Ga=L("$ZodError",Ja,{Parent:Error});function el(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 tl(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 ri=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 Qt;if(o.issues.length){const a=new(s?.Err??t)(o.issues.map(c=>Ot(c,i,At())));throw Za(a,s?.callee),a}return o.value},si=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=>Ot(c,i,At())));throw Za(a,s?.callee),a}return o.value},rs=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 Qt;return i.issues.length?{success:!1,error:new(t??Ha)(i.issues.map(o=>Ot(o,s,At())))}:{success:!0,data:i.value}},nl=rs(Ga),ss=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=>Ot(o,s,At())))}:{success:!0,data:i.value}},rl=ss(Ga),sl=t=>(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ri(t)(e,n,s)},il=t=>(e,n,r)=>ri(t)(e,n,r),ol=t=>async(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return si(t)(e,n,s)},al=t=>async(e,n,r)=>si(t)(e,n,r),cl=t=>(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return rs(t)(e,n,s)},ul=t=>(e,n,r)=>rs(t)(e,n,r),ll=t=>async(e,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ss(t)(e,n,s)},fl=t=>async(e,n,r)=>ss(t)(e,n,r),dl=/^[cC][^\s-]{8,}$/,hl=/^[0-9a-z]+$/,pl=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ml=/^[0-9a-vA-V]{20}$/,gl=/^[A-Za-z0-9]{27}$/,yl=/^[a-zA-Z0-9_-]{21}$/,wl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vl=/^([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})$/,Ri=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)$/,bl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_l="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function kl(){return new RegExp(_l,"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])$/,$l=/^(([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}|:))$/,El=/^((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])$/,Il=/^(([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])$/,Al=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wa=/^[A-Za-z0-9_-]*$/,Ol=/^\+[1-9]\d{6,14}$/,Ya="(?:(?:\\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])))",Tl=new RegExp(`^${Ya}$`);function Xa(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 Nl(t){return new RegExp(`^${Xa(t)}$`)}function Pl(t){const e=Xa({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(`^${Ya}T(?:${r})$`)}const Cl=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},xl=/^-?\d+$/,Qa=/^-?\d+(?:\.\d+)?$/,jl=/^(?:true|false)$/i,Bl=/^[^A-Z]*$/,Dl=/^[^a-z]*$/,et=L("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),ec={number:"number",bigint:"bigint",object:"date"},tc=L("$ZodCheckLessThan",(t,e)=>{et.init(t,e);const n=ec[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})}}),nc=L("$ZodCheckGreaterThan",(t,e)=>{et.init(t,e);const n=ec[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})}}),Rl=L("$ZodCheckMultipleOf",(t,e)=>{et.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):Mu(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})}}),zl=L("$ZodCheckNumberFormat",(t,e)=>{et.init(t,e),e.format=e.format||"float64";const n=e.format?.includes("int"),r=n?"int":"number",[s,i]=Ku[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=xl)}),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})}}),Fl=L("$ZodCheckMaxLength",(t,e)=>{var n;et.init(t,e),(n=t._zod.def).when??(n.when=r=>{const s=r.value;return!ei(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=ni(s);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),Ml=L("$ZodCheckMinLength",(t,e)=>{var n;et.init(t,e),(n=t._zod.def).when??(n.when=r=>{const s=r.value;return!ei(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=ni(s);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:s,inst:t,continue:!e.abort})}}),Ul=L("$ZodCheckLengthEquals",(t,e)=>{var n;et.init(t,e),(n=t._zod.def).when??(n.when=r=>{const s=r.value;return!ei(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=ni(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})}}),is=L("$ZodCheckStringFormat",(t,e)=>{var n,r;et.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=()=>{})}),Ll=L("$ZodCheckRegex",(t,e)=>{is.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})}}),ql=L("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Bl),is.init(t,e)}),Vl=L("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Dl),is.init(t,e)}),Zl=L("$ZodCheckIncludes",(t,e)=>{et.init(t,e);const n=Mt(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})}}),Kl=L("$ZodCheckStartsWith",(t,e)=>{et.init(t,e);const n=new RegExp(`^${Mt(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})}}),Jl=L("$ZodCheckEndsWith",(t,e)=>{et.init(t,e);const n=new RegExp(`.*${Mt(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})}}),Hl=L("$ZodCheckOverwrite",(t,e)=>{et.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class Gl{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 Wl={major:4,minor:3,patch:6},Se=L("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Wl;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 u=Gt(o),d;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(o))continue}else if(u)continue;const h=o.issues.length,m=p._zod.check(o);if(m instanceof Promise&&c?.async===!1)throw new Qt;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,o.issues.length!==h&&(u||(u=Gt(o,h)))});else{if(o.issues.length===h)continue;u||(u=Gt(o,h))}}return d?d.then(()=>o):o},i=(o,a,c)=>{if(Gt(o))return o.aborted=!0,o;const u=s(a,r,c);if(u instanceof Promise){if(c.async===!1)throw new Qt;return u.then(d=>t._zod.parse(d,c))}return t._zod.parse(u,c)};t._zod.run=(o,a)=>{if(a.skipChecks)return t._zod.parse(o,a);if(a.direction==="backward"){const u=t._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,o,a)):i(u,o,a)}const c=t._zod.parse(o,a);if(c instanceof Promise){if(a.async===!1)throw new Qt;return c.then(u=>s(u,r,a))}return s(c,r,a)}}we(t,"~standard",()=>({validate:s=>{try{const i=nl(t,s);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return rl(t,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ii=L("$ZodString",(t,e)=>{Se.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Cl(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}}),Ne=L("$ZodStringFormat",(t,e)=>{is.init(t,e),ii.init(t,e)}),Yl=L("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=vl),Ne.init(t,e)}),Xl=L("$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=Ri(r))}else e.pattern??(e.pattern=Ri());Ne.init(t,e)}),Ql=L("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=bl),Ne.init(t,e)}),ef=L("$ZodURL",(t,e)=>{Ne.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})}}}),tf=L("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=kl()),Ne.init(t,e)}),nf=L("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=yl),Ne.init(t,e)}),rf=L("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=dl),Ne.init(t,e)}),sf=L("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=hl),Ne.init(t,e)}),of=L("$ZodULID",(t,e)=>{e.pattern??(e.pattern=pl),Ne.init(t,e)}),af=L("$ZodXID",(t,e)=>{e.pattern??(e.pattern=ml),Ne.init(t,e)}),cf=L("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=gl),Ne.init(t,e)}),uf=L("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Pl(e)),Ne.init(t,e)}),lf=L("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Tl),Ne.init(t,e)}),ff=L("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Nl(e)),Ne.init(t,e)}),df=L("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=wl),Ne.init(t,e)}),hf=L("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Sl),Ne.init(t,e),t._zod.bag.format="ipv4"}),pf=L("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=$l),Ne.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})}}}),mf=L("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=El),Ne.init(t,e)}),gf=L("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Il),Ne.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 rc(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const yf=L("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Al),Ne.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{rc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function wf(t){if(!Wa.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return rc(n)}const vf=L("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Wa),Ne.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{wf(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),bf=L("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Ol),Ne.init(t,e)});function _f(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 kf=L("$ZodJWT",(t,e)=>{Ne.init(t,e),t._zod.check=n=>{_f(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),sc=L("$ZodNumber",(t,e)=>{Se.init(t,e),t._zod.pattern=t._zod.bag.pattern??Qa,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}}),Sf=L("$ZodNumberFormat",(t,e)=>{zl.init(t,e),sc.init(t,e)}),$f=L("$ZodBoolean",(t,e)=>{Se.init(t,e),t._zod.pattern=jl,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}}),Ef=L("$ZodUnknown",(t,e)=>{Se.init(t,e),t._zod.parse=n=>n}),If=L("$ZodNever",(t,e)=>{Se.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),Af=L("$ZodDate",(t,e)=>{Se.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 zi(t,e,n){t.issues.length&&e.issues.push(...Rt(n,t.issues)),e.value[n]=t.value}const Of=L("$ZodArray",(t,e)=>{Se.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(u=>zi(u,n,o))):zi(c,n,o)}return i.length?Promise.all(i).then(()=>n):n}});function Jr(t,e,n,r,s){if(t.issues.length){if(s&&!(n in r))return;e.issues.push(...Rt(n,t.issues))}t.value===void 0?n in r&&(e.value[n]=void 0):e.value[n]=t.value}function ic(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=Zu(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function oc(t,e,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,u=c.def.type,d=c.optout==="optional";for(const p in e){if(a.has(p))continue;if(u==="never"){o.push(p);continue}const h=c.run({value:e[p],issues:[]},r);h instanceof Promise?t.push(h.then(m=>Jr(m,n,p,e,d))):Jr(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 Tf=L("$ZodObject",(t,e)=>{if(Se.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=ns(()=>ic(e));we(t._zod,"propValues",()=>{const a=e.shape,c={};for(const u in a){const d=a[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(const p of d.values)c[u].add(p)}}return c});const s=Cn,i=e.catchall;let o;t._zod.parse=(a,c)=>{o??(o=r.value);const u=a.value;if(!s(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),a;a.value={};const d=[],p=o.shape;for(const h of o.keys){const m=p[h],b=m._zod.optout==="optional",w=m._zod.run({value:u[h],issues:[]},c);w instanceof Promise?d.push(w.then(g=>Jr(g,a,h,u,b))):Jr(w,a,h,u,b)}return i?oc(d,u,a,c,r.value,t):d.length?Promise.all(d).then(()=>a):a}}),Nf=L("$ZodObjectJIT",(t,e)=>{Tf.init(t,e);const n=t._zod.parse,r=ns(()=>ic(e)),s=h=>{const m=new Gl(["shape","payload","ctx"]),b=r.value,w=_=>{const I=Di(_);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};m.write("const input = payload.value;");const g=Object.create(null);let k=0;for(const _ of b.keys)g[_]=`key_${k++}`;m.write("const newResult = {};");for(const _ of b.keys){const I=g[_],v=Di(_),O=h[_]?._zod?.optout==="optional";m.write(`const ${I} = ${w(_)};`),O?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(_,I)=>y(h,_,I)};let i;const o=Cn,a=!qa.jitless,u=a&&Lu.value,d=e.catchall;let p;t._zod.parse=(h,m)=>{p??(p=r.value);const b=h.value;return o(b)?a&&u&&m?.async===!1&&m.jitless!==!0?(i||(i=s(e.shape)),h=i(h,m),d?oc([],b,h,m,p,t):h):n(h,m):(h.issues.push({expected:"object",code:"invalid_type",input:b,inst:t}),h)}});function Fi(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=>!Gt(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=>Ot(o,r,At())))}),e)}const ac=L("$ZodUnion",(t,e)=>{Se.init(t,e),we(t._zod,"optin",()=>e.options.some(s=>s._zod.optin==="optional")?"optional":void 0),we(t._zod,"optout",()=>e.options.some(s=>s._zod.optout==="optional")?"optional":void 0),we(t._zod,"values",()=>{if(e.options.every(s=>s._zod.values))return new Set(e.options.flatMap(s=>Array.from(s._zod.values)))}),we(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=>ti(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 u=c._zod.run({value:s.value,issues:[]},i);if(u instanceof Promise)a.push(u),o=!0;else{if(u.issues.length===0)return u;a.push(u)}}return o?Promise.all(a).then(c=>Fi(c,s,t,i)):Fi(a,s,t,i)}}),Pf=L("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ac.init(t,e);const n=t._zod.parse;we(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 u of c)s[a].add(u)}}return s});const r=ns(()=>{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(!Cn(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)}}),Cf=L("$ZodIntersection",(t,e)=>{Se.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,u])=>Mi(n,c,u)):Mi(n,i,o)}});function Vs(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=Vs(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=Vs(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 Mi(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}),Gt(t))return t;const o=Vs(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 xf=L("$ZodTuple",(t,e)=>{Se.init(t,e);const n=e.items;t._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:t,expected:"tuple",code:"invalid_type"}),r;r.value=[];const o=[],a=[...n].reverse().findIndex(d=>d._zod.optin!=="optional"),c=a===-1?0:n.length-a;if(!e.rest){const d=i.length>n.length,p=i.length<c-1;if(d||p)return r.issues.push({...d?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:t,origin:"array"}),r}let u=-1;for(const d of n){if(u++,u>=i.length&&u>=c)continue;const p=d._zod.run({value:i[u],issues:[]},s);p instanceof Promise?o.push(p.then(h=>Ln(h,r,u))):Ln(p,r,u)}if(e.rest){const d=i.slice(n.length);for(const p of d){u++;const h=e.rest._zod.run({value:p,issues:[]},s);h instanceof Promise?o.push(h.then(m=>Ln(m,r,u))):Ln(h,r,u)}}return o.length?Promise.all(o).then(()=>r):r}});function Ln(t,e,n){t.issues.length&&e.issues.push(...Rt(n,t.issues)),e.value[n]=t.value}const jf=L("$ZodRecord",(t,e)=>{Se.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 u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const d=e.valueType._zod.run({value:s[u],issues:[]},r);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&n.issues.push(...Rt(u,p.issues)),n.value[u]=p.value})):(d.issues.length&&n.issues.push(...Rt(u,d.issues)),n.value[u]=d.value)}let c;for(const u in s)a.has(u)||(c=c??[],c.push(u));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"&&Qa.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=>Ot(p,r,At())),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(...Rt(a,p.issues)),n.value[c.value]=p.value})):(d.issues.length&&n.issues.push(...Rt(a,d.issues)),n.value[c.value]=d.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Bf=L("$ZodEnum",(t,e)=>{Se.init(t,e);const n=Va(e.entries),r=new Set(n);t._zod.values=r,t._zod.pattern=new RegExp(`^(${n.filter(s=>qu.has(typeof s)).map(s=>typeof s=="string"?Mt(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}}),Df=L("$ZodLiteral",(t,e)=>{if(Se.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"?Mt(r):r?Mt(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}}),Rf=L("$ZodTransform",(t,e)=>{Se.init(t,e),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new La(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 Qt;return n.value=s,n}});function Ui(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}const cc=L("$ZodOptional",(t,e)=>{Se.init(t,e),t._zod.optin="optional",t._zod.optout="optional",we(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),we(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${ti(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=>Ui(i,n.value)):Ui(s,n.value)}return n.value===void 0?n:e.innerType._zod.run(n,r)}}),zf=L("$ZodExactOptional",(t,e)=>{cc.init(t,e),we(t._zod,"values",()=>e.innerType._zod.values),we(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,r)=>e.innerType._zod.run(n,r)}),Ff=L("$ZodNullable",(t,e)=>{Se.init(t,e),we(t._zod,"optin",()=>e.innerType._zod.optin),we(t._zod,"optout",()=>e.innerType._zod.optout),we(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${ti(n.source)}|null)$`):void 0}),we(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)}),Mf=L("$ZodDefault",(t,e)=>{Se.init(t,e),t._zod.optin="optional",we(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=>Li(i,e)):Li(s,e)}});function Li(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const Uf=L("$ZodPrefault",(t,e)=>{Se.init(t,e),t._zod.optin="optional",we(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))}),Lf=L("$ZodNonOptional",(t,e)=>{Se.init(t,e),we(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=>qi(i,t)):qi(s,t)}});function qi(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 qf=L("$ZodCatch",(t,e)=>{Se.init(t,e),we(t._zod,"optin",()=>e.innerType._zod.optin),we(t._zod,"optout",()=>e.innerType._zod.optout),we(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=>Ot(o,r,At()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=e.catchValue({...n,error:{issues:s.issues.map(i=>Ot(i,r,At()))},input:n.value}),n.issues=[]),n)}}),Vf=L("$ZodPipe",(t,e)=>{Se.init(t,e),we(t._zod,"values",()=>e.in._zod.values),we(t._zod,"optin",()=>e.in._zod.optin),we(t._zod,"optout",()=>e.out._zod.optout),we(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=>qn(o,e.in,r)):qn(i,e.in,r)}const s=e.in._zod.run(n,r);return s instanceof Promise?s.then(i=>qn(i,e.out,r)):qn(s,e.out,r)}});function qn(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},n)}const Zf=L("$ZodCodec",(t,e)=>{Se.init(t,e),we(t._zod,"values",()=>e.in._zod.values),we(t._zod,"optin",()=>e.in._zod.optin),we(t._zod,"optout",()=>e.out._zod.optout),we(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=>Vn(o,e,r)):Vn(i,e,r)}else{const i=e.out._zod.run(n,r);return i instanceof Promise?i.then(o=>Vn(o,e,r)):Vn(i,e,r)}}});function Vn(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=>Zn(t,i,e.out,n)):Zn(t,s,e.out,n)}else{const s=e.reverseTransform(t.value,t);return s instanceof Promise?s.then(i=>Zn(t,i,e.in,n)):Zn(t,s,e.in,n)}}function Zn(t,e,n,r){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},r)}const Kf=L("$ZodReadonly",(t,e)=>{Se.init(t,e),we(t._zod,"propValues",()=>e.innerType._zod.propValues),we(t._zod,"values",()=>e.innerType._zod.values),we(t._zod,"optin",()=>e.innerType?._zod?.optin),we(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(Vi):Vi(s)}});function Vi(t){return t.value=Object.freeze(t.value),t}const Jf=L("$ZodTemplateLiteral",(t,e)=>{Se.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||Vu.has(typeof r))n.push(Mt(`${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)}),Hf=L("$ZodCustom",(t,e)=>{et.init(t,e),Se.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=>Zi(i,n,r,t));Zi(s,n,r,t)}});function Zi(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(xn(s))}}var Ki;class Gf{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 Wf(){return new Gf}(Ki=globalThis).__zod_globalRegistry??(Ki.__zod_globalRegistry=Wf());const En=globalThis.__zod_globalRegistry;function Yf(t,e){return new t({type:"string",...te(e)})}function uc(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...te(e)})}function Ji(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 Qf(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(e)})}function ed(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(e)})}function td(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(e)})}function lc(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...te(e)})}function nd(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...te(e)})}function rd(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(e)})}function sd(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...te(e)})}function fc(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(e)})}function id(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...te(e)})}function od(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...te(e)})}function ad(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(e)})}function cd(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(e)})}function ud(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(e)})}function ld(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(e)})}function fd(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(e)})}function dd(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...te(e)})}function hd(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...te(e)})}function pd(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...te(e)})}function md(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...te(e)})}function gd(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(e)})}function yd(t,e){return new t({type:"string",format:"date",check:"string_format",...te(e)})}function wd(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...te(e)})}function vd(t,e){return new t({type:"string",format:"duration",check:"string_format",...te(e)})}function bd(t,e){return new t({type:"number",checks:[],...te(e)})}function _d(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...te(e)})}function kd(t,e){return new t({type:"boolean",...te(e)})}function Sd(t,e){return new t({type:"boolean",coerce:!0,...te(e)})}function $d(t){return new t({type:"unknown"})}function Ed(t,e){return new t({type:"never",...te(e)})}function Id(t,e){return new t({type:"date",...te(e)})}function Hi(t,e){return new tc({check:"less_than",...te(e),value:t,inclusive:!1})}function Fr(t,e){return new tc({check:"less_than",...te(e),value:t,inclusive:!0})}function Gi(t,e){return new nc({check:"greater_than",...te(e),value:t,inclusive:!1})}function Mr(t,e){return new nc({check:"greater_than",...te(e),value:t,inclusive:!0})}function Wi(t,e){return new Rl({check:"multiple_of",...te(e),value:t})}function dc(t,e){return new Fl({check:"max_length",...te(e),maximum:t})}function Hr(t,e){return new Ml({check:"min_length",...te(e),minimum:t})}function hc(t,e){return new Ul({check:"length_equals",...te(e),length:t})}function Ad(t,e){return new Ll({check:"string_format",format:"regex",...te(e),pattern:t})}function Od(t){return new ql({check:"string_format",format:"lowercase",...te(t)})}function Td(t){return new Vl({check:"string_format",format:"uppercase",...te(t)})}function Nd(t,e){return new Zl({check:"string_format",format:"includes",...te(e),includes:t})}function Pd(t,e){return new Kl({check:"string_format",format:"starts_with",...te(e),prefix:t})}function Cd(t,e){return new Jl({check:"string_format",format:"ends_with",...te(e),suffix:t})}function un(t){return new Hl({check:"overwrite",tx:t})}function xd(t){return un(e=>e.normalize(t))}function jd(){return un(t=>t.trim())}function Bd(){return un(t=>t.toLowerCase())}function Dd(){return un(t=>t.toUpperCase())}function Rd(){return un(t=>Uu(t))}function zd(t,e,n){return new t({type:"array",element:e,...te(n)})}function Fd(t,e,n){const r=te(n);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function Md(t,e,n){return new t({type:"custom",check:"custom",fn:e,...te(n)})}function Ud(t){const e=Ld(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(xn(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(xn(s))}},t(n.value,n)));return e}function Ld(t,e){const n=new et({check:"custom",...te(e)});return n._zod.check=t,n}function pc(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 De(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),De(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"&&We(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 mc(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??(b=>b);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 u=`#/${a}/`,d=o[1].schema.id??`__schema${t.counter++}`;return{defId:d,ref:u+d}},i=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:c,defId:u}=s(o);a.def={...a.schema},u&&(a.defId=u);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 u=t.external.registry.get(o[0])?.id;if(e!==o[0]&&u){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 gc(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,u={...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,u),o._zod.parent===d)for(const w in c)w==="$ref"||w==="allOf"||w in u||delete c[w];if(m.$ref&&h.def)for(const w in c)w==="$ref"||w==="allOf"||w in h.def&&JSON.stringify(c[w])===JSON.stringify(h.def[w])&&delete c[w]}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:Gr(e,"input",t.processors),output:Gr(e,"output",t.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function We(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 We(r.element,n);if(r.type==="set")return We(r.valueType,n);if(r.type==="lazy")return We(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 We(r.innerType,n);if(r.type==="intersection")return We(r.left,n)||We(r.right,n);if(r.type==="record"||r.type==="map")return We(r.keyType,n)||We(r.valueType,n);if(r.type==="pipe")return We(r.in,n)||We(r.out,n);if(r.type==="object"){for(const s in r.shape)if(We(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(We(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(We(s,n))return!0;return!!(r.rest&&We(r.rest,n))}return!1}const qd=(t,e={})=>n=>{const r=pc({...n,processors:e});return De(t,r),mc(r,t),gc(r,t)},Gr=(t,e,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=pc({...s??{},target:i,io:e,processors:n});return De(t,o),mc(o,t),gc(o,t)},Vd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zd=(t,e,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),a&&(s.format=Vd[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),u&&(s.contentEncoding=u),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}))])}},Kd=(t,e,n,r)=>{const s=n,{minimum:i,maximum:o,format:a,multipleOf:c,exclusiveMaximum:u,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 u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u),typeof o=="number"&&(s.maximum=o,typeof u=="number"&&e.target!=="draft-04"&&(u<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},Jd=(t,e,n,r)=>{n.type="boolean"},Hd=(t,e,n,r)=>{n.not={}},Gd=(t,e,n,r)=>{},Wd=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Yd=(t,e,n,r)=>{const s=t._zod.def,i=Va(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},Qd=(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},eh=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},th=(t,e,n,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},nh=(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=De(i.element,e,{...r,path:[...r.path,"items"]})},rh=(t,e,n,r)=>{const s=n,i=t._zod.def;s.type="object",s.properties={};const o=i.shape;for(const u in o)s.properties[u]=De(o[u],e,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(u=>{const d=i.shape[u]._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=De(i.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(s.additionalProperties=!1)},sh=(t,e,n,r)=>{const s=t._zod.def,i=s.inclusive===!1,o=s.options.map((a,c)=>De(a,e,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=o:n.anyOf=o},ih=(t,e,n,r)=>{const s=t._zod.def,i=De(s.left,e,{...r,path:[...r.path,"allOf",0]}),o=De(s.right,e,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=c},oh=(t,e,n,r)=>{const s=n,i=t._zod.def;s.type="array";const o=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((h,m)=>De(h,e,{...r,path:[...r.path,o,m]})),u=i.rest?De(i.rest,e,{...r,path:[...r.path,a,...e.target==="openapi-3.0"?[i.items.length]:[]]}):null;e.target==="draft-2020-12"?(s.prefixItems=c,u&&(s.items=u)):e.target==="openapi-3.0"?(s.items={anyOf:c},u&&s.items.anyOf.push(u),s.minItems=c.length,u||(s.maxItems=c.length)):(s.items=c,u&&(s.additionalItems=u));const{minimum:d,maximum:p}=t._zod.bag;typeof d=="number"&&(s.minItems=d),typeof p=="number"&&(s.maxItems=p)},ah=(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=De(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=De(i.keyType,e,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=De(i.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const u=o._zod.values;if(u){const d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(s.required=d)}},ch=(t,e,n,r)=>{const s=t._zod.def,i=De(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"}]},uh=(t,e,n,r)=>{const s=t._zod.def;De(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},lh=(t,e,n,r)=>{const s=t._zod.def;De(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},fh=(t,e,n,r)=>{const s=t._zod.def;De(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)))},dh=(t,e,n,r)=>{const s=t._zod.def;De(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},hh=(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;De(i,e,r);const o=e.seen.get(t);o.ref=i},ph=(t,e,n,r)=>{const s=t._zod.def;De(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType,n.readOnly=!0},yc=(t,e,n,r)=>{const s=t._zod.def;De(s.innerType,e,r);const i=e.seen.get(t);i.ref=s.innerType},mh=L("ZodISODateTime",(t,e)=>{uf.init(t,e),Ce.init(t,e)});function gh(t){return gd(mh,t)}const yh=L("ZodISODate",(t,e)=>{lf.init(t,e),Ce.init(t,e)});function wh(t){return yd(yh,t)}const vh=L("ZodISOTime",(t,e)=>{ff.init(t,e),Ce.init(t,e)});function bh(t){return wd(vh,t)}const _h=L("ZodISODuration",(t,e)=>{df.init(t,e),Ce.init(t,e)});function kh(t){return vd(_h,t)}const Sh=(t,e)=>{Ha.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>tl(t,n)},flatten:{value:n=>el(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,qs,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,qs,2)}},isEmpty:{get(){return t.issues.length===0}}})},ct=L("ZodError",Sh,{Parent:Error}),$h=ri(ct),Eh=si(ct),Ih=rs(ct),Ah=ss(ct),Oh=sl(ct),Th=il(ct),Nh=ol(ct),Ph=al(ct),Ch=cl(ct),xh=ul(ct),jh=ll(ct),Bh=fl(ct),Ie=L("ZodType",(t,e)=>(Se.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Gr(t,"input"),output:Gr(t,"output")}}),t.toJSONSchema=qd(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone(Tt(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)=>Nt(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>$h(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>Ih(t,n,r),t.parseAsync=async(n,r)=>Eh(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>Ah(t,n,r),t.spa=t.safeParseAsync,t.encode=(n,r)=>Oh(t,n,r),t.decode=(n,r)=>Th(t,n,r),t.encodeAsync=async(n,r)=>Nh(t,n,r),t.decodeAsync=async(n,r)=>Ph(t,n,r),t.safeEncode=(n,r)=>Ch(t,n,r),t.safeDecode=(n,r)=>xh(t,n,r),t.safeEncodeAsync=async(n,r)=>jh(t,n,r),t.safeDecodeAsync=async(n,r)=>Bh(t,n,r),t.refine=(n,r)=>t.check(Op(n,r)),t.superRefine=n=>t.check(Tp(n)),t.overwrite=n=>t.check(un(n)),t.optional=()=>Qi(t),t.exactOptional=()=>pp(t),t.nullable=()=>eo(t),t.nullish=()=>Qi(eo(t)),t.nonoptional=n=>bp(t,n),t.array=()=>ve(t),t.or=n=>qt([t,n]),t.and=n=>ap(t,n),t.transform=n=>to(t,dp(n)),t.default=n=>yp(t,n),t.prefault=n=>vp(t,n),t.catch=n=>kp(t,n),t.pipe=n=>to(t,n),t.readonly=()=>Ip(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)),wc=L("_ZodString",(t,e)=>{ii.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Zd(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(Ad(...r)),t.includes=(...r)=>t.check(Nd(...r)),t.startsWith=(...r)=>t.check(Pd(...r)),t.endsWith=(...r)=>t.check(Cd(...r)),t.min=(...r)=>t.check(Hr(...r)),t.max=(...r)=>t.check(dc(...r)),t.length=(...r)=>t.check(hc(...r)),t.nonempty=(...r)=>t.check(Hr(1,...r)),t.lowercase=r=>t.check(Od(r)),t.uppercase=r=>t.check(Td(r)),t.trim=()=>t.check(jd()),t.normalize=(...r)=>t.check(xd(...r)),t.toLowerCase=()=>t.check(Bd()),t.toUpperCase=()=>t.check(Dd()),t.slugify=()=>t.check(Rd())}),Dh=L("ZodString",(t,e)=>{ii.init(t,e),wc.init(t,e),t.email=n=>t.check(uc(vc,n)),t.url=n=>t.check(lc(bc,n)),t.jwt=n=>t.check(md(Yh,n)),t.emoji=n=>t.check(nd(zh,n)),t.guid=n=>t.check(Ji(Yi,n)),t.uuid=n=>t.check(Xf(Kn,n)),t.uuidv4=n=>t.check(Qf(Kn,n)),t.uuidv6=n=>t.check(ed(Kn,n)),t.uuidv7=n=>t.check(td(Kn,n)),t.nanoid=n=>t.check(rd(Fh,n)),t.guid=n=>t.check(Ji(Yi,n)),t.cuid=n=>t.check(sd(Mh,n)),t.cuid2=n=>t.check(fc(_c,n)),t.ulid=n=>t.check(id(Uh,n)),t.base64=n=>t.check(dd(Hh,n)),t.base64url=n=>t.check(hd(Gh,n)),t.xid=n=>t.check(od(Lh,n)),t.ksuid=n=>t.check(ad(qh,n)),t.ipv4=n=>t.check(cd(Vh,n)),t.ipv6=n=>t.check(ud(Zh,n)),t.cidrv4=n=>t.check(ld(Kh,n)),t.cidrv6=n=>t.check(fd(Jh,n)),t.e164=n=>t.check(pd(Wh,n)),t.datetime=n=>t.check(gh(n)),t.date=n=>t.check(wh(n)),t.time=n=>t.check(bh(n)),t.duration=n=>t.check(kh(n))});function N(t){return Yf(Dh,t)}const Ce=L("ZodStringFormat",(t,e)=>{Ne.init(t,e),wc.init(t,e)}),vc=L("ZodEmail",(t,e)=>{Ql.init(t,e),Ce.init(t,e)});function Rh(t){return uc(vc,t)}const Yi=L("ZodGUID",(t,e)=>{Yl.init(t,e),Ce.init(t,e)}),Kn=L("ZodUUID",(t,e)=>{Xl.init(t,e),Ce.init(t,e)}),bc=L("ZodURL",(t,e)=>{ef.init(t,e),Ce.init(t,e)});function oi(t){return lc(bc,t)}const zh=L("ZodEmoji",(t,e)=>{tf.init(t,e),Ce.init(t,e)}),Fh=L("ZodNanoID",(t,e)=>{nf.init(t,e),Ce.init(t,e)}),Mh=L("ZodCUID",(t,e)=>{rf.init(t,e),Ce.init(t,e)}),_c=L("ZodCUID2",(t,e)=>{sf.init(t,e),Ce.init(t,e)});function ee(t){return fc(_c,t)}const Uh=L("ZodULID",(t,e)=>{of.init(t,e),Ce.init(t,e)}),Lh=L("ZodXID",(t,e)=>{af.init(t,e),Ce.init(t,e)}),qh=L("ZodKSUID",(t,e)=>{cf.init(t,e),Ce.init(t,e)}),Vh=L("ZodIPv4",(t,e)=>{hf.init(t,e),Ce.init(t,e)}),Zh=L("ZodIPv6",(t,e)=>{pf.init(t,e),Ce.init(t,e)}),Kh=L("ZodCIDRv4",(t,e)=>{mf.init(t,e),Ce.init(t,e)}),Jh=L("ZodCIDRv6",(t,e)=>{gf.init(t,e),Ce.init(t,e)}),Hh=L("ZodBase64",(t,e)=>{yf.init(t,e),Ce.init(t,e)}),Gh=L("ZodBase64URL",(t,e)=>{vf.init(t,e),Ce.init(t,e)}),Wh=L("ZodE164",(t,e)=>{bf.init(t,e),Ce.init(t,e)}),Yh=L("ZodJWT",(t,e)=>{kf.init(t,e),Ce.init(t,e)}),kc=L("ZodNumber",(t,e)=>{sc.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Kd(t,r,s),t.gt=(r,s)=>t.check(Gi(r,s)),t.gte=(r,s)=>t.check(Mr(r,s)),t.min=(r,s)=>t.check(Mr(r,s)),t.lt=(r,s)=>t.check(Hi(r,s)),t.lte=(r,s)=>t.check(Fr(r,s)),t.max=(r,s)=>t.check(Fr(r,s)),t.int=r=>t.check(Xi(r)),t.safe=r=>t.check(Xi(r)),t.positive=r=>t.check(Gi(0,r)),t.nonnegative=r=>t.check(Mr(0,r)),t.negative=r=>t.check(Hi(0,r)),t.nonpositive=r=>t.check(Fr(0,r)),t.multipleOf=(r,s)=>t.check(Wi(r,s)),t.step=(r,s)=>t.check(Wi(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 Me(t){return bd(kc,t)}const Xh=L("ZodNumberFormat",(t,e)=>{Sf.init(t,e),kc.init(t,e)});function Xi(t){return _d(Xh,t)}const Sc=L("ZodBoolean",(t,e)=>{$f.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Jd(t,n,r)});function ye(t){return kd(Sc,t)}const Qh=L("ZodUnknown",(t,e)=>{Ef.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Gd()});function mt(){return $d(Qh)}const ep=L("ZodNever",(t,e)=>{If.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Hd(t,n,r)});function tp(t){return Ed(ep,t)}const np=L("ZodDate",(t,e)=>{Af.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Wd(t,r),t.min=(r,s)=>t.check(Mr(r,s)),t.max=(r,s)=>t.check(Fr(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 ce(t){return Id(np,t)}const rp=L("ZodArray",(t,e)=>{Of.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>nh(t,n,r,s),t.element=e.element,t.min=(n,r)=>t.check(Hr(n,r)),t.nonempty=n=>t.check(Hr(1,n)),t.max=(n,r)=>t.check(dc(n,r)),t.length=(n,r)=>t.check(hc(n,r)),t.unwrap=()=>t.element});function ve(t,e){return zd(rp,t,e)}const sp=L("ZodObject",(t,e)=>{Nf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>rh(t,n,r,s),we(t,"shape",()=>e.shape),t.keyof=()=>tt(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:mt()}),t.loose=()=>t.clone({...t._zod.def,catchall:mt()}),t.strict=()=>t.clone({...t._zod.def,catchall:tp()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>Gu(t,n),t.safeExtend=n=>Wu(t,n),t.merge=n=>Yu(t,n),t.pick=n=>Ju(t,n),t.omit=n=>Hu(t,n),t.partial=(...n)=>Xu(Ic,t,n[0]),t.required=(...n)=>Qu(Ac,t,n[0])});function R(t,e){const n={type:"object",shape:t??{},...te(e)};return new sp(n)}const $c=L("ZodUnion",(t,e)=>{ac.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>sh(t,n,r,s),t.options=e.options});function qt(t,e){return new $c({type:"union",options:t,...te(e)})}const ip=L("ZodDiscriminatedUnion",(t,e)=>{$c.init(t,e),Pf.init(t,e)});function rt(t,e,n){return new ip({type:"union",options:e,discriminator:t,...te(n)})}const op=L("ZodIntersection",(t,e)=>{Cf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>ih(t,n,r,s)});function ap(t,e){return new op({type:"intersection",left:t,right:e})}const cp=L("ZodTuple",(t,e)=>{xf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>oh(t,n,r,s),t.rest=n=>t.clone({...t._zod.def,rest:n})});function Ec(t,e,n){const r=e instanceof Se,s=r?n:e,i=r?e:null;return new cp({type:"tuple",items:t,rest:i,...te(s)})}const up=L("ZodRecord",(t,e)=>{jf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>ah(t,n,r,s),t.keyType=e.keyType,t.valueType=e.valueType});function Pe(t,e,n){return new up({type:"record",keyType:t,valueType:e,...te(n)})}const Zs=L("ZodEnum",(t,e)=>{Bf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(r,s,i)=>Yd(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 Zs({...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 Zs({...e,checks:[],...te(s),entries:i})}});function tt(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Zs({type:"enum",entries:n,...te(e)})}const lp=L("ZodLiteral",(t,e)=>{Df.init(t,e),Ie.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 ae(t,e){return new lp({type:"literal",values:Array.isArray(t)?t:[t],...te(e)})}const fp=L("ZodTransform",(t,e)=>{Rf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>th(t,n),t._zod.parse=(n,r)=>{if(r.direction==="backward")throw new La(t.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(xn(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(xn(o))}};const s=e.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function dp(t){return new fp({type:"transform",transform:t})}const Ic=L("ZodOptional",(t,e)=>{cc.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>yc(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Qi(t){return new Ic({type:"optional",innerType:t})}const hp=L("ZodExactOptional",(t,e)=>{zf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>yc(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function pp(t){return new hp({type:"optional",innerType:t})}const mp=L("ZodNullable",(t,e)=>{Ff.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>ch(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function eo(t){return new mp({type:"nullable",innerType:t})}const gp=L("ZodDefault",(t,e)=>{Mf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>lh(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function yp(t,e){return new gp({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():Ka(e)}})}const wp=L("ZodPrefault",(t,e)=>{Uf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>fh(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function vp(t,e){return new wp({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():Ka(e)}})}const Ac=L("ZodNonOptional",(t,e)=>{Lf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>uh(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function bp(t,e){return new Ac({type:"nonoptional",innerType:t,...te(e)})}const _p=L("ZodCatch",(t,e)=>{qf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>dh(t,n,r,s),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function kp(t,e){return new _p({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const Oc=L("ZodPipe",(t,e)=>{Vf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>hh(t,n,r,s),t.in=e.in,t.out=e.out});function to(t,e){return new Oc({type:"pipe",in:t,out:e})}const Sp=L("ZodCodec",(t,e)=>{Oc.init(t,e),Zf.init(t,e)});function $p(t,e,n){return new Sp({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}const Ep=L("ZodReadonly",(t,e)=>{Kf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>ph(t,n,r,s),t.unwrap=()=>t._zod.def.innerType});function Ip(t){return new Ep({type:"readonly",innerType:t})}const Ap=L("ZodTemplateLiteral",(t,e)=>{Jf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>Qd(t,n,r)});function Ur(t,e){return new Ap({type:"template_literal",parts:t,...te(e)})}const ai=L("ZodCustom",(t,e)=>{Hf.init(t,e),Ie.init(t,e),t._zod.processJSONSchema=(n,r,s)=>eh(t,n)});function en(t,e){return Fd(ai,(()=>!0),e)}function Op(t,e={}){return Md(ai,t,e)}function Tp(t){return Ud(t)}function Np(t,e={}){const n=new ai({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 Pp(t){return Sd(Sc,t)}function Cp(t,e,n){let r=s=>t(s,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function Tc(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return Cp(t,e,n);throw Error("Wrong number of arguments")}const Nc={done:!1,hasNext:!1};function no(t,...e){let n=t,r=e.map(i=>"lazy"in i?xp(i):void 0),s=0;for(;s<e.length;){if(r[s]===void 0||!jp(n)){let c=e[s];n=c(n),s+=1;continue}let i=[];for(let c=s;c<e.length;c++){let u=r[c];if(u===void 0||(i.push(u),u.isSingle))break}let o=[];for(let c of n)if(Pc(c,o,i))break;let{isSingle:a}=i.at(-1);n=a?o[0]:o,s+=i.length}return n}function Pc(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,s=Nc,i=!1;for(let[o,a]of n.entries()){let{index:c,items:u}=a;if(u.push(r),s=a(r,c,u),a.index+=1,s.hasNext){if(s.hasMany??!1){for(let d of s.next)if(Pc(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 xp(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function jp(t){return typeof t=="string"||typeof t=="object"&&!!t&&Symbol.iterator in t}function Bp(t,e){let n=e.length-t.length;if(n===1){let[r,...s]=e;return no(r,{lazy:t,lazyArgs:s})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(s=>no(s,r),r)}throw Error("Wrong number of arguments")}function Dp(...t){return Tc(Object.fromEntries,t)}function Rp(...t){return Tc(zp,t)}function zp(t,e){let n={};for(let[r,s]of Object.entries(t))n[r]=e(s,r,t);return n}function Fp(...t){return Bp(Mp,t)}function Mp(){let t=new Set;return e=>t.has(e)?Nc:(t.add(e),{done:!1,hasNext:!0,next:e})}const ci=Symbol.for("yaml.alias"),Ks=Symbol.for("yaml.document"),It=Symbol.for("yaml.map"),Cc=Symbol.for("yaml.pair"),gt=Symbol.for("yaml.scalar"),ln=Symbol.for("yaml.seq"),at=Symbol.for("yaml.node.type"),fn=t=>!!t&&typeof t=="object"&&t[at]===ci,os=t=>!!t&&typeof t=="object"&&t[at]===Ks,Dn=t=>!!t&&typeof t=="object"&&t[at]===It,Fe=t=>!!t&&typeof t=="object"&&t[at]===Cc,Ae=t=>!!t&&typeof t=="object"&&t[at]===gt,Rn=t=>!!t&&typeof t=="object"&&t[at]===ln;function Re(t){if(t&&typeof t=="object")switch(t[at]){case It:case ln:return!0}return!1}function ze(t){if(t&&typeof t=="object")switch(t[at]){case ci:case It:case gt:case ln:return!0}return!1}const xc=t=>(Ae(t)||Re(t))&&!!t.anchor,Dt=Symbol("break visit"),Up=Symbol("skip children"),Nn=Symbol("remove node");function dn(t,e){const n=Lp(e);os(t)?Wt(null,t.contents,n,Object.freeze([t]))===Nn&&(t.contents=null):Wt(null,t,n,Object.freeze([]))}dn.BREAK=Dt;dn.SKIP=Up;dn.REMOVE=Nn;function Wt(t,e,n,r){const s=qp(t,e,n,r);if(ze(s)||Fe(s))return Vp(t,r,s),Wt(t,s,n,r);if(typeof s!="symbol"){if(Re(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===Nn&&(e.items.splice(i,1),i-=1)}}}else if(Fe(e)){r=Object.freeze(r.concat(e));const i=Wt("key",e.key,n,r);if(i===Dt)return Dt;i===Nn&&(e.key=null);const o=Wt("value",e.value,n,r);if(o===Dt)return Dt;o===Nn&&(e.value=null)}}return s}function Lp(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 qp(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(Dn(e))return n.Map?.(t,e,r);if(Rn(e))return n.Seq?.(t,e,r);if(Fe(e))return n.Pair?.(t,e,r);if(Ae(e))return n.Scalar?.(t,e,r);if(fn(e))return n.Alias?.(t,e,r)}function Vp(t,e,n){const r=e[e.length-1];if(Re(r))r.items[t]=n;else if(Fe(r))t==="key"?r.key=n:r.value=n;else if(os(r))r.contents=n;else{const s=fn(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}const Zp={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Kp=t=>t.replace(/[!,[\]{}]/g,e=>Zp[e]);class Ye{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ye.defaultYaml,e),this.tags=Object.assign({},Ye.defaultTags,n)}clone(){const e=new Ye(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Ye(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ye.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ye.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:Ye.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ye.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+Kp(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&&ze(e.contents)){const i={};dn(e.contents,(o,a)=>{ze(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
|
+
`)}}Ye.defaultYaml={explicit:!1,version:"1.2"};Ye.defaultTags={"!!":"tag:yaml.org,2002:"};function jc(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 Bc(t){const e=new Set;return dn(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function Dc(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function Jp(t,e){const n=[],r=new Map;let s=null;return{onAnchor:i=>{n.push(i),s??(s=Bc(t));const o=Dc(e,s);return s.add(o),o},setAnchors:()=>{for(const i of n){const o=r.get(i);if(typeof o=="object"&&o.anchor&&(Ae(o.node)||Re(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 ot(t,e,n){if(Array.isArray(t))return t.map((r,s)=>ot(r,String(s),n));if(t&&typeof t.toJSON=="function"){if(!n||!xc(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 ui{constructor(e){Object.defineProperty(this,at,{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(!os(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=ot(this,"",o);if(typeof s=="function")for(const{count:c,res:u}of o.anchors.values())s(u,c);return typeof i=="function"?Yt(i,{"":a},"",a):a}}class li extends ui{constructor(e){super(ci),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],dn(e,{Node:(i,o)=>{(fn(o)||xc(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||(ot(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=Lr(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(jc(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 Lr(t,e,n){if(fn(e)){const r=e.resolve(t),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(Re(e)){let r=0;for(const s of e.items){const i=Lr(t,s,n);i>r&&(r=i)}return r}else if(Fe(e)){const r=Lr(t,e.key,n),s=Lr(t,e.value,n);return Math.max(r,s)}return 1}const Rc=t=>!t||typeof t!="function"&&typeof t!="object";class fe extends ui{constructor(e){super(gt),this.value=e}toJSON(e,n){return n?.keep?this.value:ot(this.value,e,n)}toString(){return String(this.value)}}fe.BLOCK_FOLDED="BLOCK_FOLDED";fe.BLOCK_LITERAL="BLOCK_LITERAL";fe.PLAIN="PLAIN";fe.QUOTE_DOUBLE="QUOTE_DOUBLE";fe.QUOTE_SINGLE="QUOTE_SINGLE";const Hp="tag:yaml.org,2002:";function Gp(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 jn(t,e,n){if(os(t)&&(t=t.contents),ze(t))return t;if(Fe(t)){const p=n.schema[It].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 li(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Hp+e.slice(2));let u=Gp(t,e,o.tags);if(!u){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new fe(t);return c&&(c.node=p),p}u=t instanceof Map?o[It]:Symbol.iterator in Object(t)?o[ln]:o[It]}i&&(i(u),delete n.onTagObj);const d=u?.createNode?u.createNode(n.schema,t,n):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(n.schema,t,n):new fe(t);return e?d.tag=e:u.default||(d.tag=u.tag),c&&(c.node=d),d}function Wr(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 jn(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 In=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class zc extends ui{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=>ze(r)||Fe(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(In(e))this.add(n);else{const[r,...s]=e,i=this.get(r,!0);if(Re(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Wr(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(Re(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&&Ae(i)?i.value:i:Re(i)?i.getIn(s,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!Fe(n))return!1;const r=n.value;return r==null||e&&Ae(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 Re(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(Re(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Wr(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const Wp=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function _t(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const zt=(t,e,n)=>t.endsWith(`
|
|
41
|
+
`)?_t(n,e):n.includes(`
|
|
42
|
+
`)?`
|
|
43
|
+
`+_t(n,e):(t.endsWith(" ")?"":" ")+n,Fc="flow",Js="block",qr="quoted";function as(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 u=[],d={};let p=s-e.length;typeof r=="number"&&(r>s-Math.max(2,i)?u.push(0):p=s-r);let h,m,b=!1,w=-1,g=-1,k=-1;n===Js&&(w=ro(t,w,e.length),w!==-1&&(p=w+c));for(let _;_=t[w+=1];){if(n===qr&&_==="\\"){switch(g=w,t[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}k=w}if(_===`
|
|
44
|
+
`)n===Js&&(w=ro(t,w,e.length)),p=w+e.length+c,h=void 0;else{if(_===" "&&m&&m!==" "&&m!==`
|
|
45
|
+
`&&m!==" "){const I=t[w+1];I&&I!==" "&&I!==`
|
|
46
|
+
`&&I!==" "&&(h=w)}if(w>=p)if(h)u.push(h),p=h+c,h=void 0;else if(n===qr){for(;m===" "||m===" ";)m=_,_=t[w+=1],b=!0;const I=w>k+1?w-2:g-1;if(d[I])return t;u.push(I),d[I]=!0,p=I+c,h=void 0}else b=!0}m=_}if(b&&a&&a(),u.length===0)return t;o&&o();let y=t.slice(0,u[0]);for(let _=0;_<u.length;++_){const I=u[_],v=u[_+1]||t.length;I===0?y=`
|
|
47
|
+
${e}${t.slice(0,v)}`:(n===qr&&d[I]&&(y+=`${t[I]}\\`),y+=`
|
|
48
|
+
${e}${t.slice(I+1,v)}`)}return y}function ro(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 cs=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),us=t=>/^(%|---|\.\.\.)/m.test(t);function Yp(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 Pn(t,e){const n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=e,s=e.options.doubleQuotedMinMultiLineLength,i=e.indent||(us(t)?" ":"");let o="",a=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,u="\\"),u==="\\")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:as(o,i,qr,cs(e,!1))}function Hs(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
54
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return Pn(t,e);const n=e.indent||(us(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
55
|
+
${n}`)+"'";return e.implicitKey?r:as(r,n,Fc,cs(e,!1))}function Xt(t,e){const{singleQuote:n}=e.options;let r;if(n===!1)r=Pn;else{const s=t.includes('"'),i=t.includes("'");s&&!i?r=Hs:i&&!s?r=Pn:r=n?Hs:Pn}return r(t,e)}let Gs;try{Gs=new RegExp(`(^|(?<!
|
|
56
|
+
))
|
|
57
|
+
+(?!
|
|
58
|
+
|$)`,"g")}catch{Gs=/\n+(?!\n|$)/g}function Vr({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 Xt(n,r);const u=r.indent||(r.forceBlockIndent||us(n)?" ":""),d=o==="literal"?!0:o==="folded"||e===fe.BLOCK_FOLDED?!1:e===fe.BLOCK_LITERAL?!0:!Yp(n,c,u.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 b=m.indexOf(`
|
|
62
|
+
`);b===-1?p="-":n===m||b!==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(Gs,`$&${u}`));let w=!1,g,k=-1;for(g=0;g<n.length;++g){const v=n[g];if(v===" ")w=!0;else if(v===`
|
|
64
|
+
`)k=g;else break}let y=n.substring(0,k<g?k+1:g);y&&(n=n.substring(y.length),y=y.replace(/\n+/g,`$&${u}`));let I=(w?u?"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,`$&${u}`);let E=!1;const O=cs(r,!0);o!=="folded"&&e!==fe.BLOCK_FOLDED&&(O.onOverflow=()=>{E=!0});const P=as(`${y}${v}${m}`,u,Js,O);if(!E)return`>${I}
|
|
66
|
+
${u}${P}`}return n=n.replace(/\n+/g,`$&${u}`),`|${I}
|
|
67
|
+
${u}${y}${n}${m}`}function Xp(t,e,n,r){const{type:s,value:i}=t,{actualString:o,implicitKey:a,indent:c,indentStep:u,inFlow:d}=e;if(a&&i.includes(`
|
|
68
|
+
`)||d&&/[[\]{},]/.test(i))return Xt(i,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||d||!i.includes(`
|
|
69
|
+
`)?Xt(i,e):Vr(t,e,n,r);if(!a&&!d&&s!==fe.PLAIN&&i.includes(`
|
|
70
|
+
`))return Vr(t,e,n,r);if(us(i)){if(c==="")return e.forceBlockIndent=!0,Vr(t,e,n,r);if(a&&c===u)return Xt(i,e)}const p=i.replace(/\n+/g,`$&
|
|
71
|
+
${c}`);if(o){const h=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(p),{compat:m,tags:b}=e.doc.schema;if(b.some(h)||m?.some(h))return Xt(i,e)}return a?p:as(p,c,Fc,cs(e,!1))}function fi(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!==fe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=fe.QUOTE_DOUBLE);const c=d=>{switch(d){case fe.BLOCK_FOLDED:case fe.BLOCK_LITERAL:return s||i?Xt(o.value,e):Vr(o,e,n,r);case fe.QUOTE_DOUBLE:return Pn(o.value,e);case fe.QUOTE_SINGLE:return Hs(o.value,e);case fe.PLAIN:return Xp(o,e,n,r);default:return null}};let u=c(a);if(u===null){const{defaultKeyType:d,defaultStringType:p}=e.options,h=s&&d||p;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function Mc(t,e){const n=Object.assign({blockQuote:!0,commentString:Wp,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},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 Qp(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(Ae(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 em(t,e,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(Ae(t)||Re(t))&&t.anchor;i&&jc(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(Fe(t))return t.toString(e,n,r);if(fn(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=ze(t)?t:e.doc.createNode(t,{onTagObj:c=>s=c});s??(s=Qp(e.doc.schema.tags,i));const o=em(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):Ae(i)?fi(i,e,n,r):i.toString(e,n,r);return o?Ae(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
72
|
+
${e.indent}${a}`:a}function tm({key:t,value:e},n,r,s){const{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:p}}=n;let h=ze(t)&&t.comment||null;if(p){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Re(t)||!ze(t)&&typeof t=="object"){const O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let m=!p&&(!t||h&&e==null&&!n.inFlow||Re(t)||(Ae(t)?t.type===fe.BLOCK_FOLDED||t.type===fe.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(p||!i),indent:a+c});let b=!1,w=!1,g=on(t,n,()=>b=!0,()=>w=!0);if(!m&&!n.inFlow&&g.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 b&&r&&r(),g===""?"?":m?`? ${g}`:g}else if(i&&!p||e==null&&m)return g=`? ${g}`,h&&!b?g+=zt(g,n.indent,u(h)):w&&s&&s(),g;b&&(h=null),m?(h&&(g+=zt(g,n.indent,u(h))),g=`? ${g}
|
|
73
|
+
${a}:`):(g=`${g}:`,h&&(g+=zt(g,n.indent,u(h))));let k,y,_;ze(e)?(k=!!e.spaceBefore,y=e.commentBefore,_=e.comment):(k=!1,y=null,_=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!m&&!h&&Ae(e)&&(n.indentAtStart=g.length+1),w=!1,!d&&c.length>=2&&!n.inFlow&&!m&&Rn(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let I=!1;const v=on(e,n,()=>I=!0,()=>w=!0);let E=" ";if(h||k||y){if(E=k?`
|
|
74
|
+
`:"",y){const O=u(y);E+=`
|
|
75
|
+
${_t(O,n.indent)}`}v===""&&!n.inFlow?E===`
|
|
76
|
+
`&&_&&(E=`
|
|
77
|
+
|
|
78
|
+
`):E+=`
|
|
79
|
+
${n.indent}`}else if(!m&&Re(e)){const O=v[0],P=v.indexOf(`
|
|
80
|
+
`),q=P!==-1,H=n.inFlow??e.flow??e.items.length===0;if(q||!H){let G=!1;if(q&&(O==="&"||O==="!")){let Y=v.indexOf(" ");O==="&"&&Y!==-1&&Y<P&&v[Y+1]==="!"&&(Y=v.indexOf(" ",Y+1)),(Y===-1||P<Y)&&(G=!0)}G||(E=`
|
|
81
|
+
${n.indent}`)}}else(v===""||v[0]===`
|
|
82
|
+
`)&&(E="");return g+=E+v,n.inFlow?I&&r&&r():_&&!I?g+=zt(g,n.indent,u(_)):w&&s&&s(),g}function Uc(t,e){(t==="debug"||t==="warn")&&console.warn(e)}const Jn="<<",kt={identify:t=>t===Jn||typeof t=="symbol"&&t.description===Jn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new fe(Symbol(Jn)),{addToJSMap:Lc}),stringify:()=>Jn},nm=(t,e)=>(kt.identify(e)||Ae(e)&&(!e.type||e.type===fe.PLAIN)&&kt.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===kt.tag&&n.default);function Lc(t,e,n){const r=qc(t,n);if(Rn(r))for(const s of r.items)_s(t,e,s);else if(Array.isArray(r))for(const s of r)_s(t,e,s);else _s(t,e,r)}function _s(t,e,n){const r=qc(t,n);if(!Dn(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 qc(t,e){return t&&fn(e)?e.resolve(t.doc,t):e}function Vc(t,e,{key:n,value:r}){if(ze(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(nm(t,n))Lc(t,e,r);else{const s=ot(n,"",t);if(e instanceof Map)e.set(s,ot(r,s,t));else if(e instanceof Set)e.add(s);else{const i=rm(n,s,t),o=ot(r,i,t);i in e?Object.defineProperty(e,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[i]=o}}return e}function rm(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(ze(t)&&n?.doc){const r=Mc(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)+'..."'),Uc(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 di(t,e,n){const r=jn(t,void 0,n),s=jn(e,void 0,n);return new Xe(r,s)}class Xe{constructor(e,n=null){Object.defineProperty(this,at,{value:Cc}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return ze(n)&&(n=n.clone(e)),ze(r)&&(r=r.clone(e)),new Xe(n,r)}toJSON(e,n){const r=n?.mapAsMap?new Map:{};return Vc(n,r,this)}toString(e,n,r){return e?.doc?tm(this,e,n,r):JSON.stringify(this)}}function Zc(t,e,n){return(e.inFlow??t.flow?im:sm)(t,e,n)}function sm({comment:t,items:e},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:i,type:null});let p=!1;const h=[];for(let b=0;b<e.length;++b){const w=e[b];let g=null;if(ze(w))!p&&w.spaceBefore&&h.push(""),Yr(n,h,w.commentBefore,p),w.comment&&(g=w.comment);else if(Fe(w)){const y=ze(w.key)?w.key:null;y&&(!p&&y.spaceBefore&&h.push(""),Yr(n,h,y.commentBefore,p))}p=!1;let k=on(w,d,()=>g=null,()=>p=!0);g&&(k+=zt(k,i,u(g))),p&&g&&(p=!1),h.push(r+k)}let m;if(h.length===0)m=s.start+s.end;else{m=h[0];for(let b=1;b<h.length;++b){const w=h[b];m+=w?`
|
|
83
|
+
${c}${w}`:`
|
|
84
|
+
`}}return t?(m+=`
|
|
85
|
+
`+_t(u(t),c),a&&a()):p&&o&&o(),m}function im({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 u=!1,d=0;const p=[];for(let b=0;b<t.length;++b){const w=t[b];let g=null;if(ze(w))w.spaceBefore&&p.push(""),Yr(e,p,w.commentBefore,!1),w.comment&&(g=w.comment);else if(Fe(w)){const y=ze(w.key)?w.key:null;y&&(y.spaceBefore&&p.push(""),Yr(e,p,y.commentBefore,!1),y.comment&&(u=!0));const _=ze(w.value)?w.value:null;_?(_.comment&&(g=_.comment),_.commentBefore&&(u=!0)):w.value==null&&y?.comment&&(g=y.comment)}g&&(u=!0);let k=on(w,c,()=>g=null);u||(u=p.length>d||k.includes(`
|
|
86
|
+
`)),b<t.length-1?k+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(u||(u=p.reduce((y,_)=>y+_.length+2,2)+(k.length+2)>e.options.lineWidth)),u&&(k+=",")),g&&(k+=zt(k,r,a(g))),p.push(k),d=p.length}const{start:h,end:m}=n;if(p.length===0)return h+m;if(!u){const b=p.reduce((w,g)=>w+g.length+2,2);u=e.options.lineWidth>0&&b>e.options.lineWidth}if(u){let b=h;for(const w of p)b+=w?`
|
|
87
|
+
${i}${s}${w}`:`
|
|
88
|
+
`;return`${b}
|
|
89
|
+
${s}${m}`}else return`${h}${o}${p.join(" ")}${o}${m}`}function Yr({indent:t,options:{commentString:e}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=_t(e(r),t);n.push(i.trimStart())}}function Ft(t,e){const n=Ae(e)?e.value:e;for(const r of t)if(Fe(r)&&(r.key===e||r.key===n||Ae(r.key)&&r.key.value===n))return r}class it extends zc{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(It,e),this.items=[]}static from(e,n,r){const{keepUndefined:s,replacer:i}=r,o=new this(e),a=(c,u)=>{if(typeof i=="function")u=i.call(n,c,u);else if(Array.isArray(i)&&!i.includes(c))return;(u!==void 0||s)&&o.items.push(di(c,u,r))};if(n instanceof Map)for(const[c,u]of n)a(c,u);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;Fe(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Xe(e,e?.value):r=new Xe(e.key,e.value);const s=Ft(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);Ae(s.value)&&Rc(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=Ft(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){const s=Ft(this.items,e)?.value;return(!n&&Ae(s)?s.value:s)??void 0}has(e){return!!Ft(this.items,e)}set(e,n){this.add(new Xe(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)Vc(n,s,i);return s}toString(e,n,r){if(!e)return JSON.stringify(this);for(const s of this.items)if(!Fe(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})),Zc(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}}const hn={collection:"map",default:!0,nodeClass:it,tag:"tag:yaml.org,2002:map",resolve(t,e){return Dn(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>it.from(t,e,n)};class Ut extends zc{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ln,e),this.items=[]}add(e){this.items.push(e)}delete(e){const n=Hn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){const r=Hn(e);if(typeof r!="number")return;const s=this.items[r];return!n&&Ae(s)?s.value:s}has(e){const n=Hn(e);return typeof n=="number"&&n<this.items.length}set(e,n){const r=Hn(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);const s=this.items[r];Ae(s)&&Rc(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(ot(i,String(s++),n));return r}toString(e,n,r){return e?Zc(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(jn(a,void 0,r))}}return i}}function Hn(t){let e=Ae(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const pn={collection:"seq",default:!0,nodeClass:Ut,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Rn(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Ut.from(t,e,n)},ls={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),fi(t,e,n,r)}},fs={identify:t=>t==null,createNode:()=>new fe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new fe(null),stringify:({source:t},e)=>typeof t=="string"&&fs.test.test(t)?t:e.options.nullStr},hi={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new fe(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&hi.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 ft({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)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=e-(i.length-o-1);for(;a-- >0;)i+="0"}return i}const Kc={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:ft},Jc={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():ft(t)}},Hc={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 fe(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:ft},ds=t=>typeof t=="bigint"||Number.isInteger(t),pi=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function Gc(t,e,n){const{value:r}=t;return ds(r)&&r>=0?n+r.toString(e):ft(t)}const Wc={identify:t=>ds(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>pi(t,2,8,n),stringify:t=>Gc(t,8,"0o")},Yc={identify:ds,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>pi(t,0,10,n),stringify:ft},Xc={identify:t=>ds(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>pi(t,2,16,n),stringify:t=>Gc(t,16,"0x")},om=[hn,pn,ls,fs,hi,Wc,Yc,Xc,Kc,Jc,Hc];function so(t){return typeof t=="bigint"||Number.isInteger(t)}const Gn=({value:t})=>JSON.stringify(t),am=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Gn},{identify:t=>t==null,createNode:()=>new fe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Gn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Gn},{identify:so,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})=>so(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:Gn}],cm={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},um=[hn,pn].concat(am,cm),mi={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 u=0;u<o.length;++u)c+=String.fromCharCode(o[u]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=fe.BLOCK_LITERAL),e!==fe.QUOTE_DOUBLE){const c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),u=Math.ceil(a.length/c),d=new Array(u);for(let p=0,h=0;p<u;++p,h+=c)d[p]=a.substr(h,c);a=d.join(e===fe.BLOCK_LITERAL?`
|
|
90
|
+
`:" ")}return fi({comment:t,type:e,value:a},r,s,i)}};function Qc(t,e){if(Rn(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!Fe(r)){if(Dn(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");const s=r.items[0]||new Xe(new fe(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]=Fe(r)?r:new Xe(r)}}else e("Expected a sequence for this tag");return t}function eu(t,e,n){const{replacer:r}=n,s=new Ut(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 u=Object.keys(o);if(u.length===1)a=u[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=o;s.items.push(di(a,c,n))}return s}const gi={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Qc,createNode:eu};class tn extends Ut{constructor(){super(),this.add=it.prototype.add.bind(this),this.delete=it.prototype.delete.bind(this),this.get=it.prototype.get.bind(this),this.has=it.prototype.has.bind(this),this.set=it.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(Fe(s)?(i=ot(s.key,"",n),o=ot(s.value,i,n)):i=ot(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=eu(e,n,r),i=new this;return i.items=s.items,i}}tn.tag="tag:yaml.org,2002:omap";const yi={collection:"seq",identify:t=>t instanceof Map,nodeClass:tn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){const n=Qc(t,e),r=[];for(const{key:s}of n.items)Ae(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 tu({value:t,source:e},n){return e&&(t?nu:ru).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}const nu={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 fe(!0),stringify:tu},ru={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 fe(!1),stringify:tu},lm={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:ft},fm={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():ft(t)}},dm={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 fe(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:ft},zn=t=>typeof t=="bigint"||Number.isInteger(t);function hs(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 wi(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 ft(t)}const hm={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>hs(t,2,2,n),stringify:t=>wi(t,2,"0b")},pm={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>hs(t,1,8,n),stringify:t=>wi(t,8,"0")},mm={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>hs(t,0,10,n),stringify:ft},gm={identify:zn,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>hs(t,2,16,n),stringify:t=>wi(t,16,"0x")};class nn extends it{constructor(e){super(e),this.tag=nn.tag}add(e){let n;Fe(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Xe(e.key,null):n=new Xe(e,null),Ft(this.items,n.key)||this.items.push(n)}get(e,n){const r=Ft(this.items,e);return!n&&Fe(r)?Ae(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=Ft(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Xe(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(di(o,null,r));return i}}nn.tag="tag:yaml.org,2002:set";const vi={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(Dn(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 bi(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 su(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return ft(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 iu={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})=>bi(t,n),stringify:su},ou={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=>bi(t,!1),stringify:su},ps={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(ps.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 u=Date.UTC(n,r-1,s,i||0,o||0,a||0,c);const d=e[8];if(d&&d!=="Z"){let p=bi(d,!1);Math.abs(p)<30&&(p*=60),u-=6e4*p}return new Date(u)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},io=[hn,pn,ls,fs,nu,ru,hm,pm,mm,gm,lm,fm,dm,mi,kt,yi,gi,vi,iu,ou,ps],oo=new Map([["core",om],["failsafe",[hn,pn,ls]],["json",um],["yaml11",io],["yaml-1.1",io]]),ao={binary:mi,bool:hi,float:Hc,floatExp:Jc,floatNaN:Kc,floatTime:ou,int:Yc,intHex:Xc,intOct:Wc,intTime:iu,map:hn,merge:kt,null:fs,omap:yi,pairs:gi,seq:pn,set:vi,timestamp:ps},ym={"tag:yaml.org,2002:binary":mi,"tag:yaml.org,2002:merge":kt,"tag:yaml.org,2002:omap":yi,"tag:yaml.org,2002:pairs":gi,"tag:yaml.org,2002:set":vi,"tag:yaml.org,2002:timestamp":ps};function ks(t,e,n){const r=oo.get(e);if(r&&!t)return n&&!r.includes(kt)?r.concat(kt):r.slice();let s=r;if(!s)if(Array.isArray(t))s=[];else{const i=Array.from(oo.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(kt)),s.reduce((i,o)=>{const a=typeof o=="string"?ao[o]:o;if(!a){const c=JSON.stringify(o),u=Object.keys(ao).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(a)||i.push(a),i},[])}const wm=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0;class _i{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?ks(e,"compat"):e?ks(null,e):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?ym:{},this.tags=ks(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,It,{value:hn}),Object.defineProperty(this,gt,{value:ls}),Object.defineProperty(this,ln,{value:pn}),this.sortMapEntries=typeof o=="function"?o:o===!0?wm:null}clone(){const e=Object.create(_i.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function vm(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=Mc(t,e),{commentString:i}=s.options;if(t.commentBefore){n.length!==1&&n.unshift("");const c=i(t.commentBefore);n.unshift(_t(c,""))}let o=!1,a=null;if(t.contents){if(ze(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){const d=i(t.contents.commentBefore);n.push(_t(d,""))}s.forceBlockIndent=!!t.comment,a=t.contents.comment}const c=a?void 0:()=>o=!0;let u=on(t.contents,s,()=>a=null,c);a&&(u+=zt(u,"",i(a))),(u[0]==="|"||u[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${u}`:n.push(u)}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(_t(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(_t(i(c),"")))}return n.join(`
|
|
94
|
+
`)+`
|
|
95
|
+
`}class ms{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,at,{value:Ks});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 Ye({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,s,r)}clone(){const e=Object.create(ms.prototype,{[at]:{value:Ks}});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=ze(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Vt(this.contents)&&this.contents.add(e)}addIn(e,n){Vt(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){const r=Bc(this);e.anchor=!n||r.has(n)?Dc(n||"a",r):n}return new li(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 g=y=>typeof y=="number"||y instanceof String||y instanceof Number,k=n.filter(g).map(String);k.length>0&&(n=n.concat(k)),s=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:u,tag:d}=r??{},{onAnchor:p,setAnchors:h,sourceObjects:m}=Jp(this,o||"a"),b={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:p,onTagObj:u,replacer:s,schema:this.schema,sourceObjects:m},w=jn(e,d,b);return a&&Re(w)&&(w.flow=!0),h(),w}createPair(e,n,r={}){const s=this.createNode(e,null,r),i=this.createNode(n,null,r);return new Xe(s,i)}delete(e){return Vt(this.contents)?this.contents.delete(e):!1}deleteIn(e){return In(e)?this.contents==null?!1:(this.contents=null,!0):Vt(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return Re(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return In(e)?!n&&Ae(this.contents)?this.contents.value:this.contents:Re(this.contents)?this.contents.getIn(e,n):void 0}has(e){return Re(this.contents)?this.contents.has(e):!1}hasIn(e){return In(e)?this.contents!==void 0:Re(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Wr(this.schema,[e],n):Vt(this.contents)&&this.contents.set(e,n)}setIn(e,n){In(e)?this.contents=n:this.contents==null?this.contents=Wr(this.schema,Array.from(e),n):Vt(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 Ye({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 Ye({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 _i(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=ot(this.contents,n??"",a);if(typeof i=="function")for(const{count:u,res:d}of a.anchors.values())i(d,u);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 vm(this,e)}}function Vt(t){if(Re(t))return!0;throw new Error("Expected a YAML collection as document contents")}class au extends Error{constructor(e,n,r,s){super(),this.name=e,this.code=r,this.message=s,this.pos=n}}class An extends au{constructor(e,n,r){super("YAMLParseError",e,n,r)}}class bm extends au{constructor(e,n,r){super("YAMLWarning",e,n,r)}}const co=(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 u=" ".repeat(i)+"^".repeat(a);n.message+=`:
|
|
97
|
+
|
|
98
|
+
${o}
|
|
99
|
+
${u}
|
|
100
|
+
`}};function an(t,{flow:e,indicator:n,next:r,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,u=a,d=a,p="",h="",m=!1,b=!1,w=null,g=null,k=null,y=null,_=null,I=null,v=null;for(const P of t)switch(b&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&i(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),w&&(u&&P.type!=="comment"&&P.type!=="newline"&&i(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),P.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&P.source.includes(" ")&&(w=P),d=!0;break;case"comment":{d||i(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const q=P.source.substring(1)||" ";p?p+=h+q:p=q,h="",u=!1;break}case"newline":u?p?p+=P.source:(!I||n!=="seq-item-ind")&&(c=!0):h+=P.source,u=!0,m=!0,(g||k)&&(y=P),d=!0;break;case"anchor":g&&i(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&i(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=P,v??(v=P.offset),u=!1,d=!1,b=!0;break;case"tag":{k&&i(P,"MULTIPLE_TAGS","A node can have at most one tag"),k=P,v??(v=P.offset),u=!1,d=!1,b=!0;break}case n:(g||k)&&i(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),I&&i(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${e??"collection"}`),I=P,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(e){_&&i(P,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),_=P,u=!1,d=!1;break}default:i(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),u=!1,d=!1}const E=t[t.length-1],O=E?E.offset+E.source.length:s;return b&&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"),w&&(u&&w.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&i(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:I,spaceBefore:c,comment:p,hasNewline:m,anchor:g,tag:k,newlineAfterProp:y,end:O,start:v??O}}function Bn(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(Bn(e.key)||Bn(e.value))return!0}return!1;default:return!0}}function Ws(t,e,n){if(e?.type==="flow-collection"){const r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&Bn(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function cu(t,e,n){const{uniqueKeys:r}=t.options;if(r===!1)return!1;const s=typeof r=="function"?r:(i,o)=>i===o||Ae(i)&&Ae(o)&&i.value===o.value;return e.some(i=>s(i.key,n))}const uo="All mapping items must start at the same column";function _m({composeNode:t,composeEmptyNode:e},n,r,s,i){const o=i?.nodeClass??it,a=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,u=null;for(const d of r.items){const{start:p,key:h,sep:m,value:b}=d,w=an(p,{indicator:"explicit-key-ind",next:h??m?.[0],offset:c,onError:s,parentIndent:r.indent,startOnNewline:!0}),g=!w.found;if(g){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",uo)),!w.anchor&&!w.tag&&!m){u=w.end,w.comment&&(a.comment?a.comment+=`
|
|
102
|
+
`+w.comment:a.comment=w.comment);continue}(w.newlineAfterProp||Bn(h))&&s(h??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==r.indent&&s(c,"BAD_INDENT",uo);n.atKey=!0;const k=w.end,y=h?t(n,h,w,s):e(n,k,p,null,w,s);n.schema.compat&&Ws(r.indent,h,s),n.atKey=!1,cu(n,a.items,y)&&s(k,"DUPLICATE_KEY","Map keys must be unique");const _=an(m??[],{indicator:"map-value-ind",next:b,offset:y.range[2],onError:s,parentIndent:r.indent,startOnNewline:!h||h.type==="block-scalar"});if(c=_.end,_.found){g&&(b?.type==="block-map"&&!_.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&w.start<_.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=b?t(n,b,_,s):e(n,c,m,null,_,s);n.schema.compat&&Ws(r.indent,b,s),c=I.range[2];const v=new Xe(y,I);n.options.keepSourceTokens&&(v.srcToken=d),a.items.push(v)}else{g&&s(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(y.comment?y.comment+=`
|
|
103
|
+
`+_.comment:y.comment=_.comment);const I=new Xe(y);n.options.keepSourceTokens&&(I.srcToken=d),a.items.push(I)}}return u&&u<c&&s(u,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,u??c],a}function km({composeNode:t,composeEmptyNode:e},n,r,s,i){const o=i?.nodeClass??Ut,a=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,u=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{u=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&&Ws(r.indent,p,s),c=m.range[2],a.items.push(m)}return a.range=[r.offset,c,u??c],a}function Fn(t,e,n,r){let s="";if(t){let i=!1,o="";for(const a of t){const{source:c,type:u}=a;switch(u){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 ${u} at node end`)}e+=c.length}}return{comment:s,offset:e}}const Ss="Block collections are not allowed within flow collections",$s=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Sm({composeNode:t,composeEmptyNode:e},n,r,s,i){const o=r.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?it:Ut),u=new c(n.schema);u.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 g=0;g<r.items.length;++g){const k=r.items[g],{start:y,key:_,sep:I,value:v}=k,E=an(y,{flow:a,indicator:"explicit-key-ind",next:_??I?.[0],offset:p,onError:s,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!I&&!v){g===0&&E.comma?s(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<r.items.length-1&&s(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(u.comment?u.comment+=`
|
|
104
|
+
`+E.comment:u.comment=E.comment),p=E.end;continue}!o&&n.options.strict&&Bn(_)&&s(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)E.comma&&s(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||s(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let O="";e:for(const P of y)switch(P.type){case"comma":case"space":break;case"comment":O=P.source.substring(1);break e;default:break e}if(O){let P=u.items[u.items.length-1];Fe(P)&&(P=P.value??P.key),P.comment?P.comment+=`
|
|
105
|
+
`+O:P.comment=O,E.comment=E.comment.substring(O.length+1)}}if(!o&&!I&&!E.found){const O=v?t(n,v,E,s):e(n,E.end,I,null,E,s);u.items.push(O),p=O.range[2],$s(v)&&s(O.range,"BLOCK_IN_FLOW",Ss)}else{n.atKey=!0;const O=E.end,P=_?t(n,_,E,s):e(n,O,y,null,E,s);$s(_)&&s(P.range,"BLOCK_IN_FLOW",Ss),n.atKey=!1;const q=an(I??[],{flow:a,indicator:"map-value-ind",next:v,offset:P.range[2],onError:s,parentIndent:r.indent,startOnNewline:!1});if(q.found){if(!o&&!E.found&&n.options.strict){if(I)for(const Y of I){if(Y===q.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}}E.start<q.found.offset-1024&&s(q.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(q.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const H=v?t(n,v,q,s):q.found?e(n,q.end,I,null,q,s):null;H?$s(v)&&s(H.range,"BLOCK_IN_FLOW",Ss):q.comment&&(P.comment?P.comment+=`
|
|
106
|
+
`+q.comment:P.comment=q.comment);const G=new Xe(P,H);if(n.options.keepSourceTokens&&(G.srcToken=k),o){const Y=u;cu(n,Y.items,P)&&s(O,"DUPLICATE_KEY","Map keys must be unique"),Y.items.push(G)}else{const Y=new it(n.schema);Y.flow=!0,Y.items.push(G);const ie=(H??P).range;Y.range=[P.range[0],ie[1],ie[2]],u.items.push(Y)}p=H?H.range[2]:q.end}}const h=o?"}":"]",[m,...b]=r.end;let w=p;if(m?.source===h)w=m.offset+m.source.length;else{const g=a[0].toUpperCase()+a.substring(1),k=d?`${g} must end with a ${h}`:`${g} in block collection must be sufficiently indented and end with a ${h}`;s(p,d?"MISSING_CHAR":"BAD_INDENT",k),m&&m.source.length!==1&&b.unshift(m)}if(b.length>0){const g=Fn(b,w,n.options.strict,s);g.comment&&(u.comment?u.comment+=`
|
|
107
|
+
`+g.comment:u.comment=g.comment),u.range=[r.offset,w,g.offset]}else u.range=[r.offset,w,w];return u}function Es(t,e,n,r,s,i){const o=n.type==="block-map"?_m(t,e,n,r,i):n.type==="block-seq"?km(t,e,n,r,i):Sm(t,e,n,r,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}function $m(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,b=h&&i?h.offset>i.offset?h:i:h??i;b&&(!m||m.offset<b.offset)&&s(b,"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===it.tagName&&a==="map"||o===Ut.tagName&&a==="seq")return Es(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),Es(t,e,n,s,o)}const u=Es(t,e,n,s,o,c),d=c.resolve?.(u,h=>s(i,"TAG_RESOLVE_FAILED",h),e.options)??u,p=ze(d)?d:new fe(d);return p.range=u.range,p.tag=o,c?.format&&(p.format=c.format),p}function Em(t,e,n){const r=e.offset,s=Im(e,t.options.strict,n);if(!s)return{value:"",type:null,comment:"",range:[r,r,r]};const i=s.mode===">"?fe.BLOCK_FOLDED:fe.BLOCK_LITERAL,o=e.source?Am(e.source):[];let a=o.length;for(let w=o.length-1;w>=0;--w){const g=o[w][1];if(g===""||g==="\r")a=w;else break}if(a===0){const w=s.chomp==="+"&&o.length>0?`
|
|
108
|
+
`.repeat(Math.max(1,o.length-1)):"";let g=r+s.length;return e.source&&(g+=e.source.length),{value:w,type:i,comment:s.comment,range:[r,g,g]}}let c=e.indent+s.indent,u=e.offset+s.length,d=0;for(let w=0;w<a;++w){const[g,k]=o[w];if(k===""||k==="\r")s.indent===0&&g.length>c&&(c=g.length);else{g.length<c&&n(u+g.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=g.length),d=w,c===0&&!t.atRoot&&n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=g.length+k.length+1}for(let w=o.length-1;w>=a;--w)o[w][0].length>c&&(a=w+1);let p="",h="",m=!1;for(let w=0;w<d;++w)p+=o[w][0].slice(c)+`
|
|
109
|
+
`;for(let w=d;w<a;++w){let[g,k]=o[w];u+=g.length+k.length+1;const y=k[k.length-1]==="\r";if(y&&(k=k.slice(0,-1)),k&&g.length<c){const I=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;n(u-k.length-(y?2:1),"BAD_INDENT",I),g=""}i===fe.BLOCK_LITERAL?(p+=h+g.slice(c)+k,h=`
|
|
110
|
+
`):g.length>c||k[0]===" "?(h===" "?h=`
|
|
111
|
+
`:!m&&h===`
|
|
112
|
+
`&&(h=`
|
|
113
|
+
|
|
114
|
+
`),p+=h+g.slice(c)+k,h=`
|
|
115
|
+
`,m=!0):k===""?h===`
|
|
116
|
+
`?p+=`
|
|
117
|
+
`:h=`
|
|
118
|
+
`:(p+=h+k,h=" ",m=!1)}switch(s.chomp){case"-":break;case"+":for(let w=a;w<o.length;++w)p+=`
|
|
119
|
+
`+o[w][0].slice(c);p[p.length-1]!==`
|
|
120
|
+
`&&(p+=`
|
|
121
|
+
`);break;default:p+=`
|
|
122
|
+
`}const b=r+s.length+e.source.length;return{value:p,type:i,comment:s.comment,range:[r,b,b]}}function Im({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 b=Number(m);!o&&b?o=b:c===-1&&(c=t+h)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let u=!1,d="",p=s.length;for(let h=1;h<e.length;++h){const m=e[h];switch(m.type){case"space":u=!0;case"newline":p+=m.source.length;break;case"comment":n&&!u&&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 b=`Unexpected token in block scalar header: ${m.type}`;r(m,"UNEXPECTED_TOKEN",b);const w=m.source;w&&typeof w=="string"&&(p+=w.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 Om(t,e,n){const{offset:r,type:s,source:i,end:o}=t;let a,c;const u=(h,m,b)=>n(r+h,m,b);switch(s){case"scalar":a=fe.PLAIN,c=Tm(i,u);break;case"single-quoted-scalar":a=fe.QUOTE_SINGLE,c=Nm(i,u);break;case"double-quoted-scalar":a=fe.QUOTE_DOUBLE,c=Pm(i,u);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=Fn(o,d,e,n);return{value:c,type:a,comment:p.comment,range:[r,d,p.offset]}}function Tm(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}`),uu(t)}function Nm(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),uu(t.slice(1,-1)).replace(/''/g,"'")}function uu(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 Pm(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}=Cm(t,r);n+=i,r=o}else if(s==="\\"){let i=t[++r];const o=xm[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=i==="x"?2:i==="u"?4:8;n+=jm(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 Cm(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 xm={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
137
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function jm(t,e,n,r){const s=t.substr(e,n),o=s.length===n&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(o)}catch{const a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function lu(t,e,n,r){const{value:s,type:i,comment:o,range:a}=e.type==="block-scalar"?Em(t,e,r):Om(e,t.options.strict,r),c=n?t.directives.tagName(n.source,p=>r(n,"TAG_RESOLVE_FAILED",p)):null;let u;t.options.stringKeys&&t.atKey?u=t.schema[gt]:c?u=Bm(t.schema,s,c,n,r):e.type==="scalar"?u=Dm(t,s,e,r):u=t.schema[gt];let d;try{const p=u.resolve(s,h=>r(n??e,"TAG_RESOLVE_FAILED",h),t.options);d=Ae(p)?p:new fe(p)}catch(p){const h=p instanceof Error?p.message:String(p);r(n??e,"TAG_RESOLVE_FAILED",h),d=new fe(s)}return d.range=a,d.source=s,i&&(d.type=i),c&&(d.tag=c),u.format&&(d.format=u.format),o&&(d.comment=o),d}function Bm(t,e,n,r,s){if(n==="!")return t[gt];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[gt])}function Dm({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[gt];if(n.compat){const a=n.compat.find(c=>c.default&&c.test?.test(r))??n[gt];if(o.tag!==a.tag){const c=e.tagString(o.tag),u=e.tagString(a.tag),d=`Value may be parsed as either ${c} or ${u}`;i(s,"TAG_RESOLVE_FAILED",d,!0)}}return o}function Rm(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 zm={composeNode:fu,composeEmptyNode:ki};function fu(t,e,n,r){const s=t.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=n;let u,d=!0;switch(e.type){case"alias":u=Fm(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":u=lu(t,e,c,r),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=$m(zm,t,e,n,r),a&&(u.anchor=a.source.substring(1))}catch(p){const h=p instanceof Error?p.message:String(p);r(e,"RESOURCE_EXHAUSTION",h)}break;default:{const p=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",p),d=!1}}return u??(u=ki(t,e.offset,void 0,null,n,r)),a&&u.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&t.options.stringKeys&&(!Ae(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(u.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?u.comment=o:u.commentBefore=o),t.options.keepSourceTokens&&d&&(u.srcToken=e),u}function ki(t,e,n,r,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},u){const d={type:"scalar",offset:Rm(e,n,r),indent:-1,source:""},p=lu(t,d,a,u);return o&&(p.anchor=o.source.substring(1),p.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(p.spaceBefore=!0),i&&(p.comment=i,p.range[2]=c),p}function Fm({options:t},{offset:e,source:n,end:r},s){const i=new li(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=Fn(r,o,t.strict,s);return i.range=[e,o,a.offset],a.comment&&(i.comment=a.comment),i}function Mm(t,e,{offset:n,start:r,value:s,end:i},o){const a=Object.assign({_directives:e},t),c=new ms(void 0,a),u={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?fu(u,s,d,o):ki(u,d.end,r,null,d,o);const p=c.contents.range[2],h=Fn(i,p,!1,o);return h.comment&&(c.comment=h.comment),c.range=[n,p,h.offset],c}function yn(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 lo(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 Um{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,s,i)=>{const o=yn(n);i?this.warnings.push(new bm(o,r,s)):this.errors.push(new An(o,r,s))},this.directives=new Ye({version:e.version||"1.2"}),this.options=e}decorate(e,n){const{comment:r,afterEmptyLine:s}=lo(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(Re(i)&&!i.flow&&i.items.length>0){let o=i.items[0];Fe(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}}if(n){for(let i=0;i<this.errors.length;++i)e.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)e.warnings.push(this.warnings[i])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:lo(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=yn(e);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",r,s)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const n=Mm(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 An(yn(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 An(yn(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Fn(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 An(yn(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 ms(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 du="\uFEFF",hu="",pu="",Ys="";function Lm(t){switch(t){case du:return"byte-order-mark";case hu:return"doc-mode";case pu:return"flow-error-end";case Ys: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 ut(t){switch(t){case void 0:case" ":case`
|
|
147
|
+
`:case"\r":case" ":return!0;default:return!1}}const fo=new Set("0123456789ABCDEFabcdef"),qm=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Wn=new Set(",[]{}"),Vm=new Set(` ,[]{}
|
|
148
|
+
\r `),Is=t=>!t||Vm.has(t);class Zm{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==="...")&&ut(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]===du&&(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 hu,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==="...")&&ut(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&&!ut(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===":")&&ut(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}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(Is),"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("..."))&&ut(s[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(s[0]==="]"||s[0]==="}")))return this.flowLevel=0,yield pu,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(Is),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||ut(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=>ut(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 Ys,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(ut(i)||e&&Wn.has(i))break;n=r}else if(ut(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&&Wn.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&&Wn.has(s))break;n=r}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield Ys,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(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Is),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ut(r)||n&&Wn.has(r)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!ut(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(qm.has(n))n=this.buffer[++e];else if(n==="%"&&fo.has(this.buffer[e+1])&&fo.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 Km{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 Et(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function ho(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 mu(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 Yn(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 Xr(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function po(t){if(t.start.type==="flow-seq-start")for(const e of t.items)e.sep&&!e.value&&!Et(e.start,"explicit-key-ind")&&!Et(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,mu(e.value)?e.value.end?Xr(e.value.end,e.sep):e.value.end=e.sep:Xr(e.start,e.sep),delete e.sep)}class Jm{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 Zm,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=Lm(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"&&po(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&&ho(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":{ho(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=Yn(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)){Xr(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(Et(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(mu(n.key)&&!Et(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(Et(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]}):Et(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&&!Et(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)){Xr(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||Et(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=Yn(r),i=Zt(s);po(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=Yn(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=Yn(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 Hm(t){const e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Km||null,prettyErrors:e}}function Gm(t,e={}){const{lineCounter:n,prettyErrors:r}=Hm(e),s=new Jm(n?.addNewLine),i=new Um(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 An(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(co(t,n)),o.warnings.forEach(co(t,n))),o}function Wm(t,e,n){let r;const s=Gm(t,n);if(!s)return null;if(s.warnings.forEach(i=>Uc(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 He=R({title:N().optional(),globalTitle:N().optional(),description:N().optional(),color:N().optional(),icon:N().optional(),iconColor:N().optional(),avatarUrl:N().optional(),secondaryIcon:N().optional(),secondaryIconColor:N().optional()}),ke=He.pick({title:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),gu=He.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),yt=He.pick({title:!0,description:!0,avatarUrl:!0,icon:!0,iconColor:!0}).required({title:!0}),Mn=R({createdAt:ce(),updatedAt:ce()}),Ze=N().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),mn=qt([Ur([Ze,ae("."),ae("v"),Me().int().min(1)]),Ur([Ze,ae("."),Ze,ae("."),ae("v"),Me().int().min(1)]),Ur([Ze,ae("."),Ze,ae("."),Ze,ae("."),ae("v"),Me().int().min(1)])]),Zr=N().regex(/^[a-z][a-zA-Z0-9]+$/,"Field name must start with a letter and be in camelCase format").min(2).max(64),mo=R({type:mn,required:ye(),multiple:ye(),field:N()});R({type:mn,extensions:N().array().optional(),directExtensions:N().array().optional(),inclusions:mo.array().optional(),directInclusions:mo.array().optional(),schema:en(),meta:He.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0}),definitionHash:Me()});R().loose(),R().loose().toJSONSchema();var Ym=R({type:mn,identity:N(),references:Pe(N(),N().array()).optional(),...He.pick({title:!0,description:!0,icon:!0,iconColor:!0}).shape});R({$meta:Ym});var yu=tt(["composite","unit"]),Xm=Symbol("runtimeSchema");function wn(t){return t.path?`${t.instanceId}:${t.output}:${t.path}`:`${t.instanceId}:${t.output}`}var gs=R({x:Me(),y:Me()}),St=Ur([mn,":",Ze]),rn=R({instanceId:St,output:N(),path:N().optional()}),Xs=R({hubId:N()}),Qm=R({args:Pe(N(),mt()).optional(),inputs:Pe(N(),ve(rn)).optional(),hubInputs:Pe(N(),ve(Xs)).optional(),injectionInputs:ve(Xs).optional(),position:gs.partial().nullable().optional()}),Kr=R({id:St,kind:yu,type:mn,name:Ze,...Qm.shape,position:gs.optional(),resolvedInputs:Pe(N(),ve(rn)).optional(),parentId:St.optional(),outputs:Pe(N(),ve(rn)).optional(),resolvedOutputs:Pe(N(),ve(rn)).optional()}),eg=R({position:gs.partial().nullable().optional(),inputs:ve(rn).optional(),injectionInputs:ve(Xs).optional()}),tg=R({id:ee(),...eg.shape,position:gs.optional()}),ng;(t=>{t.Artifact="d55c63ac-3174-4756-808f-f778e99af0d1",t.Yaml="c857cac5-caa6-4421-b82c-e561fbce6367",t.Secret="240e5789-6ae4-4b22-b9d8-87169e8b4bab"})(ng||={});var rg=R({"c857cac5-caa6-4421-b82c-e561fbce6367":ae(!0),value:N()}),sg=R({name:N(),contentType:N().optional(),size:Me().optional(),mode:Me().optional()}),ig;(t=>{t.Healthy="healthy",t.Degraded="degraded",t.Down="down",t.Warning="warning",t.Progressing="progressing",t.Error="error"})(ig||={});var og=qt([N(),Me(),ye(),N().array()]);R({name:N(),meta:He.pick({title:!0,icon:!0,iconColor:!0}).required({title:!0}),complementaryTo:N().optional(),value:og.optional()});function ag(t){const e=R({"240e5789-6ae4-4b22-b9d8-87169e8b4bab":ae(!0),value:t});return $p(qt([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 wu=R({schema:en(),[Xm]:Np(Ie).optional(),required:ye(),meta:He.required({title:!0}).pick({title:!0,globalTitle:!0,description:!0,color:!0,icon:!0,iconColor:!0})}),go=R({type:mn,fromInput:Zr.optional(),required:ye(),multiple:ye(),meta:He.required({title:!0}).pick({title:!0,description:!0})}),cg=R({type:Ze,kind:yu,args:Pe(Zr,wu),inputs:Pe(Zr,go),outputs:Pe(Zr,go),meta:He.required({title:!0}).pick({title:!0,description:!0,color:!0,icon:!0,iconColor:!0,secondaryIcon:!0,secondaryIconColor:!0}).extend({category:N().optional(),defaultNamePrefix:N()}),definitionHash:Me()}),ug=wu.extend({readonly:ye(),computed:ye()}),lg=R({package:N(),path:N().optional()});R({...cg.shape,source:lg,secrets:Pe(N(),ug)});function Si(t){return"source"in t}var fg=qt([R({type:ae("before-destroy")})]);R({name:N(),meta:He.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:fg});var dg=R({name:N()}),hg=R({...rn.shape}),pg=R({value:mt(),source:hg.optional()});R({instanceId:N(),stateId:N(),args:Pe(N(),mt()),inputs:Pe(N(),pg.array()),invokedTriggers:dg.array(),secretValues:Pe(N(),mt()),importBasePath:N()});var yo=new WeakMap;function mg(t){const e=rg.safeParse(t);if(!e.success)return t;const n=yo.get(t);if(n!==void 0)return n;const r=Wm(e.data.value);return yo.set(t,r),r}var gg;(t=>{t.Config="highstate"})(gg||={});var yg=Symbol("unitArtifactId"),wg=R({"d55c63ac-3174-4756-808f-f778e99af0d1":ae(!0),[yg]:N().optional(),hash:N(),meta:ke.optional()}),vg=qt([R({type:ae("embedded"),isBinary:ye().optional(),value:N()}),R({type:ae("embedded-secret"),isBinary:ye().optional(),value:ag(N())}),R({type:ae("artifact"),...wg.shape})]),vu=R({meta:sg,content:vg}),bu=R({image:N(),command:N().array(),cwd:N().optional(),env:Pe(N(),N()).optional(),files:Pe(N(),vu).optional()});R({name:N(),meta:He.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),spec:bu});var _u=qt([R({type:ae("markdown"),content:N()}),R({type:ae("qr"),content:N(),showContent:Pp(),language:N().optional()}),R({type:ae("file"),file:vu})]);R({name:N(),meta:He.pick({title:!0,globalTitle:!0,description:!0,icon:!0,iconColor:!0}).required({title:!0}),content:_u.array()});R({name:N(),image:N(),params:Pe(N(),mt())});R({projectId:ee(),workerVersionId:ee(),workerInstanceId:ee(),apiUrl:oi(),dataEndpoint:N().min(1),apiKey:N()});Pe(N(),mt());R({});var bg=R({path:N(),content:N(),secret:ye().default(!1),mode:Me().int().optional()}),_g=R({name:N(),containerPort:Me().int().positive().max(65535),protocol:ae("tcp").default("tcp")}),kg=rt("type",[R({type:ae("tcp"),port:N(),timeoutSeconds:Me().int().positive().default(30)}),R({type:ae("http"),port:N(),path:N(),statuses:Me().int().positive().array().default([200]),timeoutSeconds:Me().int().positive().default(30)}),R({type:ae("log"),pattern:N(),timeoutSeconds:Me().int().positive().default(30)})]);R({identity:N().regex(/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/),image:N(),command:N().array().optional(),args:N().array().default([]),env:Pe(N(),N()).default({}),files:bg.array().default([]),ports:_g.array().default([]),readiness:kg.optional()});R({id:N(),host:N(),ports:Pe(N(),R({host:N(),port:Me().int().positive().max(65535)}))});const Sg=R({key:N(),order:tt(["asc","desc"])}),dt=R({search:N().optional(),sortBy:ve(Sg).optional(),pageSize:Me().int().nonnegative().default(0).optional(),pageToken:N().optional()}),$g=rt("type",[R({type:ae("resources"),resourceIds:On(N().min(1))}),R({type:ae("projects"),projectIds:On(ee())}),R({type:ae("project-spaces"),projectSpaceIds:On(ee()),recursive:ye().default(!1)}),R({type:ae("projects-in-spaces"),projectSpaceIds:On(ee()),recursive:ye().default(!1)})]),Eg=ve($g).min(1).refine(t=>new Set(t.map(e=>e.type)).size===t.length,"Restriction types must be unique"),$i=[{title:"Backend",permissions:[{name:"backend.get",title:"View backend",risk:"low"},{name:"backend.update",title:"Update backend",risk:"critical",consequence:"Allows changing backend-wide configuration and security-sensitive settings."},{name:"backend.search",title:"Search backend",risk:"low"}],supportedRestrictions:[]},{title:"Projects",permissions:[{name:"project.get",title:"View projects",risk:"low"},{name:"project.list",title:"List projects",risk:"low"},{name:"project.create",title:"Create projects",risk:"high"},{name:"project.open",title:"Open projects",risk:"high"},{name:"project.unlock",title:"Unlock projects",risk:"critical",consequence:"Allows submitting an identity that decrypts and opens a project."},{name:"project.attach",title:"Attach projects",risk:"high"},{name:"project.detach",title:"Detach projects",risk:"critical",consequence:"Allows disconnecting projects and making their resources unavailable through the backend."},{name:"project.migrate",title:"Migrate projects",risk:"critical",consequence:"Allows moving project data between storage backends and changing where it is controlled."}],supportedRestrictions:["projects","projects-in-spaces"]},{title:"Backend service account project bindings",permissions:[{name:"backend-service-account-project-binding.get",title:"View backend service account project bindings",risk:"low"},{name:"backend-service-account-project-binding.list",title:"List backend service account project bindings",risk:"low"},{name:"backend-service-account-project-binding.create",title:"Create backend service account project bindings",risk:"high"},{name:"backend-service-account-project-binding.update",title:"Update backend service account project bindings",risk:"high"},{name:"backend-service-account-project-binding.delete",title:"Delete backend service account project bindings",risk:"high"},{name:"backend-service-account-project-binding.bind",title:"Bind project service accounts",risk:"critical",consequence:"Allows assigning backend identities to project service accounts and their project permissions."}],supportedRestrictions:["projects","projects-in-spaces"]},{title:"Project spaces",permissions:[{name:"project-space.get",title:"View project spaces",risk:"low"},{name:"project-space.list",title:"List project spaces",risk:"low"},{name:"project-space.create",title:"Create project spaces",risk:"high"},{name:"project-space.update",title:"Update project spaces",risk:"high"},{name:"project-space.delete",title:"Delete project spaces",risk:"critical",consequence:"Allows deleting project-space organization and affecting every project arranged within it."}],supportedRestrictions:["project-spaces"]},{title:"Libraries",permissions:[{name:"library.get",title:"View libraries",risk:"low"},{name:"library.list",title:"List libraries",risk:"low"},{name:"library.manage",title:"Manage libraries",risk:"high"}],supportedRestrictions:["resources"],resourceType:"library"},{title:"Pulumi backends",permissions:[{name:"pulumi-backend.get",title:"View Pulumi backends",risk:"low"},{name:"pulumi-backend.list",title:"List Pulumi backends",risk:"low"},{name:"pulumi-backend.manage",title:"Manage Pulumi backends",risk:"critical",consequence:"Allows changing infrastructure state backends that control deployed resources."}],supportedRestrictions:["resources"],resourceType:"pulumi-backend"},{title:"Project model storages",permissions:[{name:"project-model-storage.get",title:"View project model storages",risk:"low"},{name:"project-model-storage.list",title:"List project model storages",risk:"low"},{name:"project-model-storage.manage",title:"Manage project model storages",risk:"critical",consequence:"Allows changing storage that contains project models and their infrastructure definitions."}],supportedRestrictions:["resources"],resourceType:"project-model-storage"},{title:"Service accounts",permissions:[{name:"service-account.get",title:"View service accounts",risk:"low"},{name:"service-account.list",title:"List service accounts",risk:"low"},{name:"service-account.manage",title:"Manage service accounts",risk:"high"},{name:"service-account.impersonate",title:"Impersonate service accounts",risk:"critical",consequence:"Allows acting with the authority of another backend service account."}],supportedRestrictions:["resources"],resourceType:"backend-service-account"},{title:"API keys",permissions:[{name:"api-key.get",title:"View API keys",risk:"low"},{name:"api-key.list",title:"List API keys",risk:"low"},{name:"api-key.create",title:"Create API keys",risk:"high"},{name:"api-key.update",title:"Update API keys",risk:"high"},{name:"api-key.rotate",title:"Rotate API keys",risk:"high"},{name:"api-key.delete",title:"Delete API keys",risk:"high"},{name:"api-key.escalate",title:"Escalate API key permissions",risk:"critical",consequence:"Allows API keys to receive permissions beyond the caller's current access."}],supportedRestrictions:["resources"],resourceType:"backend-api-key"},{title:"Roles",permissions:[{name:"role.get",title:"View roles",risk:"low"},{name:"role.list",title:"List roles",risk:"low"},{name:"role.create",title:"Create roles",risk:"high"},{name:"role.update",title:"Update roles",risk:"high"},{name:"role.delete",title:"Delete roles",risk:"high"},{name:"role.escalate",title:"Escalate role permissions",risk:"critical",consequence:"Allows roles to receive permissions beyond the caller's current access."}],supportedRestrictions:["resources"],resourceType:"backend-role"},{title:"Role bindings",permissions:[{name:"role-binding.get",title:"View role bindings",risk:"low"},{name:"role-binding.list",title:"List role bindings",risk:"low"},{name:"role-binding.create",title:"Create role bindings",risk:"high"},{name:"role-binding.delete",title:"Delete role bindings",risk:"high"},{name:"role-binding.bind",title:"Bind roles beyond own permissions",risk:"critical",consequence:"Allows granting roles whose permissions exceed the caller's current access."}],supportedRestrictions:[]}],Ig=$i.flatMap(t=>t.permissions.map(e=>e.name)),Ag=tt(Ig),Og=R({permissions:On(Ag),restrictions:Eg.optional()}).strict().superRefine((t,e)=>{const n=$i.filter(r=>r.permissions.some(s=>t.permissions.includes(s.name)));for(const r of t.restrictions??[]){const s=n.find(o=>!o.supportedRestrictions.includes(r.type));if(s&&e.addIssue({code:"custom",message:`Permission group "${s.title}" does not support "${r.type}" restriction`,path:["restrictions"]}),r.type!=="resources")continue;new Set(n.map(o=>"resourceType"in o?o.resourceType:void 0)).size>1&&e.addIssue({code:"custom",message:"Permissions with resource restrictions must use the same resource type",path:["restrictions"]})}}),Ei=ve(Og).min(1);function On(t){return ve(t).min(1).refine(e=>new Set(e).size===e.length,"Values must be unique")}const Tg=Ei.or(Ec([])),Ng=R({meta:ke.extend({title:N().trim().min(1)}),serviceAccountId:ee().optional(),restrictionRules:Tg,expiresAt:ce().nullable()}),Pg=Ng.required({serviceAccountId:!0}).extend({id:ee(),serviceAccountMeta:yt,lastUsedAt:ce().nullable(),...Mn.shape});dt.extend({serviceAccountId:ee().optional()});R({apiKey:Pg,token:N().min(1)});const Cg=R({meta:ke.extend({title:N().trim().min(1)}),rules:Ei});Cg.extend({id:ee(),systemName:Ze.nullable(),...Mn.shape});const xg=R({meta:yt}),jg=xg.extend({id:ee(),systemName:Ze.nullable(),...Mn.shape});jg.extend({rules:ve(Ei.element)});R({roleId:ee(),serviceAccountId:ee(),createdAt:ce()});const Bg=R({backendServiceAccountId:ee(),projectId:ee(),projectServiceAccountId:ee(),createdAt:ce()});R({projectId:ee(),projectMeta:ke,unlocked:ye(),serviceAccounts:ve(R({id:ee(),meta:yt,systemName:Ze.nullable()})),binding:Bg.nullable()});const As=R({id:N().min(1),meta:ke});R({resources:Pe(N(),ve(As)),projects:ve(As),projectSpaces:ve(As)});rt("type",[R({type:ae("host")})]);$i.flatMap(t=>t.permissions.map(e=>e.name));const Dg={id:"q8xbilhwpsn65zjlv5kz44qh"},Rg={id:"n0rfvpl9o77iqf29ff4kk5gf"},zg={id:"pmn9y901jeiz2ydh93045l39"},Fg={id:"qppfcerovu3h22o0x8rlpc3g"};rt("type",[R({type:ae("codebase")}),R({type:ae("database")})]);R({name:Ze,spaceId:ee().default(Dg.id),modelStorageId:ee().default(Fg.id),libraryId:ee().default(Rg.id),pulumiBackendId:ee().default(zg.id),meta:ke});R({id:N(),name:Ze,meta:ke,spaceId:ee(),modelStorageId:ee(),libraryId:ee(),pulumiBackendId:ee(),...Mn.shape});const Mg=R({encryptedIdentities:ve(N()),hasPasskey:ye(),passkeys:ve(R({encryptedIdentity:N(),passkeyIdentity:N()})).default([])});rt("type",[R({type:ae("locked"),unlockSuite:Mg.optional()}),R({type:ae("unlocked")})]);rt("type",[R({type:ae("host")})]);const Ug=He.pick({title:!0,description:!0}).required({title:!0});R({meta:Ug,recipient:N()});tt(["low","medium","high","critical"]);const wo=R({name:N().min(1),title:N().min(1)});rt("risk",[wo.extend({risk:tt(["low","medium","high"])}),wo.extend({risk:ae("critical"),consequence:N().trim().min(1)})]);const Lg=rt("type",[R({type:ae("resources"),resourceIds:Tn(N().min(1))}),R({type:ae("instances"),instanceIds:Tn(St),recursive:ye().default(!1)}),R({type:ae("owners"),serviceAccountIds:Tn(ee())}),R({type:ae("self")}),R({type:ae("workers"),workerIds:Tn(ee())})]),qg=ve(Lg).min(1).refine(t=>new Set(t.map(e=>e.type)).size===t.length,"Restriction types must be unique"),Ii=[{title:"Instance models",permissions:[{name:"instance-model.get",title:"View instance models",risk:"low"},{name:"instance-model.update",title:"Update instance models",risk:"high"}],supportedRestrictions:["instances"]},{title:"Instance states",permissions:[{name:"instance-state.get",title:"View instance states",risk:"low"},{name:"instance-state.list",title:"List instance states",risk:"low"},{name:"instance-status.update",title:"Update instance statuses",risk:"medium"},{name:"instance-state.delete",title:"Forget instance states",risk:"high"}],supportedRestrictions:["instances"]},{title:"Operations",permissions:[{name:"operation.get",title:"View operations",risk:"low"},{name:"operation.list",title:"List operations",risk:"low"},{name:"operation.create",title:"Create operations",risk:"high"},{name:"operation.cancel",title:"Cancel operations",risk:"high"},{name:"operation.logs.get",title:"View operation logs",risk:"medium"}],supportedRestrictions:["resources","instances"],resourceType:"operation"},{title:"Secrets",permissions:[{name:"secret.metadata.get",title:"View secret metadata",risk:"low"},{name:"secret.value.get",title:"View secret values",risk:"high"},{name:"secret.list",title:"List secrets",risk:"low"},{name:"secret.create",title:"Create secrets",risk:"high"},{name:"secret.update",title:"Update secrets",risk:"high"},{name:"secret.delete",title:"Delete secrets",risk:"high"}],supportedRestrictions:["resources","instances","owners","self"],resourceType:"secret"},{title:"Artifacts",permissions:[{name:"artifact.get",title:"View artifacts",risk:"low"},{name:"artifact.list",title:"List artifacts",risk:"low"},{name:"artifact.create",title:"Create artifacts",risk:"medium"},{name:"artifact.delete",title:"Delete artifacts",risk:"high"}],supportedRestrictions:["resources","instances","owners","self"],resourceType:"artifact"},{title:"Terminals",permissions:[{name:"terminal.get",title:"View terminals",risk:"low"},{name:"terminal.list",title:"List terminals",risk:"low"},{name:"terminal.connect",title:"Connect to terminals",risk:"high"},{name:"terminal.create",title:"Create terminals",risk:"high"},{name:"terminal.update",title:"Update terminals",risk:"high"},{name:"terminal.delete",title:"Delete terminals",risk:"high"}],supportedRestrictions:["resources","instances","owners","self"],resourceType:"terminal"},{title:"Pages",permissions:[{name:"page.get",title:"View pages",risk:"low"},{name:"page.list",title:"List pages",risk:"low"},{name:"page.create",title:"Create pages",risk:"medium"},{name:"page.update",title:"Update pages",risk:"medium"},{name:"page.delete",title:"Delete pages",risk:"high"}],supportedRestrictions:["resources","instances","owners","self"],resourceType:"page"},{title:"Panels",permissions:[{name:"panel.get",title:"View panels",risk:"low"},{name:"panel.list",title:"List panels",risk:"low"},{name:"panel.create",title:"Create panels",risk:"medium"},{name:"panel.update",title:"Update panels",risk:"medium"},{name:"panel.delete",title:"Delete panels",risk:"high"}],supportedRestrictions:["resources","instances","owners","self","workers"],resourceType:"panel"},{title:"Workers",permissions:[{name:"worker.get",title:"View workers",risk:"low"},{name:"worker.list",title:"List workers",risk:"low"},{name:"worker.manage",title:"Manage workers",risk:"high"}],supportedRestrictions:["resources","owners","self","workers"],resourceType:"worker"},{title:"Worker versions",permissions:[{name:"worker-version.get",title:"View worker versions",risk:"low"},{name:"worker-version.list",title:"List worker versions",risk:"low"},{name:"worker-version.restart",title:"Restart worker versions",risk:"high"}],supportedRestrictions:["resources","owners","self","workers"],resourceType:"worker-version"},{title:"Entities",permissions:[{name:"entity.get",title:"View entities",risk:"low"},{name:"entity.list",title:"List entities",risk:"low"}],supportedRestrictions:["resources","instances","owners","self"],resourceType:"entity"},{title:"Entity snapshots",permissions:[{name:"entity-snapshot.get",title:"View entity snapshots",risk:"medium"},{name:"entity-snapshot.list",title:"List entity snapshots",risk:"low"}],supportedRestrictions:["resources","instances","owners","self"],resourceType:"entity-snapshot"},{title:"Triggers",permissions:[{name:"trigger.get",title:"View triggers",risk:"low"},{name:"trigger.list",title:"List triggers",risk:"low"}],supportedRestrictions:["resources","instances"],resourceType:"trigger"},{title:"Unlock methods",permissions:[{name:"unlock-method.get",title:"View unlock methods",risk:"low"},{name:"unlock-method.list",title:"List unlock methods",risk:"low"},{name:"unlock-method.create",title:"Create unlock methods",risk:"critical",consequence:"Allows adding identities that can decrypt the project."},{name:"unlock-method.delete",title:"Delete unlock methods",risk:"critical",consequence:"Allows removing identities that can decrypt the project."}],supportedRestrictions:["resources"],resourceType:"unlock-method"},{title:"Service accounts",permissions:[{name:"service-account.get",title:"View service accounts",risk:"low"},{name:"service-account.list",title:"List service accounts",risk:"low"},{name:"service-account.manage",title:"Manage service accounts",risk:"high"},{name:"service-account.impersonate",title:"Impersonate service accounts",risk:"critical",consequence:"Allows acting with the authority of another project service account."}],supportedRestrictions:["resources"],resourceType:"service-account"},{title:"API keys",permissions:[{name:"api-key.get",title:"View API keys",risk:"low"},{name:"api-key.list",title:"List API keys",risk:"low"},{name:"api-key.create",title:"Create API keys",risk:"high"},{name:"api-key.update",title:"Update API keys",risk:"high"},{name:"api-key.rotate",title:"Rotate API keys",risk:"high"},{name:"api-key.delete",title:"Delete API keys",risk:"high"},{name:"api-key.escalate",title:"Escalate API key permissions",risk:"critical",consequence:"Allows API keys to receive permissions beyond the caller's current access."}],supportedRestrictions:["resources","owners","self"],resourceType:"api-key"},{title:"Roles",permissions:[{name:"role.get",title:"View roles",risk:"low"},{name:"role.list",title:"List roles",risk:"low"},{name:"role.create",title:"Create roles",risk:"high"},{name:"role.update",title:"Update roles",risk:"high"},{name:"role.delete",title:"Delete roles",risk:"high"},{name:"role.escalate",title:"Escalate role permissions",risk:"critical",consequence:"Allows roles to receive permissions beyond the caller's current access."}],supportedRestrictions:["resources"],resourceType:"role"},{title:"Role bindings",permissions:[{name:"role-binding.get",title:"View role bindings",risk:"low"},{name:"role-binding.list",title:"List role bindings",risk:"low"},{name:"role-binding.create",title:"Create role bindings",risk:"high"},{name:"role-binding.delete",title:"Delete role bindings",risk:"high"},{name:"role-binding.bind",title:"Bind roles beyond own permissions",risk:"critical",consequence:"Allows granting roles whose permissions exceed the caller's current access."}],supportedRestrictions:[]}],Vg=Ii.flatMap(t=>t.permissions.map(e=>e.name)),Zg=tt(Vg),Kg=R({permissions:Tn(Zg),restrictions:qg.optional()}).strict().superRefine((t,e)=>{const n=Ii.filter(r=>r.permissions.some(s=>t.permissions.includes(s.name)));for(const r of t.restrictions??[]){const s=n.find(o=>!o.supportedRestrictions.includes(r.type));if(s&&e.addIssue({code:"custom",message:`Permission group "${s.title}" does not support "${r.type}" restriction`,path:["restrictions"]}),r.type!=="resources")continue;new Set(n.map(o=>"resourceType"in o?o.resourceType:void 0)).size>1&&e.addIssue({code:"custom",message:"Permissions with resource restrictions must use the same resource type",path:["restrictions"]})}}),Ai=ve(Kg).min(1);function Tn(t){return ve(t).min(1).refine(e=>new Set(e).size===e.length,"Values must be unique")}const ku=He.pick({title:!0,description:!0}).required({title:!0}),Su=Ai.or(Ec([]));R({meta:ku,serviceAccountId:ee().optional(),restrictionRules:Su,expiresAt:ce().nullable()});const Jg=R({id:ee(),meta:ke,serviceAccountId:ee(),serviceAccountMeta:yt.nullable(),restrictionRules:Su,expiresAt:ce().nullable(),lastUsedAt:ce().nullable(),createdAt:ce(),updatedAt:ce(),managed:ye()});dt.extend({serviceAccountId:N().optional()});R({apiKey:Jg,token:N().min(1)});R({id:ee(),hash:N(),size:Me(),meta:ke,createdAt:ce(),updatedAt:ce()});dt.extend({stateId:N().optional(),serviceAccountId:N().optional(),terminalId:N().optional(),pageId:N().optional()});const Hg=R({meta:ke.extend({title:N().trim().min(1)}),rules:Ai});Hg.extend({id:ee(),systemName:Ze.nullable(),...Mn.shape});R({roleId:ee(),serviceAccountId:ee(),createdAt:ce()});const Xn=R({id:N().min(1),title:N()});R({resources:Pe(N(),ve(Xn)),instances:ve(Xn),serviceAccounts:ve(Xn),workers:ve(Xn)});R({id:ee(),meta:ke,systemName:Ze.nullable(),rules:ve(Ai.element)});R({name:N(),meta:ke,value:N(),message:N().optional(),order:Me().min(0).max(100).optional()});R({identity:N().optional(),title:N().optional(),description:N().optional(),icon:N().optional(),iconColor:N().optional()}).passthrough();const Gg=R({id:N(),type:N(),identity:N(),meta:ke,snapshotId:N().optional(),createdAt:ce().optional()});dt.extend({type:N().optional()});const $u=R({id:N(),meta:ke,content:mt(),operationId:N(),stateId:N(),referencedInOutputs:N().array(),exportedInOutputs:N().array(),createdAt:ce()});R({id:N(),entityType:N(),meta:ke,operationId:N(),stateId:N(),createdAt:ce()});R({entity:R({id:N(),type:N(),identity:N()}),snapshot:$u});R({...Gg.shape,lastSnapshot:$u.nullable()});R({id:N(),meta:ke,group:N(),fromSnapshotId:N(),fromEntityId:N(),fromEntityType:N(),fromEntityIdentity:N(),fromEntityMeta:ke,toSnapshotId:N(),toEntityId:N(),toEntityType:N(),toEntityIdentity:N(),toEntityMeta:ke});const Wg=R({stateId:ee(),meta:ke,acquiredAt:ce()});rt("type",[R({type:ae("locked"),locks:Wg.array()}),R({type:ae("unlocked"),stateIds:ve(N())})]);Kr.pick({id:!0,kind:!0,type:!0,name:!0,args:!0,inputs:!0,hubInputs:!0,injectionInputs:!0,position:!0});R({updatedInstances:Kr.array().optional(),updatedHubs:tg.array().optional(),updatedVirtualInstances:Kr.array().optional(),updatedGhostInstances:Kr.array().optional(),deletedInstanceIds:St.array().optional(),deletedHubIds:N().array().optional(),deletedVirtualInstanceIds:St.array().optional(),deletedGhostInstanceIds:St.array().optional()});const Yg=tt(["destroy","preview","update","refresh"]),Xg=R({id:St,parentId:N().optional(),message:N()}),Qg=R({type:Yg,instances:ve(Xg)}),ey=R({forceUpdateDependencies:ye().default(!1),ignoreChangedDependencies:ye().default(!1),ignoreDependencies:ye().default(!1),forceUpdateChildren:ye().default(!1),onlyDestroyGhosts:ye().default(!1),firstDestroyGhosts:ye().default(!1),ignoreGhosts:ye().default(!1),destroyDependentInstances:ye().default(!0),invokeDestroyTriggers:ye().default(!0),deleteUnreachableResources:ye().default(!1),forceDeleteState:ye().default(!1),allowPartialCompositeInstanceUpdate:ye().default(!1),allowPartialCompositeInstanceDestruction:ye().default(!1),refresh:ye().default(!1),debug:ye().default(!1)}).partial(),Eu=tt(["update","preview","destroy","recreate","refresh"]),ty=tt(["pending","running","failing","completed","failed","cancelled","cancelling"]),Iu=He.pick({title:!0,description:!0}).required({title:!0}),ny=R({projectId:N(),type:Eu,instanceIds:ve(St).min(1),options:ey.partial().optional()});ny.extend({meta:Iu,plan:Qg.array().optional()});rt("type",[R({type:ae("updated"),operation:en()}),R({type:ae("deleted"),operationId:N()})]);R({id:ee(),type:Eu,status:ty,meta:Iu,startedAt:ce(),updatedAt:ce(),finishedAt:ce().nullable()});const ry=R({id:ee(),meta:ke,name:N().nullable(),stateId:ee().nullable(),serviceAccountId:ee().nullable(),serviceAccountMeta:yt.nullable(),createdAt:ce(),updatedAt:ce()});dt.extend({serviceAccountId:N().optional(),stateId:N().optional(),artifactId:N().optional()});R({...ry.shape,content:ve(_u)});R({name:N().min(1),meta:ke});R({id:ee(),name:N(),meta:ke,stateId:ee(),serviceAccountId:ee(),serviceAccountMeta:ke,workerVersionId:ee(),workerVersionMeta:ke,workerId:ee(),online:ye(),createdAt:ce(),updatedAt:ce()});R({online:ye()});dt.extend({stateId:ee().optional(),serviceAccountId:ee().optional(),workerVersionId:ee().optional()});R({id:ee(),meta:gu,name:N().nullable(),systemName:N().nullable(),stateId:ee().nullable(),serviceAccountId:ee().nullable(),serviceAccountMeta:yt.nullable(),createdAt:ce(),updatedAt:ce()});dt.extend({serviceAccountId:N().optional(),stateId:N().optional()});const sy=R({meta:yt});sy.extend({id:ee(),meta:yt,systemName:Ze.nullable(),createdAt:ce(),updatedAt:ce()});dt.extend({artifactId:N().optional()});R({stateId:N(),output:N(),path:N().optional()});rt("type",[R({type:ae("updated"),state:en()}),R({type:ae("patched"),stateId:N(),patch:en()}),R({type:ae("patched-batch"),patches:ve(R({stateId:N(),patch:en()}))}),R({type:ae("deleted"),stateId:N()})]);rt("type",[R({type:ae("registered"),stateId:N(),params:Pe(N(),mt())}),R({type:ae("deregistered"),stateId:N()})]);const iy=tt(["active","unavailable"]);R({id:ee(),terminalId:ee(),meta:gu,startedAt:ce(),finishedAt:ce().nullable()});const oy=R({id:ee(),name:N().nullable(),meta:ke,status:iy,stateId:N().nullable(),serviceAccountId:N().nullable(),serviceAccountMeta:yt.nullable(),createdAt:ce(),updatedAt:ce()});dt.extend({serviceAccountId:N().optional(),stateId:N().optional(),artifactId:N().optional()});R({...oy.shape,spec:bu});R({id:ee(),meta:ke,name:N(),stateId:ee(),createdAt:ce(),updatedAt:ce()});dt.extend({stateId:N().optional()});const ay=tt(["password","passkey"]),Qs=He.pick({title:!0,description:!0}).required({title:!0});rt("type",[R({meta:Qs,type:ae("password"),encryptedIdentity:N(),recipient:N()}),R({meta:Qs,type:ae("passkey"),encryptedIdentity:N(),passkeyIdentity:N(),recipient:N()})]);R({id:ee(),type:ay,meta:Qs,recipient:N(),createdAt:ce(),updatedAt:ce()});const cy=R({title:N().min(1),username:N().min(1).optional(),email:Rh().optional(),avatarUrl:oi().optional()}),uy=tt(["local","oidc"]);R({id:ee(),type:uy,meta:cy,createdAt:ce(),updatedAt:ce()});const ly=R({title:N().min(1),description:N().optional(),avatarUrl:oi().optional()});R({id:ee(),meta:ly,createdAt:ce(),updatedAt:ce()});Ii.flatMap(t=>t.permissions.map(e=>e.name));const Au=tt(["unknown","starting","running","stopping","stopped","error"]);R({workerVersionId:ee(),status:Au});R({id:ee(),digest:N(),meta:ke,status:Au,enabled:ye(),apiKeyId:N(),apiKeyMeta:ku,createdAt:ce(),updatedAt:ce()});R({id:ee(),identity:N(),meta:ke,serviceAccountId:N(),serviceAccountMeta:yt,createdAt:ce()});dt.extend({serviceAccountId:N().optional()});function Ou(t){const e=t.visited??new Set,n=t.getInstanceContext(t.input.instanceId);if(!n)return Os({rootType:t.fallbackType,path:t.input.path,entities:void 0,fallbackType:t.fallbackType});const r=n.component.outputs[t.input.output];if(!r)return Os({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,u=(n.instance.injectionInputs?.length??0)>0,d=n.instance.inputs?.[o]??[];if(!c&&!u&&d.length===1){const p=d[0];p?s=Ou({input:p,fallbackType:a,getInstanceContext:t.getInstanceContext,visited:e}):s=a}else s=a}}return Os({rootType:s,path:t.input.path,entities:n.entities,fallbackType:t.fallbackType})}function Os(t){const{rootType:e,path:n,entities:r,fallbackType:s}=t;if(!n||!r)return fy(e,s,r);let i=e;const o=n.split(".");for(const a of o){const c=r[i];if(!c)return e;const u=c.inclusions?.find(d=>d.field===a);if(!u)return e;i=u.type}return i}function fy(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 Oi{constructor(e,n,r,s){this.nodes=e,this.logger=n,this.outputHandler=r,this.dependentSetHandler=s}nodes;logger;outputHandler;dependentSetHandler;workset=new Set;dependencyMap=new Map;dependentMap=new Map;outputMap=new Map;addToWorkset(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)}}canAddDependency(e,n){if(e===n)return!1;const r=[e],s=new Set;for(;r.length>0;){const i=r.pop();if(i===n)return!1;if(s.has(i))continue;s.add(i);const o=this.dependentMap.get(i);if(o)for(const a of o)this.nodes.has(a)&&r.push(a)}return!0}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=Fp(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 u=new Set,d=this.dependencyMap.get(i)??[];for(const p of d){const h=this.dependentMap.get(p);h&&(h.delete(i),u.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),u.add(p)}if(this.dependentSetHandler)for(const p of u){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 dy extends Oi{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 Ou({input:e,fallbackType:n,getInstanceContext:r=>{const s=this.outputs.get(`instance:${r}`);if(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(wn(h.input),h)};for(const h of e.hub.inputs??[]){const{component:m}=r(h),b=m?.outputs[h.output];if(!b){this.logger.warn({msg:"output not found in the component",input:h,component:m});continue}p({input:h,type:this.resolveOutputTypeForInput(h,b.type)})}for(const h of e.hub.injectionInputs??[]){const{resolvedInputs:m}=n(h);for(const b of m)p(b)}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:Rp(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(wn(p.input),p)},o=(d,p)=>{const h=e.component.inputs[d],m=e.instance.type===Fu;if(!h&&!m){this.logger.warn({msg:"input not found in the component",input:p,component:e.component});return}const{component:b,resolvedOutputs:w}=r(p);if(!b){this.logger.warn({instanceId:e.instance.id,input:p},"no output found for the input");return}const g=h?.type??b.outputs[p.output]?.type;if(!g){this.logger.warn({instanceId:e.instance.id,input:p,component:b},"cannot resolve input type for dynamic export input");return}if(Si(b)){i(d,{input:p,type:this.resolveOutputTypeForInput(p,g)});return}if(w)for(const k of w)i(d,{input:{...k,path:p.path??k.path},type:this.resolveOutputTypeForInput({instanceId:p.instanceId,output:p.output,path:p.path??k.path},g)});else i(d,{input:p,type:this.resolveOutputTypeForInput(p,g)})};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(wn(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 b of m){const{resolvedInputs:w}=n(b);for(const g of w)h.set(wn(g.input),g)}for(const b of h.values())if(b.type===p.type){o(d,b.input);const w=wn(b.input);a.has(w)&&c.set(w,b)}}const u=Dp(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:u,resolvedOutputs:e.instance.resolvedOutputs,resolvedInjectionInputs:Array.from(a.values()),matchedInjectionInputs:Array.from(c.values())}}}function hy(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 py=t=>new TextEncoder().encode(t);typeof Buffer<"u"&&Buffer.from;function my(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 Ts(t){return new gy().update(t).digest()}var gy=(function(){function t(){this.checksum=4294967295}return t.prototype.update=function(e){var n,r;try{for(var s=hy(e),i=s.next();!i.done;i=s.next()){var o=i.value;this.checksum=this.checksum>>>8^wy[(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})(),yy=[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],wy=my(yy);function vy(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 by(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 _y=new TextEncoder,ky=50;function Sy(t,e,n){_y.encodeInto(t,e.subarray(n))}function $y(t,e,n){t.length>ky?Sy(t,e,n):by(t,e,n)}new TextDecoder;class Qn{type;data;constructor(e,n){this.type=e,this.data=n}}class Qr extends Error{constructor(e){super(e);const n=Object.create(Qr.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:Qr.name})}}function Ey(t,e,n){const r=n/4294967296,s=n;t.setUint32(e,r),t.setUint32(e+4,s)}function Tu(t,e,n){const r=Math.floor(n/4294967296),s=n;t.setUint32(e,r),t.setUint32(e+4,s)}function Iy(t,e){const n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}const Ay=-1,Oy=4294967296-1,Ty=17179869184-1;function Ny({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Ty)if(e===0&&t<=Oy){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),Tu(r,4,t),n}}function Py(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 Cy(t){if(t instanceof Date){const e=Py(t);return Ny(e)}else return null}function xy(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=Iy(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new Qr(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function jy(t){const e=xy(t);return new Date(e.sec*1e3+e.nsec/1e6)}const By={type:Ay,encode:Cy,decode:jy};class Ti{static defaultCodec=new Ti;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(By)}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 Qn(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 Qn(o,i)}}}return e instanceof Qn?e:null}decode(e,n,r){const s=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return s?s(e,n,r):new Qn(n,e)}}function Dy(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function Ry(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Dy(t)?new Uint8Array(t):Uint8Array.from(t)}const zy=100,Fy=2048;class Ni{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??Ti.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??zy,this.initialBufferSize=e?.initialBufferSize??Fy,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 Ni({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=vy(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),$y(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=Ry(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),Ey(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),Tu(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 My(t,e){return new Ni(e).encodeSharedRef(t)}var Ns={},vn={},vo;function Uy(){if(vo)return vn;vo=1,vn.byteLength=a,vn.toByteArray=u,vn.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 b=m.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var w=m.indexOf("=");w===-1&&(w=b);var g=w===b?0:4-w%4;return[w,g]}function a(m){var b=o(m),w=b[0],g=b[1];return(w+g)*3/4-g}function c(m,b,w){return(b+w)*3/4-w}function u(m){var b,w=o(m),g=w[0],k=w[1],y=new n(c(m,g,k)),_=0,I=k>0?g-4:g,v;for(v=0;v<I;v+=4)b=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 k===2&&(b=e[m.charCodeAt(v)]<<2|e[m.charCodeAt(v+1)]>>4,y[_++]=b&255),k===1&&(b=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,b,w){for(var g,k=[],y=b;y<w;y+=3)g=(m[y]<<16&16711680)+(m[y+1]<<8&65280)+(m[y+2]&255),k.push(d(g));return k.join("")}function h(m){for(var b,w=m.length,g=w%3,k=[],y=16383,_=0,I=w-g;_<I;_+=y)k.push(p(m,_,_+y>I?I:_+y));return g===1?(b=m[w-1],k.push(t[b>>2]+t[b<<4&63]+"==")):g===2&&(b=(m[w-2]<<8)+m[w-1],k.push(t[b>>10]+t[b>>4&63]+t[b<<2&63]+"=")),k.join("")}return vn}var er={};var bo;function Ly(){return bo||(bo=1,er.read=function(t,e,n,r,s){var i,o,a=s*8-r-1,c=(1<<a)-1,u=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-u;else{if(i===c)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,r),i=i-u}return(m?-1:1)*o*Math.pow(2,i-r)},er.write=function(t,e,n,r,s,i){var o,a,c,u=i*8-s-1,d=(1<<u)-1,p=d>>1,h=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:i-1,b=r?1:-1,w=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+=b,a/=256,s-=8);for(o=o<<s|a,u+=s;u>0;t[n+m]=o&255,m+=b,o/=256,u-=8);t[n+m-b]|=w*128}),er}var _o;function qy(){return _o||(_o=1,(function(t){const e=Uy(),n=Ly(),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),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(S,l),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 l=new Uint8Array(S);return Object.setPrototypeOf(l,a.prototype),l}function a(S,l,f){if(typeof S=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(S)}return c(S,l,f)}a.poolSize=8192;function c(S,l,f){if(typeof S=="string")return h(S,l);if(ArrayBuffer.isView(S))return b(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(qe(S,ArrayBuffer)||S&&qe(S.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(S,SharedArrayBuffer)||S&&qe(S.buffer,SharedArrayBuffer)))return w(S,l,f);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const A=S.valueOf&&S.valueOf();if(A!=null&&A!==S)return a.from(A,l,f);const x=g(S);if(x)return x;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return a.from(S[Symbol.toPrimitive]("string"),l,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,l,f){return c(S,l,f)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function u(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,l,f){return u(S),S<=0?o(S):l!==void 0?typeof f=="string"?o(S).fill(l,f):o(S).fill(l):o(S)}a.alloc=function(S,l,f){return d(S,l,f)};function p(S){return u(S),o(S<0?0:k(S)|0)}a.allocUnsafe=function(S){return p(S)},a.allocUnsafeSlow=function(S){return p(S)};function h(S,l){if((typeof l!="string"||l==="")&&(l="utf8"),!a.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const f=_(S,l)|0;let A=o(f);const x=A.write(S,l);return x!==f&&(A=A.slice(0,x)),A}function m(S){const l=S.length<0?0:k(S.length)|0,f=o(l);for(let A=0;A<l;A+=1)f[A]=S[A]&255;return f}function b(S){if(qe(S,Uint8Array)){const l=new Uint8Array(S);return w(l.buffer,l.byteOffset,l.byteLength)}return m(S)}function w(S,l,f){if(l<0||S.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(S.byteLength<l+(f||0))throw new RangeError('"length" is outside of buffer bounds');let A;return l===void 0&&f===void 0?A=new Uint8Array(S):f===void 0?A=new Uint8Array(S,l):A=new Uint8Array(S,l,f),Object.setPrototypeOf(A,a.prototype),A}function g(S){if(a.isBuffer(S)){const l=k(S.length)|0,f=o(l);return f.length===0||S.copy(f,0,0,l),f}if(S.length!==void 0)return typeof S.length!="number"||Je(S.length)?o(0):m(S);if(S.type==="Buffer"&&Array.isArray(S.data))return m(S.data)}function k(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(l){return l!=null&&l._isBuffer===!0&&l!==a.prototype},a.compare=function(l,f){if(qe(l,Uint8Array)&&(l=a.from(l,l.offset,l.byteLength)),qe(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(l)||!a.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===f)return 0;let A=l.length,x=f.length;for(let z=0,Z=Math.min(A,x);z<Z;++z)if(l[z]!==f[z]){A=l[z],x=f[z];break}return A<x?-1:x<A?1:0},a.isEncoding=function(l){switch(String(l).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(l,f){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return a.alloc(0);let A;if(f===void 0)for(f=0,A=0;A<l.length;++A)f+=l[A].length;const x=a.allocUnsafe(f);let z=0;for(A=0;A<l.length;++A){let Z=l[A];if(qe(Z,Uint8Array))z+Z.length>x.length?(a.isBuffer(Z)||(Z=a.from(Z)),Z.copy(x,z)):Uint8Array.prototype.set.call(x,Z,z);else if(a.isBuffer(Z))Z.copy(x,z);else throw new TypeError('"list" argument must be an Array of Buffers');z+=Z.length}return x};function _(S,l){if(a.isBuffer(S))return S.length;if(ArrayBuffer.isView(S)||qe(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,A=arguments.length>2&&arguments[2]===!0;if(!A&&f===0)return 0;let x=!1;for(;;)switch(l){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 Le(S).length;default:if(x)return A?-1:$e(S).length;l=(""+l).toLowerCase(),x=!0}}a.byteLength=_;function I(S,l,f){let A=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,l>>>=0,f<=l))return"";for(S||(S="utf8");;)switch(S){case"hex":return ue(this,l,f);case"utf8":case"utf-8":return he(this,l,f);case"ascii":return se(this,l,f);case"latin1":case"binary":return re(this,l,f);case"base64":return ie(this,l,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,l,f);default:if(A)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),A=!0}}a.prototype._isBuffer=!0;function v(S,l,f){const A=S[l];S[l]=S[f],S[f]=A}a.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<l;f+=2)v(this,f,f+1);return this},a.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<l;f+=4)v(this,f,f+3),v(this,f+1,f+2);return this},a.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<l;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 l=this.length;return l===0?"":arguments.length===0?he(this,0,l):I.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(l){if(!a.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:a.compare(this,l)===0},a.prototype.inspect=function(){let l="";const f=t.INSPECT_MAX_BYTES;return l=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(l+=" ... "),"<Buffer "+l+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(l,f,A,x,z){if(qe(l,Uint8Array)&&(l=a.from(l,l.offset,l.byteLength)),!a.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(f===void 0&&(f=0),A===void 0&&(A=l?l.length:0),x===void 0&&(x=0),z===void 0&&(z=this.length),f<0||A>l.length||x<0||z>this.length)throw new RangeError("out of range index");if(x>=z&&f>=A)return 0;if(x>=z)return-1;if(f>=A)return 1;if(f>>>=0,A>>>=0,x>>>=0,z>>>=0,this===l)return 0;let Z=z-x,me=A-f;const je=Math.min(Z,me),Oe=this.slice(x,z),Be=l.slice(f,A);for(let Ee=0;Ee<je;++Ee)if(Oe[Ee]!==Be[Ee]){Z=Oe[Ee],me=Be[Ee];break}return Z<me?-1:me<Z?1:0};function E(S,l,f,A,x){if(S.length===0)return-1;if(typeof f=="string"?(A=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Je(f)&&(f=x?0:S.length-1),f<0&&(f=S.length+f),f>=S.length){if(x)return-1;f=S.length-1}else if(f<0)if(x)f=0;else return-1;if(typeof l=="string"&&(l=a.from(l,A)),a.isBuffer(l))return l.length===0?-1:O(S,l,f,A,x);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?x?Uint8Array.prototype.indexOf.call(S,l,f):Uint8Array.prototype.lastIndexOf.call(S,l,f):O(S,[l],f,A,x);throw new TypeError("val must be string, number or Buffer")}function O(S,l,f,A,x){let z=1,Z=S.length,me=l.length;if(A!==void 0&&(A=String(A).toLowerCase(),A==="ucs2"||A==="ucs-2"||A==="utf16le"||A==="utf-16le")){if(S.length<2||l.length<2)return-1;z=2,Z/=2,me/=2,f/=2}function je(Be,Ee){return z===1?Be[Ee]:Be.readUInt16BE(Ee*z)}let Oe;if(x){let Be=-1;for(Oe=f;Oe<Z;Oe++)if(je(S,Oe)===je(l,Be===-1?0:Oe-Be)){if(Be===-1&&(Be=Oe),Oe-Be+1===me)return Be*z}else Be!==-1&&(Oe-=Oe-Be),Be=-1}else for(f+me>Z&&(f=Z-me),Oe=f;Oe>=0;Oe--){let Be=!0;for(let Ee=0;Ee<me;Ee++)if(je(S,Oe+Ee)!==je(l,Ee)){Be=!1;break}if(Be)return Oe}return-1}a.prototype.includes=function(l,f,A){return this.indexOf(l,f,A)!==-1},a.prototype.indexOf=function(l,f,A){return E(this,l,f,A,!0)},a.prototype.lastIndexOf=function(l,f,A){return E(this,l,f,A,!1)};function P(S,l,f,A){f=Number(f)||0;const x=S.length-f;A?(A=Number(A),A>x&&(A=x)):A=x;const z=l.length;A>z/2&&(A=z/2);let Z;for(Z=0;Z<A;++Z){const me=parseInt(l.substr(Z*2,2),16);if(Je(me))return Z;S[f+Z]=me}return Z}function q(S,l,f,A){return xe($e(l,S.length-f),S,f,A)}function H(S,l,f,A){return xe(Ue(l),S,f,A)}function G(S,l,f,A){return xe(Le(l),S,f,A)}function Y(S,l,f,A){return xe(Ke(l,S.length-f),S,f,A)}a.prototype.write=function(l,f,A,x){if(f===void 0)x="utf8",A=this.length,f=0;else if(A===void 0&&typeof f=="string")x=f,A=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(A)?(A=A>>>0,x===void 0&&(x="utf8")):(x=A,A=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const z=this.length-f;if((A===void 0||A>z)&&(A=z),l.length>0&&(A<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");x||(x="utf8");let Z=!1;for(;;)switch(x){case"hex":return P(this,l,f,A);case"utf8":case"utf-8":return q(this,l,f,A);case"ascii":case"latin1":case"binary":return H(this,l,f,A);case"base64":return G(this,l,f,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,l,f,A);default:if(Z)throw new TypeError("Unknown encoding: "+x);x=(""+x).toLowerCase(),Z=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ie(S,l,f){return l===0&&f===S.length?e.fromByteArray(S):e.fromByteArray(S.slice(l,f))}function he(S,l,f){f=Math.min(S.length,f);const A=[];let x=l;for(;x<f;){const z=S[x];let Z=null,me=z>239?4:z>223?3:z>191?2:1;if(x+me<=f){let je,Oe,Be,Ee;switch(me){case 1:z<128&&(Z=z);break;case 2:je=S[x+1],(je&192)===128&&(Ee=(z&31)<<6|je&63,Ee>127&&(Z=Ee));break;case 3:je=S[x+1],Oe=S[x+2],(je&192)===128&&(Oe&192)===128&&(Ee=(z&15)<<12|(je&63)<<6|Oe&63,Ee>2047&&(Ee<55296||Ee>57343)&&(Z=Ee));break;case 4:je=S[x+1],Oe=S[x+2],Be=S[x+3],(je&192)===128&&(Oe&192)===128&&(Be&192)===128&&(Ee=(z&15)<<18|(je&63)<<12|(Oe&63)<<6|Be&63,Ee>65535&&Ee<1114112&&(Z=Ee))}}Z===null?(Z=65533,me=1):Z>65535&&(Z-=65536,A.push(Z>>>10&1023|55296),Z=56320|Z&1023),A.push(Z),x+=me}return W(A)}const U=4096;function W(S){const l=S.length;if(l<=U)return String.fromCharCode.apply(String,S);let f="",A=0;for(;A<l;)f+=String.fromCharCode.apply(String,S.slice(A,A+=U));return f}function se(S,l,f){let A="";f=Math.min(S.length,f);for(let x=l;x<f;++x)A+=String.fromCharCode(S[x]&127);return A}function re(S,l,f){let A="";f=Math.min(S.length,f);for(let x=l;x<f;++x)A+=String.fromCharCode(S[x]);return A}function ue(S,l,f){const A=S.length;(!l||l<0)&&(l=0),(!f||f<0||f>A)&&(f=A);let x="";for(let z=l;z<f;++z)x+=gn[S[z]];return x}function K(S,l,f){const A=S.slice(l,f);let x="";for(let z=0;z<A.length-1;z+=2)x+=String.fromCharCode(A[z]+A[z+1]*256);return x}a.prototype.slice=function(l,f){const A=this.length;l=~~l,f=f===void 0?A:~~f,l<0?(l+=A,l<0&&(l=0)):l>A&&(l=A),f<0?(f+=A,f<0&&(f=0)):f>A&&(f=A),f<l&&(f=l);const x=this.subarray(l,f);return Object.setPrototypeOf(x,a.prototype),x};function C(S,l,f){if(S%1!==0||S<0)throw new RangeError("offset is not uint");if(S+l>f)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(l,f,A){l=l>>>0,f=f>>>0,A||C(l,f,this.length);let x=this[l],z=1,Z=0;for(;++Z<f&&(z*=256);)x+=this[l+Z]*z;return x},a.prototype.readUintBE=a.prototype.readUIntBE=function(l,f,A){l=l>>>0,f=f>>>0,A||C(l,f,this.length);let x=this[l+--f],z=1;for(;f>0&&(z*=256);)x+=this[l+--f]*z;return x},a.prototype.readUint8=a.prototype.readUInt8=function(l,f){return l=l>>>0,f||C(l,1,this.length),this[l]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(l,f){return l=l>>>0,f||C(l,2,this.length),this[l]|this[l+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(l,f){return l=l>>>0,f||C(l,2,this.length),this[l]<<8|this[l+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(l,f){return l=l>>>0,f||C(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(l,f){return l=l>>>0,f||C(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},a.prototype.readBigUInt64LE=st(function(l){l=l>>>0,V(l,"offset");const f=this[l],A=this[l+7];(f===void 0||A===void 0)&&J(l,this.length-8);const x=f+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,z=this[++l]+this[++l]*2**8+this[++l]*2**16+A*2**24;return BigInt(x)+(BigInt(z)<<BigInt(32))}),a.prototype.readBigUInt64BE=st(function(l){l=l>>>0,V(l,"offset");const f=this[l],A=this[l+7];(f===void 0||A===void 0)&&J(l,this.length-8);const x=f*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],z=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+A;return(BigInt(x)<<BigInt(32))+BigInt(z)}),a.prototype.readIntLE=function(l,f,A){l=l>>>0,f=f>>>0,A||C(l,f,this.length);let x=this[l],z=1,Z=0;for(;++Z<f&&(z*=256);)x+=this[l+Z]*z;return z*=128,x>=z&&(x-=Math.pow(2,8*f)),x},a.prototype.readIntBE=function(l,f,A){l=l>>>0,f=f>>>0,A||C(l,f,this.length);let x=f,z=1,Z=this[l+--x];for(;x>0&&(z*=256);)Z+=this[l+--x]*z;return z*=128,Z>=z&&(Z-=Math.pow(2,8*f)),Z},a.prototype.readInt8=function(l,f){return l=l>>>0,f||C(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},a.prototype.readInt16LE=function(l,f){l=l>>>0,f||C(l,2,this.length);const A=this[l]|this[l+1]<<8;return A&32768?A|4294901760:A},a.prototype.readInt16BE=function(l,f){l=l>>>0,f||C(l,2,this.length);const A=this[l+1]|this[l]<<8;return A&32768?A|4294901760:A},a.prototype.readInt32LE=function(l,f){return l=l>>>0,f||C(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},a.prototype.readInt32BE=function(l,f){return l=l>>>0,f||C(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},a.prototype.readBigInt64LE=st(function(l){l=l>>>0,V(l,"offset");const f=this[l],A=this[l+7];(f===void 0||A===void 0)&&J(l,this.length-8);const x=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(A<<24);return(BigInt(x)<<BigInt(32))+BigInt(f+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),a.prototype.readBigInt64BE=st(function(l){l=l>>>0,V(l,"offset");const f=this[l],A=this[l+7];(f===void 0||A===void 0)&&J(l,this.length-8);const x=(f<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(x)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+A)}),a.prototype.readFloatLE=function(l,f){return l=l>>>0,f||C(l,4,this.length),n.read(this,l,!0,23,4)},a.prototype.readFloatBE=function(l,f){return l=l>>>0,f||C(l,4,this.length),n.read(this,l,!1,23,4)},a.prototype.readDoubleLE=function(l,f){return l=l>>>0,f||C(l,8,this.length),n.read(this,l,!0,52,8)},a.prototype.readDoubleBE=function(l,f){return l=l>>>0,f||C(l,8,this.length),n.read(this,l,!1,52,8)};function F(S,l,f,A,x,z){if(!a.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>x||l<z)throw new RangeError('"value" argument is out of bounds');if(f+A>S.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(l,f,A,x){if(l=+l,f=f>>>0,A=A>>>0,!x){const me=Math.pow(2,8*A)-1;F(this,l,f,A,me,0)}let z=1,Z=0;for(this[f]=l&255;++Z<A&&(z*=256);)this[f+Z]=l/z&255;return f+A},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(l,f,A,x){if(l=+l,f=f>>>0,A=A>>>0,!x){const me=Math.pow(2,8*A)-1;F(this,l,f,A,me,0)}let z=A-1,Z=1;for(this[f+z]=l&255;--z>=0&&(Z*=256);)this[f+z]=l/Z&255;return f+A},a.prototype.writeUint8=a.prototype.writeUInt8=function(l,f,A){return l=+l,f=f>>>0,A||F(this,l,f,1,255,0),this[f]=l&255,f+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(l,f,A){return l=+l,f=f>>>0,A||F(this,l,f,2,65535,0),this[f]=l&255,this[f+1]=l>>>8,f+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(l,f,A){return l=+l,f=f>>>0,A||F(this,l,f,2,65535,0),this[f]=l>>>8,this[f+1]=l&255,f+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(l,f,A){return l=+l,f=f>>>0,A||F(this,l,f,4,4294967295,0),this[f+3]=l>>>24,this[f+2]=l>>>16,this[f+1]=l>>>8,this[f]=l&255,f+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(l,f,A){return l=+l,f=f>>>0,A||F(this,l,f,4,4294967295,0),this[f]=l>>>24,this[f+1]=l>>>16,this[f+2]=l>>>8,this[f+3]=l&255,f+4};function B(S,l,f,A,x){D(l,A,x,S,f,7);let z=Number(l&BigInt(4294967295));S[f++]=z,z=z>>8,S[f++]=z,z=z>>8,S[f++]=z,z=z>>8,S[f++]=z;let Z=Number(l>>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 $(S,l,f,A,x){D(l,A,x,S,f,7);let z=Number(l&BigInt(4294967295));S[f+7]=z,z=z>>8,S[f+6]=z,z=z>>8,S[f+5]=z,z=z>>8,S[f+4]=z;let Z=Number(l>>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=st(function(l,f=0){return B(this,l,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=st(function(l,f=0){return $(this,l,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(l,f,A,x){if(l=+l,f=f>>>0,!x){const je=Math.pow(2,8*A-1);F(this,l,f,A,je-1,-je)}let z=0,Z=1,me=0;for(this[f]=l&255;++z<A&&(Z*=256);)l<0&&me===0&&this[f+z-1]!==0&&(me=1),this[f+z]=(l/Z>>0)-me&255;return f+A},a.prototype.writeIntBE=function(l,f,A,x){if(l=+l,f=f>>>0,!x){const je=Math.pow(2,8*A-1);F(this,l,f,A,je-1,-je)}let z=A-1,Z=1,me=0;for(this[f+z]=l&255;--z>=0&&(Z*=256);)l<0&&me===0&&this[f+z+1]!==0&&(me=1),this[f+z]=(l/Z>>0)-me&255;return f+A},a.prototype.writeInt8=function(l,f,A){return l=+l,f=f>>>0,A||F(this,l,f,1,127,-128),l<0&&(l=255+l+1),this[f]=l&255,f+1},a.prototype.writeInt16LE=function(l,f,A){return l=+l,f=f>>>0,A||F(this,l,f,2,32767,-32768),this[f]=l&255,this[f+1]=l>>>8,f+2},a.prototype.writeInt16BE=function(l,f,A){return l=+l,f=f>>>0,A||F(this,l,f,2,32767,-32768),this[f]=l>>>8,this[f+1]=l&255,f+2},a.prototype.writeInt32LE=function(l,f,A){return l=+l,f=f>>>0,A||F(this,l,f,4,2147483647,-2147483648),this[f]=l&255,this[f+1]=l>>>8,this[f+2]=l>>>16,this[f+3]=l>>>24,f+4},a.prototype.writeInt32BE=function(l,f,A){return l=+l,f=f>>>0,A||F(this,l,f,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[f]=l>>>24,this[f+1]=l>>>16,this[f+2]=l>>>8,this[f+3]=l&255,f+4},a.prototype.writeBigInt64LE=st(function(l,f=0){return B(this,l,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=st(function(l,f=0){return $(this,l,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function T(S,l,f,A,x,z){if(f+A>S.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function M(S,l,f,A,x){return l=+l,f=f>>>0,x||T(S,l,f,4),n.write(S,l,f,A,23,4),f+4}a.prototype.writeFloatLE=function(l,f,A){return M(this,l,f,!0,A)},a.prototype.writeFloatBE=function(l,f,A){return M(this,l,f,!1,A)};function Q(S,l,f,A,x){return l=+l,f=f>>>0,x||T(S,l,f,8),n.write(S,l,f,A,52,8),f+8}a.prototype.writeDoubleLE=function(l,f,A){return Q(this,l,f,!0,A)},a.prototype.writeDoubleBE=function(l,f,A){return Q(this,l,f,!1,A)},a.prototype.copy=function(l,f,A,x){if(!a.isBuffer(l))throw new TypeError("argument should be a Buffer");if(A||(A=0),!x&&x!==0&&(x=this.length),f>=l.length&&(f=l.length),f||(f=0),x>0&&x<A&&(x=A),x===A||l.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(A<0||A>=this.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("sourceEnd out of bounds");x>this.length&&(x=this.length),l.length-f<x-A&&(x=l.length-f+A);const z=x-A;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,A,x):Uint8Array.prototype.set.call(l,this.subarray(A,x),f),z},a.prototype.fill=function(l,f,A,x){if(typeof l=="string"){if(typeof f=="string"?(x=f,f=0,A=this.length):typeof A=="string"&&(x=A,A=this.length),x!==void 0&&typeof x!="string")throw new TypeError("encoding must be a string");if(typeof x=="string"&&!a.isEncoding(x))throw new TypeError("Unknown encoding: "+x);if(l.length===1){const Z=l.charCodeAt(0);(x==="utf8"&&Z<128||x==="latin1")&&(l=Z)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(f<0||this.length<f||this.length<A)throw new RangeError("Out of range index");if(A<=f)return this;f=f>>>0,A=A===void 0?this.length:A>>>0,l||(l=0);let z;if(typeof l=="number")for(z=f;z<A;++z)this[z]=l;else{const Z=a.isBuffer(l)?l:a.from(l,x),me=Z.length;if(me===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(z=0;z<A-f;++z)this[z+f]=Z[z%me]}return this};const X={};function pe(S,l,f){X[S]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${S}]`,this.stack,delete this.name}get code(){return S}set code(x){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:x,writable:!0})}toString(){return`${this.name} [${S}]: ${this.message}`}}}pe("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),pe("ERR_INVALID_ARG_TYPE",function(S,l){return`The "${S}" argument must be of type number. Received type ${typeof l}`},TypeError),pe("ERR_OUT_OF_RANGE",function(S,l,f){let A=`The value of "${S}" is out of range.`,x=f;return Number.isInteger(f)&&Math.abs(f)>2**32?x=oe(String(f)):typeof f=="bigint"&&(x=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(x=oe(x)),x+="n"),A+=` It must be ${l}. Received ${x}`,A},RangeError);function oe(S){let l="",f=S.length;const A=S[0]==="-"?1:0;for(;f>=A+4;f-=3)l=`_${S.slice(f-3,f)}${l}`;return`${S.slice(0,f)}${l}`}function j(S,l,f){V(l,"offset"),(S[l]===void 0||S[l+f]===void 0)&&J(l,S.length-(f+1))}function D(S,l,f,A,x,z){if(S>f||S<l){const Z=typeof l=="bigint"?"n":"";let me;throw l===0||l===BigInt(0)?me=`>= 0${Z} and < 2${Z} ** ${(z+1)*8}${Z}`:me=`>= -(2${Z} ** ${(z+1)*8-1}${Z}) and < 2 ** ${(z+1)*8-1}${Z}`,new X.ERR_OUT_OF_RANGE("value",me,S)}j(A,x,z)}function V(S,l){if(typeof S!="number")throw new X.ERR_INVALID_ARG_TYPE(l,"number",S)}function J(S,l,f){throw Math.floor(S)!==S?(V(S,f),new X.ERR_OUT_OF_RANGE("offset","an integer",S)):l<0?new X.ERR_BUFFER_OUT_OF_BOUNDS:new X.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,S)}const ne=/[^+/0-9A-Za-z-_]/g;function le(S){if(S=S.split("=")[0],S=S.trim().replace(ne,""),S.length<2)return"";for(;S.length%4!==0;)S=S+"=";return S}function $e(S,l){l=l||1/0;let f;const A=S.length;let x=null;const z=[];for(let Z=0;Z<A;++Z){if(f=S.charCodeAt(Z),f>55295&&f<57344){if(!x){if(f>56319){(l-=3)>-1&&z.push(239,191,189);continue}else if(Z+1===A){(l-=3)>-1&&z.push(239,191,189);continue}x=f;continue}if(f<56320){(l-=3)>-1&&z.push(239,191,189),x=f;continue}f=(x-55296<<10|f-56320)+65536}else x&&(l-=3)>-1&&z.push(239,191,189);if(x=null,f<128){if((l-=1)<0)break;z.push(f)}else if(f<2048){if((l-=2)<0)break;z.push(f>>6|192,f&63|128)}else if(f<65536){if((l-=3)<0)break;z.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((l-=4)<0)break;z.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return z}function Ue(S){const l=[];for(let f=0;f<S.length;++f)l.push(S.charCodeAt(f)&255);return l}function Ke(S,l){let f,A,x;const z=[];for(let Z=0;Z<S.length&&!((l-=2)<0);++Z)f=S.charCodeAt(Z),A=f>>8,x=f%256,z.push(x),z.push(A);return z}function Le(S){return e.toByteArray(le(S))}function xe(S,l,f,A){let x;for(x=0;x<A&&!(x+f>=l.length||x>=S.length);++x)l[x+f]=S[x];return x}function qe(S,l){return S instanceof l||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===l.name}function Je(S){return S!==S}const gn=(function(){const S="0123456789abcdef",l=new Array(256);for(let f=0;f<16;++f){const A=f*16;for(let x=0;x<16;++x)l[A+x]=S[f]+S[x]}return l})();function st(S){return typeof BigInt>"u"?Ct:S}function Ct(){throw new Error("BigInt not supported")}})(Ns)),Ns}var bn=qy();function Kt(t){const e=new ArrayBuffer(4);return new DataView(e).setInt32(0,t,!0),new Uint8Array(e)}class Vy extends Oi{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(bn.Buffer.from(e.id)),o.push(Kt(n.definitionHash)),i?.inputHashNonce&&o.push(Kt(i.inputHashNonce)),e.args&&o.push(My(e.args)),s?o.push(Kt(s)):Si(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)),u=new Set;for(const[h,m]of c){if(Object.keys(m).length===0)continue;a.push(bn.Buffer.from(h));const b=m.map(w=>w.input.instanceId).sort();for(const w of b){const g=this.outputs.get(w);if(!g){this.logger.warn({instanceId:w,dependentInstanceId:e.id},"missing dependency when calculating input hash, this may lead to incorrect input hash");continue}a.push(Kt(g.inputHash)),a.push(Kt(g.outputHash)),u.add(w)}}const d=[],p=Array.from(u).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(Kt(m.outputHash))}return{selfHash:Ts(bn.Buffer.concat(o)),inputHash:Ts(bn.Buffer.concat(a)),dependencyOutputHash:Ts(bn.Buffer.concat(d)),outputHash:i?.outputHash??0}}}var tr={exports:{}},Ps={},wt={},xt={},Cs={},xs={},js={},ko;function es(){return ko||(ko=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((_,I)=>`${_}${I}`,"")}get names(){var y;return(y=this._names)!==null&&y!==void 0?y:this._names=this._items.reduce((_,I)=>(I instanceof n&&(_[I.str]=(_[I.str]||0)+1),_),{})}}t._Code=r,t.nil=new r("");function s(k,...y){const _=[k[0]];let I=0;for(;I<y.length;)a(_,y[I]),_.push(k[++I]);return new r(_)}t._=s;const i=new r("+");function o(k,...y){const _=[m(k[0])];let I=0;for(;I<y.length;)_.push(i),a(_,y[I]),_.push(i,m(k[++I]));return c(_),new r(_)}t.str=o;function a(k,y){y instanceof r?k.push(...y._items):y instanceof n?k.push(y):k.push(p(y))}t.addCodeArg=a;function c(k){let y=1;for(;y<k.length-1;){if(k[y]===i){const _=u(k[y-1],k[y+1]);if(_!==void 0){k.splice(y-1,3,_);continue}k[y++]="+"}y++}}function u(k,y){if(y==='""')return k;if(k==='""')return y;if(typeof k=="string")return y instanceof n||k[k.length-1]!=='"'?void 0:typeof y!="string"?`${k.slice(0,-1)}${y}"`:y[0]==='"'?k.slice(0,-1)+y.slice(1):void 0;if(typeof y=="string"&&y[0]==='"'&&!(k instanceof n))return`"${k}${y.slice(1)}`}function d(k,y){return y.emptyStr()?k:k.emptyStr()?y:o`${k}${y}`}t.strConcat=d;function p(k){return typeof k=="number"||typeof k=="boolean"||k===null?k:m(Array.isArray(k)?k.join(","):k)}function h(k){return new r(m(k))}t.stringify=h;function m(k){return JSON.stringify(k).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=m;function b(k){return typeof k=="string"&&t.IDENTIFIER.test(k)?new r(`.${k}`):s`[${k}]`}t.getProperty=b;function w(k){if(typeof k=="string"&&t.IDENTIFIER.test(k))return new r(`${k}`);throw new Error(`CodeGen: invalid export name: ${k}, use explicit $id name mapping`)}t.getEsmExportName=w;function g(k){return new r(k.toString())}t.regexpCode=g})(js)),js}var Bs={},So;function $o(){return So||(So=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=es();class n extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.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:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof e.Name?u:this.name(u)}name(u){return new e.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,p;if(!((p=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||p===void 0)&&p.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}t.Scope=s;class i extends e.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:p}){this.value=u,this.scopePath=(0,e._)`.${new e.Name(d)}[${p}]`}}t.ValueScopeName=i;const o=(0,e._)`\n`;class a extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?o:e.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,d){var p;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(u),{prefix:m}=h,b=(p=d.key)!==null&&p!==void 0?p:d.ref;let w=this._values[m];if(w){const y=w.get(b);if(y)return y}else w=this._values[m]=new Map;w.set(b,h);const g=this._scope[m]||(this._scope[m]=[]),k=g.length;return g[k]=d.ref,h.setValue(d,{property:m,itemIndex:k}),h}getValue(u,d){const p=this._values[u];if(p)return p.get(d)}scopeRefs(u,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._)`${u}${p.scopePath}`})}scopeCode(u=this._values,d,p){return this._reduceValues(u,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},d,p)}_reduceValues(u,d,p={},h){let m=e.nil;for(const b in u){const w=u[b];if(!w)continue;const g=p[b]=p[b]||new Map;w.forEach(k=>{if(g.has(k))return;g.set(k,r.Started);let y=d(k);if(y){const _=this.opts.es5?t.varKinds.var:t.varKinds.const;m=(0,e._)`${m}${_} ${k} = ${y};${this.opts._n}`}else if(y=h?.(k))m=(0,e._)`${m}${y}${this.opts._n}`;else throw new n(k);g.set(k,r.Completed)})}return m}}t.ValueScope=a})(Bs)),Bs}var Eo;function ge(){return Eo||(Eo=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=es(),n=$o();var r=es();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=$o();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($,T){return this}}class o extends i{constructor($,T,M){super(),this.varKind=$,this.name=T,this.rhs=M}render({es5:$,_n:T}){const M=$?n.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return`${M} ${this.name}${Q};`+T}optimizeNames($,T){if($[this.name.str])return this.rhs&&(this.rhs=he(this.rhs,$,T)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends i{constructor($,T,M){super(),this.lhs=$,this.rhs=T,this.sideEffects=M}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,T){if(!(this.lhs instanceof e.Name&&!$[this.lhs.str]&&!this.sideEffects))return this.rhs=he(this.rhs,$,T),this}get names(){const $=this.lhs instanceof e.Name?{}:{...this.lhs.names};return ie($,this.rhs)}}class c extends a{constructor($,T,M,Q){super($,M,Q),this.op=T}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class u extends i{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class d extends i{constructor($){super(),this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class p extends i{constructor($){super(),this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class h extends i{constructor($){super(),this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,T){return this.code=he(this.code,$,T),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class m extends i{constructor($=[]){super(),this.nodes=$}render($){return this.nodes.reduce((T,M)=>T+M.render($),"")}optimizeNodes(){const{nodes:$}=this;let T=$.length;for(;T--;){const M=$[T].optimizeNodes();Array.isArray(M)?$.splice(T,1,...M):M?$[T]=M:$.splice(T,1)}return $.length>0?this:void 0}optimizeNames($,T){const{nodes:M}=this;let Q=M.length;for(;Q--;){const X=M[Q];X.optimizeNames($,T)||(U($,X.names),M.splice(Q,1))}return M.length>0?this:void 0}get names(){return this.nodes.reduce(($,T)=>Y($,T.names),{})}}class b extends m{render($){return"{"+$._n+super.render($)+"}"+$._n}}class w extends m{}class g extends b{}g.kind="else";class k extends b{constructor($,T){super(T),this.condition=$}render($){let T=`if(${this.condition})`+super.render($);return this.else&&(T+="else "+this.else.render($)),T}optimizeNodes(){super.optimizeNodes();const $=this.condition;if($===!0)return this.nodes;let T=this.else;if(T){const M=T.optimizeNodes();T=this.else=Array.isArray(M)?new g(M):M}if(T)return $===!1?T instanceof k?T:T.nodes:this.nodes.length?this:new k(W($),T instanceof k?[T]:T.nodes);if(!($===!1||!this.nodes.length))return this}optimizeNames($,T){var M;if(this.else=(M=this.else)===null||M===void 0?void 0:M.optimizeNames($,T),!!(super.optimizeNames($,T)||this.else))return this.condition=he(this.condition,$,T),this}get names(){const $=super.names;return ie($,this.condition),this.else&&Y($,this.else.names),$}}k.kind="if";class y extends b{}y.kind="for";class _ extends y{constructor($){super(),this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,T){if(super.optimizeNames($,T))return this.iteration=he(this.iteration,$,T),this}get names(){return Y(super.names,this.iteration.names)}}class I extends y{constructor($,T,M,Q){super(),this.varKind=$,this.name=T,this.from=M,this.to=Q}render($){const T=$.es5?n.varKinds.var:this.varKind,{name:M,from:Q,to:X}=this;return`for(${T} ${M}=${Q}; ${M}<${X}; ${M}++)`+super.render($)}get names(){const $=ie(super.names,this.from);return ie($,this.to)}}class v extends y{constructor($,T,M,Q){super(),this.loop=$,this.varKind=T,this.name=M,this.iterable=Q}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,T){if(super.optimizeNames($,T))return this.iterable=he(this.iterable,$,T),this}get names(){return Y(super.names,this.iterable.names)}}class E extends b{constructor($,T,M){super(),this.name=$,this.args=T,this.async=M}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}E.kind="func";class O extends m{render($){return"return "+super.render($)}}O.kind="return";class P extends b{render($){let T="try"+super.render($);return this.catch&&(T+=this.catch.render($)),this.finally&&(T+=this.finally.render($)),T}optimizeNodes(){var $,T;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(T=this.finally)===null||T===void 0||T.optimizeNodes(),this}optimizeNames($,T){var M,Q;return super.optimizeNames($,T),(M=this.catch)===null||M===void 0||M.optimizeNames($,T),(Q=this.finally)===null||Q===void 0||Q.optimizeNames($,T),this}get names(){const $=super.names;return this.catch&&Y($,this.catch.names),this.finally&&Y($,this.finally.names),$}}class q extends b{constructor($){super(),this.error=$}render($){return`catch(${this.error})`+super.render($)}}q.kind="catch";class H extends b{render($){return"finally"+super.render($)}}H.kind="finally";class G{constructor($,T={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...T,_n:T.lines?`
|
|
170
|
+
`:""},this._extScope=$,this._scope=new n.Scope({parent:$}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,T){const M=this._extScope.value($,T);return(this._values[M.prefix]||(this._values[M.prefix]=new Set)).add(M),M}getScopeValue($,T){return this._extScope.getValue($,T)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,T,M,Q){const X=this._scope.toName(T);return M!==void 0&&Q&&(this._constants[X.str]=M),this._leafNode(new o($,X,M)),X}const($,T,M){return this._def(n.varKinds.const,$,T,M)}let($,T,M){return this._def(n.varKinds.let,$,T,M)}var($,T,M){return this._def(n.varKinds.var,$,T,M)}assign($,T,M){return this._leafNode(new a($,T,M))}add($,T){return this._leafNode(new c($,t.operators.ADD,T))}code($){return typeof $=="function"?$():$!==e.nil&&this._leafNode(new h($)),this}object(...$){const T=["{"];for(const[M,Q]of $)T.length>1&&T.push(","),T.push(M),(M!==Q||this.opts.es5)&&(T.push(":"),(0,e.addCodeArg)(T,Q));return T.push("}"),new e._Code(T)}if($,T,M){if(this._blockNode(new k($)),T&&M)this.code(T).else().code(M).endIf();else if(T)this.code(T).endIf();else if(M)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new k($))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(k,g)}_for($,T){return this._blockNode($),T&&this.code(T).endFor(),this}for($,T){return this._for(new _($),T)}forRange($,T,M,Q,X=this.opts.es5?n.varKinds.var:n.varKinds.let){const pe=this._scope.toName($);return this._for(new I(X,pe,T,M),()=>Q(pe))}forOf($,T,M,Q=n.varKinds.const){const X=this._scope.toName($);if(this.opts.es5){const pe=T instanceof e.Name?T:this.var("_arr",T);return this.forRange("_i",0,(0,e._)`${pe}.length`,oe=>{this.var(X,(0,e._)`${pe}[${oe}]`),M(X)})}return this._for(new v("of",Q,X,T),()=>M(X))}forIn($,T,M,Q=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf($,(0,e._)`Object.keys(${T})`,M);const X=this._scope.toName($);return this._for(new v("in",Q,X,T),()=>M(X))}endFor(){return this._endBlockNode(y)}label($){return this._leafNode(new u($))}break($){return this._leafNode(new d($))}return($){const T=new O;if(this._blockNode(T),this.code($),T.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try($,T,M){if(!T&&!M)throw new Error('CodeGen: "try" without "catch" and "finally"');const Q=new P;if(this._blockNode(Q),this.code($),T){const X=this.name("e");this._currNode=Q.catch=new q(X),T(X)}return M&&(this._currNode=Q.finally=new H,this.code(M)),this._endBlockNode(q,H)}throw($){return this._leafNode(new p($))}block($,T){return this._blockStarts.push(this._nodes.length),$&&this.code($).endBlock(T),this}endBlock($){const T=this._blockStarts.pop();if(T===void 0)throw new Error("CodeGen: not in self-balancing block");const M=this._nodes.length-T;if(M<0||$!==void 0&&M!==$)throw new Error(`CodeGen: wrong number of nodes: ${M} vs ${$} expected`);return this._nodes.length=T,this}func($,T=e.nil,M,Q){return this._blockNode(new E($,T,M)),Q&&this.code(Q).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize($=1){for(;$-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,T){const M=this._currNode;if(M instanceof $||T&&M instanceof T)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${T?`${$.kind}/${T.kind}`:$.kind}"`)}_elseNode($){const T=this._currNode;if(!(T instanceof k))throw new Error('CodeGen: "else" without "if"');return this._currNode=T.else=$,this}get _root(){return this._nodes[0]}get _currNode(){const $=this._nodes;return $[$.length-1]}set _currNode($){const T=this._nodes;T[T.length-1]=$}}t.CodeGen=G;function Y(B,$){for(const T in $)B[T]=(B[T]||0)+($[T]||0);return B}function ie(B,$){return $ instanceof e._CodeOrName?Y(B,$.names):B}function he(B,$,T){if(B instanceof e.Name)return M(B);if(!Q(B))return B;return new e._Code(B._items.reduce((X,pe)=>(pe instanceof e.Name&&(pe=M(pe)),pe instanceof e._Code?X.push(...pe._items):X.push(pe),X),[]));function M(X){const pe=T[X.str];return pe===void 0||$[X.str]!==1?X:(delete $[X.str],pe)}function Q(X){return X instanceof e._Code&&X._items.some(pe=>pe instanceof e.Name&&$[pe.str]===1&&T[pe.str]!==void 0)}}function U(B,$){for(const T in $)B[T]=(B[T]||0)-($[T]||0)}function W(B){return typeof B=="boolean"||typeof B=="number"||B===null?!B:(0,e._)`!${F(B)}`}t.not=W;const se=C(t.operators.AND);function re(...B){return B.reduce(se)}t.and=re;const ue=C(t.operators.OR);function K(...B){return B.reduce(ue)}t.or=K;function C(B){return($,T)=>$===e.nil?T:T===e.nil?$:(0,e._)`${F($)} ${B} ${F(T)}`}function F(B){return B instanceof e.Name?B:(0,e._)`(${B})`}})(xs)),xs}var de={},Io;function be(){if(Io)return de;Io=1,Object.defineProperty(de,"__esModule",{value:!0}),de.checkStrictMode=de.getErrorPath=de.Type=de.useFunc=de.setEvaluated=de.evaluatedPropsToName=de.mergeEvaluated=de.eachItem=de.unescapeJsonPointer=de.escapeJsonPointer=de.escapeFragment=de.unescapeFragment=de.schemaRefOrVal=de.schemaHasRulesButRef=de.schemaHasRules=de.checkUnknownRules=de.alwaysValidSchema=de.toHash=void 0;const t=ge(),e=es();function n(v){const E={};for(const O of v)E[O]=!0;return E}de.toHash=n;function r(v,E){return typeof E=="boolean"?E:Object.keys(E).length===0?!0:(s(v,E),!i(E,v.self.RULES.all))}de.alwaysValidSchema=r;function s(v,E=v.schema){const{opts:O,self:P}=v;if(!O.strictSchema||typeof E=="boolean")return;const q=P.RULES.keywords;for(const H in E)q[H]||I(v,`unknown keyword: "${H}"`)}de.checkUnknownRules=s;function i(v,E){if(typeof v=="boolean")return!v;for(const O in v)if(E[O])return!0;return!1}de.schemaHasRules=i;function o(v,E){if(typeof v=="boolean")return!v;for(const O in v)if(O!=="$ref"&&E.all[O])return!0;return!1}de.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:E},O,P,q){if(!q){if(typeof O=="number"||typeof O=="boolean")return O;if(typeof O=="string")return(0,t._)`${O}`}return(0,t._)`${v}${E}${(0,t.getProperty)(P)}`}de.schemaRefOrVal=a;function c(v){return p(decodeURIComponent(v))}de.unescapeFragment=c;function u(v){return encodeURIComponent(d(v))}de.escapeFragment=u;function d(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}de.escapeJsonPointer=d;function p(v){return v.replace(/~1/g,"/").replace(/~0/g,"~")}de.unescapeJsonPointer=p;function h(v,E){if(Array.isArray(v))for(const O of v)E(O);else E(v)}de.eachItem=h;function m({mergeNames:v,mergeToName:E,mergeValues:O,resultToName:P}){return(q,H,G,Y)=>{const ie=G===void 0?H:G instanceof t.Name?(H instanceof t.Name?v(q,H,G):E(q,H,G),G):H instanceof t.Name?(E(q,G,H),H):O(H,G);return Y===t.Name&&!(ie instanceof t.Name)?P(q,ie):ie}}de.mergeEvaluated={props:m({mergeNames:(v,E,O)=>v.if((0,t._)`${O} !== true && ${E} !== undefined`,()=>{v.if((0,t._)`${E} === true`,()=>v.assign(O,!0),()=>v.assign(O,(0,t._)`${O} || {}`).code((0,t._)`Object.assign(${O}, ${E})`))}),mergeToName:(v,E,O)=>v.if((0,t._)`${O} !== true`,()=>{E===!0?v.assign(O,!0):(v.assign(O,(0,t._)`${O} || {}`),w(v,O,E))}),mergeValues:(v,E)=>v===!0?!0:{...v,...E},resultToName:b}),items:m({mergeNames:(v,E,O)=>v.if((0,t._)`${O} !== true && ${E} !== undefined`,()=>v.assign(O,(0,t._)`${E} === true ? true : ${O} > ${E} ? ${O} : ${E}`)),mergeToName:(v,E,O)=>v.if((0,t._)`${O} !== true`,()=>v.assign(O,E===!0?!0:(0,t._)`${O} > ${E} ? ${O} : ${E}`)),mergeValues:(v,E)=>v===!0?!0:Math.max(v,E),resultToName:(v,E)=>v.var("items",E)})};function b(v,E){if(E===!0)return v.var("props",!0);const O=v.var("props",(0,t._)`{}`);return E!==void 0&&w(v,O,E),O}de.evaluatedPropsToName=b;function w(v,E,O){Object.keys(O).forEach(P=>v.assign((0,t._)`${E}${(0,t.getProperty)(P)}`,!0))}de.setEvaluated=w;const g={};function k(v,E){return v.scopeValue("func",{ref:E,code:g[E.code]||(g[E.code]=new e._Code(E.code))})}de.useFunc=k;var y;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(y||(de.Type=y={}));function _(v,E,O){if(v instanceof t.Name){const P=E===y.Num;return O?P?(0,t._)`"[" + ${v} + "]"`:(0,t._)`"['" + ${v} + "']"`:P?(0,t._)`"/" + ${v}`:(0,t._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return O?(0,t.getProperty)(v).toString():"/"+d(v)}de.getErrorPath=_;function I(v,E,O=v.opts.strictSchema){if(O){if(E=`strict mode: ${E}`,O===!0)throw new Error(E);v.self.logger.warn(E)}}return de.checkStrictMode=I,de}var nr={},Ao;function Pt(){if(Ao)return nr;Ao=1,Object.defineProperty(nr,"__esModule",{value:!0});const t=ge(),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 nr.default=e,nr}var Oo;function ys(){return Oo||(Oo=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=ge(),n=be(),r=Pt();t.keywordError={message:({keyword:g})=>(0,e.str)`must pass "${g}" keyword validation`},t.keyword$DataError={message:({keyword:g,schemaType:k})=>k?(0,e.str)`"${g}" keyword must be ${k} ($data)`:(0,e.str)`"${g}" keyword is invalid ($data)`};function s(g,k=t.keywordError,y,_){const{it:I}=g,{gen:v,compositeRule:E,allErrors:O}=I,P=p(g,k,y);_??(E||O)?c(v,P):u(I,(0,e._)`[${P}]`)}t.reportError=s;function i(g,k=t.keywordError,y){const{it:_}=g,{gen:I,compositeRule:v,allErrors:E}=_,O=p(g,k,y);c(I,O),v||E||u(_,r.default.vErrors)}t.reportExtraError=i;function o(g,k){g.assign(r.default.errors,k),g.if((0,e._)`${r.default.vErrors} !== null`,()=>g.if(k,()=>g.assign((0,e._)`${r.default.vErrors}.length`,k),()=>g.assign(r.default.vErrors,null)))}t.resetErrorsCount=o;function a({gen:g,keyword:k,schemaValue:y,data:_,errsCount:I,it:v}){if(I===void 0)throw new Error("ajv implementation error");const E=g.name("err");g.forRange("i",I,r.default.errors,O=>{g.const(E,(0,e._)`${r.default.vErrors}[${O}]`),g.if((0,e._)`${E}.instancePath === undefined`,()=>g.assign((0,e._)`${E}.instancePath`,(0,e.strConcat)(r.default.instancePath,v.errorPath))),g.assign((0,e._)`${E}.schemaPath`,(0,e.str)`${v.errSchemaPath}/${k}`),v.opts.verbose&&(g.assign((0,e._)`${E}.schema`,y),g.assign((0,e._)`${E}.data`,_))})}t.extendErrors=a;function c(g,k){const y=g.const("err",k);g.if((0,e._)`${r.default.vErrors} === null`,()=>g.assign(r.default.vErrors,(0,e._)`[${y}]`),(0,e._)`${r.default.vErrors}.push(${y})`),g.code((0,e._)`${r.default.errors}++`)}function u(g,k){const{gen:y,validateName:_,schemaEnv:I}=g;I.$async?y.throw((0,e._)`new ${g.ValidationError}(${k})`):(y.assign((0,e._)`${_}.errors`,k),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(g,k,y){const{createErrors:_}=g.it;return _===!1?(0,e._)`{}`:h(g,k,y)}function h(g,k,y={}){const{gen:_,it:I}=g,v=[m(I,y),b(g,y)];return w(g,k,v),_.object(...v)}function m({errorPath:g},{instancePath:k}){const y=k?(0,e.str)`${g}${(0,n.getErrorPath)(k,n.Type.Str)}`:g;return[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,y)]}function b({keyword:g,it:{errSchemaPath:k}},{schemaPath:y,parentSchema:_}){let I=_?k:(0,e.str)`${k}/${g}`;return y&&(I=(0,e.str)`${I}${(0,n.getErrorPath)(y,n.Type.Str)}`),[d.schemaPath,I]}function w(g,{params:k,message:y},_){const{keyword:I,data:v,schemaValue:E,it:O}=g,{opts:P,propertyName:q,topSchemaRef:H,schemaPath:G}=O;_.push([d.keyword,I],[d.params,typeof k=="function"?k(g):k||(0,e._)`{}`]),P.messages&&_.push([d.message,typeof y=="function"?y(g):y]),P.verbose&&_.push([d.schema,E],[d.parentSchema,(0,e._)`${H}${G}`],[r.default.data,v]),q&&_.push([d.propertyName,q])}})(Cs)),Cs}var To;function Zy(){if(To)return xt;To=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.boolOrEmptySchema=xt.topBoolOrEmptySchema=void 0;const t=ys(),e=ge(),n=Pt(),r={message:"boolean schema is false"};function s(a){const{gen:c,schema:u,validateName:d}=a;u===!1?o(a,!1):typeof u=="object"&&u.$async===!0?c.return(n.default.data):(c.assign((0,e._)`${d}.errors`,null),c.return(!0))}xt.topBoolOrEmptySchema=s;function i(a,c){const{gen:u,schema:d}=a;d===!1?(u.var(c,!1),o(a)):u.var(c,!0)}xt.boolOrEmptySchema=i;function o(a,c){const{gen:u,data:d}=a,p={gen:u,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(p,r,void 0,c)}return xt}var Ve={},jt={},No;function Nu(){if(No)return jt;No=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.getRules=jt.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)}jt.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 jt.getRules=r,jt}var vt={},Po;function Pu(){if(Po)return vt;Po=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.shouldUseRule=vt.shouldUseGroup=vt.schemaHasRulesForType=void 0;function t({schema:r,self:s},i){const o=s.RULES.types[i];return o&&o!==!0&&e(r,o)}vt.schemaHasRulesForType=t;function e(r,s){return s.rules.some(i=>n(r,i))}vt.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 vt.shouldUseRule=n,vt}var Co;function ts(){if(Co)return Ve;Co=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.reportTypeError=Ve.checkDataTypes=Ve.checkDataType=Ve.coerceAndCheckDataType=Ve.getJSONTypes=Ve.getSchemaTypes=Ve.DataType=void 0;const t=Nu(),e=Pu(),n=ys(),r=ge(),s=be();var i;(function(y){y[y.Correct=0]="Correct",y[y.Wrong=1]="Wrong"})(i||(Ve.DataType=i={}));function o(y){const _=a(y.type);if(_.includes("null")){if(y.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!_.length&&y.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');y.nullable===!0&&_.push("null")}return _}Ve.getSchemaTypes=o;function a(y){const _=Array.isArray(y)?y:y?[y]:[];if(_.every(t.isJSONType))return _;throw new Error("type must be JSONType or JSONType[]: "+_.join(","))}Ve.getJSONTypes=a;function c(y,_){const{gen:I,data:v,opts:E}=y,O=d(_,E.coerceTypes),P=_.length>0&&!(O.length===0&&_.length===1&&(0,e.schemaHasRulesForType)(y,_[0]));if(P){const q=b(_,v,E.strictNumbers,i.Wrong);I.if(q,()=>{O.length?p(y,_,O):g(y)})}return P}Ve.coerceAndCheckDataType=c;const u=new Set(["string","number","integer","boolean","null"]);function d(y,_){return _?y.filter(I=>u.has(I)||_==="array"&&I==="array"):[]}function p(y,_,I){const{gen:v,data:E,opts:O}=y,P=v.let("dataType",(0,r._)`typeof ${E}`),q=v.let("coerced",(0,r._)`undefined`);O.coerceTypes==="array"&&v.if((0,r._)`${P} == 'object' && Array.isArray(${E}) && ${E}.length == 1`,()=>v.assign(E,(0,r._)`${E}[0]`).assign(P,(0,r._)`typeof ${E}`).if(b(_,E,O.strictNumbers),()=>v.assign(q,E))),v.if((0,r._)`${q} !== undefined`);for(const G of I)(u.has(G)||G==="array"&&O.coerceTypes==="array")&&H(G);v.else(),g(y),v.endIf(),v.if((0,r._)`${q} !== undefined`,()=>{v.assign(E,q),h(y,q)});function H(G){switch(G){case"string":v.elseIf((0,r._)`${P} == "number" || ${P} == "boolean"`).assign(q,(0,r._)`"" + ${E}`).elseIf((0,r._)`${E} === null`).assign(q,(0,r._)`""`);return;case"number":v.elseIf((0,r._)`${P} == "boolean" || ${E} === null
|
|
171
|
+
|| (${P} == "string" && ${E} && ${E} == +${E})`).assign(q,(0,r._)`+${E}`);return;case"integer":v.elseIf((0,r._)`${P} === "boolean" || ${E} === null
|
|
172
|
+
|| (${P} === "string" && ${E} && ${E} == +${E} && !(${E} % 1))`).assign(q,(0,r._)`+${E}`);return;case"boolean":v.elseIf((0,r._)`${E} === "false" || ${E} === 0 || ${E} === null`).assign(q,!1).elseIf((0,r._)`${E} === "true" || ${E} === 1`).assign(q,!0);return;case"null":v.elseIf((0,r._)`${E} === "" || ${E} === 0 || ${E} === false`),v.assign(q,null);return;case"array":v.elseIf((0,r._)`${P} === "string" || ${P} === "number"
|
|
173
|
+
|| ${P} === "boolean" || ${E} === null`).assign(q,(0,r._)`[${E}]`)}}}function h({gen:y,parentData:_,parentDataProperty:I},v){y.if((0,r._)`${_} !== undefined`,()=>y.assign((0,r._)`${_}[${I}]`,v))}function m(y,_,I,v=i.Correct){const E=v===i.Correct?r.operators.EQ:r.operators.NEQ;let O;switch(y){case"null":return(0,r._)`${_} ${E} null`;case"array":O=(0,r._)`Array.isArray(${_})`;break;case"object":O=(0,r._)`${_} && typeof ${_} == "object" && !Array.isArray(${_})`;break;case"integer":O=P((0,r._)`!(${_} % 1) && !isNaN(${_})`);break;case"number":O=P();break;default:return(0,r._)`typeof ${_} ${E} ${y}`}return v===i.Correct?O:(0,r.not)(O);function P(q=r.nil){return(0,r.and)((0,r._)`typeof ${_} == "number"`,q,I?(0,r._)`isFinite(${_})`:r.nil)}}Ve.checkDataType=m;function b(y,_,I,v){if(y.length===1)return m(y[0],_,I,v);let E;const O=(0,s.toHash)(y);if(O.array&&O.object){const P=(0,r._)`typeof ${_} != "object"`;E=O.null?P:(0,r._)`!${_} || ${P}`,delete O.null,delete O.array,delete O.object}else E=r.nil;O.number&&delete O.integer;for(const P in O)E=(0,r.and)(E,m(P,_,I,v));return E}Ve.checkDataTypes=b;const w={message:({schema:y})=>`must be ${y}`,params:({schema:y,schemaValue:_})=>typeof y=="string"?(0,r._)`{type: ${y}}`:(0,r._)`{type: ${_}}`};function g(y){const _=k(y);(0,n.reportError)(_,w)}Ve.reportTypeError=g;function k(y){const{gen:_,data:I,schema:v}=y,E=(0,s.schemaRefOrVal)(y,v,"type");return{gen:_,keyword:"type",data:I,schema:v.type,schemaCode:E,schemaValue:E,parentSchema:v,params:{},it:y}}return Ve}var _n={},xo;function Ky(){if(xo)return _n;xo=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.assignDefaults=void 0;const t=ge(),e=be();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,u)=>r(s,u,c.default))}_n.assignDefaults=n;function r(s,i,o){const{gen:a,compositeRule:c,data:u,opts:d}=s;if(o===void 0)return;const p=(0,t._)`${u}${(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 lt={},_e={},jo;function ht(){if(jo)return _e;jo=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.validateUnion=_e.validateArray=_e.usePattern=_e.callValidateCode=_e.schemaProperties=_e.allSchemaProperties=_e.noPropertyInData=_e.propertyInData=_e.isOwnProperty=_e.hasPropFunc=_e.reportMissingProp=_e.checkMissingProp=_e.checkReportMissingProp=void 0;const t=ge(),e=be(),n=Pt(),r=be();function s(y,_){const{gen:I,data:v,it:E}=y;I.if(d(I,v,_,E.opts.ownProperties),()=>{y.setParams({missingProperty:(0,t._)`${_}`},!0),y.error()})}_e.checkReportMissingProp=s;function i({gen:y,data:_,it:{opts:I}},v,E){return(0,t.or)(...v.map(O=>(0,t.and)(d(y,_,O,I.ownProperties),(0,t._)`${E} = ${O}`)))}_e.checkMissingProp=i;function o(y,_){y.setParams({missingProperty:_},!0),y.error()}_e.reportMissingProp=o;function a(y){return y.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}_e.hasPropFunc=a;function c(y,_,I){return(0,t._)`${a(y)}.call(${_}, ${I})`}_e.isOwnProperty=c;function u(y,_,I,v){const E=(0,t._)`${_}${(0,t.getProperty)(I)} !== undefined`;return v?(0,t._)`${E} && ${c(y,_,I)}`:E}_e.propertyInData=u;function d(y,_,I,v){const E=(0,t._)`${_}${(0,t.getProperty)(I)} === undefined`;return v?(0,t.or)(E,(0,t.not)(c(y,_,I))):E}_e.noPropertyInData=d;function p(y){return y?Object.keys(y).filter(_=>_!=="__proto__"):[]}_e.allSchemaProperties=p;function h(y,_){return p(_).filter(I=>!(0,e.alwaysValidSchema)(y,_[I]))}_e.schemaProperties=h;function m({schemaCode:y,data:_,it:{gen:I,topSchemaRef:v,schemaPath:E,errorPath:O},it:P},q,H,G){const Y=G?(0,t._)`${y}, ${_}, ${v}${E}`:_,ie=[[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,O)],[n.default.parentData,P.parentData],[n.default.parentDataProperty,P.parentDataProperty],[n.default.rootData,n.default.rootData]];P.opts.dynamicRef&&ie.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const he=(0,t._)`${Y}, ${I.object(...ie)}`;return H!==t.nil?(0,t._)`${q}.call(${H}, ${he})`:(0,t._)`${q}(${he})`}_e.callValidateCode=m;const b=(0,t._)`new RegExp`;function w({gen:y,it:{opts:_}},I){const v=_.unicodeRegExp?"u":"",{regExp:E}=_.code,O=E(I,v);return y.scopeValue("pattern",{key:O.toString(),ref:O,code:(0,t._)`${E.code==="new RegExp"?b:(0,r.useFunc)(y,E)}(${I}, ${v})`})}_e.usePattern=w;function g(y){const{gen:_,data:I,keyword:v,it:E}=y,O=_.name("valid");if(E.allErrors){const q=_.let("valid",!0);return P(()=>_.assign(q,!1)),q}return _.var(O,!0),P(()=>_.break()),O;function P(q){const H=_.const("len",(0,t._)`${I}.length`);_.forRange("i",0,H,G=>{y.subschema({keyword:v,dataProp:G,dataPropType:e.Type.Num},O),_.if((0,t.not)(O),q)})}}_e.validateArray=g;function k(y){const{gen:_,schema:I,keyword:v,it:E}=y;if(!Array.isArray(I))throw new Error("ajv implementation error");if(I.some(H=>(0,e.alwaysValidSchema)(E,H))&&!E.opts.unevaluated)return;const P=_.let("valid",!1),q=_.name("_valid");_.block(()=>I.forEach((H,G)=>{const Y=y.subschema({keyword:v,schemaProp:G,compositeRule:!0},q);_.assign(P,(0,t._)`${P} || ${q}`),y.mergeValidEvaluated(Y,q)||_.if((0,t.not)(P))})),y.result(P,()=>y.reset(),()=>y.error(!0))}return _e.validateUnion=k,_e}var Bo;function Jy(){if(Bo)return lt;Bo=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.validateKeywordUsage=lt.validSchemaType=lt.funcKeywordCode=lt.macroKeywordCode=void 0;const t=ge(),e=Pt(),n=ht(),r=ys();function s(h,m){const{gen:b,keyword:w,schema:g,parentSchema:k,it:y}=h,_=m.macro.call(y.self,g,k,y),I=u(b,w,_);y.opts.validateSchema!==!1&&y.self.validateSchema(_,!0);const v=b.name("valid");h.subschema({schema:_,schemaPath:t.nil,errSchemaPath:`${y.errSchemaPath}/${w}`,topSchemaRef:I,compositeRule:!0},v),h.pass(v,()=>h.error(!0))}lt.macroKeywordCode=s;function i(h,m){var b;const{gen:w,keyword:g,schema:k,parentSchema:y,$data:_,it:I}=h;c(I,m);const v=!_&&m.compile?m.compile.call(I.self,k,y,I):m.validate,E=u(w,g,v),O=w.let("valid");h.block$data(O,P),h.ok((b=m.valid)!==null&&b!==void 0?b:O);function P(){if(m.errors===!1)G(),m.modifying&&o(h),Y(()=>h.error());else{const ie=m.async?q():H();m.modifying&&o(h),Y(()=>a(h,ie))}}function q(){const ie=w.let("ruleErrs",null);return w.try(()=>G((0,t._)`await `),he=>w.assign(O,!1).if((0,t._)`${he} instanceof ${I.ValidationError}`,()=>w.assign(ie,(0,t._)`${he}.errors`),()=>w.throw(he))),ie}function H(){const ie=(0,t._)`${E}.errors`;return w.assign(ie,null),G(t.nil),ie}function G(ie=m.async?(0,t._)`await `:t.nil){const he=I.opts.passContext?e.default.this:e.default.self,U=!("compile"in m&&!_||m.schema===!1);w.assign(O,(0,t._)`${ie}${(0,n.callValidateCode)(h,E,he,U)}`,m.modifying)}function Y(ie){var he;w.if((0,t.not)((he=m.valid)!==null&&he!==void 0?he:O),ie)}}lt.funcKeywordCode=i;function o(h){const{gen:m,data:b,it:w}=h;m.if(w.parentData,()=>m.assign(b,(0,t._)`${w.parentData}[${w.parentDataProperty}]`))}function a(h,m){const{gen:b}=h;b.if((0,t._)`Array.isArray(${m})`,()=>{b.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 u(h,m,b){if(b===void 0)throw new Error(`keyword "${m}" failed to compile`);return h.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,t.stringify)(b)})}function d(h,m,b=!1){return!m.length||m.some(w=>w==="array"?Array.isArray(h):w==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==w||b&&typeof h>"u")}lt.validSchemaType=d;function p({schema:h,opts:m,self:b,errSchemaPath:w},g,k){if(Array.isArray(g.keyword)?!g.keyword.includes(k):g.keyword!==k)throw new Error("ajv implementation error");const y=g.dependencies;if(y?.some(_=>!Object.prototype.hasOwnProperty.call(h,_)))throw new Error(`parent schema must have dependencies of ${k}: ${y.join(",")}`);if(g.validateSchema&&!g.validateSchema(h[k])){const I=`keyword "${k}" value is invalid at path "${w}": `+b.errorsText(g.validateSchema.errors);if(m.validateSchema==="log")b.logger.error(I);else throw new Error(I)}}return lt.validateKeywordUsage=p,lt}var bt={},Do;function Hy(){if(Do)return bt;Do=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.extendSubschemaMode=bt.extendSubschemaData=bt.getSubschema=void 0;const t=ge(),e=be();function n(i,{keyword:o,schemaProp:a,schema:c,schemaPath:u,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(u===void 0||d===void 0||p===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:u,topSchemaRef:p,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}bt.getSubschema=n;function r(i,o,{dataProp:a,dataPropType:c,data:u,dataTypes:d,propertyName:p}){if(u!==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:b,dataPathArr:w,opts:g}=o,k=h.let("data",(0,t._)`${o.data}${(0,t.getProperty)(a)}`,!0);m(k),i.errorPath=(0,t.str)`${b}${(0,e.getErrorPath)(a,c,g.jsPropertySyntax)}`,i.parentDataProperty=(0,t._)`${a}`,i.dataPathArr=[...w,i.parentDataProperty]}if(u!==void 0){const b=u instanceof t.Name?u:h.let("data",u,!0);m(b),p!==void 0&&(i.propertyName=p)}d&&(i.dataTypes=d);function m(b){i.data=b,i.dataLevel=o.dataLevel+1,i.dataTypes=[],o.definedProperties=new Set,i.parentData=o.data,i.dataNames=[...o.dataNames,b]}}bt.extendSubschemaData=r;function s(i,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:c,createErrors:u,allErrors:d}){c!==void 0&&(i.compositeRule=c),u!==void 0&&(i.createErrors=u),d!==void 0&&(i.allErrors=d),i.jtdDiscriminator=o,i.jtdMetadata=a}return bt.extendSubschemaMode=s,bt}var Ge={},Ds,Ro;function Cu(){return Ro||(Ro=1,Ds=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}),Ds}var Rs={exports:{}},zo;function Gy(){if(zo)return Rs.exports;zo=1;var t=Rs.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,u,d,p,h){if(o&&typeof o=="object"&&!Array.isArray(o)){s(o,a,c,u,d,p,h);for(var m in o){var b=o[m];if(Array.isArray(b)){if(m in t.arrayKeywords)for(var w=0;w<b.length;w++)e(r,s,i,b[w],a+"/"+m+"/"+w,c,a,m,o,w)}else if(m in t.propsKeywords){if(b&&typeof b=="object")for(var g in b)e(r,s,i,b[g],a+"/"+m+"/"+n(g),c,a,m,o,g)}else(m in t.keywords||r.allKeys&&!(m in t.skipKeywords))&&e(r,s,i,b,a+"/"+m,c,a,m,o)}i(o,a,c,u,d,p,h)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return Rs.exports}var Fo;function ws(){if(Fo)return Ge;Fo=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.getSchemaRefs=Ge.resolveUrl=Ge.normalizeId=Ge._getFullPath=Ge.getFullPath=Ge.inlineRef=void 0;const t=be(),e=Cu(),n=Gy(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(w,g=!0){return typeof w=="boolean"?!0:g===!0?!o(w):g?a(w)<=g:!1}Ge.inlineRef=s;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(w){for(const g in w){if(i.has(g))return!0;const k=w[g];if(Array.isArray(k)&&k.some(o)||typeof k=="object"&&o(k))return!0}return!1}function a(w){let g=0;for(const k in w){if(k==="$ref")return 1/0;if(g++,!r.has(k)&&(typeof w[k]=="object"&&(0,t.eachItem)(w[k],y=>g+=a(y)),g===1/0))return 1/0}return g}function c(w,g="",k){k!==!1&&(g=p(g));const y=w.parse(g);return u(w,y)}Ge.getFullPath=c;function u(w,g){return w.serialize(g).split("#")[0]+"#"}Ge._getFullPath=u;const d=/#\/?$/;function p(w){return w?w.replace(d,""):""}Ge.normalizeId=p;function h(w,g,k){return k=p(k),w.resolve(g,k)}Ge.resolveUrl=h;const m=/^[a-z_][-a-z0-9._]*$/i;function b(w,g){if(typeof w=="boolean")return{};const{schemaId:k,uriResolver:y}=this.opts,_=p(w[k]||g),I={"":_},v=c(y,_,!1),E={},O=new Set;return n(w,{allKeys:!0},(H,G,Y,ie)=>{if(ie===void 0)return;const he=v+G;let U=I[ie];typeof H[k]=="string"&&(U=W.call(this,H[k])),se.call(this,H.$anchor),se.call(this,H.$dynamicAnchor),I[G]=U;function W(re){const ue=this.opts.uriResolver.resolve;if(re=p(U?ue(U,re):re),O.has(re))throw q(re);O.add(re);let K=this.refs[re];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?P(H,K.schema,re):re!==p(he)&&(re[0]==="#"?(P(H,E[re],re),E[re]=H):this.refs[re]=he),re}function se(re){if(typeof re=="string"){if(!m.test(re))throw new Error(`invalid anchor "${re}"`);W.call(this,`#${re}`)}}}),E;function P(H,G,Y){if(G!==void 0&&!e(H,G))throw q(Y)}function q(H){return new Error(`reference "${H}" resolves to more than one schema`)}}return Ge.getSchemaRefs=b,Ge}var Mo;function vs(){if(Mo)return wt;Mo=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.getData=wt.KeywordCxt=wt.validateFunctionCode=void 0;const t=Zy(),e=ts(),n=Pu(),r=ts(),s=Ky(),i=Jy(),o=Hy(),a=ge(),c=Pt(),u=ws(),d=be(),p=ys();function h(j){if(v(j)&&(O(j),I(j))){g(j);return}m(j,()=>(0,t.topBoolOrEmptySchema)(j))}wt.validateFunctionCode=h;function m({gen:j,validateName:D,schema:V,schemaEnv:J,opts:ne},le){ne.code.es5?j.func(D,(0,a._)`${c.default.data}, ${c.default.valCxt}`,J.$async,()=>{j.code((0,a._)`"use strict"; ${y(V,ne)}`),w(j,ne),j.code(le)}):j.func(D,(0,a._)`${c.default.data}, ${b(ne)}`,J.$async,()=>j.code(y(V,ne)).code(le))}function b(j){return(0,a._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${j.dynamicRef?(0,a._)`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}function w(j,D){j.if(c.default.valCxt,()=>{j.var(c.default.instancePath,(0,a._)`${c.default.valCxt}.${c.default.instancePath}`),j.var(c.default.parentData,(0,a._)`${c.default.valCxt}.${c.default.parentData}`),j.var(c.default.parentDataProperty,(0,a._)`${c.default.valCxt}.${c.default.parentDataProperty}`),j.var(c.default.rootData,(0,a._)`${c.default.valCxt}.${c.default.rootData}`),D.dynamicRef&&j.var(c.default.dynamicAnchors,(0,a._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{j.var(c.default.instancePath,(0,a._)`""`),j.var(c.default.parentData,(0,a._)`undefined`),j.var(c.default.parentDataProperty,(0,a._)`undefined`),j.var(c.default.rootData,c.default.data),D.dynamicRef&&j.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function g(j){const{schema:D,opts:V,gen:J}=j;m(j,()=>{V.$comment&&D.$comment&&ie(j),H(j),J.let(c.default.vErrors,null),J.let(c.default.errors,0),V.unevaluated&&k(j),P(j),he(j)})}function k(j){const{gen:D,validateName:V}=j;j.evaluated=D.const("evaluated",(0,a._)`${V}.evaluated`),D.if((0,a._)`${j.evaluated}.dynamicProps`,()=>D.assign((0,a._)`${j.evaluated}.props`,(0,a._)`undefined`)),D.if((0,a._)`${j.evaluated}.dynamicItems`,()=>D.assign((0,a._)`${j.evaluated}.items`,(0,a._)`undefined`))}function y(j,D){const V=typeof j=="object"&&j[D.schemaId];return V&&(D.code.source||D.code.process)?(0,a._)`/*# sourceURL=${V} */`:a.nil}function _(j,D){if(v(j)&&(O(j),I(j))){E(j,D);return}(0,t.boolOrEmptySchema)(j,D)}function I({schema:j,self:D}){if(typeof j=="boolean")return!j;for(const V in j)if(D.RULES.all[V])return!0;return!1}function v(j){return typeof j.schema!="boolean"}function E(j,D){const{schema:V,gen:J,opts:ne}=j;ne.$comment&&V.$comment&&ie(j),G(j),Y(j);const le=J.const("_errs",c.default.errors);P(j,le),J.var(D,(0,a._)`${le} === ${c.default.errors}`)}function O(j){(0,d.checkUnknownRules)(j),q(j)}function P(j,D){if(j.opts.jtd)return W(j,[],!1,D);const V=(0,e.getSchemaTypes)(j.schema),J=(0,e.coerceAndCheckDataType)(j,V);W(j,V,!J,D)}function q(j){const{schema:D,errSchemaPath:V,opts:J,self:ne}=j;D.$ref&&J.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(D,ne.RULES)&&ne.logger.warn(`$ref: keywords ignored in schema at path "${V}"`)}function H(j){const{schema:D,opts:V}=j;D.default!==void 0&&V.useDefaults&&V.strictSchema&&(0,d.checkStrictMode)(j,"default is ignored in the schema root")}function G(j){const D=j.schema[j.opts.schemaId];D&&(j.baseId=(0,u.resolveUrl)(j.opts.uriResolver,j.baseId,D))}function Y(j){if(j.schema.$async&&!j.schemaEnv.$async)throw new Error("async schema in sync schema")}function ie({gen:j,schemaEnv:D,schema:V,errSchemaPath:J,opts:ne}){const le=V.$comment;if(ne.$comment===!0)j.code((0,a._)`${c.default.self}.logger.log(${le})`);else if(typeof ne.$comment=="function"){const $e=(0,a.str)`${J}/$comment`,Ue=j.scopeValue("root",{ref:D.root});j.code((0,a._)`${c.default.self}.opts.$comment(${le}, ${$e}, ${Ue}.schema)`)}}function he(j){const{gen:D,schemaEnv:V,validateName:J,ValidationError:ne,opts:le}=j;V.$async?D.if((0,a._)`${c.default.errors} === 0`,()=>D.return(c.default.data),()=>D.throw((0,a._)`new ${ne}(${c.default.vErrors})`)):(D.assign((0,a._)`${J}.errors`,c.default.vErrors),le.unevaluated&&U(j),D.return((0,a._)`${c.default.errors} === 0`))}function U({gen:j,evaluated:D,props:V,items:J}){V instanceof a.Name&&j.assign((0,a._)`${D}.props`,V),J instanceof a.Name&&j.assign((0,a._)`${D}.items`,J)}function W(j,D,V,J){const{gen:ne,schema:le,data:$e,allErrors:Ue,opts:Ke,self:Le}=j,{RULES:xe}=Le;if(le.$ref&&(Ke.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(le,xe))){ne.block(()=>Q(j,"$ref",xe.all.$ref.definition));return}Ke.jtd||re(j,D),ne.block(()=>{for(const Je of xe.rules)qe(Je);qe(xe.post)});function qe(Je){(0,n.shouldUseGroup)(le,Je)&&(Je.type?(ne.if((0,r.checkDataType)(Je.type,$e,Ke.strictNumbers)),se(j,Je),D.length===1&&D[0]===Je.type&&V&&(ne.else(),(0,r.reportTypeError)(j)),ne.endIf()):se(j,Je),Ue||ne.if((0,a._)`${c.default.errors} === ${J||0}`))}}function se(j,D){const{gen:V,schema:J,opts:{useDefaults:ne}}=j;ne&&(0,s.assignDefaults)(j,D.type),V.block(()=>{for(const le of D.rules)(0,n.shouldUseRule)(J,le)&&Q(j,le.keyword,le.definition,D.type)})}function re(j,D){j.schemaEnv.meta||!j.opts.strictTypes||(ue(j,D),j.opts.allowUnionTypes||K(j,D),C(j,j.dataTypes))}function ue(j,D){if(D.length){if(!j.dataTypes.length){j.dataTypes=D;return}D.forEach(V=>{B(j.dataTypes,V)||T(j,`type "${V}" not allowed by context "${j.dataTypes.join(",")}"`)}),$(j,D)}}function K(j,D){D.length>1&&!(D.length===2&&D.includes("null"))&&T(j,"use allowUnionTypes to allow union type keyword")}function C(j,D){const V=j.self.RULES.all;for(const J in V){const ne=V[J];if(typeof ne=="object"&&(0,n.shouldUseRule)(j.schema,ne)){const{type:le}=ne.definition;le.length&&!le.some($e=>F(D,$e))&&T(j,`missing type "${le.join(",")}" for keyword "${J}"`)}}}function F(j,D){return j.includes(D)||D==="number"&&j.includes("integer")}function B(j,D){return j.includes(D)||D==="integer"&&j.includes("number")}function $(j,D){const V=[];for(const J of j.dataTypes)B(D,J)?V.push(J):D.includes("integer")&&J==="number"&&V.push("integer");j.dataTypes=V}function T(j,D){const V=j.schemaEnv.baseId+j.errSchemaPath;D+=` at "${V}" (strictTypes)`,(0,d.checkStrictMode)(j,D,j.opts.strictTypes)}class M{constructor(D,V,J){if((0,i.validateKeywordUsage)(D,V,J),this.gen=D.gen,this.allErrors=D.allErrors,this.keyword=J,this.data=D.data,this.schema=D.schema[J],this.$data=V.$data&&D.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(D,this.schema,J,this.$data),this.schemaType=V.schemaType,this.parentSchema=D.schema,this.params={},this.it=D,this.def=V,this.$data)this.schemaCode=D.gen.const("vSchema",oe(this.$data,D));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,V.schemaType,V.allowUndefined))throw new Error(`${J} value must be ${JSON.stringify(V.schemaType)}`);("code"in V?V.trackErrors:V.errors!==!1)&&(this.errsCount=D.gen.const("_errs",c.default.errors))}result(D,V,J){this.failResult((0,a.not)(D),V,J)}failResult(D,V,J){this.gen.if(D),J?J():this.error(),V?(this.gen.else(),V(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(D,V){this.failResult((0,a.not)(D),void 0,V)}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:V}=this;this.fail((0,a._)`${V} !== undefined && (${(0,a.or)(this.invalid$data(),D)})`)}error(D,V,J){if(V){this.setParams(V),this._error(D,J),this.setParams({});return}this._error(D,J)}_error(D,V){(D?p.reportExtraError:p.reportError)(this,this.def.error,V)}$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,V){V?Object.assign(this.params,D):this.params=D}block$data(D,V,J=a.nil){this.gen.block(()=>{this.check$data(D,J),V()})}check$data(D=a.nil,V=a.nil){if(!this.$data)return;const{gen:J,schemaCode:ne,schemaType:le,def:$e}=this;J.if((0,a.or)((0,a._)`${ne} === undefined`,V)),D!==a.nil&&J.assign(D,!0),(le.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:V,schemaType:J,def:ne,it:le}=this;return(0,a.or)($e(),Ue());function $e(){if(J.length){if(!(V instanceof a.Name))throw new Error("ajv implementation error");const Ke=Array.isArray(J)?J:[J];return(0,a._)`${(0,r.checkDataTypes)(Ke,V,le.opts.strictNumbers,r.DataType.Wrong)}`}return a.nil}function Ue(){if(ne.validateSchema){const Ke=D.scopeValue("validate$data",{ref:ne.validateSchema});return(0,a._)`!${Ke}(${V})`}return a.nil}}subschema(D,V){const J=(0,o.getSubschema)(this.it,D);(0,o.extendSubschemaData)(J,this.it,D),(0,o.extendSubschemaMode)(J,D);const ne={...this.it,...J,items:void 0,props:void 0};return _(ne,V),ne}mergeEvaluated(D,V){const{it:J,gen:ne}=this;J.opts.unevaluated&&(J.props!==!0&&D.props!==void 0&&(J.props=d.mergeEvaluated.props(ne,D.props,J.props,V)),J.items!==!0&&D.items!==void 0&&(J.items=d.mergeEvaluated.items(ne,D.items,J.items,V)))}mergeValidEvaluated(D,V){const{it:J,gen:ne}=this;if(J.opts.unevaluated&&(J.props!==!0||J.items!==!0))return ne.if(V,()=>this.mergeEvaluated(D,a.Name)),!0}}wt.KeywordCxt=M;function Q(j,D,V,J){const ne=new M(j,V,D);"code"in V?V.code(ne,J):ne.$data&&V.validate?(0,i.funcKeywordCode)(ne,V):"macro"in V?(0,i.macroKeywordCode)(ne,V):(V.compile||V.validate)&&(0,i.funcKeywordCode)(ne,V)}const X=/^\/(?:[^~]|~0|~1)*$/,pe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oe(j,{dataLevel:D,dataNames:V,dataPathArr:J}){let ne,le;if(j==="")return c.default.rootData;if(j[0]==="/"){if(!X.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);ne=j,le=c.default.rootData}else{const Le=pe.exec(j);if(!Le)throw new Error(`Invalid JSON-pointer: ${j}`);const xe=+Le[1];if(ne=Le[2],ne==="#"){if(xe>=D)throw new Error(Ke("property/index",xe));return J[D-xe]}if(xe>D)throw new Error(Ke("data",xe));if(le=V[D-xe],!ne)return le}let $e=le;const Ue=ne.split("/");for(const Le of Ue)Le&&(le=(0,a._)`${le}${(0,a.getProperty)((0,d.unescapeJsonPointer)(Le))}`,$e=(0,a._)`${$e} && ${le}`);return $e;function Ke(Le,xe){return`Cannot access ${Le} ${xe} levels up, current level is ${D}`}}return wt.getData=oe,wt}var rr={},Uo;function Pi(){if(Uo)return rr;Uo=1,Object.defineProperty(rr,"__esModule",{value:!0});class t extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return rr.default=t,rr}var sr={},Lo;function bs(){if(Lo)return sr;Lo=1,Object.defineProperty(sr,"__esModule",{value:!0});const t=ws();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 sr.default=e,sr}var nt={},qo;function Ci(){if(qo)return nt;qo=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.resolveSchema=nt.getCompilingSchema=nt.resolveRef=nt.compileSchema=nt.SchemaEnv=void 0;const t=ge(),e=Pi(),n=Pt(),r=ws(),s=be(),i=vs();class o{constructor(k){var y;this.refs={},this.dynamicAnchors={};let _;typeof k.schema=="object"&&(_=k.schema),this.schema=k.schema,this.schemaId=k.schemaId,this.root=k.root||this,this.baseId=(y=k.baseId)!==null&&y!==void 0?y:(0,r.normalizeId)(_?.[k.schemaId||"$id"]),this.schemaPath=k.schemaPath,this.localRefs=k.localRefs,this.meta=k.meta,this.$async=_?.$async,this.refs={}}}nt.SchemaEnv=o;function a(g){const k=d.call(this,g);if(k)return k;const y=(0,r.getFullPath)(this.opts.uriResolver,g.root.baseId),{es5:_,lines:I}=this.opts.code,{ownProperties:v}=this.opts,E=new t.CodeGen(this.scope,{es5:_,lines:I,ownProperties:v});let O;g.$async&&(O=E.scopeValue("Error",{ref:e.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));const P=E.scopeName("validate");g.validateName=P;const q={gen:E,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:E.scopeValue("schema",this.opts.code.source===!0?{ref:g.schema,code:(0,t.stringify)(g.schema)}:{ref:g.schema}),validateName:P,ValidationError:O,schema:g.schema,schemaEnv:g,rootId:y,baseId:g.baseId||y,schemaPath:t.nil,errSchemaPath:g.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};let H;try{this._compilations.add(g),(0,i.validateFunctionCode)(q),E.optimize(this.opts.code.optimize);const G=E.toString();H=`${E.scopeRefs(n.default.scope)}return ${G}`,this.opts.code.process&&(H=this.opts.code.process(H,g));const ie=new Function(`${n.default.self}`,`${n.default.scope}`,H)(this,this.scope.get());if(this.scope.value(P,{ref:ie}),ie.errors=null,ie.schema=g.schema,ie.schemaEnv=g,g.$async&&(ie.$async=!0),this.opts.code.source===!0&&(ie.source={validateName:P,validateCode:G,scopeValues:E._values}),this.opts.unevaluated){const{props:he,items:U}=q;ie.evaluated={props:he instanceof t.Name?void 0:he,items:U instanceof t.Name?void 0:U,dynamicProps:he instanceof t.Name,dynamicItems:U instanceof t.Name},ie.source&&(ie.source.evaluated=(0,t.stringify)(ie.evaluated))}return g.validate=ie,g}catch(G){throw delete g.validate,delete g.validateName,H&&this.logger.error("Error compiling schema, function code:",H),G}finally{this._compilations.delete(g)}}nt.compileSchema=a;function c(g,k,y){var _;y=(0,r.resolveUrl)(this.opts.uriResolver,k,y);const I=g.refs[y];if(I)return I;let v=h.call(this,g,y);if(v===void 0){const E=(_=g.localRefs)===null||_===void 0?void 0:_[y],{schemaId:O}=this.opts;E&&(v=new o({schema:E,schemaId:O,root:g,baseId:k}))}if(v!==void 0)return g.refs[y]=u.call(this,v)}nt.resolveRef=c;function u(g){return(0,r.inlineRef)(g.schema,this.opts.inlineRefs)?g.schema:g.validate?g:a.call(this,g)}function d(g){for(const k of this._compilations)if(p(k,g))return k}nt.getCompilingSchema=d;function p(g,k){return g.schema===k.schema&&g.root===k.root&&g.baseId===k.baseId}function h(g,k){let y;for(;typeof(y=this.refs[k])=="string";)k=y;return y||this.schemas[k]||m.call(this,g,k)}function m(g,k){const y=this.opts.uriResolver.parse(k),_=(0,r._getFullPath)(this.opts.uriResolver,y);let I=(0,r.getFullPath)(this.opts.uriResolver,g.baseId,void 0);if(Object.keys(g.schema).length>0&&_===I)return w.call(this,y,g);const v=(0,r.normalizeId)(_),E=this.refs[v]||this.schemas[v];if(typeof E=="string"){const O=m.call(this,g,E);return typeof O?.schema!="object"?void 0:w.call(this,y,O)}if(typeof E?.schema=="object"){if(E.validate||a.call(this,E),v===(0,r.normalizeId)(k)){const{schema:O}=E,{schemaId:P}=this.opts,q=O[P];return q&&(I=(0,r.resolveUrl)(this.opts.uriResolver,I,q)),new o({schema:O,schemaId:P,root:g,baseId:I})}return w.call(this,y,E)}}nt.resolveSchema=m;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(g,{baseId:k,schema:y,root:_}){var I;if(((I=g.fragment)===null||I===void 0?void 0:I[0])!=="/")return;for(const O of g.fragment.slice(1).split("/")){if(typeof y=="boolean")return;const P=y[(0,s.unescapeFragment)(O)];if(P===void 0)return;y=P;const q=typeof y=="object"&&y[this.opts.schemaId];!b.has(O)&&q&&(k=(0,r.resolveUrl)(this.opts.uriResolver,k,q))}let v;if(typeof y!="boolean"&&y.$ref&&!(0,s.schemaHasRulesButRef)(y,this.RULES)){const O=(0,r.resolveUrl)(this.opts.uriResolver,k,y.$ref);v=m.call(this,_,O)}const{schemaId:E}=this.opts;if(v=v||new o({schema:y,schemaId:E,root:_,baseId:k}),v.schema!==v.root.schema)return v}return nt}const Wy="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Yy="Meta-schema for $data reference (JSON AnySchema extension proposal)",Xy="object",Qy=["$data"],e0={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},t0=!1;var n0={$id:Wy,description:Yy,type:Xy,required:Qy,properties:e0,additionalProperties:t0},ir={},kn={exports:{}},zs,Vo;function xu(){if(Vo)return zs;Vo=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="",b=0,w=0;for(w=0;w<h.length;w++)if(b=h[w].charCodeAt(0),b!==48){if(!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";m+=h[w];break}for(w+=1;w<h.length;w++){if(b=h[w].charCodeAt(0),!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";m+=h[w]}return m}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(h){return h.length=0,!0}function i(h,m,b){if(h.length){const w=n(h);if(w!=="")m.push(w);else return b.error=!0,!1;h.length=0}return!0}function o(h){let m=0;const b={error:!1,address:"",zone:""},w=[],g=[];let k=!1,y=!1,_=i;for(let I=0;I<h.length;I++){const v=h[I];if(!(v==="["||v==="]"))if(v===":"){if(k===!0&&(y=!0),!_(g,w,b))break;if(++m>7){b.error=!0;break}I>0&&h[I-1]===":"&&(k=!0),w.push(":");continue}else if(v==="%"){if(!_(g,w,b))break;_=s}else{g.push(v);continue}}return g.length&&(_===s?b.zone=g.join(""):y?w.push(g.join("")):w.push(n(g))),b.address=w.join(""),b}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 b=m.address,w=m.address;return m.zone&&(b+="%"+m.zone,w+="%25"+m.zone),{host:b,isIPV6:!0,escapedHost:w}}}function c(h,m){let b=0;for(let w=0;w<h.length;w++)h[w]===m&&b++;return b}function u(h){let m=h;const b=[];let w=-1,g=0;for(;g=m.length;){if(g===1){if(m===".")break;if(m==="/"){b.push("/");break}else{b.push(m);break}}else if(g===2){if(m[0]==="."){if(m[1]===".")break;if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&(m[1]==="."||m[1]==="/")){b.push("/");break}}else if(g===3&&m==="/.."){b.length!==0&&b.pop(),b.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),b.length!==0&&b.pop();continue}}if((w=m.indexOf("/",1))===-1){b.push(m);break}else b.push(m.slice(0,w)),m=m.slice(w)}return b.join("")}function d(h,m){const b=m!==!0?escape:unescape;return h.scheme!==void 0&&(h.scheme=b(h.scheme)),h.userinfo!==void 0&&(h.userinfo=b(h.userinfo)),h.host!==void 0&&(h.host=b(h.host)),h.path!==void 0&&(h.path=b(h.path)),h.query!==void 0&&(h.query=b(h.query)),h.fragment!==void 0&&(h.fragment=b(h.fragment)),h}function p(h){const m=[];if(h.userinfo!==void 0&&(m.push(h.userinfo),m.push("@")),h.host!==void 0){let b=unescape(h.host);if(!e(b)){const w=a(b);w.isIPV6===!0?b=`[${w.escapedHost}]`:b=h.host}m.push(b)}return(typeof h.port=="number"||typeof h.port=="string")&&(m.push(":"),m.push(String(h.port))),m.length?m.join(""):void 0}return zs={nonSimpleDomain:r,recomposeAuthority:p,normalizeComponentEncoding:d,removeDotSegments:u,isIPv4:e,isUUID:t,normalizeIPv6:a,stringArrayToHexStripped:n},zs}var Fs,Zo;function r0(){if(Zo)return Fs;Zo=1;const{isUUID:t}=xu(),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 E=String(v.scheme).toLowerCase()==="https";return(v.port===(E?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[E,O]=v.resourceName.split("?");v.path=E&&E!=="/"?E:void 0,v.query=O,v.resourceName=void 0}return v.fragment=void 0,v}function u(v,E){if(!v.path)return v.error="URN can not be parsed",v;const O=v.path.match(e);if(O){const P=E.scheme||v.scheme||"urn";v.nid=O[1].toLowerCase(),v.nss=O[2];const q=`${P}:${E.nid||v.nid}`,H=I(q);v.path=void 0,H&&(v=H.parse(v,E))}else v.error=v.error||"URN can not be parsed.";return v}function d(v,E){if(v.nid===void 0)throw new Error("URN without nid cannot be serialized");const O=E.scheme||v.scheme||"urn",P=v.nid.toLowerCase(),q=`${O}:${E.nid||P}`,H=I(q);H&&(v=H.serialize(v,E));const G=v,Y=v.nss;return G.path=`${P||E.nid}:${Y}`,E.skipEscape=!0,G}function p(v,E){const O=v;return O.uuid=O.nss,O.nss=void 0,!E.tolerant&&(!O.uuid||!t(O.uuid))&&(O.error=O.error||"UUID is not valid."),O}function h(v){const E=v;return E.nss=(v.uuid||"").toLowerCase(),E}const m={scheme:"http",domainHost:!0,parse:i,serialize:o},b={scheme:"https",domainHost:m.domainHost,parse:i,serialize:o},w={scheme:"ws",domainHost:!0,parse:a,serialize:c},g={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},_={http:m,https:b,ws:w,wss:g,urn:{scheme:"urn",parse:u,serialize:d,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:p,serialize:h,skipNormalize:!0}};Object.setPrototypeOf(_,null);function I(v){return v&&(_[v]||_[v.toLowerCase()])||void 0}return Fs={wsIsSecure:s,SCHEMES:_,isValidSchemeName:r,getSchemeHandler:I},Fs}var Ko;function s0(){if(Ko)return kn.exports;Ko=1;const{normalizeIPv6:t,removeDotSegments:e,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:s,nonSimpleDomain:i}=xu(),{SCHEMES:o,getSchemeHandler:a}=r0();function c(g,k){return typeof g=="string"?g=h(b(g,k),k):typeof g=="object"&&(g=b(h(g,k),k)),g}function u(g,k,y){const _=y?Object.assign({scheme:"null"},y):{scheme:"null"},I=d(b(g,_),b(k,_),_,!0);return _.skipEscape=!0,h(I,_)}function d(g,k,y,_){const I={};return _||(g=b(h(g,y),y),k=b(h(k,y),y)),y=y||{},!y.tolerant&&k.scheme?(I.scheme=k.scheme,I.userinfo=k.userinfo,I.host=k.host,I.port=k.port,I.path=e(k.path||""),I.query=k.query):(k.userinfo!==void 0||k.host!==void 0||k.port!==void 0?(I.userinfo=k.userinfo,I.host=k.host,I.port=k.port,I.path=e(k.path||""),I.query=k.query):(k.path?(k.path[0]==="/"?I.path=e(k.path):((g.userinfo!==void 0||g.host!==void 0||g.port!==void 0)&&!g.path?I.path="/"+k.path:g.path?I.path=g.path.slice(0,g.path.lastIndexOf("/")+1)+k.path:I.path=k.path,I.path=e(I.path)),I.query=k.query):(I.path=g.path,k.query!==void 0?I.query=k.query:I.query=g.query),I.userinfo=g.userinfo,I.host=g.host,I.port=g.port),I.scheme=g.scheme),I.fragment=k.fragment,I}function p(g,k,y){return typeof g=="string"?(g=unescape(g),g=h(r(b(g,y),!0),{...y,skipEscape:!0})):typeof g=="object"&&(g=h(r(g,!0),{...y,skipEscape:!0})),typeof k=="string"?(k=unescape(k),k=h(r(b(k,y),!0),{...y,skipEscape:!0})):typeof k=="object"&&(k=h(r(k,!0),{...y,skipEscape:!0})),g.toLowerCase()===k.toLowerCase()}function h(g,k){const y={host:g.host,scheme:g.scheme,userinfo:g.userinfo,port:g.port,path:g.path,query:g.query,nid:g.nid,nss:g.nss,uuid:g.uuid,fragment:g.fragment,reference:g.reference,resourceName:g.resourceName,secure:g.secure,error:""},_=Object.assign({},k),I=[],v=a(_.scheme||y.scheme);v&&v.serialize&&v.serialize(y,_),y.path!==void 0&&(_.skipEscape?y.path=unescape(y.path):(y.path=escape(y.path),y.scheme!==void 0&&(y.path=y.path.split("%3A").join(":")))),_.reference!=="suffix"&&y.scheme&&I.push(y.scheme,":");const E=n(y);if(E!==void 0&&(_.reference!=="suffix"&&I.push("//"),I.push(E),y.path&&y.path[0]!=="/"&&I.push("/")),y.path!==void 0){let O=y.path;!_.absolutePath&&(!v||!v.absolutePath)&&(O=e(O)),E===void 0&&O[0]==="/"&&O[1]==="/"&&(O="/%2F"+O.slice(2)),I.push(O)}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 b(g,k){const y=Object.assign({},k),_={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?g=y.scheme+":"+g:g="//"+g);const v=g.match(m);if(v){if(_.scheme=v[1],_.userinfo=v[3],_.host=v[4],_.port=parseInt(v[5],10),_.path=v[6]||"",_.query=v[7],_.fragment=v[8],isNaN(_.port)&&(_.port=v[5]),_.host)if(s(_.host)===!1){const P=t(_.host);_.host=P.host.toLowerCase(),I=P.isIPV6}else I=!0;_.scheme===void 0&&_.userinfo===void 0&&_.host===void 0&&_.port===void 0&&_.query===void 0&&!_.path?_.reference="same-document":_.scheme===void 0?_.reference="relative":_.fragment===void 0?_.reference="absolute":_.reference="uri",y.reference&&y.reference!=="suffix"&&y.reference!==_.reference&&(_.error=_.error||"URI is not a "+y.reference+" reference.");const E=a(y.scheme||_.scheme);if(!y.unicodeSupport&&(!E||!E.unicodeSupport)&&_.host&&(y.domainHost||E&&E.domainHost)&&I===!1&&i(_.host))try{_.host=URL.domainToASCII(_.host.toLowerCase())}catch(O){_.error=_.error||"Host's domain name can not be converted to ASCII: "+O}(!E||E&&!E.skipNormalize)&&(g.indexOf("%")!==-1&&(_.scheme!==void 0&&(_.scheme=unescape(_.scheme)),_.host!==void 0&&(_.host=unescape(_.host))),_.path&&(_.path=escape(unescape(_.path))),_.fragment&&(_.fragment=encodeURI(decodeURIComponent(_.fragment)))),E&&E.parse&&E.parse(_,y)}else _.error=_.error||"URI can not be parsed.";return _}const w={SCHEMES:o,normalize:c,resolve:u,resolveComponent:d,equal:p,serialize:h,parse:b};return kn.exports=w,kn.exports.default=w,kn.exports.fastUri=w,kn.exports}var Jo;function i0(){if(Jo)return ir;Jo=1,Object.defineProperty(ir,"__esModule",{value:!0});const t=s0();return t.code='require("ajv/dist/runtime/uri").default',ir.default=t,ir}var Ho;function o0(){return Ho||(Ho=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=vs();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var n=ge();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=Pi(),s=bs(),i=Nu(),o=Ci(),a=ge(),c=ws(),u=ts(),d=be(),p=n0,h=i0(),m=(K,C)=>new RegExp(K,C);m.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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."},k={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},y=200;function _(K){var C,F,B,$,T,M,Q,X,pe,oe,j,D,V,J,ne,le,$e,Ue,Ke,Le,xe,qe,Je,gn,st;const Ct=K.strict,S=(C=K.code)===null||C===void 0?void 0:C.optimize,l=S===!0||S===void 0?1:S||0,f=(B=(F=K.code)===null||F===void 0?void 0:F.regExp)!==null&&B!==void 0?B:m,A=($=K.uriResolver)!==null&&$!==void 0?$:h.default;return{strictSchema:(M=(T=K.strictSchema)!==null&&T!==void 0?T:Ct)!==null&&M!==void 0?M:!0,strictNumbers:(X=(Q=K.strictNumbers)!==null&&Q!==void 0?Q:Ct)!==null&&X!==void 0?X:!0,strictTypes:(oe=(pe=K.strictTypes)!==null&&pe!==void 0?pe:Ct)!==null&&oe!==void 0?oe:"log",strictTuples:(D=(j=K.strictTuples)!==null&&j!==void 0?j:Ct)!==null&&D!==void 0?D:"log",strictRequired:(J=(V=K.strictRequired)!==null&&V!==void 0?V:Ct)!==null&&J!==void 0?J:!1,code:K.code?{...K.code,optimize:l,regExp:f}:{optimize:l,regExp:f},loopRequired:(ne=K.loopRequired)!==null&&ne!==void 0?ne:y,loopEnum:(le=K.loopEnum)!==null&&le!==void 0?le:y,meta:($e=K.meta)!==null&&$e!==void 0?$e:!0,messages:(Ue=K.messages)!==null&&Ue!==void 0?Ue:!0,inlineRefs:(Ke=K.inlineRefs)!==null&&Ke!==void 0?Ke:!0,schemaId:(Le=K.schemaId)!==null&&Le!==void 0?Le:"$id",addUsedSchema:(xe=K.addUsedSchema)!==null&&xe!==void 0?xe:!0,validateSchema:(qe=K.validateSchema)!==null&&qe!==void 0?qe:!0,validateFormats:(Je=K.validateFormats)!==null&&Je!==void 0?Je:!0,unicodeRegExp:(gn=K.unicodeRegExp)!==null&&gn!==void 0?gn:!0,int32range:(st=K.int32range)!==null&&st!==void 0?st:!0,uriResolver:A}}class I{constructor(C={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,C=this.opts={...C,..._(C)};const{es5:F,lines:B}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:w,es5:F,lines:B}),this.logger=Y(C.logger);const $=C.validateFormats;C.validateFormats=!1,this.RULES=(0,i.getRules)(),v.call(this,g,C,"NOT SUPPORTED"),v.call(this,k,C,"DEPRECATED","warn"),this._metaOpts=H.call(this),C.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),C.keywords&&q.call(this,C.keywords),typeof C.meta=="object"&&this.addMetaSchema(C.meta),O.call(this),C.validateFormats=$}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:C,meta:F,schemaId:B}=this.opts;let $=p;B==="id"&&($={...p},$.id=$.$id,delete $.$id),F&&C&&this.addMetaSchema($,$[B],!1)}defaultMeta(){const{meta:C,schemaId:F}=this.opts;return this.opts.defaultMeta=typeof C=="object"?C[F]||C:void 0}validate(C,F){let B;if(typeof C=="string"){if(B=this.getSchema(C),!B)throw new Error(`no schema with key or ref "${C}"`)}else B=this.compile(C);const $=B(F);return"$async"in B||(this.errors=B.errors),$}compile(C,F){const B=this._addSchema(C,F);return B.validate||this._compileSchemaEnv(B)}compileAsync(C,F){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:B}=this.opts;return $.call(this,C,F);async function $(oe,j){await T.call(this,oe.$schema);const D=this._addSchema(oe,j);return D.validate||M.call(this,D)}async function T(oe){oe&&!this.getSchema(oe)&&await $.call(this,{$ref:oe},!0)}async function M(oe){try{return this._compileSchemaEnv(oe)}catch(j){if(!(j instanceof s.default))throw j;return Q.call(this,j),await X.call(this,j.missingSchema),M.call(this,oe)}}function Q({missingSchema:oe,missingRef:j}){if(this.refs[oe])throw new Error(`AnySchema ${oe} is loaded but ${j} cannot be resolved`)}async function X(oe){const j=await pe.call(this,oe);this.refs[oe]||await T.call(this,j.$schema),this.refs[oe]||this.addSchema(j,oe,F)}async function pe(oe){const j=this._loading[oe];if(j)return j;try{return await(this._loading[oe]=B(oe))}finally{delete this._loading[oe]}}}addSchema(C,F,B,$=this.opts.validateSchema){if(Array.isArray(C)){for(const M of C)this.addSchema(M,void 0,B,$);return this}let T;if(typeof C=="object"){const{schemaId:M}=this.opts;if(T=C[M],T!==void 0&&typeof T!="string")throw new Error(`schema ${M} must be string`)}return F=(0,c.normalizeId)(F||T),this._checkUnique(F),this.schemas[F]=this._addSchema(C,B,F,$,!0),this}addMetaSchema(C,F,B=this.opts.validateSchema){return this.addSchema(C,F,!0,B),this}validateSchema(C,F){if(typeof C=="boolean")return!0;let B;if(B=C.$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 $=this.validate(B,C);if(!$&&F){const T="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(T);else throw new Error(T)}return $}getSchema(C){let F;for(;typeof(F=E.call(this,C))=="string";)C=F;if(F===void 0){const{schemaId:B}=this.opts,$=new o.SchemaEnv({schema:{},schemaId:B});if(F=o.resolveSchema.call(this,$,C),!F)return;this.refs[C]=F}return F.validate||this._compileSchemaEnv(F)}removeSchema(C){if(C instanceof RegExp)return this._removeAllSchemas(this.schemas,C),this._removeAllSchemas(this.refs,C),this;switch(typeof C){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const F=E.call(this,C);return typeof F=="object"&&this._cache.delete(F.schema),delete this.schemas[C],delete this.refs[C],this}case"object":{const F=C;this._cache.delete(F);let B=C[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(C){for(const F of C)this.addKeyword(F);return this}addKeyword(C,F){let B;if(typeof C=="string")B=C,typeof F=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),F.keyword=B);else if(typeof C=="object"&&F===void 0){if(F=C,B=F.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(he.call(this,B,F),!F)return(0,d.eachItem)(B,T=>U.call(this,T)),this;se.call(this,F);const $={...F,type:(0,u.getJSONTypes)(F.type),schemaType:(0,u.getJSONTypes)(F.schemaType)};return(0,d.eachItem)(B,$.type.length===0?T=>U.call(this,T,$):T=>$.type.forEach(M=>U.call(this,T,$,M))),this}getKeyword(C){const F=this.RULES.all[C];return typeof F=="object"?F.definition:!!F}removeKeyword(C){const{RULES:F}=this;delete F.keywords[C],delete F.all[C];for(const B of F.rules){const $=B.rules.findIndex(T=>T.keyword===C);$>=0&&B.rules.splice($,1)}return this}addFormat(C,F){return typeof F=="string"&&(F=new RegExp(F)),this.formats[C]=F,this}errorsText(C=this.errors,{separator:F=", ",dataVar:B="data"}={}){return!C||C.length===0?"No errors":C.map($=>`${B}${$.instancePath} ${$.message}`).reduce(($,T)=>$+F+T)}$dataMetaSchema(C,F){const B=this.RULES.all;C=JSON.parse(JSON.stringify(C));for(const $ of F){const T=$.split("/").slice(1);let M=C;for(const Q of T)M=M[Q];for(const Q in B){const X=B[Q];if(typeof X!="object")continue;const{$data:pe}=X.definition,oe=M[Q];pe&&oe&&(M[Q]=ue(oe))}}return C}_removeAllSchemas(C,F){for(const B in C){const $=C[B];(!F||F.test(B))&&(typeof $=="string"?delete C[B]:$&&!$.meta&&(this._cache.delete($.schema),delete C[B]))}}_addSchema(C,F,B,$=this.opts.validateSchema,T=this.opts.addUsedSchema){let M;const{schemaId:Q}=this.opts;if(typeof C=="object")M=C[Q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof C!="boolean")throw new Error("schema must be object or boolean")}let X=this._cache.get(C);if(X!==void 0)return X;B=(0,c.normalizeId)(M||B);const pe=c.getSchemaRefs.call(this,C,B);return X=new o.SchemaEnv({schema:C,schemaId:Q,meta:F,baseId:B,localRefs:pe}),this._cache.set(X.schema,X),T&&!B.startsWith("#")&&(B&&this._checkUnique(B),this.refs[B]=X),$&&this.validateSchema(C,!0),X}_checkUnique(C){if(this.schemas[C]||this.refs[C])throw new Error(`schema with key or id "${C}" already exists`)}_compileSchemaEnv(C){if(C.meta?this._compileMetaSchema(C):o.compileSchema.call(this,C),!C.validate)throw new Error("ajv implementation error");return C.validate}_compileMetaSchema(C){const F=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,C)}finally{this.opts=F}}}I.ValidationError=r.default,I.MissingRefError=s.default,t.default=I;function v(K,C,F,B="error"){for(const $ in K){const T=$;T in C&&this.logger[B](`${F}: option ${$}. ${K[T]}`)}}function E(K){return K=(0,c.normalizeId)(K),this.schemas[K]||this.refs[K]}function O(){const K=this.opts.schemas;if(K)if(Array.isArray(K))this.addSchema(K);else for(const C in K)this.addSchema(K[C],C)}function P(){for(const K in this.opts.formats){const C=this.opts.formats[K];C&&this.addFormat(K,C)}}function q(K){if(Array.isArray(K)){this.addVocabulary(K);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const C in K){const F=K[C];F.keyword||(F.keyword=C),this.addKeyword(F)}}function H(){const K={...this.opts};for(const C of b)delete K[C];return K}const G={log(){},warn(){},error(){}};function Y(K){if(K===!1)return G;if(K===void 0)return console;if(K.log&&K.warn&&K.error)return K;throw new Error("logger must implement log, warn and error methods")}const ie=/^[a-z_$][a-z0-9_$:-]*$/i;function he(K,C){const{RULES:F}=this;if((0,d.eachItem)(K,B=>{if(F.keywords[B])throw new Error(`Keyword ${B} is already defined`);if(!ie.test(B))throw new Error(`Keyword ${B} has invalid name`)}),!!C&&C.$data&&!("code"in C||"validate"in C))throw new Error('$data keyword must have "code" or "validate" function')}function U(K,C,F){var B;const $=C?.post;if(F&&$)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:T}=this;let M=$?T.post:T.rules.find(({type:X})=>X===F);if(M||(M={type:F,rules:[]},T.rules.push(M)),T.keywords[K]=!0,!C)return;const Q={keyword:K,definition:{...C,type:(0,u.getJSONTypes)(C.type),schemaType:(0,u.getJSONTypes)(C.schemaType)}};C.before?W.call(this,M,Q,C.before):M.rules.push(Q),T.all[K]=Q,(B=C.implements)===null||B===void 0||B.forEach(X=>this.addKeyword(X))}function W(K,C,F){const B=K.rules.findIndex($=>$.keyword===F);B>=0?K.rules.splice(B,0,C):(K.rules.push(C),this.logger.warn(`rule ${F} is not defined`))}function se(K){let{metaSchema:C}=K;C!==void 0&&(K.$data&&this.opts.$data&&(C=ue(C)),K.validateSchema=this.compile(C,!0))}const re={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ue(K){return{anyOf:[K,re]}}})(Ps)),Ps}var or={},ar={},cr={},Go;function a0(){if(Go)return cr;Go=1,Object.defineProperty(cr,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return cr.default=t,cr}var $t={},Wo;function c0(){if(Wo)return $t;Wo=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.callRef=$t.getValidate=void 0;const t=bs(),e=ht(),n=ge(),r=Pt(),s=Ci(),i=be(),o={keyword:"$ref",schemaType:"string",code(u){const{gen:d,schema:p,it:h}=u,{baseId:m,schemaEnv:b,validateName:w,opts:g,self:k}=h,{root:y}=b;if((p==="#"||p==="#/")&&m===y.baseId)return I();const _=s.resolveRef.call(k,y,m,p);if(_===void 0)throw new t.default(h.opts.uriResolver,m,p);if(_ instanceof s.SchemaEnv)return v(_);return E(_);function I(){if(b===y)return c(u,w,b,b.$async);const O=d.scopeValue("root",{ref:y});return c(u,(0,n._)`${O}.validate`,y,y.$async)}function v(O){const P=a(u,O);c(u,P,O,O.$async)}function E(O){const P=d.scopeValue("schema",g.code.source===!0?{ref:O,code:(0,n.stringify)(O)}:{ref:O}),q=d.name("valid"),H=u.subschema({schema:O,dataTypes:[],schemaPath:n.nil,topSchemaRef:P,errSchemaPath:p},q);u.mergeEvaluated(H),u.ok(q)}}};function a(u,d){const{gen:p}=u;return d.validate?p.scopeValue("validate",{ref:d.validate}):(0,n._)`${p.scopeValue("wrapper",{ref:d})}.validate`}$t.getValidate=a;function c(u,d,p,h){const{gen:m,it:b}=u,{allErrors:w,schemaEnv:g,opts:k}=b,y=k.passContext?r.default.this:n.nil;h?_():I();function _(){if(!g.$async)throw new Error("async schema referenced by sync schema");const O=m.let("valid");m.try(()=>{m.code((0,n._)`await ${(0,e.callValidateCode)(u,d,y)}`),E(d),w||m.assign(O,!0)},P=>{m.if((0,n._)`!(${P} instanceof ${b.ValidationError})`,()=>m.throw(P)),v(P),w||m.assign(O,!1)}),u.ok(O)}function I(){u.result((0,e.callValidateCode)(u,d,y),()=>E(d),()=>v(d))}function v(O){const P=(0,n._)`${O}.errors`;m.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${P} : ${r.default.vErrors}.concat(${P})`),m.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function E(O){var P;if(!b.opts.unevaluated)return;const q=(P=p?.validate)===null||P===void 0?void 0:P.evaluated;if(b.props!==!0)if(q&&!q.dynamicProps)q.props!==void 0&&(b.props=i.mergeEvaluated.props(m,q.props,b.props));else{const H=m.var("props",(0,n._)`${O}.evaluated.props`);b.props=i.mergeEvaluated.props(m,H,b.props,n.Name)}if(b.items!==!0)if(q&&!q.dynamicItems)q.items!==void 0&&(b.items=i.mergeEvaluated.items(m,q.items,b.items));else{const H=m.var("items",(0,n._)`${O}.evaluated.items`);b.items=i.mergeEvaluated.items(m,H,b.items,n.Name)}}}return $t.callRef=c,$t.default=o,$t}var Yo;function u0(){if(Yo)return ar;Yo=1,Object.defineProperty(ar,"__esModule",{value:!0});const t=a0(),e=c0(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,e.default];return ar.default=n,ar}var ur={},lr={},Xo;function l0(){if(Xo)return lr;Xo=1,Object.defineProperty(lr,"__esModule",{value:!0});const t=ge(),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 lr.default=s,lr}var fr={},Qo;function f0(){if(Qo)return fr;Qo=1,Object.defineProperty(fr,"__esModule",{value:!0});const t=ge(),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,u=s.let("res"),d=c?(0,t._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:(0,t._)`${u} !== parseInt(${u})`;r.fail$data((0,t._)`(${o} === 0 || (${u} = ${i}/${o}, ${d}))`)}};return fr.default=n,fr}var dr={},hr={},ea;function d0(){if(ea)return hr;ea=1,Object.defineProperty(hr,"__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 hr.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',hr}var ta;function h0(){if(ta)return dr;ta=1,Object.defineProperty(dr,"__esModule",{value:!0});const t=ge(),e=be(),n=d0(),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:u}=i,d=o==="maxLength"?t.operators.GT:t.operators.LT,p=u.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 dr.default=s,dr}var pr={},na;function p0(){if(na)return pr;na=1,Object.defineProperty(pr,"__esModule",{value:!0});const t=ht(),e=be(),n=ge(),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:u,schemaCode:d,it:p}=i,h=p.opts.unicodeRegExp?"u":"";if(c){const{regExp:m}=p.opts.code,b=m.code==="new RegExp"?(0,n._)`new RegExp`:(0,e.useFunc)(o,m),w=o.let("valid");o.try(()=>o.assign(w,(0,n._)`${b}(${d}, ${h}).test(${a})`),()=>o.assign(w,!1)),i.fail$data((0,n._)`!${w}`)}else{const m=(0,t.usePattern)(i,u);i.fail$data((0,n._)`!${m}.test(${a})`)}}};return pr.default=s,pr}var mr={},ra;function m0(){if(ra)return mr;ra=1,Object.defineProperty(mr,"__esModule",{value:!0});const t=ge(),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 mr.default=n,mr}var gr={},sa;function g0(){if(sa)return gr;sa=1,Object.defineProperty(gr,"__esModule",{value:!0});const t=ht(),e=ge(),n=be(),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:u,$data:d,it:p}=i,{opts:h}=p;if(!d&&a.length===0)return;const m=a.length>=h.loopRequired;if(p.allErrors?b():w(),h.strictRequired){const y=i.parentSchema.properties,{definedProperties:_}=i.it;for(const I of a)if(y?.[I]===void 0&&!_.has(I)){const v=p.schemaEnv.baseId+p.errSchemaPath,E=`required property "${I}" is not defined at "${v}" (strictRequired)`;(0,n.checkStrictMode)(p,E,p.opts.strictRequired)}}function b(){if(m||d)i.block$data(e.nil,g);else for(const y of a)(0,t.checkReportMissingProp)(i,y)}function w(){const y=o.let("missing");if(m||d){const _=o.let("valid",!0);i.block$data(_,()=>k(y,_)),i.ok(_)}else o.if((0,t.checkMissingProp)(i,a,y)),(0,t.reportMissingProp)(i,y),o.else()}function g(){o.forOf("prop",c,y=>{i.setParams({missingProperty:y}),o.if((0,t.noPropertyInData)(o,u,y,h.ownProperties),()=>i.error())})}function k(y,_){i.setParams({missingProperty:y}),o.forOf(y,c,()=>{o.assign(_,(0,t.propertyInData)(o,u,y,h.ownProperties)),o.if((0,e.not)(_),()=>{i.error(),o.break()})},e.nil)}}};return gr.default=s,gr}var yr={},ia;function y0(){if(ia)return yr;ia=1,Object.defineProperty(yr,"__esModule",{value:!0});const t=ge(),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 yr.default=n,yr}var wr={},vr={},oa;function xi(){if(oa)return vr;oa=1,Object.defineProperty(vr,"__esModule",{value:!0});const t=Cu();return t.code='require("ajv/dist/runtime/equal").default',vr.default=t,vr}var aa;function w0(){if(aa)return wr;aa=1,Object.defineProperty(wr,"__esModule",{value:!0});const t=ts(),e=ge(),n=be(),r=xi(),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:u,schema:d,parentSchema:p,schemaCode:h,it:m}=o;if(!u&&!d)return;const b=a.let("valid"),w=p.items?(0,t.getSchemaTypes)(p.items):[];o.block$data(b,g,(0,e._)`${h} === false`),o.ok(b);function g(){const I=a.let("i",(0,e._)`${c}.length`),v=a.let("j");o.setParams({i:I,j:v}),a.assign(b,!0),a.if((0,e._)`${I} > 1`,()=>(k()?y:_)(I,v))}function k(){return w.length>0&&!w.some(I=>I==="object"||I==="array")}function y(I,v){const E=a.name("item"),O=(0,t.checkDataTypes)(w,E,m.opts.strictNumbers,t.DataType.Wrong),P=a.const("indices",(0,e._)`{}`);a.for((0,e._)`;${I}--;`,()=>{a.let(E,(0,e._)`${c}[${I}]`),a.if(O,(0,e._)`continue`),w.length>1&&a.if((0,e._)`typeof ${E} == "string"`,(0,e._)`${E} += "_"`),a.if((0,e._)`typeof ${P}[${E}] == "number"`,()=>{a.assign(v,(0,e._)`${P}[${E}]`),o.error(),a.assign(b,!1).break()}).code((0,e._)`${P}[${E}] = ${I}`)})}function _(I,v){const E=(0,n.useFunc)(a,r.default),O=a.name("outer");a.label(O).for((0,e._)`;${I}--;`,()=>a.for((0,e._)`${v} = ${I}; ${v}--;`,()=>a.if((0,e._)`${E}(${c}[${I}], ${c}[${v}])`,()=>{o.error(),a.assign(b,!1).break(O)})))}}};return wr.default=i,wr}var br={},ca;function v0(){if(ca)return br;ca=1,Object.defineProperty(br,"__esModule",{value:!0});const t=ge(),e=be(),n=xi(),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:u,schema:d}=i;c||d&&typeof d=="object"?i.fail$data((0,t._)`!${(0,e.useFunc)(o,n.default)}(${a}, ${u})`):i.fail((0,t._)`${d} !== ${a}`)}};return br.default=s,br}var _r={},ua;function b0(){if(ua)return _r;ua=1,Object.defineProperty(_r,"__esModule",{value:!0});const t=ge(),e=be(),n=xi(),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:u,schemaCode:d,it:p}=i;if(!c&&u.length===0)throw new Error("enum must have non-empty array");const h=u.length>=p.opts.loopEnum;let m;const b=()=>m??(m=(0,e.useFunc)(o,n.default));let w;if(h||c)w=o.let("valid"),i.block$data(w,g);else{if(!Array.isArray(u))throw new Error("ajv implementation error");const y=o.const("vSchema",d);w=(0,t.or)(...u.map((_,I)=>k(y,I)))}i.pass(w);function g(){o.assign(w,!1),o.forOf("v",d,y=>o.if((0,t._)`${b()}(${a}, ${y})`,()=>o.assign(w,!0).break()))}function k(y,_){const I=u[_];return typeof I=="object"&&I!==null?(0,t._)`${b()}(${a}, ${y}[${_}])`:(0,t._)`${a} === ${I}`}}};return _r.default=s,_r}var la;function _0(){if(la)return ur;la=1,Object.defineProperty(ur,"__esModule",{value:!0});const t=l0(),e=f0(),n=h0(),r=p0(),s=m0(),i=g0(),o=y0(),a=w0(),c=v0(),u=b0(),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,u.default];return ur.default=d,ur}var kr={},Jt={},fa;function ju(){if(fa)return Jt;fa=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.validateAdditionalItems=void 0;const t=ge(),e=be(),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:u,keyword:d,it:p}=i;p.items=!0;const h=a.const("len",(0,t._)`${u}.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 b=a.var("valid",(0,t._)`${h} <= ${o.length}`);a.if((0,t.not)(b),()=>m(b)),i.ok(b)}function m(b){a.forRange("i",o.length,h,w=>{i.subschema({keyword:d,dataProp:w,dataPropType:e.Type.Num},b),p.allErrors||a.if((0,t.not)(b),()=>a.break())})}}return Jt.validateAdditionalItems=s,Jt.default=r,Jt}var Sr={},Ht={},da;function Bu(){if(da)return Ht;da=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.validateTuple=void 0;const t=ge(),e=be(),n=ht(),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:u,data:d,keyword:p,it:h}=i;w(u),h.opts.unevaluated&&a.length&&h.items!==!0&&(h.items=e.mergeEvaluated.items(c,a.length,h.items));const m=c.name("valid"),b=c.const("len",(0,t._)`${d}.length`);a.forEach((g,k)=>{(0,e.alwaysValidSchema)(h,g)||(c.if((0,t._)`${b} > ${k}`,()=>i.subschema({keyword:p,schemaProp:k,dataProp:k},m)),i.ok(m))});function w(g){const{opts:k,errSchemaPath:y}=h,_=a.length,I=_===g.minItems&&(_===g.maxItems||g[o]===!1);if(k.strictTuples&&!I){const v=`"${p}" is ${_}-tuple, but minItems or maxItems/${o} are not specified or different at path "${y}"`;(0,e.checkStrictMode)(h,v,k.strictTuples)}}}return Ht.validateTuple=s,Ht.default=r,Ht}var ha;function k0(){if(ha)return Sr;ha=1,Object.defineProperty(Sr,"__esModule",{value:!0});const t=Bu(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,t.validateTuple)(n,"items")};return Sr.default=e,Sr}var $r={},pa;function S0(){if(pa)return $r;pa=1,Object.defineProperty($r,"__esModule",{value:!0});const t=ge(),e=be(),n=ht(),r=ju(),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:u}=o,{prefixItems:d}=c;u.items=!0,!(0,e.alwaysValidSchema)(u,a)&&(d?(0,r.validateAdditionalItems)(o,d):o.ok((0,n.validateArray)(o)))}};return $r.default=i,$r}var Er={},ma;function $0(){if(ma)return Er;ma=1,Object.defineProperty(Er,"__esModule",{value:!0});const t=ge(),e=be(),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:u}=s;let d,p;const{minContains:h,maxContains:m}=a;u.opts.next?(d=h===void 0?1:h,p=m):d=1;const b=i.const("len",(0,t._)`${c}.length`);if(s.setParams({min:d,max:p}),p===void 0&&d===0){(0,e.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(p!==void 0&&d>p){(0,e.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,e.alwaysValidSchema)(u,o)){let _=(0,t._)`${b} >= ${d}`;p!==void 0&&(_=(0,t._)`${_} && ${b} <= ${p}`),s.pass(_);return}u.items=!0;const w=i.name("valid");p===void 0&&d===1?k(w,()=>i.if(w,()=>i.break())):d===0?(i.let(w,!0),p!==void 0&&i.if((0,t._)`${c}.length > 0`,g)):(i.let(w,!1),g()),s.result(w,()=>s.reset());function g(){const _=i.name("_valid"),I=i.let("count",0);k(_,()=>i.if(_,()=>y(I)))}function k(_,I){i.forRange("i",0,b,v=>{s.subschema({keyword:"contains",dataProp:v,dataPropType:e.Type.Num,compositeRule:!0},_),I()})}function y(_){i.code((0,t._)`${_}++`),p===void 0?i.if((0,t._)`${_} >= ${d}`,()=>i.assign(w,!0).break()):(i.if((0,t._)`${_} > ${p}`,()=>i.assign(w,!1).break()),d===1?i.assign(w,!0):i.if((0,t._)`${_} >= ${d}`,()=>i.assign(w,!0)))}}};return Er.default=r,Er}var Ms={},ga;function E0(){return ga||(ga=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=ge(),n=be(),r=ht();t.error={message:({params:{property:c,depsCount:u,deps:d}})=>{const p=u===1?"property":"properties";return(0,e.str)`must have ${p} ${d} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:d,missingProperty:p}})=>(0,e._)`{property: ${c},
|
|
174
|
+
missingProperty: ${p},
|
|
175
|
+
depsCount: ${u},
|
|
176
|
+
deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(c){const[u,d]=i(c);o(c,u),a(c,d)}};function i({schema:c}){const u={},d={};for(const p in c){if(p==="__proto__")continue;const h=Array.isArray(c[p])?u:d;h[p]=c[p]}return[u,d]}function o(c,u=c.schema){const{gen:d,data:p,it:h}=c;if(Object.keys(u).length===0)return;const m=d.let("missing");for(const b in u){const w=u[b];if(w.length===0)continue;const g=(0,r.propertyInData)(d,p,b,h.opts.ownProperties);c.setParams({property:b,depsCount:w.length,deps:w.join(", ")}),h.allErrors?d.if(g,()=>{for(const k of w)(0,r.checkReportMissingProp)(c,k)}):(d.if((0,e._)`${g} && (${(0,r.checkMissingProp)(c,w,m)})`),(0,r.reportMissingProp)(c,m),d.else())}}t.validatePropertyDeps=o;function a(c,u=c.schema){const{gen:d,data:p,keyword:h,it:m}=c,b=d.name("valid");for(const w in u)(0,n.alwaysValidSchema)(m,u[w])||(d.if((0,r.propertyInData)(d,p,w,m.opts.ownProperties),()=>{const g=c.subschema({keyword:h,schemaProp:w},b);c.mergeValidEvaluated(g,b)},()=>d.var(b,!0)),c.ok(b))}t.validateSchemaDeps=a,t.default=s})(Ms)),Ms}var Ir={},ya;function I0(){if(ya)return Ir;ya=1,Object.defineProperty(Ir,"__esModule",{value:!0});const t=ge(),e=be(),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 u=i.name("valid");i.forIn("key",a,d=>{s.setParams({propertyName:d}),s.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},u),i.if((0,t.not)(u),()=>{s.error(!0),c.allErrors||i.break()})}),s.ok(u)}};return Ir.default=r,Ir}var Ar={},wa;function Du(){if(wa)return Ar;wa=1,Object.defineProperty(Ar,"__esModule",{value:!0});const t=ht(),e=ge(),n=Pt(),r=be(),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:u,data:d,errsCount:p,it:h}=o;if(!p)throw new Error("ajv implementation error");const{allErrors:m,opts:b}=h;if(h.props=!0,b.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(h,c))return;const w=(0,t.allSchemaProperties)(u.properties),g=(0,t.allSchemaProperties)(u.patternProperties);k(),o.ok((0,e._)`${p} === ${n.default.errors}`);function k(){a.forIn("key",d,E=>{!w.length&&!g.length?I(E):a.if(y(E),()=>I(E))})}function y(E){let O;if(w.length>8){const P=(0,r.schemaRefOrVal)(h,u.properties,"properties");O=(0,t.isOwnProperty)(a,P,E)}else w.length?O=(0,e.or)(...w.map(P=>(0,e._)`${E} === ${P}`)):O=e.nil;return g.length&&(O=(0,e.or)(O,...g.map(P=>(0,e._)`${(0,t.usePattern)(o,P)}.test(${E})`))),(0,e.not)(O)}function _(E){a.code((0,e._)`delete ${d}[${E}]`)}function I(E){if(b.removeAdditional==="all"||b.removeAdditional&&c===!1){_(E);return}if(c===!1){o.setParams({additionalProperty:E}),o.error(),m||a.break();return}if(typeof c=="object"&&!(0,r.alwaysValidSchema)(h,c)){const O=a.name("valid");b.removeAdditional==="failing"?(v(E,O,!1),a.if((0,e.not)(O),()=>{o.reset(),_(E)})):(v(E,O),m||a.if((0,e.not)(O),()=>a.break()))}}function v(E,O,P){const q={keyword:"additionalProperties",dataProp:E,dataPropType:r.Type.Str};P===!1&&Object.assign(q,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(q,O)}}};return Ar.default=i,Ar}var Or={},va;function A0(){if(va)return Or;va=1,Object.defineProperty(Or,"__esModule",{value:!0});const t=vs(),e=ht(),n=be(),r=Du(),s={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,parentSchema:c,data:u,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 g of p)d.definedProperties.add(g);d.opts.unevaluated&&p.length&&d.props!==!0&&(d.props=n.mergeEvaluated.props(o,(0,n.toHash)(p),d.props));const h=p.filter(g=>!(0,n.alwaysValidSchema)(d,a[g]));if(h.length===0)return;const m=o.name("valid");for(const g of h)b(g)?w(g):(o.if((0,e.propertyInData)(o,u,g,d.opts.ownProperties)),w(g),d.allErrors||o.else().var(m,!0),o.endIf()),i.it.definedProperties.add(g),i.ok(m);function b(g){return d.opts.useDefaults&&!d.compositeRule&&a[g].default!==void 0}function w(g){i.subschema({keyword:"properties",schemaProp:g,dataProp:g},m)}}};return Or.default=s,Or}var Tr={},ba;function O0(){if(ba)return Tr;ba=1,Object.defineProperty(Tr,"__esModule",{value:!0});const t=ht(),e=ge(),n=be(),r=be(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,data:c,parentSchema:u,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 b=p.strictSchema&&!p.allowMatchingProperties&&u.properties,w=o.name("valid");d.props!==!0&&!(d.props instanceof e.Name)&&(d.props=(0,r.evaluatedPropsToName)(o,d.props));const{props:g}=d;k();function k(){for(const I of h)b&&y(I),d.allErrors?_(I):(o.var(w,!0),_(I),o.if(w))}function y(I){for(const v in b)new RegExp(I).test(v)&&(0,n.checkStrictMode)(d,`property ${v} matches pattern ${I} (use allowMatchingProperties)`)}function _(I){o.forIn("key",c,v=>{o.if((0,e._)`${(0,t.usePattern)(i,I)}.test(${v})`,()=>{const E=m.includes(I);E||i.subschema({keyword:"patternProperties",schemaProp:I,dataProp:v,dataPropType:r.Type.Str},w),d.opts.unevaluated&&g!==!0?o.assign((0,e._)`${g}[${v}]`,!0):!E&&!d.allErrors&&o.if((0,e.not)(w),()=>o.break())})})}}};return Tr.default=s,Tr}var Nr={},_a;function T0(){if(_a)return Nr;_a=1,Object.defineProperty(Nr,"__esModule",{value:!0});const t=be(),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 Nr.default=e,Nr}var Pr={},ka;function N0(){if(ka)return Pr;ka=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ht().validateUnion,error:{message:"must match a schema in anyOf"}};return Pr.default=e,Pr}var Cr={},Sa;function P0(){if(Sa)return Cr;Sa=1,Object.defineProperty(Cr,"__esModule",{value:!0});const t=ge(),e=be(),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 u=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(){u.forEach((b,w)=>{let g;(0,e.alwaysValidSchema)(c,b)?i.var(h,!0):g=s.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},h),w>0&&i.if((0,t._)`${h} && ${d}`).assign(d,!1).assign(p,(0,t._)`[${p}, ${w}]`).else(),i.if(h,()=>{i.assign(d,!0),i.assign(p,w),g&&s.mergeEvaluated(g,t.Name)})})}}};return Cr.default=r,Cr}var xr={},$a;function C0(){if($a)return xr;$a=1,Object.defineProperty(xr,"__esModule",{value:!0});const t=be(),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 u=n.subschema({keyword:"allOf",schemaProp:c},o);n.ok(o),n.mergeEvaluated(u)})}};return xr.default=e,xr}var jr={},Ea;function x0(){if(Ea)return jr;Ea=1,Object.defineProperty(jr,"__esModule",{value:!0});const t=ge(),e=be(),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 u=s(c,"then"),d=s(c,"else");if(!u&&!d)return;const p=o.let("valid",!0),h=o.name("_valid");if(m(),i.reset(),u&&d){const w=o.let("ifClause");i.setParams({ifClause:w}),o.if(h,b("then",w),b("else",w))}else u?o.if(h,b("then")):o.if((0,t.not)(h),b("else"));i.pass(p,()=>i.error(!0));function m(){const w=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);i.mergeEvaluated(w)}function b(w,g){return()=>{const k=i.subschema({keyword:w},h);o.assign(p,h),i.mergeValidEvaluated(k,p),g?o.assign(g,(0,t._)`${w}`):i.setParams({ifClause:w})}}}};function s(i,o){const a=i.schema[o];return a!==void 0&&!(0,e.alwaysValidSchema)(i,a)}return jr.default=r,jr}var Br={},Ia;function j0(){if(Ia)return Br;Ia=1,Object.defineProperty(Br,"__esModule",{value:!0});const t=be(),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 Br.default=e,Br}var Aa;function B0(){if(Aa)return kr;Aa=1,Object.defineProperty(kr,"__esModule",{value:!0});const t=ju(),e=k0(),n=Bu(),r=S0(),s=$0(),i=E0(),o=I0(),a=Du(),c=A0(),u=O0(),d=T0(),p=N0(),h=P0(),m=C0(),b=x0(),w=j0();function g(k=!1){const y=[d.default,p.default,h.default,m.default,b.default,w.default,o.default,a.default,i.default,c.default,u.default];return k?y.push(e.default,r.default):y.push(t.default,n.default),y.push(s.default),y}return kr.default=g,kr}var Dr={},Rr={},Oa;function D0(){if(Oa)return Rr;Oa=1,Object.defineProperty(Rr,"__esModule",{value:!0});const t=ge(),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:u,it:d}=r,{opts:p,errSchemaPath:h,schemaEnv:m,self:b}=d;if(!p.validateFormats)return;a?w():g();function w(){const k=i.scopeValue("formats",{ref:b.formats,code:p.code.formats}),y=i.const("fDef",(0,t._)`${k}[${u}]`),_=i.let("fType"),I=i.let("format");i.if((0,t._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>i.assign(_,(0,t._)`${y}.type || "string"`).assign(I,(0,t._)`${y}.validate`),()=>i.assign(_,(0,t._)`"string"`).assign(I,y)),r.fail$data((0,t.or)(v(),E()));function v(){return p.strictSchema===!1?t.nil:(0,t._)`${u} && !${I}`}function E(){const O=m.$async?(0,t._)`(${y}.async ? await ${I}(${o}) : ${I}(${o}))`:(0,t._)`${I}(${o})`,P=(0,t._)`(typeof ${I} == "function" ? ${O} : ${I}.test(${o}))`;return(0,t._)`${I} && ${I} !== true && ${_} === ${s} && !${P}`}}function g(){const k=b.formats[c];if(!k){v();return}if(k===!0)return;const[y,_,I]=E(k);y===s&&r.pass(O());function v(){if(p.strictSchema===!1){b.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${c}" ignored in schema at path "${h}"`}}function E(P){const q=P instanceof RegExp?(0,t.regexpCode)(P):p.code.formats?(0,t._)`${p.code.formats}${(0,t.getProperty)(c)}`:void 0,H=i.scopeValue("formats",{key:c,ref:P,code:q});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,t._)`${H}.validate`]:["string",P,H]}function O(){if(typeof k=="object"&&!(k instanceof RegExp)&&k.async){if(!m.$async)throw new Error("async format in sync schema");return(0,t._)`await ${I}(${o})`}return typeof _=="function"?(0,t._)`${I}(${o})`:(0,t._)`${I}.test(${o})`}}}};return Rr.default=n,Rr}var Ta;function R0(){if(Ta)return Dr;Ta=1,Object.defineProperty(Dr,"__esModule",{value:!0});const e=[D0().default];return Dr.default=e,Dr}var Bt={},Na;function z0(){return Na||(Na=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 Pa;function F0(){if(Pa)return or;Pa=1,Object.defineProperty(or,"__esModule",{value:!0});const t=u0(),e=_0(),n=B0(),r=R0(),s=z0(),i=[t.default,e.default,(0,n.default)(),r.default,s.metadataVocabulary,s.contentVocabulary];return or.default=i,or}var zr={},Sn={},Ca;function M0(){if(Ca)return Sn;Ca=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.DiscrError=void 0;var t;return(function(e){e.Tag="tag",e.Mapping="mapping"})(t||(Sn.DiscrError=t={})),Sn}var xa;function U0(){if(xa)return zr;xa=1,Object.defineProperty(zr,"__esModule",{value:!0});const t=ge(),e=M0(),n=Ci(),r=bs(),s=be(),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:u}})=>(0,t._)`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){const{gen:c,data:u,schema:d,parentSchema:p,it:h}=a,{oneOf:m}=p;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=d.propertyName;if(typeof b!="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 w=c.let("valid",!1),g=c.const("tag",(0,t._)`${u}${(0,t.getProperty)(b)}`);c.if((0,t._)`typeof ${g} == "string"`,()=>k(),()=>a.error(!1,{discrError:e.DiscrError.Tag,tag:g,tagName:b})),a.ok(w);function k(){const I=_();c.if(!1);for(const v in I)c.elseIf((0,t._)`${g} === ${v}`),c.assign(w,y(I[v]));c.else(),a.error(!1,{discrError:e.DiscrError.Mapping,tag:g,tagName:b}),c.endIf()}function y(I){const v=c.name("valid"),E=a.subschema({keyword:"oneOf",schemaProp:I},v);return a.mergeEvaluated(E,t.Name),v}function _(){var I;const v={},E=P(p);let O=!0;for(let G=0;G<m.length;G++){let Y=m[G];if(Y?.$ref&&!(0,s.schemaHasRulesButRef)(Y,h.self.RULES)){const he=Y.$ref;if(Y=n.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,he),Y instanceof n.SchemaEnv&&(Y=Y.schema),Y===void 0)throw new r.default(h.opts.uriResolver,h.baseId,he)}const ie=(I=Y?.properties)===null||I===void 0?void 0:I[b];if(typeof ie!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);O=O&&(E||P(Y)),q(ie,G)}if(!O)throw new Error(`discriminator: "${b}" must be required`);return v;function P({required:G}){return Array.isArray(G)&&G.includes(b)}function q(G,Y){if(G.const)H(G.const,Y);else if(G.enum)for(const ie of G.enum)H(ie,Y);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function H(G,Y){if(typeof G!="string"||G in v)throw new Error(`discriminator: "${b}" values must be unique strings`);v[G]=Y}}}};return zr.default=o,zr}const L0="http://json-schema.org/draft-07/schema#",q0="http://json-schema.org/draft-07/schema#",V0="Core schema meta-schema",Z0={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:[]}},K0=["object","boolean"],J0={$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 H0={$schema:L0,$id:q0,title:V0,definitions:Z0,type:K0,properties:J0,default:!0},ja;function G0(){return ja||(ja=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=o0(),r=F0(),s=U0(),i=H0,o=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(b,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 u=vs();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=ge();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=Pi();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return p.default}});var h=bs();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})})(tr,tr.exports)),tr.exports}var W0=G0();const Us=10,Ba=(t=0)=>e=>`\x1B[${e+t}m`,Da=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ra=(t=0)=>(e,n,r)=>`\x1B[${38+t};2;${e};${n};${r}m`,Te={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(Te.modifier);const Y0=Object.keys(Te.color),X0=Object.keys(Te.bgColor);[...Y0,...X0];function Q0(){const t=new Map;for(const[e,n]of Object.entries(Te)){for(const[r,s]of Object.entries(n))Te[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},n[r]=Te[r],t.set(s[0],s[1]);Object.defineProperty(Te,e,{value:n,enumerable:!1})}return Object.defineProperty(Te,"codes",{value:t,enumerable:!1}),Te.color.close="\x1B[39m",Te.bgColor.close="\x1B[49m",Te.color.ansi=Ba(),Te.color.ansi256=Da(),Te.color.ansi16m=Ra(),Te.bgColor.ansi=Ba(Us),Te.bgColor.ansi256=Da(Us),Te.bgColor.ansi16m=Ra(Us),Object.defineProperties(Te,{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=>Te.rgbToAnsi256(...Te.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)=>Te.ansi256ToAnsi(Te.rgbToAnsi256(e,n,r)),enumerable:!1},hexToAnsi:{value:e=>Te.ansi256ToAnsi(Te.hexToAnsi256(e)),enumerable:!1}}),Te}const Qe=Q0();class ew extends Oi{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 W0.Ajv({strict:!1});this.logger.debug({instanceId:e.id},"validating instance");const o=[];for(const[u,d]of Object.entries(n.args))try{const p=mg(e.args?.[u]);if(!d.required&&p===void 0)continue;i.validate(d.schema,p)||(this.logger.debug({instanceId:e.id,argumentName:u},"invalid argument"),o.push(`Invalid argument "${Qe.blueBright.open}${u}${Qe.reset.close}": `+i.errorsText()))}catch(p){this.logger.debug({instanceId:e.id,argumentName:u,error:p},"failed to validate argument"),o.push(`Failed to validate argument "${Qe.blueBright.open}${u}${Qe.reset.close}": `+(p instanceof Error?p.message:String(p)))}if(Si(n))for(const[u,d]of Object.entries(n.secrets))d.required&&!r?.secretNames?.includes(u)&&o.push(`Missing required secret "${Qe.blueBright.open}${u}${Qe.reset.close}"`);for(const[u,d]of Object.entries(s))for(const p of d)this.outputs.get(p.input.instanceId)?.status!=="ok"&&o.push(`Invalid input "${Qe.blueBright.open}${u}${Qe.reset.close}":
|
|
177
|
+
"${Qe.blueBright.open}${p.input.instanceId}${Qe.reset.close}" has validation errors`);for(const[u,d]of Object.entries(n.inputs))d.required&&(s[u]?.length||o.push(`Missing required input "${Qe.blueBright.open}${u}${Qe.reset.close}" of type "${Qe.greenBright.open}${d.type}${Qe.reset.close}"`));if(o.length===0)return{status:"ok"};const a=(o.length+1).toString().length+2;return{status:"error",errorText:o.map((u,d)=>{const p=u.split(`
|
|
178
|
+
`),h=`${d+1}. `;return p.map((m,b)=>`${b===0?h:" ".repeat(a)}${m}`).join(`\r
|
|
179
|
+
`)}).join(`\r
|
|
180
|
+
`)}}}const tw={InputResolver:dy,InputHashResolver:Vy,ValidationResolver:ew};var $n={exports:{}},Ls,za;function nw(){if(za)return Ls;za=1;function t(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}Ls=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 u=1;u<a;u++)c[u]=i(r[u]);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,b=n&&n.length||0,w=0;w<b;){if(n.charCodeAt(w)===37&&w+1<b){switch(m=m>-1?m:0,n.charCodeAt(w+1)){case 100:case 102:if(h>=d||r[h]==null)break;m<w&&(p+=n.slice(m,w)),p+=Number(r[h]),m=w+2,w++;break;case 105:if(h>=d||r[h]==null)break;m<w&&(p+=n.slice(m,w)),p+=Math.floor(Number(r[h])),m=w+2,w++;break;case 79:case 111:case 106:if(h>=d||r[h]===void 0)break;m<w&&(p+=n.slice(m,w));var g=typeof r[h];if(g==="string"){p+="'"+r[h]+"'",m=w+2,w++;break}if(g==="function"){p+=r[h].name||"<anonymous>",m=w+2,w++;break}p+=i(r[h]),m=w+2,w++;break;case 115:if(h>=d)break;m<w&&(p+=n.slice(m,w)),p+=String(r[h]),m=w+2,w++;break;case 37:m<w&&(p+=n.slice(m,w)),p+="%",m=w+2,w++,h--;break}++h}++w}return m===-1?n:(m<b&&(p+=n.slice(m)),p)}return Ls}var Fa;function rw(){if(Fa)return $n.exports;Fa=1;const t=nw();$n.exports=d;const e=he().console||{},n={mapHttpRequest:O,mapHttpResponse:O,wrapRequestSerializer:P,wrapResponseSerializer:P,wrapErrorSerializer:P,req:O,res:O,err:v,errWithCause:v};function r(U,W){return U==="silent"?1/0:W.levels.values[U]}const s=Symbol("pino.logFuncs"),i=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function a(U,W){const se={logger:W,parent:U[i]};W[i]=se}function c(U,W,se){const re={};W.forEach(ue=>{re[ue]=se[ue]?se[ue]:e[ue]||e[o[ue]||"log"]||q}),U[s]=re}function u(U,W){return Array.isArray(U)?U.filter(function(re){return re!=="!stdSerializers.err"}):U===!0?Object.keys(W):!1}function d(U){U=U||{},U.browser=U.browser||{};const W=U.browser.transmit;if(W&&typeof W.send!="function")throw Error("pino: transmit option must have a send function");const se=U.browser.write||e;U.browser.write&&(U.browser.asObject=!0);const re=U.serializers||{},ue=u(U.browser.serialize,re);let K=U.browser.serialize;Array.isArray(U.browser.serialize)&&U.browser.serialize.indexOf("!stdSerializers.err")>-1&&(K=!1);const C=Object.keys(U.customLevels||{}),F=["error","fatal","warn","info","debug","trace"].concat(C);typeof se=="function"&&F.forEach(function(oe){se[oe]=se}),(U.enabled===!1||U.browser.disabled)&&(U.level="silent");const B=U.level||"info",$=Object.create(se);$.log||($.log=q),c($,F,se),a({},$),Object.defineProperty($,"levelVal",{get:M}),Object.defineProperty($,"level",{get:Q,set:X});const T={transmit:W,serialize:ue,asObject:U.browser.asObject,asObjectBindingsOnly:U.browser.asObjectBindingsOnly,formatters:U.browser.formatters,levels:F,timestamp:E(U),messageKey:U.messageKey||"msg",onChild:U.onChild||q};$.levels=p(U),$.level=B,$.isLevelEnabled=function(oe){return this.levels.values[oe]?this.levels.values[oe]>=this.levels.values[this.level]:!1},$.setMaxListeners=$.getMaxListeners=$.emit=$.addListener=$.on=$.prependListener=$.once=$.prependOnceListener=$.removeListener=$.removeAllListeners=$.listeners=$.listenerCount=$.eventNames=$.write=$.flush=q,$.serializers=re,$._serialize=ue,$._stdErrSerialize=K,$.child=function(...oe){return pe.call(this,T,...oe)},W&&($._logEvent=I());function M(){return r(this.level,this)}function Q(){return this._level}function X(oe){if(oe!=="silent"&&!this.levels.values[oe])throw Error("unknown level "+oe);this._level=oe,b(this,T,$,"error"),b(this,T,$,"fatal"),b(this,T,$,"warn"),b(this,T,$,"info"),b(this,T,$,"debug"),b(this,T,$,"trace"),C.forEach(j=>{b(this,T,$,j)})}function pe(oe,j,D){if(!j)throw new Error("missing bindings for child Pino");D=D||{},ue&&j.serializers&&(D.serializers=j.serializers);const V=D.serializers;if(ue&&V){var J=Object.assign({},re,V),ne=U.browser.serialize===!0?Object.keys(J):ue;delete j.serializers,y([j],ne,J,this._stdErrSerialize)}function le(Ue){this._childLevel=(Ue._childLevel|0)+1,this.bindings=j,J&&(this.serializers=J,this._serialize=ne),W&&(this._logEvent=I([].concat(Ue._logEvent.bindings,j)))}le.prototype=this;const $e=new le(this);return a(this,$e),$e.child=function(...Ue){return pe.call(this,oe,...Ue)},$e.level=D.level||this.level,oe.onChild($e),$e}return $}function p(U){const W=U.customLevels||{},se=Object.assign({},d.levels.values,W),re=Object.assign({},d.levels.labels,h(W));return{values:se,labels:re}}function h(U){const W={};return Object.keys(U).forEach(function(se){W[U[se]]=se}),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:ie});function m(U){const W=[];U.bindings&&W.push(U.bindings);let se=U[i];for(;se.parent;)se=se.parent,se.logger.bindings&&W.push(se.logger.bindings);return W.reverse()}function b(U,W,se,re){if(Object.defineProperty(U,re,{value:r(U.level,se)>r(re,se)?q:se[s][re],writable:!0,enumerable:!0,configurable:!0}),U[re]===q){if(!W.transmit)return;const K=W.transmit.level||U.level,C=r(K,se);if(r(re,se)<C)return}U[re]=g(U,W,se,re);const ue=m(U);ue.length!==0&&(U[re]=w(ue,U[re]))}function w(U,W){return function(){return W.apply(this,[...U,...arguments])}}function g(U,W,se,re){return(function(ue){return function(){const C=W.timestamp(),F=new Array(arguments.length),B=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var $=0;$<F.length;$++)F[$]=arguments[$];var T=!1;if(W.serialize&&(y(F,this._serialize,this.serializers,this._stdErrSerialize),T=!0),W.asObject||W.formatters?ue.call(B,...k(this,re,F,C,W)):ue.apply(B,F),W.transmit){const M=W.transmit.level||U._level,Q=r(M,se),X=r(re,se);if(X<Q)return;_(this,{ts:C,methodLevel:re,methodValue:X,transmitValue:se.levels.values[W.transmit.level||U._level],send:W.transmit.send,val:r(U._level,se)},F,T)}}})(U[s][re])}function k(U,W,se,re,ue){const{level:K,log:C=M=>M}=ue.formatters||{},F=se.slice();let B=F[0];const $={};let T=(U._childLevel|0)+1;if(T<1&&(T=1),re&&($.time=re),K){const M=K(W,U.levels.values[W]);Object.assign($,M)}else $.level=U.levels.values[W];if(ue.asObjectBindingsOnly){if(B!==null&&typeof B=="object")for(;T--&&typeof F[0]=="object";)Object.assign($,F.shift());return[C($),...F]}else{if(B!==null&&typeof B=="object"){for(;T--&&typeof F[0]=="object";)Object.assign($,F.shift());B=F.length?t(F.shift(),F):void 0}else typeof B=="string"&&(B=t(F.shift(),F));return B!==void 0&&($[ue.messageKey]=B),[C($)]}}function y(U,W,se,re){for(const ue in U)if(re&&U[ue]instanceof Error)U[ue]=d.stdSerializers.err(U[ue]);else if(typeof U[ue]=="object"&&!Array.isArray(U[ue])&&W)for(const K in U[ue])W.indexOf(K)>-1&&K in se&&(U[ue][K]=se[K](U[ue][K]))}function _(U,W,se,re=!1){const ue=W.send,K=W.ts,C=W.methodLevel,F=W.methodValue,B=W.val,$=U._logEvent.bindings;re||y(se,U._serialize||Object.keys(U.serializers),U.serializers,U._stdErrSerialize===void 0?!0:U._stdErrSerialize),U._logEvent.ts=K,U._logEvent.messages=se.filter(function(T){return $.indexOf(T)===-1}),U._logEvent.level.label=C,U._logEvent.level.value=F,ue(C,U._logEvent,B),U._logEvent=I($)}function I(U){return{ts:0,messages:[],bindings:U||[],level:{label:"",value:0}}}function v(U){const W={type:U.constructor.name,msg:U.message,stack:U.stack};for(const se in U)W[se]===void 0&&(W[se]=U[se]);return W}function E(U){return typeof U.timestamp=="function"?U.timestamp:U.timestamp===!1?H:G}function O(){return{}}function P(U){return U}function q(){}function H(){return!1}function G(){return Date.now()}function Y(){return Math.round(Date.now()/1e3)}function ie(){return new Date(Date.now()).toISOString()}function he(){function U(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 U(self)||U(window)||U(this)||{}}}return $n.exports.default=d,$n.exports.pino=d,$n.exports}var sw=rw();const cn=(t,e)=>{t.postMessage(e)},pt=new Map,Ma=128,Ru=(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+=Ma)cn(t,{type:"outputs",resolverId:e,items:r.slice(s,s+Ma)})},Ua=(t,e,n)=>{n.flushTimer||(n.flushTimer=setTimeout(()=>{if(n.flushTimer=null,Ru(t,e,n),n.pendingDependentSets.size>0){const r=Array.from(n.pendingDependentSets.entries()).map(([s,i])=>({nodeId:s,dependents:i}));cn(t,{type:"dependent-set-batch",resolverId:e,items:r}),n.pendingDependentSets.clear()}},0))},ji=(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,ji(t,e))})},iw=async(t,e,n,r,s=!1)=>{if(pt.has(n)){console.warn(`state with id "${n}" already exists`);return}const i=sw.pino({level:"info"}).child({resolverId:n,resolverType:r}),o=(d,p)=>{const h=pt.get(n);h&&(h.pendingOutputs.set(d,{nodeId:d,output:p}),Ua(t,n,h))};let a;s&&(a=(d,p)=>{const h=pt.get(n);h&&(h.pendingDependentSets.set(d,p&&Array.from(p)),Ua(t,n,h))});const c=new tw[r](e,i,o,a);pt.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 u=pt.get(n);if(u&&(u.flushTimer&&(clearTimeout(u.flushTimer),u.flushTimer=null),Ru(t,n,u),u.pendingDependentSets.size>0)){const d=Array.from(u.pendingDependentSets.entries()).map(([p,h])=>({nodeId:p,dependents:h}));cn(t,{type:"dependent-set-batch",resolverId:n,items:d}),u.pendingDependentSets.clear()}cn(t,{type:"resolver-ready",resolverId:n})},zu=(t,e,n)=>{t.abortController.abort(),t.abortController=new AbortController,t.nodes.set(e,n),t.resolver.invalidate(e)},ow=(t,e,n,r)=>{const s=pt.get(e);if(!s)throw new Error(`Unknown state: ${e}`);zu(s,n,r),ji(t,s)},aw=(t,e,n)=>{const r=pt.get(e);if(!r)throw new Error(`Unknown state: ${e}`);zu(r,n,void 0),ji(t,r)},cw=t=>{const e=pt.get(t);e?.flushTimer&&clearTimeout(e.flushTimer),pt.delete(t)},uw=(t,e,n,r,s)=>{const i=pt.get(e);if(!i)throw new Error(`Unknown state: ${e}`);cn(t,{type:"can-add-dependency-result",resolverId:e,requestId:n,result:i.resolver.canAddDependency(r,s)})};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));iw(e,s,r.resolverId,r.resolverType,r.syncDependentMap);break}case"update-input":{ow(e,r.resolverId,r.nodeId,r.node);break}case"delete-input":{aw(e,r.resolverId,r.nodeId);break}case"dispose-resolver":{cw(r.resolverId);break}case"can-add-dependency":{uw(e,r.resolverId,r.requestId,r.nodeId,r.dependencyId);break}}},cn(e,{type:"ready"})};
|