@ht-rnd/json-schema-editor 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/main.es.js +3615 -3547
- package/dist/lib/main.umd.js +8 -8
- package/package.json +1 -1
package/dist/lib/main.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(Se,ee){typeof exports=="object"&&typeof module<"u"?ee(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ee):(Se=typeof globalThis<"u"?globalThis:Se||self,ee(Se["json-schema-editor"]={},Se.React))})(this,(function(Se,ee){"use strict";const ps=["string","integer","number","boolean","object","array"],Ja=[...ps,"ref"],Ha=["int-32","int-64"],Ga=["float","double","big-decimal"],Ba=["date","date-time","local-date-time","time","duration","email","hostname","ipv4","ipv6","password","html","json","json-path","uri","uri-refrence","uri-template","relative-json-pointer","json-pointer","regex","uuid"],yn="http://json-schema.org/draft/2020-12/schema",Wa=()=>({type:"object",$schema:yn,additionalProperties:!0}),Ya=()=>({type:"array",$schema:yn,items:{type:"string"}}),Xa=e=>({id:e,key:`field_${e}`,isRequired:!1,schema:{type:"string"}}),Qa="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Qe=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Qa[r[e]&63];return t};const ec=e=>e?e.includes("draft-04")?"draft04":e.includes("draft-07")||e.includes("draft-06")?"legacy":"modern":"modern",tc=["enumEnabled","enumInput","isModifiable"],rc=(e,t)=>{const r={...e};if(r.enumEnabled&&Array.isArray(r.enumInput)&&r.enumInput.length>0){let n=r.enumInput;r.type==="number"?n=r.enumInput.map(Number).filter(s=>!Number.isNaN(s)):r.type==="integer"&&(n=r.enumInput.map(Number).filter(s=>Number.isInteger(s))),n.length>0&&(r.enum=n)}r.exclusiveMin!=null&&(t==="draft04"?(r.minimum=r.exclusiveMin,r.exclusiveMinimum=!0):r.exclusiveMinimum=r.exclusiveMin,delete r.exclusiveMin),r.exclusiveMax!=null&&(t==="draft04"?(r.maximum=r.exclusiveMax,r.exclusiveMaximum=!0):r.exclusiveMaximum=r.exclusiveMax,delete r.exclusiveMax),(r.format==="none"||r.format==="")&&delete r.format;for(const n of tc)delete r[n];return r},vn=e=>{const t=a=>{if(a==null||a==="")return;if(typeof a!="object"||a instanceof Date)return a;if(Array.isArray(a))return a.map(t).filter(u=>u!==void 0);const c={};for(const u in a){const m=t(a[u]);m!==void 0&&(c[u]=m)}return c},r=ec(e.root.$schema),n=(a,c)=>{if(a.type==="ref"&&a.$ref)return t({$ref:a.$ref,...a.title&&{title:a.title},...a.description&&{description:a.description}});const u=rc({...a},c);if(u.type==="ref"&&delete u.type,Array.isArray(u.properties)){const m={},v=[];u.properties.forEach(l=>{l.key&&(m[l.key]=n(l.schema,c),l.isRequired&&v.push(l.key))}),u.properties=m,v.length>0&&(u.required=v)}return typeof u.items=="object"&&u.items!==null&&!Array.isArray(u.items)?u.items=n(u.items,c):Array.isArray(u.items)&&(u.items=u.items.map(m=>n(m,c))),t(u)},s={...n(e.root,r)},o={},i=[];if(e.properties.forEach(a=>{a.key&&(o[a.key]=n(a.schema,r),a.isRequired&&i.push(a.key))}),Object.keys(o).length>0&&(s.properties=o),i.length>0&&(s.required=i),e.definitions&&e.definitions.length>0){const a={};e.definitions.forEach(c=>{c.key&&(a[c.key]=n(c.schema,r))}),r!=="modern"?s.definitions=a:s.$defs=a}return s},ys=e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};for(const r of["properties","$defs","definitions"])t[r]===null?delete t[r]:t[r]&&typeof t[r]=="object"&&!Array.isArray(t[r])&&(t[r]=Object.fromEntries(Object.entries(t[r]).map(([n,s])=>[n,ys(s)])));return t.items===null&&delete t.items,t},vs=e=>{e=ys(e);const t=v=>{const l={...v};if(l.$ref&&(l.type="ref"),Array.isArray(l.enum)&&l.enum.length>0&&(l.enumEnabled=!0,l.enumInput=l.enum.map(h=>String(h))),l.exclusiveMinimum!=null&&(typeof l.exclusiveMinimum=="boolean"?l.exclusiveMinimum===!0&&l.minimum!=null&&(l.exclusiveMin=l.minimum,delete l.minimum):l.exclusiveMin=l.exclusiveMinimum,delete l.exclusiveMinimum),l.exclusiveMaximum!=null&&(typeof l.exclusiveMaximum=="boolean"?l.exclusiveMaximum===!0&&l.maximum!=null&&(l.exclusiveMax=l.maximum,delete l.maximum):l.exclusiveMax=l.exclusiveMaximum,delete l.exclusiveMaximum),typeof l.properties=="object"&&!Array.isArray(l.properties)){const h=[];Object.keys(l.properties).forEach(w=>{const S=l.properties[w];h.push({id:Qe(6),key:w,isRequired:l.required?.includes(w)||!1,schema:t(S)})}),l.properties=h}return typeof l.items=="object"&&l.items!==null&&!Array.isArray(l.items)?l.items=t(l.items):Array.isArray(l.items)&&(l.items=l.items.map(h=>t(h))),l},{properties:r,required:n,$defs:s,definitions:o,...i}=e,a=s??o,c=t(i),u=[];r&&Object.keys(r).forEach(v=>{u.push({id:Qe(6),key:v,isRequired:n?.includes(v)||!1,schema:t(r[v])})});const m=[];return a&&Object.keys(a).forEach(v=>{m.push({id:Qe(6),key:v,schema:t(a[v])})}),{root:c,properties:u,definitions:m}};function D(e,t,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,m=Object.keys(u);for(let v=0;v<m.length;v++){const l=m[v];l in a||(a[l]=u[l].bind(a))}}const s=r?.Parent??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(a){var c;const u=r?.Parent?new o:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const m of u._zod.deferred)m();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class _t extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gs extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const _s={};function st(e){return _s}function $s(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function gn(e,t){return typeof t=="bigint"?t.toString():t}function _n(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function $n(e){return e==null}function bn(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function nc(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let s=(n.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(n)){const c=n.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const o=r>s?r:s,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}const bs=Symbol("evaluating");function de(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==bs)return n===void 0&&(n=bs,n=r()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function mt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ot(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function ws(e){return JSON.stringify(e)}function sc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ss="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const oc=_n(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function $t(e){if(xt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(xt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Es(e){return $t(e)?{...e}:Array.isArray(e)?[...e]:e}const ic=new Set(["string","number","symbol"]);function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function te(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function ac(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const cc={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 uc(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=ot(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return mt(this,"shape",i),i},checks:[]});return it(e,o)}function dc(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=ot(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return mt(this,"shape",i),i},checks:[]});return it(e,o)}function lc(e,t){if(!$t(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=ot(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return mt(this,"shape",o),o}});return it(e,s)}function fc(e,t){if(!$t(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=ot(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return mt(this,"shape",n),n}});return it(e,r)}function mc(e,t){const r=ot(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return mt(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return it(e,r)}function hc(e,t,r){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=ot(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(r)for(const u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return mt(this,"shape",c),c},checks:[]});return it(t,i)}function pc(e,t,r){const n=ot(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(r)for(const i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return mt(this,"shape",o),o}});return it(t,n)}function bt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function wt(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Kt(e){return typeof e=="string"?e:e?.message}function at(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const s=Kt(e.inst?._zod.def?.error?.(e))??Kt(t?.error?.(e))??Kt(r.customError?.(e))??Kt(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function wn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tt(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const ks=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,gn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Sn=D("$ZodError",ks),Jt=D("$ZodError",ks,{Parent:Error});function yc(e,t=r=>r.message){const r={},n=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function vc(e,t=r=>r.message){const r={_errors:[]},n=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>n({issues:i}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let i=r,a=0;for(;a<o.path.length;){const c=o.path[a];a===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return n(e),r}const Ht=e=>(t,r,n,s)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new _t;if(i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>at(c,o,st())));throw Ss(a,s?.callee),a}return i.value},gc=Ht(Jt),Gt=e=>async(t,r,n,s)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>at(c,o,st())));throw Ss(a,s?.callee),a}return i.value},_c=Gt(Jt),Bt=e=>(t,r,n)=>{const s=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},s);if(o instanceof Promise)throw new _t;return o.issues.length?{success:!1,error:new(e??Sn)(o.issues.map(i=>at(i,s,st())))}:{success:!0,data:o.value}},$c=Bt(Jt),Wt=e=>async(t,r,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>at(i,s,st())))}:{success:!0,data:o.value}},bc=Wt(Jt),wc=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ht(e)(t,r,s)},Sc=e=>(t,r,n)=>Ht(e)(t,r,n),Ec=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Gt(e)(t,r,s)},kc=e=>async(t,r,n)=>Gt(e)(t,r,n),Pc=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Bt(e)(t,r,s)},Oc=e=>(t,r,n)=>Bt(e)(t,r,n),jc=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Wt(e)(t,r,s)},Ac=e=>async(t,r,n)=>Wt(e)(t,r,n),Nc=/^[cC][^\s-]{8,}$/,zc=/^[0-9a-z]+$/,Rc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ic=/^[0-9a-vA-V]{20}$/,Tc=/^[A-Za-z0-9]{27}$/,Cc=/^[a-zA-Z0-9_-]{21}$/,Mc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dc=/^([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})$/,Ps=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Vc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Fc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qc(){return new RegExp(Fc,"u")}const Zc=/^(?:(?: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])$/,Uc=/^(([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}|:))$/,xc=/^((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])$/,Lc=/^(([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])$/,Kc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Os=/^[A-Za-z0-9_-]*$/,Jc=/^\+[1-9]\d{6,14}$/,js="(?:(?:\\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])))",Hc=new RegExp(`^${js}$`);function As(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Gc(e){return new RegExp(`^${As(e)}$`)}function Bc(e){const t=As({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${js}T(?:${n})$`)}const Wc=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Yc=/^-?\d+$/,Ns=/^-?\d+(?:\.\d+)?$/,Xc=/^(?:true|false)$/i,Qc=/^[^A-Z]*$/,eu=/^[^a-z]*$/,De=D("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),zs={number:"number",bigint:"bigint",object:"date"},Rs=D("$ZodCheckLessThan",(e,t)=>{De.init(e,t);const r=zs[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Is=D("$ZodCheckGreaterThan",(e,t)=>{De.init(e,t);const r=zs[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tu=D("$ZodCheckMultipleOf",(e,t)=>{De.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):nc(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ru=D("$ZodCheckNumberFormat",(e,t)=>{De.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[s,o]=cc[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=s,a.maximum=o,r&&(a.pattern=Yc)}),e._zod.check=i=>{const a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<s&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>o&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),nu=D("$ZodCheckMaxLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!$n(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const i=wn(s);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),su=D("$ZodCheckMinLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!$n(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const i=wn(s);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ou=D("$ZodCheckLengthEquals",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!$n(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,o=s.length;if(o===t.length)return;const i=wn(s),a=o>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Yt=D("$ZodCheckStringFormat",(e,t)=>{var r,n;De.init(e,t),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),iu=D("$ZodCheckRegex",(e,t)=>{Yt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),au=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Qc),Yt.init(e,t)}),cu=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=eu),Yt.init(e,t)}),uu=D("$ZodCheckIncludes",(e,t)=>{De.init(e,t);const r=Lt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),du=D("$ZodCheckStartsWith",(e,t)=>{De.init(e,t);const r=new RegExp(`^${Lt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),lu=D("$ZodCheckEndsWith",(e,t)=>{De.init(e,t);const r=new RegExp(`.*${Lt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),fu=D("$ZodCheckOverwrite",(e,t)=>{De.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class mu{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
1
|
+
(function(Se,ee){typeof exports=="object"&&typeof module<"u"?ee(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ee):(Se=typeof globalThis<"u"?globalThis:Se||self,ee(Se["json-schema-editor"]={},Se.React))})(this,(function(Se,ee){"use strict";const gs=["string","integer","number","boolean","object","array"],Wa=[...gs,"ref"],Ya=["int-32","int-64"],Xa=["float","double","big-decimal"],Qa=["date","date-time","local-date-time","time","duration","email","hostname","ipv4","ipv6","password","html","json","json-path","uri","uri-refrence","uri-template","relative-json-pointer","json-pointer","regex","uuid"],gn="http://json-schema.org/draft/2020-12/schema",ec=()=>({type:"object",$schema:gn,additionalProperties:!0}),tc=()=>({type:"array",$schema:gn,items:{type:"string"}}),rc=e=>({id:e,key:`field_${e}`,isRequired:!1,schema:{type:"string"}});let nc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",et=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=nc[r[e]&63];return t};const sc=e=>e?e.includes("draft-04")?"draft04":e.includes("draft-07")||e.includes("draft-06")?"legacy":"modern":"modern",oc=["enumEnabled","enumInput","isModifiable"],ic=(e,t)=>{const r={...e};if(r.enumEnabled&&Array.isArray(r.enumInput)&&r.enumInput.length>0){let n=r.enumInput;r.type==="number"?n=r.enumInput.map(Number).filter(s=>!Number.isNaN(s)):r.type==="integer"&&(n=r.enumInput.map(Number).filter(s=>Number.isInteger(s))),n.length>0&&(r.enum=n)}r.exclusiveMin!=null&&(t==="draft04"?(r.minimum=r.exclusiveMin,r.exclusiveMinimum=!0):r.exclusiveMinimum=r.exclusiveMin,delete r.exclusiveMin),r.exclusiveMax!=null&&(t==="draft04"?(r.maximum=r.exclusiveMax,r.exclusiveMaximum=!0):r.exclusiveMaximum=r.exclusiveMax,delete r.exclusiveMax),(r.format==="none"||r.format==="")&&delete r.format;for(const n of oc)delete r[n];return r},_n=e=>{const t=a=>{if(a==null||a==="")return;if(typeof a!="object"||a instanceof Date)return a;if(Array.isArray(a))return a.map(t).filter(u=>u!==void 0);const c={};for(const u in a){const m=t(a[u]);m!==void 0&&(c[u]=m)}return c},r=sc(e.root.$schema),n=(a,c)=>{if(a.type==="ref"&&a.$ref)return t({$ref:a.$ref,...a.title&&{title:a.title},...a.description&&{description:a.description}});const u=ic({...a},c);if(u.type==="ref"&&delete u.type,u.type==="object"){const m={},y=[];Array.isArray(u.properties)&&u.properties.forEach(f=>{f.key&&(m[f.key]=n(f.schema,c),f.isRequired&&y.push(f.key))}),u.properties=m,y.length>0&&(u.required=y)}else delete u.properties;return u.type==="array"?typeof u.items=="object"&&u.items!==null&&!Array.isArray(u.items)?u.items=n(u.items,c):Array.isArray(u.items)?u.items=u.items.map(m=>n(m,c)):u.items={}:delete u.items,t(u)},s={...n(e.root,r)},o={},i=[];if(e.properties.forEach(a=>{a.key&&(o[a.key]=n(a.schema,r),a.isRequired&&i.push(a.key))}),(s.type==="object"||Object.keys(o).length>0)&&(s.properties=o),s.type==="array"&&!s.items&&(s.items={}),i.length>0&&(s.required=i),e.definitions&&e.definitions.length>0){const a={};e.definitions.forEach(c=>{c.key&&(a[c.key]=n(c.schema,r))}),r!=="modern"?s.definitions=a:s.$defs=a}return s},_s=e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;const t={...e};for(const r of["properties","$defs","definitions"])t[r]===null?delete t[r]:t[r]&&typeof t[r]=="object"&&!Array.isArray(t[r])&&(t[r]=Object.fromEntries(Object.entries(t[r]).map(([n,s])=>[n,_s(s)])));return t.items===null&&delete t.items,t},$s=e=>{e=_s(e);const t=y=>{const f={...y};if(f.$ref&&(f.type="ref"),Array.isArray(f.enum)&&f.enum.length>0&&(f.enumEnabled=!0,f.enumInput=f.enum.map(h=>String(h))),f.exclusiveMinimum!=null&&(typeof f.exclusiveMinimum=="boolean"?f.exclusiveMinimum===!0&&f.minimum!=null&&(f.exclusiveMin=f.minimum,delete f.minimum):f.exclusiveMin=f.exclusiveMinimum,delete f.exclusiveMinimum),f.exclusiveMaximum!=null&&(typeof f.exclusiveMaximum=="boolean"?f.exclusiveMaximum===!0&&f.maximum!=null&&(f.exclusiveMax=f.maximum,delete f.maximum):f.exclusiveMax=f.exclusiveMaximum,delete f.exclusiveMaximum),typeof f.properties=="object"&&!Array.isArray(f.properties)){const h=[];Object.keys(f.properties).forEach(w=>{const S=f.properties[w];h.push({id:et(6),key:w,isRequired:f.required?.includes(w)||!1,schema:t(S)})}),f.properties=h}return typeof f.items=="object"&&f.items!==null&&!Array.isArray(f.items)?f.items=t(f.items):Array.isArray(f.items)&&(f.items=f.items.map(h=>t(h))),f},{properties:r,required:n,$defs:s,definitions:o,...i}=e,a=s??o,c=t(i),u=[];r&&Object.keys(r).forEach(y=>{u.push({id:et(6),key:y,isRequired:n?.includes(y)||!1,schema:t(r[y])})}),u.length===0&&(i.type==="object"||!i.type)&&u.push({id:et(6),key:"",isRequired:!1,schema:{type:"string"}});const m=[];return a&&Object.keys(a).forEach(y=>{m.push({id:et(6),key:y,schema:t(a[y])})}),{root:c,properties:u,definitions:m}};function M(e,t,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const u=i.prototype,m=Object.keys(u);for(let y=0;y<m.length;y++){const f=m[y];f in a||(a[f]=u[f].bind(a))}}const s=r?.Parent??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(a){var c;const u=r?.Parent?new o:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const m of u._zod.deferred)m();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class $t extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class bs extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const ws={};function at(e){return ws}function Ss(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function $n(e,t){return typeof t=="bigint"?t.toString():t}function bn(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function wn(e){return e==null}function Sn(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function ac(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let s=(n.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(n)){const c=n.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const o=r>s?r:s,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}const Es=Symbol("evaluating");function le(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Es)return n===void 0&&(n=Es,n=r()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function pt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ct(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function ks(e){return JSON.stringify(e)}function cc(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ps="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Kt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const uc=bn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function bt(e){if(Kt(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(Kt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Os(e){return bt(e)?{...e}:Array.isArray(e)?[...e]:e}const dc=new Set(["string","number","symbol"]);function Jt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ut(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function te(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function lc(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const fc={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 mc(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=ct(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=r.shape[a])}return pt(this,"shape",i),i},checks:[]});return ut(e,o)}function hc(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=ct(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return pt(this,"shape",i),i},checks:[]});return ut(e,o)}function pc(e,t){if(!bt(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=ct(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return pt(this,"shape",o),o}});return ut(e,s)}function yc(e,t){if(!bt(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=ct(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return pt(this,"shape",n),n}});return ut(e,r)}function vc(e,t){const r=ct(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return pt(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ut(e,r)}function gc(e,t,r){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=ct(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(r)for(const u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return pt(this,"shape",c),c},checks:[]});return ut(t,i)}function _c(e,t,r){const n=ct(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(r)for(const i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return pt(this,"shape",o),o}});return ut(t,n)}function wt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function St(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Gt(e){return typeof e=="string"?e:e?.message}function dt(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const s=Gt(e.inst?._zod.def?.error?.(e))??Gt(t?.error?.(e))??Gt(r.customError?.(e))??Gt(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function En(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Mt(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const js=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,$n,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kn=M("$ZodError",js),Ht=M("$ZodError",js,{Parent:Error});function $c(e,t=r=>r.message){const r={},n=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function bc(e,t=r=>r.message){const r={_errors:[]},n=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>n({issues:i}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let i=r,a=0;for(;a<o.path.length;){const c=o.path[a];a===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o))):i[c]=i[c]||{_errors:[]},i=i[c],a++}}};return n(e),r}const Bt=e=>(t,r,n,s)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new $t;if(i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>dt(c,o,at())));throw Ps(a,s?.callee),a}return i.value},wc=Bt(Ht),Wt=e=>async(t,r,n,s)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(s?.Err??e)(i.issues.map(c=>dt(c,o,at())));throw Ps(a,s?.callee),a}return i.value},Sc=Wt(Ht),Yt=e=>(t,r,n)=>{const s=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},s);if(o instanceof Promise)throw new $t;return o.issues.length?{success:!1,error:new(e??kn)(o.issues.map(i=>dt(i,s,at())))}:{success:!0,data:o.value}},Ec=Yt(Ht),Xt=e=>async(t,r,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>dt(i,s,at())))}:{success:!0,data:o.value}},kc=Xt(Ht),Pc=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Bt(e)(t,r,s)},Oc=e=>(t,r,n)=>Bt(e)(t,r,n),jc=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Wt(e)(t,r,s)},Ac=e=>async(t,r,n)=>Wt(e)(t,r,n),Nc=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yt(e)(t,r,s)},zc=e=>(t,r,n)=>Yt(e)(t,r,n),Rc=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Xt(e)(t,r,s)},Ic=e=>async(t,r,n)=>Xt(e)(t,r,n),Tc=/^[cC][^\s-]{8,}$/,Cc=/^[0-9a-z]+$/,Mc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Dc=/^[0-9a-vA-V]{20}$/,Vc=/^[A-Za-z0-9]{27}$/,Fc=/^[a-zA-Z0-9_-]{21}$/,qc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Zc=/^([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})$/,As=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Uc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,xc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Lc(){return new RegExp(xc,"u")}const Kc=/^(?:(?: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])$/,Jc=/^(([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}|:))$/,Gc=/^((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])$/,Hc=/^(([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])$/,Bc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ns=/^[A-Za-z0-9_-]*$/,Wc=/^\+[1-9]\d{6,14}$/,zs="(?:(?:\\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])))",Yc=new RegExp(`^${zs}$`);function Rs(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Xc(e){return new RegExp(`^${Rs(e)}$`)}function Qc(e){const t=Rs({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${zs}T(?:${n})$`)}const eu=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},tu=/^-?\d+$/,Is=/^-?\d+(?:\.\d+)?$/,ru=/^(?:true|false)$/i,nu=/^[^A-Z]*$/,su=/^[^a-z]*$/,Ve=M("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Ts={number:"number",bigint:"bigint",object:"date"},Cs=M("$ZodCheckLessThan",(e,t)=>{Ve.init(e,t);const r=Ts[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,o=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ms=M("$ZodCheckGreaterThan",(e,t)=>{Ve.init(e,t);const r=Ts[typeof t.value];e._zod.onattach.push(n=>{const s=n._zod.bag,o=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ou=M("$ZodCheckMultipleOf",(e,t)=>{Ve.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):ac(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),iu=M("$ZodCheckNumberFormat",(e,t)=>{Ve.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),n=r?"int":"number",[s,o]=fc[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=s,a.maximum=o,r&&(a.pattern=tu)}),e._zod.check=i=>{const a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<s&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>o&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),au=M("$ZodCheckMaxLength",(e,t)=>{var r;Ve.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!wn(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const i=En(s);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),cu=M("$ZodCheckMinLength",(e,t)=>{var r;Ve.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!wn(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const i=En(s);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),uu=M("$ZodCheckLengthEquals",(e,t)=>{var r;Ve.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!wn(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,o=s.length;if(o===t.length)return;const i=En(s),a=o>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Qt=M("$ZodCheckStringFormat",(e,t)=>{var r,n;Ve.init(e,t),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),du=M("$ZodCheckRegex",(e,t)=>{Qt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),lu=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=nu),Qt.init(e,t)}),fu=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=su),Qt.init(e,t)}),mu=M("$ZodCheckIncludes",(e,t)=>{Ve.init(e,t);const r=Jt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),hu=M("$ZodCheckStartsWith",(e,t)=>{Ve.init(e,t);const r=new RegExp(`^${Jt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),pu=M("$ZodCheckEndsWith",(e,t)=>{Ve.init(e,t);const r=new RegExp(`.*${Jt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),yu=M("$ZodCheckOverwrite",(e,t)=>{Ve.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class vu{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(`
|
|
2
2
|
`).filter(i=>i),s=Math.min(...n.map(i=>i.length-i.trimStart().length)),o=n.map(i=>i.slice(s)).map(i=>" ".repeat(this.indent*2)+i);for(const i of o)this.content.push(i)}compile(){const t=Function,r=this?.args,s=[...(this?.content??[""]).map(o=>` ${o}`)];return new t(...r,s.join(`
|
|
3
|
-
`))}}const
|
|
3
|
+
`))}}const gu={major:4,minor:3,patch:6},_e=M("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gu;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const o of s._zod.onattach)o(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(i,a,c)=>{let u=wt(i),m;for(const y of a){if(y._zod.def.when){if(!y._zod.def.when(i))continue}else if(u)continue;const f=i.issues.length,h=y._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new $t;if(m||h instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await h,i.issues.length!==f&&(u||(u=wt(i,f)))});else{if(i.issues.length===f)continue;u||(u=wt(i,f))}}return m?m.then(()=>i):i},o=(i,a,c)=>{if(wt(i))return i.aborted=!0,i;const u=s(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new $t;return u.then(m=>e._zod.parse(m,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(m=>o(m,i,a)):o(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new $t;return c.then(u=>s(u,n,a))}return s(c,n,a)}}le(e,"~standard",()=>({validate:s=>{try{const o=Ec(e,s);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return kc(e,s).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Pn=M("$ZodString",(e,t)=>{_e.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??eu(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),$e=M("$ZodStringFormat",(e,t)=>{Qt.init(e,t),Pn.init(e,t)}),_u=M("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Zc),$e.init(e,t)}),$u=M("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=As(n))}else t.pattern??(t.pattern=As());$e.init(e,t)}),bu=M("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Uc),$e.init(e,t)}),wu=M("$ZodURL",(e,t)=>{$e.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),s=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=s.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Su=M("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Lc()),$e.init(e,t)}),Eu=M("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Fc),$e.init(e,t)}),ku=M("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Tc),$e.init(e,t)}),Pu=M("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Cc),$e.init(e,t)}),Ou=M("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Mc),$e.init(e,t)}),ju=M("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Dc),$e.init(e,t)}),Au=M("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Vc),$e.init(e,t)}),Nu=M("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Qc(t)),$e.init(e,t)}),zu=M("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Yc),$e.init(e,t)}),Ru=M("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Xc(t)),$e.init(e,t)}),Iu=M("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=qc),$e.init(e,t)}),Tu=M("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Kc),$e.init(e,t),e._zod.bag.format="ipv4"}),Cu=M("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Jc),$e.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Mu=M("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Gc),$e.init(e,t)}),Du=M("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Hc),$e.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[s,o]=n;if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${s}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Ds(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Vu=M("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Bc),$e.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Ds(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Fu(e){if(!Ns.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ds(r)}const qu=M("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ns),$e.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Fu(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Zu=M("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Wc),$e.init(e,t)});function Uu(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const s=JSON.parse(atob(n));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const xu=M("$ZodJWT",(e,t)=>{$e.init(e,t),e._zod.check=r=>{Uu(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Vs=M("$ZodNumber",(e,t)=>{_e.init(e,t),e._zod.pattern=e._zod.bag.pattern??Is,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const s=r.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return r;const o=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...o?{received:o}:{}}),r}}),Lu=M("$ZodNumberFormat",(e,t)=>{iu.init(e,t),Vs.init(e,t)}),Ku=M("$ZodBoolean",(e,t)=>{_e.init(e,t),e._zod.pattern=ru,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const s=r.value;return typeof s=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),r}}),Ju=M("$ZodAny",(e,t)=>{_e.init(e,t),e._zod.parse=r=>r}),Gu=M("$ZodUnknown",(e,t)=>{_e.init(e,t),e._zod.parse=r=>r}),Hu=M("$ZodNever",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Fs(e,t,r){e.issues.length&&t.issues.push(...St(r,e.issues)),t.value[r]=e.value}const Bu=M("$ZodArray",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);const o=[];for(let i=0;i<s.length;i++){const a=s[i],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?o.push(c.then(u=>Fs(u,r,i))):Fs(c,r,i)}return o.length?Promise.all(o).then(()=>r):r}});function er(e,t,r,n,s){if(e.issues.length){if(s&&!(r in n))return;t.issues.push(...St(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function qs(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const r=lc(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Zs(e,t,r,n,s,o){const i=[],a=s.keySet,c=s.catchall._zod,u=c.def.type,m=c.optout==="optional";for(const y in t){if(a.has(y))continue;if(u==="never"){i.push(y);continue}const f=c.run({value:t[y],issues:[]},n);f instanceof Promise?e.push(f.then(h=>er(h,r,y,t,m))):er(f,r,y,t,m)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const Wu=M("$ZodObject",(e,t)=>{if(_e.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const n=bn(()=>qs(t));le(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const m=a[u]._zod;if(m.values){c[u]??(c[u]=new Set);for(const y of m.values)c[u].add(y)}}return c});const s=Kt,o=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=n.value);const u=a.value;if(!s(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const m=[],y=i.shape;for(const f of i.keys){const h=y[f],w=h._zod.optout==="optional",S=h._zod.run({value:u[f],issues:[]},c);S instanceof Promise?m.push(S.then(p=>er(p,a,f,u,w))):er(S,a,f,u,w)}return o?Zs(m,u,a,c,n.value,e):m.length?Promise.all(m).then(()=>a):a}}),Yu=M("$ZodObjectJIT",(e,t)=>{Wu.init(e,t);const r=e._zod.parse,n=bn(()=>qs(t)),s=f=>{const h=new vu(["shape","payload","ctx"]),w=n.value,S=v=>{const g=ks(v);return`shape[${g}]._zod.run({ value: input[${g}], issues: [] }, ctx)`};h.write("const input = payload.value;");const p=Object.create(null);let _=0;for(const v of w.keys)p[v]=`key_${_++}`;h.write("const newResult = {};");for(const v of w.keys){const g=p[v],d=ks(v),E=f[v]?._zod?.optout==="optional";h.write(`const ${g} = ${S(v)};`),E?h.write(`
|
|
4
4
|
if (${g}.issues.length) {
|
|
5
5
|
if (${d} in input) {
|
|
6
6
|
payload.issues = payload.issues.concat(${g}.issues.map(iss => ({
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
newResult[${d}] = ${g}.value;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
`)}h.write("payload.value = newResult;"),h.write("return payload;");const f=h.compile();return(y,g)=>f(l,y,g)};let o;const i=xt,a=!_s.jitless,u=a&&oc.value,m=t.catchall;let v;e._zod.parse=(l,h)=>{v??(v=n.value);const w=l.value;return i(w)?a&&u&&h?.async===!1&&h.jitless!==!0?(o||(o=s(t.shape)),l=o(l,h),m?Vs([],w,l,h,v,e):l):r(l,h):(l.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),l)}});function Fs(e,t,r,n){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const s=e.filter(o=>!bt(o));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(i=>at(i,n,st())))}),t)}const Gu=D("$ZodUnion",(e,t)=>{_e.init(e,t),de(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),de(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),de(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),de(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${s.map(o=>bn(o.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,o)=>{if(r)return n(s,o);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:s.value,issues:[]},o);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>Fs(c,s,e,o)):Fs(a,s,e,o)}}),Bu=D("$ZodIntersection",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const s=r.value,o=t.left._zod.run({value:s,issues:[]},n),i=t.right._zod.run({value:s,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([c,u])=>qs(r,c,u)):qs(r,o,i)}});function kn(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if($t(e)&&$t(t)){const r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),s={...e,...t};for(const o of n){const i=kn(e[o],t[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};s[o]=i.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const s=e[n],o=t[n],i=kn(s,o);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function qs(e,t,r){const n=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(a);for(const a of r.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(a);const o=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&s&&e.issues.push({...s,keys:o}),bt(e))return e;const i=kn(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Wu=D("$ZodRecord",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!$t(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;const o=[],i=t.keyType._zod.values;if(i){r.value={};const a=new Set;for(const u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const m=t.valueType._zod.run({value:s[u],issues:[]},n);m instanceof Promise?o.push(m.then(v=>{v.issues.length&&r.issues.push(...wt(u,v.issues)),r.value[u]=v.value})):(m.issues.length&&r.issues.push(...wt(u,m.issues)),r.value[u]=m.value)}let c;for(const u in s)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c})}else{r.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Ns.test(a)&&c.issues.length){const v=t.keyType._zod.run({value:Number(a),issues:[]},n);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(c=v)}if(c.issues.length){t.mode==="loose"?r.value[a]=s[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(v=>at(v,n,st())),input:a,path:[a],inst:e});continue}const m=t.valueType._zod.run({value:s[a],issues:[]},n);m instanceof Promise?o.push(m.then(v=>{v.issues.length&&r.issues.push(...wt(a,v.issues)),r.value[c.value]=v.value})):(m.issues.length&&r.issues.push(...wt(a,m.issues)),r.value[c.value]=m.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Yu=D("$ZodEnum",(e,t)=>{_e.init(e,t);const r=$s(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(s=>ic.has(typeof s)).map(s=>typeof s=="string"?Lt(s):s.toString()).join("|")})$`),e._zod.parse=(s,o)=>{const i=s.value;return n.has(i)||s.issues.push({code:"invalid_value",values:r,input:i,inst:e}),s}}),Xu=D("$ZodTransform",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new gs(e.constructor.name);const s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(r.value=i,r));if(s instanceof Promise)throw new _t;return r.value=s,r}});function Zs(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Us=D("$ZodOptional",(e,t)=>{_e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",de(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),de(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${bn(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Zs(o,r.value)):Zs(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Qu=D("$ZodExactOptional",(e,t)=>{Us.init(e,t),de(e._zod,"values",()=>t.innerType._zod.values),de(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),ed=D("$ZodNullable",(e,t)=>{_e.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${bn(r.source)}|null)$`):void 0}),de(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),td=D("$ZodDefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>xs(o,t)):xs(s,t)}});function xs(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const rd=D("$ZodPrefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),nd=D("$ZodNonOptional",(e,t)=>{_e.init(e,t),de(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Ls(o,e)):Ls(s,e)}});function Ls(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const sd=D("$ZodCatch",(e,t)=>{_e.init(e,t),de(e._zod,"optin",()=>t.innerType._zod.optin),de(e._zod,"optout",()=>t.innerType._zod.optout),de(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>at(i,n,st()))},input:r.value}),r.issues=[]),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(o=>at(o,n,st()))},input:r.value}),r.issues=[]),r)}}),od=D("$ZodPipe",(e,t)=>{_e.init(e,t),de(e._zod,"values",()=>t.in._zod.values),de(e._zod,"optin",()=>t.in._zod.optin),de(e._zod,"optout",()=>t.out._zod.optout),de(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const o=t.out._zod.run(r,n);return o instanceof Promise?o.then(i=>Qt(i,t.in,n)):Qt(o,t.in,n)}const s=t.in._zod.run(r,n);return s instanceof Promise?s.then(o=>Qt(o,t.out,n)):Qt(s,t.out,n)}});function Qt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const id=D("$ZodReadonly",(e,t)=>{_e.init(e,t),de(e._zod,"propValues",()=>t.innerType._zod.propValues),de(e._zod,"values",()=>t.innerType._zod.values),de(e._zod,"optin",()=>t.innerType?._zod?.optin),de(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(Ks):Ks(s)}});function Ks(e){return e.value=Object.freeze(e.value),e}const ad=D("$ZodLazy",(e,t)=>{_e.init(e,t),de(e._zod,"innerType",()=>t.getter()),de(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),de(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),de(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),de(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),cd=D("$ZodCustom",(e,t)=>{De.init(e,t),_e.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(o=>Js(o,r,n,e));Js(s,r,n,e)}});function Js(e,t,r,n){if(!e){const s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Tt(s))}}var Hs;class ud{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function dd(){return new ud}(Hs=globalThis).__zod_globalRegistry??(Hs.__zod_globalRegistry=dd());const Ct=globalThis.__zod_globalRegistry;function ld(e,t){return new e({type:"string",...te(t)})}function fd(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...te(t)})}function Gs(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...te(t)})}function md(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...te(t)})}function hd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(t)})}function pd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(t)})}function yd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(t)})}function vd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...te(t)})}function gd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...te(t)})}function _d(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(t)})}function $d(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...te(t)})}function bd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(t)})}function wd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...te(t)})}function Sd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...te(t)})}function Ed(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(t)})}function kd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(t)})}function Pd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(t)})}function Od(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(t)})}function jd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(t)})}function Ad(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...te(t)})}function Nd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...te(t)})}function zd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...te(t)})}function Rd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...te(t)})}function Id(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(t)})}function Td(e,t){return new e({type:"string",format:"date",check:"string_format",...te(t)})}function Cd(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...te(t)})}function Md(e,t){return new e({type:"string",format:"duration",check:"string_format",...te(t)})}function Dd(e,t){return new e({type:"number",checks:[],...te(t)})}function Vd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...te(t)})}function Fd(e,t){return new e({type:"boolean",...te(t)})}function qd(e){return new e({type:"any"})}function Zd(e){return new e({type:"unknown"})}function Ud(e,t){return new e({type:"never",...te(t)})}function Bs(e,t){return new Rs({check:"less_than",...te(t),value:e,inclusive:!1})}function Pn(e,t){return new Rs({check:"less_than",...te(t),value:e,inclusive:!0})}function Ws(e,t){return new Is({check:"greater_than",...te(t),value:e,inclusive:!1})}function On(e,t){return new Is({check:"greater_than",...te(t),value:e,inclusive:!0})}function Ys(e,t){return new tu({check:"multiple_of",...te(t),value:e})}function Xs(e,t){return new nu({check:"max_length",...te(t),maximum:e})}function er(e,t){return new su({check:"min_length",...te(t),minimum:e})}function Qs(e,t){return new ou({check:"length_equals",...te(t),length:e})}function xd(e,t){return new iu({check:"string_format",format:"regex",...te(t),pattern:e})}function Ld(e){return new au({check:"string_format",format:"lowercase",...te(e)})}function Kd(e){return new cu({check:"string_format",format:"uppercase",...te(e)})}function Jd(e,t){return new uu({check:"string_format",format:"includes",...te(t),includes:e})}function Hd(e,t){return new du({check:"string_format",format:"starts_with",...te(t),prefix:e})}function Gd(e,t){return new lu({check:"string_format",format:"ends_with",...te(t),suffix:e})}function St(e){return new fu({check:"overwrite",tx:e})}function Bd(e){return St(t=>t.normalize(e))}function Wd(){return St(e=>e.trim())}function Yd(){return St(e=>e.toLowerCase())}function Xd(){return St(e=>e.toUpperCase())}function Qd(){return St(e=>sc(e))}function el(e,t,r){return new e({type:"array",element:t,...te(r)})}function tl(e,t,r){return new e({type:"custom",check:"custom",fn:t,...te(r)})}function rl(e){const t=nl(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Tt(n,r.value,t._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),r.issues.push(Tt(s))}},e(r.value,r)));return t}function nl(e,t){const r=new De({check:"custom",...te(t)});return r._zod.check=e,r}function eo(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ct,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ee(e,t,r={path:[],schemaPath:[]}){var n;const s=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const m={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,m);else{const l=i.schema,h=t.processors[s.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,l,m)}const v=e._zod.parent;v&&(i.ref||(i.ref=v),Ee(v,t,m),t.seen.get(v).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&Ie(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function to(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=n.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,i[0])}}const s=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(i[0])?.id,l=e.external.uri??(w=>w);if(v)return{ref:l(v)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${l("__shared")}#/${a}/${h}`}}if(i[1]===r)return{ref:"#"};const u=`#/${a}/`,m=i[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:u+m}},o=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=s(i);a.def={...a.schema},u&&(a.defId=u);const m=a.schema;for(const v in m)delete m[v];m.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
37
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");const l=h.compile();return(v,g)=>l(f,v,g)};let o;const i=Kt,a=!ws.jitless,u=a&&uc.value,m=t.catchall;let y;e._zod.parse=(f,h)=>{y??(y=n.value);const w=f.value;return i(w)?a&&u&&h?.async===!1&&h.jitless!==!0?(o||(o=s(t.shape)),f=o(f,h),m?Zs([],w,f,h,y,e):f):r(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),f)}});function Us(e,t,r,n){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const s=e.filter(o=>!wt(o));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(i=>dt(i,n,at())))}),t)}const Xu=M("$ZodUnion",(e,t)=>{_e.init(e,t),le(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),le(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),le(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),le(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${s.map(o=>Sn(o.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,o)=>{if(r)return n(s,o);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:s.value,issues:[]},o);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>Us(c,s,e,o)):Us(a,s,e,o)}}),Qu=M("$ZodIntersection",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const s=r.value,o=t.left._zod.run({value:s,issues:[]},n),i=t.right._zod.run({value:s,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([c,u])=>xs(r,c,u)):xs(r,o,i)}});function On(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(bt(e)&&bt(t)){const r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),s={...e,...t};for(const o of n){const i=On(e[o],t[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};s[o]=i.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const s=e[n],o=t[n],i=On(s,o);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function xs(e,t,r){const n=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(a);for(const a of r.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(a);const o=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&s&&e.issues.push({...s,keys:o}),wt(e))return e;const i=On(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const ed=M("$ZodRecord",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!bt(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;const o=[],i=t.keyType._zod.values;if(i){r.value={};const a=new Set;for(const u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const m=t.valueType._zod.run({value:s[u],issues:[]},n);m instanceof Promise?o.push(m.then(y=>{y.issues.length&&r.issues.push(...St(u,y.issues)),r.value[u]=y.value})):(m.issues.length&&r.issues.push(...St(u,m.issues)),r.value[u]=m.value)}let c;for(const u in s)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c})}else{r.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Is.test(a)&&c.issues.length){const y=t.keyType._zod.run({value:Number(a),issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(c=y)}if(c.issues.length){t.mode==="loose"?r.value[a]=s[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(y=>dt(y,n,at())),input:a,path:[a],inst:e});continue}const m=t.valueType._zod.run({value:s[a],issues:[]},n);m instanceof Promise?o.push(m.then(y=>{y.issues.length&&r.issues.push(...St(a,y.issues)),r.value[c.value]=y.value})):(m.issues.length&&r.issues.push(...St(a,m.issues)),r.value[c.value]=m.value)}}return o.length?Promise.all(o).then(()=>r):r}}),td=M("$ZodEnum",(e,t)=>{_e.init(e,t);const r=Ss(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(s=>dc.has(typeof s)).map(s=>typeof s=="string"?Jt(s):s.toString()).join("|")})$`),e._zod.parse=(s,o)=>{const i=s.value;return n.has(i)||s.issues.push({code:"invalid_value",values:r,input:i,inst:e}),s}}),rd=M("$ZodTransform",(e,t)=>{_e.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new bs(e.constructor.name);const s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(i=>(r.value=i,r));if(s instanceof Promise)throw new $t;return r.value=s,r}});function Ls(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ks=M("$ZodOptional",(e,t)=>{_e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),le(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Sn(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Ls(o,r.value)):Ls(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),nd=M("$ZodExactOptional",(e,t)=>{Ks.init(e,t),le(e._zod,"values",()=>t.innerType._zod.values),le(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),sd=M("$ZodNullable",(e,t)=>{_e.init(e,t),le(e._zod,"optin",()=>t.innerType._zod.optin),le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Sn(r.source)}|null)$`):void 0}),le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),od=M("$ZodDefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Js(o,t)):Js(s,t)}});function Js(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const id=M("$ZodPrefault",(e,t)=>{_e.init(e,t),e._zod.optin="optional",le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),ad=M("$ZodNonOptional",(e,t)=>{_e.init(e,t),le(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Gs(o,e)):Gs(s,e)}});function Gs(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const cd=M("$ZodCatch",(e,t)=>{_e.init(e,t),le(e._zod,"optin",()=>t.innerType._zod.optin),le(e._zod,"optout",()=>t.innerType._zod.optout),le(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>dt(i,n,at()))},input:r.value}),r.issues=[]),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(o=>dt(o,n,at()))},input:r.value}),r.issues=[]),r)}}),ud=M("$ZodPipe",(e,t)=>{_e.init(e,t),le(e._zod,"values",()=>t.in._zod.values),le(e._zod,"optin",()=>t.in._zod.optin),le(e._zod,"optout",()=>t.out._zod.optout),le(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const o=t.out._zod.run(r,n);return o instanceof Promise?o.then(i=>tr(i,t.in,n)):tr(o,t.in,n)}const s=t.in._zod.run(r,n);return s instanceof Promise?s.then(o=>tr(o,t.out,n)):tr(s,t.out,n)}});function tr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const dd=M("$ZodReadonly",(e,t)=>{_e.init(e,t),le(e._zod,"propValues",()=>t.innerType._zod.propValues),le(e._zod,"values",()=>t.innerType._zod.values),le(e._zod,"optin",()=>t.innerType?._zod?.optin),le(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(Hs):Hs(s)}});function Hs(e){return e.value=Object.freeze(e.value),e}const ld=M("$ZodLazy",(e,t)=>{_e.init(e,t),le(e._zod,"innerType",()=>t.getter()),le(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),le(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),le(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),le(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),fd=M("$ZodCustom",(e,t)=>{Ve.init(e,t),_e.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(o=>Bs(o,r,n,e));Bs(s,r,n,e)}});function Bs(e,t,r,n){if(!e){const s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Mt(s))}}var Ws;class md{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function hd(){return new md}(Ws=globalThis).__zod_globalRegistry??(Ws.__zod_globalRegistry=hd());const Dt=globalThis.__zod_globalRegistry;function pd(e,t){return new e({type:"string",...te(t)})}function yd(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...te(t)})}function Ys(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...te(t)})}function vd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...te(t)})}function gd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...te(t)})}function _d(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...te(t)})}function $d(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...te(t)})}function bd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...te(t)})}function wd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...te(t)})}function Sd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...te(t)})}function Ed(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...te(t)})}function kd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...te(t)})}function Pd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...te(t)})}function Od(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...te(t)})}function jd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...te(t)})}function Ad(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...te(t)})}function Nd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...te(t)})}function zd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...te(t)})}function Rd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...te(t)})}function Id(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...te(t)})}function Td(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...te(t)})}function Cd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...te(t)})}function Md(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...te(t)})}function Dd(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...te(t)})}function Vd(e,t){return new e({type:"string",format:"date",check:"string_format",...te(t)})}function Fd(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...te(t)})}function qd(e,t){return new e({type:"string",format:"duration",check:"string_format",...te(t)})}function Zd(e,t){return new e({type:"number",checks:[],...te(t)})}function Ud(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...te(t)})}function xd(e,t){return new e({type:"boolean",...te(t)})}function Ld(e){return new e({type:"any"})}function Kd(e){return new e({type:"unknown"})}function Jd(e,t){return new e({type:"never",...te(t)})}function Xs(e,t){return new Cs({check:"less_than",...te(t),value:e,inclusive:!1})}function jn(e,t){return new Cs({check:"less_than",...te(t),value:e,inclusive:!0})}function Qs(e,t){return new Ms({check:"greater_than",...te(t),value:e,inclusive:!1})}function An(e,t){return new Ms({check:"greater_than",...te(t),value:e,inclusive:!0})}function eo(e,t){return new ou({check:"multiple_of",...te(t),value:e})}function to(e,t){return new au({check:"max_length",...te(t),maximum:e})}function rr(e,t){return new cu({check:"min_length",...te(t),minimum:e})}function ro(e,t){return new uu({check:"length_equals",...te(t),length:e})}function Gd(e,t){return new du({check:"string_format",format:"regex",...te(t),pattern:e})}function Hd(e){return new lu({check:"string_format",format:"lowercase",...te(e)})}function Bd(e){return new fu({check:"string_format",format:"uppercase",...te(e)})}function Wd(e,t){return new mu({check:"string_format",format:"includes",...te(t),includes:e})}function Yd(e,t){return new hu({check:"string_format",format:"starts_with",...te(t),prefix:e})}function Xd(e,t){return new pu({check:"string_format",format:"ends_with",...te(t),suffix:e})}function Et(e){return new yu({check:"overwrite",tx:e})}function Qd(e){return Et(t=>t.normalize(e))}function el(){return Et(e=>e.trim())}function tl(){return Et(e=>e.toLowerCase())}function rl(){return Et(e=>e.toUpperCase())}function nl(){return Et(e=>cc(e))}function sl(e,t,r){return new e({type:"array",element:t,...te(r)})}function ol(e,t,r){return new e({type:"custom",check:"custom",fn:t,...te(r)})}function il(e){const t=al(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Mt(n,r.value,t._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),r.issues.push(Mt(s))}},e(r.value,r)));return t}function al(e,t){const r=new Ve({check:"custom",...te(t)});return r._zod.check=e,r}function no(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Dt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ee(e,t,r={path:[],schemaPath:[]}){var n;const s=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const m={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,m);else{const f=i.schema,h=t.processors[s.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);h(e,t,f,m)}const y=e._zod.parent;y&&(i.ref||(i.ref=y),Ee(y,t,m),t.seen.get(y).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&Ie(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function so(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=n.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,i[0])}}const s=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(i[0])?.id,f=e.external.uri??(w=>w);if(y)return{ref:f(y)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(i[1]===r)return{ref:"#"};const u=`#/${a}/`,m=i[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:u+m}},o=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=s(i);a.def={...a.schema},u&&(a.defId=u);const m=a.schema;for(const y in m)delete m[y];m.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
38
38
|
|
|
39
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){o(i);continue}if(e.external){const u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(a.cycle){o(i);continue}if(a.count>1&&e.reused==="ref"){o(i);continue}}}function ro(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,u={...c},m=a.ref;if(a.ref=null,m){n(m);const l=e.seen.get(m),h=l.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,u),i._zod.parent===m)for(const S in c)S==="$ref"||S==="allOf"||S in u||delete c[S];if(h.$ref&&l.def)for(const S in c)S==="$ref"||S==="allOf"||S in l.def&&JSON.stringify(c[S])===JSON.stringify(l.def[S])&&delete c[S]}const v=i._zod.parent;if(v&&v!==m){n(v);const l=e.seen.get(v);if(l?.schema.$ref&&(c.$ref=l.schema.$ref,l.def))for(const h in c)h==="$ref"||h==="allOf"||h in l.def&&JSON.stringify(c[h])===JSON.stringify(l.def[h])&&delete c[h]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())n(i[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(i)}Object.assign(s,r.def??r.schema);const o=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(o[a.defId]=a.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const i=JSON.parse(JSON.stringify(s));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:tr(t,"input",e.processors),output:tr(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function Ie(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ie(n.element,r);if(n.type==="set")return Ie(n.valueType,r);if(n.type==="lazy")return Ie(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ie(n.innerType,r);if(n.type==="intersection")return Ie(n.left,r)||Ie(n.right,r);if(n.type==="record"||n.type==="map")return Ie(n.keyType,r)||Ie(n.valueType,r);if(n.type==="pipe")return Ie(n.in,r)||Ie(n.out,r);if(n.type==="object"){for(const s in n.shape)if(Ie(n.shape[s],r))return!0;return!1}if(n.type==="union"){for(const s of n.options)if(Ie(s,r))return!0;return!1}if(n.type==="tuple"){for(const s of n.items)if(Ie(s,r))return!0;return!!(n.rest&&Ie(n.rest,r))}return!1}const sl=(e,t={})=>r=>{const n=eo({...r,processors:t});return Ee(e,n),to(n,e),ro(n,e)},tr=(e,t,r={})=>n=>{const{libraryOptions:s,target:o}=n??{},i=eo({...s??{},target:o,io:t,processors:r});return Ee(e,i),to(i,e),ro(i,e)},ol={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},il=(e,t,r,n)=>{const s=r;s.type="string";const{minimum:o,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof i=="number"&&(s.maxLength=i),a&&(s.format=ol[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),u&&(s.contentEncoding=u),c&&c.size>0){const m=[...c];m.length===1?s.pattern=m[0].source:m.length>1&&(s.allOf=[...m.map(v=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},al=(e,t,r,n)=>{const s=r,{minimum:o,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:m}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=m,s.exclusiveMinimum=!0):s.exclusiveMinimum=m),typeof o=="number"&&(s.minimum=o,typeof m=="number"&&t.target!=="draft-04"&&(m>=o?delete s.minimum:delete s.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u),typeof i=="number"&&(s.maximum=i,typeof u=="number"&&t.target!=="draft-04"&&(u<=i?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},cl=(e,t,r,n)=>{r.type="boolean"},ul=(e,t,r,n)=>{r.not={}},dl=(e,t,r,n)=>{},ll=(e,t,r,n)=>{},fl=(e,t,r,n)=>{const s=e._zod.def,o=$s(s.entries);o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),r.enum=o},ml=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},hl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},pl=(e,t,r,n)=>{const s=r,o=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=Ee(o.element,t,{...n,path:[...n.path,"items"]})},yl=(e,t,r,n)=>{const s=r,o=e._zod.def;s.type="object",s.properties={};const i=o.shape;for(const u in i)s.properties[u]=Ee(i[u],t,{...n,path:[...n.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const m=o.shape[u]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));c.size>0&&(s.required=Array.from(c)),o.catchall?._zod.def.type==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=Ee(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},vl=(e,t,r,n)=>{const s=e._zod.def,o=s.inclusive===!1,i=s.options.map((a,c)=>Ee(a,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=i:r.anyOf=i},gl=(e,t,r,n)=>{const s=e._zod.def,o=Ee(s.left,t,{...n,path:[...n.path,"allOf",0]}),i=Ee(s.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(i)?i.allOf:[i]];r.allOf=c},_l=(e,t,r,n)=>{const s=r,o=e._zod.def;s.type="object";const i=o.keyType,c=i._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){const m=Ee(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(const v of c)s.patternProperties[v.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Ee(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),s.additionalProperties=Ee(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const u=i._zod.values;if(u){const m=[...u].filter(v=>typeof v=="string"||typeof v=="number");m.length>0&&(s.required=m)}},$l=(e,t,r,n)=>{const s=e._zod.def,o=Ee(s.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},bl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType},wl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},Sl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},El=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},kl=(e,t,r,n)=>{const s=e._zod.def,o=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Ee(o,t,n);const i=t.seen.get(e);i.ref=o},Pl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,r.readOnly=!0},no=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType},Ol=(e,t,r,n)=>{const s=e._zod.innerType;Ee(s,t,n);const o=t.seen.get(e);o.ref=s},jl=D("ZodISODateTime",(e,t)=>{Pu.init(e,t),we.init(e,t)});function Al(e){return Id(jl,e)}const Nl=D("ZodISODate",(e,t)=>{Ou.init(e,t),we.init(e,t)});function zl(e){return Td(Nl,e)}const Rl=D("ZodISOTime",(e,t)=>{ju.init(e,t),we.init(e,t)});function Il(e){return Cd(Rl,e)}const Tl=D("ZodISODuration",(e,t)=>{Au.init(e,t),we.init(e,t)});function Cl(e){return Md(Tl,e)}const Ke=D("ZodError",(e,t)=>{Sn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>vc(e,r)},flatten:{value:r=>yc(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,gn,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,gn,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ml=Ht(Ke),Dl=Gt(Ke),Vl=Bt(Ke),Fl=Wt(Ke),ql=wc(Ke),Zl=Sc(Ke),Ul=Ec(Ke),xl=kc(Ke),Ll=Pc(Ke),Kl=Oc(Ke),Jl=jc(Ke),Hl=Ac(Ke),be=D("ZodType",(e,t)=>(_e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:tr(e,"input"),output:tr(e,"output")}}),e.toJSONSchema=sl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ot(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>it(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>Ml(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Vl(e,r,n),e.parseAsync=async(r,n)=>Dl(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Fl(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>ql(e,r,n),e.decode=(r,n)=>Zl(e,r,n),e.encodeAsync=async(r,n)=>Ul(e,r,n),e.decodeAsync=async(r,n)=>xl(e,r,n),e.safeEncode=(r,n)=>Ll(e,r,n),e.safeDecode=(r,n)=>Kl(e,r,n),e.safeEncodeAsync=async(r,n)=>Jl(e,r,n),e.safeDecodeAsync=async(r,n)=>Hl(e,r,n),e.refine=(r,n)=>e.check(Uf(r,n)),e.superRefine=r=>e.check(xf(r)),e.overwrite=r=>e.check(St(r)),e.optional=()=>ho(e),e.exactOptional=()=>jf(e),e.nullable=()=>po(e),e.nullish=()=>ho(po(e)),e.nonoptional=r=>Tf(e,r),e.array=()=>Ye(e),e.or=r=>jn([e,r]),e.and=r=>Sf(e,r),e.transform=r=>vo(e,Pf(r)),e.default=r=>zf(e,r),e.prefault=r=>If(e,r),e.catch=r=>Mf(e,r),e.pipe=r=>vo(e,r),e.readonly=()=>Ff(e),e.describe=r=>{const n=e.clone();return Ct.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Ct.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ct.get(e);const n=e.clone();return Ct.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),so=D("_ZodString",(e,t)=>{En.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>il(e,n,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(xd(...n)),e.includes=(...n)=>e.check(Jd(...n)),e.startsWith=(...n)=>e.check(Hd(...n)),e.endsWith=(...n)=>e.check(Gd(...n)),e.min=(...n)=>e.check(er(...n)),e.max=(...n)=>e.check(Xs(...n)),e.length=(...n)=>e.check(Qs(...n)),e.nonempty=(...n)=>e.check(er(1,...n)),e.lowercase=n=>e.check(Ld(n)),e.uppercase=n=>e.check(Kd(n)),e.trim=()=>e.check(Wd()),e.normalize=(...n)=>e.check(Bd(...n)),e.toLowerCase=()=>e.check(Yd()),e.toUpperCase=()=>e.check(Xd()),e.slugify=()=>e.check(Qd())}),Gl=D("ZodString",(e,t)=>{En.init(e,t),so.init(e,t),e.email=r=>e.check(fd(Bl,r)),e.url=r=>e.check(vd(Wl,r)),e.jwt=r=>e.check(Rd(ff,r)),e.emoji=r=>e.check(gd(Yl,r)),e.guid=r=>e.check(Gs(oo,r)),e.uuid=r=>e.check(md(rr,r)),e.uuidv4=r=>e.check(hd(rr,r)),e.uuidv6=r=>e.check(pd(rr,r)),e.uuidv7=r=>e.check(yd(rr,r)),e.nanoid=r=>e.check(_d(Xl,r)),e.guid=r=>e.check(Gs(oo,r)),e.cuid=r=>e.check($d(Ql,r)),e.cuid2=r=>e.check(bd(ef,r)),e.ulid=r=>e.check(wd(tf,r)),e.base64=r=>e.check(Ad(uf,r)),e.base64url=r=>e.check(Nd(df,r)),e.xid=r=>e.check(Sd(rf,r)),e.ksuid=r=>e.check(Ed(nf,r)),e.ipv4=r=>e.check(kd(sf,r)),e.ipv6=r=>e.check(Pd(of,r)),e.cidrv4=r=>e.check(Od(af,r)),e.cidrv6=r=>e.check(jd(cf,r)),e.e164=r=>e.check(zd(lf,r)),e.datetime=r=>e.check(Al(r)),e.date=r=>e.check(zl(r)),e.time=r=>e.check(Il(r)),e.duration=r=>e.check(Cl(r))});function Te(e){return ld(Gl,e)}const we=D("ZodStringFormat",(e,t)=>{$e.init(e,t),so.init(e,t)}),Bl=D("ZodEmail",(e,t)=>{vu.init(e,t),we.init(e,t)}),oo=D("ZodGUID",(e,t)=>{pu.init(e,t),we.init(e,t)}),rr=D("ZodUUID",(e,t)=>{yu.init(e,t),we.init(e,t)}),Wl=D("ZodURL",(e,t)=>{gu.init(e,t),we.init(e,t)}),Yl=D("ZodEmoji",(e,t)=>{_u.init(e,t),we.init(e,t)}),Xl=D("ZodNanoID",(e,t)=>{$u.init(e,t),we.init(e,t)}),Ql=D("ZodCUID",(e,t)=>{bu.init(e,t),we.init(e,t)}),ef=D("ZodCUID2",(e,t)=>{wu.init(e,t),we.init(e,t)}),tf=D("ZodULID",(e,t)=>{Su.init(e,t),we.init(e,t)}),rf=D("ZodXID",(e,t)=>{Eu.init(e,t),we.init(e,t)}),nf=D("ZodKSUID",(e,t)=>{ku.init(e,t),we.init(e,t)}),sf=D("ZodIPv4",(e,t)=>{Nu.init(e,t),we.init(e,t)}),of=D("ZodIPv6",(e,t)=>{zu.init(e,t),we.init(e,t)}),af=D("ZodCIDRv4",(e,t)=>{Ru.init(e,t),we.init(e,t)}),cf=D("ZodCIDRv6",(e,t)=>{Iu.init(e,t),we.init(e,t)}),uf=D("ZodBase64",(e,t)=>{Tu.init(e,t),we.init(e,t)}),df=D("ZodBase64URL",(e,t)=>{Mu.init(e,t),we.init(e,t)}),lf=D("ZodE164",(e,t)=>{Du.init(e,t),we.init(e,t)}),ff=D("ZodJWT",(e,t)=>{Fu.init(e,t),we.init(e,t)}),io=D("ZodNumber",(e,t)=>{Cs.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>al(e,n,s),e.gt=(n,s)=>e.check(Ws(n,s)),e.gte=(n,s)=>e.check(On(n,s)),e.min=(n,s)=>e.check(On(n,s)),e.lt=(n,s)=>e.check(Bs(n,s)),e.lte=(n,s)=>e.check(Pn(n,s)),e.max=(n,s)=>e.check(Pn(n,s)),e.int=n=>e.check(ao(n)),e.safe=n=>e.check(ao(n)),e.positive=n=>e.check(Ws(0,n)),e.nonnegative=n=>e.check(On(0,n)),e.negative=n=>e.check(Bs(0,n)),e.nonpositive=n=>e.check(Pn(0,n)),e.multipleOf=(n,s)=>e.check(Ys(n,s)),e.step=(n,s)=>e.check(Ys(n,s)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function qe(e){return Dd(io,e)}const mf=D("ZodNumberFormat",(e,t)=>{qu.init(e,t),io.init(e,t)});function ao(e){return Vd(mf,e)}const hf=D("ZodBoolean",(e,t)=>{Zu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>cl(e,r,n)});function nr(e){return Fd(hf,e)}const pf=D("ZodAny",(e,t)=>{Uu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>dl()});function co(){return qd(pf)}const yf=D("ZodUnknown",(e,t)=>{xu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ll()});function uo(){return Zd(yf)}const vf=D("ZodNever",(e,t)=>{Lu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ul(e,r,n)});function gf(e){return Ud(vf,e)}const _f=D("ZodArray",(e,t)=>{Ku.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>pl(e,r,n,s),e.element=t.element,e.min=(r,n)=>e.check(er(r,n)),e.nonempty=r=>e.check(er(1,r)),e.max=(r,n)=>e.check(Xs(r,n)),e.length=(r,n)=>e.check(Qs(r,n)),e.unwrap=()=>e.element});function Ye(e,t){return el(_f,e,t)}const $f=D("ZodObject",(e,t)=>{Hu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>yl(e,r,n,s),de(e,"shape",()=>t.shape),e.keyof=()=>fo(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:uo()}),e.loose=()=>e.clone({...e._zod.def,catchall:uo()}),e.strict=()=>e.clone({...e._zod.def,catchall:gf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>lc(e,r),e.safeExtend=r=>fc(e,r),e.merge=r=>mc(e,r),e.pick=r=>uc(e,r),e.omit=r=>dc(e,r),e.partial=(...r)=>hc(mo,e,r[0]),e.required=(...r)=>pc(yo,e,r[0])});function sr(e,t){const r={type:"object",shape:e??{},...te(t)};return new $f(r)}const bf=D("ZodUnion",(e,t)=>{Gu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>vl(e,r,n,s),e.options=t.options});function jn(e,t){return new bf({type:"union",options:e,...te(t)})}const wf=D("ZodIntersection",(e,t)=>{Bu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>gl(e,r,n,s)});function Sf(e,t){return new wf({type:"intersection",left:e,right:t})}const Ef=D("ZodRecord",(e,t)=>{Wu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_l(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType});function lo(e,t,r){return new Ef({type:"record",keyType:e,valueType:t,...te(r)})}const An=D("ZodEnum",(e,t)=>{Yu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>fl(e,n,s),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const o={};for(const i of n)if(r.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new An({...t,checks:[],...te(s),entries:o})},e.exclude=(n,s)=>{const o={...t.entries};for(const i of n)if(r.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new An({...t,checks:[],...te(s),entries:o})}});function fo(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new An({type:"enum",entries:r,...te(t)})}const kf=D("ZodTransform",(e,t)=>{Xu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>hl(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new gs(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(Tt(o,r.value,t));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Tt(i))}};const s=t.transform(r.value,r);return s instanceof Promise?s.then(o=>(r.value=o,r)):(r.value=s,r)}});function Pf(e){return new kf({type:"transform",transform:e})}const mo=D("ZodOptional",(e,t)=>{Us.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>no(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function ho(e){return new mo({type:"optional",innerType:e})}const Of=D("ZodExactOptional",(e,t)=>{Qu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>no(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function jf(e){return new Of({type:"optional",innerType:e})}const Af=D("ZodNullable",(e,t)=>{ed.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>$l(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function po(e){return new Af({type:"nullable",innerType:e})}const Nf=D("ZodDefault",(e,t)=>{td.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>wl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zf(e,t){return new Nf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Es(t)}})}const Rf=D("ZodPrefault",(e,t)=>{rd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Sl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function If(e,t){return new Rf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Es(t)}})}const yo=D("ZodNonOptional",(e,t)=>{nd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>bl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Tf(e,t){return new yo({type:"nonoptional",innerType:e,...te(t)})}const Cf=D("ZodCatch",(e,t)=>{sd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>El(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Mf(e,t){return new Cf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Df=D("ZodPipe",(e,t)=>{od.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>kl(e,r,n,s),e.in=t.in,e.out=t.out});function vo(e,t){return new Df({type:"pipe",in:e,out:t})}const Vf=D("ZodReadonly",(e,t)=>{id.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Pl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Ff(e){return new Vf({type:"readonly",innerType:e})}const qf=D("ZodLazy",(e,t)=>{ad.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ol(e,r,n,s),e.unwrap=()=>e._zod.def.getter()});function ct(e){return new qf({type:"lazy",getter:e})}const Zf=D("ZodCustom",(e,t)=>{cd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ml(e,r)});function Uf(e,t={}){return tl(Zf,e,t)}function xf(e){return rl(e)}const Ze=sr({type:fo(["string","number","integer","boolean","object","array","ref"]).optional(),title:Te().optional(),description:Te().optional(),default:co().optional(),minimum:qe().optional(),maximum:qe().optional(),exclusiveMin:qe().optional(),exclusiveMax:qe().optional(),multipleOf:qe().optional(),minLength:qe().optional(),maxLength:qe().optional(),minContains:qe().optional(),maxContains:qe().optional(),minProperties:qe().optional(),maxProperties:qe().optional(),isModifiable:nr().optional(),"x-modifiable":Ye(Te()).optional(),pattern:Te().optional(),format:Te().optional(),minItems:qe().optional(),maxItems:qe().optional(),uniqueItems:nr().optional(),enum:Ye(co()).optional(),$id:Te().optional(),$schema:Te().optional(),$ref:Te().optional()}).extend({properties:ct(()=>lo(Te(),Ze)).optional(),items:ct(()=>jn([Ze,Ye(Ze)])).optional(),required:Ye(Te()).optional(),additionalProperties:ct(()=>jn([nr(),Ze])).optional(),allOf:ct(()=>Ye(Ze)).optional(),anyOf:ct(()=>Ye(Ze)).optional(),oneOf:ct(()=>Ye(Ze)).optional(),not:ct(()=>Ze).optional(),$defs:ct(()=>lo(Te(),Ze)).optional()}),go=sr({root:Ze,properties:Ye(sr({id:Te(),key:Te().min(1),isRequired:nr(),schema:Ze})),definitions:Ye(sr({id:Te(),key:Te().min(1),schema:Ze}))});var Mt=e=>e.type==="checkbox",ht=e=>e instanceof Date,Ve=e=>e==null;const _o=e=>typeof e=="object";var Pe=e=>!Ve(e)&&!Array.isArray(e)&&_o(e)&&!ht(e),Lf=e=>Pe(e)&&e.target?Mt(e.target)?e.target.checked:e.target.value:e,Kf=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Jf=(e,t)=>e.has(Kf(t)),Hf=e=>{const t=e.constructor&&e.constructor.prototype;return Pe(t)&&t.hasOwnProperty("isPrototypeOf")},Nn=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ge(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Nn&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Pe(e)&&Hf(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=ge(e[s]));return n}var or=e=>/^\w*$/.test(e),ve=e=>e===void 0,ir=e=>Array.isArray(e)?e.filter(Boolean):[],zn=e=>ir(e.replace(/["|']|\]/g,"").split(/\.|\[/)),W=(e,t,r)=>{if(!t||!Pe(e))return r;const n=(or(t)?[t]:zn(t)).reduce((s,o)=>Ve(s)?s:s[o],e);return ve(n)||n===e?ve(e[t])?r:e[t]:n},Xe=e=>typeof e=="boolean",He=e=>typeof e=="function",he=(e,t,r)=>{let n=-1;const s=or(t)?[t]:zn(t),o=s.length,i=o-1;for(;++n<o;){const a=s[n];let c=r;if(n!==i){const u=e[a];c=Pe(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const $o={BLUR:"blur",FOCUS_OUT:"focusout"},Je={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},et={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},bo=ee.createContext(null);bo.displayName="HookFormControlContext";const Gf=()=>ee.useContext(bo);var Bf=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==Je.all&&(t._proxyFormState[i]=!n||Je.all),e[i]}});return s};const wo=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;var Ue=e=>typeof e=="string",Wf=(e,t,r,n,s)=>Ue(e)?(n&&t.watch.add(e),W(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),W(r,o))):(n&&(t.watchAll=!0),r),Rn=e=>Ve(e)||!_o(e);function ut(e,t,r=new WeakSet){if(Rn(e)||Rn(t))return Object.is(e,t);if(ht(e)&&ht(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const i=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const a=t[o];if(ht(i)&&ht(a)||Pe(i)&&Pe(a)||Array.isArray(i)&&Array.isArray(a)?!ut(i,a,r):!Object.is(i,a))return!1}}return!0}const Yf=ee.createContext(null);Yf.displayName="HookFormContext";var In=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Fe=e=>Array.isArray(e)?e:[e],So=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function Eo(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],o=t[n];if(s&&Pe(s)&&o){const i=Eo(s,o);Pe(i)&&(r[n]=i)}else e[n]&&(r[n]=o)}return r}var Re=e=>Pe(e)&&!Object.keys(e).length,Tn=e=>e.type==="file",ar=e=>{if(!Nn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ko=e=>e.type==="select-multiple",Cn=e=>e.type==="radio",Xf=e=>Cn(e)||Mt(e),Mn=e=>ar(e)&&e.isConnected;function Qf(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=ve(e)?n++:e[t[n++]];return e}function em(e){for(const t in e)if(e.hasOwnProperty(t)&&!ve(e[t]))return!1;return!0}function ke(e,t){const r=Array.isArray(t)?t:or(t)?[t]:zn(t),n=r.length===1?e:Qf(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(Pe(n)&&Re(n)||Array.isArray(n)&&em(n))&&ke(e,r.slice(0,-1)),e}var tm=e=>{for(const t in e)if(He(e[t]))return!0;return!1};function Po(e){return Array.isArray(e)||Pe(e)&&!tm(e)}function Dn(e,t={}){for(const r in e){const n=e[r];Po(n)?(t[r]=Array.isArray(n)?[]:{},Dn(n,t[r])):ve(n)||(t[r]=!0)}return t}function Et(e,t,r){r||(r=Dn(t));for(const n in e){const s=e[n];if(Po(s))ve(t)||Rn(r[n])?r[n]=Dn(s,Array.isArray(s)?[]:{}):Et(s,Ve(t)?{}:t[n],r[n]);else{const o=t[n];r[n]=!ut(s,o)}}return r}const Oo={value:!1,isValid:!1},jo={value:!0,isValid:!0};var Ao=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ve(e[0].attributes.value)?ve(e[0].value)||e[0].value===""?jo:{value:e[0].value,isValid:!0}:jo:Oo}return Oo},No=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ve(e)?e:t?e===""?NaN:e&&+e:r&&Ue(e)?new Date(e):n?n(e):e;const zo={isValid:!1,value:null};var Ro=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,zo):zo;function Io(e){const t=e.ref;return Tn(t)?t.files:Cn(t)?Ro(e.refs).value:ko(t)?[...t.selectedOptions].map(({value:r})=>r):Mt(t)?Ao(e.refs).value:No(ve(t.value)?e.ref.value:t.value,e)}var rm=(e,t,r,n)=>{const s={};for(const o of e){const i=W(t,o);i&&he(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},cr=e=>e instanceof RegExp,Dt=e=>ve(e)?e:cr(e)?e.source:Pe(e)?cr(e.value)?e.value.source:e.value:e,kt=e=>({isOnSubmit:!e||e===Je.onSubmit,isOnBlur:e===Je.onBlur,isOnChange:e===Je.onChange,isOnAll:e===Je.all,isOnTouch:e===Je.onTouched});const To="AsyncFunction";var nm=e=>!!e&&!!e.validate&&!!(He(e.validate)&&e.validate.constructor.name===To||Pe(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===To)),sm=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Vn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Pt=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=W(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(Pt(a,t))break}else if(Pe(a)&&Pt(a,t))break}}};function Co(e,t,r){const n=W(e,r);if(n||or(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=W(t,o),a=W(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};if(a&&a.root&&a.root.type)return{name:`${o}.root`,error:a.root};s.pop()}return{name:r}}var om=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return Re(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||Je.all))},im=(e,t,r)=>!e||!t||e===t||Fe(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),am=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,cm=(e,t)=>!ir(W(e,t)).length&&ke(e,t),Mo=(e,t,r)=>{const n=Fe(W(e,r));return he(n,"root",t[r]),he(e,r,n),e};function Do(e,t,r="validate"){if(Ue(e)||Array.isArray(e)&&e.every(Ue)||Xe(e)&&!e)return{type:r,message:Ue(e)?e:"",ref:t}}var Ot=e=>Pe(e)&&!cr(e)?e:{value:e,message:""},Fn=async(e,t,r,n,s,o)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:m,min:v,max:l,pattern:h,validate:w,name:S,valueAsNumber:p,mount:_}=e._f,f=W(r,S);if(!_||t.has(S))return{};const y=a?a[0]:i,g=V=>{s&&y.reportValidity&&(y.setCustomValidity(Xe(V)?"":V||""),y.reportValidity())},d={},$=Cn(i),E=Mt(i),R=$||E,Z=(p||Tn(i))&&ve(i.value)&&ve(f)||ar(i)&&i.value===""||f===""||Array.isArray(f)&&!f.length,L=In.bind(null,S,n,d),F=(V,U,K,re=et.maxLength,ye=et.minLength)=>{const me=V?U:K;d[S]={type:V?re:ye,message:me,ref:i,...L(V?re:ye,me)}};if(o?!Array.isArray(f)||!f.length:c&&(!R&&(Z||Ve(f))||Xe(f)&&!f||E&&!Ao(a).isValid||$&&!Ro(a).isValid)){const{value:V,message:U}=Ue(c)?{value:!!c,message:c}:Ot(c);if(V&&(d[S]={type:et.required,message:U,ref:y,...L(et.required,U)},!n))return g(U),d}if(!Z&&(!Ve(v)||!Ve(l))){let V,U;const K=Ot(l),re=Ot(v);if(!Ve(f)&&!isNaN(f)){const ye=i.valueAsNumber||f&&+f;Ve(K.value)||(V=ye>K.value),Ve(re.value)||(U=ye<re.value)}else{const ye=i.valueAsDate||new Date(f),me=M=>new Date(new Date().toDateString()+" "+M),ue=i.type=="time",Oe=i.type=="week";Ue(K.value)&&f&&(V=ue?me(f)>me(K.value):Oe?f>K.value:ye>new Date(K.value)),Ue(re.value)&&f&&(U=ue?me(f)<me(re.value):Oe?f<re.value:ye<new Date(re.value))}if((V||U)&&(F(!!V,K.message,re.message,et.max,et.min),!n))return g(d[S].message),d}if((u||m)&&!Z&&(Ue(f)||o&&Array.isArray(f))){const V=Ot(u),U=Ot(m),K=!Ve(V.value)&&f.length>+V.value,re=!Ve(U.value)&&f.length<+U.value;if((K||re)&&(F(K,V.message,U.message),!n))return g(d[S].message),d}if(h&&!Z&&Ue(f)){const{value:V,message:U}=Ot(h);if(cr(V)&&!f.match(V)&&(d[S]={type:et.pattern,message:U,ref:i,...L(et.pattern,U)},!n))return g(U),d}if(w){if(He(w)){const V=await w(f,r),U=Do(V,y);if(U&&(d[S]={...U,...L(et.validate,U.message)},!n))return g(U.message),d}else if(Pe(w)){let V={};for(const U in w){if(!Re(V)&&!n)break;const K=Do(await w[U](f,r),y,U);K&&(V={...K,...L(U,K.message)},g(K.message),n&&(d[S]=V))}if(!Re(V)&&(d[S]={ref:y,...V},!n))return d}}return g(!0),d};const um={mode:Je.onSubmit,reValidateMode:Je.onChange,shouldFocusError:!0};function dm(e={}){let t={...um,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:He(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=Pe(t.defaultValues)||Pe(t.values)?ge(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:ge(s),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={...m};let l={...v};const h={array:So(),state:So()},w=t.criteriaMode===Je.all,S=k=>N=>{clearTimeout(u),u=setTimeout(k,N)},p=async k=>{if(!i.keepIsValid&&!t.disabled&&(v.isValid||l.isValid||k)){let N;t.resolver?(N=Re((await R()).errors),_()):N=await L(n,!0),N!==r.isValid&&h.state.next({isValid:N})}},_=(k,N)=>{!t.disabled&&(v.isValidating||v.validatingFields||l.isValidating||l.validatingFields)&&((k||Array.from(a.mount)).forEach(I=>{I&&(N?he(r.validatingFields,I,N):ke(r.validatingFields,I))}),h.state.next({validatingFields:r.validatingFields,isValidating:!Re(r.validatingFields)}))},f=(k,N=[],I,B,J=!0,x=!0)=>{if(B&&I&&!t.disabled){if(i.action=!0,x&&Array.isArray(W(n,k))){const Q=I(W(n,k),B.argA,B.argB);J&&he(n,k,Q)}if(x&&Array.isArray(W(r.errors,k))){const Q=I(W(r.errors,k),B.argA,B.argB);J&&he(r.errors,k,Q),cm(r.errors,k)}if((v.touchedFields||l.touchedFields)&&x&&Array.isArray(W(r.touchedFields,k))){const Q=I(W(r.touchedFields,k),B.argA,B.argB);J&&he(r.touchedFields,k,Q)}(v.dirtyFields||l.dirtyFields)&&(r.dirtyFields=Et(s,o)),h.state.next({name:k,isDirty:V(k,N),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else he(o,k,N)},y=(k,N)=>{he(r.errors,k,N),h.state.next({errors:r.errors})},g=k=>{r.errors=k,h.state.next({errors:r.errors,isValid:!1})},d=(k,N,I,B)=>{const J=W(n,k);if(J){const x=W(o,k,ve(I)?W(s,k):I);ve(x)||B&&B.defaultChecked||N?he(o,k,N?x:Io(J._f)):re(k,x),i.mount&&!i.action&&p()}},$=(k,N,I,B,J)=>{let x=!1,Q=!1;const le={name:k};if(!t.disabled){if(!I||B){(v.isDirty||l.isDirty)&&(Q=r.isDirty,r.isDirty=le.isDirty=V(),x=Q!==le.isDirty);const fe=ut(W(s,k),N);Q=!!W(r.dirtyFields,k),fe?ke(r.dirtyFields,k):he(r.dirtyFields,k,!0),le.dirtyFields=r.dirtyFields,x=x||(v.dirtyFields||l.dirtyFields)&&Q!==!fe}if(I){const fe=W(r.touchedFields,k);fe||(he(r.touchedFields,k,I),le.touchedFields=r.touchedFields,x=x||(v.touchedFields||l.touchedFields)&&fe!==I)}x&&J&&h.state.next(le)}return x?le:{}},E=(k,N,I,B)=>{const J=W(r.errors,k),x=(v.isValid||l.isValid)&&Xe(N)&&r.isValid!==N;if(t.delayError&&I?(c=S(()=>y(k,I)),c(t.delayError)):(clearTimeout(u),c=null,I?he(r.errors,k,I):ke(r.errors,k)),(I?!ut(J,I):J)||!Re(B)||x){const Q={...B,...x&&Xe(N)?{isValid:N}:{},errors:r.errors,name:k};r={...r,...Q},h.state.next(Q)}},R=async k=>(_(k,!0),await t.resolver(o,t.context,rm(k||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),Z=async k=>{const{errors:N}=await R(k);if(_(k),k)for(const I of k){const B=W(N,I);B?he(r.errors,I,B):ke(r.errors,I)}else r.errors=N;return N},L=async(k,N,I={valid:!0})=>{for(const B in k){const J=k[B];if(J){const{_f:x,...Q}=J;if(x){const le=a.array.has(x.name),fe=J._f&&nm(J._f);fe&&v.validatingFields&&_([x.name],!0);const ze=await Fn(J,a.disabled,o,w,t.shouldUseNativeValidation&&!N,le);if(fe&&v.validatingFields&&_([x.name]),ze[x.name]&&(I.valid=!1,N||e.shouldUseNativeValidation))break;!N&&(W(ze,x.name)?le?Mo(r.errors,ze,x.name):he(r.errors,x.name,ze[x.name]):ke(r.errors,x.name))}!Re(Q)&&await L(Q,N,I)}}return I.valid},F=()=>{for(const k of a.unMount){const N=W(n,k);N&&(N._f.refs?N._f.refs.every(I=>!Mn(I)):!Mn(N._f.ref))&&Y(k)}a.unMount=new Set},V=(k,N)=>!t.disabled&&(k&&N&&he(o,k,N),!ut(O(),s)),U=(k,N,I)=>Wf(k,a,{...i.mount?o:ve(N)?s:Ue(k)?{[k]:N}:N},I,N),K=k=>ir(W(i.mount?o:s,k,t.shouldUnregister?W(s,k,[]):[])),re=(k,N,I={})=>{const B=W(n,k);let J=N;if(B){const x=B._f;x&&(!x.disabled&&he(o,k,No(N,x)),J=ar(x.ref)&&Ve(N)?"":N,ko(x.ref)?[...x.ref.options].forEach(Q=>Q.selected=J.includes(Q.value)):x.refs?Mt(x.ref)?x.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(J)?Q.checked=!!J.find(le=>le===Q.value):Q.checked=J===Q.value||!!J)}):x.refs.forEach(Q=>Q.checked=Q.value===J):Tn(x.ref)?x.ref.value="":(x.ref.value=J,x.ref.type||h.state.next({name:k,values:ge(o)})))}(I.shouldDirty||I.shouldTouch)&&$(k,J,I.shouldTouch,I.shouldDirty,!0),I.shouldValidate&&M(k)},ye=(k,N,I)=>{for(const B in N){if(!N.hasOwnProperty(B))return;const J=N[B],x=k+"."+B,Q=W(n,x);(a.array.has(k)||Pe(J)||Q&&!Q._f)&&!ht(J)?ye(x,J,I):re(x,J,I)}},me=(k,N,I={})=>{const B=W(n,k),J=a.array.has(k),x=ge(N);he(o,k,x),J?(h.array.next({name:k,values:ge(o)}),(v.isDirty||v.dirtyFields||l.isDirty||l.dirtyFields)&&I.shouldDirty&&h.state.next({name:k,dirtyFields:Et(s,o),isDirty:V(k,x)})):B&&!B._f&&!Ve(x)?ye(k,x,I):re(k,x,I),Vn(k,a)?h.state.next({...r,name:k,values:ge(o)}):h.state.next({name:i.mount?k:void 0,values:ge(o)})},ue=async k=>{i.mount=!0;const N=k.target;let I=N.name,B=!0;const J=W(n,I),x=fe=>{B=Number.isNaN(fe)||ht(fe)&&isNaN(fe.getTime())||ut(fe,W(o,I,fe))},Q=kt(t.mode),le=kt(t.reValidateMode);if(J){let fe,ze;const gt=N.type?Io(J._f):Lf(k),ft=k.type===$o.BLUR||k.type===$o.FOCUS_OUT,xh=!sm(J._f)&&!t.resolver&&!W(r.errors,I)&&!J._f.deps||am(ft,W(r.touchedFields,I),r.isSubmitted,le,Q),ms=Vn(I,a,ft);he(o,I,gt),ft?(!N||!N.readOnly)&&(J._f.onBlur&&J._f.onBlur(k),c&&c(0)):J._f.onChange&&J._f.onChange(k);const hs=$(I,gt,ft),Lh=!Re(hs)||ms;if(!ft&&h.state.next({name:I,type:k.type,values:ge(o)}),xh)return(v.isValid||l.isValid)&&(t.mode==="onBlur"?ft&&p():ft||p()),Lh&&h.state.next({name:I,...ms?{}:hs});if(!ft&&ms&&h.state.next({...r}),t.resolver){const{errors:La}=await R([I]);if(_([I]),x(gt),B){const Kh=Co(r.errors,n,I),Ka=Co(La,n,Kh.name||I);fe=Ka.error,I=Ka.name,ze=Re(La)}}else _([I],!0),fe=(await Fn(J,a.disabled,o,w,t.shouldUseNativeValidation))[I],_([I]),x(gt),B&&(fe?ze=!1:(v.isValid||l.isValid)&&(ze=await L(n,!0)));B&&(J._f.deps&&(!Array.isArray(J._f.deps)||J._f.deps.length>0)&&M(J._f.deps),E(I,ze,fe,hs))}},Oe=(k,N)=>{if(W(r.errors,N)&&k.focus)return k.focus(),1},M=async(k,N={})=>{let I,B;const J=Fe(k);if(t.resolver){const x=await Z(ve(k)?k:J);I=Re(x),B=k?!J.some(Q=>W(x,Q)):I}else k?(B=(await Promise.all(J.map(async x=>{const Q=W(n,x);return await L(Q&&Q._f?{[x]:Q}:Q)}))).every(Boolean),!(!B&&!r.isValid)&&p()):B=I=await L(n);return h.state.next({...!Ue(k)||(v.isValid||l.isValid)&&I!==r.isValid?{}:{name:k},...t.resolver||!k?{isValid:I}:{},errors:r.errors}),N.shouldFocus&&!B&&Pt(n,Oe,k?J:a.mount),B},O=(k,N)=>{let I={...i.mount?o:s};return N&&(I=Eo(N.dirtyFields?r.dirtyFields:r.touchedFields,I)),ve(k)?I:Ue(k)?W(I,k):k.map(B=>W(I,B))},C=(k,N)=>({invalid:!!W((N||r).errors,k),isDirty:!!W((N||r).dirtyFields,k),error:W((N||r).errors,k),isValidating:!!W(r.validatingFields,k),isTouched:!!W((N||r).touchedFields,k)}),A=k=>{k&&Fe(k).forEach(N=>ke(r.errors,N)),h.state.next({errors:k?r.errors:{}})},b=(k,N,I)=>{const B=(W(n,k,{_f:{}})._f||{}).ref,J=W(r.errors,k)||{},{ref:x,message:Q,type:le,...fe}=J;he(r.errors,k,{...fe,...N,ref:B}),h.state.next({name:k,errors:r.errors,isValid:!1}),I&&I.shouldFocus&&B&&B.focus&&B.focus()},P=(k,N)=>He(k)?h.state.subscribe({next:I=>"values"in I&&k(U(void 0,N),I)}):U(k,N,!0),T=k=>h.state.subscribe({next:N=>{im(k.name,N.name,k.exact)&&om(N,k.formState||v,Le,k.reRenderRoot)&&k.callback({values:{...o},...r,...N,defaultValues:s})}}).unsubscribe,G=k=>(i.mount=!0,l={...l,...k.formState},T({...k,formState:{...m,...k.formState}})),Y=(k,N={})=>{for(const I of k?Fe(k):a.mount)a.mount.delete(I),a.array.delete(I),N.keepValue||(ke(n,I),ke(o,I)),!N.keepError&&ke(r.errors,I),!N.keepDirty&&ke(r.dirtyFields,I),!N.keepTouched&&ke(r.touchedFields,I),!N.keepIsValidating&&ke(r.validatingFields,I),!t.shouldUnregister&&!N.keepDefaultValue&&ke(s,I);h.state.next({values:ge(o)}),h.state.next({...r,...N.keepDirty?{isDirty:V()}:{}}),!N.keepIsValid&&p()},ie=({disabled:k,name:N})=>{if(Xe(k)&&i.mount||k||a.disabled.has(N)){const J=a.disabled.has(N)!==!!k;k?a.disabled.add(N):a.disabled.delete(N),J&&i.mount&&!i.action&&p()}},ae=(k,N={})=>{let I=W(n,k);const B=Xe(N.disabled)||Xe(t.disabled);return he(n,k,{...I||{},_f:{...I&&I._f?I._f:{ref:{name:k}},name:k,mount:!0,...N}}),a.mount.add(k),I?ie({disabled:Xe(N.disabled)?N.disabled:t.disabled,name:k}):d(k,!0,N.value),{...B?{disabled:N.disabled||t.disabled}:{},...t.progressive?{required:!!N.required,min:Dt(N.min),max:Dt(N.max),minLength:Dt(N.minLength),maxLength:Dt(N.maxLength),pattern:Dt(N.pattern)}:{},name:k,onChange:ue,onBlur:ue,ref:J=>{if(J){ae(k,N),I=W(n,k);const x=ve(J.value)&&J.querySelectorAll&&J.querySelectorAll("input,select,textarea")[0]||J,Q=Xf(x),le=I._f.refs||[];if(Q?le.find(fe=>fe===x):x===I._f.ref)return;he(n,k,{_f:{...I._f,...Q?{refs:[...le.filter(Mn),x,...Array.isArray(W(s,k))?[{}]:[]],ref:{type:x.type,name:k}}:{ref:x}}}),d(k,!1,void 0,x)}else I=W(n,k,{}),I._f&&(I._f.mount=!1),(t.shouldUnregister||N.shouldUnregister)&&!(Jf(a.array,k)&&i.action)&&a.unMount.add(k)}}},j=()=>t.shouldFocusError&&Pt(n,Oe,a.mount),z=k=>{Xe(k)&&(h.state.next({disabled:k}),Pt(n,(N,I)=>{const B=W(n,I);B&&(N.disabled=B._f.disabled||k,Array.isArray(B._f.refs)&&B._f.refs.forEach(J=>{J.disabled=B._f.disabled||k}))},0,!1))},q=(k,N)=>async I=>{let B;I&&(I.preventDefault&&I.preventDefault(),I.persist&&I.persist());let J=ge(o);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:x,values:Q}=await R();_(),r.errors=x,J=ge(Q)}else await L(n);if(a.disabled.size)for(const x of a.disabled)ke(J,x);if(ke(r.errors,"root"),Re(r.errors)){h.state.next({errors:{}});try{await k(J,I)}catch(x){B=x}}else N&&await N({...r.errors},I),j(),setTimeout(j);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Re(r.errors)&&!B,submitCount:r.submitCount+1,errors:r.errors}),B)throw B},H=(k,N={})=>{W(n,k)&&(ve(N.defaultValue)?me(k,ge(W(s,k))):(me(k,N.defaultValue),he(s,k,ge(N.defaultValue))),N.keepTouched||ke(r.touchedFields,k),N.keepDirty||(ke(r.dirtyFields,k),r.isDirty=N.defaultValue?V(k,ge(W(s,k))):V()),N.keepError||(ke(r.errors,k),v.isValid&&p()),h.state.next({...r}))},X=(k,N={})=>{const I=k?ge(k):s,B=ge(I),J=Re(k),x=J?s:B;if(N.keepDefaultValues||(s=I),!N.keepValues){if(N.keepDirtyValues){const Q=new Set([...a.mount,...Object.keys(Et(s,o))]);for(const le of Array.from(Q)){const fe=W(r.dirtyFields,le),ze=W(o,le),gt=W(x,le);fe&&!ve(ze)?he(x,le,ze):!fe&&!ve(gt)&&me(le,gt)}}else{if(Nn&&ve(k))for(const Q of a.mount){const le=W(n,Q);if(le&&le._f){const fe=Array.isArray(le._f.refs)?le._f.refs[0]:le._f.ref;if(ar(fe)){const ze=fe.closest("form");if(ze){ze.reset();break}}}}if(N.keepFieldsRef)for(const Q of a.mount)me(Q,W(x,Q));else n={}}o=t.shouldUnregister?N.keepDefaultValues?ge(s):{}:ge(x),h.array.next({values:{...x}}),h.state.next({values:{...x}})}a={mount:N.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!v.isValid||!!N.keepIsValid||!!N.keepDirtyValues||!t.shouldUnregister&&!Re(x),i.watch=!!t.shouldUnregister,i.keepIsValid=!!N.keepIsValid,i.action=!1,N.keepErrors||(r.errors={}),h.state.next({submitCount:N.keepSubmitCount?r.submitCount:0,isDirty:J?!1:N.keepDirty?r.isDirty:!!(N.keepDefaultValues&&!ut(k,s)),isSubmitted:N.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:J?{}:N.keepDirtyValues?N.keepDefaultValues&&o?Et(s,o):r.dirtyFields:N.keepDefaultValues&&k?Et(s,k):N.keepDirty?r.dirtyFields:{},touchedFields:N.keepTouched?r.touchedFields:{},errors:N.keepErrors?r.errors:{},isSubmitSuccessful:N.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},se=(k,N)=>X(He(k)?k(o):k,{...t.resetOptions,...N}),je=(k,N={})=>{const I=W(n,k),B=I&&I._f;if(B){const J=B.refs?B.refs[0]:B.ref;J.focus&&setTimeout(()=>{J.focus(),N.shouldSelect&&He(J.select)&&J.select()})}},Le=k=>{r={...r,...k}},Ne={control:{register:ae,unregister:Y,getFieldState:C,handleSubmit:q,setError:b,_subscribe:T,_runSchema:R,_updateIsValidating:_,_focusError:j,_getWatch:U,_getDirty:V,_setValid:p,_setFieldArray:f,_setDisabledField:ie,_setErrors:g,_getFieldArray:K,_reset:X,_resetDefaultValues:()=>He(t.defaultValues)&&t.defaultValues().then(k=>{se(k,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:F,_disableForm:z,_subjects:h,_proxyFormState:v,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(k){i=k},get _defaultValues(){return s},get _names(){return a},set _names(k){a=k},get _formState(){return r},get _options(){return t},set _options(k){t={...t,...k}}},subscribe:G,trigger:M,register:ae,handleSubmit:q,watch:P,setValue:me,getValues:O,reset:se,resetField:H,clearErrors:A,unregister:Y,setError:b,setFocus:je,getFieldState:C};return{...Ne,formControl:Ne}}var dt=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},qn=(e,t,r={})=>r.shouldFocus||ve(r.shouldFocus)?r.focusName||`${e}.${ve(r.focusIndex)?t:r.focusIndex}.`:"",Zn=(e,t)=>[...e,...Fe(t)],Un=e=>Array.isArray(e)?e.map(()=>{}):void 0;function xn(e,t,r){return[...e.slice(0,t),...Fe(r),...e.slice(t)]}var Ln=(e,t,r)=>Array.isArray(e)?(ve(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],Kn=(e,t)=>[...Fe(t),...Fe(e)];function lm(e,t){let r=0;const n=[...e];for(const s of t)n.splice(s-r,1),r++;return ir(n).length?n:[]}var Jn=(e,t)=>ve(t)?[]:lm(e,Fe(t).sort((r,n)=>r-n)),Hn=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},Vo=(e,t,r)=>(e[t]=r,e);function Fo(e){const t=Gf(),{control:r=t,name:n,keyName:s="id",shouldUnregister:o,rules:i}=e,[a,c]=ee.useState(r._getFieldArray(n)),u=ee.useRef(r._getFieldArray(n).map(dt)),m=ee.useRef(!1);r._names.array.add(n),ee.useMemo(()=>i&&a.length>=0&&r.register(n,i),[r,n,a.length,i]),wo(()=>r._subjects.array.subscribe({next:({values:g,name:d})=>{if(d===n||!d){const $=W(g,n);Array.isArray($)&&(c($),u.current=$.map(dt))}}}).unsubscribe,[r,n]);const v=ee.useCallback(g=>{m.current=!0,r._setFieldArray(n,g)},[r,n]),l=(g,d)=>{const $=Fe(ge(g)),E=Zn(r._getFieldArray(n),$);r._names.focus=qn(n,E.length-1,d),u.current=Zn(u.current,$.map(dt)),v(E),c(E),r._setFieldArray(n,E,Zn,{argA:Un(g)})},h=(g,d)=>{const $=Fe(ge(g)),E=Kn(r._getFieldArray(n),$);r._names.focus=qn(n,0,d),u.current=Kn(u.current,$.map(dt)),v(E),c(E),r._setFieldArray(n,E,Kn,{argA:Un(g)})},w=g=>{const d=Jn(r._getFieldArray(n),g);u.current=Jn(u.current,g),v(d),c(d),!Array.isArray(W(r._fields,n))&&he(r._fields,n,void 0),r._setFieldArray(n,d,Jn,{argA:g})},S=(g,d,$)=>{const E=Fe(ge(d)),R=xn(r._getFieldArray(n),g,E);r._names.focus=qn(n,g,$),u.current=xn(u.current,g,E.map(dt)),v(R),c(R),r._setFieldArray(n,R,xn,{argA:g,argB:Un(d)})},p=(g,d)=>{const $=r._getFieldArray(n);Hn($,g,d),Hn(u.current,g,d),v($),c($),r._setFieldArray(n,$,Hn,{argA:g,argB:d},!1)},_=(g,d)=>{const $=r._getFieldArray(n);Ln($,g,d),Ln(u.current,g,d),v($),c($),r._setFieldArray(n,$,Ln,{argA:g,argB:d},!1)},f=(g,d)=>{const $=ge(d),E=Vo(r._getFieldArray(n),g,$);u.current=[...E].map((R,Z)=>!R||Z===g?dt():u.current[Z]),v(E),c([...E]),r._setFieldArray(n,E,Vo,{argA:g,argB:$},!0,!1)},y=g=>{const d=Fe(ge(g));u.current=d.map(dt),v([...d]),c([...d]),r._setFieldArray(n,[...d],$=>$,{},!0,!1)};return ee.useEffect(()=>{if(r._state.action=!1,Vn(n,r._names)&&r._subjects.state.next({...r._formState}),m.current&&(!kt(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!kt(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(g=>{r._updateIsValidating([n]);const d=W(g.errors,n),$=W(r._formState.errors,n);($?!d&&$.type||d&&($.type!==d.type||$.message!==d.message):d&&d.type)&&(d?he(r._formState.errors,n,d):ke(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const g=W(r._fields,n);g&&g._f&&!(kt(r._options.reValidateMode).isOnSubmit&&kt(r._options.mode).isOnSubmit)&&Fn(g,r._names.disabled,r._formValues,r._options.criteriaMode===Je.all,r._options.shouldUseNativeValidation,!0).then(d=>!Re(d)&&r._subjects.state.next({errors:Mo(r._formState.errors,d,n)}))}r._subjects.state.next({name:n,values:ge(r._formValues)}),r._names.focus&&Pt(r._fields,(g,d)=>{if(r._names.focus&&d.startsWith(r._names.focus)&&g.focus)return g.focus(),1}),r._names.focus="",r._setValid(),m.current=!1},[a,n,r]),ee.useEffect(()=>(!W(r._formValues,n)&&r._setFieldArray(n),()=>{const g=(d,$)=>{const E=W(r._fields,d);E&&E._f&&(E._f.mount=$)};r._options.shouldUnregister||o?r.unregister(n):g(n,!1)}),[n,r,s,o]),{swap:ee.useCallback(p,[v,n,r]),move:ee.useCallback(_,[v,n,r]),prepend:ee.useCallback(h,[v,n,r]),append:ee.useCallback(l,[v,n,r]),remove:ee.useCallback(w,[v,n,r]),insert:ee.useCallback(S,[v,n,r]),update:ee.useCallback(f,[v,n,r]),replace:ee.useCallback(y,[v,n,r]),fields:ee.useMemo(()=>a.map((g,d)=>({...g,[s]:u.current[d]||dt()})),[a,s])}}function fm(e={}){const t=ee.useRef(void 0),r=ee.useRef(void 0),[n,s]=ee.useState({isDirty:!1,isValidating:!1,isLoading:He(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:He(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!He(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=dm(e);t.current={...a,formState:n}}const o=t.current.control;return o._options=e,wo(()=>{const i=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),o._formState.isReady=!0,i},[o]),ee.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ee.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),ee.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),ee.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),ee.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),ee.useEffect(()=>{var i;e.values&&!ut(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((i=o._options.resetOptions)===null||i===void 0)&&i.keepIsValid||o._setValid(),r.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),ee.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=ee.useMemo(()=>Bf(n,o),[o,n]),t.current}const qo=(e,t,r)=>{if(e&&"reportValidity"in e){const n=W(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Gn=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?qo(n.ref,r,e):n&&n.refs&&n.refs.forEach(s=>qo(s,r,e))}},Zo=(e,t)=>{t.shouldUseNativeValidation&&Gn(e,t);const r={};for(const n in e){const s=W(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(mm(t.names||Object.keys(e),n)){const i=Object.assign({},W(r,n));he(i,"root",o),he(r,n,i)}else he(r,n,o)}return r},mm=(e,t)=>{const r=Uo(t);return e.some(n=>Uo(n).match(`^${r}\\.\\d+`))};function Uo(e){return e.replace(/\]|\[/g,"")}function xo(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function hm(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(m){return m.errors.forEach(function(v){return e.push(v)})}),t){var c=r[i].types,u=c&&c[n.code];r[i]=In(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r}function pm(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if(n.code==="invalid_union"&&n.errors.length>0){var a=n.errors[0][0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if(n.code==="invalid_union"&&n.errors.forEach(function(m){return m.forEach(function(v){return e.push(v)})}),t){var c=r[i].types,u=c&&c[n.code];r[i]=In(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r}function ym(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,s,o){try{return Promise.resolve(xo(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(i){return o.shouldUseNativeValidation&&Gn({},o),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:Zo(hm(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,s,o){try{return Promise.resolve(xo(function(){return Promise.resolve((r.mode==="sync"?gc:_c)(e,n,t)).then(function(i){return o.shouldUseNativeValidation&&Gn({},o),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(a){return a instanceof Sn})(i))return{values:{},errors:Zo(pm(i.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}function ur(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dr={exports:{}},Bn={},tt={},pt={},Wn={},Yn={},Xn={},Lo;function lr(){return Lo||(Lo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(f){if(super(),!e.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((y,g)=>`${y}${g}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((y,g)=>(g instanceof r&&(y[g.str]=(y[g.str]||0)+1),y),{})}}e._Code=n,e.nil=new n("");function s(_,...f){const y=[_[0]];let g=0;for(;g<f.length;)a(y,f[g]),y.push(_[++g]);return new n(y)}e._=s;const o=new n("+");function i(_,...f){const y=[h(_[0])];let g=0;for(;g<f.length;)y.push(o),a(y,f[g]),y.push(o,h(_[++g]));return c(y),new n(y)}e.str=i;function a(_,f){f instanceof n?_.push(...f._items):f instanceof r?_.push(f):_.push(v(f))}e.addCodeArg=a;function c(_){let f=1;for(;f<_.length-1;){if(_[f]===o){const y=u(_[f-1],_[f+1]);if(y!==void 0){_.splice(f-1,3,y);continue}_[f++]="+"}f++}}function u(_,f){if(f==='""')return _;if(_==='""')return f;if(typeof _=="string")return f instanceof r||_[_.length-1]!=='"'?void 0:typeof f!="string"?`${_.slice(0,-1)}${f}"`:f[0]==='"'?_.slice(0,-1)+f.slice(1):void 0;if(typeof f=="string"&&f[0]==='"'&&!(_ instanceof r))return`"${_}${f.slice(1)}`}function m(_,f){return f.emptyStr()?_:_.emptyStr()?f:i`${_}${f}`}e.strConcat=m;function v(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:h(Array.isArray(_)?_.join(","):_)}function l(_){return new n(h(_))}e.stringify=l;function h(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function w(_){return typeof _=="string"&&e.IDENTIFIER.test(_)?new n(`.${_}`):s`[${_}]`}e.getProperty=w;function S(_){if(typeof _=="string"&&e.IDENTIFIER.test(_))return new n(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}e.getEsmExportName=S;function p(_){return new n(_.toString())}e.regexpCode=p})(Xn)),Xn}var Qn={},Ko;function Jo(){return Ko||(Ko=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=lr();class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:u,parent:m}={}){this._names={},this._prefixes=u,this._parent=m}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const m=this._names[u]||this._nameGroup(u);return`${u}${m.index++}`}_nameGroup(u){var m,v;if(!((v=(m=this._parent)===null||m===void 0?void 0:m._prefixes)===null||v===void 0)&&v.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}}}e.Scope=s;class o extends t.Name{constructor(u,m){super(m),this.prefix=u}setValue(u,{property:m,itemIndex:v}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(m)}[${v}]`}}e.ValueScopeName=o;const i=(0,t._)`\n`;class a extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?i:t.nil}}get(){return this._scope}name(u){return new o(u,this._newName(u))}value(u,m){var v;if(m.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const l=this.toName(u),{prefix:h}=l,w=(v=m.key)!==null&&v!==void 0?v:m.ref;let S=this._values[h];if(S){const f=S.get(w);if(f)return f}else S=this._values[h]=new Map;S.set(w,l);const p=this._scope[h]||(this._scope[h]=[]),_=p.length;return p[_]=m.ref,l.setValue(m,{property:h,itemIndex:_}),l}getValue(u,m){const v=this._values[u];if(v)return v.get(m)}scopeRefs(u,m=this._values){return this._reduceValues(m,v=>{if(v.scopePath===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return(0,t._)`${u}${v.scopePath}`})}scopeCode(u=this._values,m,v){return this._reduceValues(u,l=>{if(l.value===void 0)throw new Error(`CodeGen: name "${l}" has no value`);return l.value.code},m,v)}_reduceValues(u,m,v={},l){let h=t.nil;for(const w in u){const S=u[w];if(!S)continue;const p=v[w]=v[w]||new Map;S.forEach(_=>{if(p.has(_))return;p.set(_,n.Started);let f=m(_);if(f){const y=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${y} ${_} = ${f};${this.opts._n}`}else if(f=l?.(_))h=(0,t._)`${h}${f}${this.opts._n}`;else throw new r(_);p.set(_,n.Completed)})}return h}}e.ValueScope=a})(Qn)),Qn}var Ho;function ne(){return Ho||(Ho=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=lr(),r=Jo();var n=lr();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Jo();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(b,P){return this}}class i extends o{constructor(b,P,T){super(),this.varKind=b,this.name=P,this.rhs=T}render({es5:b,_n:P}){const T=b?r.varKinds.var:this.varKind,G=this.rhs===void 0?"":` = ${this.rhs}`;return`${T} ${this.name}${G};`+P}optimizeNames(b,P){if(b[this.name.str])return this.rhs&&(this.rhs=K(this.rhs,b,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends o{constructor(b,P,T){super(),this.lhs=b,this.rhs=P,this.sideEffects=T}render({_n:b}){return`${this.lhs} = ${this.rhs};`+b}optimizeNames(b,P){if(!(this.lhs instanceof t.Name&&!b[this.lhs.str]&&!this.sideEffects))return this.rhs=K(this.rhs,b,P),this}get names(){const b=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(b,this.rhs)}}class c extends a{constructor(b,P,T,G){super(b,T,G),this.op=P}render({_n:b}){return`${this.lhs} ${this.op}= ${this.rhs};`+b}}class u extends o{constructor(b){super(),this.label=b,this.names={}}render({_n:b}){return`${this.label}:`+b}}class m extends o{constructor(b){super(),this.label=b,this.names={}}render({_n:b}){return`break${this.label?` ${this.label}`:""};`+b}}class v extends o{constructor(b){super(),this.error=b}render({_n:b}){return`throw ${this.error};`+b}get names(){return this.error.names}}class l extends o{constructor(b){super(),this.code=b}render({_n:b}){return`${this.code};`+b}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(b,P){return this.code=K(this.code,b,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(b=[]){super(),this.nodes=b}render(b){return this.nodes.reduce((P,T)=>P+T.render(b),"")}optimizeNodes(){const{nodes:b}=this;let P=b.length;for(;P--;){const T=b[P].optimizeNodes();Array.isArray(T)?b.splice(P,1,...T):T?b[P]=T:b.splice(P,1)}return b.length>0?this:void 0}optimizeNames(b,P){const{nodes:T}=this;let G=T.length;for(;G--;){const Y=T[G];Y.optimizeNames(b,P)||(re(b,Y.names),T.splice(G,1))}return T.length>0?this:void 0}get names(){return this.nodes.reduce((b,P)=>V(b,P.names),{})}}class w extends h{render(b){return"{"+b._n+super.render(b)+"}"+b._n}}class S extends h{}class p extends w{}p.kind="else";class _ extends w{constructor(b,P){super(P),this.condition=b}render(b){let P=`if(${this.condition})`+super.render(b);return this.else&&(P+="else "+this.else.render(b)),P}optimizeNodes(){super.optimizeNodes();const b=this.condition;if(b===!0)return this.nodes;let P=this.else;if(P){const T=P.optimizeNodes();P=this.else=Array.isArray(T)?new p(T):T}if(P)return b===!1?P instanceof _?P:P.nodes:this.nodes.length?this:new _(ye(b),P instanceof _?[P]:P.nodes);if(!(b===!1||!this.nodes.length))return this}optimizeNames(b,P){var T;if(this.else=(T=this.else)===null||T===void 0?void 0:T.optimizeNames(b,P),!!(super.optimizeNames(b,P)||this.else))return this.condition=K(this.condition,b,P),this}get names(){const b=super.names;return U(b,this.condition),this.else&&V(b,this.else.names),b}}_.kind="if";class f extends w{}f.kind="for";class y extends f{constructor(b){super(),this.iteration=b}render(b){return`for(${this.iteration})`+super.render(b)}optimizeNames(b,P){if(super.optimizeNames(b,P))return this.iteration=K(this.iteration,b,P),this}get names(){return V(super.names,this.iteration.names)}}class g extends f{constructor(b,P,T,G){super(),this.varKind=b,this.name=P,this.from=T,this.to=G}render(b){const P=b.es5?r.varKinds.var:this.varKind,{name:T,from:G,to:Y}=this;return`for(${P} ${T}=${G}; ${T}<${Y}; ${T}++)`+super.render(b)}get names(){const b=U(super.names,this.from);return U(b,this.to)}}class d extends f{constructor(b,P,T,G){super(),this.loop=b,this.varKind=P,this.name=T,this.iterable=G}render(b){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(b)}optimizeNames(b,P){if(super.optimizeNames(b,P))return this.iterable=K(this.iterable,b,P),this}get names(){return V(super.names,this.iterable.names)}}class $ extends w{constructor(b,P,T){super(),this.name=b,this.args=P,this.async=T}render(b){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(b)}}$.kind="func";class E extends h{render(b){return"return "+super.render(b)}}E.kind="return";class R extends w{render(b){let P="try"+super.render(b);return this.catch&&(P+=this.catch.render(b)),this.finally&&(P+=this.finally.render(b)),P}optimizeNodes(){var b,P;return super.optimizeNodes(),(b=this.catch)===null||b===void 0||b.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(b,P){var T,G;return super.optimizeNames(b,P),(T=this.catch)===null||T===void 0||T.optimizeNames(b,P),(G=this.finally)===null||G===void 0||G.optimizeNames(b,P),this}get names(){const b=super.names;return this.catch&&V(b,this.catch.names),this.finally&&V(b,this.finally.names),b}}class Z extends w{constructor(b){super(),this.error=b}render(b){return`catch(${this.error})`+super.render(b)}}Z.kind="catch";class L extends w{render(b){return"finally"+super.render(b)}}L.kind="finally";class F{constructor(b,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
|
|
40
|
-
`:""},this._extScope=b,this._scope=new r.Scope({parent:b}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(b){return this._scope.name(b)}scopeName(b){return this._extScope.name(b)}scopeValue(b,P){const T=this._extScope.value(b,P);return(this._values[T.prefix]||(this._values[T.prefix]=new Set)).add(T),T}getScopeValue(b,P){return this._extScope.getValue(b,P)}scopeRefs(b){return this._extScope.scopeRefs(b,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(b,P,T,G){const Y=this._scope.toName(P);return T!==void 0&&G&&(this._constants[Y.str]=T),this._leafNode(new i(b,Y,T)),Y}const(b,P,T){return this._def(r.varKinds.const,b,P,T)}let(b,P,T){return this._def(r.varKinds.let,b,P,T)}var(b,P,T){return this._def(r.varKinds.var,b,P,T)}assign(b,P,T){return this._leafNode(new a(b,P,T))}add(b,P){return this._leafNode(new c(b,e.operators.ADD,P))}code(b){return typeof b=="function"?b():b!==t.nil&&this._leafNode(new l(b)),this}object(...b){const P=["{"];for(const[T,G]of b)P.length>1&&P.push(","),P.push(T),(T!==G||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,G));return P.push("}"),new t._Code(P)}if(b,P,T){if(this._blockNode(new _(b)),P&&T)this.code(P).else().code(T).endIf();else if(P)this.code(P).endIf();else if(T)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(b){return this._elseNode(new _(b))}else(){return this._elseNode(new p)}endIf(){return this._endBlockNode(_,p)}_for(b,P){return this._blockNode(b),P&&this.code(P).endFor(),this}for(b,P){return this._for(new y(b),P)}forRange(b,P,T,G,Y=this.opts.es5?r.varKinds.var:r.varKinds.let){const ie=this._scope.toName(b);return this._for(new g(Y,ie,P,T),()=>G(ie))}forOf(b,P,T,G=r.varKinds.const){const Y=this._scope.toName(b);if(this.opts.es5){const ie=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,t._)`${ie}.length`,ae=>{this.var(Y,(0,t._)`${ie}[${ae}]`),T(Y)})}return this._for(new d("of",G,Y,P),()=>T(Y))}forIn(b,P,T,G=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(b,(0,t._)`Object.keys(${P})`,T);const Y=this._scope.toName(b);return this._for(new d("in",G,Y,P),()=>T(Y))}endFor(){return this._endBlockNode(f)}label(b){return this._leafNode(new u(b))}break(b){return this._leafNode(new m(b))}return(b){const P=new E;if(this._blockNode(P),this.code(b),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(b,P,T){if(!P&&!T)throw new Error('CodeGen: "try" without "catch" and "finally"');const G=new R;if(this._blockNode(G),this.code(b),P){const Y=this.name("e");this._currNode=G.catch=new Z(Y),P(Y)}return T&&(this._currNode=G.finally=new L,this.code(T)),this._endBlockNode(Z,L)}throw(b){return this._leafNode(new v(b))}block(b,P){return this._blockStarts.push(this._nodes.length),b&&this.code(b).endBlock(P),this}endBlock(b){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const T=this._nodes.length-P;if(T<0||b!==void 0&&T!==b)throw new Error(`CodeGen: wrong number of nodes: ${T} vs ${b} expected`);return this._nodes.length=P,this}func(b,P=t.nil,T,G){return this._blockNode(new $(b,P,T)),G&&this.code(G).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(b=1){for(;b-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(b){return this._currNode.nodes.push(b),this}_blockNode(b){this._currNode.nodes.push(b),this._nodes.push(b)}_endBlockNode(b,P){const T=this._currNode;if(T instanceof b||P&&T instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${b.kind}/${P.kind}`:b.kind}"`)}_elseNode(b){const P=this._currNode;if(!(P instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=b,this}get _root(){return this._nodes[0]}get _currNode(){const b=this._nodes;return b[b.length-1]}set _currNode(b){const P=this._nodes;P[P.length-1]=b}}e.CodeGen=F;function V(A,b){for(const P in b)A[P]=(A[P]||0)+(b[P]||0);return A}function U(A,b){return b instanceof t._CodeOrName?V(A,b.names):A}function K(A,b,P){if(A instanceof t.Name)return T(A);if(!G(A))return A;return new t._Code(A._items.reduce((Y,ie)=>(ie instanceof t.Name&&(ie=T(ie)),ie instanceof t._Code?Y.push(...ie._items):Y.push(ie),Y),[]));function T(Y){const ie=P[Y.str];return ie===void 0||b[Y.str]!==1?Y:(delete b[Y.str],ie)}function G(Y){return Y instanceof t._Code&&Y._items.some(ie=>ie instanceof t.Name&&b[ie.str]===1&&P[ie.str]!==void 0)}}function re(A,b){for(const P in b)A[P]=(A[P]||0)-(b[P]||0)}function ye(A){return typeof A=="boolean"||typeof A=="number"||A===null?!A:(0,t._)`!${C(A)}`}e.not=ye;const me=O(e.operators.AND);function ue(...A){return A.reduce(me)}e.and=ue;const Oe=O(e.operators.OR);function M(...A){return A.reduce(Oe)}e.or=M;function O(A){return(b,P)=>b===t.nil?P:P===t.nil?b:(0,t._)`${C(b)} ${A} ${C(P)}`}function C(A){return A instanceof t.Name?A:(0,t._)`(${A})`}})(Yn)),Yn}var oe={},Go;function ce(){if(Go)return oe;Go=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.checkStrictMode=oe.getErrorPath=oe.Type=oe.useFunc=oe.setEvaluated=oe.evaluatedPropsToName=oe.mergeEvaluated=oe.eachItem=oe.unescapeJsonPointer=oe.escapeJsonPointer=oe.escapeFragment=oe.unescapeFragment=oe.schemaRefOrVal=oe.schemaHasRulesButRef=oe.schemaHasRules=oe.checkUnknownRules=oe.alwaysValidSchema=oe.toHash=void 0;const e=ne(),t=lr();function r(d){const $={};for(const E of d)$[E]=!0;return $}oe.toHash=r;function n(d,$){return typeof $=="boolean"?$:Object.keys($).length===0?!0:(s(d,$),!o($,d.self.RULES.all))}oe.alwaysValidSchema=n;function s(d,$=d.schema){const{opts:E,self:R}=d;if(!E.strictSchema||typeof $=="boolean")return;const Z=R.RULES.keywords;for(const L in $)Z[L]||g(d,`unknown keyword: "${L}"`)}oe.checkUnknownRules=s;function o(d,$){if(typeof d=="boolean")return!d;for(const E in d)if($[E])return!0;return!1}oe.schemaHasRules=o;function i(d,$){if(typeof d=="boolean")return!d;for(const E in d)if(E!=="$ref"&&$.all[E])return!0;return!1}oe.schemaHasRulesButRef=i;function a({topSchemaRef:d,schemaPath:$},E,R,Z){if(!Z){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,e._)`${E}`}return(0,e._)`${d}${$}${(0,e.getProperty)(R)}`}oe.schemaRefOrVal=a;function c(d){return v(decodeURIComponent(d))}oe.unescapeFragment=c;function u(d){return encodeURIComponent(m(d))}oe.escapeFragment=u;function m(d){return typeof d=="number"?`${d}`:d.replace(/~/g,"~0").replace(/\//g,"~1")}oe.escapeJsonPointer=m;function v(d){return d.replace(/~1/g,"/").replace(/~0/g,"~")}oe.unescapeJsonPointer=v;function l(d,$){if(Array.isArray(d))for(const E of d)$(E);else $(d)}oe.eachItem=l;function h({mergeNames:d,mergeToName:$,mergeValues:E,resultToName:R}){return(Z,L,F,V)=>{const U=F===void 0?L:F instanceof e.Name?(L instanceof e.Name?d(Z,L,F):$(Z,L,F),F):L instanceof e.Name?($(Z,F,L),L):E(L,F);return V===e.Name&&!(U instanceof e.Name)?R(Z,U):U}}oe.mergeEvaluated={props:h({mergeNames:(d,$,E)=>d.if((0,e._)`${E} !== true && ${$} !== undefined`,()=>{d.if((0,e._)`${$} === true`,()=>d.assign(E,!0),()=>d.assign(E,(0,e._)`${E} || {}`).code((0,e._)`Object.assign(${E}, ${$})`))}),mergeToName:(d,$,E)=>d.if((0,e._)`${E} !== true`,()=>{$===!0?d.assign(E,!0):(d.assign(E,(0,e._)`${E} || {}`),S(d,E,$))}),mergeValues:(d,$)=>d===!0?!0:{...d,...$},resultToName:w}),items:h({mergeNames:(d,$,E)=>d.if((0,e._)`${E} !== true && ${$} !== undefined`,()=>d.assign(E,(0,e._)`${$} === true ? true : ${E} > ${$} ? ${E} : ${$}`)),mergeToName:(d,$,E)=>d.if((0,e._)`${E} !== true`,()=>d.assign(E,$===!0?!0:(0,e._)`${E} > ${$} ? ${E} : ${$}`)),mergeValues:(d,$)=>d===!0?!0:Math.max(d,$),resultToName:(d,$)=>d.var("items",$)})};function w(d,$){if($===!0)return d.var("props",!0);const E=d.var("props",(0,e._)`{}`);return $!==void 0&&S(d,E,$),E}oe.evaluatedPropsToName=w;function S(d,$,E){Object.keys(E).forEach(R=>d.assign((0,e._)`${$}${(0,e.getProperty)(R)}`,!0))}oe.setEvaluated=S;const p={};function _(d,$){return d.scopeValue("func",{ref:$,code:p[$.code]||(p[$.code]=new t._Code($.code))})}oe.useFunc=_;var f;(function(d){d[d.Num=0]="Num",d[d.Str=1]="Str"})(f||(oe.Type=f={}));function y(d,$,E){if(d instanceof e.Name){const R=$===f.Num;return E?R?(0,e._)`"[" + ${d} + "]"`:(0,e._)`"['" + ${d} + "']"`:R?(0,e._)`"/" + ${d}`:(0,e._)`"/" + ${d}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,e.getProperty)(d).toString():"/"+m(d)}oe.getErrorPath=y;function g(d,$,E=d.opts.strictSchema){if(E){if($=`strict mode: ${$}`,E===!0)throw new Error($);d.self.logger.warn($)}}return oe.checkStrictMode=g,oe}var fr={},Bo;function Ge(){if(Bo)return fr;Bo=1,Object.defineProperty(fr,"__esModule",{value:!0});const e=ne(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return fr.default=t,fr}var Wo;function mr(){return Wo||(Wo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ne(),r=ce(),n=Ge();e.keywordError={message:({keyword:p})=>(0,t.str)`must pass "${p}" keyword validation`},e.keyword$DataError={message:({keyword:p,schemaType:_})=>_?(0,t.str)`"${p}" keyword must be ${_} ($data)`:(0,t.str)`"${p}" keyword is invalid ($data)`};function s(p,_=e.keywordError,f,y){const{it:g}=p,{gen:d,compositeRule:$,allErrors:E}=g,R=v(p,_,f);y??($||E)?c(d,R):u(g,(0,t._)`[${R}]`)}e.reportError=s;function o(p,_=e.keywordError,f){const{it:y}=p,{gen:g,compositeRule:d,allErrors:$}=y,E=v(p,_,f);c(g,E),d||$||u(y,n.default.vErrors)}e.reportExtraError=o;function i(p,_){p.assign(n.default.errors,_),p.if((0,t._)`${n.default.vErrors} !== null`,()=>p.if(_,()=>p.assign((0,t._)`${n.default.vErrors}.length`,_),()=>p.assign(n.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:p,keyword:_,schemaValue:f,data:y,errsCount:g,it:d}){if(g===void 0)throw new Error("ajv implementation error");const $=p.name("err");p.forRange("i",g,n.default.errors,E=>{p.const($,(0,t._)`${n.default.vErrors}[${E}]`),p.if((0,t._)`${$}.instancePath === undefined`,()=>p.assign((0,t._)`${$}.instancePath`,(0,t.strConcat)(n.default.instancePath,d.errorPath))),p.assign((0,t._)`${$}.schemaPath`,(0,t.str)`${d.errSchemaPath}/${_}`),d.opts.verbose&&(p.assign((0,t._)`${$}.schema`,f),p.assign((0,t._)`${$}.data`,y))})}e.extendErrors=a;function c(p,_){const f=p.const("err",_);p.if((0,t._)`${n.default.vErrors} === null`,()=>p.assign(n.default.vErrors,(0,t._)`[${f}]`),(0,t._)`${n.default.vErrors}.push(${f})`),p.code((0,t._)`${n.default.errors}++`)}function u(p,_){const{gen:f,validateName:y,schemaEnv:g}=p;g.$async?f.throw((0,t._)`new ${p.ValidationError}(${_})`):(f.assign((0,t._)`${y}.errors`,_),f.return(!1))}const m={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function v(p,_,f){const{createErrors:y}=p.it;return y===!1?(0,t._)`{}`:l(p,_,f)}function l(p,_,f={}){const{gen:y,it:g}=p,d=[h(g,f),w(p,f)];return S(p,_,d),y.object(...d)}function h({errorPath:p},{instancePath:_}){const f=_?(0,t.str)`${p}${(0,r.getErrorPath)(_,r.Type.Str)}`:p;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,f)]}function w({keyword:p,it:{errSchemaPath:_}},{schemaPath:f,parentSchema:y}){let g=y?_:(0,t.str)`${_}/${p}`;return f&&(g=(0,t.str)`${g}${(0,r.getErrorPath)(f,r.Type.Str)}`),[m.schemaPath,g]}function S(p,{params:_,message:f},y){const{keyword:g,data:d,schemaValue:$,it:E}=p,{opts:R,propertyName:Z,topSchemaRef:L,schemaPath:F}=E;y.push([m.keyword,g],[m.params,typeof _=="function"?_(p):_||(0,t._)`{}`]),R.messages&&y.push([m.message,typeof f=="function"?f(p):f]),R.verbose&&y.push([m.schema,$],[m.parentSchema,(0,t._)`${L}${F}`],[n.default.data,d]),Z&&y.push([m.propertyName,Z])}})(Wn)),Wn}var Yo;function vm(){if(Yo)return pt;Yo=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.boolOrEmptySchema=pt.topBoolOrEmptySchema=void 0;const e=mr(),t=ne(),r=Ge(),n={message:"boolean schema is false"};function s(a){const{gen:c,schema:u,validateName:m}=a;u===!1?i(a,!1):typeof u=="object"&&u.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${m}.errors`,null),c.return(!0))}pt.topBoolOrEmptySchema=s;function o(a,c){const{gen:u,schema:m}=a;m===!1?(u.var(c,!1),i(a)):u.var(c,!0)}pt.boolOrEmptySchema=o;function i(a,c){const{gen:u,data:m}=a,v={gen:u,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(v,n,void 0,c)}return pt}var Ae={},yt={},Xo;function Qo(){if(Xo)return yt;Xo=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.getRules=yt.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(s){return typeof s=="string"&&t.has(s)}yt.isJSONType=r;function n(){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 yt.getRules=n,yt}var rt={},ei;function ti(){if(ei)return rt;ei=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.shouldUseRule=rt.shouldUseGroup=rt.schemaHasRulesForType=void 0;function e({schema:n,self:s},o){const i=s.RULES.types[o];return i&&i!==!0&&t(n,i)}rt.schemaHasRulesForType=e;function t(n,s){return s.rules.some(o=>r(n,o))}rt.shouldUseGroup=t;function r(n,s){var o;return n[s.keyword]!==void 0||((o=s.definition.implements)===null||o===void 0?void 0:o.some(i=>n[i]!==void 0))}return rt.shouldUseRule=r,rt}var ri;function hr(){if(ri)return Ae;ri=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.reportTypeError=Ae.checkDataTypes=Ae.checkDataType=Ae.coerceAndCheckDataType=Ae.getJSONTypes=Ae.getSchemaTypes=Ae.DataType=void 0;const e=Qo(),t=ti(),r=mr(),n=ne(),s=ce();var o;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(o||(Ae.DataType=o={}));function i(f){const y=a(f.type);if(y.includes("null")){if(f.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!y.length&&f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&y.push("null")}return y}Ae.getSchemaTypes=i;function a(f){const y=Array.isArray(f)?f:f?[f]:[];if(y.every(e.isJSONType))return y;throw new Error("type must be JSONType or JSONType[]: "+y.join(","))}Ae.getJSONTypes=a;function c(f,y){const{gen:g,data:d,opts:$}=f,E=m(y,$.coerceTypes),R=y.length>0&&!(E.length===0&&y.length===1&&(0,t.schemaHasRulesForType)(f,y[0]));if(R){const Z=w(y,d,$.strictNumbers,o.Wrong);g.if(Z,()=>{E.length?v(f,y,E):p(f)})}return R}Ae.coerceAndCheckDataType=c;const u=new Set(["string","number","integer","boolean","null"]);function m(f,y){return y?f.filter(g=>u.has(g)||y==="array"&&g==="array"):[]}function v(f,y,g){const{gen:d,data:$,opts:E}=f,R=d.let("dataType",(0,n._)`typeof ${$}`),Z=d.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&d.if((0,n._)`${R} == 'object' && Array.isArray(${$}) && ${$}.length == 1`,()=>d.assign($,(0,n._)`${$}[0]`).assign(R,(0,n._)`typeof ${$}`).if(w(y,$,E.strictNumbers),()=>d.assign(Z,$))),d.if((0,n._)`${Z} !== undefined`);for(const F of g)(u.has(F)||F==="array"&&E.coerceTypes==="array")&&L(F);d.else(),p(f),d.endIf(),d.if((0,n._)`${Z} !== undefined`,()=>{d.assign($,Z),l(f,Z)});function L(F){switch(F){case"string":d.elseIf((0,n._)`${R} == "number" || ${R} == "boolean"`).assign(Z,(0,n._)`"" + ${$}`).elseIf((0,n._)`${$} === null`).assign(Z,(0,n._)`""`);return;case"number":d.elseIf((0,n._)`${R} == "boolean" || ${$} === null
|
|
39
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){o(i);continue}if(e.external){const u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){o(i);continue}}if(e.metadataRegistry.get(i[0])?.id){o(i);continue}if(a.cycle){o(i);continue}if(a.count>1&&e.reused==="ref"){o(i);continue}}}function oo(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=i=>{const a=e.seen.get(i);if(a.ref===null)return;const c=a.def??a.schema,u={...c},m=a.ref;if(a.ref=null,m){n(m);const f=e.seen.get(m),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):Object.assign(c,h),Object.assign(c,u),i._zod.parent===m)for(const S in c)S==="$ref"||S==="allOf"||S in u||delete c[S];if(h.$ref&&f.def)for(const S in c)S==="$ref"||S==="allOf"||S in f.def&&JSON.stringify(c[S])===JSON.stringify(f.def[S])&&delete c[S]}const y=i._zod.parent;if(y&&y!==m){n(y);const f=e.seen.get(y);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(const h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}e.override({zodSchema:i,jsonSchema:c,path:a.path??[]})};for(const i of[...e.seen.entries()].reverse())n(i[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(i)}Object.assign(s,r.def??r.schema);const o=e.external?.defs??{};for(const i of e.seen.entries()){const a=i[1];a.def&&a.defId&&(o[a.defId]=a.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const i=JSON.parse(JSON.stringify(s));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:nr(t,"input",e.processors),output:nr(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function Ie(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Ie(n.element,r);if(n.type==="set")return Ie(n.valueType,r);if(n.type==="lazy")return Ie(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return Ie(n.innerType,r);if(n.type==="intersection")return Ie(n.left,r)||Ie(n.right,r);if(n.type==="record"||n.type==="map")return Ie(n.keyType,r)||Ie(n.valueType,r);if(n.type==="pipe")return Ie(n.in,r)||Ie(n.out,r);if(n.type==="object"){for(const s in n.shape)if(Ie(n.shape[s],r))return!0;return!1}if(n.type==="union"){for(const s of n.options)if(Ie(s,r))return!0;return!1}if(n.type==="tuple"){for(const s of n.items)if(Ie(s,r))return!0;return!!(n.rest&&Ie(n.rest,r))}return!1}const cl=(e,t={})=>r=>{const n=no({...r,processors:t});return Ee(e,n),so(n,e),oo(n,e)},nr=(e,t,r={})=>n=>{const{libraryOptions:s,target:o}=n??{},i=no({...s??{},target:o,io:t,processors:r});return Ee(e,i),so(i,e),oo(i,e)},ul={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},dl=(e,t,r,n)=>{const s=r;s.type="string";const{minimum:o,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof i=="number"&&(s.maxLength=i),a&&(s.format=ul[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),u&&(s.contentEncoding=u),c&&c.size>0){const m=[...c];m.length===1?s.pattern=m[0].source:m.length>1&&(s.allOf=[...m.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},ll=(e,t,r,n)=>{const s=r,{minimum:o,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:m}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=m,s.exclusiveMinimum=!0):s.exclusiveMinimum=m),typeof o=="number"&&(s.minimum=o,typeof m=="number"&&t.target!=="draft-04"&&(m>=o?delete s.minimum:delete s.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=u,s.exclusiveMaximum=!0):s.exclusiveMaximum=u),typeof i=="number"&&(s.maximum=i,typeof u=="number"&&t.target!=="draft-04"&&(u<=i?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},fl=(e,t,r,n)=>{r.type="boolean"},ml=(e,t,r,n)=>{r.not={}},hl=(e,t,r,n)=>{},pl=(e,t,r,n)=>{},yl=(e,t,r,n)=>{const s=e._zod.def,o=Ss(s.entries);o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),r.enum=o},vl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},gl=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},_l=(e,t,r,n)=>{const s=r,o=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(s.minItems=i),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=Ee(o.element,t,{...n,path:[...n.path,"items"]})},$l=(e,t,r,n)=>{const s=r,o=e._zod.def;s.type="object",s.properties={};const i=o.shape;for(const u in i)s.properties[u]=Ee(i[u],t,{...n,path:[...n.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const m=o.shape[u]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));c.size>0&&(s.required=Array.from(c)),o.catchall?._zod.def.type==="never"?s.additionalProperties=!1:o.catchall?o.catchall&&(s.additionalProperties=Ee(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},bl=(e,t,r,n)=>{const s=e._zod.def,o=s.inclusive===!1,i=s.options.map((a,c)=>Ee(a,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=i:r.anyOf=i},wl=(e,t,r,n)=>{const s=e._zod.def,o=Ee(s.left,t,{...n,path:[...n.path,"allOf",0]}),i=Ee(s.right,t,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(i)?i.allOf:[i]];r.allOf=c},Sl=(e,t,r,n)=>{const s=r,o=e._zod.def;s.type="object";const i=o.keyType,c=i._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){const m=Ee(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});s.patternProperties={};for(const y of c)s.patternProperties[y.source]=m}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=Ee(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),s.additionalProperties=Ee(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const u=i._zod.values;if(u){const m=[...u].filter(y=>typeof y=="string"||typeof y=="number");m.length>0&&(s.required=m)}},El=(e,t,r,n)=>{const s=e._zod.def,o=Ee(s.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=s.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},kl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType},Pl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},Ol=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},jl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType;let i;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},Al=(e,t,r,n)=>{const s=e._zod.def,o=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Ee(o,t,n);const i=t.seen.get(e);i.ref=o},Nl=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,r.readOnly=!0},io=(e,t,r,n)=>{const s=e._zod.def;Ee(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType},zl=(e,t,r,n)=>{const s=e._zod.innerType;Ee(s,t,n);const o=t.seen.get(e);o.ref=s},Rl=M("ZodISODateTime",(e,t)=>{Nu.init(e,t),we.init(e,t)});function Il(e){return Dd(Rl,e)}const Tl=M("ZodISODate",(e,t)=>{zu.init(e,t),we.init(e,t)});function Cl(e){return Vd(Tl,e)}const Ml=M("ZodISOTime",(e,t)=>{Ru.init(e,t),we.init(e,t)});function Dl(e){return Fd(Ml,e)}const Vl=M("ZodISODuration",(e,t)=>{Iu.init(e,t),we.init(e,t)});function Fl(e){return qd(Vl,e)}const Ge=M("ZodError",(e,t)=>{kn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>bc(e,r)},flatten:{value:r=>$c(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,$n,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,$n,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),ql=Bt(Ge),Zl=Wt(Ge),Ul=Yt(Ge),xl=Xt(Ge),Ll=Pc(Ge),Kl=Oc(Ge),Jl=jc(Ge),Gl=Ac(Ge),Hl=Nc(Ge),Bl=zc(Ge),Wl=Rc(Ge),Yl=Ic(Ge),be=M("ZodType",(e,t)=>(_e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:nr(e,"input"),output:nr(e,"output")}}),e.toJSONSchema=cl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ct(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>ut(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>ql(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ul(e,r,n),e.parseAsync=async(r,n)=>Zl(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>xl(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Ll(e,r,n),e.decode=(r,n)=>Kl(e,r,n),e.encodeAsync=async(r,n)=>Jl(e,r,n),e.decodeAsync=async(r,n)=>Gl(e,r,n),e.safeEncode=(r,n)=>Hl(e,r,n),e.safeDecode=(r,n)=>Bl(e,r,n),e.safeEncodeAsync=async(r,n)=>Wl(e,r,n),e.safeDecodeAsync=async(r,n)=>Yl(e,r,n),e.refine=(r,n)=>e.check(Jf(r,n)),e.superRefine=r=>e.check(Gf(r)),e.overwrite=r=>e.check(Et(r)),e.optional=()=>vo(e),e.exactOptional=()=>Rf(e),e.nullable=()=>go(e),e.nullish=()=>vo(go(e)),e.nonoptional=r=>Vf(e,r),e.array=()=>tt(e),e.or=r=>Nn([e,r]),e.and=r=>Of(e,r),e.transform=r=>$o(e,Nf(r)),e.default=r=>Cf(e,r),e.prefault=r=>Df(e,r),e.catch=r=>qf(e,r),e.pipe=r=>$o(e,r),e.readonly=()=>xf(e),e.describe=r=>{const n=e.clone();return Dt.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return Dt.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Dt.get(e);const n=e.clone();return Dt.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),ao=M("_ZodString",(e,t)=>{Pn.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>dl(e,n,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Gd(...n)),e.includes=(...n)=>e.check(Wd(...n)),e.startsWith=(...n)=>e.check(Yd(...n)),e.endsWith=(...n)=>e.check(Xd(...n)),e.min=(...n)=>e.check(rr(...n)),e.max=(...n)=>e.check(to(...n)),e.length=(...n)=>e.check(ro(...n)),e.nonempty=(...n)=>e.check(rr(1,...n)),e.lowercase=n=>e.check(Hd(n)),e.uppercase=n=>e.check(Bd(n)),e.trim=()=>e.check(el()),e.normalize=(...n)=>e.check(Qd(...n)),e.toLowerCase=()=>e.check(tl()),e.toUpperCase=()=>e.check(rl()),e.slugify=()=>e.check(nl())}),Xl=M("ZodString",(e,t)=>{Pn.init(e,t),ao.init(e,t),e.email=r=>e.check(yd(Ql,r)),e.url=r=>e.check(bd(ef,r)),e.jwt=r=>e.check(Md(yf,r)),e.emoji=r=>e.check(wd(tf,r)),e.guid=r=>e.check(Ys(co,r)),e.uuid=r=>e.check(vd(sr,r)),e.uuidv4=r=>e.check(gd(sr,r)),e.uuidv6=r=>e.check(_d(sr,r)),e.uuidv7=r=>e.check($d(sr,r)),e.nanoid=r=>e.check(Sd(rf,r)),e.guid=r=>e.check(Ys(co,r)),e.cuid=r=>e.check(Ed(nf,r)),e.cuid2=r=>e.check(kd(sf,r)),e.ulid=r=>e.check(Pd(of,r)),e.base64=r=>e.check(Id(mf,r)),e.base64url=r=>e.check(Td(hf,r)),e.xid=r=>e.check(Od(af,r)),e.ksuid=r=>e.check(jd(cf,r)),e.ipv4=r=>e.check(Ad(uf,r)),e.ipv6=r=>e.check(Nd(df,r)),e.cidrv4=r=>e.check(zd(lf,r)),e.cidrv6=r=>e.check(Rd(ff,r)),e.e164=r=>e.check(Cd(pf,r)),e.datetime=r=>e.check(Il(r)),e.date=r=>e.check(Cl(r)),e.time=r=>e.check(Dl(r)),e.duration=r=>e.check(Fl(r))});function Te(e){return pd(Xl,e)}const we=M("ZodStringFormat",(e,t)=>{$e.init(e,t),ao.init(e,t)}),Ql=M("ZodEmail",(e,t)=>{bu.init(e,t),we.init(e,t)}),co=M("ZodGUID",(e,t)=>{_u.init(e,t),we.init(e,t)}),sr=M("ZodUUID",(e,t)=>{$u.init(e,t),we.init(e,t)}),ef=M("ZodURL",(e,t)=>{wu.init(e,t),we.init(e,t)}),tf=M("ZodEmoji",(e,t)=>{Su.init(e,t),we.init(e,t)}),rf=M("ZodNanoID",(e,t)=>{Eu.init(e,t),we.init(e,t)}),nf=M("ZodCUID",(e,t)=>{ku.init(e,t),we.init(e,t)}),sf=M("ZodCUID2",(e,t)=>{Pu.init(e,t),we.init(e,t)}),of=M("ZodULID",(e,t)=>{Ou.init(e,t),we.init(e,t)}),af=M("ZodXID",(e,t)=>{ju.init(e,t),we.init(e,t)}),cf=M("ZodKSUID",(e,t)=>{Au.init(e,t),we.init(e,t)}),uf=M("ZodIPv4",(e,t)=>{Tu.init(e,t),we.init(e,t)}),df=M("ZodIPv6",(e,t)=>{Cu.init(e,t),we.init(e,t)}),lf=M("ZodCIDRv4",(e,t)=>{Mu.init(e,t),we.init(e,t)}),ff=M("ZodCIDRv6",(e,t)=>{Du.init(e,t),we.init(e,t)}),mf=M("ZodBase64",(e,t)=>{Vu.init(e,t),we.init(e,t)}),hf=M("ZodBase64URL",(e,t)=>{qu.init(e,t),we.init(e,t)}),pf=M("ZodE164",(e,t)=>{Zu.init(e,t),we.init(e,t)}),yf=M("ZodJWT",(e,t)=>{xu.init(e,t),we.init(e,t)}),uo=M("ZodNumber",(e,t)=>{Vs.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>ll(e,n,s),e.gt=(n,s)=>e.check(Qs(n,s)),e.gte=(n,s)=>e.check(An(n,s)),e.min=(n,s)=>e.check(An(n,s)),e.lt=(n,s)=>e.check(Xs(n,s)),e.lte=(n,s)=>e.check(jn(n,s)),e.max=(n,s)=>e.check(jn(n,s)),e.int=n=>e.check(lo(n)),e.safe=n=>e.check(lo(n)),e.positive=n=>e.check(Qs(0,n)),e.nonnegative=n=>e.check(An(0,n)),e.negative=n=>e.check(Xs(0,n)),e.nonpositive=n=>e.check(jn(0,n)),e.multipleOf=(n,s)=>e.check(eo(n,s)),e.step=(n,s)=>e.check(eo(n,s)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Ue(e){return Zd(uo,e)}const vf=M("ZodNumberFormat",(e,t)=>{Lu.init(e,t),uo.init(e,t)});function lo(e){return Ud(vf,e)}const gf=M("ZodBoolean",(e,t)=>{Ku.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>fl(e,r,n)});function or(e){return xd(gf,e)}const _f=M("ZodAny",(e,t)=>{Ju.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>hl()});function fo(){return Ld(_f)}const $f=M("ZodUnknown",(e,t)=>{Gu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>pl()});function mo(){return Kd($f)}const bf=M("ZodNever",(e,t)=>{Hu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ml(e,r,n)});function wf(e){return Jd(bf,e)}const Sf=M("ZodArray",(e,t)=>{Bu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>_l(e,r,n,s),e.element=t.element,e.min=(r,n)=>e.check(rr(r,n)),e.nonempty=r=>e.check(rr(1,r)),e.max=(r,n)=>e.check(to(r,n)),e.length=(r,n)=>e.check(ro(r,n)),e.unwrap=()=>e.element});function tt(e,t){return sl(Sf,e,t)}const Ef=M("ZodObject",(e,t)=>{Yu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>$l(e,r,n,s),le(e,"shape",()=>t.shape),e.keyof=()=>po(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:mo()}),e.loose=()=>e.clone({...e._zod.def,catchall:mo()}),e.strict=()=>e.clone({...e._zod.def,catchall:wf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>pc(e,r),e.safeExtend=r=>yc(e,r),e.merge=r=>vc(e,r),e.pick=r=>mc(e,r),e.omit=r=>hc(e,r),e.partial=(...r)=>gc(yo,e,r[0]),e.required=(...r)=>_c(_o,e,r[0])});function ir(e,t){const r={type:"object",shape:e??{},...te(t)};return new Ef(r)}const kf=M("ZodUnion",(e,t)=>{Xu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>bl(e,r,n,s),e.options=t.options});function Nn(e,t){return new kf({type:"union",options:e,...te(t)})}const Pf=M("ZodIntersection",(e,t)=>{Qu.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>wl(e,r,n,s)});function Of(e,t){return new Pf({type:"intersection",left:e,right:t})}const jf=M("ZodRecord",(e,t)=>{ed.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Sl(e,r,n,s),e.keyType=t.keyType,e.valueType=t.valueType});function ho(e,t,r){return new jf({type:"record",keyType:e,valueType:t,...te(r)})}const zn=M("ZodEnum",(e,t)=>{td.init(e,t),be.init(e,t),e._zod.processJSONSchema=(n,s,o)=>yl(e,n,s),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const o={};for(const i of n)if(r.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new zn({...t,checks:[],...te(s),entries:o})},e.exclude=(n,s)=>{const o={...t.entries};for(const i of n)if(r.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new zn({...t,checks:[],...te(s),entries:o})}});function po(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new zn({type:"enum",entries:r,...te(t)})}const Af=M("ZodTransform",(e,t)=>{rd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>gl(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new bs(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(Mt(o,r.value,t));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(Mt(i))}};const s=t.transform(r.value,r);return s instanceof Promise?s.then(o=>(r.value=o,r)):(r.value=s,r)}});function Nf(e){return new Af({type:"transform",transform:e})}const yo=M("ZodOptional",(e,t)=>{Ks.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>io(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function vo(e){return new yo({type:"optional",innerType:e})}const zf=M("ZodExactOptional",(e,t)=>{nd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>io(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Rf(e){return new zf({type:"optional",innerType:e})}const If=M("ZodNullable",(e,t)=>{sd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>El(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function go(e){return new If({type:"nullable",innerType:e})}const Tf=M("ZodDefault",(e,t)=>{od.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Pl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Cf(e,t){return new Tf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Os(t)}})}const Mf=M("ZodPrefault",(e,t)=>{id.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ol(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Df(e,t){return new Mf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Os(t)}})}const _o=M("ZodNonOptional",(e,t)=>{ad.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>kl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Vf(e,t){return new _o({type:"nonoptional",innerType:e,...te(t)})}const Ff=M("ZodCatch",(e,t)=>{cd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>jl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qf(e,t){return new Ff({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Zf=M("ZodPipe",(e,t)=>{ud.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Al(e,r,n,s),e.in=t.in,e.out=t.out});function $o(e,t){return new Zf({type:"pipe",in:e,out:t})}const Uf=M("ZodReadonly",(e,t)=>{dd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Nl(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new Uf({type:"readonly",innerType:e})}const Lf=M("ZodLazy",(e,t)=>{ld.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>zl(e,r,n,s),e.unwrap=()=>e._zod.def.getter()});function lt(e){return new Lf({type:"lazy",getter:e})}const Kf=M("ZodCustom",(e,t)=>{fd.init(e,t),be.init(e,t),e._zod.processJSONSchema=(r,n,s)=>vl(e,r)});function Jf(e,t={}){return ol(Kf,e,t)}function Gf(e){return il(e)}const xe=ir({type:po(["string","number","integer","boolean","object","array","ref"]).optional(),title:Te().optional(),description:Te().optional(),default:fo().optional(),minimum:Ue().optional(),maximum:Ue().optional(),exclusiveMin:Ue().optional(),exclusiveMax:Ue().optional(),multipleOf:Ue().optional(),minLength:Ue().optional(),maxLength:Ue().optional(),minContains:Ue().optional(),maxContains:Ue().optional(),minProperties:Ue().optional(),maxProperties:Ue().optional(),isModifiable:or().optional(),"x-modifiable":tt(Te()).optional(),pattern:Te().optional(),format:Te().optional(),minItems:Ue().optional(),maxItems:Ue().optional(),uniqueItems:or().optional(),enum:tt(fo()).optional(),$id:Te().optional(),$schema:Te().optional(),$ref:Te().optional()}).extend({properties:lt(()=>ho(Te(),xe)).optional(),items:lt(()=>Nn([xe,tt(xe)])).optional(),required:tt(Te()).optional(),additionalProperties:lt(()=>Nn([or(),xe])).optional(),allOf:lt(()=>tt(xe)).optional(),anyOf:lt(()=>tt(xe)).optional(),oneOf:lt(()=>tt(xe)).optional(),not:lt(()=>xe).optional(),$defs:lt(()=>ho(Te(),xe)).optional()}),bo=ir({root:xe,properties:tt(ir({id:Te(),key:Te().min(1),isRequired:or(),schema:xe})),definitions:tt(ir({id:Te(),key:Te().min(1),schema:xe}))});var Vt=e=>e.type==="checkbox",yt=e=>e instanceof Date,Fe=e=>e==null;const wo=e=>typeof e=="object";var ke=e=>!Fe(e)&&!Array.isArray(e)&&wo(e)&&!yt(e),Hf=e=>ke(e)&&e.target?Vt(e.target)?e.target.checked:e.target.value:e,So=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Bf=(e,t)=>e.has(So(t)),Wf=e=>{const t=e.constructor&&e.constructor.prototype;return ke(t)&&t.hasOwnProperty("isPrototypeOf")},Rn=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ge(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Rn&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(ke(e)&&Wf(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=ge(e[s]));return n}var ar=e=>/^\w*$/.test(e),ve=e=>e===void 0,cr=e=>Array.isArray(e)?e.filter(Boolean):[],In=e=>cr(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Y=(e,t,r)=>{if(!t||!ke(e))return r;const n=(ar(t)?[t]:In(t)).reduce((s,o)=>Fe(s)?s:s[o],e);return ve(n)||n===e?ve(e[t])?r:e[t]:n},rt=e=>typeof e=="boolean",Be=e=>typeof e=="function",me=(e,t,r)=>{let n=-1;const s=ar(t)?[t]:In(t),o=s.length,i=o-1;for(;++n<o;){const a=s[n];let c=r;if(n!==i){const u=e[a];c=ke(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=c,e=e[a]}};const kt={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},He={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},We={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Tn="form",Eo="root",ko=ee.createContext(null);ko.displayName="HookFormControlContext";const Yf=()=>ee.useContext(ko);var Xf=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==He.all&&(t._proxyFormState[i]=!n||He.all),e[i]}});return s};const Po=typeof window<"u"?ee.useLayoutEffect:ee.useEffect;var Ce=e=>typeof e=="string",Qf=(e,t,r,n,s)=>Ce(e)?(n&&t.watch.add(e),Y(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),Y(r,o))):(n&&(t.watchAll=!0),r),Cn=e=>Fe(e)||!wo(e);function ft(e,t,r=new WeakSet){if(Cn(e)||Cn(t))return Object.is(e,t);if(yt(e)&&yt(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const i=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const a=t[o];if(yt(i)&&yt(a)||ke(i)&&ke(a)||Array.isArray(i)&&Array.isArray(a)?!ft(i,a,r):!Object.is(i,a))return!1}}return!0}const em=ee.createContext(null);em.displayName="HookFormContext";var Mn=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},qe=e=>Array.isArray(e)?e:[e],Oo=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function jo(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],o=t[n];if(s&&ke(s)&&o){const i=jo(s,o);ke(i)&&(r[n]=i)}else e[n]&&(r[n]=o)}return r}var ze=e=>ke(e)&&!Object.keys(e).length,Dn=e=>e.type==="file",ur=e=>{if(!Rn)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ao=e=>e.type==="select-multiple",Vn=e=>e.type==="radio",tm=e=>Vn(e)||Vt(e),Fn=e=>ur(e)&&e.isConnected;function rm(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=ve(e)?n++:e[t[n++]];return e}function nm(e){for(const t in e)if(e.hasOwnProperty(t)&&!ve(e[t]))return!1;return!0}function Pe(e,t){const r=Array.isArray(t)?t:ar(t)?[t]:In(t),n=r.length===1?e:rm(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(ke(n)&&ze(n)||Array.isArray(n)&&nm(n))&&Pe(e,r.slice(0,-1)),e}var sm=e=>{for(const t in e)if(Be(e[t]))return!0;return!1};function No(e){return Array.isArray(e)||ke(e)&&!sm(e)}function qn(e,t={}){for(const r in e){const n=e[r];No(n)?(t[r]=Array.isArray(n)?[]:{},qn(n,t[r])):ve(n)||(t[r]=!0)}return t}function Pt(e,t,r){r||(r=qn(t));for(const n in e){const s=e[n];if(No(s))ve(t)||Cn(r[n])?r[n]=qn(s,Array.isArray(s)?[]:{}):Pt(s,Fe(t)?{}:t[n],r[n]);else{const o=t[n];r[n]=!ft(s,o)}}return r}const zo={value:!1,isValid:!1},Ro={value:!0,isValid:!0};var Io=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ve(e[0].attributes.value)?ve(e[0].value)||e[0].value===""?Ro:{value:e[0].value,isValid:!0}:Ro:zo}return zo},To=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ve(e)?e:t?e===""?NaN:e&&+e:r&&Ce(e)?new Date(e):n?n(e):e;const Co={isValid:!1,value:null};var Mo=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Co):Co;function Do(e){const t=e.ref;return Dn(t)?t.files:Vn(t)?Mo(e.refs).value:Ao(t)?[...t.selectedOptions].map(({value:r})=>r):Vt(t)?Io(e.refs).value:To(ve(t.value)?e.ref.value:t.value,e)}var om=(e,t,r,n)=>{const s={};for(const o of e){const i=Y(t,o);i&&me(s,o,i._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},dr=e=>e instanceof RegExp,Ft=e=>ve(e)?e:dr(e)?e.source:ke(e)?dr(e.value)?e.value.source:e.value:e,Ot=e=>({isOnSubmit:!e||e===He.onSubmit,isOnBlur:e===He.onBlur,isOnChange:e===He.onChange,isOnAll:e===He.all,isOnTouch:e===He.onTouched});const Vo="AsyncFunction";var im=e=>!!e&&!!e.validate&&!!(Be(e.validate)&&e.validate.constructor.name===Vo||ke(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Vo)),am=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Zn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const jt=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=Y(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(jt(a,t))break}else if(ke(a)&&jt(a,t))break}}};function Fo(e,t,r){const n=Y(e,r);if(n||ar(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),i=Y(t,o),a=Y(e,o);if(i&&!Array.isArray(i)&&r!==o)return{name:r};if(a&&a.type)return{name:o,error:a};if(a&&a.root&&a.root.type)return{name:`${o}.root`,error:a.root};s.pop()}return{name:r}}var cm=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return ze(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!n||He.all))},um=(e,t,r)=>!e||!t||e===t||qe(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),dm=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,lm=(e,t)=>!cr(Y(e,t)).length&&Pe(e,t),qo=(e,t,r)=>{const n=qe(Y(e,r));return me(n,Eo,t[r]),me(e,r,n),e};function Zo(e,t,r="validate"){if(Ce(e)||Array.isArray(e)&&e.every(Ce)||rt(e)&&!e)return{type:r,message:Ce(e)?e:"",ref:t}}var At=e=>ke(e)&&!dr(e)?e:{value:e,message:""},Un=async(e,t,r,n,s,o)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:m,min:y,max:f,pattern:h,validate:w,name:S,valueAsNumber:p,mount:_}=e._f,l=Y(r,S);if(!_||t.has(S))return{};const v=a?a[0]:i,g=V=>{s&&v.reportValidity&&(v.setCustomValidity(rt(V)?"":V||""),v.reportValidity())},d={},$=Vn(i),E=Vt(i),R=$||E,Z=(p||Dn(i))&&ve(i.value)&&ve(l)||ur(i)&&i.value===""||l===""||Array.isArray(l)&&!l.length,K=Mn.bind(null,S,n,d),D=(V,q,L,re=We.maxLength,he=We.minLength)=>{const ye=V?q:L;d[S]={type:V?re:he,message:ye,ref:i,...K(V?re:he,ye)}};if(o?!Array.isArray(l)||!l.length:c&&(!R&&(Z||Fe(l))||rt(l)&&!l||E&&!Io(a).isValid||$&&!Mo(a).isValid)){const{value:V,message:q}=Ce(c)?{value:!!c,message:c}:At(c);if(V&&(d[S]={type:We.required,message:q,ref:v,...K(We.required,q)},!n))return g(q),d}if(!Z&&(!Fe(y)||!Fe(f))){let V,q;const L=At(f),re=At(y);if(!Fe(l)&&!isNaN(l)){const he=i.valueAsNumber||l&&+l;Fe(L.value)||(V=he>L.value),Fe(re.value)||(q=he<re.value)}else{const he=i.valueAsDate||new Date(l),ye=U=>new Date(new Date().toDateString()+" "+U),ce=i.type=="time",Ae=i.type=="week";Ce(L.value)&&l&&(V=ce?ye(l)>ye(L.value):Ae?l>L.value:he>new Date(L.value)),Ce(re.value)&&l&&(q=ce?ye(l)<ye(re.value):Ae?l<re.value:he<new Date(re.value))}if((V||q)&&(D(!!V,L.message,re.message,We.max,We.min),!n))return g(d[S].message),d}if((u||m)&&!Z&&(Ce(l)||o&&Array.isArray(l))){const V=At(u),q=At(m),L=!Fe(V.value)&&l.length>+V.value,re=!Fe(q.value)&&l.length<+q.value;if((L||re)&&(D(L,V.message,q.message),!n))return g(d[S].message),d}if(h&&!Z&&Ce(l)){const{value:V,message:q}=At(h);if(dr(V)&&!l.match(V)&&(d[S]={type:We.pattern,message:q,ref:i,...K(We.pattern,q)},!n))return g(q),d}if(w){if(Be(w)){const V=await w(l,r),q=Zo(V,v);if(q&&(d[S]={...q,...K(We.validate,q.message)},!n))return g(q.message),d}else if(ke(w)){let V={};for(const q in w){if(!ze(V)&&!n)break;const L=Zo(await w[q](l,r),v,q);L&&(V={...L,...K(q,L.message)},g(L.message),n&&(d[S]=V))}if(!ze(V)&&(d[S]={ref:v,...V},!n))return d}}return g(!0),d};const fm={mode:He.onSubmit,reValidateMode:He.onChange,shouldFocusError:!0};function mm(e={}){let t={...fm,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Be(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=ke(t.defaultValues)||ke(t.values)?ge(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:ge(s),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},y={...m};let f={...y};const h={array:Oo(),state:Oo()},w=t.criteriaMode===He.all,S=P=>A=>{clearTimeout(u),u=setTimeout(P,A)},p=async P=>{if(!i.keepIsValid&&!t.disabled&&(y.isValid||f.isValid||P)){let A;t.resolver?(A=ze((await R()).errors),_()):A=await D({fields:n,onlyCheckValid:!0,eventType:kt.VALID}),A!==r.isValid&&h.state.next({isValid:A})}},_=(P,A)=>{!t.disabled&&(y.isValidating||y.validatingFields||f.isValidating||f.validatingFields)&&((P||Array.from(a.mount)).forEach(I=>{I&&(A?me(r.validatingFields,I,A):Pe(r.validatingFields,I))}),h.state.next({validatingFields:r.validatingFields,isValidating:!ze(r.validatingFields)}))},l=(P,A=[],I,H,x=!0,G=!0)=>{if(H&&I&&!t.disabled){if(i.action=!0,G&&Array.isArray(Y(n,P))){const X=I(Y(n,P),H.argA,H.argB);x&&me(n,P,X)}if(G&&Array.isArray(Y(r.errors,P))){const X=I(Y(r.errors,P),H.argA,H.argB);x&&me(r.errors,P,X),lm(r.errors,P)}if((y.touchedFields||f.touchedFields)&&G&&Array.isArray(Y(r.touchedFields,P))){const X=I(Y(r.touchedFields,P),H.argA,H.argB);x&&me(r.touchedFields,P,X)}if(y.dirtyFields||f.dirtyFields){const X=Pt(s,o),se=So(P);me(r.dirtyFields,se,Y(X,se))}h.state.next({name:P,isDirty:q(P,A),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else me(o,P,A)},v=(P,A)=>{me(r.errors,P,A),h.state.next({errors:r.errors})},g=P=>{r.errors=P,h.state.next({errors:r.errors,isValid:!1})},d=(P,A,I,H)=>{const x=Y(n,P);if(x){const G=Y(o,P,ve(I)?Y(s,P):I);ve(G)||H&&H.defaultChecked||A?me(o,P,A?G:Do(x._f)):he(P,G),i.mount&&!i.action&&p()}},$=(P,A,I,H,x)=>{let G=!1,X=!1;const se={name:P};if(!t.disabled){if(!I||H){(y.isDirty||f.isDirty)&&(X=r.isDirty,r.isDirty=se.isDirty=q(),G=X!==se.isDirty);const fe=ft(Y(s,P),A);X=!!Y(r.dirtyFields,P),fe?Pe(r.dirtyFields,P):me(r.dirtyFields,P,!0),se.dirtyFields=r.dirtyFields,G=G||(y.dirtyFields||f.dirtyFields)&&X!==!fe}if(I){const fe=Y(r.touchedFields,P);fe||(me(r.touchedFields,P,I),se.touchedFields=r.touchedFields,G=G||(y.touchedFields||f.touchedFields)&&fe!==I)}G&&x&&h.state.next(se)}return G?se:{}},E=(P,A,I,H)=>{const x=Y(r.errors,P),G=(y.isValid||f.isValid)&&rt(A)&&r.isValid!==A;if(t.delayError&&I?(c=S(()=>v(P,I)),c(t.delayError)):(clearTimeout(u),c=null,I?me(r.errors,P,I):Pe(r.errors,P)),(I?!ft(x,I):x)||!ze(H)||G){const X={...H,...G&&rt(A)?{isValid:A}:{},errors:r.errors,name:P};r={...r,...X},h.state.next(X)}},R=async P=>(_(P,!0),await t.resolver(o,t.context,om(P||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),Z=async P=>{const{errors:A}=await R(P);if(_(P),P)for(const I of P){const H=Y(A,I);H?me(r.errors,I,H):Pe(r.errors,I)}else r.errors=A;return A},K=async({name:P,eventType:A})=>{if(e.validate){const I=await e.validate({formValues:o,formState:r,name:P,eventType:A});if(ke(I))for(const H in I)I[H]&&k(`${Tn}.${H}`,{message:Ce(I.message)?I.message:"",type:We.validate});else Ce(I)||!I?k(Tn,{message:I||"",type:We.validate}):b(Tn);return I}return!0},D=async({fields:P,onlyCheckValid:A,name:I,eventType:H,context:x={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(x.runRootValidation=!0,!await K({name:I,eventType:H})&&(x.valid=!1,A)))return x.valid;for(const G in P){const X=P[G];if(X){const{_f:se,...fe}=X;if(se){const Je=a.array.has(se.name),nt=X._f&&im(X._f);nt&&y.validatingFields&&_([se.name],!0);const Ze=await Un(X,a.disabled,o,w,t.shouldUseNativeValidation&&!A,Je);if(nt&&y.validatingFields&&_([se.name]),Ze[se.name]&&(x.valid=!1,A)||(!A&&(Y(Ze,se.name)?Je?qo(r.errors,Ze,se.name):me(r.errors,se.name,Ze[se.name]):Pe(r.errors,se.name)),e.shouldUseNativeValidation&&Ze[se.name]))break}!ze(fe)&&await D({context:x,onlyCheckValid:A,fields:fe,name:G,eventType:H})}}return x.valid},V=()=>{for(const P of a.unMount){const A=Y(n,P);A&&(A._f.refs?A._f.refs.every(I=>!Fn(I)):!Fn(A._f.ref))&&ue(P)}a.unMount=new Set},q=(P,A)=>!t.disabled&&(P&&A&&me(o,P,A),!ft(C(),s)),L=(P,A,I)=>Qf(P,a,{...i.mount?o:ve(A)?s:Ce(P)?{[P]:A}:A},I,A),re=P=>cr(Y(i.mount?o:s,P,t.shouldUnregister?Y(s,P,[]):[])),he=(P,A,I={})=>{const H=Y(n,P);let x=A;if(H){const G=H._f;G&&(!G.disabled&&me(o,P,To(A,G)),x=ur(G.ref)&&Fe(A)?"":A,Ao(G.ref)?[...G.ref.options].forEach(X=>X.selected=x.includes(X.value)):G.refs?Vt(G.ref)?G.refs.forEach(X=>{(!X.defaultChecked||!X.disabled)&&(Array.isArray(x)?X.checked=!!x.find(se=>se===X.value):X.checked=x===X.value||!!x)}):G.refs.forEach(X=>X.checked=X.value===x):Dn(G.ref)?G.ref.value="":(G.ref.value=x,G.ref.type||h.state.next({name:P,values:ge(o)})))}(I.shouldDirty||I.shouldTouch)&&$(P,x,I.shouldTouch,I.shouldDirty,!0),I.shouldValidate&&O(P)},ye=(P,A,I)=>{for(const H in A){if(!A.hasOwnProperty(H))return;const x=A[H],G=P+"."+H,X=Y(n,G);(a.array.has(P)||ke(x)||X&&!X._f)&&!yt(x)?ye(G,x,I):he(G,x,I)}},ce=(P,A,I={})=>{const H=Y(n,P),x=a.array.has(P),G=ge(A);me(o,P,G),x?(h.array.next({name:P,values:ge(o)}),(y.isDirty||y.dirtyFields||f.isDirty||f.dirtyFields)&&I.shouldDirty&&h.state.next({name:P,dirtyFields:Pt(s,o),isDirty:q(P,G)})):H&&!H._f&&!Fe(G)?ye(P,G,I):he(P,G,I),Zn(P,a)?h.state.next({...r,name:P,values:ge(o)}):h.state.next({name:i.mount?P:void 0,values:ge(o)})},Ae=async P=>{i.mount=!0;const A=P.target;let I=A.name,H=!0;const x=Y(n,I),G=fe=>{H=Number.isNaN(fe)||yt(fe)&&isNaN(fe.getTime())||ft(fe,Y(o,I,fe))},X=Ot(t.mode),se=Ot(t.reValidateMode);if(x){let fe,Je;const nt=A.type?Do(x._f):Hf(P),Ze=P.type===kt.BLUR||P.type===kt.FOCUS_OUT,Jh=!am(x._f)&&!e.validate&&!t.resolver&&!Y(r.errors,I)&&!x._f.deps||dm(Ze,Y(r.touchedFields,I),r.isSubmitted,se,X),ys=Zn(I,a,Ze);me(o,I,nt),Ze?(!A||!A.readOnly)&&(x._f.onBlur&&x._f.onBlur(P),c&&c(0)):x._f.onChange&&x._f.onChange(P);const vs=$(I,nt,Ze),Gh=!ze(vs)||ys;if(!Ze&&h.state.next({name:I,type:P.type,values:ge(o)}),Jh)return(y.isValid||f.isValid)&&(t.mode==="onBlur"?Ze&&p():Ze||p()),Gh&&h.state.next({name:I,...ys?{}:vs});if(!t.resolver&&e.validate&&await K({name:I,eventType:P.type}),!Ze&&ys&&h.state.next({...r}),t.resolver){const{errors:Ha}=await R([I]);if(_([I]),G(nt),H){const Hh=Fo(r.errors,n,I),Ba=Fo(Ha,n,Hh.name||I);fe=Ba.error,I=Ba.name,Je=ze(Ha)}}else _([I],!0),fe=(await Un(x,a.disabled,o,w,t.shouldUseNativeValidation))[I],_([I]),G(nt),H&&(fe?Je=!1:(y.isValid||f.isValid)&&(Je=await D({fields:n,onlyCheckValid:!0,name:I,eventType:P.type})));H&&(x._f.deps&&(!Array.isArray(x._f.deps)||x._f.deps.length>0)&&O(x._f.deps),E(I,Je,fe,vs))}},U=(P,A)=>{if(Y(r.errors,A)&&P.focus)return P.focus(),1},O=async(P,A={})=>{let I,H;const x=qe(P);if(t.resolver){const G=await Z(ve(P)?P:x);I=ze(G),H=P?!x.some(X=>Y(G,X)):I}else P?(H=(await Promise.all(x.map(async G=>{const X=Y(n,G);return await D({fields:X&&X._f?{[G]:X}:X,eventType:kt.TRIGGER})}))).every(Boolean),!(!H&&!r.isValid)&&p()):H=I=await D({fields:n,name:P,eventType:kt.TRIGGER});return h.state.next({...!Ce(P)||(y.isValid||f.isValid)&&I!==r.isValid?{}:{name:P},...t.resolver||!P?{isValid:I}:{},errors:r.errors}),A.shouldFocus&&!H&&jt(n,U,P?x:a.mount),H},C=(P,A)=>{let I={...i.mount?o:s};return A&&(I=jo(A.dirtyFields?r.dirtyFields:r.touchedFields,I)),ve(P)?I:Ce(P)?Y(I,P):P.map(H=>Y(I,H))},N=(P,A)=>({invalid:!!Y((A||r).errors,P),isDirty:!!Y((A||r).dirtyFields,P),error:Y((A||r).errors,P),isValidating:!!Y(r.validatingFields,P),isTouched:!!Y((A||r).touchedFields,P)}),b=P=>{const A=P?qe(P):void 0;A?.forEach(I=>Pe(r.errors,I)),A?A.forEach(I=>{h.state.next({name:I,errors:r.errors})}):h.state.next({errors:{}})},k=(P,A,I)=>{const H=(Y(n,P,{_f:{}})._f||{}).ref,x=Y(r.errors,P)||{},{ref:G,message:X,type:se,...fe}=x;me(r.errors,P,{...fe,...A,ref:H}),h.state.next({name:P,errors:r.errors,isValid:!1}),I&&I.shouldFocus&&H&&H.focus&&H.focus()},T=(P,A)=>Be(P)?h.state.subscribe({next:I=>"values"in I&&P(L(void 0,A),I)}):L(P,A,!0),B=P=>h.state.subscribe({next:A=>{um(P.name,A.name,P.exact)&&cm(A,P.formState||y,Re,P.reRenderRoot)&&P.callback({values:{...o},...r,...A,defaultValues:s})}}).unsubscribe,W=P=>(i.mount=!0,f={...f,...P.formState},B({...P,formState:{...m,...P.formState}})),ue=(P,A={})=>{for(const I of P?qe(P):a.mount)a.mount.delete(I),a.array.delete(I),A.keepValue||(Pe(n,I),Pe(o,I)),!A.keepError&&Pe(r.errors,I),!A.keepDirty&&Pe(r.dirtyFields,I),!A.keepTouched&&Pe(r.touchedFields,I),!A.keepIsValidating&&Pe(r.validatingFields,I),!t.shouldUnregister&&!A.keepDefaultValue&&Pe(s,I);h.state.next({values:ge(o)}),h.state.next({...r,...A.keepDirty?{isDirty:q()}:{}}),!A.keepIsValid&&p()},oe=({disabled:P,name:A})=>{if(rt(P)&&i.mount||P||a.disabled.has(A)){const x=a.disabled.has(A)!==!!P;P?a.disabled.add(A):a.disabled.delete(A),x&&i.mount&&!i.action&&p()}},j=(P,A={})=>{let I=Y(n,P);const H=rt(A.disabled)||rt(t.disabled);return me(n,P,{...I||{},_f:{...I&&I._f?I._f:{ref:{name:P}},name:P,mount:!0,...A}}),a.mount.add(P),I?oe({disabled:rt(A.disabled)?A.disabled:t.disabled,name:P}):d(P,!0,A.value),{...H?{disabled:A.disabled||t.disabled}:{},...t.progressive?{required:!!A.required,min:Ft(A.min),max:Ft(A.max),minLength:Ft(A.minLength),maxLength:Ft(A.maxLength),pattern:Ft(A.pattern)}:{},name:P,onChange:Ae,onBlur:Ae,ref:x=>{if(x){j(P,A),I=Y(n,P);const G=ve(x.value)&&x.querySelectorAll&&x.querySelectorAll("input,select,textarea")[0]||x,X=tm(G),se=I._f.refs||[];if(X?se.find(fe=>fe===G):G===I._f.ref)return;me(n,P,{_f:{...I._f,...X?{refs:[...se.filter(Fn),G,...Array.isArray(Y(s,P))?[{}]:[]],ref:{type:G.type,name:P}}:{ref:G}}}),d(P,!1,void 0,G)}else I=Y(n,P,{}),I._f&&(I._f.mount=!1),(t.shouldUnregister||A.shouldUnregister)&&!(Bf(a.array,P)&&i.action)&&a.unMount.add(P)}}},z=()=>t.shouldFocusError&&jt(n,U,a.mount),F=P=>{rt(P)&&(h.state.next({disabled:P}),jt(n,(A,I)=>{const H=Y(n,I);H&&(A.disabled=H._f.disabled||P,Array.isArray(H._f.refs)&&H._f.refs.forEach(x=>{x.disabled=H._f.disabled||P}))},0,!1))},J=(P,A)=>async I=>{let H;I&&(I.preventDefault&&I.preventDefault(),I.persist&&I.persist());let x=ge(o);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:G,values:X}=await R();_(),r.errors=G,x=ge(X)}else await D({fields:n,eventType:kt.SUBMIT});if(a.disabled.size)for(const G of a.disabled)Pe(x,G);if(Pe(r.errors,Eo),ze(r.errors)){h.state.next({errors:{}});try{await P(x,I)}catch(G){H=G}}else A&&await A({...r.errors},I),z(),setTimeout(z);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ze(r.errors)&&!H,submitCount:r.submitCount+1,errors:r.errors}),H)throw H},Q=(P,A={})=>{Y(n,P)&&(ve(A.defaultValue)?ce(P,ge(Y(s,P))):(ce(P,A.defaultValue),me(s,P,ge(A.defaultValue))),A.keepTouched||Pe(r.touchedFields,P),A.keepDirty||(Pe(r.dirtyFields,P),r.isDirty=A.defaultValue?q(P,ge(Y(s,P))):q()),A.keepError||(Pe(r.errors,P),y.isValid&&p()),h.state.next({...r}))},ie=(P,A={})=>{const I=P?ge(P):s,H=ge(I),x=ze(P),G=x?s:H;if(A.keepDefaultValues||(s=I),!A.keepValues){if(A.keepDirtyValues){const X=new Set([...a.mount,...Object.keys(Pt(s,o))]);for(const se of Array.from(X)){const fe=Y(r.dirtyFields,se),Je=Y(o,se),nt=Y(G,se);fe&&!ve(Je)?me(G,se,Je):!fe&&!ve(nt)&&ce(se,nt)}}else{if(Rn&&ve(P))for(const X of a.mount){const se=Y(n,X);if(se&&se._f){const fe=Array.isArray(se._f.refs)?se._f.refs[0]:se._f.ref;if(ur(fe)){const Je=fe.closest("form");if(Je){Je.reset();break}}}}if(A.keepFieldsRef)for(const X of a.mount)ce(X,Y(G,X));else n={}}o=t.shouldUnregister?A.keepDefaultValues?ge(s):{}:ge(G),h.array.next({values:{...G}}),h.state.next({values:{...G}})}a={mount:A.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!y.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!t.shouldUnregister&&!ze(G),i.watch=!!t.shouldUnregister,i.keepIsValid=!!A.keepIsValid,i.action=!1,A.keepErrors||(r.errors={}),h.state.next({submitCount:A.keepSubmitCount?r.submitCount:0,isDirty:x?!1:A.keepDirty?r.isDirty:!!(A.keepDefaultValues&&!ft(P,s)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:x?{}:A.keepDirtyValues?A.keepDefaultValues&&o?Pt(s,o):r.dirtyFields:A.keepDefaultValues&&P?Pt(s,P):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Oe=(P,A)=>ie(Be(P)?P(o):P,{...t.resetOptions,...A}),Ke=(P,A={})=>{const I=Y(n,P),H=I&&I._f;if(H){const x=H.refs?H.refs[0]:H.ref;x.focus&&setTimeout(()=>{x.focus(),A.shouldSelect&&Be(x.select)&&x.select()})}},Re=P=>{r={...r,...P}},je={control:{register:j,unregister:ue,getFieldState:N,handleSubmit:J,setError:k,_subscribe:B,_runSchema:R,_updateIsValidating:_,_focusError:z,_getWatch:L,_getDirty:q,_setValid:p,_setFieldArray:l,_setDisabledField:oe,_setErrors:g,_getFieldArray:re,_reset:ie,_resetDefaultValues:()=>Be(t.defaultValues)&&t.defaultValues().then(P=>{Oe(P,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:V,_disableForm:F,_subjects:h,_proxyFormState:y,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(P){i=P},get _defaultValues(){return s},get _names(){return a},set _names(P){a=P},get _formState(){return r},get _options(){return t},set _options(P){t={...t,...P}}},subscribe:W,trigger:O,register:j,handleSubmit:J,watch:T,setValue:ce,getValues:C,reset:Oe,resetField:Q,clearErrors:b,unregister:ue,setError:k,setFocus:Ke,getFieldState:N};return{...je,formControl:je}}var mt=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},xn=(e,t,r={})=>r.shouldFocus||ve(r.shouldFocus)?r.focusName||`${e}.${ve(r.focusIndex)?t:r.focusIndex}.`:"",Ln=(e,t)=>[...e,...qe(t)],Kn=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Jn(e,t,r){return[...e.slice(0,t),...qe(r),...e.slice(t)]}var Gn=(e,t,r)=>Array.isArray(e)?(ve(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[],Hn=(e,t)=>[...qe(t),...qe(e)];function hm(e,t){let r=0;const n=[...e];for(const s of t)n.splice(s-r,1),r++;return cr(n).length?n:[]}var Bn=(e,t)=>ve(t)?[]:hm(e,qe(t).sort((r,n)=>r-n)),Wn=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},Uo=(e,t,r)=>(e[t]=r,e);function xo(e){const t=Yf(),{control:r=t,name:n,keyName:s="id",shouldUnregister:o,rules:i}=e,[a,c]=ee.useState(r._getFieldArray(n)),u=ee.useRef(r._getFieldArray(n).map(mt)),m=ee.useRef(!1);r._names.array.add(n),ee.useMemo(()=>i&&a.length>=0&&r.register(n,i),[r,n,a.length,i]),Po(()=>r._subjects.array.subscribe({next:({values:g,name:d})=>{if(d===n||!d){const $=Y(g,n);Array.isArray($)&&(c($),u.current=$.map(mt))}}}).unsubscribe,[r,n]);const y=ee.useCallback(g=>{m.current=!0,r._setFieldArray(n,g)},[r,n]),f=(g,d)=>{const $=qe(ge(g)),E=Ln(r._getFieldArray(n),$);r._names.focus=xn(n,E.length-1,d),u.current=Ln(u.current,$.map(mt)),y(E),c(E),r._setFieldArray(n,E,Ln,{argA:Kn(g)})},h=(g,d)=>{const $=qe(ge(g)),E=Hn(r._getFieldArray(n),$);r._names.focus=xn(n,0,d),u.current=Hn(u.current,$.map(mt)),y(E),c(E),r._setFieldArray(n,E,Hn,{argA:Kn(g)})},w=g=>{const d=Bn(r._getFieldArray(n),g);u.current=Bn(u.current,g),y(d),c(d),!Array.isArray(Y(r._fields,n))&&me(r._fields,n,void 0),r._setFieldArray(n,d,Bn,{argA:g})},S=(g,d,$)=>{const E=qe(ge(d)),R=Jn(r._getFieldArray(n),g,E);r._names.focus=xn(n,g,$),u.current=Jn(u.current,g,E.map(mt)),y(R),c(R),r._setFieldArray(n,R,Jn,{argA:g,argB:Kn(d)})},p=(g,d)=>{const $=r._getFieldArray(n);Wn($,g,d),Wn(u.current,g,d),y($),c($),r._setFieldArray(n,$,Wn,{argA:g,argB:d},!1)},_=(g,d)=>{const $=r._getFieldArray(n);Gn($,g,d),Gn(u.current,g,d),y($),c($),r._setFieldArray(n,$,Gn,{argA:g,argB:d},!1)},l=(g,d)=>{const $=ge(d),E=Uo(r._getFieldArray(n),g,$);u.current=[...E].map((R,Z)=>!R||Z===g?mt():u.current[Z]),y(E),c([...E]),r._setFieldArray(n,E,Uo,{argA:g,argB:$},!0,!1)},v=g=>{const d=qe(ge(g));u.current=d.map(mt),y([...d]),c([...d]),r._setFieldArray(n,[...d],$=>$,{},!0,!1)};return ee.useEffect(()=>{if(r._state.action=!1,Zn(n,r._names)&&r._subjects.state.next({...r._formState}),m.current&&(!Ot(r._options.mode).isOnSubmit||r._formState.isSubmitted)&&!Ot(r._options.reValidateMode).isOnSubmit)if(r._options.resolver)r._runSchema([n]).then(g=>{r._updateIsValidating([n]);const d=Y(g.errors,n),$=Y(r._formState.errors,n);($?!d&&$.type||d&&($.type!==d.type||$.message!==d.message):d&&d.type)&&(d?me(r._formState.errors,n,d):Pe(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const g=Y(r._fields,n);g&&g._f&&!(Ot(r._options.reValidateMode).isOnSubmit&&Ot(r._options.mode).isOnSubmit)&&Un(g,r._names.disabled,r._formValues,r._options.criteriaMode===He.all,r._options.shouldUseNativeValidation,!0).then(d=>!ze(d)&&r._subjects.state.next({errors:qo(r._formState.errors,d,n)}))}r._subjects.state.next({name:n,values:ge(r._formValues)}),r._names.focus&&jt(r._fields,(g,d)=>{if(r._names.focus&&d.startsWith(r._names.focus)&&g.focus)return g.focus(),1}),r._names.focus="",r._setValid(),m.current=!1},[a,n,r]),ee.useEffect(()=>(!Y(r._formValues,n)&&r._setFieldArray(n),()=>{const g=(d,$)=>{const E=Y(r._fields,d);E&&E._f&&(E._f.mount=$)};r._options.shouldUnregister||o?r.unregister(n):g(n,!1)}),[n,r,s,o]),{swap:ee.useCallback(p,[y,n,r]),move:ee.useCallback(_,[y,n,r]),prepend:ee.useCallback(h,[y,n,r]),append:ee.useCallback(f,[y,n,r]),remove:ee.useCallback(w,[y,n,r]),insert:ee.useCallback(S,[y,n,r]),update:ee.useCallback(l,[y,n,r]),replace:ee.useCallback(v,[y,n,r]),fields:ee.useMemo(()=>a.map((g,d)=>({...g,[s]:u.current[d]||mt()})),[a,s])}}function pm(e={}){const t=ee.useRef(void 0),r=ee.useRef(void 0),[n,s]=ee.useState({isDirty:!1,isValidating:!1,isLoading:Be(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Be(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!Be(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...a}=mm(e);t.current={...a,formState:n}}const o=t.current.control;return o._options=e,Po(()=>{const i=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),o._formState.isReady=!0,i},[o]),ee.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ee.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),ee.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),ee.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),ee.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),ee.useEffect(()=>{var i;e.values&&!ft(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((i=o._options.resetOptions)===null||i===void 0)&&i.keepIsValid||o._setValid(),r.current=e.values,s(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),ee.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=ee.useMemo(()=>Xf(n,o),[o,n]),t.current}const Lo=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Y(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Yn=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Lo(n.ref,r,e):n&&n.refs&&n.refs.forEach(s=>Lo(s,r,e))}},Ko=(e,t)=>{t.shouldUseNativeValidation&&Yn(e,t);const r={};for(const n in e){const s=Y(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(ym(t.names||Object.keys(e),n)){const i=Object.assign({},Y(r,n));me(i,"root",o),me(r,n,i)}else me(r,n,o)}return r},ym=(e,t)=>{const r=Jo(t);return e.some(n=>Jo(n).match(`^${r}\\.\\d+`))};function Jo(e){return e.replace(/\]|\[/g,"")}function Go(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function vm(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(m){return m.errors.forEach(function(y){return e.push(y)})}),t){var c=r[i].types,u=c&&c[n.code];r[i]=Mn(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r}function gm(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,i=n.path.join(".");if(!r[i])if(n.code==="invalid_union"&&n.errors.length>0){var a=n.errors[0][0];r[i]={message:a.message,type:a.code}}else r[i]={message:o,type:s};if(n.code==="invalid_union"&&n.errors.forEach(function(m){return m.forEach(function(y){return e.push(y)})}),t){var c=r[i].types,u=c&&c[n.code];r[i]=Mn(i,t,r,s,u?[].concat(u,n.message):n.message)}e.shift()}return r}function _m(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,s,o){try{return Promise.resolve(Go(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(i){return o.shouldUseNativeValidation&&Yn({},o),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(a){return Array.isArray(a?.issues)})(i))return{values:{},errors:Ko(vm(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,s,o){try{return Promise.resolve(Go(function(){return Promise.resolve((r.mode==="sync"?wc:Sc)(e,n,t)).then(function(i){return o.shouldUseNativeValidation&&Yn({},o),{errors:{},values:r.raw?Object.assign({},n):i}})},function(i){if((function(a){return a instanceof kn})(i))return{values:{},errors:Ko(gm(i.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}function lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fr={exports:{}},Xn={},st={},vt={},Qn={},es={},ts={},Ho;function mr(){return Ho||(Ho=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(l){if(super(),!e.IDENTIFIER.test(l))throw new Error("CodeGen: name must be a valid identifier");this.str=l}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(l){super(),this._items=typeof l=="string"?[l]:l}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const l=this._items[0];return l===""||l==='""'}get str(){var l;return(l=this._str)!==null&&l!==void 0?l:this._str=this._items.reduce((v,g)=>`${v}${g}`,"")}get names(){var l;return(l=this._names)!==null&&l!==void 0?l:this._names=this._items.reduce((v,g)=>(g instanceof r&&(v[g.str]=(v[g.str]||0)+1),v),{})}}e._Code=n,e.nil=new n("");function s(_,...l){const v=[_[0]];let g=0;for(;g<l.length;)a(v,l[g]),v.push(_[++g]);return new n(v)}e._=s;const o=new n("+");function i(_,...l){const v=[h(_[0])];let g=0;for(;g<l.length;)v.push(o),a(v,l[g]),v.push(o,h(_[++g]));return c(v),new n(v)}e.str=i;function a(_,l){l instanceof n?_.push(...l._items):l instanceof r?_.push(l):_.push(y(l))}e.addCodeArg=a;function c(_){let l=1;for(;l<_.length-1;){if(_[l]===o){const v=u(_[l-1],_[l+1]);if(v!==void 0){_.splice(l-1,3,v);continue}_[l++]="+"}l++}}function u(_,l){if(l==='""')return _;if(_==='""')return l;if(typeof _=="string")return l instanceof r||_[_.length-1]!=='"'?void 0:typeof l!="string"?`${_.slice(0,-1)}${l}"`:l[0]==='"'?_.slice(0,-1)+l.slice(1):void 0;if(typeof l=="string"&&l[0]==='"'&&!(_ instanceof r))return`"${_}${l.slice(1)}`}function m(_,l){return l.emptyStr()?_:_.emptyStr()?l:i`${_}${l}`}e.strConcat=m;function y(_){return typeof _=="number"||typeof _=="boolean"||_===null?_:h(Array.isArray(_)?_.join(","):_)}function f(_){return new n(h(_))}e.stringify=f;function h(_){return JSON.stringify(_).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function w(_){return typeof _=="string"&&e.IDENTIFIER.test(_)?new n(`.${_}`):s`[${_}]`}e.getProperty=w;function S(_){if(typeof _=="string"&&e.IDENTIFIER.test(_))return new n(`${_}`);throw new Error(`CodeGen: invalid export name: ${_}, use explicit $id name mapping`)}e.getEsmExportName=S;function p(_){return new n(_.toString())}e.regexpCode=p})(ts)),ts}var rs={},Bo;function Wo(){return Bo||(Bo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=mr();class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:u,parent:m}={}){this._names={},this._prefixes=u,this._parent=m}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const m=this._names[u]||this._nameGroup(u);return`${u}${m.index++}`}_nameGroup(u){var m,y;if(!((y=(m=this._parent)===null||m===void 0?void 0:m._prefixes)===null||y===void 0)&&y.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}}}e.Scope=s;class o extends t.Name{constructor(u,m){super(m),this.prefix=u}setValue(u,{property:m,itemIndex:y}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(m)}[${y}]`}}e.ValueScopeName=o;const i=(0,t._)`\n`;class a extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?i:t.nil}}get(){return this._scope}name(u){return new o(u,this._newName(u))}value(u,m){var y;if(m.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const f=this.toName(u),{prefix:h}=f,w=(y=m.key)!==null&&y!==void 0?y:m.ref;let S=this._values[h];if(S){const l=S.get(w);if(l)return l}else S=this._values[h]=new Map;S.set(w,f);const p=this._scope[h]||(this._scope[h]=[]),_=p.length;return p[_]=m.ref,f.setValue(m,{property:h,itemIndex:_}),f}getValue(u,m){const y=this._values[u];if(y)return y.get(m)}scopeRefs(u,m=this._values){return this._reduceValues(m,y=>{if(y.scopePath===void 0)throw new Error(`CodeGen: name "${y}" has no value`);return(0,t._)`${u}${y.scopePath}`})}scopeCode(u=this._values,m,y){return this._reduceValues(u,f=>{if(f.value===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return f.value.code},m,y)}_reduceValues(u,m,y={},f){let h=t.nil;for(const w in u){const S=u[w];if(!S)continue;const p=y[w]=y[w]||new Map;S.forEach(_=>{if(p.has(_))return;p.set(_,n.Started);let l=m(_);if(l){const v=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${v} ${_} = ${l};${this.opts._n}`}else if(l=f?.(_))h=(0,t._)`${h}${l}${this.opts._n}`;else throw new r(_);p.set(_,n.Completed)})}return h}}e.ValueScope=a})(rs)),rs}var Yo;function ne(){return Yo||(Yo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=mr(),r=Wo();var n=mr();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Wo();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(b,k){return this}}class i extends o{constructor(b,k,T){super(),this.varKind=b,this.name=k,this.rhs=T}render({es5:b,_n:k}){const T=b?r.varKinds.var:this.varKind,B=this.rhs===void 0?"":` = ${this.rhs}`;return`${T} ${this.name}${B};`+k}optimizeNames(b,k){if(b[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,b,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends o{constructor(b,k,T){super(),this.lhs=b,this.rhs=k,this.sideEffects=T}render({_n:b}){return`${this.lhs} = ${this.rhs};`+b}optimizeNames(b,k){if(!(this.lhs instanceof t.Name&&!b[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,b,k),this}get names(){const b=this.lhs instanceof t.Name?{}:{...this.lhs.names};return q(b,this.rhs)}}class c extends a{constructor(b,k,T,B){super(b,T,B),this.op=k}render({_n:b}){return`${this.lhs} ${this.op}= ${this.rhs};`+b}}class u extends o{constructor(b){super(),this.label=b,this.names={}}render({_n:b}){return`${this.label}:`+b}}class m extends o{constructor(b){super(),this.label=b,this.names={}}render({_n:b}){return`break${this.label?` ${this.label}`:""};`+b}}class y extends o{constructor(b){super(),this.error=b}render({_n:b}){return`throw ${this.error};`+b}get names(){return this.error.names}}class f extends o{constructor(b){super(),this.code=b}render({_n:b}){return`${this.code};`+b}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(b,k){return this.code=L(this.code,b,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(b=[]){super(),this.nodes=b}render(b){return this.nodes.reduce((k,T)=>k+T.render(b),"")}optimizeNodes(){const{nodes:b}=this;let k=b.length;for(;k--;){const T=b[k].optimizeNodes();Array.isArray(T)?b.splice(k,1,...T):T?b[k]=T:b.splice(k,1)}return b.length>0?this:void 0}optimizeNames(b,k){const{nodes:T}=this;let B=T.length;for(;B--;){const W=T[B];W.optimizeNames(b,k)||(re(b,W.names),T.splice(B,1))}return T.length>0?this:void 0}get names(){return this.nodes.reduce((b,k)=>V(b,k.names),{})}}class w extends h{render(b){return"{"+b._n+super.render(b)+"}"+b._n}}class S extends h{}class p extends w{}p.kind="else";class _ extends w{constructor(b,k){super(k),this.condition=b}render(b){let k=`if(${this.condition})`+super.render(b);return this.else&&(k+="else "+this.else.render(b)),k}optimizeNodes(){super.optimizeNodes();const b=this.condition;if(b===!0)return this.nodes;let k=this.else;if(k){const T=k.optimizeNodes();k=this.else=Array.isArray(T)?new p(T):T}if(k)return b===!1?k instanceof _?k:k.nodes:this.nodes.length?this:new _(he(b),k instanceof _?[k]:k.nodes);if(!(b===!1||!this.nodes.length))return this}optimizeNames(b,k){var T;if(this.else=(T=this.else)===null||T===void 0?void 0:T.optimizeNames(b,k),!!(super.optimizeNames(b,k)||this.else))return this.condition=L(this.condition,b,k),this}get names(){const b=super.names;return q(b,this.condition),this.else&&V(b,this.else.names),b}}_.kind="if";class l extends w{}l.kind="for";class v extends l{constructor(b){super(),this.iteration=b}render(b){return`for(${this.iteration})`+super.render(b)}optimizeNames(b,k){if(super.optimizeNames(b,k))return this.iteration=L(this.iteration,b,k),this}get names(){return V(super.names,this.iteration.names)}}class g extends l{constructor(b,k,T,B){super(),this.varKind=b,this.name=k,this.from=T,this.to=B}render(b){const k=b.es5?r.varKinds.var:this.varKind,{name:T,from:B,to:W}=this;return`for(${k} ${T}=${B}; ${T}<${W}; ${T}++)`+super.render(b)}get names(){const b=q(super.names,this.from);return q(b,this.to)}}class d extends l{constructor(b,k,T,B){super(),this.loop=b,this.varKind=k,this.name=T,this.iterable=B}render(b){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(b)}optimizeNames(b,k){if(super.optimizeNames(b,k))return this.iterable=L(this.iterable,b,k),this}get names(){return V(super.names,this.iterable.names)}}class $ extends w{constructor(b,k,T){super(),this.name=b,this.args=k,this.async=T}render(b){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(b)}}$.kind="func";class E extends h{render(b){return"return "+super.render(b)}}E.kind="return";class R extends w{render(b){let k="try"+super.render(b);return this.catch&&(k+=this.catch.render(b)),this.finally&&(k+=this.finally.render(b)),k}optimizeNodes(){var b,k;return super.optimizeNodes(),(b=this.catch)===null||b===void 0||b.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(b,k){var T,B;return super.optimizeNames(b,k),(T=this.catch)===null||T===void 0||T.optimizeNames(b,k),(B=this.finally)===null||B===void 0||B.optimizeNames(b,k),this}get names(){const b=super.names;return this.catch&&V(b,this.catch.names),this.finally&&V(b,this.finally.names),b}}class Z extends w{constructor(b){super(),this.error=b}render(b){return`catch(${this.error})`+super.render(b)}}Z.kind="catch";class K extends w{render(b){return"finally"+super.render(b)}}K.kind="finally";class D{constructor(b,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
|
|
40
|
+
`:""},this._extScope=b,this._scope=new r.Scope({parent:b}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(b){return this._scope.name(b)}scopeName(b){return this._extScope.name(b)}scopeValue(b,k){const T=this._extScope.value(b,k);return(this._values[T.prefix]||(this._values[T.prefix]=new Set)).add(T),T}getScopeValue(b,k){return this._extScope.getValue(b,k)}scopeRefs(b){return this._extScope.scopeRefs(b,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(b,k,T,B){const W=this._scope.toName(k);return T!==void 0&&B&&(this._constants[W.str]=T),this._leafNode(new i(b,W,T)),W}const(b,k,T){return this._def(r.varKinds.const,b,k,T)}let(b,k,T){return this._def(r.varKinds.let,b,k,T)}var(b,k,T){return this._def(r.varKinds.var,b,k,T)}assign(b,k,T){return this._leafNode(new a(b,k,T))}add(b,k){return this._leafNode(new c(b,e.operators.ADD,k))}code(b){return typeof b=="function"?b():b!==t.nil&&this._leafNode(new f(b)),this}object(...b){const k=["{"];for(const[T,B]of b)k.length>1&&k.push(","),k.push(T),(T!==B||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,B));return k.push("}"),new t._Code(k)}if(b,k,T){if(this._blockNode(new _(b)),k&&T)this.code(k).else().code(T).endIf();else if(k)this.code(k).endIf();else if(T)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(b){return this._elseNode(new _(b))}else(){return this._elseNode(new p)}endIf(){return this._endBlockNode(_,p)}_for(b,k){return this._blockNode(b),k&&this.code(k).endFor(),this}for(b,k){return this._for(new v(b),k)}forRange(b,k,T,B,W=this.opts.es5?r.varKinds.var:r.varKinds.let){const ue=this._scope.toName(b);return this._for(new g(W,ue,k,T),()=>B(ue))}forOf(b,k,T,B=r.varKinds.const){const W=this._scope.toName(b);if(this.opts.es5){const ue=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${ue}.length`,oe=>{this.var(W,(0,t._)`${ue}[${oe}]`),T(W)})}return this._for(new d("of",B,W,k),()=>T(W))}forIn(b,k,T,B=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(b,(0,t._)`Object.keys(${k})`,T);const W=this._scope.toName(b);return this._for(new d("in",B,W,k),()=>T(W))}endFor(){return this._endBlockNode(l)}label(b){return this._leafNode(new u(b))}break(b){return this._leafNode(new m(b))}return(b){const k=new E;if(this._blockNode(k),this.code(b),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(b,k,T){if(!k&&!T)throw new Error('CodeGen: "try" without "catch" and "finally"');const B=new R;if(this._blockNode(B),this.code(b),k){const W=this.name("e");this._currNode=B.catch=new Z(W),k(W)}return T&&(this._currNode=B.finally=new K,this.code(T)),this._endBlockNode(Z,K)}throw(b){return this._leafNode(new y(b))}block(b,k){return this._blockStarts.push(this._nodes.length),b&&this.code(b).endBlock(k),this}endBlock(b){const k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");const T=this._nodes.length-k;if(T<0||b!==void 0&&T!==b)throw new Error(`CodeGen: wrong number of nodes: ${T} vs ${b} expected`);return this._nodes.length=k,this}func(b,k=t.nil,T,B){return this._blockNode(new $(b,k,T)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode($)}optimize(b=1){for(;b-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(b){return this._currNode.nodes.push(b),this}_blockNode(b){this._currNode.nodes.push(b),this._nodes.push(b)}_endBlockNode(b,k){const T=this._currNode;if(T instanceof b||k&&T instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${b.kind}/${k.kind}`:b.kind}"`)}_elseNode(b){const k=this._currNode;if(!(k instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=b,this}get _root(){return this._nodes[0]}get _currNode(){const b=this._nodes;return b[b.length-1]}set _currNode(b){const k=this._nodes;k[k.length-1]=b}}e.CodeGen=D;function V(N,b){for(const k in b)N[k]=(N[k]||0)+(b[k]||0);return N}function q(N,b){return b instanceof t._CodeOrName?V(N,b.names):N}function L(N,b,k){if(N instanceof t.Name)return T(N);if(!B(N))return N;return new t._Code(N._items.reduce((W,ue)=>(ue instanceof t.Name&&(ue=T(ue)),ue instanceof t._Code?W.push(...ue._items):W.push(ue),W),[]));function T(W){const ue=k[W.str];return ue===void 0||b[W.str]!==1?W:(delete b[W.str],ue)}function B(W){return W instanceof t._Code&&W._items.some(ue=>ue instanceof t.Name&&b[ue.str]===1&&k[ue.str]!==void 0)}}function re(N,b){for(const k in b)N[k]=(N[k]||0)-(b[k]||0)}function he(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,t._)`!${C(N)}`}e.not=he;const ye=O(e.operators.AND);function ce(...N){return N.reduce(ye)}e.and=ce;const Ae=O(e.operators.OR);function U(...N){return N.reduce(Ae)}e.or=U;function O(N){return(b,k)=>b===t.nil?k:k===t.nil?b:(0,t._)`${C(b)} ${N} ${C(k)}`}function C(N){return N instanceof t.Name?N:(0,t._)`(${N})`}})(es)),es}var ae={},Xo;function de(){if(Xo)return ae;Xo=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.checkStrictMode=ae.getErrorPath=ae.Type=ae.useFunc=ae.setEvaluated=ae.evaluatedPropsToName=ae.mergeEvaluated=ae.eachItem=ae.unescapeJsonPointer=ae.escapeJsonPointer=ae.escapeFragment=ae.unescapeFragment=ae.schemaRefOrVal=ae.schemaHasRulesButRef=ae.schemaHasRules=ae.checkUnknownRules=ae.alwaysValidSchema=ae.toHash=void 0;const e=ne(),t=mr();function r(d){const $={};for(const E of d)$[E]=!0;return $}ae.toHash=r;function n(d,$){return typeof $=="boolean"?$:Object.keys($).length===0?!0:(s(d,$),!o($,d.self.RULES.all))}ae.alwaysValidSchema=n;function s(d,$=d.schema){const{opts:E,self:R}=d;if(!E.strictSchema||typeof $=="boolean")return;const Z=R.RULES.keywords;for(const K in $)Z[K]||g(d,`unknown keyword: "${K}"`)}ae.checkUnknownRules=s;function o(d,$){if(typeof d=="boolean")return!d;for(const E in d)if($[E])return!0;return!1}ae.schemaHasRules=o;function i(d,$){if(typeof d=="boolean")return!d;for(const E in d)if(E!=="$ref"&&$.all[E])return!0;return!1}ae.schemaHasRulesButRef=i;function a({topSchemaRef:d,schemaPath:$},E,R,Z){if(!Z){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,e._)`${E}`}return(0,e._)`${d}${$}${(0,e.getProperty)(R)}`}ae.schemaRefOrVal=a;function c(d){return y(decodeURIComponent(d))}ae.unescapeFragment=c;function u(d){return encodeURIComponent(m(d))}ae.escapeFragment=u;function m(d){return typeof d=="number"?`${d}`:d.replace(/~/g,"~0").replace(/\//g,"~1")}ae.escapeJsonPointer=m;function y(d){return d.replace(/~1/g,"/").replace(/~0/g,"~")}ae.unescapeJsonPointer=y;function f(d,$){if(Array.isArray(d))for(const E of d)$(E);else $(d)}ae.eachItem=f;function h({mergeNames:d,mergeToName:$,mergeValues:E,resultToName:R}){return(Z,K,D,V)=>{const q=D===void 0?K:D instanceof e.Name?(K instanceof e.Name?d(Z,K,D):$(Z,K,D),D):K instanceof e.Name?($(Z,D,K),K):E(K,D);return V===e.Name&&!(q instanceof e.Name)?R(Z,q):q}}ae.mergeEvaluated={props:h({mergeNames:(d,$,E)=>d.if((0,e._)`${E} !== true && ${$} !== undefined`,()=>{d.if((0,e._)`${$} === true`,()=>d.assign(E,!0),()=>d.assign(E,(0,e._)`${E} || {}`).code((0,e._)`Object.assign(${E}, ${$})`))}),mergeToName:(d,$,E)=>d.if((0,e._)`${E} !== true`,()=>{$===!0?d.assign(E,!0):(d.assign(E,(0,e._)`${E} || {}`),S(d,E,$))}),mergeValues:(d,$)=>d===!0?!0:{...d,...$},resultToName:w}),items:h({mergeNames:(d,$,E)=>d.if((0,e._)`${E} !== true && ${$} !== undefined`,()=>d.assign(E,(0,e._)`${$} === true ? true : ${E} > ${$} ? ${E} : ${$}`)),mergeToName:(d,$,E)=>d.if((0,e._)`${E} !== true`,()=>d.assign(E,$===!0?!0:(0,e._)`${E} > ${$} ? ${E} : ${$}`)),mergeValues:(d,$)=>d===!0?!0:Math.max(d,$),resultToName:(d,$)=>d.var("items",$)})};function w(d,$){if($===!0)return d.var("props",!0);const E=d.var("props",(0,e._)`{}`);return $!==void 0&&S(d,E,$),E}ae.evaluatedPropsToName=w;function S(d,$,E){Object.keys(E).forEach(R=>d.assign((0,e._)`${$}${(0,e.getProperty)(R)}`,!0))}ae.setEvaluated=S;const p={};function _(d,$){return d.scopeValue("func",{ref:$,code:p[$.code]||(p[$.code]=new t._Code($.code))})}ae.useFunc=_;var l;(function(d){d[d.Num=0]="Num",d[d.Str=1]="Str"})(l||(ae.Type=l={}));function v(d,$,E){if(d instanceof e.Name){const R=$===l.Num;return E?R?(0,e._)`"[" + ${d} + "]"`:(0,e._)`"['" + ${d} + "']"`:R?(0,e._)`"/" + ${d}`:(0,e._)`"/" + ${d}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,e.getProperty)(d).toString():"/"+m(d)}ae.getErrorPath=v;function g(d,$,E=d.opts.strictSchema){if(E){if($=`strict mode: ${$}`,E===!0)throw new Error($);d.self.logger.warn($)}}return ae.checkStrictMode=g,ae}var hr={},Qo;function Ye(){if(Qo)return hr;Qo=1,Object.defineProperty(hr,"__esModule",{value:!0});const e=ne(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return hr.default=t,hr}var ei;function pr(){return ei||(ei=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ne(),r=de(),n=Ye();e.keywordError={message:({keyword:p})=>(0,t.str)`must pass "${p}" keyword validation`},e.keyword$DataError={message:({keyword:p,schemaType:_})=>_?(0,t.str)`"${p}" keyword must be ${_} ($data)`:(0,t.str)`"${p}" keyword is invalid ($data)`};function s(p,_=e.keywordError,l,v){const{it:g}=p,{gen:d,compositeRule:$,allErrors:E}=g,R=y(p,_,l);v??($||E)?c(d,R):u(g,(0,t._)`[${R}]`)}e.reportError=s;function o(p,_=e.keywordError,l){const{it:v}=p,{gen:g,compositeRule:d,allErrors:$}=v,E=y(p,_,l);c(g,E),d||$||u(v,n.default.vErrors)}e.reportExtraError=o;function i(p,_){p.assign(n.default.errors,_),p.if((0,t._)`${n.default.vErrors} !== null`,()=>p.if(_,()=>p.assign((0,t._)`${n.default.vErrors}.length`,_),()=>p.assign(n.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:p,keyword:_,schemaValue:l,data:v,errsCount:g,it:d}){if(g===void 0)throw new Error("ajv implementation error");const $=p.name("err");p.forRange("i",g,n.default.errors,E=>{p.const($,(0,t._)`${n.default.vErrors}[${E}]`),p.if((0,t._)`${$}.instancePath === undefined`,()=>p.assign((0,t._)`${$}.instancePath`,(0,t.strConcat)(n.default.instancePath,d.errorPath))),p.assign((0,t._)`${$}.schemaPath`,(0,t.str)`${d.errSchemaPath}/${_}`),d.opts.verbose&&(p.assign((0,t._)`${$}.schema`,l),p.assign((0,t._)`${$}.data`,v))})}e.extendErrors=a;function c(p,_){const l=p.const("err",_);p.if((0,t._)`${n.default.vErrors} === null`,()=>p.assign(n.default.vErrors,(0,t._)`[${l}]`),(0,t._)`${n.default.vErrors}.push(${l})`),p.code((0,t._)`${n.default.errors}++`)}function u(p,_){const{gen:l,validateName:v,schemaEnv:g}=p;g.$async?l.throw((0,t._)`new ${p.ValidationError}(${_})`):(l.assign((0,t._)`${v}.errors`,_),l.return(!1))}const m={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function y(p,_,l){const{createErrors:v}=p.it;return v===!1?(0,t._)`{}`:f(p,_,l)}function f(p,_,l={}){const{gen:v,it:g}=p,d=[h(g,l),w(p,l)];return S(p,_,d),v.object(...d)}function h({errorPath:p},{instancePath:_}){const l=_?(0,t.str)`${p}${(0,r.getErrorPath)(_,r.Type.Str)}`:p;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,l)]}function w({keyword:p,it:{errSchemaPath:_}},{schemaPath:l,parentSchema:v}){let g=v?_:(0,t.str)`${_}/${p}`;return l&&(g=(0,t.str)`${g}${(0,r.getErrorPath)(l,r.Type.Str)}`),[m.schemaPath,g]}function S(p,{params:_,message:l},v){const{keyword:g,data:d,schemaValue:$,it:E}=p,{opts:R,propertyName:Z,topSchemaRef:K,schemaPath:D}=E;v.push([m.keyword,g],[m.params,typeof _=="function"?_(p):_||(0,t._)`{}`]),R.messages&&v.push([m.message,typeof l=="function"?l(p):l]),R.verbose&&v.push([m.schema,$],[m.parentSchema,(0,t._)`${K}${D}`],[n.default.data,d]),Z&&v.push([m.propertyName,Z])}})(Qn)),Qn}var ti;function $m(){if(ti)return vt;ti=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.boolOrEmptySchema=vt.topBoolOrEmptySchema=void 0;const e=pr(),t=ne(),r=Ye(),n={message:"boolean schema is false"};function s(a){const{gen:c,schema:u,validateName:m}=a;u===!1?i(a,!1):typeof u=="object"&&u.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${m}.errors`,null),c.return(!0))}vt.topBoolOrEmptySchema=s;function o(a,c){const{gen:u,schema:m}=a;m===!1?(u.var(c,!1),i(a)):u.var(c,!0)}vt.boolOrEmptySchema=o;function i(a,c){const{gen:u,data:m}=a,y={gen:u,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(y,n,void 0,c)}return vt}var Ne={},gt={},ri;function ni(){if(ri)return gt;ri=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.getRules=gt.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(s){return typeof s=="string"&&t.has(s)}gt.isJSONType=r;function n(){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 gt.getRules=n,gt}var ot={},si;function oi(){if(si)return ot;si=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.shouldUseRule=ot.shouldUseGroup=ot.schemaHasRulesForType=void 0;function e({schema:n,self:s},o){const i=s.RULES.types[o];return i&&i!==!0&&t(n,i)}ot.schemaHasRulesForType=e;function t(n,s){return s.rules.some(o=>r(n,o))}ot.shouldUseGroup=t;function r(n,s){var o;return n[s.keyword]!==void 0||((o=s.definition.implements)===null||o===void 0?void 0:o.some(i=>n[i]!==void 0))}return ot.shouldUseRule=r,ot}var ii;function yr(){if(ii)return Ne;ii=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.reportTypeError=Ne.checkDataTypes=Ne.checkDataType=Ne.coerceAndCheckDataType=Ne.getJSONTypes=Ne.getSchemaTypes=Ne.DataType=void 0;const e=ni(),t=oi(),r=pr(),n=ne(),s=de();var o;(function(l){l[l.Correct=0]="Correct",l[l.Wrong=1]="Wrong"})(o||(Ne.DataType=o={}));function i(l){const v=a(l.type);if(v.includes("null")){if(l.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!v.length&&l.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');l.nullable===!0&&v.push("null")}return v}Ne.getSchemaTypes=i;function a(l){const v=Array.isArray(l)?l:l?[l]:[];if(v.every(e.isJSONType))return v;throw new Error("type must be JSONType or JSONType[]: "+v.join(","))}Ne.getJSONTypes=a;function c(l,v){const{gen:g,data:d,opts:$}=l,E=m(v,$.coerceTypes),R=v.length>0&&!(E.length===0&&v.length===1&&(0,t.schemaHasRulesForType)(l,v[0]));if(R){const Z=w(v,d,$.strictNumbers,o.Wrong);g.if(Z,()=>{E.length?y(l,v,E):p(l)})}return R}Ne.coerceAndCheckDataType=c;const u=new Set(["string","number","integer","boolean","null"]);function m(l,v){return v?l.filter(g=>u.has(g)||v==="array"&&g==="array"):[]}function y(l,v,g){const{gen:d,data:$,opts:E}=l,R=d.let("dataType",(0,n._)`typeof ${$}`),Z=d.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&d.if((0,n._)`${R} == 'object' && Array.isArray(${$}) && ${$}.length == 1`,()=>d.assign($,(0,n._)`${$}[0]`).assign(R,(0,n._)`typeof ${$}`).if(w(v,$,E.strictNumbers),()=>d.assign(Z,$))),d.if((0,n._)`${Z} !== undefined`);for(const D of g)(u.has(D)||D==="array"&&E.coerceTypes==="array")&&K(D);d.else(),p(l),d.endIf(),d.if((0,n._)`${Z} !== undefined`,()=>{d.assign($,Z),f(l,Z)});function K(D){switch(D){case"string":d.elseIf((0,n._)`${R} == "number" || ${R} == "boolean"`).assign(Z,(0,n._)`"" + ${$}`).elseIf((0,n._)`${$} === null`).assign(Z,(0,n._)`""`);return;case"number":d.elseIf((0,n._)`${R} == "boolean" || ${$} === null
|
|
41
41
|
|| (${R} == "string" && ${$} && ${$} == +${$})`).assign(Z,(0,n._)`+${$}`);return;case"integer":d.elseIf((0,n._)`${R} === "boolean" || ${$} === null
|
|
42
42
|
|| (${R} === "string" && ${$} && ${$} == +${$} && !(${$} % 1))`).assign(Z,(0,n._)`+${$}`);return;case"boolean":d.elseIf((0,n._)`${$} === "false" || ${$} === 0 || ${$} === null`).assign(Z,!1).elseIf((0,n._)`${$} === "true" || ${$} === 1`).assign(Z,!0);return;case"null":d.elseIf((0,n._)`${$} === "" || ${$} === 0 || ${$} === false`),d.assign(Z,null);return;case"array":d.elseIf((0,n._)`${R} === "string" || ${R} === "number"
|
|
43
|
-
|| ${R} === "boolean" || ${$} === null`).assign(Z,(0,n._)`[${$}]`)}}}function l({gen:f,parentData:y,parentDataProperty:g},d){f.if((0,n._)`${y} !== undefined`,()=>f.assign((0,n._)`${y}[${g}]`,d))}function h(f,y,g,d=o.Correct){const $=d===o.Correct?n.operators.EQ:n.operators.NEQ;let E;switch(f){case"null":return(0,n._)`${y} ${$} null`;case"array":E=(0,n._)`Array.isArray(${y})`;break;case"object":E=(0,n._)`${y} && typeof ${y} == "object" && !Array.isArray(${y})`;break;case"integer":E=R((0,n._)`!(${y} % 1) && !isNaN(${y})`);break;case"number":E=R();break;default:return(0,n._)`typeof ${y} ${$} ${f}`}return d===o.Correct?E:(0,n.not)(E);function R(Z=n.nil){return(0,n.and)((0,n._)`typeof ${y} == "number"`,Z,g?(0,n._)`isFinite(${y})`:n.nil)}}Ae.checkDataType=h;function w(f,y,g,d){if(f.length===1)return h(f[0],y,g,d);let $;const E=(0,s.toHash)(f);if(E.array&&E.object){const R=(0,n._)`typeof ${y} != "object"`;$=E.null?R:(0,n._)`!${y} || ${R}`,delete E.null,delete E.array,delete E.object}else $=n.nil;E.number&&delete E.integer;for(const R in E)$=(0,n.and)($,h(R,y,g,d));return $}Ae.checkDataTypes=w;const S={message:({schema:f})=>`must be ${f}`,params:({schema:f,schemaValue:y})=>typeof f=="string"?(0,n._)`{type: ${f}}`:(0,n._)`{type: ${y}}`};function p(f){const y=_(f);(0,r.reportError)(y,S)}Ae.reportTypeError=p;function _(f){const{gen:y,data:g,schema:d}=f,$=(0,s.schemaRefOrVal)(f,d,"type");return{gen:y,keyword:"type",data:g,schema:d.type,schemaCode:$,schemaValue:$,parentSchema:d,params:{},it:f}}return Ae}var Vt={},ni;function gm(){if(ni)return Vt;ni=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.assignDefaults=void 0;const e=ne(),t=ce();function r(s,o){const{properties:i,items:a}=s.schema;if(o==="object"&&i)for(const c in i)n(s,c,i[c].default);else o==="array"&&Array.isArray(a)&&a.forEach((c,u)=>n(s,u,c.default))}Vt.assignDefaults=r;function n(s,o,i){const{gen:a,compositeRule:c,data:u,opts:m}=s;if(i===void 0)return;const v=(0,e._)`${u}${(0,e.getProperty)(o)}`;if(c){(0,t.checkStrictMode)(s,`default is ignored for: ${v}`);return}let l=(0,e._)`${v} === undefined`;m.useDefaults==="empty"&&(l=(0,e._)`${l} || ${v} === null || ${v} === ""`),a.if(l,(0,e._)`${v} = ${(0,e.stringify)(i)}`)}return Vt}var Be={},pe={},si;function We(){if(si)return pe;si=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.validateUnion=pe.validateArray=pe.usePattern=pe.callValidateCode=pe.schemaProperties=pe.allSchemaProperties=pe.noPropertyInData=pe.propertyInData=pe.isOwnProperty=pe.hasPropFunc=pe.reportMissingProp=pe.checkMissingProp=pe.checkReportMissingProp=void 0;const e=ne(),t=ce(),r=Ge(),n=ce();function s(f,y){const{gen:g,data:d,it:$}=f;g.if(m(g,d,y,$.opts.ownProperties),()=>{f.setParams({missingProperty:(0,e._)`${y}`},!0),f.error()})}pe.checkReportMissingProp=s;function o({gen:f,data:y,it:{opts:g}},d,$){return(0,e.or)(...d.map(E=>(0,e.and)(m(f,y,E,g.ownProperties),(0,e._)`${$} = ${E}`)))}pe.checkMissingProp=o;function i(f,y){f.setParams({missingProperty:y},!0),f.error()}pe.reportMissingProp=i;function a(f){return f.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}pe.hasPropFunc=a;function c(f,y,g){return(0,e._)`${a(f)}.call(${y}, ${g})`}pe.isOwnProperty=c;function u(f,y,g,d){const $=(0,e._)`${y}${(0,e.getProperty)(g)} !== undefined`;return d?(0,e._)`${$} && ${c(f,y,g)}`:$}pe.propertyInData=u;function m(f,y,g,d){const $=(0,e._)`${y}${(0,e.getProperty)(g)} === undefined`;return d?(0,e.or)($,(0,e.not)(c(f,y,g))):$}pe.noPropertyInData=m;function v(f){return f?Object.keys(f).filter(y=>y!=="__proto__"):[]}pe.allSchemaProperties=v;function l(f,y){return v(y).filter(g=>!(0,t.alwaysValidSchema)(f,y[g]))}pe.schemaProperties=l;function h({schemaCode:f,data:y,it:{gen:g,topSchemaRef:d,schemaPath:$,errorPath:E},it:R},Z,L,F){const V=F?(0,e._)`${f}, ${y}, ${d}${$}`:y,U=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,E)],[r.default.parentData,R.parentData],[r.default.parentDataProperty,R.parentDataProperty],[r.default.rootData,r.default.rootData]];R.opts.dynamicRef&&U.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const K=(0,e._)`${V}, ${g.object(...U)}`;return L!==e.nil?(0,e._)`${Z}.call(${L}, ${K})`:(0,e._)`${Z}(${K})`}pe.callValidateCode=h;const w=(0,e._)`new RegExp`;function S({gen:f,it:{opts:y}},g){const d=y.unicodeRegExp?"u":"",{regExp:$}=y.code,E=$(g,d);return f.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,e._)`${$.code==="new RegExp"?w:(0,n.useFunc)(f,$)}(${g}, ${d})`})}pe.usePattern=S;function p(f){const{gen:y,data:g,keyword:d,it:$}=f,E=y.name("valid");if($.allErrors){const Z=y.let("valid",!0);return R(()=>y.assign(Z,!1)),Z}return y.var(E,!0),R(()=>y.break()),E;function R(Z){const L=y.const("len",(0,e._)`${g}.length`);y.forRange("i",0,L,F=>{f.subschema({keyword:d,dataProp:F,dataPropType:t.Type.Num},E),y.if((0,e.not)(E),Z)})}}pe.validateArray=p;function _(f){const{gen:y,schema:g,keyword:d,it:$}=f;if(!Array.isArray(g))throw new Error("ajv implementation error");if(g.some(L=>(0,t.alwaysValidSchema)($,L))&&!$.opts.unevaluated)return;const R=y.let("valid",!1),Z=y.name("_valid");y.block(()=>g.forEach((L,F)=>{const V=f.subschema({keyword:d,schemaProp:F,compositeRule:!0},Z);y.assign(R,(0,e._)`${R} || ${Z}`),f.mergeValidEvaluated(V,Z)||y.if((0,e.not)(R))})),f.result(R,()=>f.reset(),()=>f.error(!0))}return pe.validateUnion=_,pe}var oi;function _m(){if(oi)return Be;oi=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.validateKeywordUsage=Be.validSchemaType=Be.funcKeywordCode=Be.macroKeywordCode=void 0;const e=ne(),t=Ge(),r=We(),n=mr();function s(l,h){const{gen:w,keyword:S,schema:p,parentSchema:_,it:f}=l,y=h.macro.call(f.self,p,_,f),g=u(w,S,y);f.opts.validateSchema!==!1&&f.self.validateSchema(y,!0);const d=w.name("valid");l.subschema({schema:y,schemaPath:e.nil,errSchemaPath:`${f.errSchemaPath}/${S}`,topSchemaRef:g,compositeRule:!0},d),l.pass(d,()=>l.error(!0))}Be.macroKeywordCode=s;function o(l,h){var w;const{gen:S,keyword:p,schema:_,parentSchema:f,$data:y,it:g}=l;c(g,h);const d=!y&&h.compile?h.compile.call(g.self,_,f,g):h.validate,$=u(S,p,d),E=S.let("valid");l.block$data(E,R),l.ok((w=h.valid)!==null&&w!==void 0?w:E);function R(){if(h.errors===!1)F(),h.modifying&&i(l),V(()=>l.error());else{const U=h.async?Z():L();h.modifying&&i(l),V(()=>a(l,U))}}function Z(){const U=S.let("ruleErrs",null);return S.try(()=>F((0,e._)`await `),K=>S.assign(E,!1).if((0,e._)`${K} instanceof ${g.ValidationError}`,()=>S.assign(U,(0,e._)`${K}.errors`),()=>S.throw(K))),U}function L(){const U=(0,e._)`${$}.errors`;return S.assign(U,null),F(e.nil),U}function F(U=h.async?(0,e._)`await `:e.nil){const K=g.opts.passContext?t.default.this:t.default.self,re=!("compile"in h&&!y||h.schema===!1);S.assign(E,(0,e._)`${U}${(0,r.callValidateCode)(l,$,K,re)}`,h.modifying)}function V(U){var K;S.if((0,e.not)((K=h.valid)!==null&&K!==void 0?K:E),U)}}Be.funcKeywordCode=o;function i(l){const{gen:h,data:w,it:S}=l;h.if(S.parentData,()=>h.assign(w,(0,e._)`${S.parentData}[${S.parentDataProperty}]`))}function a(l,h){const{gen:w}=l;w.if((0,e._)`Array.isArray(${h})`,()=>{w.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${h} : ${t.default.vErrors}.concat(${h})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(l)},()=>l.error())}function c({schemaEnv:l},h){if(h.async&&!l.$async)throw new Error("async keyword in sync schema")}function u(l,h,w){if(w===void 0)throw new Error(`keyword "${h}" failed to compile`);return l.scopeValue("keyword",typeof w=="function"?{ref:w}:{ref:w,code:(0,e.stringify)(w)})}function m(l,h,w=!1){return!h.length||h.some(S=>S==="array"?Array.isArray(l):S==="object"?l&&typeof l=="object"&&!Array.isArray(l):typeof l==S||w&&typeof l>"u")}Be.validSchemaType=m;function v({schema:l,opts:h,self:w,errSchemaPath:S},p,_){if(Array.isArray(p.keyword)?!p.keyword.includes(_):p.keyword!==_)throw new Error("ajv implementation error");const f=p.dependencies;if(f?.some(y=>!Object.prototype.hasOwnProperty.call(l,y)))throw new Error(`parent schema must have dependencies of ${_}: ${f.join(",")}`);if(p.validateSchema&&!p.validateSchema(l[_])){const g=`keyword "${_}" value is invalid at path "${S}": `+w.errorsText(p.validateSchema.errors);if(h.validateSchema==="log")w.logger.error(g);else throw new Error(g)}}return Be.validateKeywordUsage=v,Be}var nt={},ii;function $m(){if(ii)return nt;ii=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.extendSubschemaMode=nt.extendSubschemaData=nt.getSubschema=void 0;const e=ne(),t=ce();function r(o,{keyword:i,schemaProp:a,schema:c,schemaPath:u,errSchemaPath:m,topSchemaRef:v}){if(i!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){const l=o.schema[i];return a===void 0?{schema:l,schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(i)}`,errSchemaPath:`${o.errSchemaPath}/${i}`}:{schema:l[a],schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(i)}${(0,e.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${i}/${(0,t.escapeFragment)(a)}`}}if(c!==void 0){if(u===void 0||m===void 0||v===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:u,topSchemaRef:v,errSchemaPath:m}}throw new Error('either "keyword" or "schema" must be passed')}nt.getSubschema=r;function n(o,i,{dataProp:a,dataPropType:c,data:u,dataTypes:m,propertyName:v}){if(u!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=i;if(a!==void 0){const{errorPath:w,dataPathArr:S,opts:p}=i,_=l.let("data",(0,e._)`${i.data}${(0,e.getProperty)(a)}`,!0);h(_),o.errorPath=(0,e.str)`${w}${(0,t.getErrorPath)(a,c,p.jsPropertySyntax)}`,o.parentDataProperty=(0,e._)`${a}`,o.dataPathArr=[...S,o.parentDataProperty]}if(u!==void 0){const w=u instanceof e.Name?u:l.let("data",u,!0);h(w),v!==void 0&&(o.propertyName=v)}m&&(o.dataTypes=m);function h(w){o.data=w,o.dataLevel=i.dataLevel+1,o.dataTypes=[],i.definedProperties=new Set,o.parentData=i.data,o.dataNames=[...i.dataNames,w]}}nt.extendSubschemaData=n;function s(o,{jtdDiscriminator:i,jtdMetadata:a,compositeRule:c,createErrors:u,allErrors:m}){c!==void 0&&(o.compositeRule=c),u!==void 0&&(o.createErrors=u),m!==void 0&&(o.allErrors=m),o.jtdDiscriminator=i,o.jtdMetadata=a}return nt.extendSubschemaMode=s,nt}var Ce={},es,ai;function ci(){return ai||(ai=1,es=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),es}var ts={exports:{}},ui;function bm(){if(ui)return ts.exports;ui=1;var e=ts.exports=function(n,s,o){typeof s=="function"&&(o=s,s={}),o=s.cb||o;var i=typeof o=="function"?o:o.pre||function(){},a=o.post||function(){};t(s,i,a,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,s,o,i,a,c,u,m,v,l){if(i&&typeof i=="object"&&!Array.isArray(i)){s(i,a,c,u,m,v,l);for(var h in i){var w=i[h];if(Array.isArray(w)){if(h in e.arrayKeywords)for(var S=0;S<w.length;S++)t(n,s,o,w[S],a+"/"+h+"/"+S,c,a,h,i,S)}else if(h in e.propsKeywords){if(w&&typeof w=="object")for(var p in w)t(n,s,o,w[p],a+"/"+h+"/"+r(p),c,a,h,i,p)}else(h in e.keywords||n.allKeys&&!(h in e.skipKeywords))&&t(n,s,o,w,a+"/"+h,c,a,h,i)}o(i,a,c,u,m,v,l)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return ts.exports}var di;function pr(){if(di)return Ce;di=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.getSchemaRefs=Ce.resolveUrl=Ce.normalizeId=Ce._getFullPath=Ce.getFullPath=Ce.inlineRef=void 0;const e=ce(),t=ci(),r=bm(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(S,p=!0){return typeof S=="boolean"?!0:p===!0?!i(S):p?a(S)<=p:!1}Ce.inlineRef=s;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(S){for(const p in S){if(o.has(p))return!0;const _=S[p];if(Array.isArray(_)&&_.some(i)||typeof _=="object"&&i(_))return!0}return!1}function a(S){let p=0;for(const _ in S){if(_==="$ref")return 1/0;if(p++,!n.has(_)&&(typeof S[_]=="object"&&(0,e.eachItem)(S[_],f=>p+=a(f)),p===1/0))return 1/0}return p}function c(S,p="",_){_!==!1&&(p=v(p));const f=S.parse(p);return u(S,f)}Ce.getFullPath=c;function u(S,p){return S.serialize(p).split("#")[0]+"#"}Ce._getFullPath=u;const m=/#\/?$/;function v(S){return S?S.replace(m,""):""}Ce.normalizeId=v;function l(S,p,_){return _=v(_),S.resolve(p,_)}Ce.resolveUrl=l;const h=/^[a-z_][-a-z0-9._]*$/i;function w(S,p){if(typeof S=="boolean")return{};const{schemaId:_,uriResolver:f}=this.opts,y=v(S[_]||p),g={"":y},d=c(f,y,!1),$={},E=new Set;return r(S,{allKeys:!0},(L,F,V,U)=>{if(U===void 0)return;const K=d+F;let re=g[U];typeof L[_]=="string"&&(re=ye.call(this,L[_])),me.call(this,L.$anchor),me.call(this,L.$dynamicAnchor),g[F]=re;function ye(ue){const Oe=this.opts.uriResolver.resolve;if(ue=v(re?Oe(re,ue):ue),E.has(ue))throw Z(ue);E.add(ue);let M=this.refs[ue];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?R(L,M.schema,ue):ue!==v(K)&&(ue[0]==="#"?(R(L,$[ue],ue),$[ue]=L):this.refs[ue]=K),ue}function me(ue){if(typeof ue=="string"){if(!h.test(ue))throw new Error(`invalid anchor "${ue}"`);ye.call(this,`#${ue}`)}}}),$;function R(L,F,V){if(F!==void 0&&!t(L,F))throw Z(V)}function Z(L){return new Error(`reference "${L}" resolves to more than one schema`)}}return Ce.getSchemaRefs=w,Ce}var li;function jt(){if(li)return tt;li=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.getData=tt.KeywordCxt=tt.validateFunctionCode=void 0;const e=vm(),t=hr(),r=ti(),n=hr(),s=gm(),o=_m(),i=$m(),a=ne(),c=Ge(),u=pr(),m=ce(),v=mr();function l(j){if(d(j)&&(E(j),g(j))){p(j);return}h(j,()=>(0,e.topBoolOrEmptySchema)(j))}tt.validateFunctionCode=l;function h({gen:j,validateName:z,schema:q,schemaEnv:H,opts:X},se){X.code.es5?j.func(z,(0,a._)`${c.default.data}, ${c.default.valCxt}`,H.$async,()=>{j.code((0,a._)`"use strict"; ${f(q,X)}`),S(j,X),j.code(se)}):j.func(z,(0,a._)`${c.default.data}, ${w(X)}`,H.$async,()=>j.code(f(q,X)).code(se))}function w(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 S(j,z){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}`),z.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),z.dynamicRef&&j.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function p(j){const{schema:z,opts:q,gen:H}=j;h(j,()=>{q.$comment&&z.$comment&&U(j),L(j),H.let(c.default.vErrors,null),H.let(c.default.errors,0),q.unevaluated&&_(j),R(j),K(j)})}function _(j){const{gen:z,validateName:q}=j;j.evaluated=z.const("evaluated",(0,a._)`${q}.evaluated`),z.if((0,a._)`${j.evaluated}.dynamicProps`,()=>z.assign((0,a._)`${j.evaluated}.props`,(0,a._)`undefined`)),z.if((0,a._)`${j.evaluated}.dynamicItems`,()=>z.assign((0,a._)`${j.evaluated}.items`,(0,a._)`undefined`))}function f(j,z){const q=typeof j=="object"&&j[z.schemaId];return q&&(z.code.source||z.code.process)?(0,a._)`/*# sourceURL=${q} */`:a.nil}function y(j,z){if(d(j)&&(E(j),g(j))){$(j,z);return}(0,e.boolOrEmptySchema)(j,z)}function g({schema:j,self:z}){if(typeof j=="boolean")return!j;for(const q in j)if(z.RULES.all[q])return!0;return!1}function d(j){return typeof j.schema!="boolean"}function $(j,z){const{schema:q,gen:H,opts:X}=j;X.$comment&&q.$comment&&U(j),F(j),V(j);const se=H.const("_errs",c.default.errors);R(j,se),H.var(z,(0,a._)`${se} === ${c.default.errors}`)}function E(j){(0,m.checkUnknownRules)(j),Z(j)}function R(j,z){if(j.opts.jtd)return ye(j,[],!1,z);const q=(0,t.getSchemaTypes)(j.schema),H=(0,t.coerceAndCheckDataType)(j,q);ye(j,q,!H,z)}function Z(j){const{schema:z,errSchemaPath:q,opts:H,self:X}=j;z.$ref&&H.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(z,X.RULES)&&X.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function L(j){const{schema:z,opts:q}=j;z.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,m.checkStrictMode)(j,"default is ignored in the schema root")}function F(j){const z=j.schema[j.opts.schemaId];z&&(j.baseId=(0,u.resolveUrl)(j.opts.uriResolver,j.baseId,z))}function V(j){if(j.schema.$async&&!j.schemaEnv.$async)throw new Error("async schema in sync schema")}function U({gen:j,schemaEnv:z,schema:q,errSchemaPath:H,opts:X}){const se=q.$comment;if(X.$comment===!0)j.code((0,a._)`${c.default.self}.logger.log(${se})`);else if(typeof X.$comment=="function"){const je=(0,a.str)`${H}/$comment`,Le=j.scopeValue("root",{ref:z.root});j.code((0,a._)`${c.default.self}.opts.$comment(${se}, ${je}, ${Le}.schema)`)}}function K(j){const{gen:z,schemaEnv:q,validateName:H,ValidationError:X,opts:se}=j;q.$async?z.if((0,a._)`${c.default.errors} === 0`,()=>z.return(c.default.data),()=>z.throw((0,a._)`new ${X}(${c.default.vErrors})`)):(z.assign((0,a._)`${H}.errors`,c.default.vErrors),se.unevaluated&&re(j),z.return((0,a._)`${c.default.errors} === 0`))}function re({gen:j,evaluated:z,props:q,items:H}){q instanceof a.Name&&j.assign((0,a._)`${z}.props`,q),H instanceof a.Name&&j.assign((0,a._)`${z}.items`,H)}function ye(j,z,q,H){const{gen:X,schema:se,data:je,allErrors:Le,opts:Me,self:Ne}=j,{RULES:k}=Ne;if(se.$ref&&(Me.ignoreKeywordsWithRef||!(0,m.schemaHasRulesButRef)(se,k))){X.block(()=>G(j,"$ref",k.all.$ref.definition));return}Me.jtd||ue(j,z),X.block(()=>{for(const I of k.rules)N(I);N(k.post)});function N(I){(0,r.shouldUseGroup)(se,I)&&(I.type?(X.if((0,n.checkDataType)(I.type,je,Me.strictNumbers)),me(j,I),z.length===1&&z[0]===I.type&&q&&(X.else(),(0,n.reportTypeError)(j)),X.endIf()):me(j,I),Le||X.if((0,a._)`${c.default.errors} === ${H||0}`))}}function me(j,z){const{gen:q,schema:H,opts:{useDefaults:X}}=j;X&&(0,s.assignDefaults)(j,z.type),q.block(()=>{for(const se of z.rules)(0,r.shouldUseRule)(H,se)&&G(j,se.keyword,se.definition,z.type)})}function ue(j,z){j.schemaEnv.meta||!j.opts.strictTypes||(Oe(j,z),j.opts.allowUnionTypes||M(j,z),O(j,j.dataTypes))}function Oe(j,z){if(z.length){if(!j.dataTypes.length){j.dataTypes=z;return}z.forEach(q=>{A(j.dataTypes,q)||P(j,`type "${q}" not allowed by context "${j.dataTypes.join(",")}"`)}),b(j,z)}}function M(j,z){z.length>1&&!(z.length===2&&z.includes("null"))&&P(j,"use allowUnionTypes to allow union type keyword")}function O(j,z){const q=j.self.RULES.all;for(const H in q){const X=q[H];if(typeof X=="object"&&(0,r.shouldUseRule)(j.schema,X)){const{type:se}=X.definition;se.length&&!se.some(je=>C(z,je))&&P(j,`missing type "${se.join(",")}" for keyword "${H}"`)}}}function C(j,z){return j.includes(z)||z==="number"&&j.includes("integer")}function A(j,z){return j.includes(z)||z==="integer"&&j.includes("number")}function b(j,z){const q=[];for(const H of j.dataTypes)A(z,H)?q.push(H):z.includes("integer")&&H==="number"&&q.push("integer");j.dataTypes=q}function P(j,z){const q=j.schemaEnv.baseId+j.errSchemaPath;z+=` at "${q}" (strictTypes)`,(0,m.checkStrictMode)(j,z,j.opts.strictTypes)}class T{constructor(z,q,H){if((0,o.validateKeywordUsage)(z,q,H),this.gen=z.gen,this.allErrors=z.allErrors,this.keyword=H,this.data=z.data,this.schema=z.schema[H],this.$data=q.$data&&z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(z,this.schema,H,this.$data),this.schemaType=q.schemaType,this.parentSchema=z.schema,this.params={},this.it=z,this.def=q,this.$data)this.schemaCode=z.gen.const("vSchema",ae(this.$data,z));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${H} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=z.gen.const("_errs",c.default.errors))}result(z,q,H){this.failResult((0,a.not)(z),q,H)}failResult(z,q,H){this.gen.if(z),H?H():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(z,q){this.failResult((0,a.not)(z),void 0,q)}fail(z){if(z===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(z),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(z){if(!this.$data)return this.fail(z);const{schemaCode:q}=this;this.fail((0,a._)`${q} !== undefined && (${(0,a.or)(this.invalid$data(),z)})`)}error(z,q,H){if(q){this.setParams(q),this._error(z,H),this.setParams({});return}this._error(z,H)}_error(z,q){(z?v.reportExtraError:v.reportError)(this,this.def.error,q)}$dataError(){(0,v.reportError)(this,this.def.$dataError||v.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,v.resetErrorsCount)(this.gen,this.errsCount)}ok(z){this.allErrors||this.gen.if(z)}setParams(z,q){q?Object.assign(this.params,z):this.params=z}block$data(z,q,H=a.nil){this.gen.block(()=>{this.check$data(z,H),q()})}check$data(z=a.nil,q=a.nil){if(!this.$data)return;const{gen:H,schemaCode:X,schemaType:se,def:je}=this;H.if((0,a.or)((0,a._)`${X} === undefined`,q)),z!==a.nil&&H.assign(z,!0),(se.length||je.validateSchema)&&(H.elseIf(this.invalid$data()),this.$dataError(),z!==a.nil&&H.assign(z,!1)),H.else()}invalid$data(){const{gen:z,schemaCode:q,schemaType:H,def:X,it:se}=this;return(0,a.or)(je(),Le());function je(){if(H.length){if(!(q instanceof a.Name))throw new Error("ajv implementation error");const Me=Array.isArray(H)?H:[H];return(0,a._)`${(0,n.checkDataTypes)(Me,q,se.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function Le(){if(X.validateSchema){const Me=z.scopeValue("validate$data",{ref:X.validateSchema});return(0,a._)`!${Me}(${q})`}return a.nil}}subschema(z,q){const H=(0,i.getSubschema)(this.it,z);(0,i.extendSubschemaData)(H,this.it,z),(0,i.extendSubschemaMode)(H,z);const X={...this.it,...H,items:void 0,props:void 0};return y(X,q),X}mergeEvaluated(z,q){const{it:H,gen:X}=this;H.opts.unevaluated&&(H.props!==!0&&z.props!==void 0&&(H.props=m.mergeEvaluated.props(X,z.props,H.props,q)),H.items!==!0&&z.items!==void 0&&(H.items=m.mergeEvaluated.items(X,z.items,H.items,q)))}mergeValidEvaluated(z,q){const{it:H,gen:X}=this;if(H.opts.unevaluated&&(H.props!==!0||H.items!==!0))return X.if(q,()=>this.mergeEvaluated(z,a.Name)),!0}}tt.KeywordCxt=T;function G(j,z,q,H){const X=new T(j,q,z);"code"in q?q.code(X,H):X.$data&&q.validate?(0,o.funcKeywordCode)(X,q):"macro"in q?(0,o.macroKeywordCode)(X,q):(q.compile||q.validate)&&(0,o.funcKeywordCode)(X,q)}const Y=/^\/(?:[^~]|~0|~1)*$/,ie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ae(j,{dataLevel:z,dataNames:q,dataPathArr:H}){let X,se;if(j==="")return c.default.rootData;if(j[0]==="/"){if(!Y.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);X=j,se=c.default.rootData}else{const Ne=ie.exec(j);if(!Ne)throw new Error(`Invalid JSON-pointer: ${j}`);const k=+Ne[1];if(X=Ne[2],X==="#"){if(k>=z)throw new Error(Me("property/index",k));return H[z-k]}if(k>z)throw new Error(Me("data",k));if(se=q[z-k],!X)return se}let je=se;const Le=X.split("/");for(const Ne of Le)Ne&&(se=(0,a._)`${se}${(0,a.getProperty)((0,m.unescapeJsonPointer)(Ne))}`,je=(0,a._)`${je} && ${se}`);return je;function Me(Ne,k){return`Cannot access ${Ne} ${k} levels up, current level is ${z}`}}return tt.getData=ae,tt}var yr={},fi;function Ft(){if(fi)return yr;fi=1,Object.defineProperty(yr,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return yr.default=e,yr}var vr={},mi;function At(){if(mi)return vr;mi=1,Object.defineProperty(vr,"__esModule",{value:!0});const e=pr();class t extends Error{constructor(n,s,o,i){super(i||`can't resolve reference ${o} from id ${s}`),this.missingRef=(0,e.resolveUrl)(n,s,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return vr.default=t,vr}var xe={},hi;function gr(){if(hi)return xe;hi=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.resolveSchema=xe.getCompilingSchema=xe.resolveRef=xe.compileSchema=xe.SchemaEnv=void 0;const e=ne(),t=Ft(),r=Ge(),n=pr(),s=ce(),o=jt();class i{constructor(_){var f;this.refs={},this.dynamicAnchors={};let y;typeof _.schema=="object"&&(y=_.schema),this.schema=_.schema,this.schemaId=_.schemaId,this.root=_.root||this,this.baseId=(f=_.baseId)!==null&&f!==void 0?f:(0,n.normalizeId)(y?.[_.schemaId||"$id"]),this.schemaPath=_.schemaPath,this.localRefs=_.localRefs,this.meta=_.meta,this.$async=y?.$async,this.refs={}}}xe.SchemaEnv=i;function a(p){const _=m.call(this,p);if(_)return _;const f=(0,n.getFullPath)(this.opts.uriResolver,p.root.baseId),{es5:y,lines:g}=this.opts.code,{ownProperties:d}=this.opts,$=new e.CodeGen(this.scope,{es5:y,lines:g,ownProperties:d});let E;p.$async&&(E=$.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const R=$.scopeName("validate");p.validateName=R;const Z={gen:$,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:$.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,e.stringify)(p.schema)}:{ref:p.schema}),validateName:R,ValidationError:E,schema:p.schema,schemaEnv:p,rootId:f,baseId:p.baseId||f,schemaPath:e.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let L;try{this._compilations.add(p),(0,o.validateFunctionCode)(Z),$.optimize(this.opts.code.optimize);const F=$.toString();L=`${$.scopeRefs(r.default.scope)}return ${F}`,this.opts.code.process&&(L=this.opts.code.process(L,p));const U=new Function(`${r.default.self}`,`${r.default.scope}`,L)(this,this.scope.get());if(this.scope.value(R,{ref:U}),U.errors=null,U.schema=p.schema,U.schemaEnv=p,p.$async&&(U.$async=!0),this.opts.code.source===!0&&(U.source={validateName:R,validateCode:F,scopeValues:$._values}),this.opts.unevaluated){const{props:K,items:re}=Z;U.evaluated={props:K instanceof e.Name?void 0:K,items:re instanceof e.Name?void 0:re,dynamicProps:K instanceof e.Name,dynamicItems:re instanceof e.Name},U.source&&(U.source.evaluated=(0,e.stringify)(U.evaluated))}return p.validate=U,p}catch(F){throw delete p.validate,delete p.validateName,L&&this.logger.error("Error compiling schema, function code:",L),F}finally{this._compilations.delete(p)}}xe.compileSchema=a;function c(p,_,f){var y;f=(0,n.resolveUrl)(this.opts.uriResolver,_,f);const g=p.refs[f];if(g)return g;let d=l.call(this,p,f);if(d===void 0){const $=(y=p.localRefs)===null||y===void 0?void 0:y[f],{schemaId:E}=this.opts;$&&(d=new i({schema:$,schemaId:E,root:p,baseId:_}))}if(d!==void 0)return p.refs[f]=u.call(this,d)}xe.resolveRef=c;function u(p){return(0,n.inlineRef)(p.schema,this.opts.inlineRefs)?p.schema:p.validate?p:a.call(this,p)}function m(p){for(const _ of this._compilations)if(v(_,p))return _}xe.getCompilingSchema=m;function v(p,_){return p.schema===_.schema&&p.root===_.root&&p.baseId===_.baseId}function l(p,_){let f;for(;typeof(f=this.refs[_])=="string";)_=f;return f||this.schemas[_]||h.call(this,p,_)}function h(p,_){const f=this.opts.uriResolver.parse(_),y=(0,n._getFullPath)(this.opts.uriResolver,f);let g=(0,n.getFullPath)(this.opts.uriResolver,p.baseId,void 0);if(Object.keys(p.schema).length>0&&y===g)return S.call(this,f,p);const d=(0,n.normalizeId)(y),$=this.refs[d]||this.schemas[d];if(typeof $=="string"){const E=h.call(this,p,$);return typeof E?.schema!="object"?void 0:S.call(this,f,E)}if(typeof $?.schema=="object"){if($.validate||a.call(this,$),d===(0,n.normalizeId)(_)){const{schema:E}=$,{schemaId:R}=this.opts,Z=E[R];return Z&&(g=(0,n.resolveUrl)(this.opts.uriResolver,g,Z)),new i({schema:E,schemaId:R,root:p,baseId:g})}return S.call(this,f,$)}}xe.resolveSchema=h;const w=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function S(p,{baseId:_,schema:f,root:y}){var g;if(((g=p.fragment)===null||g===void 0?void 0:g[0])!=="/")return;for(const E of p.fragment.slice(1).split("/")){if(typeof f=="boolean")return;const R=f[(0,s.unescapeFragment)(E)];if(R===void 0)return;f=R;const Z=typeof f=="object"&&f[this.opts.schemaId];!w.has(E)&&Z&&(_=(0,n.resolveUrl)(this.opts.uriResolver,_,Z))}let d;if(typeof f!="boolean"&&f.$ref&&!(0,s.schemaHasRulesButRef)(f,this.RULES)){const E=(0,n.resolveUrl)(this.opts.uriResolver,_,f.$ref);d=h.call(this,y,E)}const{schemaId:$}=this.opts;if(d=d||new i({schema:f,schemaId:$,root:y,baseId:_}),d.schema!==d.root.schema)return d}return xe}const wm={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var _r={},qt={exports:{}},rs,pi;function yi(){if(pi)return rs;pi=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function r(l){let h="",w=0,S=0;for(S=0;S<l.length;S++)if(w=l[S].charCodeAt(0),w!==48){if(!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";h+=l[S];break}for(S+=1;S<l.length;S++){if(w=l[S].charCodeAt(0),!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";h+=l[S]}return h}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(l){return l.length=0,!0}function o(l,h,w){if(l.length){const S=r(l);if(S!=="")h.push(S);else return w.error=!0,!1;l.length=0}return!0}function i(l){let h=0;const w={error:!1,address:"",zone:""},S=[],p=[];let _=!1,f=!1,y=o;for(let g=0;g<l.length;g++){const d=l[g];if(!(d==="["||d==="]"))if(d===":"){if(_===!0&&(f=!0),!y(p,S,w))break;if(++h>7){w.error=!0;break}g>0&&l[g-1]===":"&&(_=!0),S.push(":");continue}else if(d==="%"){if(!y(p,S,w))break;y=s}else{p.push(d);continue}}return p.length&&(y===s?w.zone=p.join(""):f?S.push(p.join("")):S.push(r(p))),w.address=S.join(""),w}function a(l){if(c(l,":")<2)return{host:l,isIPV6:!1};const h=i(l);if(h.error)return{host:l,isIPV6:!1};{let w=h.address,S=h.address;return h.zone&&(w+="%"+h.zone,S+="%25"+h.zone),{host:w,isIPV6:!0,escapedHost:S}}}function c(l,h){let w=0;for(let S=0;S<l.length;S++)l[S]===h&&w++;return w}function u(l){let h=l;const w=[];let S=-1,p=0;for(;p=h.length;){if(p===1){if(h===".")break;if(h==="/"){w.push("/");break}else{w.push(h);break}}else if(p===2){if(h[0]==="."){if(h[1]===".")break;if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&(h[1]==="."||h[1]==="/")){w.push("/");break}}else if(p===3&&h==="/.."){w.length!==0&&w.pop(),w.push("/");break}if(h[0]==="."){if(h[1]==="."){if(h[2]==="/"){h=h.slice(3);continue}}else if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&h[1]==="."){if(h[2]==="/"){h=h.slice(2);continue}else if(h[2]==="."&&h[3]==="/"){h=h.slice(3),w.length!==0&&w.pop();continue}}if((S=h.indexOf("/",1))===-1){w.push(h);break}else w.push(h.slice(0,S)),h=h.slice(S)}return w.join("")}function m(l,h){const w=h!==!0?escape:unescape;return l.scheme!==void 0&&(l.scheme=w(l.scheme)),l.userinfo!==void 0&&(l.userinfo=w(l.userinfo)),l.host!==void 0&&(l.host=w(l.host)),l.path!==void 0&&(l.path=w(l.path)),l.query!==void 0&&(l.query=w(l.query)),l.fragment!==void 0&&(l.fragment=w(l.fragment)),l}function v(l){const h=[];if(l.userinfo!==void 0&&(h.push(l.userinfo),h.push("@")),l.host!==void 0){let w=unescape(l.host);if(!t(w)){const S=a(w);S.isIPV6===!0?w=`[${S.escapedHost}]`:w=l.host}h.push(w)}return(typeof l.port=="number"||typeof l.port=="string")&&(h.push(":"),h.push(String(l.port))),h.length?h.join(""):void 0}return rs={nonSimpleDomain:n,recomposeAuthority:v,normalizeComponentEncoding:m,removeDotSegments:u,isIPv4:t,isUUID:e,normalizeIPv6:a,stringArrayToHexStripped:r},rs}var ns,vi;function Sm(){if(vi)return ns;vi=1;const{isUUID:e}=yi(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(d){return r.indexOf(d)!==-1}function s(d){return d.secure===!0?!0:d.secure===!1?!1:d.scheme?d.scheme.length===3&&(d.scheme[0]==="w"||d.scheme[0]==="W")&&(d.scheme[1]==="s"||d.scheme[1]==="S")&&(d.scheme[2]==="s"||d.scheme[2]==="S"):!1}function o(d){return d.host||(d.error=d.error||"HTTP URIs must have a host."),d}function i(d){const $=String(d.scheme).toLowerCase()==="https";return(d.port===($?443:80)||d.port==="")&&(d.port=void 0),d.path||(d.path="/"),d}function a(d){return d.secure=s(d),d.resourceName=(d.path||"/")+(d.query?"?"+d.query:""),d.path=void 0,d.query=void 0,d}function c(d){if((d.port===(s(d)?443:80)||d.port==="")&&(d.port=void 0),typeof d.secure=="boolean"&&(d.scheme=d.secure?"wss":"ws",d.secure=void 0),d.resourceName){const[$,E]=d.resourceName.split("?");d.path=$&&$!=="/"?$:void 0,d.query=E,d.resourceName=void 0}return d.fragment=void 0,d}function u(d,$){if(!d.path)return d.error="URN can not be parsed",d;const E=d.path.match(t);if(E){const R=$.scheme||d.scheme||"urn";d.nid=E[1].toLowerCase(),d.nss=E[2];const Z=`${R}:${$.nid||d.nid}`,L=g(Z);d.path=void 0,L&&(d=L.parse(d,$))}else d.error=d.error||"URN can not be parsed.";return d}function m(d,$){if(d.nid===void 0)throw new Error("URN without nid cannot be serialized");const E=$.scheme||d.scheme||"urn",R=d.nid.toLowerCase(),Z=`${E}:${$.nid||R}`,L=g(Z);L&&(d=L.serialize(d,$));const F=d,V=d.nss;return F.path=`${R||$.nid}:${V}`,$.skipEscape=!0,F}function v(d,$){const E=d;return E.uuid=E.nss,E.nss=void 0,!$.tolerant&&(!E.uuid||!e(E.uuid))&&(E.error=E.error||"UUID is not valid."),E}function l(d){const $=d;return $.nss=(d.uuid||"").toLowerCase(),$}const h={scheme:"http",domainHost:!0,parse:o,serialize:i},w={scheme:"https",domainHost:h.domainHost,parse:o,serialize:i},S={scheme:"ws",domainHost:!0,parse:a,serialize:c},p={scheme:"wss",domainHost:S.domainHost,parse:S.parse,serialize:S.serialize},y={http:h,https:w,ws:S,wss:p,urn:{scheme:"urn",parse:u,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:v,serialize:l,skipNormalize:!0}};Object.setPrototypeOf(y,null);function g(d){return d&&(y[d]||y[d.toLowerCase()])||void 0}return ns={wsIsSecure:s,SCHEMES:y,isValidSchemeName:n,getSchemeHandler:g},ns}var gi;function Em(){if(gi)return qt.exports;gi=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:s,nonSimpleDomain:o}=yi(),{SCHEMES:i,getSchemeHandler:a}=Sm();function c(p,_){return typeof p=="string"?p=l(w(p,_),_):typeof p=="object"&&(p=w(l(p,_),_)),p}function u(p,_,f){const y=f?Object.assign({scheme:"null"},f):{scheme:"null"},g=m(w(p,y),w(_,y),y,!0);return y.skipEscape=!0,l(g,y)}function m(p,_,f,y){const g={};return y||(p=w(l(p,f),f),_=w(l(_,f),f)),f=f||{},!f.tolerant&&_.scheme?(g.scheme=_.scheme,g.userinfo=_.userinfo,g.host=_.host,g.port=_.port,g.path=t(_.path||""),g.query=_.query):(_.userinfo!==void 0||_.host!==void 0||_.port!==void 0?(g.userinfo=_.userinfo,g.host=_.host,g.port=_.port,g.path=t(_.path||""),g.query=_.query):(_.path?(_.path[0]==="/"?g.path=t(_.path):((p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path?g.path="/"+_.path:p.path?g.path=p.path.slice(0,p.path.lastIndexOf("/")+1)+_.path:g.path=_.path,g.path=t(g.path)),g.query=_.query):(g.path=p.path,_.query!==void 0?g.query=_.query:g.query=p.query),g.userinfo=p.userinfo,g.host=p.host,g.port=p.port),g.scheme=p.scheme),g.fragment=_.fragment,g}function v(p,_,f){return typeof p=="string"?(p=unescape(p),p=l(n(w(p,f),!0),{...f,skipEscape:!0})):typeof p=="object"&&(p=l(n(p,!0),{...f,skipEscape:!0})),typeof _=="string"?(_=unescape(_),_=l(n(w(_,f),!0),{...f,skipEscape:!0})):typeof _=="object"&&(_=l(n(_,!0),{...f,skipEscape:!0})),p.toLowerCase()===_.toLowerCase()}function l(p,_){const f={host:p.host,scheme:p.scheme,userinfo:p.userinfo,port:p.port,path:p.path,query:p.query,nid:p.nid,nss:p.nss,uuid:p.uuid,fragment:p.fragment,reference:p.reference,resourceName:p.resourceName,secure:p.secure,error:""},y=Object.assign({},_),g=[],d=a(y.scheme||f.scheme);d&&d.serialize&&d.serialize(f,y),f.path!==void 0&&(y.skipEscape?f.path=unescape(f.path):(f.path=escape(f.path),f.scheme!==void 0&&(f.path=f.path.split("%3A").join(":")))),y.reference!=="suffix"&&f.scheme&&g.push(f.scheme,":");const $=r(f);if($!==void 0&&(y.reference!=="suffix"&&g.push("//"),g.push($),f.path&&f.path[0]!=="/"&&g.push("/")),f.path!==void 0){let E=f.path;!y.absolutePath&&(!d||!d.absolutePath)&&(E=t(E)),$===void 0&&E[0]==="/"&&E[1]==="/"&&(E="/%2F"+E.slice(2)),g.push(E)}return f.query!==void 0&&g.push("?",f.query),f.fragment!==void 0&&g.push("#",f.fragment),g.join("")}const h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function w(p,_){const f=Object.assign({},_),y={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let g=!1;f.reference==="suffix"&&(f.scheme?p=f.scheme+":"+p:p="//"+p);const d=p.match(h);if(d){if(y.scheme=d[1],y.userinfo=d[3],y.host=d[4],y.port=parseInt(d[5],10),y.path=d[6]||"",y.query=d[7],y.fragment=d[8],isNaN(y.port)&&(y.port=d[5]),y.host)if(s(y.host)===!1){const R=e(y.host);y.host=R.host.toLowerCase(),g=R.isIPV6}else g=!0;y.scheme===void 0&&y.userinfo===void 0&&y.host===void 0&&y.port===void 0&&y.query===void 0&&!y.path?y.reference="same-document":y.scheme===void 0?y.reference="relative":y.fragment===void 0?y.reference="absolute":y.reference="uri",f.reference&&f.reference!=="suffix"&&f.reference!==y.reference&&(y.error=y.error||"URI is not a "+f.reference+" reference.");const $=a(f.scheme||y.scheme);if(!f.unicodeSupport&&(!$||!$.unicodeSupport)&&y.host&&(f.domainHost||$&&$.domainHost)&&g===!1&&o(y.host))try{y.host=URL.domainToASCII(y.host.toLowerCase())}catch(E){y.error=y.error||"Host's domain name can not be converted to ASCII: "+E}(!$||$&&!$.skipNormalize)&&(p.indexOf("%")!==-1&&(y.scheme!==void 0&&(y.scheme=unescape(y.scheme)),y.host!==void 0&&(y.host=unescape(y.host))),y.path&&(y.path=escape(unescape(y.path))),y.fragment&&(y.fragment=encodeURI(decodeURIComponent(y.fragment)))),$&&$.parse&&$.parse(y,f)}else y.error=y.error||"URI can not be parsed.";return y}const S={SCHEMES:i,normalize:c,resolve:u,resolveComponent:m,equal:v,serialize:l,parse:w};return qt.exports=S,qt.exports.default=S,qt.exports.fastUri=S,qt.exports}var _i;function km(){if(_i)return _r;_i=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=Em();return e.code='require("ajv/dist/runtime/uri").default',_r.default=e,_r}var $i;function ss(){return $i||($i=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=jt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ne();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=Ft(),s=At(),o=Qo(),i=gr(),a=ne(),c=pr(),u=hr(),m=ce(),v=wm,l=km(),h=(M,O)=>new RegExp(M,O);h.code="new RegExp";const w=["removeAdditional","useDefaults","coerceTypes"],S=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),p={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},f=200;function y(M){var O,C,A,b,P,T,G,Y,ie,ae,j,z,q,H,X,se,je,Le,Me,Ne,k,N,I,B,J;const x=M.strict,Q=(O=M.code)===null||O===void 0?void 0:O.optimize,le=Q===!0||Q===void 0?1:Q||0,fe=(A=(C=M.code)===null||C===void 0?void 0:C.regExp)!==null&&A!==void 0?A:h,ze=(b=M.uriResolver)!==null&&b!==void 0?b:l.default;return{strictSchema:(T=(P=M.strictSchema)!==null&&P!==void 0?P:x)!==null&&T!==void 0?T:!0,strictNumbers:(Y=(G=M.strictNumbers)!==null&&G!==void 0?G:x)!==null&&Y!==void 0?Y:!0,strictTypes:(ae=(ie=M.strictTypes)!==null&&ie!==void 0?ie:x)!==null&&ae!==void 0?ae:"log",strictTuples:(z=(j=M.strictTuples)!==null&&j!==void 0?j:x)!==null&&z!==void 0?z:"log",strictRequired:(H=(q=M.strictRequired)!==null&&q!==void 0?q:x)!==null&&H!==void 0?H:!1,code:M.code?{...M.code,optimize:le,regExp:fe}:{optimize:le,regExp:fe},loopRequired:(X=M.loopRequired)!==null&&X!==void 0?X:f,loopEnum:(se=M.loopEnum)!==null&&se!==void 0?se:f,meta:(je=M.meta)!==null&&je!==void 0?je:!0,messages:(Le=M.messages)!==null&&Le!==void 0?Le:!0,inlineRefs:(Me=M.inlineRefs)!==null&&Me!==void 0?Me:!0,schemaId:(Ne=M.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(k=M.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(N=M.validateSchema)!==null&&N!==void 0?N:!0,validateFormats:(I=M.validateFormats)!==null&&I!==void 0?I:!0,unicodeRegExp:(B=M.unicodeRegExp)!==null&&B!==void 0?B:!0,int32range:(J=M.int32range)!==null&&J!==void 0?J:!0,uriResolver:ze}}class g{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...y(O)};const{es5:C,lines:A}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:S,es5:C,lines:A}),this.logger=V(O.logger);const b=O.validateFormats;O.validateFormats=!1,this.RULES=(0,o.getRules)(),d.call(this,p,O,"NOT SUPPORTED"),d.call(this,_,O,"DEPRECATED","warn"),this._metaOpts=L.call(this),O.formats&&R.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords&&Z.call(this,O.keywords),typeof O.meta=="object"&&this.addMetaSchema(O.meta),E.call(this),O.validateFormats=b}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:O,meta:C,schemaId:A}=this.opts;let b=v;A==="id"&&(b={...v},b.id=b.$id,delete b.$id),C&&O&&this.addMetaSchema(b,b[A],!1)}defaultMeta(){const{meta:O,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[C]||O:void 0}validate(O,C){let A;if(typeof O=="string"){if(A=this.getSchema(O),!A)throw new Error(`no schema with key or ref "${O}"`)}else A=this.compile(O);const b=A(C);return"$async"in A||(this.errors=A.errors),b}compile(O,C){const A=this._addSchema(O,C);return A.validate||this._compileSchemaEnv(A)}compileAsync(O,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:A}=this.opts;return b.call(this,O,C);async function b(ae,j){await P.call(this,ae.$schema);const z=this._addSchema(ae,j);return z.validate||T.call(this,z)}async function P(ae){ae&&!this.getSchema(ae)&&await b.call(this,{$ref:ae},!0)}async function T(ae){try{return this._compileSchemaEnv(ae)}catch(j){if(!(j instanceof s.default))throw j;return G.call(this,j),await Y.call(this,j.missingSchema),T.call(this,ae)}}function G({missingSchema:ae,missingRef:j}){if(this.refs[ae])throw new Error(`AnySchema ${ae} is loaded but ${j} cannot be resolved`)}async function Y(ae){const j=await ie.call(this,ae);this.refs[ae]||await P.call(this,j.$schema),this.refs[ae]||this.addSchema(j,ae,C)}async function ie(ae){const j=this._loading[ae];if(j)return j;try{return await(this._loading[ae]=A(ae))}finally{delete this._loading[ae]}}}addSchema(O,C,A,b=this.opts.validateSchema){if(Array.isArray(O)){for(const T of O)this.addSchema(T,void 0,A,b);return this}let P;if(typeof O=="object"){const{schemaId:T}=this.opts;if(P=O[T],P!==void 0&&typeof P!="string")throw new Error(`schema ${T} must be string`)}return C=(0,c.normalizeId)(C||P),this._checkUnique(C),this.schemas[C]=this._addSchema(O,A,C,b,!0),this}addMetaSchema(O,C,A=this.opts.validateSchema){return this.addSchema(O,C,!0,A),this}validateSchema(O,C){if(typeof O=="boolean")return!0;let A;if(A=O.$schema,A!==void 0&&typeof A!="string")throw new Error("$schema must be a string");if(A=A||this.opts.defaultMeta||this.defaultMeta(),!A)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const b=this.validate(A,O);if(!b&&C){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return b}getSchema(O){let C;for(;typeof(C=$.call(this,O))=="string";)O=C;if(C===void 0){const{schemaId:A}=this.opts,b=new i.SchemaEnv({schema:{},schemaId:A});if(C=i.resolveSchema.call(this,b,O),!C)return;this.refs[O]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=$.call(this,O);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[O],delete this.refs[O],this}case"object":{const C=O;this._cache.delete(C);let A=O[this.opts.schemaId];return A&&(A=(0,c.normalizeId)(A),delete this.schemas[A],delete this.refs[A]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(const C of O)this.addKeyword(C);return this}addKeyword(O,C){let A;if(typeof O=="string")A=O,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=A);else if(typeof O=="object"&&C===void 0){if(C=O,A=C.keyword,Array.isArray(A)&&!A.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(K.call(this,A,C),!C)return(0,m.eachItem)(A,P=>re.call(this,P)),this;me.call(this,C);const b={...C,type:(0,u.getJSONTypes)(C.type),schemaType:(0,u.getJSONTypes)(C.schemaType)};return(0,m.eachItem)(A,b.type.length===0?P=>re.call(this,P,b):P=>b.type.forEach(T=>re.call(this,P,b,T))),this}getKeyword(O){const C=this.RULES.all[O];return typeof C=="object"?C.definition:!!C}removeKeyword(O){const{RULES:C}=this;delete C.keywords[O],delete C.all[O];for(const A of C.rules){const b=A.rules.findIndex(P=>P.keyword===O);b>=0&&A.rules.splice(b,1)}return this}addFormat(O,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[O]=C,this}errorsText(O=this.errors,{separator:C=", ",dataVar:A="data"}={}){return!O||O.length===0?"No errors":O.map(b=>`${A}${b.instancePath} ${b.message}`).reduce((b,P)=>b+C+P)}$dataMetaSchema(O,C){const A=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(const b of C){const P=b.split("/").slice(1);let T=O;for(const G of P)T=T[G];for(const G in A){const Y=A[G];if(typeof Y!="object")continue;const{$data:ie}=Y.definition,ae=T[G];ie&&ae&&(T[G]=Oe(ae))}}return O}_removeAllSchemas(O,C){for(const A in O){const b=O[A];(!C||C.test(A))&&(typeof b=="string"?delete O[A]:b&&!b.meta&&(this._cache.delete(b.schema),delete O[A]))}}_addSchema(O,C,A,b=this.opts.validateSchema,P=this.opts.addUsedSchema){let T;const{schemaId:G}=this.opts;if(typeof O=="object")T=O[G];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof O!="boolean")throw new Error("schema must be object or boolean")}let Y=this._cache.get(O);if(Y!==void 0)return Y;A=(0,c.normalizeId)(T||A);const ie=c.getSchemaRefs.call(this,O,A);return Y=new i.SchemaEnv({schema:O,schemaId:G,meta:C,baseId:A,localRefs:ie}),this._cache.set(Y.schema,Y),P&&!A.startsWith("#")&&(A&&this._checkUnique(A),this.refs[A]=Y),b&&this.validateSchema(O,!0),Y}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw new Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta?this._compileMetaSchema(O):i.compileSchema.call(this,O),!O.validate)throw new Error("ajv implementation error");return O.validate}_compileMetaSchema(O){const C=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,O)}finally{this.opts=C}}}g.ValidationError=n.default,g.MissingRefError=s.default,e.default=g;function d(M,O,C,A="error"){for(const b in M){const P=b;P in O&&this.logger[A](`${C}: option ${b}. ${M[P]}`)}}function $(M){return M=(0,c.normalizeId)(M),this.schemas[M]||this.refs[M]}function E(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const O in M)this.addSchema(M[O],O)}function R(){for(const M in this.opts.formats){const O=this.opts.formats[M];O&&this.addFormat(M,O)}}function Z(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const O in M){const C=M[O];C.keyword||(C.keyword=O),this.addKeyword(C)}}function L(){const M={...this.opts};for(const O of w)delete M[O];return M}const F={log(){},warn(){},error(){}};function V(M){if(M===!1)return F;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function K(M,O){const{RULES:C}=this;if((0,m.eachItem)(M,A=>{if(C.keywords[A])throw new Error(`Keyword ${A} is already defined`);if(!U.test(A))throw new Error(`Keyword ${A} has invalid name`)}),!!O&&O.$data&&!("code"in O||"validate"in O))throw new Error('$data keyword must have "code" or "validate" function')}function re(M,O,C){var A;const b=O?.post;if(C&&b)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let T=b?P.post:P.rules.find(({type:Y})=>Y===C);if(T||(T={type:C,rules:[]},P.rules.push(T)),P.keywords[M]=!0,!O)return;const G={keyword:M,definition:{...O,type:(0,u.getJSONTypes)(O.type),schemaType:(0,u.getJSONTypes)(O.schemaType)}};O.before?ye.call(this,T,G,O.before):T.rules.push(G),P.all[M]=G,(A=O.implements)===null||A===void 0||A.forEach(Y=>this.addKeyword(Y))}function ye(M,O,C){const A=M.rules.findIndex(b=>b.keyword===C);A>=0?M.rules.splice(A,0,O):(M.rules.push(O),this.logger.warn(`rule ${C} is not defined`))}function me(M){let{metaSchema:O}=M;O!==void 0&&(M.$data&&this.opts.$data&&(O=Oe(O)),M.validateSchema=this.compile(O,!0))}const ue={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Oe(M){return{anyOf:[M,ue]}}})(Bn)),Bn}var $r={},br={},wr={},bi;function Pm(){if(bi)return wr;bi=1,Object.defineProperty(wr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return wr.default=e,wr}var lt={},wi;function os(){if(wi)return lt;wi=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.callRef=lt.getValidate=void 0;const e=At(),t=We(),r=ne(),n=Ge(),s=gr(),o=ce(),i={keyword:"$ref",schemaType:"string",code(u){const{gen:m,schema:v,it:l}=u,{baseId:h,schemaEnv:w,validateName:S,opts:p,self:_}=l,{root:f}=w;if((v==="#"||v==="#/")&&h===f.baseId)return g();const y=s.resolveRef.call(_,f,h,v);if(y===void 0)throw new e.default(l.opts.uriResolver,h,v);if(y instanceof s.SchemaEnv)return d(y);return $(y);function g(){if(w===f)return c(u,S,w,w.$async);const E=m.scopeValue("root",{ref:f});return c(u,(0,r._)`${E}.validate`,f,f.$async)}function d(E){const R=a(u,E);c(u,R,E,E.$async)}function $(E){const R=m.scopeValue("schema",p.code.source===!0?{ref:E,code:(0,r.stringify)(E)}:{ref:E}),Z=m.name("valid"),L=u.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:R,errSchemaPath:v},Z);u.mergeEvaluated(L),u.ok(Z)}}};function a(u,m){const{gen:v}=u;return m.validate?v.scopeValue("validate",{ref:m.validate}):(0,r._)`${v.scopeValue("wrapper",{ref:m})}.validate`}lt.getValidate=a;function c(u,m,v,l){const{gen:h,it:w}=u,{allErrors:S,schemaEnv:p,opts:_}=w,f=_.passContext?n.default.this:r.nil;l?y():g();function y(){if(!p.$async)throw new Error("async schema referenced by sync schema");const E=h.let("valid");h.try(()=>{h.code((0,r._)`await ${(0,t.callValidateCode)(u,m,f)}`),$(m),S||h.assign(E,!0)},R=>{h.if((0,r._)`!(${R} instanceof ${w.ValidationError})`,()=>h.throw(R)),d(R),S||h.assign(E,!1)}),u.ok(E)}function g(){u.result((0,t.callValidateCode)(u,m,f),()=>$(m),()=>d(m))}function d(E){const R=(0,r._)`${E}.errors`;h.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${R} : ${n.default.vErrors}.concat(${R})`),h.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function $(E){var R;if(!w.opts.unevaluated)return;const Z=(R=v?.validate)===null||R===void 0?void 0:R.evaluated;if(w.props!==!0)if(Z&&!Z.dynamicProps)Z.props!==void 0&&(w.props=o.mergeEvaluated.props(h,Z.props,w.props));else{const L=h.var("props",(0,r._)`${E}.evaluated.props`);w.props=o.mergeEvaluated.props(h,L,w.props,r.Name)}if(w.items!==!0)if(Z&&!Z.dynamicItems)Z.items!==void 0&&(w.items=o.mergeEvaluated.items(h,Z.items,w.items));else{const L=h.var("items",(0,r._)`${E}.evaluated.items`);w.items=o.mergeEvaluated.items(h,L,w.items,r.Name)}}}return lt.callRef=c,lt.default=i,lt}var Si;function Ei(){if(Si)return br;Si=1,Object.defineProperty(br,"__esModule",{value:!0});const e=Pm(),t=os(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return br.default=r,br}var Sr={},Er={},ki;function Om(){if(ki)return Er;ki=1,Object.defineProperty(Er,"__esModule",{value:!0});const e=ne(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:o,schemaCode:i})=>(0,e.str)`must be ${r[o].okStr} ${i}`,params:({keyword:o,schemaCode:i})=>(0,e._)`{comparison: ${r[o].okStr}, limit: ${i}}`},s={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(o){const{keyword:i,data:a,schemaCode:c}=o;o.fail$data((0,e._)`${a} ${r[i].fail} ${c} || isNaN(${a})`)}};return Er.default=s,Er}var kr={},Pi;function jm(){if(Pi)return kr;Pi=1,Object.defineProperty(kr,"__esModule",{value:!0});const e=ne(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:s,data:o,schemaCode:i,it:a}=n,c=a.opts.multipleOfPrecision,u=s.let("res"),m=c?(0,e._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:(0,e._)`${u} !== parseInt(${u})`;n.fail$data((0,e._)`(${i} === 0 || (${u} = ${o}/${i}, ${m}))`)}};return kr.default=r,kr}var Pr={},Or={},Oi;function Am(){if(Oi)return Or;Oi=1,Object.defineProperty(Or,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,s=0,o;for(;s<r;)n++,o=t.charCodeAt(s++),o>=55296&&o<=56319&&s<r&&(o=t.charCodeAt(s),(o&64512)===56320&&s++);return n}return Or.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Or}var ji;function Nm(){if(ji)return Pr;ji=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=ne(),t=ce(),r=Am(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:i}){const a=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${i} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:i,data:a,schemaCode:c,it:u}=o,m=i==="maxLength"?e.operators.GT:e.operators.LT,v=u.opts.unicode===!1?(0,e._)`${a}.length`:(0,e._)`${(0,t.useFunc)(o.gen,r.default)}(${a})`;o.fail$data((0,e._)`${v} ${m} ${c}`)}};return Pr.default=s,Pr}var jr={},Ai;function zm(){if(Ai)return jr;Ai=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=We(),t=ce(),r=ne(),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,r.str)`must match pattern "${o}"`,params:({schemaCode:o})=>(0,r._)`{pattern: ${o}}`},code(o){const{gen:i,data:a,$data:c,schema:u,schemaCode:m,it:v}=o,l=v.opts.unicodeRegExp?"u":"";if(c){const{regExp:h}=v.opts.code,w=h.code==="new RegExp"?(0,r._)`new RegExp`:(0,t.useFunc)(i,h),S=i.let("valid");i.try(()=>i.assign(S,(0,r._)`${w}(${m}, ${l}).test(${a})`),()=>i.assign(S,!1)),o.fail$data((0,r._)`!${S}`)}else{const h=(0,e.usePattern)(o,u);o.fail$data((0,r._)`!${h}.test(${a})`)}}};return jr.default=s,jr}var Ar={},Ni;function Rm(){if(Ni)return Ar;Ni=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=ne(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const o=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${s} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:o,schemaCode:i}=n,a=s==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${o}).length ${a} ${i}`)}};return Ar.default=r,Ar}var Nr={},zi;function Im(){if(zi)return Nr;zi=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=We(),t=ne(),r=ce(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:i,schema:a,schemaCode:c,data:u,$data:m,it:v}=o,{opts:l}=v;if(!m&&a.length===0)return;const h=a.length>=l.loopRequired;if(v.allErrors?w():S(),l.strictRequired){const f=o.parentSchema.properties,{definedProperties:y}=o.it;for(const g of a)if(f?.[g]===void 0&&!y.has(g)){const d=v.schemaEnv.baseId+v.errSchemaPath,$=`required property "${g}" is not defined at "${d}" (strictRequired)`;(0,r.checkStrictMode)(v,$,v.opts.strictRequired)}}function w(){if(h||m)o.block$data(t.nil,p);else for(const f of a)(0,e.checkReportMissingProp)(o,f)}function S(){const f=i.let("missing");if(h||m){const y=i.let("valid",!0);o.block$data(y,()=>_(f,y)),o.ok(y)}else i.if((0,e.checkMissingProp)(o,a,f)),(0,e.reportMissingProp)(o,f),i.else()}function p(){i.forOf("prop",c,f=>{o.setParams({missingProperty:f}),i.if((0,e.noPropertyInData)(i,u,f,l.ownProperties),()=>o.error())})}function _(f,y){o.setParams({missingProperty:f}),i.forOf(f,c,()=>{i.assign(y,(0,e.propertyInData)(i,u,f,l.ownProperties)),i.if((0,t.not)(y),()=>{o.error(),i.break()})},t.nil)}}};return Nr.default=s,Nr}var zr={},Ri;function Tm(){if(Ri)return zr;Ri=1,Object.defineProperty(zr,"__esModule",{value:!0});const e=ne(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const o=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${s} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:o,schemaCode:i}=n,a=s==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${o}.length ${a} ${i}`)}};return zr.default=r,zr}var Rr={},Ir={},Ii;function is(){if(Ii)return Ir;Ii=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=ci();return e.code='require("ajv/dist/runtime/equal").default',Ir.default=e,Ir}var Ti;function Cm(){if(Ti)return Rr;Ti=1,Object.defineProperty(Rr,"__esModule",{value:!0});const e=hr(),t=ne(),r=ce(),n=is(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:a}})=>(0,t.str)`must NOT have duplicate items (items ## ${a} and ${i} are identical)`,params:({params:{i,j:a}})=>(0,t._)`{i: ${i}, j: ${a}}`},code(i){const{gen:a,data:c,$data:u,schema:m,parentSchema:v,schemaCode:l,it:h}=i;if(!u&&!m)return;const w=a.let("valid"),S=v.items?(0,e.getSchemaTypes)(v.items):[];i.block$data(w,p,(0,t._)`${l} === false`),i.ok(w);function p(){const g=a.let("i",(0,t._)`${c}.length`),d=a.let("j");i.setParams({i:g,j:d}),a.assign(w,!0),a.if((0,t._)`${g} > 1`,()=>(_()?f:y)(g,d))}function _(){return S.length>0&&!S.some(g=>g==="object"||g==="array")}function f(g,d){const $=a.name("item"),E=(0,e.checkDataTypes)(S,$,h.opts.strictNumbers,e.DataType.Wrong),R=a.const("indices",(0,t._)`{}`);a.for((0,t._)`;${g}--;`,()=>{a.let($,(0,t._)`${c}[${g}]`),a.if(E,(0,t._)`continue`),S.length>1&&a.if((0,t._)`typeof ${$} == "string"`,(0,t._)`${$} += "_"`),a.if((0,t._)`typeof ${R}[${$}] == "number"`,()=>{a.assign(d,(0,t._)`${R}[${$}]`),i.error(),a.assign(w,!1).break()}).code((0,t._)`${R}[${$}] = ${g}`)})}function y(g,d){const $=(0,r.useFunc)(a,n.default),E=a.name("outer");a.label(E).for((0,t._)`;${g}--;`,()=>a.for((0,t._)`${d} = ${g}; ${d}--;`,()=>a.if((0,t._)`${$}(${c}[${g}], ${c}[${d}])`,()=>{i.error(),a.assign(w,!1).break(E)})))}}};return Rr.default=o,Rr}var Tr={},Ci;function Mm(){if(Ci)return Tr;Ci=1,Object.defineProperty(Tr,"__esModule",{value:!0});const e=ne(),t=ce(),r=is(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:i,data:a,$data:c,schemaCode:u,schema:m}=o;c||m&&typeof m=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(i,r.default)}(${a}, ${u})`):o.fail((0,e._)`${m} !== ${a}`)}};return Tr.default=s,Tr}var Cr={},Mi;function Dm(){if(Mi)return Cr;Mi=1,Object.defineProperty(Cr,"__esModule",{value:!0});const e=ne(),t=ce(),r=is(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:i,data:a,$data:c,schema:u,schemaCode:m,it:v}=o;if(!c&&u.length===0)throw new Error("enum must have non-empty array");const l=u.length>=v.opts.loopEnum;let h;const w=()=>h??(h=(0,t.useFunc)(i,r.default));let S;if(l||c)S=i.let("valid"),o.block$data(S,p);else{if(!Array.isArray(u))throw new Error("ajv implementation error");const f=i.const("vSchema",m);S=(0,e.or)(...u.map((y,g)=>_(f,g)))}o.pass(S);function p(){i.assign(S,!1),i.forOf("v",m,f=>i.if((0,e._)`${w()}(${a}, ${f})`,()=>i.assign(S,!0).break()))}function _(f,y){const g=u[y];return typeof g=="object"&&g!==null?(0,e._)`${w()}(${a}, ${f}[${y}])`:(0,e._)`${a} === ${g}`}}};return Cr.default=s,Cr}var Di;function Vi(){if(Di)return Sr;Di=1,Object.defineProperty(Sr,"__esModule",{value:!0});const e=Om(),t=jm(),r=Nm(),n=zm(),s=Rm(),o=Im(),i=Tm(),a=Cm(),c=Mm(),u=Dm(),m=[e.default,t.default,r.default,n.default,s.default,o.default,i.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default];return Sr.default=m,Sr}var Mr={},Nt={},Fi;function qi(){if(Fi)return Nt;Fi=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.validateAdditionalItems=void 0;const e=ne(),t=ce(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:i,it:a}=o,{items:c}=i;if(!Array.isArray(c)){(0,t.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(o,c)}};function s(o,i){const{gen:a,schema:c,data:u,keyword:m,it:v}=o;v.items=!0;const l=a.const("len",(0,e._)`${u}.length`);if(c===!1)o.setParams({len:i.length}),o.pass((0,e._)`${l} <= ${i.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(v,c)){const w=a.var("valid",(0,e._)`${l} <= ${i.length}`);a.if((0,e.not)(w),()=>h(w)),o.ok(w)}function h(w){a.forRange("i",i.length,l,S=>{o.subschema({keyword:m,dataProp:S,dataPropType:t.Type.Num},w),v.allErrors||a.if((0,e.not)(w),()=>a.break())})}}return Nt.validateAdditionalItems=s,Nt.default=n,Nt}var Dr={},zt={},Zi;function Ui(){if(Zi)return zt;Zi=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.validateTuple=void 0;const e=ne(),t=ce(),r=We(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:i,it:a}=o;if(Array.isArray(i))return s(o,"additionalItems",i);a.items=!0,!(0,t.alwaysValidSchema)(a,i)&&o.ok((0,r.validateArray)(o))}};function s(o,i,a=o.schema){const{gen:c,parentSchema:u,data:m,keyword:v,it:l}=o;S(u),l.opts.unevaluated&&a.length&&l.items!==!0&&(l.items=t.mergeEvaluated.items(c,a.length,l.items));const h=c.name("valid"),w=c.const("len",(0,e._)`${m}.length`);a.forEach((p,_)=>{(0,t.alwaysValidSchema)(l,p)||(c.if((0,e._)`${w} > ${_}`,()=>o.subschema({keyword:v,schemaProp:_,dataProp:_},h)),o.ok(h))});function S(p){const{opts:_,errSchemaPath:f}=l,y=a.length,g=y===p.minItems&&(y===p.maxItems||p[i]===!1);if(_.strictTuples&&!g){const d=`"${v}" is ${y}-tuple, but minItems or maxItems/${i} are not specified or different at path "${f}"`;(0,t.checkStrictMode)(l,d,_.strictTuples)}}}return zt.validateTuple=s,zt.default=n,zt}var xi;function Vm(){if(xi)return Dr;xi=1,Object.defineProperty(Dr,"__esModule",{value:!0});const e=Ui(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return Dr.default=t,Dr}var Vr={},Li;function Fm(){if(Li)return Vr;Li=1,Object.defineProperty(Vr,"__esModule",{value:!0});const e=ne(),t=ce(),r=We(),n=qi(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{schema:a,parentSchema:c,it:u}=i,{prefixItems:m}=c;u.items=!0,!(0,t.alwaysValidSchema)(u,a)&&(m?(0,n.validateAdditionalItems)(i,m):i.ok((0,r.validateArray)(i)))}};return Vr.default=o,Vr}var Fr={},Ki;function qm(){if(Ki)return Fr;Ki=1,Object.defineProperty(Fr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:o}})=>o===void 0?(0,e.str)`must contain at least ${s} valid item(s)`:(0,e.str)`must contain at least ${s} and no more than ${o} valid item(s)`,params:({params:{min:s,max:o}})=>o===void 0?(0,e._)`{minContains: ${s}}`:(0,e._)`{minContains: ${s}, maxContains: ${o}}`},code(s){const{gen:o,schema:i,parentSchema:a,data:c,it:u}=s;let m,v;const{minContains:l,maxContains:h}=a;u.opts.next?(m=l===void 0?1:l,v=h):m=1;const w=o.const("len",(0,e._)`${c}.length`);if(s.setParams({min:m,max:v}),v===void 0&&m===0){(0,t.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(v!==void 0&&m>v){(0,t.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,t.alwaysValidSchema)(u,i)){let y=(0,e._)`${w} >= ${m}`;v!==void 0&&(y=(0,e._)`${y} && ${w} <= ${v}`),s.pass(y);return}u.items=!0;const S=o.name("valid");v===void 0&&m===1?_(S,()=>o.if(S,()=>o.break())):m===0?(o.let(S,!0),v!==void 0&&o.if((0,e._)`${c}.length > 0`,p)):(o.let(S,!1),p()),s.result(S,()=>s.reset());function p(){const y=o.name("_valid"),g=o.let("count",0);_(y,()=>o.if(y,()=>f(g)))}function _(y,g){o.forRange("i",0,w,d=>{s.subschema({keyword:"contains",dataProp:d,dataPropType:t.Type.Num,compositeRule:!0},y),g()})}function f(y){o.code((0,e._)`${y}++`),v===void 0?o.if((0,e._)`${y} >= ${m}`,()=>o.assign(S,!0).break()):(o.if((0,e._)`${y} > ${v}`,()=>o.assign(S,!1).break()),m===1?o.assign(S,!0):o.if((0,e._)`${y} >= ${m}`,()=>o.assign(S,!0)))}}};return Fr.default=n,Fr}var as={},Ji;function cs(){return Ji||(Ji=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ne(),r=ce(),n=We();e.error={message:({params:{property:c,depsCount:u,deps:m}})=>{const v=u===1?"property":"properties";return(0,t.str)`must have ${v} ${m} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:m,missingProperty:v}})=>(0,t._)`{property: ${c},
|
|
44
|
-
missingProperty: ${
|
|
43
|
+
|| ${R} === "boolean" || ${$} === null`).assign(Z,(0,n._)`[${$}]`)}}}function f({gen:l,parentData:v,parentDataProperty:g},d){l.if((0,n._)`${v} !== undefined`,()=>l.assign((0,n._)`${v}[${g}]`,d))}function h(l,v,g,d=o.Correct){const $=d===o.Correct?n.operators.EQ:n.operators.NEQ;let E;switch(l){case"null":return(0,n._)`${v} ${$} null`;case"array":E=(0,n._)`Array.isArray(${v})`;break;case"object":E=(0,n._)`${v} && typeof ${v} == "object" && !Array.isArray(${v})`;break;case"integer":E=R((0,n._)`!(${v} % 1) && !isNaN(${v})`);break;case"number":E=R();break;default:return(0,n._)`typeof ${v} ${$} ${l}`}return d===o.Correct?E:(0,n.not)(E);function R(Z=n.nil){return(0,n.and)((0,n._)`typeof ${v} == "number"`,Z,g?(0,n._)`isFinite(${v})`:n.nil)}}Ne.checkDataType=h;function w(l,v,g,d){if(l.length===1)return h(l[0],v,g,d);let $;const E=(0,s.toHash)(l);if(E.array&&E.object){const R=(0,n._)`typeof ${v} != "object"`;$=E.null?R:(0,n._)`!${v} || ${R}`,delete E.null,delete E.array,delete E.object}else $=n.nil;E.number&&delete E.integer;for(const R in E)$=(0,n.and)($,h(R,v,g,d));return $}Ne.checkDataTypes=w;const S={message:({schema:l})=>`must be ${l}`,params:({schema:l,schemaValue:v})=>typeof l=="string"?(0,n._)`{type: ${l}}`:(0,n._)`{type: ${v}}`};function p(l){const v=_(l);(0,r.reportError)(v,S)}Ne.reportTypeError=p;function _(l){const{gen:v,data:g,schema:d}=l,$=(0,s.schemaRefOrVal)(l,d,"type");return{gen:v,keyword:"type",data:g,schema:d.type,schemaCode:$,schemaValue:$,parentSchema:d,params:{},it:l}}return Ne}var qt={},ai;function bm(){if(ai)return qt;ai=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.assignDefaults=void 0;const e=ne(),t=de();function r(s,o){const{properties:i,items:a}=s.schema;if(o==="object"&&i)for(const c in i)n(s,c,i[c].default);else o==="array"&&Array.isArray(a)&&a.forEach((c,u)=>n(s,u,c.default))}qt.assignDefaults=r;function n(s,o,i){const{gen:a,compositeRule:c,data:u,opts:m}=s;if(i===void 0)return;const y=(0,e._)`${u}${(0,e.getProperty)(o)}`;if(c){(0,t.checkStrictMode)(s,`default is ignored for: ${y}`);return}let f=(0,e._)`${y} === undefined`;m.useDefaults==="empty"&&(f=(0,e._)`${f} || ${y} === null || ${y} === ""`),a.if(f,(0,e._)`${y} = ${(0,e.stringify)(i)}`)}return qt}var Xe={},pe={},ci;function Qe(){if(ci)return pe;ci=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.validateUnion=pe.validateArray=pe.usePattern=pe.callValidateCode=pe.schemaProperties=pe.allSchemaProperties=pe.noPropertyInData=pe.propertyInData=pe.isOwnProperty=pe.hasPropFunc=pe.reportMissingProp=pe.checkMissingProp=pe.checkReportMissingProp=void 0;const e=ne(),t=de(),r=Ye(),n=de();function s(l,v){const{gen:g,data:d,it:$}=l;g.if(m(g,d,v,$.opts.ownProperties),()=>{l.setParams({missingProperty:(0,e._)`${v}`},!0),l.error()})}pe.checkReportMissingProp=s;function o({gen:l,data:v,it:{opts:g}},d,$){return(0,e.or)(...d.map(E=>(0,e.and)(m(l,v,E,g.ownProperties),(0,e._)`${$} = ${E}`)))}pe.checkMissingProp=o;function i(l,v){l.setParams({missingProperty:v},!0),l.error()}pe.reportMissingProp=i;function a(l){return l.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}pe.hasPropFunc=a;function c(l,v,g){return(0,e._)`${a(l)}.call(${v}, ${g})`}pe.isOwnProperty=c;function u(l,v,g,d){const $=(0,e._)`${v}${(0,e.getProperty)(g)} !== undefined`;return d?(0,e._)`${$} && ${c(l,v,g)}`:$}pe.propertyInData=u;function m(l,v,g,d){const $=(0,e._)`${v}${(0,e.getProperty)(g)} === undefined`;return d?(0,e.or)($,(0,e.not)(c(l,v,g))):$}pe.noPropertyInData=m;function y(l){return l?Object.keys(l).filter(v=>v!=="__proto__"):[]}pe.allSchemaProperties=y;function f(l,v){return y(v).filter(g=>!(0,t.alwaysValidSchema)(l,v[g]))}pe.schemaProperties=f;function h({schemaCode:l,data:v,it:{gen:g,topSchemaRef:d,schemaPath:$,errorPath:E},it:R},Z,K,D){const V=D?(0,e._)`${l}, ${v}, ${d}${$}`:v,q=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,E)],[r.default.parentData,R.parentData],[r.default.parentDataProperty,R.parentDataProperty],[r.default.rootData,r.default.rootData]];R.opts.dynamicRef&&q.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const L=(0,e._)`${V}, ${g.object(...q)}`;return K!==e.nil?(0,e._)`${Z}.call(${K}, ${L})`:(0,e._)`${Z}(${L})`}pe.callValidateCode=h;const w=(0,e._)`new RegExp`;function S({gen:l,it:{opts:v}},g){const d=v.unicodeRegExp?"u":"",{regExp:$}=v.code,E=$(g,d);return l.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,e._)`${$.code==="new RegExp"?w:(0,n.useFunc)(l,$)}(${g}, ${d})`})}pe.usePattern=S;function p(l){const{gen:v,data:g,keyword:d,it:$}=l,E=v.name("valid");if($.allErrors){const Z=v.let("valid",!0);return R(()=>v.assign(Z,!1)),Z}return v.var(E,!0),R(()=>v.break()),E;function R(Z){const K=v.const("len",(0,e._)`${g}.length`);v.forRange("i",0,K,D=>{l.subschema({keyword:d,dataProp:D,dataPropType:t.Type.Num},E),v.if((0,e.not)(E),Z)})}}pe.validateArray=p;function _(l){const{gen:v,schema:g,keyword:d,it:$}=l;if(!Array.isArray(g))throw new Error("ajv implementation error");if(g.some(K=>(0,t.alwaysValidSchema)($,K))&&!$.opts.unevaluated)return;const R=v.let("valid",!1),Z=v.name("_valid");v.block(()=>g.forEach((K,D)=>{const V=l.subschema({keyword:d,schemaProp:D,compositeRule:!0},Z);v.assign(R,(0,e._)`${R} || ${Z}`),l.mergeValidEvaluated(V,Z)||v.if((0,e.not)(R))})),l.result(R,()=>l.reset(),()=>l.error(!0))}return pe.validateUnion=_,pe}var ui;function wm(){if(ui)return Xe;ui=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.validateKeywordUsage=Xe.validSchemaType=Xe.funcKeywordCode=Xe.macroKeywordCode=void 0;const e=ne(),t=Ye(),r=Qe(),n=pr();function s(f,h){const{gen:w,keyword:S,schema:p,parentSchema:_,it:l}=f,v=h.macro.call(l.self,p,_,l),g=u(w,S,v);l.opts.validateSchema!==!1&&l.self.validateSchema(v,!0);const d=w.name("valid");f.subschema({schema:v,schemaPath:e.nil,errSchemaPath:`${l.errSchemaPath}/${S}`,topSchemaRef:g,compositeRule:!0},d),f.pass(d,()=>f.error(!0))}Xe.macroKeywordCode=s;function o(f,h){var w;const{gen:S,keyword:p,schema:_,parentSchema:l,$data:v,it:g}=f;c(g,h);const d=!v&&h.compile?h.compile.call(g.self,_,l,g):h.validate,$=u(S,p,d),E=S.let("valid");f.block$data(E,R),f.ok((w=h.valid)!==null&&w!==void 0?w:E);function R(){if(h.errors===!1)D(),h.modifying&&i(f),V(()=>f.error());else{const q=h.async?Z():K();h.modifying&&i(f),V(()=>a(f,q))}}function Z(){const q=S.let("ruleErrs",null);return S.try(()=>D((0,e._)`await `),L=>S.assign(E,!1).if((0,e._)`${L} instanceof ${g.ValidationError}`,()=>S.assign(q,(0,e._)`${L}.errors`),()=>S.throw(L))),q}function K(){const q=(0,e._)`${$}.errors`;return S.assign(q,null),D(e.nil),q}function D(q=h.async?(0,e._)`await `:e.nil){const L=g.opts.passContext?t.default.this:t.default.self,re=!("compile"in h&&!v||h.schema===!1);S.assign(E,(0,e._)`${q}${(0,r.callValidateCode)(f,$,L,re)}`,h.modifying)}function V(q){var L;S.if((0,e.not)((L=h.valid)!==null&&L!==void 0?L:E),q)}}Xe.funcKeywordCode=o;function i(f){const{gen:h,data:w,it:S}=f;h.if(S.parentData,()=>h.assign(w,(0,e._)`${S.parentData}[${S.parentDataProperty}]`))}function a(f,h){const{gen:w}=f;w.if((0,e._)`Array.isArray(${h})`,()=>{w.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${h} : ${t.default.vErrors}.concat(${h})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(f)},()=>f.error())}function c({schemaEnv:f},h){if(h.async&&!f.$async)throw new Error("async keyword in sync schema")}function u(f,h,w){if(w===void 0)throw new Error(`keyword "${h}" failed to compile`);return f.scopeValue("keyword",typeof w=="function"?{ref:w}:{ref:w,code:(0,e.stringify)(w)})}function m(f,h,w=!1){return!h.length||h.some(S=>S==="array"?Array.isArray(f):S==="object"?f&&typeof f=="object"&&!Array.isArray(f):typeof f==S||w&&typeof f>"u")}Xe.validSchemaType=m;function y({schema:f,opts:h,self:w,errSchemaPath:S},p,_){if(Array.isArray(p.keyword)?!p.keyword.includes(_):p.keyword!==_)throw new Error("ajv implementation error");const l=p.dependencies;if(l?.some(v=>!Object.prototype.hasOwnProperty.call(f,v)))throw new Error(`parent schema must have dependencies of ${_}: ${l.join(",")}`);if(p.validateSchema&&!p.validateSchema(f[_])){const g=`keyword "${_}" value is invalid at path "${S}": `+w.errorsText(p.validateSchema.errors);if(h.validateSchema==="log")w.logger.error(g);else throw new Error(g)}}return Xe.validateKeywordUsage=y,Xe}var it={},di;function Sm(){if(di)return it;di=1,Object.defineProperty(it,"__esModule",{value:!0}),it.extendSubschemaMode=it.extendSubschemaData=it.getSubschema=void 0;const e=ne(),t=de();function r(o,{keyword:i,schemaProp:a,schema:c,schemaPath:u,errSchemaPath:m,topSchemaRef:y}){if(i!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){const f=o.schema[i];return a===void 0?{schema:f,schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(i)}`,errSchemaPath:`${o.errSchemaPath}/${i}`}:{schema:f[a],schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(i)}${(0,e.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${i}/${(0,t.escapeFragment)(a)}`}}if(c!==void 0){if(u===void 0||m===void 0||y===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:u,topSchemaRef:y,errSchemaPath:m}}throw new Error('either "keyword" or "schema" must be passed')}it.getSubschema=r;function n(o,i,{dataProp:a,dataPropType:c,data:u,dataTypes:m,propertyName:y}){if(u!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:f}=i;if(a!==void 0){const{errorPath:w,dataPathArr:S,opts:p}=i,_=f.let("data",(0,e._)`${i.data}${(0,e.getProperty)(a)}`,!0);h(_),o.errorPath=(0,e.str)`${w}${(0,t.getErrorPath)(a,c,p.jsPropertySyntax)}`,o.parentDataProperty=(0,e._)`${a}`,o.dataPathArr=[...S,o.parentDataProperty]}if(u!==void 0){const w=u instanceof e.Name?u:f.let("data",u,!0);h(w),y!==void 0&&(o.propertyName=y)}m&&(o.dataTypes=m);function h(w){o.data=w,o.dataLevel=i.dataLevel+1,o.dataTypes=[],i.definedProperties=new Set,o.parentData=i.data,o.dataNames=[...i.dataNames,w]}}it.extendSubschemaData=n;function s(o,{jtdDiscriminator:i,jtdMetadata:a,compositeRule:c,createErrors:u,allErrors:m}){c!==void 0&&(o.compositeRule=c),u!==void 0&&(o.createErrors=u),m!==void 0&&(o.allErrors=m),o.jtdDiscriminator=i,o.jtdMetadata=a}return it.extendSubschemaMode=s,it}var Me={},ns,li;function fi(){return li||(li=1,ns=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),ns}var ss={exports:{}},mi;function Em(){if(mi)return ss.exports;mi=1;var e=ss.exports=function(n,s,o){typeof s=="function"&&(o=s,s={}),o=s.cb||o;var i=typeof o=="function"?o:o.pre||function(){},a=o.post||function(){};t(s,i,a,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,s,o,i,a,c,u,m,y,f){if(i&&typeof i=="object"&&!Array.isArray(i)){s(i,a,c,u,m,y,f);for(var h in i){var w=i[h];if(Array.isArray(w)){if(h in e.arrayKeywords)for(var S=0;S<w.length;S++)t(n,s,o,w[S],a+"/"+h+"/"+S,c,a,h,i,S)}else if(h in e.propsKeywords){if(w&&typeof w=="object")for(var p in w)t(n,s,o,w[p],a+"/"+h+"/"+r(p),c,a,h,i,p)}else(h in e.keywords||n.allKeys&&!(h in e.skipKeywords))&&t(n,s,o,w,a+"/"+h,c,a,h,i)}o(i,a,c,u,m,y,f)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return ss.exports}var hi;function vr(){if(hi)return Me;hi=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.getSchemaRefs=Me.resolveUrl=Me.normalizeId=Me._getFullPath=Me.getFullPath=Me.inlineRef=void 0;const e=de(),t=fi(),r=Em(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(S,p=!0){return typeof S=="boolean"?!0:p===!0?!i(S):p?a(S)<=p:!1}Me.inlineRef=s;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(S){for(const p in S){if(o.has(p))return!0;const _=S[p];if(Array.isArray(_)&&_.some(i)||typeof _=="object"&&i(_))return!0}return!1}function a(S){let p=0;for(const _ in S){if(_==="$ref")return 1/0;if(p++,!n.has(_)&&(typeof S[_]=="object"&&(0,e.eachItem)(S[_],l=>p+=a(l)),p===1/0))return 1/0}return p}function c(S,p="",_){_!==!1&&(p=y(p));const l=S.parse(p);return u(S,l)}Me.getFullPath=c;function u(S,p){return S.serialize(p).split("#")[0]+"#"}Me._getFullPath=u;const m=/#\/?$/;function y(S){return S?S.replace(m,""):""}Me.normalizeId=y;function f(S,p,_){return _=y(_),S.resolve(p,_)}Me.resolveUrl=f;const h=/^[a-z_][-a-z0-9._]*$/i;function w(S,p){if(typeof S=="boolean")return{};const{schemaId:_,uriResolver:l}=this.opts,v=y(S[_]||p),g={"":v},d=c(l,v,!1),$={},E=new Set;return r(S,{allKeys:!0},(K,D,V,q)=>{if(q===void 0)return;const L=d+D;let re=g[q];typeof K[_]=="string"&&(re=he.call(this,K[_])),ye.call(this,K.$anchor),ye.call(this,K.$dynamicAnchor),g[D]=re;function he(ce){const Ae=this.opts.uriResolver.resolve;if(ce=y(re?Ae(re,ce):ce),E.has(ce))throw Z(ce);E.add(ce);let U=this.refs[ce];return typeof U=="string"&&(U=this.refs[U]),typeof U=="object"?R(K,U.schema,ce):ce!==y(L)&&(ce[0]==="#"?(R(K,$[ce],ce),$[ce]=K):this.refs[ce]=L),ce}function ye(ce){if(typeof ce=="string"){if(!h.test(ce))throw new Error(`invalid anchor "${ce}"`);he.call(this,`#${ce}`)}}}),$;function R(K,D,V){if(D!==void 0&&!t(K,D))throw Z(V)}function Z(K){return new Error(`reference "${K}" resolves to more than one schema`)}}return Me.getSchemaRefs=w,Me}var pi;function Nt(){if(pi)return st;pi=1,Object.defineProperty(st,"__esModule",{value:!0}),st.getData=st.KeywordCxt=st.validateFunctionCode=void 0;const e=$m(),t=yr(),r=oi(),n=yr(),s=bm(),o=wm(),i=Sm(),a=ne(),c=Ye(),u=vr(),m=de(),y=pr();function f(j){if(d(j)&&(E(j),g(j))){p(j);return}h(j,()=>(0,e.topBoolOrEmptySchema)(j))}st.validateFunctionCode=f;function h({gen:j,validateName:z,schema:F,schemaEnv:J,opts:Q},ie){Q.code.es5?j.func(z,(0,a._)`${c.default.data}, ${c.default.valCxt}`,J.$async,()=>{j.code((0,a._)`"use strict"; ${l(F,Q)}`),S(j,Q),j.code(ie)}):j.func(z,(0,a._)`${c.default.data}, ${w(Q)}`,J.$async,()=>j.code(l(F,Q)).code(ie))}function w(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 S(j,z){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}`),z.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),z.dynamicRef&&j.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function p(j){const{schema:z,opts:F,gen:J}=j;h(j,()=>{F.$comment&&z.$comment&&q(j),K(j),J.let(c.default.vErrors,null),J.let(c.default.errors,0),F.unevaluated&&_(j),R(j),L(j)})}function _(j){const{gen:z,validateName:F}=j;j.evaluated=z.const("evaluated",(0,a._)`${F}.evaluated`),z.if((0,a._)`${j.evaluated}.dynamicProps`,()=>z.assign((0,a._)`${j.evaluated}.props`,(0,a._)`undefined`)),z.if((0,a._)`${j.evaluated}.dynamicItems`,()=>z.assign((0,a._)`${j.evaluated}.items`,(0,a._)`undefined`))}function l(j,z){const F=typeof j=="object"&&j[z.schemaId];return F&&(z.code.source||z.code.process)?(0,a._)`/*# sourceURL=${F} */`:a.nil}function v(j,z){if(d(j)&&(E(j),g(j))){$(j,z);return}(0,e.boolOrEmptySchema)(j,z)}function g({schema:j,self:z}){if(typeof j=="boolean")return!j;for(const F in j)if(z.RULES.all[F])return!0;return!1}function d(j){return typeof j.schema!="boolean"}function $(j,z){const{schema:F,gen:J,opts:Q}=j;Q.$comment&&F.$comment&&q(j),D(j),V(j);const ie=J.const("_errs",c.default.errors);R(j,ie),J.var(z,(0,a._)`${ie} === ${c.default.errors}`)}function E(j){(0,m.checkUnknownRules)(j),Z(j)}function R(j,z){if(j.opts.jtd)return he(j,[],!1,z);const F=(0,t.getSchemaTypes)(j.schema),J=(0,t.coerceAndCheckDataType)(j,F);he(j,F,!J,z)}function Z(j){const{schema:z,errSchemaPath:F,opts:J,self:Q}=j;z.$ref&&J.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(z,Q.RULES)&&Q.logger.warn(`$ref: keywords ignored in schema at path "${F}"`)}function K(j){const{schema:z,opts:F}=j;z.default!==void 0&&F.useDefaults&&F.strictSchema&&(0,m.checkStrictMode)(j,"default is ignored in the schema root")}function D(j){const z=j.schema[j.opts.schemaId];z&&(j.baseId=(0,u.resolveUrl)(j.opts.uriResolver,j.baseId,z))}function V(j){if(j.schema.$async&&!j.schemaEnv.$async)throw new Error("async schema in sync schema")}function q({gen:j,schemaEnv:z,schema:F,errSchemaPath:J,opts:Q}){const ie=F.$comment;if(Q.$comment===!0)j.code((0,a._)`${c.default.self}.logger.log(${ie})`);else if(typeof Q.$comment=="function"){const Oe=(0,a.str)`${J}/$comment`,Ke=j.scopeValue("root",{ref:z.root});j.code((0,a._)`${c.default.self}.opts.$comment(${ie}, ${Oe}, ${Ke}.schema)`)}}function L(j){const{gen:z,schemaEnv:F,validateName:J,ValidationError:Q,opts:ie}=j;F.$async?z.if((0,a._)`${c.default.errors} === 0`,()=>z.return(c.default.data),()=>z.throw((0,a._)`new ${Q}(${c.default.vErrors})`)):(z.assign((0,a._)`${J}.errors`,c.default.vErrors),ie.unevaluated&&re(j),z.return((0,a._)`${c.default.errors} === 0`))}function re({gen:j,evaluated:z,props:F,items:J}){F instanceof a.Name&&j.assign((0,a._)`${z}.props`,F),J instanceof a.Name&&j.assign((0,a._)`${z}.items`,J)}function he(j,z,F,J){const{gen:Q,schema:ie,data:Oe,allErrors:Ke,opts:Re,self:De}=j,{RULES:je}=De;if(ie.$ref&&(Re.ignoreKeywordsWithRef||!(0,m.schemaHasRulesButRef)(ie,je))){Q.block(()=>B(j,"$ref",je.all.$ref.definition));return}Re.jtd||ce(j,z),Q.block(()=>{for(const A of je.rules)P(A);P(je.post)});function P(A){(0,r.shouldUseGroup)(ie,A)&&(A.type?(Q.if((0,n.checkDataType)(A.type,Oe,Re.strictNumbers)),ye(j,A),z.length===1&&z[0]===A.type&&F&&(Q.else(),(0,n.reportTypeError)(j)),Q.endIf()):ye(j,A),Ke||Q.if((0,a._)`${c.default.errors} === ${J||0}`))}}function ye(j,z){const{gen:F,schema:J,opts:{useDefaults:Q}}=j;Q&&(0,s.assignDefaults)(j,z.type),F.block(()=>{for(const ie of z.rules)(0,r.shouldUseRule)(J,ie)&&B(j,ie.keyword,ie.definition,z.type)})}function ce(j,z){j.schemaEnv.meta||!j.opts.strictTypes||(Ae(j,z),j.opts.allowUnionTypes||U(j,z),O(j,j.dataTypes))}function Ae(j,z){if(z.length){if(!j.dataTypes.length){j.dataTypes=z;return}z.forEach(F=>{N(j.dataTypes,F)||k(j,`type "${F}" not allowed by context "${j.dataTypes.join(",")}"`)}),b(j,z)}}function U(j,z){z.length>1&&!(z.length===2&&z.includes("null"))&&k(j,"use allowUnionTypes to allow union type keyword")}function O(j,z){const F=j.self.RULES.all;for(const J in F){const Q=F[J];if(typeof Q=="object"&&(0,r.shouldUseRule)(j.schema,Q)){const{type:ie}=Q.definition;ie.length&&!ie.some(Oe=>C(z,Oe))&&k(j,`missing type "${ie.join(",")}" for keyword "${J}"`)}}}function C(j,z){return j.includes(z)||z==="number"&&j.includes("integer")}function N(j,z){return j.includes(z)||z==="integer"&&j.includes("number")}function b(j,z){const F=[];for(const J of j.dataTypes)N(z,J)?F.push(J):z.includes("integer")&&J==="number"&&F.push("integer");j.dataTypes=F}function k(j,z){const F=j.schemaEnv.baseId+j.errSchemaPath;z+=` at "${F}" (strictTypes)`,(0,m.checkStrictMode)(j,z,j.opts.strictTypes)}class T{constructor(z,F,J){if((0,o.validateKeywordUsage)(z,F,J),this.gen=z.gen,this.allErrors=z.allErrors,this.keyword=J,this.data=z.data,this.schema=z.schema[J],this.$data=F.$data&&z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(z,this.schema,J,this.$data),this.schemaType=F.schemaType,this.parentSchema=z.schema,this.params={},this.it=z,this.def=F,this.$data)this.schemaCode=z.gen.const("vSchema",oe(this.$data,z));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,F.schemaType,F.allowUndefined))throw new Error(`${J} value must be ${JSON.stringify(F.schemaType)}`);("code"in F?F.trackErrors:F.errors!==!1)&&(this.errsCount=z.gen.const("_errs",c.default.errors))}result(z,F,J){this.failResult((0,a.not)(z),F,J)}failResult(z,F,J){this.gen.if(z),J?J():this.error(),F?(this.gen.else(),F(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(z,F){this.failResult((0,a.not)(z),void 0,F)}fail(z){if(z===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(z),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(z){if(!this.$data)return this.fail(z);const{schemaCode:F}=this;this.fail((0,a._)`${F} !== undefined && (${(0,a.or)(this.invalid$data(),z)})`)}error(z,F,J){if(F){this.setParams(F),this._error(z,J),this.setParams({});return}this._error(z,J)}_error(z,F){(z?y.reportExtraError:y.reportError)(this,this.def.error,F)}$dataError(){(0,y.reportError)(this,this.def.$dataError||y.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,y.resetErrorsCount)(this.gen,this.errsCount)}ok(z){this.allErrors||this.gen.if(z)}setParams(z,F){F?Object.assign(this.params,z):this.params=z}block$data(z,F,J=a.nil){this.gen.block(()=>{this.check$data(z,J),F()})}check$data(z=a.nil,F=a.nil){if(!this.$data)return;const{gen:J,schemaCode:Q,schemaType:ie,def:Oe}=this;J.if((0,a.or)((0,a._)`${Q} === undefined`,F)),z!==a.nil&&J.assign(z,!0),(ie.length||Oe.validateSchema)&&(J.elseIf(this.invalid$data()),this.$dataError(),z!==a.nil&&J.assign(z,!1)),J.else()}invalid$data(){const{gen:z,schemaCode:F,schemaType:J,def:Q,it:ie}=this;return(0,a.or)(Oe(),Ke());function Oe(){if(J.length){if(!(F instanceof a.Name))throw new Error("ajv implementation error");const Re=Array.isArray(J)?J:[J];return(0,a._)`${(0,n.checkDataTypes)(Re,F,ie.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function Ke(){if(Q.validateSchema){const Re=z.scopeValue("validate$data",{ref:Q.validateSchema});return(0,a._)`!${Re}(${F})`}return a.nil}}subschema(z,F){const J=(0,i.getSubschema)(this.it,z);(0,i.extendSubschemaData)(J,this.it,z),(0,i.extendSubschemaMode)(J,z);const Q={...this.it,...J,items:void 0,props:void 0};return v(Q,F),Q}mergeEvaluated(z,F){const{it:J,gen:Q}=this;J.opts.unevaluated&&(J.props!==!0&&z.props!==void 0&&(J.props=m.mergeEvaluated.props(Q,z.props,J.props,F)),J.items!==!0&&z.items!==void 0&&(J.items=m.mergeEvaluated.items(Q,z.items,J.items,F)))}mergeValidEvaluated(z,F){const{it:J,gen:Q}=this;if(J.opts.unevaluated&&(J.props!==!0||J.items!==!0))return Q.if(F,()=>this.mergeEvaluated(z,a.Name)),!0}}st.KeywordCxt=T;function B(j,z,F,J){const Q=new T(j,F,z);"code"in F?F.code(Q,J):Q.$data&&F.validate?(0,o.funcKeywordCode)(Q,F):"macro"in F?(0,o.macroKeywordCode)(Q,F):(F.compile||F.validate)&&(0,o.funcKeywordCode)(Q,F)}const W=/^\/(?:[^~]|~0|~1)*$/,ue=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oe(j,{dataLevel:z,dataNames:F,dataPathArr:J}){let Q,ie;if(j==="")return c.default.rootData;if(j[0]==="/"){if(!W.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);Q=j,ie=c.default.rootData}else{const De=ue.exec(j);if(!De)throw new Error(`Invalid JSON-pointer: ${j}`);const je=+De[1];if(Q=De[2],Q==="#"){if(je>=z)throw new Error(Re("property/index",je));return J[z-je]}if(je>z)throw new Error(Re("data",je));if(ie=F[z-je],!Q)return ie}let Oe=ie;const Ke=Q.split("/");for(const De of Ke)De&&(ie=(0,a._)`${ie}${(0,a.getProperty)((0,m.unescapeJsonPointer)(De))}`,Oe=(0,a._)`${Oe} && ${ie}`);return Oe;function Re(De,je){return`Cannot access ${De} ${je} levels up, current level is ${z}`}}return st.getData=oe,st}var gr={},yi;function Zt(){if(yi)return gr;yi=1,Object.defineProperty(gr,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return gr.default=e,gr}var _r={},vi;function zt(){if(vi)return _r;vi=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=vr();class t extends Error{constructor(n,s,o,i){super(i||`can't resolve reference ${o} from id ${s}`),this.missingRef=(0,e.resolveUrl)(n,s,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return _r.default=t,_r}var Le={},gi;function $r(){if(gi)return Le;gi=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.resolveSchema=Le.getCompilingSchema=Le.resolveRef=Le.compileSchema=Le.SchemaEnv=void 0;const e=ne(),t=Zt(),r=Ye(),n=vr(),s=de(),o=Nt();class i{constructor(_){var l;this.refs={},this.dynamicAnchors={};let v;typeof _.schema=="object"&&(v=_.schema),this.schema=_.schema,this.schemaId=_.schemaId,this.root=_.root||this,this.baseId=(l=_.baseId)!==null&&l!==void 0?l:(0,n.normalizeId)(v?.[_.schemaId||"$id"]),this.schemaPath=_.schemaPath,this.localRefs=_.localRefs,this.meta=_.meta,this.$async=v?.$async,this.refs={}}}Le.SchemaEnv=i;function a(p){const _=m.call(this,p);if(_)return _;const l=(0,n.getFullPath)(this.opts.uriResolver,p.root.baseId),{es5:v,lines:g}=this.opts.code,{ownProperties:d}=this.opts,$=new e.CodeGen(this.scope,{es5:v,lines:g,ownProperties:d});let E;p.$async&&(E=$.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const R=$.scopeName("validate");p.validateName=R;const Z={gen:$,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:$.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,e.stringify)(p.schema)}:{ref:p.schema}),validateName:R,ValidationError:E,schema:p.schema,schemaEnv:p,rootId:l,baseId:p.baseId||l,schemaPath:e.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let K;try{this._compilations.add(p),(0,o.validateFunctionCode)(Z),$.optimize(this.opts.code.optimize);const D=$.toString();K=`${$.scopeRefs(r.default.scope)}return ${D}`,this.opts.code.process&&(K=this.opts.code.process(K,p));const q=new Function(`${r.default.self}`,`${r.default.scope}`,K)(this,this.scope.get());if(this.scope.value(R,{ref:q}),q.errors=null,q.schema=p.schema,q.schemaEnv=p,p.$async&&(q.$async=!0),this.opts.code.source===!0&&(q.source={validateName:R,validateCode:D,scopeValues:$._values}),this.opts.unevaluated){const{props:L,items:re}=Z;q.evaluated={props:L instanceof e.Name?void 0:L,items:re instanceof e.Name?void 0:re,dynamicProps:L instanceof e.Name,dynamicItems:re instanceof e.Name},q.source&&(q.source.evaluated=(0,e.stringify)(q.evaluated))}return p.validate=q,p}catch(D){throw delete p.validate,delete p.validateName,K&&this.logger.error("Error compiling schema, function code:",K),D}finally{this._compilations.delete(p)}}Le.compileSchema=a;function c(p,_,l){var v;l=(0,n.resolveUrl)(this.opts.uriResolver,_,l);const g=p.refs[l];if(g)return g;let d=f.call(this,p,l);if(d===void 0){const $=(v=p.localRefs)===null||v===void 0?void 0:v[l],{schemaId:E}=this.opts;$&&(d=new i({schema:$,schemaId:E,root:p,baseId:_}))}if(d!==void 0)return p.refs[l]=u.call(this,d)}Le.resolveRef=c;function u(p){return(0,n.inlineRef)(p.schema,this.opts.inlineRefs)?p.schema:p.validate?p:a.call(this,p)}function m(p){for(const _ of this._compilations)if(y(_,p))return _}Le.getCompilingSchema=m;function y(p,_){return p.schema===_.schema&&p.root===_.root&&p.baseId===_.baseId}function f(p,_){let l;for(;typeof(l=this.refs[_])=="string";)_=l;return l||this.schemas[_]||h.call(this,p,_)}function h(p,_){const l=this.opts.uriResolver.parse(_),v=(0,n._getFullPath)(this.opts.uriResolver,l);let g=(0,n.getFullPath)(this.opts.uriResolver,p.baseId,void 0);if(Object.keys(p.schema).length>0&&v===g)return S.call(this,l,p);const d=(0,n.normalizeId)(v),$=this.refs[d]||this.schemas[d];if(typeof $=="string"){const E=h.call(this,p,$);return typeof E?.schema!="object"?void 0:S.call(this,l,E)}if(typeof $?.schema=="object"){if($.validate||a.call(this,$),d===(0,n.normalizeId)(_)){const{schema:E}=$,{schemaId:R}=this.opts,Z=E[R];return Z&&(g=(0,n.resolveUrl)(this.opts.uriResolver,g,Z)),new i({schema:E,schemaId:R,root:p,baseId:g})}return S.call(this,l,$)}}Le.resolveSchema=h;const w=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function S(p,{baseId:_,schema:l,root:v}){var g;if(((g=p.fragment)===null||g===void 0?void 0:g[0])!=="/")return;for(const E of p.fragment.slice(1).split("/")){if(typeof l=="boolean")return;const R=l[(0,s.unescapeFragment)(E)];if(R===void 0)return;l=R;const Z=typeof l=="object"&&l[this.opts.schemaId];!w.has(E)&&Z&&(_=(0,n.resolveUrl)(this.opts.uriResolver,_,Z))}let d;if(typeof l!="boolean"&&l.$ref&&!(0,s.schemaHasRulesButRef)(l,this.RULES)){const E=(0,n.resolveUrl)(this.opts.uriResolver,_,l.$ref);d=h.call(this,v,E)}const{schemaId:$}=this.opts;if(d=d||new i({schema:l,schemaId:$,root:v,baseId:_}),d.schema!==d.root.schema)return d}return Le}const km={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var br={},Ut={exports:{}},os,_i;function $i(){if(_i)return os;_i=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function r(f){let h="",w=0,S=0;for(S=0;S<f.length;S++)if(w=f[S].charCodeAt(0),w!==48){if(!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";h+=f[S];break}for(S+=1;S<f.length;S++){if(w=f[S].charCodeAt(0),!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";h+=f[S]}return h}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s(f){return f.length=0,!0}function o(f,h,w){if(f.length){const S=r(f);if(S!=="")h.push(S);else return w.error=!0,!1;f.length=0}return!0}function i(f){let h=0;const w={error:!1,address:"",zone:""},S=[],p=[];let _=!1,l=!1,v=o;for(let g=0;g<f.length;g++){const d=f[g];if(!(d==="["||d==="]"))if(d===":"){if(_===!0&&(l=!0),!v(p,S,w))break;if(++h>7){w.error=!0;break}g>0&&f[g-1]===":"&&(_=!0),S.push(":");continue}else if(d==="%"){if(!v(p,S,w))break;v=s}else{p.push(d);continue}}return p.length&&(v===s?w.zone=p.join(""):l?S.push(p.join("")):S.push(r(p))),w.address=S.join(""),w}function a(f){if(c(f,":")<2)return{host:f,isIPV6:!1};const h=i(f);if(h.error)return{host:f,isIPV6:!1};{let w=h.address,S=h.address;return h.zone&&(w+="%"+h.zone,S+="%25"+h.zone),{host:w,isIPV6:!0,escapedHost:S}}}function c(f,h){let w=0;for(let S=0;S<f.length;S++)f[S]===h&&w++;return w}function u(f){let h=f;const w=[];let S=-1,p=0;for(;p=h.length;){if(p===1){if(h===".")break;if(h==="/"){w.push("/");break}else{w.push(h);break}}else if(p===2){if(h[0]==="."){if(h[1]===".")break;if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&(h[1]==="."||h[1]==="/")){w.push("/");break}}else if(p===3&&h==="/.."){w.length!==0&&w.pop(),w.push("/");break}if(h[0]==="."){if(h[1]==="."){if(h[2]==="/"){h=h.slice(3);continue}}else if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&h[1]==="."){if(h[2]==="/"){h=h.slice(2);continue}else if(h[2]==="."&&h[3]==="/"){h=h.slice(3),w.length!==0&&w.pop();continue}}if((S=h.indexOf("/",1))===-1){w.push(h);break}else w.push(h.slice(0,S)),h=h.slice(S)}return w.join("")}function m(f,h){const w=h!==!0?escape:unescape;return f.scheme!==void 0&&(f.scheme=w(f.scheme)),f.userinfo!==void 0&&(f.userinfo=w(f.userinfo)),f.host!==void 0&&(f.host=w(f.host)),f.path!==void 0&&(f.path=w(f.path)),f.query!==void 0&&(f.query=w(f.query)),f.fragment!==void 0&&(f.fragment=w(f.fragment)),f}function y(f){const h=[];if(f.userinfo!==void 0&&(h.push(f.userinfo),h.push("@")),f.host!==void 0){let w=unescape(f.host);if(!t(w)){const S=a(w);S.isIPV6===!0?w=`[${S.escapedHost}]`:w=f.host}h.push(w)}return(typeof f.port=="number"||typeof f.port=="string")&&(h.push(":"),h.push(String(f.port))),h.length?h.join(""):void 0}return os={nonSimpleDomain:n,recomposeAuthority:y,normalizeComponentEncoding:m,removeDotSegments:u,isIPv4:t,isUUID:e,normalizeIPv6:a,stringArrayToHexStripped:r},os}var is,bi;function Pm(){if(bi)return is;bi=1;const{isUUID:e}=$i(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(d){return r.indexOf(d)!==-1}function s(d){return d.secure===!0?!0:d.secure===!1?!1:d.scheme?d.scheme.length===3&&(d.scheme[0]==="w"||d.scheme[0]==="W")&&(d.scheme[1]==="s"||d.scheme[1]==="S")&&(d.scheme[2]==="s"||d.scheme[2]==="S"):!1}function o(d){return d.host||(d.error=d.error||"HTTP URIs must have a host."),d}function i(d){const $=String(d.scheme).toLowerCase()==="https";return(d.port===($?443:80)||d.port==="")&&(d.port=void 0),d.path||(d.path="/"),d}function a(d){return d.secure=s(d),d.resourceName=(d.path||"/")+(d.query?"?"+d.query:""),d.path=void 0,d.query=void 0,d}function c(d){if((d.port===(s(d)?443:80)||d.port==="")&&(d.port=void 0),typeof d.secure=="boolean"&&(d.scheme=d.secure?"wss":"ws",d.secure=void 0),d.resourceName){const[$,E]=d.resourceName.split("?");d.path=$&&$!=="/"?$:void 0,d.query=E,d.resourceName=void 0}return d.fragment=void 0,d}function u(d,$){if(!d.path)return d.error="URN can not be parsed",d;const E=d.path.match(t);if(E){const R=$.scheme||d.scheme||"urn";d.nid=E[1].toLowerCase(),d.nss=E[2];const Z=`${R}:${$.nid||d.nid}`,K=g(Z);d.path=void 0,K&&(d=K.parse(d,$))}else d.error=d.error||"URN can not be parsed.";return d}function m(d,$){if(d.nid===void 0)throw new Error("URN without nid cannot be serialized");const E=$.scheme||d.scheme||"urn",R=d.nid.toLowerCase(),Z=`${E}:${$.nid||R}`,K=g(Z);K&&(d=K.serialize(d,$));const D=d,V=d.nss;return D.path=`${R||$.nid}:${V}`,$.skipEscape=!0,D}function y(d,$){const E=d;return E.uuid=E.nss,E.nss=void 0,!$.tolerant&&(!E.uuid||!e(E.uuid))&&(E.error=E.error||"UUID is not valid."),E}function f(d){const $=d;return $.nss=(d.uuid||"").toLowerCase(),$}const h={scheme:"http",domainHost:!0,parse:o,serialize:i},w={scheme:"https",domainHost:h.domainHost,parse:o,serialize:i},S={scheme:"ws",domainHost:!0,parse:a,serialize:c},p={scheme:"wss",domainHost:S.domainHost,parse:S.parse,serialize:S.serialize},v={http:h,https:w,ws:S,wss:p,urn:{scheme:"urn",parse:u,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:y,serialize:f,skipNormalize:!0}};Object.setPrototypeOf(v,null);function g(d){return d&&(v[d]||v[d.toLowerCase()])||void 0}return is={wsIsSecure:s,SCHEMES:v,isValidSchemeName:n,getSchemeHandler:g},is}var wi;function Om(){if(wi)return Ut.exports;wi=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:s,nonSimpleDomain:o}=$i(),{SCHEMES:i,getSchemeHandler:a}=Pm();function c(p,_){return typeof p=="string"?p=f(w(p,_),_):typeof p=="object"&&(p=w(f(p,_),_)),p}function u(p,_,l){const v=l?Object.assign({scheme:"null"},l):{scheme:"null"},g=m(w(p,v),w(_,v),v,!0);return v.skipEscape=!0,f(g,v)}function m(p,_,l,v){const g={};return v||(p=w(f(p,l),l),_=w(f(_,l),l)),l=l||{},!l.tolerant&&_.scheme?(g.scheme=_.scheme,g.userinfo=_.userinfo,g.host=_.host,g.port=_.port,g.path=t(_.path||""),g.query=_.query):(_.userinfo!==void 0||_.host!==void 0||_.port!==void 0?(g.userinfo=_.userinfo,g.host=_.host,g.port=_.port,g.path=t(_.path||""),g.query=_.query):(_.path?(_.path[0]==="/"?g.path=t(_.path):((p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path?g.path="/"+_.path:p.path?g.path=p.path.slice(0,p.path.lastIndexOf("/")+1)+_.path:g.path=_.path,g.path=t(g.path)),g.query=_.query):(g.path=p.path,_.query!==void 0?g.query=_.query:g.query=p.query),g.userinfo=p.userinfo,g.host=p.host,g.port=p.port),g.scheme=p.scheme),g.fragment=_.fragment,g}function y(p,_,l){return typeof p=="string"?(p=unescape(p),p=f(n(w(p,l),!0),{...l,skipEscape:!0})):typeof p=="object"&&(p=f(n(p,!0),{...l,skipEscape:!0})),typeof _=="string"?(_=unescape(_),_=f(n(w(_,l),!0),{...l,skipEscape:!0})):typeof _=="object"&&(_=f(n(_,!0),{...l,skipEscape:!0})),p.toLowerCase()===_.toLowerCase()}function f(p,_){const l={host:p.host,scheme:p.scheme,userinfo:p.userinfo,port:p.port,path:p.path,query:p.query,nid:p.nid,nss:p.nss,uuid:p.uuid,fragment:p.fragment,reference:p.reference,resourceName:p.resourceName,secure:p.secure,error:""},v=Object.assign({},_),g=[],d=a(v.scheme||l.scheme);d&&d.serialize&&d.serialize(l,v),l.path!==void 0&&(v.skipEscape?l.path=unescape(l.path):(l.path=escape(l.path),l.scheme!==void 0&&(l.path=l.path.split("%3A").join(":")))),v.reference!=="suffix"&&l.scheme&&g.push(l.scheme,":");const $=r(l);if($!==void 0&&(v.reference!=="suffix"&&g.push("//"),g.push($),l.path&&l.path[0]!=="/"&&g.push("/")),l.path!==void 0){let E=l.path;!v.absolutePath&&(!d||!d.absolutePath)&&(E=t(E)),$===void 0&&E[0]==="/"&&E[1]==="/"&&(E="/%2F"+E.slice(2)),g.push(E)}return l.query!==void 0&&g.push("?",l.query),l.fragment!==void 0&&g.push("#",l.fragment),g.join("")}const h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function w(p,_){const l=Object.assign({},_),v={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let g=!1;l.reference==="suffix"&&(l.scheme?p=l.scheme+":"+p:p="//"+p);const d=p.match(h);if(d){if(v.scheme=d[1],v.userinfo=d[3],v.host=d[4],v.port=parseInt(d[5],10),v.path=d[6]||"",v.query=d[7],v.fragment=d[8],isNaN(v.port)&&(v.port=d[5]),v.host)if(s(v.host)===!1){const R=e(v.host);v.host=R.host.toLowerCase(),g=R.isIPV6}else g=!0;v.scheme===void 0&&v.userinfo===void 0&&v.host===void 0&&v.port===void 0&&v.query===void 0&&!v.path?v.reference="same-document":v.scheme===void 0?v.reference="relative":v.fragment===void 0?v.reference="absolute":v.reference="uri",l.reference&&l.reference!=="suffix"&&l.reference!==v.reference&&(v.error=v.error||"URI is not a "+l.reference+" reference.");const $=a(l.scheme||v.scheme);if(!l.unicodeSupport&&(!$||!$.unicodeSupport)&&v.host&&(l.domainHost||$&&$.domainHost)&&g===!1&&o(v.host))try{v.host=URL.domainToASCII(v.host.toLowerCase())}catch(E){v.error=v.error||"Host's domain name can not be converted to ASCII: "+E}(!$||$&&!$.skipNormalize)&&(p.indexOf("%")!==-1&&(v.scheme!==void 0&&(v.scheme=unescape(v.scheme)),v.host!==void 0&&(v.host=unescape(v.host))),v.path&&(v.path=escape(unescape(v.path))),v.fragment&&(v.fragment=encodeURI(decodeURIComponent(v.fragment)))),$&&$.parse&&$.parse(v,l)}else v.error=v.error||"URI can not be parsed.";return v}const S={SCHEMES:i,normalize:c,resolve:u,resolveComponent:m,equal:y,serialize:f,parse:w};return Ut.exports=S,Ut.exports.default=S,Ut.exports.fastUri=S,Ut.exports}var Si;function jm(){if(Si)return br;Si=1,Object.defineProperty(br,"__esModule",{value:!0});const e=Om();return e.code='require("ajv/dist/runtime/uri").default',br.default=e,br}var Ei;function as(){return Ei||(Ei=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Nt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ne();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=Zt(),s=zt(),o=ni(),i=$r(),a=ne(),c=vr(),u=yr(),m=de(),y=km,f=jm(),h=(U,O)=>new RegExp(U,O);h.code="new RegExp";const w=["removeAdditional","useDefaults","coerceTypes"],S=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),p={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},l=200;function v(U){var O,C,N,b,k,T,B,W,ue,oe,j,z,F,J,Q,ie,Oe,Ke,Re,De,je,P,A,I,H;const x=U.strict,G=(O=U.code)===null||O===void 0?void 0:O.optimize,X=G===!0||G===void 0?1:G||0,se=(N=(C=U.code)===null||C===void 0?void 0:C.regExp)!==null&&N!==void 0?N:h,fe=(b=U.uriResolver)!==null&&b!==void 0?b:f.default;return{strictSchema:(T=(k=U.strictSchema)!==null&&k!==void 0?k:x)!==null&&T!==void 0?T:!0,strictNumbers:(W=(B=U.strictNumbers)!==null&&B!==void 0?B:x)!==null&&W!==void 0?W:!0,strictTypes:(oe=(ue=U.strictTypes)!==null&&ue!==void 0?ue:x)!==null&&oe!==void 0?oe:"log",strictTuples:(z=(j=U.strictTuples)!==null&&j!==void 0?j:x)!==null&&z!==void 0?z:"log",strictRequired:(J=(F=U.strictRequired)!==null&&F!==void 0?F:x)!==null&&J!==void 0?J:!1,code:U.code?{...U.code,optimize:X,regExp:se}:{optimize:X,regExp:se},loopRequired:(Q=U.loopRequired)!==null&&Q!==void 0?Q:l,loopEnum:(ie=U.loopEnum)!==null&&ie!==void 0?ie:l,meta:(Oe=U.meta)!==null&&Oe!==void 0?Oe:!0,messages:(Ke=U.messages)!==null&&Ke!==void 0?Ke:!0,inlineRefs:(Re=U.inlineRefs)!==null&&Re!==void 0?Re:!0,schemaId:(De=U.schemaId)!==null&&De!==void 0?De:"$id",addUsedSchema:(je=U.addUsedSchema)!==null&&je!==void 0?je:!0,validateSchema:(P=U.validateSchema)!==null&&P!==void 0?P:!0,validateFormats:(A=U.validateFormats)!==null&&A!==void 0?A:!0,unicodeRegExp:(I=U.unicodeRegExp)!==null&&I!==void 0?I:!0,int32range:(H=U.int32range)!==null&&H!==void 0?H:!0,uriResolver:fe}}class g{constructor(O={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,O=this.opts={...O,...v(O)};const{es5:C,lines:N}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:S,es5:C,lines:N}),this.logger=V(O.logger);const b=O.validateFormats;O.validateFormats=!1,this.RULES=(0,o.getRules)(),d.call(this,p,O,"NOT SUPPORTED"),d.call(this,_,O,"DEPRECATED","warn"),this._metaOpts=K.call(this),O.formats&&R.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),O.keywords&&Z.call(this,O.keywords),typeof O.meta=="object"&&this.addMetaSchema(O.meta),E.call(this),O.validateFormats=b}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:O,meta:C,schemaId:N}=this.opts;let b=y;N==="id"&&(b={...y},b.id=b.$id,delete b.$id),C&&O&&this.addMetaSchema(b,b[N],!1)}defaultMeta(){const{meta:O,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof O=="object"?O[C]||O:void 0}validate(O,C){let N;if(typeof O=="string"){if(N=this.getSchema(O),!N)throw new Error(`no schema with key or ref "${O}"`)}else N=this.compile(O);const b=N(C);return"$async"in N||(this.errors=N.errors),b}compile(O,C){const N=this._addSchema(O,C);return N.validate||this._compileSchemaEnv(N)}compileAsync(O,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:N}=this.opts;return b.call(this,O,C);async function b(oe,j){await k.call(this,oe.$schema);const z=this._addSchema(oe,j);return z.validate||T.call(this,z)}async function k(oe){oe&&!this.getSchema(oe)&&await b.call(this,{$ref:oe},!0)}async function T(oe){try{return this._compileSchemaEnv(oe)}catch(j){if(!(j instanceof s.default))throw j;return B.call(this,j),await W.call(this,j.missingSchema),T.call(this,oe)}}function B({missingSchema:oe,missingRef:j}){if(this.refs[oe])throw new Error(`AnySchema ${oe} is loaded but ${j} cannot be resolved`)}async function W(oe){const j=await ue.call(this,oe);this.refs[oe]||await k.call(this,j.$schema),this.refs[oe]||this.addSchema(j,oe,C)}async function ue(oe){const j=this._loading[oe];if(j)return j;try{return await(this._loading[oe]=N(oe))}finally{delete this._loading[oe]}}}addSchema(O,C,N,b=this.opts.validateSchema){if(Array.isArray(O)){for(const T of O)this.addSchema(T,void 0,N,b);return this}let k;if(typeof O=="object"){const{schemaId:T}=this.opts;if(k=O[T],k!==void 0&&typeof k!="string")throw new Error(`schema ${T} must be string`)}return C=(0,c.normalizeId)(C||k),this._checkUnique(C),this.schemas[C]=this._addSchema(O,N,C,b,!0),this}addMetaSchema(O,C,N=this.opts.validateSchema){return this.addSchema(O,C,!0,N),this}validateSchema(O,C){if(typeof O=="boolean")return!0;let N;if(N=O.$schema,N!==void 0&&typeof N!="string")throw new Error("$schema must be a string");if(N=N||this.opts.defaultMeta||this.defaultMeta(),!N)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const b=this.validate(N,O);if(!b&&C){const k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return b}getSchema(O){let C;for(;typeof(C=$.call(this,O))=="string";)O=C;if(C===void 0){const{schemaId:N}=this.opts,b=new i.SchemaEnv({schema:{},schemaId:N});if(C=i.resolveSchema.call(this,b,O),!C)return;this.refs[O]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(O){if(O instanceof RegExp)return this._removeAllSchemas(this.schemas,O),this._removeAllSchemas(this.refs,O),this;switch(typeof O){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=$.call(this,O);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[O],delete this.refs[O],this}case"object":{const C=O;this._cache.delete(C);let N=O[this.opts.schemaId];return N&&(N=(0,c.normalizeId)(N),delete this.schemas[N],delete this.refs[N]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(O){for(const C of O)this.addKeyword(C);return this}addKeyword(O,C){let N;if(typeof O=="string")N=O,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=N);else if(typeof O=="object"&&C===void 0){if(C=O,N=C.keyword,Array.isArray(N)&&!N.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,N,C),!C)return(0,m.eachItem)(N,k=>re.call(this,k)),this;ye.call(this,C);const b={...C,type:(0,u.getJSONTypes)(C.type),schemaType:(0,u.getJSONTypes)(C.schemaType)};return(0,m.eachItem)(N,b.type.length===0?k=>re.call(this,k,b):k=>b.type.forEach(T=>re.call(this,k,b,T))),this}getKeyword(O){const C=this.RULES.all[O];return typeof C=="object"?C.definition:!!C}removeKeyword(O){const{RULES:C}=this;delete C.keywords[O],delete C.all[O];for(const N of C.rules){const b=N.rules.findIndex(k=>k.keyword===O);b>=0&&N.rules.splice(b,1)}return this}addFormat(O,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[O]=C,this}errorsText(O=this.errors,{separator:C=", ",dataVar:N="data"}={}){return!O||O.length===0?"No errors":O.map(b=>`${N}${b.instancePath} ${b.message}`).reduce((b,k)=>b+C+k)}$dataMetaSchema(O,C){const N=this.RULES.all;O=JSON.parse(JSON.stringify(O));for(const b of C){const k=b.split("/").slice(1);let T=O;for(const B of k)T=T[B];for(const B in N){const W=N[B];if(typeof W!="object")continue;const{$data:ue}=W.definition,oe=T[B];ue&&oe&&(T[B]=Ae(oe))}}return O}_removeAllSchemas(O,C){for(const N in O){const b=O[N];(!C||C.test(N))&&(typeof b=="string"?delete O[N]:b&&!b.meta&&(this._cache.delete(b.schema),delete O[N]))}}_addSchema(O,C,N,b=this.opts.validateSchema,k=this.opts.addUsedSchema){let T;const{schemaId:B}=this.opts;if(typeof O=="object")T=O[B];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof O!="boolean")throw new Error("schema must be object or boolean")}let W=this._cache.get(O);if(W!==void 0)return W;N=(0,c.normalizeId)(T||N);const ue=c.getSchemaRefs.call(this,O,N);return W=new i.SchemaEnv({schema:O,schemaId:B,meta:C,baseId:N,localRefs:ue}),this._cache.set(W.schema,W),k&&!N.startsWith("#")&&(N&&this._checkUnique(N),this.refs[N]=W),b&&this.validateSchema(O,!0),W}_checkUnique(O){if(this.schemas[O]||this.refs[O])throw new Error(`schema with key or id "${O}" already exists`)}_compileSchemaEnv(O){if(O.meta?this._compileMetaSchema(O):i.compileSchema.call(this,O),!O.validate)throw new Error("ajv implementation error");return O.validate}_compileMetaSchema(O){const C=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,O)}finally{this.opts=C}}}g.ValidationError=n.default,g.MissingRefError=s.default,e.default=g;function d(U,O,C,N="error"){for(const b in U){const k=b;k in O&&this.logger[N](`${C}: option ${b}. ${U[k]}`)}}function $(U){return U=(0,c.normalizeId)(U),this.schemas[U]||this.refs[U]}function E(){const U=this.opts.schemas;if(U)if(Array.isArray(U))this.addSchema(U);else for(const O in U)this.addSchema(U[O],O)}function R(){for(const U in this.opts.formats){const O=this.opts.formats[U];O&&this.addFormat(U,O)}}function Z(U){if(Array.isArray(U)){this.addVocabulary(U);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const O in U){const C=U[O];C.keyword||(C.keyword=O),this.addKeyword(C)}}function K(){const U={...this.opts};for(const O of w)delete U[O];return U}const D={log(){},warn(){},error(){}};function V(U){if(U===!1)return D;if(U===void 0)return console;if(U.log&&U.warn&&U.error)return U;throw new Error("logger must implement log, warn and error methods")}const q=/^[a-z_$][a-z0-9_$:-]*$/i;function L(U,O){const{RULES:C}=this;if((0,m.eachItem)(U,N=>{if(C.keywords[N])throw new Error(`Keyword ${N} is already defined`);if(!q.test(N))throw new Error(`Keyword ${N} has invalid name`)}),!!O&&O.$data&&!("code"in O||"validate"in O))throw new Error('$data keyword must have "code" or "validate" function')}function re(U,O,C){var N;const b=O?.post;if(C&&b)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:k}=this;let T=b?k.post:k.rules.find(({type:W})=>W===C);if(T||(T={type:C,rules:[]},k.rules.push(T)),k.keywords[U]=!0,!O)return;const B={keyword:U,definition:{...O,type:(0,u.getJSONTypes)(O.type),schemaType:(0,u.getJSONTypes)(O.schemaType)}};O.before?he.call(this,T,B,O.before):T.rules.push(B),k.all[U]=B,(N=O.implements)===null||N===void 0||N.forEach(W=>this.addKeyword(W))}function he(U,O,C){const N=U.rules.findIndex(b=>b.keyword===C);N>=0?U.rules.splice(N,0,O):(U.rules.push(O),this.logger.warn(`rule ${C} is not defined`))}function ye(U){let{metaSchema:O}=U;O!==void 0&&(U.$data&&this.opts.$data&&(O=Ae(O)),U.validateSchema=this.compile(O,!0))}const ce={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Ae(U){return{anyOf:[U,ce]}}})(Xn)),Xn}var wr={},Sr={},Er={},ki;function Am(){if(ki)return Er;ki=1,Object.defineProperty(Er,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Er.default=e,Er}var ht={},Pi;function cs(){if(Pi)return ht;Pi=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.callRef=ht.getValidate=void 0;const e=zt(),t=Qe(),r=ne(),n=Ye(),s=$r(),o=de(),i={keyword:"$ref",schemaType:"string",code(u){const{gen:m,schema:y,it:f}=u,{baseId:h,schemaEnv:w,validateName:S,opts:p,self:_}=f,{root:l}=w;if((y==="#"||y==="#/")&&h===l.baseId)return g();const v=s.resolveRef.call(_,l,h,y);if(v===void 0)throw new e.default(f.opts.uriResolver,h,y);if(v instanceof s.SchemaEnv)return d(v);return $(v);function g(){if(w===l)return c(u,S,w,w.$async);const E=m.scopeValue("root",{ref:l});return c(u,(0,r._)`${E}.validate`,l,l.$async)}function d(E){const R=a(u,E);c(u,R,E,E.$async)}function $(E){const R=m.scopeValue("schema",p.code.source===!0?{ref:E,code:(0,r.stringify)(E)}:{ref:E}),Z=m.name("valid"),K=u.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:R,errSchemaPath:y},Z);u.mergeEvaluated(K),u.ok(Z)}}};function a(u,m){const{gen:y}=u;return m.validate?y.scopeValue("validate",{ref:m.validate}):(0,r._)`${y.scopeValue("wrapper",{ref:m})}.validate`}ht.getValidate=a;function c(u,m,y,f){const{gen:h,it:w}=u,{allErrors:S,schemaEnv:p,opts:_}=w,l=_.passContext?n.default.this:r.nil;f?v():g();function v(){if(!p.$async)throw new Error("async schema referenced by sync schema");const E=h.let("valid");h.try(()=>{h.code((0,r._)`await ${(0,t.callValidateCode)(u,m,l)}`),$(m),S||h.assign(E,!0)},R=>{h.if((0,r._)`!(${R} instanceof ${w.ValidationError})`,()=>h.throw(R)),d(R),S||h.assign(E,!1)}),u.ok(E)}function g(){u.result((0,t.callValidateCode)(u,m,l),()=>$(m),()=>d(m))}function d(E){const R=(0,r._)`${E}.errors`;h.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${R} : ${n.default.vErrors}.concat(${R})`),h.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function $(E){var R;if(!w.opts.unevaluated)return;const Z=(R=y?.validate)===null||R===void 0?void 0:R.evaluated;if(w.props!==!0)if(Z&&!Z.dynamicProps)Z.props!==void 0&&(w.props=o.mergeEvaluated.props(h,Z.props,w.props));else{const K=h.var("props",(0,r._)`${E}.evaluated.props`);w.props=o.mergeEvaluated.props(h,K,w.props,r.Name)}if(w.items!==!0)if(Z&&!Z.dynamicItems)Z.items!==void 0&&(w.items=o.mergeEvaluated.items(h,Z.items,w.items));else{const K=h.var("items",(0,r._)`${E}.evaluated.items`);w.items=o.mergeEvaluated.items(h,K,w.items,r.Name)}}}return ht.callRef=c,ht.default=i,ht}var Oi;function ji(){if(Oi)return Sr;Oi=1,Object.defineProperty(Sr,"__esModule",{value:!0});const e=Am(),t=cs(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Sr.default=r,Sr}var kr={},Pr={},Ai;function Nm(){if(Ai)return Pr;Ai=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=ne(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:o,schemaCode:i})=>(0,e.str)`must be ${r[o].okStr} ${i}`,params:({keyword:o,schemaCode:i})=>(0,e._)`{comparison: ${r[o].okStr}, limit: ${i}}`},s={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(o){const{keyword:i,data:a,schemaCode:c}=o;o.fail$data((0,e._)`${a} ${r[i].fail} ${c} || isNaN(${a})`)}};return Pr.default=s,Pr}var Or={},Ni;function zm(){if(Ni)return Or;Ni=1,Object.defineProperty(Or,"__esModule",{value:!0});const e=ne(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:s,data:o,schemaCode:i,it:a}=n,c=a.opts.multipleOfPrecision,u=s.let("res"),m=c?(0,e._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:(0,e._)`${u} !== parseInt(${u})`;n.fail$data((0,e._)`(${i} === 0 || (${u} = ${o}/${i}, ${m}))`)}};return Or.default=r,Or}var jr={},Ar={},zi;function Rm(){if(zi)return Ar;zi=1,Object.defineProperty(Ar,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,s=0,o;for(;s<r;)n++,o=t.charCodeAt(s++),o>=55296&&o<=56319&&s<r&&(o=t.charCodeAt(s),(o&64512)===56320&&s++);return n}return Ar.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Ar}var Ri;function Im(){if(Ri)return jr;Ri=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=ne(),t=de(),r=Rm(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:i}){const a=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${i} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:i,data:a,schemaCode:c,it:u}=o,m=i==="maxLength"?e.operators.GT:e.operators.LT,y=u.opts.unicode===!1?(0,e._)`${a}.length`:(0,e._)`${(0,t.useFunc)(o.gen,r.default)}(${a})`;o.fail$data((0,e._)`${y} ${m} ${c}`)}};return jr.default=s,jr}var Nr={},Ii;function Tm(){if(Ii)return Nr;Ii=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=Qe(),t=de(),r=ne(),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,r.str)`must match pattern "${o}"`,params:({schemaCode:o})=>(0,r._)`{pattern: ${o}}`},code(o){const{gen:i,data:a,$data:c,schema:u,schemaCode:m,it:y}=o,f=y.opts.unicodeRegExp?"u":"";if(c){const{regExp:h}=y.opts.code,w=h.code==="new RegExp"?(0,r._)`new RegExp`:(0,t.useFunc)(i,h),S=i.let("valid");i.try(()=>i.assign(S,(0,r._)`${w}(${m}, ${f}).test(${a})`),()=>i.assign(S,!1)),o.fail$data((0,r._)`!${S}`)}else{const h=(0,e.usePattern)(o,u);o.fail$data((0,r._)`!${h}.test(${a})`)}}};return Nr.default=s,Nr}var zr={},Ti;function Cm(){if(Ti)return zr;Ti=1,Object.defineProperty(zr,"__esModule",{value:!0});const e=ne(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const o=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${s} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:o,schemaCode:i}=n,a=s==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${o}).length ${a} ${i}`)}};return zr.default=r,zr}var Rr={},Ci;function Mm(){if(Ci)return Rr;Ci=1,Object.defineProperty(Rr,"__esModule",{value:!0});const e=Qe(),t=ne(),r=de(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:i,schema:a,schemaCode:c,data:u,$data:m,it:y}=o,{opts:f}=y;if(!m&&a.length===0)return;const h=a.length>=f.loopRequired;if(y.allErrors?w():S(),f.strictRequired){const l=o.parentSchema.properties,{definedProperties:v}=o.it;for(const g of a)if(l?.[g]===void 0&&!v.has(g)){const d=y.schemaEnv.baseId+y.errSchemaPath,$=`required property "${g}" is not defined at "${d}" (strictRequired)`;(0,r.checkStrictMode)(y,$,y.opts.strictRequired)}}function w(){if(h||m)o.block$data(t.nil,p);else for(const l of a)(0,e.checkReportMissingProp)(o,l)}function S(){const l=i.let("missing");if(h||m){const v=i.let("valid",!0);o.block$data(v,()=>_(l,v)),o.ok(v)}else i.if((0,e.checkMissingProp)(o,a,l)),(0,e.reportMissingProp)(o,l),i.else()}function p(){i.forOf("prop",c,l=>{o.setParams({missingProperty:l}),i.if((0,e.noPropertyInData)(i,u,l,f.ownProperties),()=>o.error())})}function _(l,v){o.setParams({missingProperty:l}),i.forOf(l,c,()=>{i.assign(v,(0,e.propertyInData)(i,u,l,f.ownProperties)),i.if((0,t.not)(v),()=>{o.error(),i.break()})},t.nil)}}};return Rr.default=s,Rr}var Ir={},Mi;function Dm(){if(Mi)return Ir;Mi=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=ne(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const o=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${s} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:o,schemaCode:i}=n,a=s==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${o}.length ${a} ${i}`)}};return Ir.default=r,Ir}var Tr={},Cr={},Di;function us(){if(Di)return Cr;Di=1,Object.defineProperty(Cr,"__esModule",{value:!0});const e=fi();return e.code='require("ajv/dist/runtime/equal").default',Cr.default=e,Cr}var Vi;function Vm(){if(Vi)return Tr;Vi=1,Object.defineProperty(Tr,"__esModule",{value:!0});const e=yr(),t=ne(),r=de(),n=us(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:a}})=>(0,t.str)`must NOT have duplicate items (items ## ${a} and ${i} are identical)`,params:({params:{i,j:a}})=>(0,t._)`{i: ${i}, j: ${a}}`},code(i){const{gen:a,data:c,$data:u,schema:m,parentSchema:y,schemaCode:f,it:h}=i;if(!u&&!m)return;const w=a.let("valid"),S=y.items?(0,e.getSchemaTypes)(y.items):[];i.block$data(w,p,(0,t._)`${f} === false`),i.ok(w);function p(){const g=a.let("i",(0,t._)`${c}.length`),d=a.let("j");i.setParams({i:g,j:d}),a.assign(w,!0),a.if((0,t._)`${g} > 1`,()=>(_()?l:v)(g,d))}function _(){return S.length>0&&!S.some(g=>g==="object"||g==="array")}function l(g,d){const $=a.name("item"),E=(0,e.checkDataTypes)(S,$,h.opts.strictNumbers,e.DataType.Wrong),R=a.const("indices",(0,t._)`{}`);a.for((0,t._)`;${g}--;`,()=>{a.let($,(0,t._)`${c}[${g}]`),a.if(E,(0,t._)`continue`),S.length>1&&a.if((0,t._)`typeof ${$} == "string"`,(0,t._)`${$} += "_"`),a.if((0,t._)`typeof ${R}[${$}] == "number"`,()=>{a.assign(d,(0,t._)`${R}[${$}]`),i.error(),a.assign(w,!1).break()}).code((0,t._)`${R}[${$}] = ${g}`)})}function v(g,d){const $=(0,r.useFunc)(a,n.default),E=a.name("outer");a.label(E).for((0,t._)`;${g}--;`,()=>a.for((0,t._)`${d} = ${g}; ${d}--;`,()=>a.if((0,t._)`${$}(${c}[${g}], ${c}[${d}])`,()=>{i.error(),a.assign(w,!1).break(E)})))}}};return Tr.default=o,Tr}var Mr={},Fi;function Fm(){if(Fi)return Mr;Fi=1,Object.defineProperty(Mr,"__esModule",{value:!0});const e=ne(),t=de(),r=us(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:i,data:a,$data:c,schemaCode:u,schema:m}=o;c||m&&typeof m=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(i,r.default)}(${a}, ${u})`):o.fail((0,e._)`${m} !== ${a}`)}};return Mr.default=s,Mr}var Dr={},qi;function qm(){if(qi)return Dr;qi=1,Object.defineProperty(Dr,"__esModule",{value:!0});const e=ne(),t=de(),r=us(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:i,data:a,$data:c,schema:u,schemaCode:m,it:y}=o;if(!c&&u.length===0)throw new Error("enum must have non-empty array");const f=u.length>=y.opts.loopEnum;let h;const w=()=>h??(h=(0,t.useFunc)(i,r.default));let S;if(f||c)S=i.let("valid"),o.block$data(S,p);else{if(!Array.isArray(u))throw new Error("ajv implementation error");const l=i.const("vSchema",m);S=(0,e.or)(...u.map((v,g)=>_(l,g)))}o.pass(S);function p(){i.assign(S,!1),i.forOf("v",m,l=>i.if((0,e._)`${w()}(${a}, ${l})`,()=>i.assign(S,!0).break()))}function _(l,v){const g=u[v];return typeof g=="object"&&g!==null?(0,e._)`${w()}(${a}, ${l}[${v}])`:(0,e._)`${a} === ${g}`}}};return Dr.default=s,Dr}var Zi;function Ui(){if(Zi)return kr;Zi=1,Object.defineProperty(kr,"__esModule",{value:!0});const e=Nm(),t=zm(),r=Im(),n=Tm(),s=Cm(),o=Mm(),i=Dm(),a=Vm(),c=Fm(),u=qm(),m=[e.default,t.default,r.default,n.default,s.default,o.default,i.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,u.default];return kr.default=m,kr}var Vr={},Rt={},xi;function Li(){if(xi)return Rt;xi=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.validateAdditionalItems=void 0;const e=ne(),t=de(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:i,it:a}=o,{items:c}=i;if(!Array.isArray(c)){(0,t.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(o,c)}};function s(o,i){const{gen:a,schema:c,data:u,keyword:m,it:y}=o;y.items=!0;const f=a.const("len",(0,e._)`${u}.length`);if(c===!1)o.setParams({len:i.length}),o.pass((0,e._)`${f} <= ${i.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(y,c)){const w=a.var("valid",(0,e._)`${f} <= ${i.length}`);a.if((0,e.not)(w),()=>h(w)),o.ok(w)}function h(w){a.forRange("i",i.length,f,S=>{o.subschema({keyword:m,dataProp:S,dataPropType:t.Type.Num},w),y.allErrors||a.if((0,e.not)(w),()=>a.break())})}}return Rt.validateAdditionalItems=s,Rt.default=n,Rt}var Fr={},It={},Ki;function Ji(){if(Ki)return It;Ki=1,Object.defineProperty(It,"__esModule",{value:!0}),It.validateTuple=void 0;const e=ne(),t=de(),r=Qe(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:i,it:a}=o;if(Array.isArray(i))return s(o,"additionalItems",i);a.items=!0,!(0,t.alwaysValidSchema)(a,i)&&o.ok((0,r.validateArray)(o))}};function s(o,i,a=o.schema){const{gen:c,parentSchema:u,data:m,keyword:y,it:f}=o;S(u),f.opts.unevaluated&&a.length&&f.items!==!0&&(f.items=t.mergeEvaluated.items(c,a.length,f.items));const h=c.name("valid"),w=c.const("len",(0,e._)`${m}.length`);a.forEach((p,_)=>{(0,t.alwaysValidSchema)(f,p)||(c.if((0,e._)`${w} > ${_}`,()=>o.subschema({keyword:y,schemaProp:_,dataProp:_},h)),o.ok(h))});function S(p){const{opts:_,errSchemaPath:l}=f,v=a.length,g=v===p.minItems&&(v===p.maxItems||p[i]===!1);if(_.strictTuples&&!g){const d=`"${y}" is ${v}-tuple, but minItems or maxItems/${i} are not specified or different at path "${l}"`;(0,t.checkStrictMode)(f,d,_.strictTuples)}}}return It.validateTuple=s,It.default=n,It}var Gi;function Zm(){if(Gi)return Fr;Gi=1,Object.defineProperty(Fr,"__esModule",{value:!0});const e=Ji(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return Fr.default=t,Fr}var qr={},Hi;function Um(){if(Hi)return qr;Hi=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=ne(),t=de(),r=Qe(),n=Li(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{schema:a,parentSchema:c,it:u}=i,{prefixItems:m}=c;u.items=!0,!(0,t.alwaysValidSchema)(u,a)&&(m?(0,n.validateAdditionalItems)(i,m):i.ok((0,r.validateArray)(i)))}};return qr.default=o,qr}var Zr={},Bi;function xm(){if(Bi)return Zr;Bi=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=ne(),t=de(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:o}})=>o===void 0?(0,e.str)`must contain at least ${s} valid item(s)`:(0,e.str)`must contain at least ${s} and no more than ${o} valid item(s)`,params:({params:{min:s,max:o}})=>o===void 0?(0,e._)`{minContains: ${s}}`:(0,e._)`{minContains: ${s}, maxContains: ${o}}`},code(s){const{gen:o,schema:i,parentSchema:a,data:c,it:u}=s;let m,y;const{minContains:f,maxContains:h}=a;u.opts.next?(m=f===void 0?1:f,y=h):m=1;const w=o.const("len",(0,e._)`${c}.length`);if(s.setParams({min:m,max:y}),y===void 0&&m===0){(0,t.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(y!==void 0&&m>y){(0,t.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,t.alwaysValidSchema)(u,i)){let v=(0,e._)`${w} >= ${m}`;y!==void 0&&(v=(0,e._)`${v} && ${w} <= ${y}`),s.pass(v);return}u.items=!0;const S=o.name("valid");y===void 0&&m===1?_(S,()=>o.if(S,()=>o.break())):m===0?(o.let(S,!0),y!==void 0&&o.if((0,e._)`${c}.length > 0`,p)):(o.let(S,!1),p()),s.result(S,()=>s.reset());function p(){const v=o.name("_valid"),g=o.let("count",0);_(v,()=>o.if(v,()=>l(g)))}function _(v,g){o.forRange("i",0,w,d=>{s.subschema({keyword:"contains",dataProp:d,dataPropType:t.Type.Num,compositeRule:!0},v),g()})}function l(v){o.code((0,e._)`${v}++`),y===void 0?o.if((0,e._)`${v} >= ${m}`,()=>o.assign(S,!0).break()):(o.if((0,e._)`${v} > ${y}`,()=>o.assign(S,!1).break()),m===1?o.assign(S,!0):o.if((0,e._)`${v} >= ${m}`,()=>o.assign(S,!0)))}}};return Zr.default=n,Zr}var ds={},Wi;function ls(){return Wi||(Wi=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ne(),r=de(),n=Qe();e.error={message:({params:{property:c,depsCount:u,deps:m}})=>{const y=u===1?"property":"properties";return(0,t.str)`must have ${y} ${m} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:m,missingProperty:y}})=>(0,t._)`{property: ${c},
|
|
44
|
+
missingProperty: ${y},
|
|
45
45
|
depsCount: ${u},
|
|
46
|
-
deps: ${m}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[u,m]=o(c);i(c,u),a(c,m)}};function o({schema:c}){const u={},m={};for(const v in c){if(v==="__proto__")continue;const l=Array.isArray(c[v])?u:m;l[v]=c[v]}return[u,m]}function i(c,u=c.schema){const{gen:m,data:v,it:l}=c;if(Object.keys(u).length===0)return;const h=m.let("missing");for(const w in u){const S=u[w];if(S.length===0)continue;const p=(0,n.propertyInData)(m,v,w,l.opts.ownProperties);c.setParams({property:w,depsCount:S.length,deps:S.join(", ")}),l.allErrors?m.if(p,()=>{for(const _ of S)(0,n.checkReportMissingProp)(c,_)}):(m.if((0,t._)`${p} && (${(0,n.checkMissingProp)(c,S,h)})`),(0,n.reportMissingProp)(c,h),m.else())}}e.validatePropertyDeps=i;function a(c,u=c.schema){const{gen:m,data:v,keyword:l,it:h}=c,w=m.name("valid");for(const S in u)(0,r.alwaysValidSchema)(h,u[S])||(m.if((0,n.propertyInData)(m,v,S,h.opts.ownProperties),()=>{const p=c.subschema({keyword:l,schemaProp:S},w);c.mergeValidEvaluated(p,w)},()=>m.var(w,!0)),c.ok(w))}e.validateSchemaDeps=a,e.default=s})(as)),as}var qr={},Hi;function Zm(){if(Hi)return qr;Hi=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,e._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:o,schema:i,data:a,it:c}=s;if((0,t.alwaysValidSchema)(c,i))return;const u=o.name("valid");o.forIn("key",a,m=>{s.setParams({propertyName:m}),s.subschema({keyword:"propertyNames",data:m,dataTypes:["string"],propertyName:m,compositeRule:!0},u),o.if((0,e.not)(u),()=>{s.error(!0),c.allErrors||o.break()})}),s.ok(u)}};return qr.default=n,qr}var Zr={},Gi;function Bi(){if(Gi)return Zr;Gi=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=We(),t=ne(),r=Ge(),n=ce(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,t._)`{additionalProperty: ${i.additionalProperty}}`},code(i){const{gen:a,schema:c,parentSchema:u,data:m,errsCount:v,it:l}=i;if(!v)throw new Error("ajv implementation error");const{allErrors:h,opts:w}=l;if(l.props=!0,w.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(l,c))return;const S=(0,e.allSchemaProperties)(u.properties),p=(0,e.allSchemaProperties)(u.patternProperties);_(),i.ok((0,t._)`${v} === ${r.default.errors}`);function _(){a.forIn("key",m,$=>{!S.length&&!p.length?g($):a.if(f($),()=>g($))})}function f($){let E;if(S.length>8){const R=(0,n.schemaRefOrVal)(l,u.properties,"properties");E=(0,e.isOwnProperty)(a,R,$)}else S.length?E=(0,t.or)(...S.map(R=>(0,t._)`${$} === ${R}`)):E=t.nil;return p.length&&(E=(0,t.or)(E,...p.map(R=>(0,t._)`${(0,e.usePattern)(i,R)}.test(${$})`))),(0,t.not)(E)}function y($){a.code((0,t._)`delete ${m}[${$}]`)}function g($){if(w.removeAdditional==="all"||w.removeAdditional&&c===!1){y($);return}if(c===!1){i.setParams({additionalProperty:$}),i.error(),h||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(l,c)){const E=a.name("valid");w.removeAdditional==="failing"?(d($,E,!1),a.if((0,t.not)(E),()=>{i.reset(),y($)})):(d($,E),h||a.if((0,t.not)(E),()=>a.break()))}}function d($,E,R){const Z={keyword:"additionalProperties",dataProp:$,dataPropType:n.Type.Str};R===!1&&Object.assign(Z,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(Z,E)}}};return Zr.default=o,Zr}var Ur={},Wi;function Um(){if(Wi)return Ur;Wi=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=jt(),t=We(),r=ce(),n=Bi(),s={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:i,schema:a,parentSchema:c,data:u,it:m}=o;m.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(m,n.default,"additionalProperties"));const v=(0,t.allSchemaProperties)(a);for(const p of v)m.definedProperties.add(p);m.opts.unevaluated&&v.length&&m.props!==!0&&(m.props=r.mergeEvaluated.props(i,(0,r.toHash)(v),m.props));const l=v.filter(p=>!(0,r.alwaysValidSchema)(m,a[p]));if(l.length===0)return;const h=i.name("valid");for(const p of l)w(p)?S(p):(i.if((0,t.propertyInData)(i,u,p,m.opts.ownProperties)),S(p),m.allErrors||i.else().var(h,!0),i.endIf()),o.it.definedProperties.add(p),o.ok(h);function w(p){return m.opts.useDefaults&&!m.compositeRule&&a[p].default!==void 0}function S(p){o.subschema({keyword:"properties",schemaProp:p,dataProp:p},h)}}};return Ur.default=s,Ur}var xr={},Yi;function xm(){if(Yi)return xr;Yi=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=We(),t=ne(),r=ce(),n=ce(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:i,schema:a,data:c,parentSchema:u,it:m}=o,{opts:v}=m,l=(0,e.allSchemaProperties)(a),h=l.filter(g=>(0,r.alwaysValidSchema)(m,a[g]));if(l.length===0||h.length===l.length&&(!m.opts.unevaluated||m.props===!0))return;const w=v.strictSchema&&!v.allowMatchingProperties&&u.properties,S=i.name("valid");m.props!==!0&&!(m.props instanceof t.Name)&&(m.props=(0,n.evaluatedPropsToName)(i,m.props));const{props:p}=m;_();function _(){for(const g of l)w&&f(g),m.allErrors?y(g):(i.var(S,!0),y(g),i.if(S))}function f(g){for(const d in w)new RegExp(g).test(d)&&(0,r.checkStrictMode)(m,`property ${d} matches pattern ${g} (use allowMatchingProperties)`)}function y(g){i.forIn("key",c,d=>{i.if((0,t._)`${(0,e.usePattern)(o,g)}.test(${d})`,()=>{const $=h.includes(g);$||o.subschema({keyword:"patternProperties",schemaProp:g,dataProp:d,dataPropType:n.Type.Str},S),m.opts.unevaluated&&p!==!0?i.assign((0,t._)`${p}[${d}]`,!0):!$&&!m.allErrors&&i.if((0,t.not)(S),()=>i.break())})})}}};return xr.default=s,xr}var Lr={},Xi;function Lm(){if(Xi)return Lr;Xi=1,Object.defineProperty(Lr,"__esModule",{value:!0});const e=ce(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:s,it:o}=r;if((0,e.alwaysValidSchema)(o,s)){r.fail();return}const i=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),r.failResult(i,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return Lr.default=t,Lr}var Kr={},Qi;function Km(){if(Qi)return Kr;Qi=1,Object.defineProperty(Kr,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:We().validateUnion,error:{message:"must match a schema in anyOf"}};return Kr.default=t,Kr}var Jr={},ea;function Jm(){if(ea)return Jr;ea=1,Object.defineProperty(Jr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,e._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:o,schema:i,parentSchema:a,it:c}=s;if(!Array.isArray(i))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;const u=i,m=o.let("valid",!1),v=o.let("passing",null),l=o.name("_valid");s.setParams({passing:v}),o.block(h),s.result(m,()=>s.reset(),()=>s.error(!0));function h(){u.forEach((w,S)=>{let p;(0,t.alwaysValidSchema)(c,w)?o.var(l,!0):p=s.subschema({keyword:"oneOf",schemaProp:S,compositeRule:!0},l),S>0&&o.if((0,e._)`${l} && ${m}`).assign(m,!1).assign(v,(0,e._)`[${v}, ${S}]`).else(),o.if(l,()=>{o.assign(m,!0),o.assign(v,S),p&&s.mergeEvaluated(p,e.Name)})})}}};return Jr.default=n,Jr}var Hr={},ta;function Hm(){if(ta)return Hr;ta=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=ce(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:s,it:o}=r;if(!Array.isArray(s))throw new Error("ajv implementation error");const i=n.name("valid");s.forEach((a,c)=>{if((0,e.alwaysValidSchema)(o,a))return;const u=r.subschema({keyword:"allOf",schemaProp:c},i);r.ok(i),r.mergeEvaluated(u)})}};return Hr.default=t,Hr}var Gr={},ra;function Gm(){if(ra)return Gr;ra=1,Object.defineProperty(Gr,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:i,parentSchema:a,it:c}=o;a.then===void 0&&a.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const u=s(c,"then"),m=s(c,"else");if(!u&&!m)return;const v=i.let("valid",!0),l=i.name("_valid");if(h(),o.reset(),u&&m){const S=i.let("ifClause");o.setParams({ifClause:S}),i.if(l,w("then",S),w("else",S))}else u?i.if(l,w("then")):i.if((0,e.not)(l),w("else"));o.pass(v,()=>o.error(!0));function h(){const S=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);o.mergeEvaluated(S)}function w(S,p){return()=>{const _=o.subschema({keyword:S},l);i.assign(v,l),o.mergeValidEvaluated(_,v),p?i.assign(p,(0,e._)`${S}`):o.setParams({ifClause:S})}}}};function s(o,i){const a=o.schema[i];return a!==void 0&&!(0,t.alwaysValidSchema)(o,a)}return Gr.default=n,Gr}var Br={},na;function Bm(){if(na)return Br;na=1,Object.defineProperty(Br,"__esModule",{value:!0});const e=ce(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:s}){n.if===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "if" is ignored`)}};return Br.default=t,Br}var sa;function oa(){if(sa)return Mr;sa=1,Object.defineProperty(Mr,"__esModule",{value:!0});const e=qi(),t=Vm(),r=Ui(),n=Fm(),s=qm(),o=cs(),i=Zm(),a=Bi(),c=Um(),u=xm(),m=Lm(),v=Km(),l=Jm(),h=Hm(),w=Gm(),S=Bm();function p(_=!1){const f=[m.default,v.default,l.default,h.default,w.default,S.default,i.default,a.default,o.default,c.default,u.default];return _?f.push(t.default,n.default):f.push(e.default,r.default),f.push(s.default),f}return Mr.default=p,Mr}var Wr={},Yr={},ia;function Wm(){if(ia)return Yr;ia=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=ne(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,s){const{gen:o,data:i,$data:a,schema:c,schemaCode:u,it:m}=n,{opts:v,errSchemaPath:l,schemaEnv:h,self:w}=m;if(!v.validateFormats)return;a?S():p();function S(){const _=o.scopeValue("formats",{ref:w.formats,code:v.code.formats}),f=o.const("fDef",(0,e._)`${_}[${u}]`),y=o.let("fType"),g=o.let("format");o.if((0,e._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>o.assign(y,(0,e._)`${f}.type || "string"`).assign(g,(0,e._)`${f}.validate`),()=>o.assign(y,(0,e._)`"string"`).assign(g,f)),n.fail$data((0,e.or)(d(),$()));function d(){return v.strictSchema===!1?e.nil:(0,e._)`${u} && !${g}`}function $(){const E=h.$async?(0,e._)`(${f}.async ? await ${g}(${i}) : ${g}(${i}))`:(0,e._)`${g}(${i})`,R=(0,e._)`(typeof ${g} == "function" ? ${E} : ${g}.test(${i}))`;return(0,e._)`${g} && ${g} !== true && ${y} === ${s} && !${R}`}}function p(){const _=w.formats[c];if(!_){d();return}if(_===!0)return;const[f,y,g]=$(_);f===s&&n.pass(E());function d(){if(v.strictSchema===!1){w.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${c}" ignored in schema at path "${l}"`}}function $(R){const Z=R instanceof RegExp?(0,e.regexpCode)(R):v.code.formats?(0,e._)`${v.code.formats}${(0,e.getProperty)(c)}`:void 0,L=o.scopeValue("formats",{key:c,ref:R,code:Z});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,e._)`${L}.validate`]:["string",R,L]}function E(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!h.$async)throw new Error("async format in sync schema");return(0,e._)`await ${g}(${i})`}return typeof y=="function"?(0,e._)`${g}(${i})`:(0,e._)`${g}.test(${i})`}}}};return Yr.default=r,Yr}var aa;function ca(){if(aa)return Wr;aa=1,Object.defineProperty(Wr,"__esModule",{value:!0});const t=[Wm().default];return Wr.default=t,Wr}var vt={},ua;function da(){return ua||(ua=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.contentVocabulary=vt.metadataVocabulary=void 0,vt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],vt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),vt}var la;function fa(){if(la)return $r;la=1,Object.defineProperty($r,"__esModule",{value:!0});const e=Ei(),t=Vi(),r=oa(),n=ca(),s=da(),o=[e.default,t.default,(0,r.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];return $r.default=o,$r}var Xr={},Zt={},ma;function Ym(){if(ma)return Zt;ma=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Zt.DiscrError=e={})),Zt}var ha;function us(){if(ha)return Xr;ha=1,Object.defineProperty(Xr,"__esModule",{value:!0});const e=ne(),t=Ym(),r=gr(),n=At(),s=ce(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:u}})=>(0,e._)`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){const{gen:c,data:u,schema:m,parentSchema:v,it:l}=a,{oneOf:h}=v;if(!l.opts.discriminator)throw new Error("discriminator: requires discriminator option");const w=m.propertyName;if(typeof w!="string")throw new Error("discriminator: requires propertyName");if(m.mapping)throw new Error("discriminator: mapping is not supported");if(!h)throw new Error("discriminator: requires oneOf keyword");const S=c.let("valid",!1),p=c.const("tag",(0,e._)`${u}${(0,e.getProperty)(w)}`);c.if((0,e._)`typeof ${p} == "string"`,()=>_(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:p,tagName:w})),a.ok(S);function _(){const g=y();c.if(!1);for(const d in g)c.elseIf((0,e._)`${p} === ${d}`),c.assign(S,f(g[d]));c.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:p,tagName:w}),c.endIf()}function f(g){const d=c.name("valid"),$=a.subschema({keyword:"oneOf",schemaProp:g},d);return a.mergeEvaluated($,e.Name),d}function y(){var g;const d={},$=R(v);let E=!0;for(let F=0;F<h.length;F++){let V=h[F];if(V?.$ref&&!(0,s.schemaHasRulesButRef)(V,l.self.RULES)){const K=V.$ref;if(V=r.resolveRef.call(l.self,l.schemaEnv.root,l.baseId,K),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default(l.opts.uriResolver,l.baseId,K)}const U=(g=V?.properties)===null||g===void 0?void 0:g[w];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${w}"`);E=E&&($||R(V)),Z(U,F)}if(!E)throw new Error(`discriminator: "${w}" must be required`);return d;function R({required:F}){return Array.isArray(F)&&F.includes(w)}function Z(F,V){if(F.const)L(F.const,V);else if(F.enum)for(const U of F.enum)L(U,V);else throw new Error(`discriminator: "properties/${w}" must have "const" or "enum"`)}function L(F,V){if(typeof F!="string"||F in d)throw new Error(`discriminator: "${w}" values must be unique strings`);d[F]=V}}}};return Xr.default=i,Xr}const Xm={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};var pa;function ya(){return pa||(pa=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=ss(),n=fa(),s=us(),o=Xm,i=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(o,i):o;this.addMetaSchema(w,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=jt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var m=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var v=Ft();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return v.default}});var l=At();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return l.default}})})(dr,dr.exports)),dr.exports}var Qm=ya();const eh=ur(Qm);var Qr={exports:{}},en={},Rt={},va;function ga(){if(va)return Rt;va=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.dynamicAnchor=void 0;const e=ne(),t=Ge(),r=gr(),n=os(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>o(a,a.schema)};function o(a,c){const{gen:u,it:m}=a;m.schemaEnv.root.dynamicAnchors[c]=!0;const v=(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(c)}`,l=m.errSchemaPath==="#"?m.validateName:i(a);u.if((0,e._)`!${v}`,()=>u.assign(v,l))}Rt.dynamicAnchor=o;function i(a){const{schemaEnv:c,schema:u,self:m}=a.it,{root:v,baseId:l,localRefs:h,meta:w}=c.root,{schemaId:S}=m.opts,p=new r.SchemaEnv({schema:u,schemaId:S,root:v,baseId:l,localRefs:h,meta:w});return r.compileSchema.call(m,p),(0,n.getValidate)(a,p)}return Rt.default=s,Rt}var It={},_a;function $a(){if(_a)return It;_a=1,Object.defineProperty(It,"__esModule",{value:!0}),It.dynamicRef=void 0;const e=ne(),t=Ge(),r=os(),n={keyword:"$dynamicRef",schemaType:"string",code:o=>s(o,o.schema)};function s(o,i){const{gen:a,keyword:c,it:u}=o;if(i[0]!=="#")throw new Error(`"${c}" only supports hash fragment reference`);const m=i.slice(1);if(u.allErrors)v();else{const h=a.let("valid",!1);v(h),o.ok(h)}function v(h){if(u.schemaEnv.root.dynamicAnchors[m]){const w=a.let("_v",(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(m)}`);a.if(w,l(w,h),l(u.validateName,h))}else l(u.validateName,h)()}function l(h,w){return w?()=>a.block(()=>{(0,r.callRef)(o,h),a.let(w,!0)}):()=>(0,r.callRef)(o,h)}}return It.dynamicRef=s,It.default=n,It}var tn={},ba;function th(){if(ba)return tn;ba=1,Object.defineProperty(tn,"__esModule",{value:!0});const e=ga(),t=ce(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,e.dynamicAnchor)(n,""):(0,t.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return tn.default=r,tn}var rn={},wa;function rh(){if(wa)return rn;wa=1,Object.defineProperty(rn,"__esModule",{value:!0});const e=$a(),t={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,e.dynamicRef)(r,r.schema)};return rn.default=t,rn}var Sa;function Ea(){if(Sa)return en;Sa=1,Object.defineProperty(en,"__esModule",{value:!0});const e=ga(),t=$a(),r=th(),n=rh(),s=[e.default,t.default,r.default,n.default];return en.default=s,en}var nn={},sn={},ka;function nh(){if(ka)return sn;ka=1,Object.defineProperty(sn,"__esModule",{value:!0});const e=cs(),t={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:r=>(0,e.validatePropertyDeps)(r)};return sn.default=t,sn}var on={},Pa;function sh(){if(Pa)return on;Pa=1,Object.defineProperty(on,"__esModule",{value:!0});const e=cs(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,e.validateSchemaDeps)(r)};return on.default=t,on}var an={},Oa;function oh(){if(Oa)return an;Oa=1,Object.defineProperty(an,"__esModule",{value:!0});const e=ce(),t={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:s}){n.contains===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "contains" is ignored`)}};return an.default=t,an}var ja;function Aa(){if(ja)return nn;ja=1,Object.defineProperty(nn,"__esModule",{value:!0});const e=nh(),t=sh(),r=oh(),n=[e.default,t.default,r.default];return nn.default=n,nn}var cn={},un={},Na;function ih(){if(Na)return un;Na=1,Object.defineProperty(un,"__esModule",{value:!0});const e=ne(),t=ce(),r=Ge(),s={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:o})=>(0,e._)`{unevaluatedProperty: ${o.unevaluatedProperty}}`},code(o){const{gen:i,schema:a,data:c,errsCount:u,it:m}=o;if(!u)throw new Error("ajv implementation error");const{allErrors:v,props:l}=m;l instanceof e.Name?i.if((0,e._)`${l} !== true`,()=>i.forIn("key",c,p=>i.if(w(l,p),()=>h(p)))):l!==!0&&i.forIn("key",c,p=>l===void 0?h(p):i.if(S(l,p),()=>h(p))),m.props=!0,o.ok((0,e._)`${u} === ${r.default.errors}`);function h(p){if(a===!1){o.setParams({unevaluatedProperty:p}),o.error(),v||i.break();return}if(!(0,t.alwaysValidSchema)(m,a)){const _=i.name("valid");o.subschema({keyword:"unevaluatedProperties",dataProp:p,dataPropType:t.Type.Str},_),v||i.if((0,e.not)(_),()=>i.break())}}function w(p,_){return(0,e._)`!${p} || !${p}[${_}]`}function S(p,_){const f=[];for(const y in p)p[y]===!0&&f.push((0,e._)`${_} !== ${y}`);return(0,e.and)(...f)}}};return un.default=s,un}var dn={},za;function ah(){if(za)return dn;za=1,Object.defineProperty(dn,"__esModule",{value:!0});const e=ne(),t=ce(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{gen:o,schema:i,data:a,it:c}=s,u=c.items||0;if(u===!0)return;const m=o.const("len",(0,e._)`${a}.length`);if(i===!1)s.setParams({len:u}),s.fail((0,e._)`${m} > ${u}`);else if(typeof i=="object"&&!(0,t.alwaysValidSchema)(c,i)){const l=o.var("valid",(0,e._)`${m} <= ${u}`);o.if((0,e.not)(l),()=>v(l,u)),s.ok(l)}c.items=!0;function v(l,h){o.forRange("i",h,m,w=>{s.subschema({keyword:"unevaluatedItems",dataProp:w,dataPropType:t.Type.Num},l),c.allErrors||o.if((0,e.not)(l),()=>o.break())})}}};return dn.default=n,dn}var Ra;function Ia(){if(Ra)return cn;Ra=1,Object.defineProperty(cn,"__esModule",{value:!0});const e=ih(),t=ah(),r=[e.default,t.default];return cn.default=r,cn}var ln={};const ch={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}},uh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}},dh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}},lh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}},fh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}},mh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},hh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};var Ta;function ph(){if(Ta)return ln;Ta=1,Object.defineProperty(ln,"__esModule",{value:!0});const e=ch,t=uh,r=dh,n=lh,s=fh,o=mh,i=hh,a=["/properties"];function c(u){return[e,t,r,n,m(this,s),o,m(this,i)].forEach(v=>this.addMetaSchema(v,void 0,!1)),this;function m(v,l){return u?v.$dataMetaSchema(l,a):l}}return ln.default=c,ln}var Ca;function yh(){return Ca||(Ca=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2019=void 0;const r=ss(),n=fa(),s=Ea(),o=Aa(),i=Ia(),a=us(),c=ph(),u="https://json-schema.org/draft/2019-09/schema";class m extends r.default{constructor(p={}){super({...p,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(s.default),n.default.forEach(p=>this.addVocabulary(p)),this.addVocabulary(o.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:p,meta:_}=this.opts;_&&(c.default.call(this,p),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv2019=m,e.exports=t=m,e.exports.Ajv2019=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var v=jt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return v.KeywordCxt}});var l=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var h=Ft();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var w=At();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return w.default}})})(Qr,Qr.exports)),Qr.exports}var vh=yh();const gh=ur(vh);var fn={exports:{}},mn={},Ma;function _h(){if(Ma)return mn;Ma=1,Object.defineProperty(mn,"__esModule",{value:!0});const e=Ei(),t=Vi(),r=oa(),n=Ea(),s=Aa(),o=Ia(),i=ca(),a=da(),c=[n.default,e.default,t.default,(0,r.default)(!0),i.default,a.metadataVocabulary,a.contentVocabulary,s.default,o.default];return mn.default=c,mn}var hn={};const $h={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}},bh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}},wh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}},Sh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}},Eh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}},kh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}},Ph={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},Oh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};var Da;function jh(){if(Da)return hn;Da=1,Object.defineProperty(hn,"__esModule",{value:!0});const e=$h,t=bh,r=wh,n=Sh,s=Eh,o=kh,i=Ph,a=Oh,c=["/properties"];function u(m){return[e,t,r,n,s,v(this,o),i,v(this,a)].forEach(l=>this.addMetaSchema(l,void 0,!1)),this;function v(l,h){return m?l.$dataMetaSchema(h,c):h}}return hn.default=u,hn}var Va;function Ah(){return Va||(Va=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const r=ss(),n=_h(),s=us(),o=jh(),i="https://json-schema.org/draft/2020-12/schema";class a extends r.default{constructor(h={}){super({...h,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:h,meta:w}=this.opts;w&&(o.default.call(this,h),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var c=jt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var m=Ft();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var v=At();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(fn,fn.exports)),fn.exports}var Nh=Ah();const zh=ur(Nh);var pn={exports:{}},ds={},Fa;function Rh(){return Fa||(Fa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(F,V){return{validate:F,compare:V}}e.fullFormats={date:t(o,i),time:t(c(!0),u),"date-time":t(l(!0),h),"iso-time":t(c(),m),"iso-date-time":t(l(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:L,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:$},int64:{type:"number",validate:E},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,w),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(F){return F%4===0&&(F%100!==0||F%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(F){const V=n.exec(F);if(!V)return!1;const U=+V[1],K=+V[2],re=+V[3];return K>=1&&K<=12&&re>=1&&re<=(K===2&&r(U)?29:s[K])}function i(F,V){if(F&&V)return F>V?1:F<V?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(F){return function(U){const K=a.exec(U);if(!K)return!1;const re=+K[1],ye=+K[2],me=+K[3],ue=K[4],Oe=K[5]==="-"?-1:1,M=+(K[6]||0),O=+(K[7]||0);if(M>23||O>59||F&&!ue)return!1;if(re<=23&&ye<=59&&me<60)return!0;const C=ye-O*Oe,A=re-M*Oe-(C<0?1:0);return(A===23||A===-1)&&(C===59||C===-1)&&me<61}}function u(F,V){if(!(F&&V))return;const U=new Date("2020-01-01T"+F).valueOf(),K=new Date("2020-01-01T"+V).valueOf();if(U&&K)return U-K}function m(F,V){if(!(F&&V))return;const U=a.exec(F),K=a.exec(V);if(U&&K)return F=U[1]+U[2]+U[3],V=K[1]+K[2]+K[3],F>V?1:F<V?-1:0}const v=/t|\s/i;function l(F){const V=c(F);return function(K){const re=K.split(v);return re.length===2&&o(re[0])&&V(re[1])}}function h(F,V){if(!(F&&V))return;const U=new Date(F).valueOf(),K=new Date(V).valueOf();if(U&&K)return U-K}function w(F,V){if(!(F&&V))return;const[U,K]=F.split(v),[re,ye]=V.split(v),me=i(U,re);if(me!==void 0)return me||u(K,ye)}const S=/\/|:/,p=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(F){return S.test(F)&&p.test(F)}const f=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(F){return f.lastIndex=0,f.test(F)}const g=-2147483648,d=2**31-1;function $(F){return Number.isInteger(F)&&F<=d&&F>=g}function E(F){return Number.isInteger(F)}function R(){return!0}const Z=/[^\\]\\Z/;function L(F){if(Z.test(F))return!1;try{return new RegExp(F),!0}catch{return!1}}})(ds)),ds}var ls={},qa;function Ih(){return qa||(qa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=ya(),r=ne(),n=r.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:a,schemaCode:c})=>(0,r.str)`should be ${s[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>(0,r._)`{comparison: ${s[a].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:o,code(a){const{gen:c,data:u,schemaCode:m,keyword:v,it:l}=a,{opts:h,self:w}=l;if(!h.validateFormats)return;const S=new t.KeywordCxt(l,w.RULES.all.format.definition,"format");S.$data?p():_();function p(){const y=c.scopeValue("formats",{ref:w.formats,code:h.code.formats}),g=c.const("fmt",(0,r._)`${y}[${S.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${g} != "object"`,(0,r._)`${g} instanceof RegExp`,(0,r._)`typeof ${g}.compare != "function"`,f(g)))}function _(){const y=S.schema,g=w.formats[y];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${v}": format "${y}" does not define "compare" function`);const d=c.scopeValue("formats",{key:y,ref:g,code:h.code.formats?(0,r._)`${h.code.formats}${(0,r.getProperty)(y)}`:void 0});a.fail$data(f(d))}function f(y){return(0,r._)`${y}.compare(${u}, ${m}) ${s[v].fail} 0`}},dependencies:["format"]};const i=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i})(ls)),ls}var Za;function Th(){return Za||(Za=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Rh(),n=Ih(),s=ne(),o=new s.Name("fullFormats"),i=new s.Name("fastFormats"),a=(u,m={keywords:!0})=>{if(Array.isArray(m))return c(u,m,r.fullFormats,o),u;const[v,l]=m.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,o],h=m.formats||r.formatNames;return c(u,h,v,l),m.keywords&&(0,n.default)(u),u};a.get=(u,m="full")=>{const l=(m==="fast"?r.fastFormats:r.fullFormats)[u];if(!l)throw new Error(`Unknown format "${u}"`);return l};function c(u,m,v,l){var h,w;(h=(w=u.opts.code).formats)!==null&&h!==void 0||(w.formats=(0,s._)`require("ajv-formats/dist/formats").${l}`);for(const S of m)u.addFormat(S,v[S])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(pn,pn.exports)),pn.exports}var Ch=Th();const fs=ur(Ch),Mh=fs(new eh({strict:!1})),Dh=fs(new gh),Ua=fs(new zh),Vh=[{patterns:["draft-07","draft-06","draft-04"],ajv:Mh,metaUri:"http://json-schema.org/draft-07/schema"},{patterns:["draft/2019-09"],ajv:Dh,metaUri:"https://json-schema.org/draft/2019-09/schema"},{patterns:["draft/2020-12"],ajv:Ua,metaUri:"https://json-schema.org/draft/2020-12/schema"}],Fh=Ua,qh="https://json-schema.org/draft/2020-12/schema";function Zh(e){const t=e.$schema??"";for(const r of Vh)if(r.patterns.some(n=>t.includes(n)))return{ajv:r.ajv,metaUri:r.metaUri};return{ajv:Fh,metaUri:qh}}function Ut(e,t=""){const r=[];if(e===null||typeof e!="object")return r;const n=p=>typeof p=="number"?p:void 0,s=n(e.minimum),o=n(e.maximum),i=e.exclusiveMinimum,a=e.exclusiveMaximum,c=n(e.minLength),u=n(e.maxLength),m=n(e.minItems),v=n(e.maxItems),l=n(e.minContains),h=n(e.maxContains),w=n(e.minProperties),S=n(e.maxProperties);if(s!==void 0&&o!==void 0&&(typeof i=="boolean"&&i||typeof a=="boolean"&&a?o<=s:o<s)&&r.push({instancePath:`${t}/maximum`,message:`maximum (${o}) must be >= minimum (${s})`}),typeof i=="number"&&(o!==void 0&&o<=i&&r.push({instancePath:`${t}/maximum`,message:`maximum (${o}) must be > exclusiveMinimum (${i})`}),s!==void 0&&i===s&&r.push({instancePath:`${t}/exclusiveMinimum`,message:`exclusiveMinimum (${i}) must not equal minimum (${s})`})),typeof a=="number"&&(s!==void 0&&a<=s&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must be > minimum (${s})`}),typeof i=="number"&&a<=i&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must be > exclusiveMinimum (${i})`}),o!==void 0&&a===o&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must not equal maximum (${o})`})),c!==void 0&&u!==void 0&&u<c&&r.push({instancePath:`${t}/maxLength`,message:`maxLength (${u}) must be >= minLength (${c})`}),m!==void 0&&v!==void 0&&v<m&&r.push({instancePath:`${t}/maxItems`,message:`maxItems (${v}) must be >= minItems (${m})`}),l!==void 0&&h!==void 0&&h<l&&r.push({instancePath:`${t}/maxContains`,message:`maxContains (${h}) must be >= minContains (${l})`}),w!==void 0&&S!==void 0&&S<w&&r.push({instancePath:`${t}/maxProperties`,message:`maxProperties (${S}) must be >= minProperties (${w})`}),e.properties&&typeof e.properties=="object"&&!Array.isArray(e.properties))for(const p of Object.keys(e.properties))r.push(...Ut(e.properties[p],`${t}/properties/${p}`));if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items)&&r.push(...Ut(e.items,`${t}/items`)),e.$defs&&typeof e.$defs=="object")for(const p of Object.keys(e.$defs))r.push(...Ut(e.$defs[p],`${t}/$defs/${p}`));if(e.definitions&&typeof e.definitions=="object")for(const p of Object.keys(e.definitions))r.push(...Ut(e.definitions[p],`${t}/definitions/${p}`));return r}function xa(e){const{ajv:t,metaUri:r}=Zh(e),s=t.validate(r,e)?[]:t.errors??[],o=Ut(e),i=[...s,...o];return i.length>0?i:null}function Uh(e={}){const{rootType:t="object",defaultValue:r,onChange:n}=e,s=ee.useRef(n);s.current=n;const o=ee.useMemo(()=>Qe(6),[]),i=ee.useCallback(M=>({root:{type:t,$schema:"http://json-schema.org/draft/2020-12/schema",...t==="object"&&{additionalProperties:!0},...t==="array"&&{items:{type:"string"}}},properties:t==="object"?[{id:M,key:`field_${M}`,isRequired:!1,schema:{type:"number"}}]:[],definitions:[]}),[t]),a=fm({resolver:ym(go),defaultValues:r?vs(r):i(o)}),{setError:c,clearErrors:u,setValue:m,reset:v,getValues:l}=a,{fields:h,append:w,remove:S}=Fo({control:a.control,name:"properties",keyName:"fieldId"}),{fields:p,append:_,remove:f}=Fo({control:a.control,name:"definitions",keyName:"defId"}),[y,g]=ee.useState(()=>vn(l())),[d,$]=ee.useState(null),[E,R]=ee.useState({isOpen:!1,fieldPath:null}),Z=ee.useRef("");ee.useEffect(()=>{const M=a.watch(O=>{const C=vn(O),A=JSON.stringify(C);if(A!==Z.current){Z.current=A,g(C),s.current?.(C);const b=xa(C);$(P=>JSON.stringify(b)!==JSON.stringify(P)?b:P)}});return()=>M.unsubscribe()},[a]),ee.useEffect(()=>{const M={exclusiveMinimum:"exclusiveMin",exclusiveMaximum:"exclusiveMax"};if(u(),d){const O=l("properties");d.forEach(C=>{const A=C.instancePath.split("/").filter(Boolean);if(A[0]==="properties"&&A.length>=3){const b=O?.findIndex(P=>P.key===A[1])??-1;if(b!==-1){const P=A[2],T=M[P]??P;c(`properties.${b}.schema.${T}`,{type:"ajv",message:C.message})}}else if(A.length>0){const b=A[0],P=M[b]??b;c(`root.${P}`,{type:"ajv",message:C.message})}})}},[d,u,c,l]),ee.useEffect(()=>{if(!r){const M=Qe(6);v(i(M))}},[t,v,r,i]);const L=ee.useCallback(()=>{const M=Qe(6);w({id:M,key:`field_${M}`,isRequired:!1,schema:{type:"string"}})},[w]),F=ee.useCallback(M=>{S(M)},[S]),V=ee.useCallback(()=>{const M=Qe(6);_({id:M,key:`def_${M}`,schema:{type:"object",additionalProperties:!0}})},[_]),U=ee.useCallback(M=>{const O=l(`definitions.${M}.key`);K(O,null),f(M)},[l,f]),K=ee.useCallback((M,O)=>{const C=`#/$defs/${M}`,A=O?`#/$defs/${O}`:"",b=l(),P=(T,G)=>{G&&(G.schema&&G.schema.$ref===C&&m(`${T}.schema.$ref`,A),G.$ref===C&&m(`${T}.$ref`,A),G.schema?.properties&&Array.isArray(G.schema.properties)&&G.schema.properties.forEach((Y,ie)=>{P(`${T}.schema.properties.${ie}`,Y)}),G.properties&&Array.isArray(G.properties)&&G.properties.forEach((Y,ie)=>{P(`${T}.properties.${ie}`,Y)}),G.schema?.items&&(Array.isArray(G.schema.items)||P(`${T}.schema.items`,{schema:G.schema.items})))};b.properties&&b.properties.forEach((T,G)=>{P(`properties.${G}`,T)}),b.definitions&&b.definitions.forEach((T,G)=>{T.key!==M&&P(`definitions.${G}`,T)}),b.root&&b.root.$ref===C&&m("root.$ref",A)},[l,m]),re=ee.useCallback(M=>{R({isOpen:!0,fieldPath:M})},[]),ye=ee.useCallback(()=>{R({isOpen:!1,fieldPath:null})},[]),me=ee.useCallback((M,O)=>{let C={};O==="object"?C={type:"object",properties:[],additionalProperties:!0}:O==="array"?C={type:"array"}:O==="ref"?C={type:"ref",$ref:""}:C={type:O},m(`${M}.schema`,C)},[m]),ue=ee.useCallback(M=>{const O=Qe(6),C=l(`${M}.schema.properties`)||[];m(`${M}.schema.properties`,[...C,{id:O,key:`field_${O}`,isRequired:!1,schema:{type:"string"}}])},[m,l]),Oe=ee.useCallback(()=>{const M=Qe(6);v(i(M))},[v,i]);return{schema:y,errors:d,fields:h,definitions:p,form:a,settingsState:E,addField:L,removeField:F,addDefinition:V,removeDefinition:U,updateReferences:K,openSettings:re,closeSettings:ye,handleTypeChange:me,addNestedField:ue,reset:Oe}}Se.DEFAULT_SCHEMA_URI=yn,Se.INTEGER_FORMATS=Ha,Se.NUMBER_FORMATS=Ga,Se.SCHEMA_TYPES=ps,Se.SCHEMA_TYPES_WITH_REF=Ja,Se.STRING_FORMATS=Ba,Se.createDefaultArraySchema=Ya,Se.createDefaultField=Xa,Se.createDefaultObjectSchema=Wa,Se.formSchema=go,Se.formToSchema=vn,Se.jsonSchemaZod=Ze,Se.schemaToForm=vs,Se.useJsonSchemaEditor=Uh,Se.validateSchema=xa,Object.defineProperty(Se,Symbol.toStringTag,{value:"Module"})}));
|
|
46
|
+
deps: ${m}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[u,m]=o(c);i(c,u),a(c,m)}};function o({schema:c}){const u={},m={};for(const y in c){if(y==="__proto__")continue;const f=Array.isArray(c[y])?u:m;f[y]=c[y]}return[u,m]}function i(c,u=c.schema){const{gen:m,data:y,it:f}=c;if(Object.keys(u).length===0)return;const h=m.let("missing");for(const w in u){const S=u[w];if(S.length===0)continue;const p=(0,n.propertyInData)(m,y,w,f.opts.ownProperties);c.setParams({property:w,depsCount:S.length,deps:S.join(", ")}),f.allErrors?m.if(p,()=>{for(const _ of S)(0,n.checkReportMissingProp)(c,_)}):(m.if((0,t._)`${p} && (${(0,n.checkMissingProp)(c,S,h)})`),(0,n.reportMissingProp)(c,h),m.else())}}e.validatePropertyDeps=i;function a(c,u=c.schema){const{gen:m,data:y,keyword:f,it:h}=c,w=m.name("valid");for(const S in u)(0,r.alwaysValidSchema)(h,u[S])||(m.if((0,n.propertyInData)(m,y,S,h.opts.ownProperties),()=>{const p=c.subschema({keyword:f,schemaProp:S},w);c.mergeValidEvaluated(p,w)},()=>m.var(w,!0)),c.ok(w))}e.validateSchemaDeps=a,e.default=s})(ds)),ds}var Ur={},Yi;function Lm(){if(Yi)return Ur;Yi=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=ne(),t=de(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,e._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:o,schema:i,data:a,it:c}=s;if((0,t.alwaysValidSchema)(c,i))return;const u=o.name("valid");o.forIn("key",a,m=>{s.setParams({propertyName:m}),s.subschema({keyword:"propertyNames",data:m,dataTypes:["string"],propertyName:m,compositeRule:!0},u),o.if((0,e.not)(u),()=>{s.error(!0),c.allErrors||o.break()})}),s.ok(u)}};return Ur.default=n,Ur}var xr={},Xi;function Qi(){if(Xi)return xr;Xi=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=Qe(),t=ne(),r=Ye(),n=de(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>(0,t._)`{additionalProperty: ${i.additionalProperty}}`},code(i){const{gen:a,schema:c,parentSchema:u,data:m,errsCount:y,it:f}=i;if(!y)throw new Error("ajv implementation error");const{allErrors:h,opts:w}=f;if(f.props=!0,w.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(f,c))return;const S=(0,e.allSchemaProperties)(u.properties),p=(0,e.allSchemaProperties)(u.patternProperties);_(),i.ok((0,t._)`${y} === ${r.default.errors}`);function _(){a.forIn("key",m,$=>{!S.length&&!p.length?g($):a.if(l($),()=>g($))})}function l($){let E;if(S.length>8){const R=(0,n.schemaRefOrVal)(f,u.properties,"properties");E=(0,e.isOwnProperty)(a,R,$)}else S.length?E=(0,t.or)(...S.map(R=>(0,t._)`${$} === ${R}`)):E=t.nil;return p.length&&(E=(0,t.or)(E,...p.map(R=>(0,t._)`${(0,e.usePattern)(i,R)}.test(${$})`))),(0,t.not)(E)}function v($){a.code((0,t._)`delete ${m}[${$}]`)}function g($){if(w.removeAdditional==="all"||w.removeAdditional&&c===!1){v($);return}if(c===!1){i.setParams({additionalProperty:$}),i.error(),h||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(f,c)){const E=a.name("valid");w.removeAdditional==="failing"?(d($,E,!1),a.if((0,t.not)(E),()=>{i.reset(),v($)})):(d($,E),h||a.if((0,t.not)(E),()=>a.break()))}}function d($,E,R){const Z={keyword:"additionalProperties",dataProp:$,dataPropType:n.Type.Str};R===!1&&Object.assign(Z,{compositeRule:!0,createErrors:!1,allErrors:!1}),i.subschema(Z,E)}}};return xr.default=o,xr}var Lr={},ea;function Km(){if(ea)return Lr;ea=1,Object.defineProperty(Lr,"__esModule",{value:!0});const e=Nt(),t=Qe(),r=de(),n=Qi(),s={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:i,schema:a,parentSchema:c,data:u,it:m}=o;m.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(m,n.default,"additionalProperties"));const y=(0,t.allSchemaProperties)(a);for(const p of y)m.definedProperties.add(p);m.opts.unevaluated&&y.length&&m.props!==!0&&(m.props=r.mergeEvaluated.props(i,(0,r.toHash)(y),m.props));const f=y.filter(p=>!(0,r.alwaysValidSchema)(m,a[p]));if(f.length===0)return;const h=i.name("valid");for(const p of f)w(p)?S(p):(i.if((0,t.propertyInData)(i,u,p,m.opts.ownProperties)),S(p),m.allErrors||i.else().var(h,!0),i.endIf()),o.it.definedProperties.add(p),o.ok(h);function w(p){return m.opts.useDefaults&&!m.compositeRule&&a[p].default!==void 0}function S(p){o.subschema({keyword:"properties",schemaProp:p,dataProp:p},h)}}};return Lr.default=s,Lr}var Kr={},ta;function Jm(){if(ta)return Kr;ta=1,Object.defineProperty(Kr,"__esModule",{value:!0});const e=Qe(),t=ne(),r=de(),n=de(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:i,schema:a,data:c,parentSchema:u,it:m}=o,{opts:y}=m,f=(0,e.allSchemaProperties)(a),h=f.filter(g=>(0,r.alwaysValidSchema)(m,a[g]));if(f.length===0||h.length===f.length&&(!m.opts.unevaluated||m.props===!0))return;const w=y.strictSchema&&!y.allowMatchingProperties&&u.properties,S=i.name("valid");m.props!==!0&&!(m.props instanceof t.Name)&&(m.props=(0,n.evaluatedPropsToName)(i,m.props));const{props:p}=m;_();function _(){for(const g of f)w&&l(g),m.allErrors?v(g):(i.var(S,!0),v(g),i.if(S))}function l(g){for(const d in w)new RegExp(g).test(d)&&(0,r.checkStrictMode)(m,`property ${d} matches pattern ${g} (use allowMatchingProperties)`)}function v(g){i.forIn("key",c,d=>{i.if((0,t._)`${(0,e.usePattern)(o,g)}.test(${d})`,()=>{const $=h.includes(g);$||o.subschema({keyword:"patternProperties",schemaProp:g,dataProp:d,dataPropType:n.Type.Str},S),m.opts.unevaluated&&p!==!0?i.assign((0,t._)`${p}[${d}]`,!0):!$&&!m.allErrors&&i.if((0,t.not)(S),()=>i.break())})})}}};return Kr.default=s,Kr}var Jr={},ra;function Gm(){if(ra)return Jr;ra=1,Object.defineProperty(Jr,"__esModule",{value:!0});const e=de(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:s,it:o}=r;if((0,e.alwaysValidSchema)(o,s)){r.fail();return}const i=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),r.failResult(i,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return Jr.default=t,Jr}var Gr={},na;function Hm(){if(na)return Gr;na=1,Object.defineProperty(Gr,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Qe().validateUnion,error:{message:"must match a schema in anyOf"}};return Gr.default=t,Gr}var Hr={},sa;function Bm(){if(sa)return Hr;sa=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=ne(),t=de(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,e._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:o,schema:i,parentSchema:a,it:c}=s;if(!Array.isArray(i))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;const u=i,m=o.let("valid",!1),y=o.let("passing",null),f=o.name("_valid");s.setParams({passing:y}),o.block(h),s.result(m,()=>s.reset(),()=>s.error(!0));function h(){u.forEach((w,S)=>{let p;(0,t.alwaysValidSchema)(c,w)?o.var(f,!0):p=s.subschema({keyword:"oneOf",schemaProp:S,compositeRule:!0},f),S>0&&o.if((0,e._)`${f} && ${m}`).assign(m,!1).assign(y,(0,e._)`[${y}, ${S}]`).else(),o.if(f,()=>{o.assign(m,!0),o.assign(y,S),p&&s.mergeEvaluated(p,e.Name)})})}}};return Hr.default=n,Hr}var Br={},oa;function Wm(){if(oa)return Br;oa=1,Object.defineProperty(Br,"__esModule",{value:!0});const e=de(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:s,it:o}=r;if(!Array.isArray(s))throw new Error("ajv implementation error");const i=n.name("valid");s.forEach((a,c)=>{if((0,e.alwaysValidSchema)(o,a))return;const u=r.subschema({keyword:"allOf",schemaProp:c},i);r.ok(i),r.mergeEvaluated(u)})}};return Br.default=t,Br}var Wr={},ia;function Ym(){if(ia)return Wr;ia=1,Object.defineProperty(Wr,"__esModule",{value:!0});const e=ne(),t=de(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:i,parentSchema:a,it:c}=o;a.then===void 0&&a.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const u=s(c,"then"),m=s(c,"else");if(!u&&!m)return;const y=i.let("valid",!0),f=i.name("_valid");if(h(),o.reset(),u&&m){const S=i.let("ifClause");o.setParams({ifClause:S}),i.if(f,w("then",S),w("else",S))}else u?i.if(f,w("then")):i.if((0,e.not)(f),w("else"));o.pass(y,()=>o.error(!0));function h(){const S=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},f);o.mergeEvaluated(S)}function w(S,p){return()=>{const _=o.subschema({keyword:S},f);i.assign(y,f),o.mergeValidEvaluated(_,y),p?i.assign(p,(0,e._)`${S}`):o.setParams({ifClause:S})}}}};function s(o,i){const a=o.schema[i];return a!==void 0&&!(0,t.alwaysValidSchema)(o,a)}return Wr.default=n,Wr}var Yr={},aa;function Xm(){if(aa)return Yr;aa=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=de(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:s}){n.if===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "if" is ignored`)}};return Yr.default=t,Yr}var ca;function ua(){if(ca)return Vr;ca=1,Object.defineProperty(Vr,"__esModule",{value:!0});const e=Li(),t=Zm(),r=Ji(),n=Um(),s=xm(),o=ls(),i=Lm(),a=Qi(),c=Km(),u=Jm(),m=Gm(),y=Hm(),f=Bm(),h=Wm(),w=Ym(),S=Xm();function p(_=!1){const l=[m.default,y.default,f.default,h.default,w.default,S.default,i.default,a.default,o.default,c.default,u.default];return _?l.push(t.default,n.default):l.push(e.default,r.default),l.push(s.default),l}return Vr.default=p,Vr}var Xr={},Qr={},da;function Qm(){if(da)return Qr;da=1,Object.defineProperty(Qr,"__esModule",{value:!0});const e=ne(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,s){const{gen:o,data:i,$data:a,schema:c,schemaCode:u,it:m}=n,{opts:y,errSchemaPath:f,schemaEnv:h,self:w}=m;if(!y.validateFormats)return;a?S():p();function S(){const _=o.scopeValue("formats",{ref:w.formats,code:y.code.formats}),l=o.const("fDef",(0,e._)`${_}[${u}]`),v=o.let("fType"),g=o.let("format");o.if((0,e._)`typeof ${l} == "object" && !(${l} instanceof RegExp)`,()=>o.assign(v,(0,e._)`${l}.type || "string"`).assign(g,(0,e._)`${l}.validate`),()=>o.assign(v,(0,e._)`"string"`).assign(g,l)),n.fail$data((0,e.or)(d(),$()));function d(){return y.strictSchema===!1?e.nil:(0,e._)`${u} && !${g}`}function $(){const E=h.$async?(0,e._)`(${l}.async ? await ${g}(${i}) : ${g}(${i}))`:(0,e._)`${g}(${i})`,R=(0,e._)`(typeof ${g} == "function" ? ${E} : ${g}.test(${i}))`;return(0,e._)`${g} && ${g} !== true && ${v} === ${s} && !${R}`}}function p(){const _=w.formats[c];if(!_){d();return}if(_===!0)return;const[l,v,g]=$(_);l===s&&n.pass(E());function d(){if(y.strictSchema===!1){w.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${c}" ignored in schema at path "${f}"`}}function $(R){const Z=R instanceof RegExp?(0,e.regexpCode)(R):y.code.formats?(0,e._)`${y.code.formats}${(0,e.getProperty)(c)}`:void 0,K=o.scopeValue("formats",{key:c,ref:R,code:Z});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,e._)`${K}.validate`]:["string",R,K]}function E(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!h.$async)throw new Error("async format in sync schema");return(0,e._)`await ${g}(${i})`}return typeof v=="function"?(0,e._)`${g}(${i})`:(0,e._)`${g}.test(${i})`}}}};return Qr.default=r,Qr}var la;function fa(){if(la)return Xr;la=1,Object.defineProperty(Xr,"__esModule",{value:!0});const t=[Qm().default];return Xr.default=t,Xr}var _t={},ma;function ha(){return ma||(ma=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.contentVocabulary=_t.metadataVocabulary=void 0,_t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],_t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),_t}var pa;function ya(){if(pa)return wr;pa=1,Object.defineProperty(wr,"__esModule",{value:!0});const e=ji(),t=Ui(),r=ua(),n=fa(),s=ha(),o=[e.default,t.default,(0,r.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];return wr.default=o,wr}var en={},xt={},va;function eh(){if(va)return xt;va=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(xt.DiscrError=e={})),xt}var ga;function fs(){if(ga)return en;ga=1,Object.defineProperty(en,"__esModule",{value:!0});const e=ne(),t=eh(),r=$r(),n=zt(),s=de(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:u}})=>(0,e._)`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){const{gen:c,data:u,schema:m,parentSchema:y,it:f}=a,{oneOf:h}=y;if(!f.opts.discriminator)throw new Error("discriminator: requires discriminator option");const w=m.propertyName;if(typeof w!="string")throw new Error("discriminator: requires propertyName");if(m.mapping)throw new Error("discriminator: mapping is not supported");if(!h)throw new Error("discriminator: requires oneOf keyword");const S=c.let("valid",!1),p=c.const("tag",(0,e._)`${u}${(0,e.getProperty)(w)}`);c.if((0,e._)`typeof ${p} == "string"`,()=>_(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:p,tagName:w})),a.ok(S);function _(){const g=v();c.if(!1);for(const d in g)c.elseIf((0,e._)`${p} === ${d}`),c.assign(S,l(g[d]));c.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:p,tagName:w}),c.endIf()}function l(g){const d=c.name("valid"),$=a.subschema({keyword:"oneOf",schemaProp:g},d);return a.mergeEvaluated($,e.Name),d}function v(){var g;const d={},$=R(y);let E=!0;for(let D=0;D<h.length;D++){let V=h[D];if(V?.$ref&&!(0,s.schemaHasRulesButRef)(V,f.self.RULES)){const L=V.$ref;if(V=r.resolveRef.call(f.self,f.schemaEnv.root,f.baseId,L),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default(f.opts.uriResolver,f.baseId,L)}const q=(g=V?.properties)===null||g===void 0?void 0:g[w];if(typeof q!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${w}"`);E=E&&($||R(V)),Z(q,D)}if(!E)throw new Error(`discriminator: "${w}" must be required`);return d;function R({required:D}){return Array.isArray(D)&&D.includes(w)}function Z(D,V){if(D.const)K(D.const,V);else if(D.enum)for(const q of D.enum)K(q,V);else throw new Error(`discriminator: "properties/${w}" must have "const" or "enum"`)}function K(D,V){if(typeof D!="string"||D in d)throw new Error(`discriminator: "${w}" values must be unique strings`);d[D]=V}}}};return en.default=i,en}const th={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0};var _a;function $a(){return _a||(_a=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=as(),n=ya(),s=fs(),o=th,i=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(o,i):o;this.addMetaSchema(w,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Nt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var m=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var y=Zt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return y.default}});var f=zt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return f.default}})})(fr,fr.exports)),fr.exports}var rh=$a();const nh=lr(rh);var tn={exports:{}},rn={},Tt={},ba;function wa(){if(ba)return Tt;ba=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.dynamicAnchor=void 0;const e=ne(),t=Ye(),r=$r(),n=cs(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>o(a,a.schema)};function o(a,c){const{gen:u,it:m}=a;m.schemaEnv.root.dynamicAnchors[c]=!0;const y=(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(c)}`,f=m.errSchemaPath==="#"?m.validateName:i(a);u.if((0,e._)`!${y}`,()=>u.assign(y,f))}Tt.dynamicAnchor=o;function i(a){const{schemaEnv:c,schema:u,self:m}=a.it,{root:y,baseId:f,localRefs:h,meta:w}=c.root,{schemaId:S}=m.opts,p=new r.SchemaEnv({schema:u,schemaId:S,root:y,baseId:f,localRefs:h,meta:w});return r.compileSchema.call(m,p),(0,n.getValidate)(a,p)}return Tt.default=s,Tt}var Ct={},Sa;function Ea(){if(Sa)return Ct;Sa=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.dynamicRef=void 0;const e=ne(),t=Ye(),r=cs(),n={keyword:"$dynamicRef",schemaType:"string",code:o=>s(o,o.schema)};function s(o,i){const{gen:a,keyword:c,it:u}=o;if(i[0]!=="#")throw new Error(`"${c}" only supports hash fragment reference`);const m=i.slice(1);if(u.allErrors)y();else{const h=a.let("valid",!1);y(h),o.ok(h)}function y(h){if(u.schemaEnv.root.dynamicAnchors[m]){const w=a.let("_v",(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(m)}`);a.if(w,f(w,h),f(u.validateName,h))}else f(u.validateName,h)()}function f(h,w){return w?()=>a.block(()=>{(0,r.callRef)(o,h),a.let(w,!0)}):()=>(0,r.callRef)(o,h)}}return Ct.dynamicRef=s,Ct.default=n,Ct}var nn={},ka;function sh(){if(ka)return nn;ka=1,Object.defineProperty(nn,"__esModule",{value:!0});const e=wa(),t=de(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,e.dynamicAnchor)(n,""):(0,t.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return nn.default=r,nn}var sn={},Pa;function oh(){if(Pa)return sn;Pa=1,Object.defineProperty(sn,"__esModule",{value:!0});const e=Ea(),t={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,e.dynamicRef)(r,r.schema)};return sn.default=t,sn}var Oa;function ja(){if(Oa)return rn;Oa=1,Object.defineProperty(rn,"__esModule",{value:!0});const e=wa(),t=Ea(),r=sh(),n=oh(),s=[e.default,t.default,r.default,n.default];return rn.default=s,rn}var on={},an={},Aa;function ih(){if(Aa)return an;Aa=1,Object.defineProperty(an,"__esModule",{value:!0});const e=ls(),t={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:r=>(0,e.validatePropertyDeps)(r)};return an.default=t,an}var cn={},Na;function ah(){if(Na)return cn;Na=1,Object.defineProperty(cn,"__esModule",{value:!0});const e=ls(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,e.validateSchemaDeps)(r)};return cn.default=t,cn}var un={},za;function ch(){if(za)return un;za=1,Object.defineProperty(un,"__esModule",{value:!0});const e=de(),t={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:s}){n.contains===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "contains" is ignored`)}};return un.default=t,un}var Ra;function Ia(){if(Ra)return on;Ra=1,Object.defineProperty(on,"__esModule",{value:!0});const e=ih(),t=ah(),r=ch(),n=[e.default,t.default,r.default];return on.default=n,on}var dn={},ln={},Ta;function uh(){if(Ta)return ln;Ta=1,Object.defineProperty(ln,"__esModule",{value:!0});const e=ne(),t=de(),r=Ye(),s={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:o})=>(0,e._)`{unevaluatedProperty: ${o.unevaluatedProperty}}`},code(o){const{gen:i,schema:a,data:c,errsCount:u,it:m}=o;if(!u)throw new Error("ajv implementation error");const{allErrors:y,props:f}=m;f instanceof e.Name?i.if((0,e._)`${f} !== true`,()=>i.forIn("key",c,p=>i.if(w(f,p),()=>h(p)))):f!==!0&&i.forIn("key",c,p=>f===void 0?h(p):i.if(S(f,p),()=>h(p))),m.props=!0,o.ok((0,e._)`${u} === ${r.default.errors}`);function h(p){if(a===!1){o.setParams({unevaluatedProperty:p}),o.error(),y||i.break();return}if(!(0,t.alwaysValidSchema)(m,a)){const _=i.name("valid");o.subschema({keyword:"unevaluatedProperties",dataProp:p,dataPropType:t.Type.Str},_),y||i.if((0,e.not)(_),()=>i.break())}}function w(p,_){return(0,e._)`!${p} || !${p}[${_}]`}function S(p,_){const l=[];for(const v in p)p[v]===!0&&l.push((0,e._)`${_} !== ${v}`);return(0,e.and)(...l)}}};return ln.default=s,ln}var fn={},Ca;function dh(){if(Ca)return fn;Ca=1,Object.defineProperty(fn,"__esModule",{value:!0});const e=ne(),t=de(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{gen:o,schema:i,data:a,it:c}=s,u=c.items||0;if(u===!0)return;const m=o.const("len",(0,e._)`${a}.length`);if(i===!1)s.setParams({len:u}),s.fail((0,e._)`${m} > ${u}`);else if(typeof i=="object"&&!(0,t.alwaysValidSchema)(c,i)){const f=o.var("valid",(0,e._)`${m} <= ${u}`);o.if((0,e.not)(f),()=>y(f,u)),s.ok(f)}c.items=!0;function y(f,h){o.forRange("i",h,m,w=>{s.subschema({keyword:"unevaluatedItems",dataProp:w,dataPropType:t.Type.Num},f),c.allErrors||o.if((0,e.not)(f),()=>o.break())})}}};return fn.default=n,fn}var Ma;function Da(){if(Ma)return dn;Ma=1,Object.defineProperty(dn,"__esModule",{value:!0});const e=uh(),t=dh(),r=[e.default,t.default];return dn.default=r,dn}var mn={};const lh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}},fh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}},mh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}},hh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}},ph={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}},yh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},vh={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};var Va;function gh(){if(Va)return mn;Va=1,Object.defineProperty(mn,"__esModule",{value:!0});const e=lh,t=fh,r=mh,n=hh,s=ph,o=yh,i=vh,a=["/properties"];function c(u){return[e,t,r,n,m(this,s),o,m(this,i)].forEach(y=>this.addMetaSchema(y,void 0,!1)),this;function m(y,f){return u?y.$dataMetaSchema(f,a):f}}return mn.default=c,mn}var Fa;function _h(){return Fa||(Fa=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2019=void 0;const r=as(),n=ya(),s=ja(),o=Ia(),i=Da(),a=fs(),c=gh(),u="https://json-schema.org/draft/2019-09/schema";class m extends r.default{constructor(p={}){super({...p,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(s.default),n.default.forEach(p=>this.addVocabulary(p)),this.addVocabulary(o.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:p,meta:_}=this.opts;_&&(c.default.call(this,p),this.refs["http://json-schema.org/schema"]=u)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv2019=m,e.exports=t=m,e.exports.Ajv2019=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var y=Nt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return y.KeywordCxt}});var f=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var h=Zt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var w=zt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return w.default}})})(tn,tn.exports)),tn.exports}var $h=_h();const bh=lr($h);var hn={exports:{}},pn={},qa;function wh(){if(qa)return pn;qa=1,Object.defineProperty(pn,"__esModule",{value:!0});const e=ji(),t=Ui(),r=ua(),n=ja(),s=Ia(),o=Da(),i=fa(),a=ha(),c=[n.default,e.default,t.default,(0,r.default)(!0),i.default,a.metadataVocabulary,a.contentVocabulary,s.default,o.default];return pn.default=c,pn}var yn={};const Sh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}},Eh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}},kh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}},Ph={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}},Oh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}},jh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}},Ah={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},Nh={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};var Za;function zh(){if(Za)return yn;Za=1,Object.defineProperty(yn,"__esModule",{value:!0});const e=Sh,t=Eh,r=kh,n=Ph,s=Oh,o=jh,i=Ah,a=Nh,c=["/properties"];function u(m){return[e,t,r,n,s,y(this,o),i,y(this,a)].forEach(f=>this.addMetaSchema(f,void 0,!1)),this;function y(f,h){return m?f.$dataMetaSchema(h,c):h}}return yn.default=u,yn}var Ua;function Rh(){return Ua||(Ua=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const r=as(),n=wh(),s=fs(),o=zh(),i="https://json-schema.org/draft/2020-12/schema";class a extends r.default{constructor(h={}){super({...h,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(h=>this.addVocabulary(h)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:h,meta:w}=this.opts;w&&(o.default.call(this,h),this.refs["http://json-schema.org/schema"]=i)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var c=Nt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=ne();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var m=Zt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var y=zt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return y.default}})})(hn,hn.exports)),hn.exports}var Ih=Rh();const Th=lr(Ih);var vn={exports:{}},ms={},xa;function Ch(){return xa||(xa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(D,V){return{validate:D,compare:V}}e.fullFormats={date:t(o,i),time:t(c(!0),u),"date-time":t(f(!0),h),"iso-time":t(c(),m),"iso-date-time":t(f(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:K,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:v,int32:{type:"number",validate:$},int64:{type:"number",validate:E},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,w),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(D){return D%4===0&&(D%100!==0||D%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(D){const V=n.exec(D);if(!V)return!1;const q=+V[1],L=+V[2],re=+V[3];return L>=1&&L<=12&&re>=1&&re<=(L===2&&r(q)?29:s[L])}function i(D,V){if(D&&V)return D>V?1:D<V?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(D){return function(q){const L=a.exec(q);if(!L)return!1;const re=+L[1],he=+L[2],ye=+L[3],ce=L[4],Ae=L[5]==="-"?-1:1,U=+(L[6]||0),O=+(L[7]||0);if(U>23||O>59||D&&!ce)return!1;if(re<=23&&he<=59&&ye<60)return!0;const C=he-O*Ae,N=re-U*Ae-(C<0?1:0);return(N===23||N===-1)&&(C===59||C===-1)&&ye<61}}function u(D,V){if(!(D&&V))return;const q=new Date("2020-01-01T"+D).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(q&&L)return q-L}function m(D,V){if(!(D&&V))return;const q=a.exec(D),L=a.exec(V);if(q&&L)return D=q[1]+q[2]+q[3],V=L[1]+L[2]+L[3],D>V?1:D<V?-1:0}const y=/t|\s/i;function f(D){const V=c(D);return function(L){const re=L.split(y);return re.length===2&&o(re[0])&&V(re[1])}}function h(D,V){if(!(D&&V))return;const q=new Date(D).valueOf(),L=new Date(V).valueOf();if(q&&L)return q-L}function w(D,V){if(!(D&&V))return;const[q,L]=D.split(y),[re,he]=V.split(y),ye=i(q,re);if(ye!==void 0)return ye||u(L,he)}const S=/\/|:/,p=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(D){return S.test(D)&&p.test(D)}const l=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function v(D){return l.lastIndex=0,l.test(D)}const g=-2147483648,d=2**31-1;function $(D){return Number.isInteger(D)&&D<=d&&D>=g}function E(D){return Number.isInteger(D)}function R(){return!0}const Z=/[^\\]\\Z/;function K(D){if(Z.test(D))return!1;try{return new RegExp(D),!0}catch{return!1}}})(ms)),ms}var hs={},La;function Mh(){return La||(La=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=$a(),r=ne(),n=r.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:a,schemaCode:c})=>(0,r.str)`should be ${s[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>(0,r._)`{comparison: ${s[a].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:o,code(a){const{gen:c,data:u,schemaCode:m,keyword:y,it:f}=a,{opts:h,self:w}=f;if(!h.validateFormats)return;const S=new t.KeywordCxt(f,w.RULES.all.format.definition,"format");S.$data?p():_();function p(){const v=c.scopeValue("formats",{ref:w.formats,code:h.code.formats}),g=c.const("fmt",(0,r._)`${v}[${S.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${g} != "object"`,(0,r._)`${g} instanceof RegExp`,(0,r._)`typeof ${g}.compare != "function"`,l(g)))}function _(){const v=S.schema,g=w.formats[v];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${y}": format "${v}" does not define "compare" function`);const d=c.scopeValue("formats",{key:v,ref:g,code:h.code.formats?(0,r._)`${h.code.formats}${(0,r.getProperty)(v)}`:void 0});a.fail$data(l(d))}function l(v){return(0,r._)`${v}.compare(${u}, ${m}) ${s[y].fail} 0`}},dependencies:["format"]};const i=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i})(hs)),hs}var Ka;function Dh(){return Ka||(Ka=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Ch(),n=Mh(),s=ne(),o=new s.Name("fullFormats"),i=new s.Name("fastFormats"),a=(u,m={keywords:!0})=>{if(Array.isArray(m))return c(u,m,r.fullFormats,o),u;const[y,f]=m.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,o],h=m.formats||r.formatNames;return c(u,h,y,f),m.keywords&&(0,n.default)(u),u};a.get=(u,m="full")=>{const f=(m==="fast"?r.fastFormats:r.fullFormats)[u];if(!f)throw new Error(`Unknown format "${u}"`);return f};function c(u,m,y,f){var h,w;(h=(w=u.opts.code).formats)!==null&&h!==void 0||(w.formats=(0,s._)`require("ajv-formats/dist/formats").${f}`);for(const S of m)u.addFormat(S,y[S])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(vn,vn.exports)),vn.exports}var Vh=Dh();const ps=lr(Vh),Fh=ps(new nh({strict:!1})),qh=ps(new bh),Ja=ps(new Th),Zh=[{patterns:["draft-07","draft-06","draft-04"],ajv:Fh,metaUri:"http://json-schema.org/draft-07/schema"},{patterns:["draft/2019-09"],ajv:qh,metaUri:"https://json-schema.org/draft/2019-09/schema"},{patterns:["draft/2020-12"],ajv:Ja,metaUri:"https://json-schema.org/draft/2020-12/schema"}],Uh=Ja,xh="https://json-schema.org/draft/2020-12/schema";function Lh(e){const t=e.$schema??"";for(const r of Zh)if(r.patterns.some(n=>t.includes(n)))return{ajv:r.ajv,metaUri:r.metaUri};return{ajv:Uh,metaUri:xh}}function Lt(e,t=""){const r=[];if(e===null||typeof e!="object")return r;const n=p=>typeof p=="number"?p:void 0,s=n(e.minimum),o=n(e.maximum),i=e.exclusiveMinimum,a=e.exclusiveMaximum,c=n(e.minLength),u=n(e.maxLength),m=n(e.minItems),y=n(e.maxItems),f=n(e.minContains),h=n(e.maxContains),w=n(e.minProperties),S=n(e.maxProperties);if(s!==void 0&&o!==void 0&&(typeof i=="boolean"&&i||typeof a=="boolean"&&a?o<=s:o<s)&&r.push({instancePath:`${t}/maximum`,message:`maximum (${o}) must be >= minimum (${s})`}),typeof i=="number"&&(o!==void 0&&o<=i&&r.push({instancePath:`${t}/maximum`,message:`maximum (${o}) must be > exclusiveMinimum (${i})`}),s!==void 0&&i===s&&r.push({instancePath:`${t}/exclusiveMinimum`,message:`exclusiveMinimum (${i}) must not equal minimum (${s})`})),typeof a=="number"&&(s!==void 0&&a<=s&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must be > minimum (${s})`}),typeof i=="number"&&a<=i&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must be > exclusiveMinimum (${i})`}),o!==void 0&&a===o&&r.push({instancePath:`${t}/exclusiveMaximum`,message:`exclusiveMaximum (${a}) must not equal maximum (${o})`})),c!==void 0&&u!==void 0&&u<c&&r.push({instancePath:`${t}/maxLength`,message:`maxLength (${u}) must be >= minLength (${c})`}),m!==void 0&&y!==void 0&&y<m&&r.push({instancePath:`${t}/maxItems`,message:`maxItems (${y}) must be >= minItems (${m})`}),f!==void 0&&h!==void 0&&h<f&&r.push({instancePath:`${t}/maxContains`,message:`maxContains (${h}) must be >= minContains (${f})`}),w!==void 0&&S!==void 0&&S<w&&r.push({instancePath:`${t}/maxProperties`,message:`maxProperties (${S}) must be >= minProperties (${w})`}),e.properties&&typeof e.properties=="object"&&!Array.isArray(e.properties))for(const p of Object.keys(e.properties))r.push(...Lt(e.properties[p],`${t}/properties/${p}`));if(e.items&&typeof e.items=="object"&&!Array.isArray(e.items)&&r.push(...Lt(e.items,`${t}/items`)),e.$defs&&typeof e.$defs=="object")for(const p of Object.keys(e.$defs))r.push(...Lt(e.$defs[p],`${t}/$defs/${p}`));if(e.definitions&&typeof e.definitions=="object")for(const p of Object.keys(e.definitions))r.push(...Lt(e.definitions[p],`${t}/definitions/${p}`));return r}function Ga(e){const{ajv:t,metaUri:r}=Lh(e),s=t.validate(r,e)?[]:t.errors??[],o=Lt(e),i=[...s,...o];return i.length>0?i:null}function Kh(e={}){const{rootType:t="object",defaultValue:r,onChange:n}=e,s=r!=null&&Object.keys(r).length>0,o=ee.useRef(n);o.current=n;const i=ee.useMemo(()=>et(6),[]),a=ee.useCallback(O=>({root:{type:t,$schema:"http://json-schema.org/draft/2020-12/schema",...t==="object"&&{additionalProperties:!0},...t==="array"&&{items:{type:"string"}}},properties:t==="object"?[{id:O,key:`field_${O}`,isRequired:!1,schema:{type:"number"}}]:[],definitions:[]}),[t]),c=pm({resolver:_m(bo),defaultValues:s?$s(r):a(i)}),{setError:u,clearErrors:m,setValue:y,reset:f,getValues:h}=c,{fields:w,append:S,remove:p}=xo({control:c.control,name:"properties",keyName:"fieldId"}),{fields:_,append:l,remove:v}=xo({control:c.control,name:"definitions",keyName:"defId"}),[g,d]=ee.useState(()=>_n(h())),[$,E]=ee.useState(null),[R,Z]=ee.useState({isOpen:!1,fieldPath:null}),K=ee.useRef("");ee.useEffect(()=>{const O=c.watch(C=>{const N=_n(C),b=JSON.stringify(N);if(b!==K.current){K.current=b,d(N),o.current?.(N);const k=Ga(N);E(T=>JSON.stringify(k)!==JSON.stringify(T)?k:T)}});return()=>O.unsubscribe()},[c]),ee.useEffect(()=>{const O={exclusiveMinimum:"exclusiveMin",exclusiveMaximum:"exclusiveMax"};if(m(),$){const C=h("properties");$.forEach(N=>{const b=N.instancePath.split("/").filter(Boolean);if(b[0]==="properties"&&b.length>=3){const k=C?.findIndex(T=>T.key===b[1])??-1;if(k!==-1){const T=b[2],B=O[T]??T;u(`properties.${k}.schema.${B}`,{type:"ajv",message:N.message})}}else if(b.length>0){const k=b[0],T=O[k]??k;u(`root.${T}`,{type:"ajv",message:N.message})}})}},[$,m,u,h]),ee.useEffect(()=>{if(!s){const O=et(6);f(a(O))}},[t,f,s,a]);const D=ee.useCallback(()=>{const O=et(6);S({id:O,key:`field_${O}`,isRequired:!1,schema:{type:"string"}})},[S]),V=ee.useCallback(O=>{p(O)},[p]),q=ee.useCallback(()=>{const O=et(6);l({id:O,key:`def_${O}`,schema:{type:"object",additionalProperties:!0}})},[l]),L=ee.useCallback(O=>{const C=h(`definitions.${O}.key`);re(C,null),v(O)},[h,v]),re=ee.useCallback((O,C)=>{const N=`#/$defs/${O}`,b=C?`#/$defs/${C}`:"",k=h(),T=(B,W)=>{W&&(W.schema&&W.schema.$ref===N&&y(`${B}.schema.$ref`,b),W.$ref===N&&y(`${B}.$ref`,b),W.schema?.properties&&Array.isArray(W.schema.properties)&&W.schema.properties.forEach((ue,oe)=>{T(`${B}.schema.properties.${oe}`,ue)}),W.properties&&Array.isArray(W.properties)&&W.properties.forEach((ue,oe)=>{T(`${B}.properties.${oe}`,ue)}),W.schema?.items&&(Array.isArray(W.schema.items)||T(`${B}.schema.items`,{schema:W.schema.items})))};k.properties&&k.properties.forEach((B,W)=>{T(`properties.${W}`,B)}),k.definitions&&k.definitions.forEach((B,W)=>{B.key!==O&&T(`definitions.${W}`,B)}),k.root&&k.root.$ref===N&&y("root.$ref",b)},[h,y]),he=ee.useCallback(O=>{Z({isOpen:!0,fieldPath:O})},[]),ye=ee.useCallback(()=>{Z({isOpen:!1,fieldPath:null})},[]),ce=ee.useCallback((O,C)=>{let N={};C==="object"?N={type:"object",properties:[],additionalProperties:!0}:C==="array"?N={type:"array"}:C==="ref"?N={type:"ref",$ref:""}:N={type:C},y(`${O}.schema`,N)},[y]),Ae=ee.useCallback(O=>{const C=et(6),N=h(`${O}.schema.properties`)||[];y(`${O}.schema.properties`,[...N,{id:C,key:`field_${C}`,isRequired:!1,schema:{type:"string"}}])},[y,h]),U=ee.useCallback(()=>{const O=et(6);f(a(O))},[f,a]);return{schema:g,errors:$,fields:w,definitions:_,form:c,settingsState:R,addField:D,removeField:V,addDefinition:q,removeDefinition:L,updateReferences:re,openSettings:he,closeSettings:ye,handleTypeChange:ce,addNestedField:Ae,reset:U}}Se.DEFAULT_SCHEMA_URI=gn,Se.INTEGER_FORMATS=Ya,Se.NUMBER_FORMATS=Xa,Se.SCHEMA_TYPES=gs,Se.SCHEMA_TYPES_WITH_REF=Wa,Se.STRING_FORMATS=Qa,Se.createDefaultArraySchema=tc,Se.createDefaultField=rc,Se.createDefaultObjectSchema=ec,Se.formSchema=bo,Se.formToSchema=_n,Se.jsonSchemaZod=xe,Se.schemaToForm=$s,Se.useJsonSchemaEditor=Kh,Se.validateSchema=Ga,Object.defineProperty(Se,Symbol.toStringTag,{value:"Module"})}));
|