@oceanum/eidos 0.9.5 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +8 -8
  2. package/dist/index.js +2733 -2674
  3. package/package.json +3 -2
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Nt=require("react/jsx-runtime"),Re=require("react"),Pn=Symbol(),Bt=Object.getPrototypeOf,Ut=new WeakMap,Rn=e=>e&&(Ut.has(e)?Ut.get(e):Bt(e)===Object.prototype||Bt(e)===Array.prototype),Nn=e=>Rn(e)&&e[Pn]||null,Xt=(e,a=!0)=>{Ut.set(e,a)},yt={},Lt=e=>typeof e=="object"&&e!==null,On=e=>Lt(e)&&!Ft.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise),pn=(e,a)=>{const g=Qt.get(e);if(g?.[0]===a)return g[1];const u=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return Xt(u,!0),Qt.set(e,[a,u]),Reflect.ownKeys(e).forEach(v=>{if(Object.getOwnPropertyDescriptor(u,v))return;const o=Reflect.get(e,v),{enumerable:l}=Reflect.getOwnPropertyDescriptor(e,v),c={value:o,enumerable:l,configurable:!0};if(Ft.has(o))Xt(o,!1);else if(be.has(o)){const[d,_]=be.get(o);c.value=pn(d,_())}Object.defineProperty(u,v,c)}),Object.preventExtensions(u)},jn=(e,a,g,u)=>({deleteProperty(v,o){Reflect.get(v,o),g(o);const l=Reflect.deleteProperty(v,o);return l&&u(void 0),l},set(v,o,l,c){const d=!e()&&Reflect.has(v,o),_=Reflect.get(v,o,c);if(d&&(Yt(_,l)||vt.has(l)&&Yt(_,vt.get(l))))return!0;g(o),Lt(l)&&(l=Nn(l)||l);const h=!be.has(l)&&In(l)?mn(l):l;return a(o,h),Reflect.set(v,o,h,c),u(void 0),!0}}),be=new WeakMap,Ft=new WeakSet,Qt=new WeakMap,Ot=[1],vt=new WeakMap;let Yt=Object.is,kn=(e,a)=>new Proxy(e,a),In=On,Tn=pn,qn=jn;function mn(e={}){if(!Lt(e))throw new Error("object required");const a=vt.get(e);if(a)return a;let g=Ot[0];const u=new Set,v=(n,r=++Ot[0])=>{g!==r&&(o=g=r,u.forEach(t=>t(n,r)))};let o=g;const l=(n=Ot[0])=>(o!==n&&(o=n,d.forEach(([r])=>{const t=r[1](n);t>g&&(g=t)})),g),c=n=>(r,t)=>{let s;r&&(s=[...r],s[1]=[n,...s[1]]),v(s,t)},d=new Map,_=(n,r)=>{const t=!Ft.has(r)&&be.get(r);if(t){if((yt?"production":void 0)!=="production"&&d.has(n))throw new Error("prop listener already exists");if(u.size){const s=t[2](c(n));d.set(n,[t,s])}else d.set(n,[t])}},h=n=>{var r;const t=d.get(n);t&&(d.delete(n),(r=t[1])==null||r.call(t))},S=n=>(u.add(n),u.size===1&&d.forEach(([t,s],f)=>{if((yt?"production":void 0)!=="production"&&s)throw new Error("remove already exists");const m=t[2](c(f));d.set(f,[t,m])}),()=>{u.delete(n),u.size===0&&d.forEach(([t,s],f)=>{s&&(s(),d.set(f,[t]))})});let R=!0;const E=qn(()=>R,_,h,v),b=kn(e,E);vt.set(e,b);const y=[e,l,S];return be.set(b,y),Reflect.ownKeys(e).forEach(n=>{const r=Object.getOwnPropertyDescriptor(e,n);"value"in r&&r.writable&&(b[n]=e[n])}),R=!1,b}function Cn(e,a,g){const u=be.get(e);(yt?"production":void 0)!=="production"&&!u&&console.warn("Please use proxy object");let v;const o=[],l=u[2];let c=!1;const _=l(h=>{h&&o.push(h),v||(v=Promise.resolve().then(()=>{v=void 0,c&&a(o.splice(0))}))});return c=!0,()=>{c=!1,_()}}function An(e){const a=be.get(e);(yt?"production":void 0)!=="production"&&!a&&console.warn("Please use proxy object");const[g,u]=a;return Tn(g,u())}function Mn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Te={exports:{}},jt={},he={},ge={},kt={},It={},Tt={},Zt;function _t(){return Zt||(Zt=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 a{}e._CodeOrName=a,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class g extends a{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=g;class u extends a{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((s,f)=>`${s}${f}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((s,f)=>(f instanceof g&&(s[f.str]=(s[f.str]||0)+1),s),{})}}e._Code=u,e.nil=new u("");function v(r,...t){const s=[r[0]];let f=0;for(;f<t.length;)c(s,t[f]),s.push(r[++f]);return new u(s)}e._=v;const o=new u("+");function l(r,...t){const s=[E(r[0])];let f=0;for(;f<t.length;)s.push(o),c(s,t[f]),s.push(o,E(r[++f]));return d(s),new u(s)}e.str=l;function c(r,t){t instanceof u?r.push(...t._items):t instanceof g?r.push(t):r.push(S(t))}e.addCodeArg=c;function d(r){let t=1;for(;t<r.length-1;){if(r[t]===o){const s=_(r[t-1],r[t+1]);if(s!==void 0){r.splice(t-1,3,s);continue}r[t++]="+"}t++}}function _(r,t){if(t==='""')return r;if(r==='""')return t;if(typeof r=="string")return t instanceof g||r[r.length-1]!=='"'?void 0:typeof t!="string"?`${r.slice(0,-1)}${t}"`:t[0]==='"'?r.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(r instanceof g))return`"${r}${t.slice(1)}`}function h(r,t){return t.emptyStr()?r:r.emptyStr()?t:l`${r}${t}`}e.strConcat=h;function S(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:E(Array.isArray(r)?r.join(","):r)}function R(r){return new u(E(r))}e.stringify=R;function E(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=E;function b(r){return typeof r=="string"&&e.IDENTIFIER.test(r)?new u(`.${r}`):v`[${r}]`}e.getProperty=b;function y(r){if(typeof r=="string"&&e.IDENTIFIER.test(r))return new u(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}e.getEsmExportName=y;function n(r){return new u(r.toString())}e.regexpCode=n}(Tt)),Tt}var qt={},xt;function er(){return xt||(xt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const a=_t();class g extends Error{constructor(_){super(`CodeGen: "code" for ${_} not defined`),this.value=_.value}}var u;(function(d){d[d.Started=0]="Started",d[d.Completed=1]="Completed"})(u||(e.UsedValueState=u={})),e.varKinds={const:new a.Name("const"),let:new a.Name("let"),var:new a.Name("var")};class v{constructor({prefixes:_,parent:h}={}){this._names={},this._prefixes=_,this._parent=h}toName(_){return _ instanceof a.Name?_:this.name(_)}name(_){return new a.Name(this._newName(_))}_newName(_){const h=this._names[_]||this._nameGroup(_);return`${_}${h.index++}`}_nameGroup(_){var h,S;if(!((S=(h=this._parent)===null||h===void 0?void 0:h._prefixes)===null||S===void 0)&&S.has(_)||this._prefixes&&!this._prefixes.has(_))throw new Error(`CodeGen: prefix "${_}" is not allowed in this scope`);return this._names[_]={prefix:_,index:0}}}e.Scope=v;class o extends a.Name{constructor(_,h){super(h),this.prefix=_}setValue(_,{property:h,itemIndex:S}){this.value=_,this.scopePath=(0,a._)`.${new a.Name(h)}[${S}]`}}e.ValueScopeName=o;const l=(0,a._)`\n`;class c extends v{constructor(_){super(_),this._values={},this._scope=_.scope,this.opts={..._,_n:_.lines?l:a.nil}}get(){return this._scope}name(_){return new o(_,this._newName(_))}value(_,h){var S;if(h.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const R=this.toName(_),{prefix:E}=R,b=(S=h.key)!==null&&S!==void 0?S:h.ref;let y=this._values[E];if(y){const t=y.get(b);if(t)return t}else y=this._values[E]=new Map;y.set(b,R);const n=this._scope[E]||(this._scope[E]=[]),r=n.length;return n[r]=h.ref,R.setValue(h,{property:E,itemIndex:r}),R}getValue(_,h){const S=this._values[_];if(S)return S.get(h)}scopeRefs(_,h=this._values){return this._reduceValues(h,S=>{if(S.scopePath===void 0)throw new Error(`CodeGen: name "${S}" has no value`);return(0,a._)`${_}${S.scopePath}`})}scopeCode(_=this._values,h,S){return this._reduceValues(_,R=>{if(R.value===void 0)throw new Error(`CodeGen: name "${R}" has no value`);return R.value.code},h,S)}_reduceValues(_,h,S={},R){let E=a.nil;for(const b in _){const y=_[b];if(!y)continue;const n=S[b]=S[b]||new Map;y.forEach(r=>{if(n.has(r))return;n.set(r,u.Started);let t=h(r);if(t){const s=this.opts.es5?e.varKinds.var:e.varKinds.const;E=(0,a._)`${E}${s} ${r} = ${t};${this.opts._n}`}else if(t=R?.(r))E=(0,a._)`${E}${t}${this.opts._n}`;else throw new g(r);n.set(r,u.Completed)})}return E}}e.ValueScope=c}(qt)),qt}var tr;function J(){return tr||(tr=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 a=_t(),g=er();var u=_t();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return u.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return u.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return u.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}});var v=er();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return v.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return v.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return v.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return v.varKinds}}),e.operators={GT:new a._Code(">"),GTE:new a._Code(">="),LT:new a._Code("<"),LTE:new a._Code("<="),EQ:new a._Code("==="),NEQ:new a._Code("!=="),NOT:new a._Code("!"),OR:new a._Code("||"),AND:new a._Code("&&"),ADD:new a._Code("+")};class o{optimizeNodes(){return this}optimizeNames(i,w){return this}}class l extends o{constructor(i,w,I){super(),this.varKind=i,this.name=w,this.rhs=I}render({es5:i,_n:w}){const I=i?g.varKinds.var:this.varKind,V=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${V};`+w}optimizeNames(i,w){if(i[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,i,w)),this}get names(){return this.rhs instanceof a._CodeOrName?this.rhs.names:{}}}class c extends o{constructor(i,w,I){super(),this.lhs=i,this.rhs=w,this.sideEffects=I}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,w){if(!(this.lhs instanceof a.Name&&!i[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,i,w),this}get names(){const i=this.lhs instanceof a.Name?{}:{...this.lhs.names};return F(i,this.rhs)}}class d extends c{constructor(i,w,I,V){super(i,I,V),this.op=w}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}}class _ extends o{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}}class h extends o{constructor(i){super(),this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}}class S extends o{constructor(i){super(),this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}}class R extends o{constructor(i){super(),this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,w){return this.code=B(this.code,i,w),this}get names(){return this.code instanceof a._CodeOrName?this.code.names:{}}}class E extends o{constructor(i=[]){super(),this.nodes=i}render(i){return this.nodes.reduce((w,I)=>w+I.render(i),"")}optimizeNodes(){const{nodes:i}=this;let w=i.length;for(;w--;){const I=i[w].optimizeNodes();Array.isArray(I)?i.splice(w,1,...I):I?i[w]=I:i.splice(w,1)}return i.length>0?this:void 0}optimizeNames(i,w){const{nodes:I}=this;let V=I.length;for(;V--;){const L=I[V];L.optimizeNames(i,w)||(x(i,L.names),I.splice(V,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((i,w)=>K(i,w.names),{})}}class b extends E{render(i){return"{"+i._n+super.render(i)+"}"+i._n}}class y extends E{}class n extends b{}n.kind="else";class r extends b{constructor(i,w){super(w),this.condition=i}render(i){let w=`if(${this.condition})`+super.render(i);return this.else&&(w+="else "+this.else.render(i)),w}optimizeNodes(){super.optimizeNodes();const i=this.condition;if(i===!0)return this.nodes;let w=this.else;if(w){const I=w.optimizeNodes();w=this.else=Array.isArray(I)?new n(I):I}if(w)return i===!1?w instanceof r?w:w.nodes:this.nodes.length?this:new r(de(i),w instanceof r?[w]:w.nodes);if(!(i===!1||!this.nodes.length))return this}optimizeNames(i,w){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(i,w),!!(super.optimizeNames(i,w)||this.else))return this.condition=B(this.condition,i,w),this}get names(){const i=super.names;return F(i,this.condition),this.else&&K(i,this.else.names),i}}r.kind="if";class t extends b{}t.kind="for";class s extends t{constructor(i){super(),this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,w){if(super.optimizeNames(i,w))return this.iteration=B(this.iteration,i,w),this}get names(){return K(super.names,this.iteration.names)}}class f extends t{constructor(i,w,I,V){super(),this.varKind=i,this.name=w,this.from=I,this.to=V}render(i){const w=i.es5?g.varKinds.var:this.varKind,{name:I,from:V,to:L}=this;return`for(${w} ${I}=${V}; ${I}<${L}; ${I}++)`+super.render(i)}get names(){const i=F(super.names,this.from);return F(i,this.to)}}class m extends t{constructor(i,w,I,V){super(),this.loop=i,this.varKind=w,this.name=I,this.iterable=V}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,w){if(super.optimizeNames(i,w))return this.iterable=B(this.iterable,i,w),this}get names(){return K(super.names,this.iterable.names)}}class p extends b{constructor(i,w,I){super(),this.name=i,this.args=w,this.async=I}render(i){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(i)}}p.kind="func";class $ extends E{render(i){return"return "+super.render(i)}}$.kind="return";class k extends b{render(i){let w="try"+super.render(i);return this.catch&&(w+=this.catch.render(i)),this.finally&&(w+=this.finally.render(i)),w}optimizeNodes(){var i,w;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(w=this.finally)===null||w===void 0||w.optimizeNodes(),this}optimizeNames(i,w){var I,V;return super.optimizeNames(i,w),(I=this.catch)===null||I===void 0||I.optimizeNames(i,w),(V=this.finally)===null||V===void 0||V.optimizeNames(i,w),this}get names(){const i=super.names;return this.catch&&K(i,this.catch.names),this.finally&&K(i,this.finally.names),i}}class C extends b{constructor(i){super(),this.error=i}render(i){return`catch(${this.error})`+super.render(i)}}C.kind="catch";class D extends b{render(i){return"finally"+super.render(i)}}D.kind="finally";class z{constructor(i,w={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...w,_n:w.lines?`
2
- `:""},this._extScope=i,this._scope=new g.Scope({parent:i}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(i){return this._scope.name(i)}scopeName(i){return this._extScope.name(i)}scopeValue(i,w){const I=this._extScope.value(i,w);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(i,w){return this._extScope.getValue(i,w)}scopeRefs(i){return this._extScope.scopeRefs(i,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(i,w,I,V){const L=this._scope.toName(w);return I!==void 0&&V&&(this._constants[L.str]=I),this._leafNode(new l(i,L,I)),L}const(i,w,I){return this._def(g.varKinds.const,i,w,I)}let(i,w,I){return this._def(g.varKinds.let,i,w,I)}var(i,w,I){return this._def(g.varKinds.var,i,w,I)}assign(i,w,I){return this._leafNode(new c(i,w,I))}add(i,w){return this._leafNode(new d(i,e.operators.ADD,w))}code(i){return typeof i=="function"?i():i!==a.nil&&this._leafNode(new R(i)),this}object(...i){const w=["{"];for(const[I,V]of i)w.length>1&&w.push(","),w.push(I),(I!==V||this.opts.es5)&&(w.push(":"),(0,a.addCodeArg)(w,V));return w.push("}"),new a._Code(w)}if(i,w,I){if(this._blockNode(new r(i)),w&&I)this.code(w).else().code(I).endIf();else if(w)this.code(w).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(i){return this._elseNode(new r(i))}else(){return this._elseNode(new n)}endIf(){return this._endBlockNode(r,n)}_for(i,w){return this._blockNode(i),w&&this.code(w).endFor(),this}for(i,w){return this._for(new s(i),w)}forRange(i,w,I,V,L=this.opts.es5?g.varKinds.var:g.varKinds.let){const Q=this._scope.toName(i);return this._for(new f(L,Q,w,I),()=>V(Q))}forOf(i,w,I,V=g.varKinds.const){const L=this._scope.toName(i);if(this.opts.es5){const Q=w instanceof a.Name?w:this.var("_arr",w);return this.forRange("_i",0,(0,a._)`${Q}.length`,W=>{this.var(L,(0,a._)`${Q}[${W}]`),I(L)})}return this._for(new m("of",V,L,w),()=>I(L))}forIn(i,w,I,V=this.opts.es5?g.varKinds.var:g.varKinds.const){if(this.opts.ownProperties)return this.forOf(i,(0,a._)`Object.keys(${w})`,I);const L=this._scope.toName(i);return this._for(new m("in",V,L,w),()=>I(L))}endFor(){return this._endBlockNode(t)}label(i){return this._leafNode(new _(i))}break(i){return this._leafNode(new h(i))}return(i){const w=new $;if(this._blockNode(w),this.code(i),w.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode($)}try(i,w,I){if(!w&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const V=new k;if(this._blockNode(V),this.code(i),w){const L=this.name("e");this._currNode=V.catch=new C(L),w(L)}return I&&(this._currNode=V.finally=new D,this.code(I)),this._endBlockNode(C,D)}throw(i){return this._leafNode(new S(i))}block(i,w){return this._blockStarts.push(this._nodes.length),i&&this.code(i).endBlock(w),this}endBlock(i){const w=this._blockStarts.pop();if(w===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-w;if(I<0||i!==void 0&&I!==i)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${i} expected`);return this._nodes.length=w,this}func(i,w=a.nil,I,V){return this._blockNode(new p(i,w,I)),V&&this.code(V).endFunc(),this}endFunc(){return this._endBlockNode(p)}optimize(i=1){for(;i-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(i){return this._currNode.nodes.push(i),this}_blockNode(i){this._currNode.nodes.push(i),this._nodes.push(i)}_endBlockNode(i,w){const I=this._currNode;if(I instanceof i||w&&I instanceof w)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${w?`${i.kind}/${w.kind}`:i.kind}"`)}_elseNode(i){const w=this._currNode;if(!(w instanceof r))throw new Error('CodeGen: "else" without "if"');return this._currNode=w.else=i,this}get _root(){return this._nodes[0]}get _currNode(){const i=this._nodes;return i[i.length-1]}set _currNode(i){const w=this._nodes;w[w.length-1]=i}}e.CodeGen=z;function K(j,i){for(const w in i)j[w]=(j[w]||0)+(i[w]||0);return j}function F(j,i){return i instanceof a._CodeOrName?K(j,i.names):j}function B(j,i,w){if(j instanceof a.Name)return I(j);if(!V(j))return j;return new a._Code(j._items.reduce((L,Q)=>(Q instanceof a.Name&&(Q=I(Q)),Q instanceof a._Code?L.push(...Q._items):L.push(Q),L),[]));function I(L){const Q=w[L.str];return Q===void 0||i[L.str]!==1?L:(delete i[L.str],Q)}function V(L){return L instanceof a._Code&&L._items.some(Q=>Q instanceof a.Name&&i[Q.str]===1&&w[Q.str]!==void 0)}}function x(j,i){for(const w in i)j[w]=(j[w]||0)-(i[w]||0)}function de(j){return typeof j=="boolean"||typeof j=="number"||j===null?!j:(0,a._)`!${q(j)}`}e.not=de;const fe=N(e.operators.AND);function Z(...j){return j.reduce(fe)}e.and=Z;const ye=N(e.operators.OR);function A(...j){return j.reduce(ye)}e.or=A;function N(j){return(i,w)=>i===a.nil?w:w===a.nil?i:(0,a._)`${q(i)} ${j} ${q(w)}`}function q(j){return j instanceof a.Name?j:(0,a._)`(${j})`}}(It)),It}var H={},rr;function X(){if(rr)return H;rr=1,Object.defineProperty(H,"__esModule",{value:!0}),H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;const e=J(),a=_t();function g(m){const p={};for(const $ of m)p[$]=!0;return p}H.toHash=g;function u(m,p){return typeof p=="boolean"?p:Object.keys(p).length===0?!0:(v(m,p),!o(p,m.self.RULES.all))}H.alwaysValidSchema=u;function v(m,p=m.schema){const{opts:$,self:k}=m;if(!$.strictSchema||typeof p=="boolean")return;const C=k.RULES.keywords;for(const D in p)C[D]||f(m,`unknown keyword: "${D}"`)}H.checkUnknownRules=v;function o(m,p){if(typeof m=="boolean")return!m;for(const $ in m)if(p[$])return!0;return!1}H.schemaHasRules=o;function l(m,p){if(typeof m=="boolean")return!m;for(const $ in m)if($!=="$ref"&&p.all[$])return!0;return!1}H.schemaHasRulesButRef=l;function c({topSchemaRef:m,schemaPath:p},$,k,C){if(!C){if(typeof $=="number"||typeof $=="boolean")return $;if(typeof $=="string")return(0,e._)`${$}`}return(0,e._)`${m}${p}${(0,e.getProperty)(k)}`}H.schemaRefOrVal=c;function d(m){return S(decodeURIComponent(m))}H.unescapeFragment=d;function _(m){return encodeURIComponent(h(m))}H.escapeFragment=_;function h(m){return typeof m=="number"?`${m}`:m.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=h;function S(m){return m.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=S;function R(m,p){if(Array.isArray(m))for(const $ of m)p($);else p(m)}H.eachItem=R;function E({mergeNames:m,mergeToName:p,mergeValues:$,resultToName:k}){return(C,D,z,K)=>{const F=z===void 0?D:z instanceof e.Name?(D instanceof e.Name?m(C,D,z):p(C,D,z),z):D instanceof e.Name?(p(C,z,D),D):$(D,z);return K===e.Name&&!(F instanceof e.Name)?k(C,F):F}}H.mergeEvaluated={props:E({mergeNames:(m,p,$)=>m.if((0,e._)`${$} !== true && ${p} !== undefined`,()=>{m.if((0,e._)`${p} === true`,()=>m.assign($,!0),()=>m.assign($,(0,e._)`${$} || {}`).code((0,e._)`Object.assign(${$}, ${p})`))}),mergeToName:(m,p,$)=>m.if((0,e._)`${$} !== true`,()=>{p===!0?m.assign($,!0):(m.assign($,(0,e._)`${$} || {}`),y(m,$,p))}),mergeValues:(m,p)=>m===!0?!0:{...m,...p},resultToName:b}),items:E({mergeNames:(m,p,$)=>m.if((0,e._)`${$} !== true && ${p} !== undefined`,()=>m.assign($,(0,e._)`${p} === true ? true : ${$} > ${p} ? ${$} : ${p}`)),mergeToName:(m,p,$)=>m.if((0,e._)`${$} !== true`,()=>m.assign($,p===!0?!0:(0,e._)`${$} > ${p} ? ${$} : ${p}`)),mergeValues:(m,p)=>m===!0?!0:Math.max(m,p),resultToName:(m,p)=>m.var("items",p)})};function b(m,p){if(p===!0)return m.var("props",!0);const $=m.var("props",(0,e._)`{}`);return p!==void 0&&y(m,$,p),$}H.evaluatedPropsToName=b;function y(m,p,$){Object.keys($).forEach(k=>m.assign((0,e._)`${p}${(0,e.getProperty)(k)}`,!0))}H.setEvaluated=y;const n={};function r(m,p){return m.scopeValue("func",{ref:p,code:n[p.code]||(n[p.code]=new a._Code(p.code))})}H.useFunc=r;var t;(function(m){m[m.Num=0]="Num",m[m.Str=1]="Str"})(t||(H.Type=t={}));function s(m,p,$){if(m instanceof e.Name){const k=p===t.Num;return $?k?(0,e._)`"[" + ${m} + "]"`:(0,e._)`"['" + ${m} + "']"`:k?(0,e._)`"/" + ${m}`:(0,e._)`"/" + ${m}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return $?(0,e.getProperty)(m).toString():"/"+h(m)}H.getErrorPath=s;function f(m,p,$=m.opts.strictSchema){if($){if(p=`strict mode: ${p}`,$===!0)throw new Error(p);m.self.logger.warn(p)}}return H.checkStrictMode=f,H}var qe={},nr;function _e(){if(nr)return qe;nr=1,Object.defineProperty(qe,"__esModule",{value:!0});const e=J(),a={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 qe.default=a,qe}var sr;function $t(){return sr||(sr=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 a=J(),g=X(),u=_e();e.keywordError={message:({keyword:n})=>(0,a.str)`must pass "${n}" keyword validation`},e.keyword$DataError={message:({keyword:n,schemaType:r})=>r?(0,a.str)`"${n}" keyword must be ${r} ($data)`:(0,a.str)`"${n}" keyword is invalid ($data)`};function v(n,r=e.keywordError,t,s){const{it:f}=n,{gen:m,compositeRule:p,allErrors:$}=f,k=S(n,r,t);s??(p||$)?d(m,k):_(f,(0,a._)`[${k}]`)}e.reportError=v;function o(n,r=e.keywordError,t){const{it:s}=n,{gen:f,compositeRule:m,allErrors:p}=s,$=S(n,r,t);d(f,$),m||p||_(s,u.default.vErrors)}e.reportExtraError=o;function l(n,r){n.assign(u.default.errors,r),n.if((0,a._)`${u.default.vErrors} !== null`,()=>n.if(r,()=>n.assign((0,a._)`${u.default.vErrors}.length`,r),()=>n.assign(u.default.vErrors,null)))}e.resetErrorsCount=l;function c({gen:n,keyword:r,schemaValue:t,data:s,errsCount:f,it:m}){if(f===void 0)throw new Error("ajv implementation error");const p=n.name("err");n.forRange("i",f,u.default.errors,$=>{n.const(p,(0,a._)`${u.default.vErrors}[${$}]`),n.if((0,a._)`${p}.instancePath === undefined`,()=>n.assign((0,a._)`${p}.instancePath`,(0,a.strConcat)(u.default.instancePath,m.errorPath))),n.assign((0,a._)`${p}.schemaPath`,(0,a.str)`${m.errSchemaPath}/${r}`),m.opts.verbose&&(n.assign((0,a._)`${p}.schema`,t),n.assign((0,a._)`${p}.data`,s))})}e.extendErrors=c;function d(n,r){const t=n.const("err",r);n.if((0,a._)`${u.default.vErrors} === null`,()=>n.assign(u.default.vErrors,(0,a._)`[${t}]`),(0,a._)`${u.default.vErrors}.push(${t})`),n.code((0,a._)`${u.default.errors}++`)}function _(n,r){const{gen:t,validateName:s,schemaEnv:f}=n;f.$async?t.throw((0,a._)`new ${n.ValidationError}(${r})`):(t.assign((0,a._)`${s}.errors`,r),t.return(!1))}const h={keyword:new a.Name("keyword"),schemaPath:new a.Name("schemaPath"),params:new a.Name("params"),propertyName:new a.Name("propertyName"),message:new a.Name("message"),schema:new a.Name("schema"),parentSchema:new a.Name("parentSchema")};function S(n,r,t){const{createErrors:s}=n.it;return s===!1?(0,a._)`{}`:R(n,r,t)}function R(n,r,t={}){const{gen:s,it:f}=n,m=[E(f,t),b(n,t)];return y(n,r,m),s.object(...m)}function E({errorPath:n},{instancePath:r}){const t=r?(0,a.str)`${n}${(0,g.getErrorPath)(r,g.Type.Str)}`:n;return[u.default.instancePath,(0,a.strConcat)(u.default.instancePath,t)]}function b({keyword:n,it:{errSchemaPath:r}},{schemaPath:t,parentSchema:s}){let f=s?r:(0,a.str)`${r}/${n}`;return t&&(f=(0,a.str)`${f}${(0,g.getErrorPath)(t,g.Type.Str)}`),[h.schemaPath,f]}function y(n,{params:r,message:t},s){const{keyword:f,data:m,schemaValue:p,it:$}=n,{opts:k,propertyName:C,topSchemaRef:D,schemaPath:z}=$;s.push([h.keyword,f],[h.params,typeof r=="function"?r(n):r||(0,a._)`{}`]),k.messages&&s.push([h.message,typeof t=="function"?t(n):t]),k.verbose&&s.push([h.schema,p],[h.parentSchema,(0,a._)`${D}${z}`],[u.default.data,m]),C&&s.push([h.propertyName,C])}}(kt)),kt}var ar;function Dn(){if(ar)return ge;ar=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.boolOrEmptySchema=ge.topBoolOrEmptySchema=void 0;const e=$t(),a=J(),g=_e(),u={message:"boolean schema is false"};function v(c){const{gen:d,schema:_,validateName:h}=c;_===!1?l(c,!1):typeof _=="object"&&_.$async===!0?d.return(g.default.data):(d.assign((0,a._)`${h}.errors`,null),d.return(!0))}ge.topBoolOrEmptySchema=v;function o(c,d){const{gen:_,schema:h}=c;h===!1?(_.var(d,!1),l(c)):_.var(d,!0)}ge.boolOrEmptySchema=o;function l(c,d){const{gen:_,data:h}=c,S={gen:_,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,e.reportError)(S,u,void 0,d)}return ge}var re={},$e={},or;function yn(){if(or)return $e;or=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.getRules=$e.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],a=new Set(e);function g(v){return typeof v=="string"&&a.has(v)}$e.isJSONType=g;function u(){const v={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...v,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},v.number,v.string,v.array,v.object],post:{rules:[]},all:{},keywords:{}}}return $e.getRules=u,$e}var pe={},ir;function vn(){if(ir)return pe;ir=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.shouldUseRule=pe.shouldUseGroup=pe.schemaHasRulesForType=void 0;function e({schema:u,self:v},o){const l=v.RULES.types[o];return l&&l!==!0&&a(u,l)}pe.schemaHasRulesForType=e;function a(u,v){return v.rules.some(o=>g(u,o))}pe.shouldUseGroup=a;function g(u,v){var o;return u[v.keyword]!==void 0||((o=v.definition.implements)===null||o===void 0?void 0:o.some(l=>u[l]!==void 0))}return pe.shouldUseRule=g,pe}var cr;function gt(){if(cr)return re;cr=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=yn(),a=vn(),g=$t(),u=J(),v=X();var o;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(o||(re.DataType=o={}));function l(t){const s=c(t.type);if(s.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!s.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&s.push("null")}return s}re.getSchemaTypes=l;function c(t){const s=Array.isArray(t)?t:t?[t]:[];if(s.every(e.isJSONType))return s;throw new Error("type must be JSONType or JSONType[]: "+s.join(","))}re.getJSONTypes=c;function d(t,s){const{gen:f,data:m,opts:p}=t,$=h(s,p.coerceTypes),k=s.length>0&&!($.length===0&&s.length===1&&(0,a.schemaHasRulesForType)(t,s[0]));if(k){const C=b(s,m,p.strictNumbers,o.Wrong);f.if(C,()=>{$.length?S(t,s,$):n(t)})}return k}re.coerceAndCheckDataType=d;const _=new Set(["string","number","integer","boolean","null"]);function h(t,s){return s?t.filter(f=>_.has(f)||s==="array"&&f==="array"):[]}function S(t,s,f){const{gen:m,data:p,opts:$}=t,k=m.let("dataType",(0,u._)`typeof ${p}`),C=m.let("coerced",(0,u._)`undefined`);$.coerceTypes==="array"&&m.if((0,u._)`${k} == 'object' && Array.isArray(${p}) && ${p}.length == 1`,()=>m.assign(p,(0,u._)`${p}[0]`).assign(k,(0,u._)`typeof ${p}`).if(b(s,p,$.strictNumbers),()=>m.assign(C,p))),m.if((0,u._)`${C} !== undefined`);for(const z of f)(_.has(z)||z==="array"&&$.coerceTypes==="array")&&D(z);m.else(),n(t),m.endIf(),m.if((0,u._)`${C} !== undefined`,()=>{m.assign(p,C),R(t,C)});function D(z){switch(z){case"string":m.elseIf((0,u._)`${k} == "number" || ${k} == "boolean"`).assign(C,(0,u._)`"" + ${p}`).elseIf((0,u._)`${p} === null`).assign(C,(0,u._)`""`);return;case"number":m.elseIf((0,u._)`${k} == "boolean" || ${p} === null
3
- || (${k} == "string" && ${p} && ${p} == +${p})`).assign(C,(0,u._)`+${p}`);return;case"integer":m.elseIf((0,u._)`${k} === "boolean" || ${p} === null
4
- || (${k} === "string" && ${p} && ${p} == +${p} && !(${p} % 1))`).assign(C,(0,u._)`+${p}`);return;case"boolean":m.elseIf((0,u._)`${p} === "false" || ${p} === 0 || ${p} === null`).assign(C,!1).elseIf((0,u._)`${p} === "true" || ${p} === 1`).assign(C,!0);return;case"null":m.elseIf((0,u._)`${p} === "" || ${p} === 0 || ${p} === false`),m.assign(C,null);return;case"array":m.elseIf((0,u._)`${k} === "string" || ${k} === "number"
5
- || ${k} === "boolean" || ${p} === null`).assign(C,(0,u._)`[${p}]`)}}}function R({gen:t,parentData:s,parentDataProperty:f},m){t.if((0,u._)`${s} !== undefined`,()=>t.assign((0,u._)`${s}[${f}]`,m))}function E(t,s,f,m=o.Correct){const p=m===o.Correct?u.operators.EQ:u.operators.NEQ;let $;switch(t){case"null":return(0,u._)`${s} ${p} null`;case"array":$=(0,u._)`Array.isArray(${s})`;break;case"object":$=(0,u._)`${s} && typeof ${s} == "object" && !Array.isArray(${s})`;break;case"integer":$=k((0,u._)`!(${s} % 1) && !isNaN(${s})`);break;case"number":$=k();break;default:return(0,u._)`typeof ${s} ${p} ${t}`}return m===o.Correct?$:(0,u.not)($);function k(C=u.nil){return(0,u.and)((0,u._)`typeof ${s} == "number"`,C,f?(0,u._)`isFinite(${s})`:u.nil)}}re.checkDataType=E;function b(t,s,f,m){if(t.length===1)return E(t[0],s,f,m);let p;const $=(0,v.toHash)(t);if($.array&&$.object){const k=(0,u._)`typeof ${s} != "object"`;p=$.null?k:(0,u._)`!${s} || ${k}`,delete $.null,delete $.array,delete $.object}else p=u.nil;$.number&&delete $.integer;for(const k in $)p=(0,u.and)(p,E(k,s,f,m));return p}re.checkDataTypes=b;const y={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:s})=>typeof t=="string"?(0,u._)`{type: ${t}}`:(0,u._)`{type: ${s}}`};function n(t){const s=r(t);(0,g.reportError)(s,y)}re.reportTypeError=n;function r(t){const{gen:s,data:f,schema:m}=t,p=(0,v.schemaRefOrVal)(t,m,"type");return{gen:s,keyword:"type",data:f,schema:m.type,schemaCode:p,schemaValue:p,parentSchema:m,params:{},it:t}}return re}var Oe={},ur;function Vn(){if(ur)return Oe;ur=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.assignDefaults=void 0;const e=J(),a=X();function g(v,o){const{properties:l,items:c}=v.schema;if(o==="object"&&l)for(const d in l)u(v,d,l[d].default);else o==="array"&&Array.isArray(c)&&c.forEach((d,_)=>u(v,_,d.default))}Oe.assignDefaults=g;function u(v,o,l){const{gen:c,compositeRule:d,data:_,opts:h}=v;if(l===void 0)return;const S=(0,e._)`${_}${(0,e.getProperty)(o)}`;if(d){(0,a.checkStrictMode)(v,`default is ignored for: ${S}`);return}let R=(0,e._)`${S} === undefined`;h.useDefaults==="empty"&&(R=(0,e._)`${R} || ${S} === null || ${S} === ""`),c.if(R,(0,e._)`${S} = ${(0,e.stringify)(l)}`)}return Oe}var ue={},Y={},lr;function le(){if(lr)return Y;lr=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.validateUnion=Y.validateArray=Y.usePattern=Y.callValidateCode=Y.schemaProperties=Y.allSchemaProperties=Y.noPropertyInData=Y.propertyInData=Y.isOwnProperty=Y.hasPropFunc=Y.reportMissingProp=Y.checkMissingProp=Y.checkReportMissingProp=void 0;const e=J(),a=X(),g=_e(),u=X();function v(t,s){const{gen:f,data:m,it:p}=t;f.if(h(f,m,s,p.opts.ownProperties),()=>{t.setParams({missingProperty:(0,e._)`${s}`},!0),t.error()})}Y.checkReportMissingProp=v;function o({gen:t,data:s,it:{opts:f}},m,p){return(0,e.or)(...m.map($=>(0,e.and)(h(t,s,$,f.ownProperties),(0,e._)`${p} = ${$}`)))}Y.checkMissingProp=o;function l(t,s){t.setParams({missingProperty:s},!0),t.error()}Y.reportMissingProp=l;function c(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Y.hasPropFunc=c;function d(t,s,f){return(0,e._)`${c(t)}.call(${s}, ${f})`}Y.isOwnProperty=d;function _(t,s,f,m){const p=(0,e._)`${s}${(0,e.getProperty)(f)} !== undefined`;return m?(0,e._)`${p} && ${d(t,s,f)}`:p}Y.propertyInData=_;function h(t,s,f,m){const p=(0,e._)`${s}${(0,e.getProperty)(f)} === undefined`;return m?(0,e.or)(p,(0,e.not)(d(t,s,f))):p}Y.noPropertyInData=h;function S(t){return t?Object.keys(t).filter(s=>s!=="__proto__"):[]}Y.allSchemaProperties=S;function R(t,s){return S(s).filter(f=>!(0,a.alwaysValidSchema)(t,s[f]))}Y.schemaProperties=R;function E({schemaCode:t,data:s,it:{gen:f,topSchemaRef:m,schemaPath:p,errorPath:$},it:k},C,D,z){const K=z?(0,e._)`${t}, ${s}, ${m}${p}`:s,F=[[g.default.instancePath,(0,e.strConcat)(g.default.instancePath,$)],[g.default.parentData,k.parentData],[g.default.parentDataProperty,k.parentDataProperty],[g.default.rootData,g.default.rootData]];k.opts.dynamicRef&&F.push([g.default.dynamicAnchors,g.default.dynamicAnchors]);const B=(0,e._)`${K}, ${f.object(...F)}`;return D!==e.nil?(0,e._)`${C}.call(${D}, ${B})`:(0,e._)`${C}(${B})`}Y.callValidateCode=E;const b=(0,e._)`new RegExp`;function y({gen:t,it:{opts:s}},f){const m=s.unicodeRegExp?"u":"",{regExp:p}=s.code,$=p(f,m);return t.scopeValue("pattern",{key:$.toString(),ref:$,code:(0,e._)`${p.code==="new RegExp"?b:(0,u.useFunc)(t,p)}(${f}, ${m})`})}Y.usePattern=y;function n(t){const{gen:s,data:f,keyword:m,it:p}=t,$=s.name("valid");if(p.allErrors){const C=s.let("valid",!0);return k(()=>s.assign(C,!1)),C}return s.var($,!0),k(()=>s.break()),$;function k(C){const D=s.const("len",(0,e._)`${f}.length`);s.forRange("i",0,D,z=>{t.subschema({keyword:m,dataProp:z,dataPropType:a.Type.Num},$),s.if((0,e.not)($),C)})}}Y.validateArray=n;function r(t){const{gen:s,schema:f,keyword:m,it:p}=t;if(!Array.isArray(f))throw new Error("ajv implementation error");if(f.some(D=>(0,a.alwaysValidSchema)(p,D))&&!p.opts.unevaluated)return;const k=s.let("valid",!1),C=s.name("_valid");s.block(()=>f.forEach((D,z)=>{const K=t.subschema({keyword:m,schemaProp:z,compositeRule:!0},C);s.assign(k,(0,e._)`${k} || ${C}`),t.mergeValidEvaluated(K,C)||s.if((0,e.not)(k))})),t.result(k,()=>t.reset(),()=>t.error(!0))}return Y.validateUnion=r,Y}var dr;function zn(){if(dr)return ue;dr=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.validateKeywordUsage=ue.validSchemaType=ue.funcKeywordCode=ue.macroKeywordCode=void 0;const e=J(),a=_e(),g=le(),u=$t();function v(R,E){const{gen:b,keyword:y,schema:n,parentSchema:r,it:t}=R,s=E.macro.call(t.self,n,r,t),f=_(b,y,s);t.opts.validateSchema!==!1&&t.self.validateSchema(s,!0);const m=b.name("valid");R.subschema({schema:s,schemaPath:e.nil,errSchemaPath:`${t.errSchemaPath}/${y}`,topSchemaRef:f,compositeRule:!0},m),R.pass(m,()=>R.error(!0))}ue.macroKeywordCode=v;function o(R,E){var b;const{gen:y,keyword:n,schema:r,parentSchema:t,$data:s,it:f}=R;d(f,E);const m=!s&&E.compile?E.compile.call(f.self,r,t,f):E.validate,p=_(y,n,m),$=y.let("valid");R.block$data($,k),R.ok((b=E.valid)!==null&&b!==void 0?b:$);function k(){if(E.errors===!1)z(),E.modifying&&l(R),K(()=>R.error());else{const F=E.async?C():D();E.modifying&&l(R),K(()=>c(R,F))}}function C(){const F=y.let("ruleErrs",null);return y.try(()=>z((0,e._)`await `),B=>y.assign($,!1).if((0,e._)`${B} instanceof ${f.ValidationError}`,()=>y.assign(F,(0,e._)`${B}.errors`),()=>y.throw(B))),F}function D(){const F=(0,e._)`${p}.errors`;return y.assign(F,null),z(e.nil),F}function z(F=E.async?(0,e._)`await `:e.nil){const B=f.opts.passContext?a.default.this:a.default.self,x=!("compile"in E&&!s||E.schema===!1);y.assign($,(0,e._)`${F}${(0,g.callValidateCode)(R,p,B,x)}`,E.modifying)}function K(F){var B;y.if((0,e.not)((B=E.valid)!==null&&B!==void 0?B:$),F)}}ue.funcKeywordCode=o;function l(R){const{gen:E,data:b,it:y}=R;E.if(y.parentData,()=>E.assign(b,(0,e._)`${y.parentData}[${y.parentDataProperty}]`))}function c(R,E){const{gen:b}=R;b.if((0,e._)`Array.isArray(${E})`,()=>{b.assign(a.default.vErrors,(0,e._)`${a.default.vErrors} === null ? ${E} : ${a.default.vErrors}.concat(${E})`).assign(a.default.errors,(0,e._)`${a.default.vErrors}.length`),(0,u.extendErrors)(R)},()=>R.error())}function d({schemaEnv:R},E){if(E.async&&!R.$async)throw new Error("async keyword in sync schema")}function _(R,E,b){if(b===void 0)throw new Error(`keyword "${E}" failed to compile`);return R.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function h(R,E,b=!1){return!E.length||E.some(y=>y==="array"?Array.isArray(R):y==="object"?R&&typeof R=="object"&&!Array.isArray(R):typeof R==y||b&&typeof R>"u")}ue.validSchemaType=h;function S({schema:R,opts:E,self:b,errSchemaPath:y},n,r){if(Array.isArray(n.keyword)?!n.keyword.includes(r):n.keyword!==r)throw new Error("ajv implementation error");const t=n.dependencies;if(t?.some(s=>!Object.prototype.hasOwnProperty.call(R,s)))throw new Error(`parent schema must have dependencies of ${r}: ${t.join(",")}`);if(n.validateSchema&&!n.validateSchema(R[r])){const f=`keyword "${r}" value is invalid at path "${y}": `+b.errorsText(n.validateSchema.errors);if(E.validateSchema==="log")b.logger.error(f);else throw new Error(f)}}return ue.validateKeywordUsage=S,ue}var me={},fr;function Un(){if(fr)return me;fr=1,Object.defineProperty(me,"__esModule",{value:!0}),me.extendSubschemaMode=me.extendSubschemaData=me.getSubschema=void 0;const e=J(),a=X();function g(o,{keyword:l,schemaProp:c,schema:d,schemaPath:_,errSchemaPath:h,topSchemaRef:S}){if(l!==void 0&&d!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){const R=o.schema[l];return c===void 0?{schema:R,schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${o.errSchemaPath}/${l}`}:{schema:R[c],schemaPath:(0,e._)`${o.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(c)}`,errSchemaPath:`${o.errSchemaPath}/${l}/${(0,a.escapeFragment)(c)}`}}if(d!==void 0){if(_===void 0||h===void 0||S===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:_,topSchemaRef:S,errSchemaPath:h}}throw new Error('either "keyword" or "schema" must be passed')}me.getSubschema=g;function u(o,l,{dataProp:c,dataPropType:d,data:_,dataTypes:h,propertyName:S}){if(_!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:R}=l;if(c!==void 0){const{errorPath:b,dataPathArr:y,opts:n}=l,r=R.let("data",(0,e._)`${l.data}${(0,e.getProperty)(c)}`,!0);E(r),o.errorPath=(0,e.str)`${b}${(0,a.getErrorPath)(c,d,n.jsPropertySyntax)}`,o.parentDataProperty=(0,e._)`${c}`,o.dataPathArr=[...y,o.parentDataProperty]}if(_!==void 0){const b=_ instanceof e.Name?_:R.let("data",_,!0);E(b),S!==void 0&&(o.propertyName=S)}h&&(o.dataTypes=h);function E(b){o.data=b,o.dataLevel=l.dataLevel+1,o.dataTypes=[],l.definedProperties=new Set,o.parentData=l.data,o.dataNames=[...l.dataNames,b]}}me.extendSubschemaData=u;function v(o,{jtdDiscriminator:l,jtdMetadata:c,compositeRule:d,createErrors:_,allErrors:h}){d!==void 0&&(o.compositeRule=d),_!==void 0&&(o.createErrors=_),h!==void 0&&(o.allErrors=h),o.jtdDiscriminator=l,o.jtdMetadata=c}return me.extendSubschemaMode=v,me}var ne={},Ct,hr;function _n(){return hr||(hr=1,Ct=function e(a,g){if(a===g)return!0;if(a&&g&&typeof a=="object"&&typeof g=="object"){if(a.constructor!==g.constructor)return!1;var u,v,o;if(Array.isArray(a)){if(u=a.length,u!=g.length)return!1;for(v=u;v--!==0;)if(!e(a[v],g[v]))return!1;return!0}if(a.constructor===RegExp)return a.source===g.source&&a.flags===g.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===g.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===g.toString();if(o=Object.keys(a),u=o.length,u!==Object.keys(g).length)return!1;for(v=u;v--!==0;)if(!Object.prototype.hasOwnProperty.call(g,o[v]))return!1;for(v=u;v--!==0;){var l=o[v];if(!e(a[l],g[l]))return!1}return!0}return a!==a&&g!==g}),Ct}var At={exports:{}},pr;function Ln(){if(pr)return At.exports;pr=1;var e=At.exports=function(u,v,o){typeof v=="function"&&(o=v,v={}),o=v.cb||o;var l=typeof o=="function"?o:o.pre||function(){},c=o.post||function(){};a(v,l,c,u,"",u)};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 a(u,v,o,l,c,d,_,h,S,R){if(l&&typeof l=="object"&&!Array.isArray(l)){v(l,c,d,_,h,S,R);for(var E in l){var b=l[E];if(Array.isArray(b)){if(E in e.arrayKeywords)for(var y=0;y<b.length;y++)a(u,v,o,b[y],c+"/"+E+"/"+y,d,c,E,l,y)}else if(E in e.propsKeywords){if(b&&typeof b=="object")for(var n in b)a(u,v,o,b[n],c+"/"+E+"/"+g(n),d,c,E,l,n)}else(E in e.keywords||u.allKeys&&!(E in e.skipKeywords))&&a(u,v,o,b,c+"/"+E,d,c,E,l)}o(l,c,d,_,h,S,R)}}function g(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}return At.exports}var mr;function wt(){if(mr)return ne;mr=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.getSchemaRefs=ne.resolveUrl=ne.normalizeId=ne._getFullPath=ne.getFullPath=ne.inlineRef=void 0;const e=X(),a=_n(),g=Ln(),u=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function v(y,n=!0){return typeof y=="boolean"?!0:n===!0?!l(y):n?c(y)<=n:!1}ne.inlineRef=v;const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(y){for(const n in y){if(o.has(n))return!0;const r=y[n];if(Array.isArray(r)&&r.some(l)||typeof r=="object"&&l(r))return!0}return!1}function c(y){let n=0;for(const r in y){if(r==="$ref")return 1/0;if(n++,!u.has(r)&&(typeof y[r]=="object"&&(0,e.eachItem)(y[r],t=>n+=c(t)),n===1/0))return 1/0}return n}function d(y,n="",r){r!==!1&&(n=S(n));const t=y.parse(n);return _(y,t)}ne.getFullPath=d;function _(y,n){return y.serialize(n).split("#")[0]+"#"}ne._getFullPath=_;const h=/#\/?$/;function S(y){return y?y.replace(h,""):""}ne.normalizeId=S;function R(y,n,r){return r=S(r),y.resolve(n,r)}ne.resolveUrl=R;const E=/^[a-z_][-a-z0-9._]*$/i;function b(y,n){if(typeof y=="boolean")return{};const{schemaId:r,uriResolver:t}=this.opts,s=S(y[r]||n),f={"":s},m=d(t,s,!1),p={},$=new Set;return g(y,{allKeys:!0},(D,z,K,F)=>{if(F===void 0)return;const B=m+z;let x=f[F];typeof D[r]=="string"&&(x=de.call(this,D[r])),fe.call(this,D.$anchor),fe.call(this,D.$dynamicAnchor),f[z]=x;function de(Z){const ye=this.opts.uriResolver.resolve;if(Z=S(x?ye(x,Z):Z),$.has(Z))throw C(Z);$.add(Z);let A=this.refs[Z];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?k(D,A.schema,Z):Z!==S(B)&&(Z[0]==="#"?(k(D,p[Z],Z),p[Z]=D):this.refs[Z]=B),Z}function fe(Z){if(typeof Z=="string"){if(!E.test(Z))throw new Error(`invalid anchor "${Z}"`);de.call(this,`#${Z}`)}}}),p;function k(D,z,K){if(z!==void 0&&!a(D,z))throw C(K)}function C(D){return new Error(`reference "${D}" resolves to more than one schema`)}}return ne.getSchemaRefs=b,ne}var yr;function bt(){if(yr)return he;yr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getData=he.KeywordCxt=he.validateFunctionCode=void 0;const e=Dn(),a=gt(),g=vn(),u=gt(),v=Vn(),o=zn(),l=Un(),c=J(),d=_e(),_=wt(),h=X(),S=$t();function R(P){if(m(P)&&($(P),f(P))){n(P);return}E(P,()=>(0,e.topBoolOrEmptySchema)(P))}he.validateFunctionCode=R;function E({gen:P,validateName:O,schema:T,schemaEnv:M,opts:U},G){U.code.es5?P.func(O,(0,c._)`${d.default.data}, ${d.default.valCxt}`,M.$async,()=>{P.code((0,c._)`"use strict"; ${t(T,U)}`),y(P,U),P.code(G)}):P.func(O,(0,c._)`${d.default.data}, ${b(U)}`,M.$async,()=>P.code(t(T,U)).code(G))}function b(P){return(0,c._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${P.dynamicRef?(0,c._)`, ${d.default.dynamicAnchors}={}`:c.nil}}={}`}function y(P,O){P.if(d.default.valCxt,()=>{P.var(d.default.instancePath,(0,c._)`${d.default.valCxt}.${d.default.instancePath}`),P.var(d.default.parentData,(0,c._)`${d.default.valCxt}.${d.default.parentData}`),P.var(d.default.parentDataProperty,(0,c._)`${d.default.valCxt}.${d.default.parentDataProperty}`),P.var(d.default.rootData,(0,c._)`${d.default.valCxt}.${d.default.rootData}`),O.dynamicRef&&P.var(d.default.dynamicAnchors,(0,c._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{P.var(d.default.instancePath,(0,c._)`""`),P.var(d.default.parentData,(0,c._)`undefined`),P.var(d.default.parentDataProperty,(0,c._)`undefined`),P.var(d.default.rootData,d.default.data),O.dynamicRef&&P.var(d.default.dynamicAnchors,(0,c._)`{}`)})}function n(P){const{schema:O,opts:T,gen:M}=P;E(P,()=>{T.$comment&&O.$comment&&F(P),D(P),M.let(d.default.vErrors,null),M.let(d.default.errors,0),T.unevaluated&&r(P),k(P),B(P)})}function r(P){const{gen:O,validateName:T}=P;P.evaluated=O.const("evaluated",(0,c._)`${T}.evaluated`),O.if((0,c._)`${P.evaluated}.dynamicProps`,()=>O.assign((0,c._)`${P.evaluated}.props`,(0,c._)`undefined`)),O.if((0,c._)`${P.evaluated}.dynamicItems`,()=>O.assign((0,c._)`${P.evaluated}.items`,(0,c._)`undefined`))}function t(P,O){const T=typeof P=="object"&&P[O.schemaId];return T&&(O.code.source||O.code.process)?(0,c._)`/*# sourceURL=${T} */`:c.nil}function s(P,O){if(m(P)&&($(P),f(P))){p(P,O);return}(0,e.boolOrEmptySchema)(P,O)}function f({schema:P,self:O}){if(typeof P=="boolean")return!P;for(const T in P)if(O.RULES.all[T])return!0;return!1}function m(P){return typeof P.schema!="boolean"}function p(P,O){const{schema:T,gen:M,opts:U}=P;U.$comment&&T.$comment&&F(P),z(P),K(P);const G=M.const("_errs",d.default.errors);k(P,G),M.var(O,(0,c._)`${G} === ${d.default.errors}`)}function $(P){(0,h.checkUnknownRules)(P),C(P)}function k(P,O){if(P.opts.jtd)return de(P,[],!1,O);const T=(0,a.getSchemaTypes)(P.schema),M=(0,a.coerceAndCheckDataType)(P,T);de(P,T,!M,O)}function C(P){const{schema:O,errSchemaPath:T,opts:M,self:U}=P;O.$ref&&M.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(O,U.RULES)&&U.logger.warn(`$ref: keywords ignored in schema at path "${T}"`)}function D(P){const{schema:O,opts:T}=P;O.default!==void 0&&T.useDefaults&&T.strictSchema&&(0,h.checkStrictMode)(P,"default is ignored in the schema root")}function z(P){const O=P.schema[P.opts.schemaId];O&&(P.baseId=(0,_.resolveUrl)(P.opts.uriResolver,P.baseId,O))}function K(P){if(P.schema.$async&&!P.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:P,schemaEnv:O,schema:T,errSchemaPath:M,opts:U}){const G=T.$comment;if(U.$comment===!0)P.code((0,c._)`${d.default.self}.logger.log(${G})`);else if(typeof U.$comment=="function"){const ee=(0,c.str)`${M}/$comment`,ce=P.scopeValue("root",{ref:O.root});P.code((0,c._)`${d.default.self}.opts.$comment(${G}, ${ee}, ${ce}.schema)`)}}function B(P){const{gen:O,schemaEnv:T,validateName:M,ValidationError:U,opts:G}=P;T.$async?O.if((0,c._)`${d.default.errors} === 0`,()=>O.return(d.default.data),()=>O.throw((0,c._)`new ${U}(${d.default.vErrors})`)):(O.assign((0,c._)`${M}.errors`,d.default.vErrors),G.unevaluated&&x(P),O.return((0,c._)`${d.default.errors} === 0`))}function x({gen:P,evaluated:O,props:T,items:M}){T instanceof c.Name&&P.assign((0,c._)`${O}.props`,T),M instanceof c.Name&&P.assign((0,c._)`${O}.items`,M)}function de(P,O,T,M){const{gen:U,schema:G,data:ee,allErrors:ce,opts:se,self:ae}=P,{RULES:te}=ae;if(G.$ref&&(se.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(G,te))){U.block(()=>V(P,"$ref",te.all.$ref.definition));return}se.jtd||Z(P,O),U.block(()=>{for(const ie of te.rules)Ee(ie);Ee(te.post)});function Ee(ie){(0,g.shouldUseGroup)(G,ie)&&(ie.type?(U.if((0,u.checkDataType)(ie.type,ee,se.strictNumbers)),fe(P,ie),O.length===1&&O[0]===ie.type&&T&&(U.else(),(0,u.reportTypeError)(P)),U.endIf()):fe(P,ie),ce||U.if((0,c._)`${d.default.errors} === ${M||0}`))}}function fe(P,O){const{gen:T,schema:M,opts:{useDefaults:U}}=P;U&&(0,v.assignDefaults)(P,O.type),T.block(()=>{for(const G of O.rules)(0,g.shouldUseRule)(M,G)&&V(P,G.keyword,G.definition,O.type)})}function Z(P,O){P.schemaEnv.meta||!P.opts.strictTypes||(ye(P,O),P.opts.allowUnionTypes||A(P,O),N(P,P.dataTypes))}function ye(P,O){if(O.length){if(!P.dataTypes.length){P.dataTypes=O;return}O.forEach(T=>{j(P.dataTypes,T)||w(P,`type "${T}" not allowed by context "${P.dataTypes.join(",")}"`)}),i(P,O)}}function A(P,O){O.length>1&&!(O.length===2&&O.includes("null"))&&w(P,"use allowUnionTypes to allow union type keyword")}function N(P,O){const T=P.self.RULES.all;for(const M in T){const U=T[M];if(typeof U=="object"&&(0,g.shouldUseRule)(P.schema,U)){const{type:G}=U.definition;G.length&&!G.some(ee=>q(O,ee))&&w(P,`missing type "${G.join(",")}" for keyword "${M}"`)}}}function q(P,O){return P.includes(O)||O==="number"&&P.includes("integer")}function j(P,O){return P.includes(O)||O==="integer"&&P.includes("number")}function i(P,O){const T=[];for(const M of P.dataTypes)j(O,M)?T.push(M):O.includes("integer")&&M==="number"&&T.push("integer");P.dataTypes=T}function w(P,O){const T=P.schemaEnv.baseId+P.errSchemaPath;O+=` at "${T}" (strictTypes)`,(0,h.checkStrictMode)(P,O,P.opts.strictTypes)}class I{constructor(O,T,M){if((0,o.validateKeywordUsage)(O,T,M),this.gen=O.gen,this.allErrors=O.allErrors,this.keyword=M,this.data=O.data,this.schema=O.schema[M],this.$data=T.$data&&O.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(O,this.schema,M,this.$data),this.schemaType=T.schemaType,this.parentSchema=O.schema,this.params={},this.it=O,this.def=T,this.$data)this.schemaCode=O.gen.const("vSchema",W(this.$data,O));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,T.schemaType,T.allowUndefined))throw new Error(`${M} value must be ${JSON.stringify(T.schemaType)}`);("code"in T?T.trackErrors:T.errors!==!1)&&(this.errsCount=O.gen.const("_errs",d.default.errors))}result(O,T,M){this.failResult((0,c.not)(O),T,M)}failResult(O,T,M){this.gen.if(O),M?M():this.error(),T?(this.gen.else(),T(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(O,T){this.failResult((0,c.not)(O),void 0,T)}fail(O){if(O===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(O),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(O){if(!this.$data)return this.fail(O);const{schemaCode:T}=this;this.fail((0,c._)`${T} !== undefined && (${(0,c.or)(this.invalid$data(),O)})`)}error(O,T,M){if(T){this.setParams(T),this._error(O,M),this.setParams({});return}this._error(O,M)}_error(O,T){(O?S.reportExtraError:S.reportError)(this,this.def.error,T)}$dataError(){(0,S.reportError)(this,this.def.$dataError||S.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,S.resetErrorsCount)(this.gen,this.errsCount)}ok(O){this.allErrors||this.gen.if(O)}setParams(O,T){T?Object.assign(this.params,O):this.params=O}block$data(O,T,M=c.nil){this.gen.block(()=>{this.check$data(O,M),T()})}check$data(O=c.nil,T=c.nil){if(!this.$data)return;const{gen:M,schemaCode:U,schemaType:G,def:ee}=this;M.if((0,c.or)((0,c._)`${U} === undefined`,T)),O!==c.nil&&M.assign(O,!0),(G.length||ee.validateSchema)&&(M.elseIf(this.invalid$data()),this.$dataError(),O!==c.nil&&M.assign(O,!1)),M.else()}invalid$data(){const{gen:O,schemaCode:T,schemaType:M,def:U,it:G}=this;return(0,c.or)(ee(),ce());function ee(){if(M.length){if(!(T instanceof c.Name))throw new Error("ajv implementation error");const se=Array.isArray(M)?M:[M];return(0,c._)`${(0,u.checkDataTypes)(se,T,G.opts.strictNumbers,u.DataType.Wrong)}`}return c.nil}function ce(){if(U.validateSchema){const se=O.scopeValue("validate$data",{ref:U.validateSchema});return(0,c._)`!${se}(${T})`}return c.nil}}subschema(O,T){const M=(0,l.getSubschema)(this.it,O);(0,l.extendSubschemaData)(M,this.it,O),(0,l.extendSubschemaMode)(M,O);const U={...this.it,...M,items:void 0,props:void 0};return s(U,T),U}mergeEvaluated(O,T){const{it:M,gen:U}=this;M.opts.unevaluated&&(M.props!==!0&&O.props!==void 0&&(M.props=h.mergeEvaluated.props(U,O.props,M.props,T)),M.items!==!0&&O.items!==void 0&&(M.items=h.mergeEvaluated.items(U,O.items,M.items,T)))}mergeValidEvaluated(O,T){const{it:M,gen:U}=this;if(M.opts.unevaluated&&(M.props!==!0||M.items!==!0))return U.if(T,()=>this.mergeEvaluated(O,c.Name)),!0}}he.KeywordCxt=I;function V(P,O,T,M){const U=new I(P,T,O);"code"in T?T.code(U,M):U.$data&&T.validate?(0,o.funcKeywordCode)(U,T):"macro"in T?(0,o.macroKeywordCode)(U,T):(T.compile||T.validate)&&(0,o.funcKeywordCode)(U,T)}const L=/^\/(?:[^~]|~0|~1)*$/,Q=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function W(P,{dataLevel:O,dataNames:T,dataPathArr:M}){let U,G;if(P==="")return d.default.rootData;if(P[0]==="/"){if(!L.test(P))throw new Error(`Invalid JSON-pointer: ${P}`);U=P,G=d.default.rootData}else{const ae=Q.exec(P);if(!ae)throw new Error(`Invalid JSON-pointer: ${P}`);const te=+ae[1];if(U=ae[2],U==="#"){if(te>=O)throw new Error(se("property/index",te));return M[O-te]}if(te>O)throw new Error(se("data",te));if(G=T[O-te],!U)return G}let ee=G;const ce=U.split("/");for(const ae of ce)ae&&(G=(0,c._)`${G}${(0,c.getProperty)((0,h.unescapeJsonPointer)(ae))}`,ee=(0,c._)`${ee} && ${G}`);return ee;function se(ae,te){return`Cannot access ${ae} ${te} levels up, current level is ${O}`}}return he.getData=W,he}var Ce={},vr;function Kt(){if(vr)return Ce;vr=1,Object.defineProperty(Ce,"__esModule",{value:!0});class e extends Error{constructor(g){super("validation failed"),this.errors=g,this.ajv=this.validation=!0}}return Ce.default=e,Ce}var Ae={},_r;function Et(){if(_r)return Ae;_r=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=wt();class a extends Error{constructor(u,v,o,l){super(l||`can't resolve reference ${o} from id ${v}`),this.missingRef=(0,e.resolveUrl)(u,v,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(u,this.missingRef))}}return Ae.default=a,Ae}var oe={},gr;function Ht(){if(gr)return oe;gr=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.resolveSchema=oe.getCompilingSchema=oe.resolveRef=oe.compileSchema=oe.SchemaEnv=void 0;const e=J(),a=Kt(),g=_e(),u=wt(),v=X(),o=bt();class l{constructor(r){var t;this.refs={},this.dynamicAnchors={};let s;typeof r.schema=="object"&&(s=r.schema),this.schema=r.schema,this.schemaId=r.schemaId,this.root=r.root||this,this.baseId=(t=r.baseId)!==null&&t!==void 0?t:(0,u.normalizeId)(s?.[r.schemaId||"$id"]),this.schemaPath=r.schemaPath,this.localRefs=r.localRefs,this.meta=r.meta,this.$async=s?.$async,this.refs={}}}oe.SchemaEnv=l;function c(n){const r=h.call(this,n);if(r)return r;const t=(0,u.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:s,lines:f}=this.opts.code,{ownProperties:m}=this.opts,p=new e.CodeGen(this.scope,{es5:s,lines:f,ownProperties:m});let $;n.$async&&($=p.scopeValue("Error",{ref:a.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const k=p.scopeName("validate");n.validateName=k;const C={gen:p,allErrors:this.opts.allErrors,data:g.default.data,parentData:g.default.parentData,parentDataProperty:g.default.parentDataProperty,dataNames:[g.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:p.scopeValue("schema",this.opts.code.source===!0?{ref:n.schema,code:(0,e.stringify)(n.schema)}:{ref:n.schema}),validateName:k,ValidationError:$,schema:n.schema,schemaEnv:n,rootId:t,baseId:n.baseId||t,schemaPath:e.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let D;try{this._compilations.add(n),(0,o.validateFunctionCode)(C),p.optimize(this.opts.code.optimize);const z=p.toString();D=`${p.scopeRefs(g.default.scope)}return ${z}`,this.opts.code.process&&(D=this.opts.code.process(D,n));const F=new Function(`${g.default.self}`,`${g.default.scope}`,D)(this,this.scope.get());if(this.scope.value(k,{ref:F}),F.errors=null,F.schema=n.schema,F.schemaEnv=n,n.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:k,validateCode:z,scopeValues:p._values}),this.opts.unevaluated){const{props:B,items:x}=C;F.evaluated={props:B instanceof e.Name?void 0:B,items:x instanceof e.Name?void 0:x,dynamicProps:B instanceof e.Name,dynamicItems:x instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return n.validate=F,n}catch(z){throw delete n.validate,delete n.validateName,D&&this.logger.error("Error compiling schema, function code:",D),z}finally{this._compilations.delete(n)}}oe.compileSchema=c;function d(n,r,t){var s;t=(0,u.resolveUrl)(this.opts.uriResolver,r,t);const f=n.refs[t];if(f)return f;let m=R.call(this,n,t);if(m===void 0){const p=(s=n.localRefs)===null||s===void 0?void 0:s[t],{schemaId:$}=this.opts;p&&(m=new l({schema:p,schemaId:$,root:n,baseId:r}))}if(m!==void 0)return n.refs[t]=_.call(this,m)}oe.resolveRef=d;function _(n){return(0,u.inlineRef)(n.schema,this.opts.inlineRefs)?n.schema:n.validate?n:c.call(this,n)}function h(n){for(const r of this._compilations)if(S(r,n))return r}oe.getCompilingSchema=h;function S(n,r){return n.schema===r.schema&&n.root===r.root&&n.baseId===r.baseId}function R(n,r){let t;for(;typeof(t=this.refs[r])=="string";)r=t;return t||this.schemas[r]||E.call(this,n,r)}function E(n,r){const t=this.opts.uriResolver.parse(r),s=(0,u._getFullPath)(this.opts.uriResolver,t);let f=(0,u.getFullPath)(this.opts.uriResolver,n.baseId,void 0);if(Object.keys(n.schema).length>0&&s===f)return y.call(this,t,n);const m=(0,u.normalizeId)(s),p=this.refs[m]||this.schemas[m];if(typeof p=="string"){const $=E.call(this,n,p);return typeof $?.schema!="object"?void 0:y.call(this,t,$)}if(typeof p?.schema=="object"){if(p.validate||c.call(this,p),m===(0,u.normalizeId)(r)){const{schema:$}=p,{schemaId:k}=this.opts,C=$[k];return C&&(f=(0,u.resolveUrl)(this.opts.uriResolver,f,C)),new l({schema:$,schemaId:k,root:n,baseId:f})}return y.call(this,t,p)}}oe.resolveSchema=E;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(n,{baseId:r,schema:t,root:s}){var f;if(((f=n.fragment)===null||f===void 0?void 0:f[0])!=="/")return;for(const $ of n.fragment.slice(1).split("/")){if(typeof t=="boolean")return;const k=t[(0,v.unescapeFragment)($)];if(k===void 0)return;t=k;const C=typeof t=="object"&&t[this.opts.schemaId];!b.has($)&&C&&(r=(0,u.resolveUrl)(this.opts.uriResolver,r,C))}let m;if(typeof t!="boolean"&&t.$ref&&!(0,v.schemaHasRulesButRef)(t,this.RULES)){const $=(0,u.resolveUrl)(this.opts.uriResolver,r,t.$ref);m=E.call(this,s,$)}const{schemaId:p}=this.opts;if(m=m||new l({schema:t,schemaId:p,root:s,baseId:r}),m.schema!==m.root.schema)return m}return oe}const Fn="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Kn="Meta-schema for $data reference (JSON AnySchema extension proposal)",Hn="object",Gn=["$data"],Jn={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Wn=!1,Bn={$id:Fn,description:Kn,type:Hn,required:Gn,properties:Jn,additionalProperties:Wn};var Me={},je={exports:{}},Mt,$r;function Xn(){return $r||($r=1,Mt={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}),Mt}var Dt,wr;function Qn(){if(wr)return Dt;wr=1;const{HEX:e}=Xn(),a=/^(?:(?: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 g(y){if(c(y,".")<3)return{host:y,isIPV4:!1};const n=y.match(a)||[],[r]=n;return r?{host:l(r,"."),isIPV4:!0}:{host:y,isIPV4:!1}}function u(y,n=!1){let r="",t=!0;for(const s of y){if(e[s]===void 0)return;s!=="0"&&t===!0&&(t=!1),t||(r+=s)}return n&&r.length===0&&(r="0"),r}function v(y){let n=0;const r={error:!1,address:"",zone:""},t=[],s=[];let f=!1,m=!1,p=!1;function $(){if(s.length){if(f===!1){const k=u(s);if(k!==void 0)t.push(k);else return r.error=!0,!1}s.length=0}return!0}for(let k=0;k<y.length;k++){const C=y[k];if(!(C==="["||C==="]"))if(C===":"){if(m===!0&&(p=!0),!$())break;if(n++,t.push(":"),n>7){r.error=!0;break}k-1>=0&&y[k-1]===":"&&(m=!0);continue}else if(C==="%"){if(!$())break;f=!0}else{s.push(C);continue}}return s.length&&(f?r.zone=s.join(""):p?t.push(s.join("")):t.push(u(s))),r.address=t.join(""),r}function o(y){if(c(y,":")<2)return{host:y,isIPV6:!1};const n=v(y);if(n.error)return{host:y,isIPV6:!1};{let r=n.address,t=n.address;return n.zone&&(r+="%"+n.zone,t+="%25"+n.zone),{host:r,escapedHost:t,isIPV6:!0}}}function l(y,n){let r="",t=!0;const s=y.length;for(let f=0;f<s;f++){const m=y[f];m==="0"&&t?(f+1<=s&&y[f+1]===n||f+1===s)&&(r+=m,t=!1):(m===n?t=!0:t=!1,r+=m)}return r}function c(y,n){let r=0;for(let t=0;t<y.length;t++)y[t]===n&&r++;return r}const d=/^\.\.?\//u,_=/^\/\.(?:\/|$)/u,h=/^\/\.\.(?:\/|$)/u,S=/^\/?(?:.|\n)*?(?=\/|$)/u;function R(y){const n=[];for(;y.length;)if(y.match(d))y=y.replace(d,"");else if(y.match(_))y=y.replace(_,"/");else if(y.match(h))y=y.replace(h,"/"),n.pop();else if(y==="."||y==="..")y="";else{const r=y.match(S);if(r){const t=r[0];y=y.slice(t.length),n.push(t)}else throw new Error("Unexpected dot segment condition")}return n.join("")}function E(y,n){const r=n!==!0?escape:unescape;return y.scheme!==void 0&&(y.scheme=r(y.scheme)),y.userinfo!==void 0&&(y.userinfo=r(y.userinfo)),y.host!==void 0&&(y.host=r(y.host)),y.path!==void 0&&(y.path=r(y.path)),y.query!==void 0&&(y.query=r(y.query)),y.fragment!==void 0&&(y.fragment=r(y.fragment)),y}function b(y){const n=[];if(y.userinfo!==void 0&&(n.push(y.userinfo),n.push("@")),y.host!==void 0){let r=unescape(y.host);const t=g(r);if(t.isIPV4)r=t.host;else{const s=o(t.host);s.isIPV6===!0?r=`[${s.escapedHost}]`:r=y.host}n.push(r)}return(typeof y.port=="number"||typeof y.port=="string")&&(n.push(":"),n.push(String(y.port))),n.length?n.join(""):void 0}return Dt={recomposeAuthority:b,normalizeComponentEncoding:E,removeDotSegments:R,normalizeIPv4:g,normalizeIPv6:o,stringArrayToHexStripped:u},Dt}var Vt,br;function Yn(){if(br)return Vt;br=1;const e=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,a=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function g(t){return typeof t.secure=="boolean"?t.secure:String(t.scheme).toLowerCase()==="wss"}function u(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function v(t){const s=String(t.scheme).toLowerCase()==="https";return(t.port===(s?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function o(t){return t.secure=g(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function l(t){if((t.port===(g(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){const[s,f]=t.resourceName.split("?");t.path=s&&s!=="/"?s:void 0,t.query=f,t.resourceName=void 0}return t.fragment=void 0,t}function c(t,s){if(!t.path)return t.error="URN can not be parsed",t;const f=t.path.match(a);if(f){const m=s.scheme||t.scheme||"urn";t.nid=f[1].toLowerCase(),t.nss=f[2];const p=`${m}:${s.nid||t.nid}`,$=r[p];t.path=void 0,$&&(t=$.parse(t,s))}else t.error=t.error||"URN can not be parsed.";return t}function d(t,s){const f=s.scheme||t.scheme||"urn",m=t.nid.toLowerCase(),p=`${f}:${s.nid||m}`,$=r[p];$&&(t=$.serialize(t,s));const k=t,C=t.nss;return k.path=`${m||s.nid}:${C}`,s.skipEscape=!0,k}function _(t,s){const f=t;return f.uuid=f.nss,f.nss=void 0,!s.tolerant&&(!f.uuid||!e.test(f.uuid))&&(f.error=f.error||"UUID is not valid."),f}function h(t){const s=t;return s.nss=(t.uuid||"").toLowerCase(),s}const S={scheme:"http",domainHost:!0,parse:u,serialize:v},R={scheme:"https",domainHost:S.domainHost,parse:u,serialize:v},E={scheme:"ws",domainHost:!0,parse:o,serialize:l},b={scheme:"wss",domainHost:E.domainHost,parse:E.parse,serialize:E.serialize},r={http:S,https:R,ws:E,wss:b,urn:{scheme:"urn",parse:c,serialize:d,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:_,serialize:h,skipNormalize:!0}};return Vt=r,Vt}var Er;function Zn(){if(Er)return je.exports;Er=1;const{normalizeIPv6:e,normalizeIPv4:a,removeDotSegments:g,recomposeAuthority:u,normalizeComponentEncoding:v}=Qn(),o=Yn();function l(n,r){return typeof n=="string"?n=h(b(n,r),r):typeof n=="object"&&(n=b(h(n,r),r)),n}function c(n,r,t){const s=Object.assign({scheme:"null"},t),f=d(b(n,s),b(r,s),s,!0);return h(f,{...s,skipEscape:!0})}function d(n,r,t,s){const f={};return s||(n=b(h(n,t),t),r=b(h(r,t),t)),t=t||{},!t.tolerant&&r.scheme?(f.scheme=r.scheme,f.userinfo=r.userinfo,f.host=r.host,f.port=r.port,f.path=g(r.path||""),f.query=r.query):(r.userinfo!==void 0||r.host!==void 0||r.port!==void 0?(f.userinfo=r.userinfo,f.host=r.host,f.port=r.port,f.path=g(r.path||""),f.query=r.query):(r.path?(r.path.charAt(0)==="/"?f.path=g(r.path):((n.userinfo!==void 0||n.host!==void 0||n.port!==void 0)&&!n.path?f.path="/"+r.path:n.path?f.path=n.path.slice(0,n.path.lastIndexOf("/")+1)+r.path:f.path=r.path,f.path=g(f.path)),f.query=r.query):(f.path=n.path,r.query!==void 0?f.query=r.query:f.query=n.query),f.userinfo=n.userinfo,f.host=n.host,f.port=n.port),f.scheme=n.scheme),f.fragment=r.fragment,f}function _(n,r,t){return typeof n=="string"?(n=unescape(n),n=h(v(b(n,t),!0),{...t,skipEscape:!0})):typeof n=="object"&&(n=h(v(n,!0),{...t,skipEscape:!0})),typeof r=="string"?(r=unescape(r),r=h(v(b(r,t),!0),{...t,skipEscape:!0})):typeof r=="object"&&(r=h(v(r,!0),{...t,skipEscape:!0})),n.toLowerCase()===r.toLowerCase()}function h(n,r){const t={host:n.host,scheme:n.scheme,userinfo:n.userinfo,port:n.port,path:n.path,query:n.query,nid:n.nid,nss:n.nss,uuid:n.uuid,fragment:n.fragment,reference:n.reference,resourceName:n.resourceName,secure:n.secure,error:""},s=Object.assign({},r),f=[],m=o[(s.scheme||t.scheme||"").toLowerCase()];m&&m.serialize&&m.serialize(t,s),t.path!==void 0&&(s.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),s.reference!=="suffix"&&t.scheme&&f.push(t.scheme,":");const p=u(t);if(p!==void 0&&(s.reference!=="suffix"&&f.push("//"),f.push(p),t.path&&t.path.charAt(0)!=="/"&&f.push("/")),t.path!==void 0){let $=t.path;!s.absolutePath&&(!m||!m.absolutePath)&&($=g($)),p===void 0&&($=$.replace(/^\/\//u,"/%2F")),f.push($)}return t.query!==void 0&&f.push("?",t.query),t.fragment!==void 0&&f.push("#",t.fragment),f.join("")}const S=Array.from({length:127},(n,r)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(r)));function R(n){let r=0;for(let t=0,s=n.length;t<s;++t)if(r=n.charCodeAt(t),r>126||S[r])return!0;return!1}const E=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(n,r){const t=Object.assign({},r),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},f=n.indexOf("%")!==-1;let m=!1;t.reference==="suffix"&&(n=(t.scheme?t.scheme+":":"")+"//"+n);const p=n.match(E);if(p){if(s.scheme=p[1],s.userinfo=p[3],s.host=p[4],s.port=parseInt(p[5],10),s.path=p[6]||"",s.query=p[7],s.fragment=p[8],isNaN(s.port)&&(s.port=p[5]),s.host){const k=a(s.host);if(k.isIPV4===!1){const C=e(k.host);s.host=C.host.toLowerCase(),m=C.isIPV6}else s.host=k.host,m=!0}s.scheme===void 0&&s.userinfo===void 0&&s.host===void 0&&s.port===void 0&&s.query===void 0&&!s.path?s.reference="same-document":s.scheme===void 0?s.reference="relative":s.fragment===void 0?s.reference="absolute":s.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==s.reference&&(s.error=s.error||"URI is not a "+t.reference+" reference.");const $=o[(t.scheme||s.scheme||"").toLowerCase()];if(!t.unicodeSupport&&(!$||!$.unicodeSupport)&&s.host&&(t.domainHost||$&&$.domainHost)&&m===!1&&R(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(k){s.error=s.error||"Host's domain name can not be converted to ASCII: "+k}(!$||$&&!$.skipNormalize)&&(f&&s.scheme!==void 0&&(s.scheme=unescape(s.scheme)),f&&s.host!==void 0&&(s.host=unescape(s.host)),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),$&&$.parse&&$.parse(s,t)}else s.error=s.error||"URI can not be parsed.";return s}const y={SCHEMES:o,normalize:l,resolve:c,resolveComponents:d,equal:_,serialize:h,parse:b};return je.exports=y,je.exports.default=y,je.exports.fastUri=y,je.exports}var Sr;function xn(){if(Sr)return Me;Sr=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=Zn();return e.code='require("ajv/dist/runtime/uri").default',Me.default=e,Me}var Pr;function es(){return Pr||(Pr=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 a=bt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return a.KeywordCxt}});var g=J();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});const u=Kt(),v=Et(),o=yn(),l=Ht(),c=J(),d=wt(),_=gt(),h=X(),S=Bn,R=xn(),E=(A,N)=>new RegExp(A,N);E.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),n={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."},r={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},t=200;function s(A){var N,q,j,i,w,I,V,L,Q,W,P,O,T,M,U,G,ee,ce,se,ae,te,Ee,ie,St,Pt;const Ne=A.strict,Rt=(N=A.code)===null||N===void 0?void 0:N.optimize,Jt=Rt===!0||Rt===void 0?1:Rt||0,Wt=(j=(q=A.code)===null||q===void 0?void 0:q.regExp)!==null&&j!==void 0?j:E,Sn=(i=A.uriResolver)!==null&&i!==void 0?i:R.default;return{strictSchema:(I=(w=A.strictSchema)!==null&&w!==void 0?w:Ne)!==null&&I!==void 0?I:!0,strictNumbers:(L=(V=A.strictNumbers)!==null&&V!==void 0?V:Ne)!==null&&L!==void 0?L:!0,strictTypes:(W=(Q=A.strictTypes)!==null&&Q!==void 0?Q:Ne)!==null&&W!==void 0?W:"log",strictTuples:(O=(P=A.strictTuples)!==null&&P!==void 0?P:Ne)!==null&&O!==void 0?O:"log",strictRequired:(M=(T=A.strictRequired)!==null&&T!==void 0?T:Ne)!==null&&M!==void 0?M:!1,code:A.code?{...A.code,optimize:Jt,regExp:Wt}:{optimize:Jt,regExp:Wt},loopRequired:(U=A.loopRequired)!==null&&U!==void 0?U:t,loopEnum:(G=A.loopEnum)!==null&&G!==void 0?G:t,meta:(ee=A.meta)!==null&&ee!==void 0?ee:!0,messages:(ce=A.messages)!==null&&ce!==void 0?ce:!0,inlineRefs:(se=A.inlineRefs)!==null&&se!==void 0?se:!0,schemaId:(ae=A.schemaId)!==null&&ae!==void 0?ae:"$id",addUsedSchema:(te=A.addUsedSchema)!==null&&te!==void 0?te:!0,validateSchema:(Ee=A.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(ie=A.validateFormats)!==null&&ie!==void 0?ie:!0,unicodeRegExp:(St=A.unicodeRegExp)!==null&&St!==void 0?St:!0,int32range:(Pt=A.int32range)!==null&&Pt!==void 0?Pt:!0,uriResolver:Sn}}class f{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...s(N)};const{es5:q,lines:j}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:y,es5:q,lines:j}),this.logger=K(N.logger);const i=N.validateFormats;N.validateFormats=!1,this.RULES=(0,o.getRules)(),m.call(this,n,N,"NOT SUPPORTED"),m.call(this,r,N,"DEPRECATED","warn"),this._metaOpts=D.call(this),N.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords&&C.call(this,N.keywords),typeof N.meta=="object"&&this.addMetaSchema(N.meta),$.call(this),N.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:N,meta:q,schemaId:j}=this.opts;let i=S;j==="id"&&(i={...S},i.id=i.$id,delete i.$id),q&&N&&this.addMetaSchema(i,i[j],!1)}defaultMeta(){const{meta:N,schemaId:q}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[q]||N:void 0}validate(N,q){let j;if(typeof N=="string"){if(j=this.getSchema(N),!j)throw new Error(`no schema with key or ref "${N}"`)}else j=this.compile(N);const i=j(q);return"$async"in j||(this.errors=j.errors),i}compile(N,q){const j=this._addSchema(N,q);return j.validate||this._compileSchemaEnv(j)}compileAsync(N,q){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:j}=this.opts;return i.call(this,N,q);async function i(W,P){await w.call(this,W.$schema);const O=this._addSchema(W,P);return O.validate||I.call(this,O)}async function w(W){W&&!this.getSchema(W)&&await i.call(this,{$ref:W},!0)}async function I(W){try{return this._compileSchemaEnv(W)}catch(P){if(!(P instanceof v.default))throw P;return V.call(this,P),await L.call(this,P.missingSchema),I.call(this,W)}}function V({missingSchema:W,missingRef:P}){if(this.refs[W])throw new Error(`AnySchema ${W} is loaded but ${P} cannot be resolved`)}async function L(W){const P=await Q.call(this,W);this.refs[W]||await w.call(this,P.$schema),this.refs[W]||this.addSchema(P,W,q)}async function Q(W){const P=this._loading[W];if(P)return P;try{return await(this._loading[W]=j(W))}finally{delete this._loading[W]}}}addSchema(N,q,j,i=this.opts.validateSchema){if(Array.isArray(N)){for(const I of N)this.addSchema(I,void 0,j,i);return this}let w;if(typeof N=="object"){const{schemaId:I}=this.opts;if(w=N[I],w!==void 0&&typeof w!="string")throw new Error(`schema ${I} must be string`)}return q=(0,d.normalizeId)(q||w),this._checkUnique(q),this.schemas[q]=this._addSchema(N,j,q,i,!0),this}addMetaSchema(N,q,j=this.opts.validateSchema){return this.addSchema(N,q,!0,j),this}validateSchema(N,q){if(typeof N=="boolean")return!0;let j;if(j=N.$schema,j!==void 0&&typeof j!="string")throw new Error("$schema must be a string");if(j=j||this.opts.defaultMeta||this.defaultMeta(),!j)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const i=this.validate(j,N);if(!i&&q){const w="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(w);else throw new Error(w)}return i}getSchema(N){let q;for(;typeof(q=p.call(this,N))=="string";)N=q;if(q===void 0){const{schemaId:j}=this.opts,i=new l.SchemaEnv({schema:{},schemaId:j});if(q=l.resolveSchema.call(this,i,N),!q)return;this.refs[N]=q}return q.validate||this._compileSchemaEnv(q)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const q=p.call(this,N);return typeof q=="object"&&this._cache.delete(q.schema),delete this.schemas[N],delete this.refs[N],this}case"object":{const q=N;this._cache.delete(q);let j=N[this.opts.schemaId];return j&&(j=(0,d.normalizeId)(j),delete this.schemas[j],delete this.refs[j]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(const q of N)this.addKeyword(q);return this}addKeyword(N,q){let j;if(typeof N=="string")j=N,typeof q=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),q.keyword=j);else if(typeof N=="object"&&q===void 0){if(q=N,j=q.keyword,Array.isArray(j)&&!j.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B.call(this,j,q),!q)return(0,h.eachItem)(j,w=>x.call(this,w)),this;fe.call(this,q);const i={...q,type:(0,_.getJSONTypes)(q.type),schemaType:(0,_.getJSONTypes)(q.schemaType)};return(0,h.eachItem)(j,i.type.length===0?w=>x.call(this,w,i):w=>i.type.forEach(I=>x.call(this,w,i,I))),this}getKeyword(N){const q=this.RULES.all[N];return typeof q=="object"?q.definition:!!q}removeKeyword(N){const{RULES:q}=this;delete q.keywords[N],delete q.all[N];for(const j of q.rules){const i=j.rules.findIndex(w=>w.keyword===N);i>=0&&j.rules.splice(i,1)}return this}addFormat(N,q){return typeof q=="string"&&(q=new RegExp(q)),this.formats[N]=q,this}errorsText(N=this.errors,{separator:q=", ",dataVar:j="data"}={}){return!N||N.length===0?"No errors":N.map(i=>`${j}${i.instancePath} ${i.message}`).reduce((i,w)=>i+q+w)}$dataMetaSchema(N,q){const j=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(const i of q){const w=i.split("/").slice(1);let I=N;for(const V of w)I=I[V];for(const V in j){const L=j[V];if(typeof L!="object")continue;const{$data:Q}=L.definition,W=I[V];Q&&W&&(I[V]=ye(W))}}return N}_removeAllSchemas(N,q){for(const j in N){const i=N[j];(!q||q.test(j))&&(typeof i=="string"?delete N[j]:i&&!i.meta&&(this._cache.delete(i.schema),delete N[j]))}}_addSchema(N,q,j,i=this.opts.validateSchema,w=this.opts.addUsedSchema){let I;const{schemaId:V}=this.opts;if(typeof N=="object")I=N[V];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof N!="boolean")throw new Error("schema must be object or boolean")}let L=this._cache.get(N);if(L!==void 0)return L;j=(0,d.normalizeId)(I||j);const Q=d.getSchemaRefs.call(this,N,j);return L=new l.SchemaEnv({schema:N,schemaId:V,meta:q,baseId:j,localRefs:Q}),this._cache.set(L.schema,L),w&&!j.startsWith("#")&&(j&&this._checkUnique(j),this.refs[j]=L),i&&this.validateSchema(N,!0),L}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw new Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta?this._compileMetaSchema(N):l.compileSchema.call(this,N),!N.validate)throw new Error("ajv implementation error");return N.validate}_compileMetaSchema(N){const q=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,N)}finally{this.opts=q}}}f.ValidationError=u.default,f.MissingRefError=v.default,e.default=f;function m(A,N,q,j="error"){for(const i in A){const w=i;w in N&&this.logger[j](`${q}: option ${i}. ${A[w]}`)}}function p(A){return A=(0,d.normalizeId)(A),this.schemas[A]||this.refs[A]}function $(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const N in A)this.addSchema(A[N],N)}function k(){for(const A in this.opts.formats){const N=this.opts.formats[A];N&&this.addFormat(A,N)}}function C(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const N in A){const q=A[N];q.keyword||(q.keyword=N),this.addKeyword(q)}}function D(){const A={...this.opts};for(const N of b)delete A[N];return A}const z={log(){},warn(){},error(){}};function K(A){if(A===!1)return z;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function B(A,N){const{RULES:q}=this;if((0,h.eachItem)(A,j=>{if(q.keywords[j])throw new Error(`Keyword ${j} is already defined`);if(!F.test(j))throw new Error(`Keyword ${j} has invalid name`)}),!!N&&N.$data&&!("code"in N||"validate"in N))throw new Error('$data keyword must have "code" or "validate" function')}function x(A,N,q){var j;const i=N?.post;if(q&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:w}=this;let I=i?w.post:w.rules.find(({type:L})=>L===q);if(I||(I={type:q,rules:[]},w.rules.push(I)),w.keywords[A]=!0,!N)return;const V={keyword:A,definition:{...N,type:(0,_.getJSONTypes)(N.type),schemaType:(0,_.getJSONTypes)(N.schemaType)}};N.before?de.call(this,I,V,N.before):I.rules.push(V),w.all[A]=V,(j=N.implements)===null||j===void 0||j.forEach(L=>this.addKeyword(L))}function de(A,N,q){const j=A.rules.findIndex(i=>i.keyword===q);j>=0?A.rules.splice(j,0,N):(A.rules.push(N),this.logger.warn(`rule ${q} is not defined`))}function fe(A){let{metaSchema:N}=A;N!==void 0&&(A.$data&&this.opts.$data&&(N=ye(N)),A.validateSchema=this.compile(N,!0))}const Z={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ye(A){return{anyOf:[A,Z]}}}(jt)),jt}var De={},Ve={},ze={},Rr;function ts(){if(Rr)return ze;Rr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return ze.default=e,ze}var ve={},Nr;function rs(){if(Nr)return ve;Nr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.callRef=ve.getValidate=void 0;const e=Et(),a=le(),g=J(),u=_e(),v=Ht(),o=X(),l={keyword:"$ref",schemaType:"string",code(_){const{gen:h,schema:S,it:R}=_,{baseId:E,schemaEnv:b,validateName:y,opts:n,self:r}=R,{root:t}=b;if((S==="#"||S==="#/")&&E===t.baseId)return f();const s=v.resolveRef.call(r,t,E,S);if(s===void 0)throw new e.default(R.opts.uriResolver,E,S);if(s instanceof v.SchemaEnv)return m(s);return p(s);function f(){if(b===t)return d(_,y,b,b.$async);const $=h.scopeValue("root",{ref:t});return d(_,(0,g._)`${$}.validate`,t,t.$async)}function m($){const k=c(_,$);d(_,k,$,$.$async)}function p($){const k=h.scopeValue("schema",n.code.source===!0?{ref:$,code:(0,g.stringify)($)}:{ref:$}),C=h.name("valid"),D=_.subschema({schema:$,dataTypes:[],schemaPath:g.nil,topSchemaRef:k,errSchemaPath:S},C);_.mergeEvaluated(D),_.ok(C)}}};function c(_,h){const{gen:S}=_;return h.validate?S.scopeValue("validate",{ref:h.validate}):(0,g._)`${S.scopeValue("wrapper",{ref:h})}.validate`}ve.getValidate=c;function d(_,h,S,R){const{gen:E,it:b}=_,{allErrors:y,schemaEnv:n,opts:r}=b,t=r.passContext?u.default.this:g.nil;R?s():f();function s(){if(!n.$async)throw new Error("async schema referenced by sync schema");const $=E.let("valid");E.try(()=>{E.code((0,g._)`await ${(0,a.callValidateCode)(_,h,t)}`),p(h),y||E.assign($,!0)},k=>{E.if((0,g._)`!(${k} instanceof ${b.ValidationError})`,()=>E.throw(k)),m(k),y||E.assign($,!1)}),_.ok($)}function f(){_.result((0,a.callValidateCode)(_,h,t),()=>p(h),()=>m(h))}function m($){const k=(0,g._)`${$}.errors`;E.assign(u.default.vErrors,(0,g._)`${u.default.vErrors} === null ? ${k} : ${u.default.vErrors}.concat(${k})`),E.assign(u.default.errors,(0,g._)`${u.default.vErrors}.length`)}function p($){var k;if(!b.opts.unevaluated)return;const C=(k=S?.validate)===null||k===void 0?void 0:k.evaluated;if(b.props!==!0)if(C&&!C.dynamicProps)C.props!==void 0&&(b.props=o.mergeEvaluated.props(E,C.props,b.props));else{const D=E.var("props",(0,g._)`${$}.evaluated.props`);b.props=o.mergeEvaluated.props(E,D,b.props,g.Name)}if(b.items!==!0)if(C&&!C.dynamicItems)C.items!==void 0&&(b.items=o.mergeEvaluated.items(E,C.items,b.items));else{const D=E.var("items",(0,g._)`${$}.evaluated.items`);b.items=o.mergeEvaluated.items(E,D,b.items,g.Name)}}}return ve.callRef=d,ve.default=l,ve}var Or;function ns(){if(Or)return Ve;Or=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=ts(),a=rs(),g=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,a.default];return Ve.default=g,Ve}var Ue={},Le={},jr;function ss(){if(jr)return Le;jr=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=J(),a=e.operators,g={maximum:{okStr:"<=",ok:a.LTE,fail:a.GT},minimum:{okStr:">=",ok:a.GTE,fail:a.LT},exclusiveMaximum:{okStr:"<",ok:a.LT,fail:a.GTE},exclusiveMinimum:{okStr:">",ok:a.GT,fail:a.LTE}},u={message:({keyword:o,schemaCode:l})=>(0,e.str)`must be ${g[o].okStr} ${l}`,params:({keyword:o,schemaCode:l})=>(0,e._)`{comparison: ${g[o].okStr}, limit: ${l}}`},v={keyword:Object.keys(g),type:"number",schemaType:"number",$data:!0,error:u,code(o){const{keyword:l,data:c,schemaCode:d}=o;o.fail$data((0,e._)`${c} ${g[l].fail} ${d} || isNaN(${c})`)}};return Le.default=v,Le}var Fe={},kr;function as(){if(kr)return Fe;kr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=J(),g={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:u})=>(0,e.str)`must be multiple of ${u}`,params:({schemaCode:u})=>(0,e._)`{multipleOf: ${u}}`},code(u){const{gen:v,data:o,schemaCode:l,it:c}=u,d=c.opts.multipleOfPrecision,_=v.let("res"),h=d?(0,e._)`Math.abs(Math.round(${_}) - ${_}) > 1e-${d}`:(0,e._)`${_} !== parseInt(${_})`;u.fail$data((0,e._)`(${l} === 0 || (${_} = ${o}/${l}, ${h}))`)}};return Fe.default=g,Fe}var Ke={},He={},Ir;function os(){if(Ir)return He;Ir=1,Object.defineProperty(He,"__esModule",{value:!0});function e(a){const g=a.length;let u=0,v=0,o;for(;v<g;)u++,o=a.charCodeAt(v++),o>=55296&&o<=56319&&v<g&&(o=a.charCodeAt(v),(o&64512)===56320&&v++);return u}return He.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',He}var Tr;function is(){if(Tr)return Ke;Tr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=J(),a=X(),g=os(),v={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:l}){const c=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${c} than ${l} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:l,data:c,schemaCode:d,it:_}=o,h=l==="maxLength"?e.operators.GT:e.operators.LT,S=_.opts.unicode===!1?(0,e._)`${c}.length`:(0,e._)`${(0,a.useFunc)(o.gen,g.default)}(${c})`;o.fail$data((0,e._)`${S} ${h} ${d}`)}};return Ke.default=v,Ke}var Ge={},qr;function cs(){if(qr)return Ge;qr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=le(),a=J(),u={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:v})=>(0,a.str)`must match pattern "${v}"`,params:({schemaCode:v})=>(0,a._)`{pattern: ${v}}`},code(v){const{data:o,$data:l,schema:c,schemaCode:d,it:_}=v,h=_.opts.unicodeRegExp?"u":"",S=l?(0,a._)`(new RegExp(${d}, ${h}))`:(0,e.usePattern)(v,c);v.fail$data((0,a._)`!${S}.test(${o})`)}};return Ge.default=u,Ge}var Je={},Cr;function us(){if(Cr)return Je;Cr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=J(),g={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:u,schemaCode:v}){const o=u==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${v} properties`},params:({schemaCode:u})=>(0,e._)`{limit: ${u}}`},code(u){const{keyword:v,data:o,schemaCode:l}=u,c=v==="maxProperties"?e.operators.GT:e.operators.LT;u.fail$data((0,e._)`Object.keys(${o}).length ${c} ${l}`)}};return Je.default=g,Je}var We={},Ar;function ls(){if(Ar)return We;Ar=1,Object.defineProperty(We,"__esModule",{value:!0});const e=le(),a=J(),g=X(),v={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,a.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,a._)`{missingProperty: ${o}}`},code(o){const{gen:l,schema:c,schemaCode:d,data:_,$data:h,it:S}=o,{opts:R}=S;if(!h&&c.length===0)return;const E=c.length>=R.loopRequired;if(S.allErrors?b():y(),R.strictRequired){const t=o.parentSchema.properties,{definedProperties:s}=o.it;for(const f of c)if(t?.[f]===void 0&&!s.has(f)){const m=S.schemaEnv.baseId+S.errSchemaPath,p=`required property "${f}" is not defined at "${m}" (strictRequired)`;(0,g.checkStrictMode)(S,p,S.opts.strictRequired)}}function b(){if(E||h)o.block$data(a.nil,n);else for(const t of c)(0,e.checkReportMissingProp)(o,t)}function y(){const t=l.let("missing");if(E||h){const s=l.let("valid",!0);o.block$data(s,()=>r(t,s)),o.ok(s)}else l.if((0,e.checkMissingProp)(o,c,t)),(0,e.reportMissingProp)(o,t),l.else()}function n(){l.forOf("prop",d,t=>{o.setParams({missingProperty:t}),l.if((0,e.noPropertyInData)(l,_,t,R.ownProperties),()=>o.error())})}function r(t,s){o.setParams({missingProperty:t}),l.forOf(t,d,()=>{l.assign(s,(0,e.propertyInData)(l,_,t,R.ownProperties)),l.if((0,a.not)(s),()=>{o.error(),l.break()})},a.nil)}}};return We.default=v,We}var Be={},Mr;function ds(){if(Mr)return Be;Mr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=J(),g={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:u,schemaCode:v}){const o=u==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${v} items`},params:({schemaCode:u})=>(0,e._)`{limit: ${u}}`},code(u){const{keyword:v,data:o,schemaCode:l}=u,c=v==="maxItems"?e.operators.GT:e.operators.LT;u.fail$data((0,e._)`${o}.length ${c} ${l}`)}};return Be.default=g,Be}var Xe={},Qe={},Dr;function Gt(){if(Dr)return Qe;Dr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=_n();return e.code='require("ajv/dist/runtime/equal").default',Qe.default=e,Qe}var Vr;function fs(){if(Vr)return Xe;Vr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=gt(),a=J(),g=X(),u=Gt(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:l,j:c}})=>(0,a.str)`must NOT have duplicate items (items ## ${c} and ${l} are identical)`,params:({params:{i:l,j:c}})=>(0,a._)`{i: ${l}, j: ${c}}`},code(l){const{gen:c,data:d,$data:_,schema:h,parentSchema:S,schemaCode:R,it:E}=l;if(!_&&!h)return;const b=c.let("valid"),y=S.items?(0,e.getSchemaTypes)(S.items):[];l.block$data(b,n,(0,a._)`${R} === false`),l.ok(b);function n(){const f=c.let("i",(0,a._)`${d}.length`),m=c.let("j");l.setParams({i:f,j:m}),c.assign(b,!0),c.if((0,a._)`${f} > 1`,()=>(r()?t:s)(f,m))}function r(){return y.length>0&&!y.some(f=>f==="object"||f==="array")}function t(f,m){const p=c.name("item"),$=(0,e.checkDataTypes)(y,p,E.opts.strictNumbers,e.DataType.Wrong),k=c.const("indices",(0,a._)`{}`);c.for((0,a._)`;${f}--;`,()=>{c.let(p,(0,a._)`${d}[${f}]`),c.if($,(0,a._)`continue`),y.length>1&&c.if((0,a._)`typeof ${p} == "string"`,(0,a._)`${p} += "_"`),c.if((0,a._)`typeof ${k}[${p}] == "number"`,()=>{c.assign(m,(0,a._)`${k}[${p}]`),l.error(),c.assign(b,!1).break()}).code((0,a._)`${k}[${p}] = ${f}`)})}function s(f,m){const p=(0,g.useFunc)(c,u.default),$=c.name("outer");c.label($).for((0,a._)`;${f}--;`,()=>c.for((0,a._)`${m} = ${f}; ${m}--;`,()=>c.if((0,a._)`${p}(${d}[${f}], ${d}[${m}])`,()=>{l.error(),c.assign(b,!1).break($)})))}}};return Xe.default=o,Xe}var Ye={},zr;function hs(){if(zr)return Ye;zr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=J(),a=X(),g=Gt(),v={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:l,data:c,$data:d,schemaCode:_,schema:h}=o;d||h&&typeof h=="object"?o.fail$data((0,e._)`!${(0,a.useFunc)(l,g.default)}(${c}, ${_})`):o.fail((0,e._)`${h} !== ${c}`)}};return Ye.default=v,Ye}var Ze={},Ur;function ps(){if(Ur)return Ze;Ur=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=J(),a=X(),g=Gt(),v={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:l,data:c,$data:d,schema:_,schemaCode:h,it:S}=o;if(!d&&_.length===0)throw new Error("enum must have non-empty array");const R=_.length>=S.opts.loopEnum;let E;const b=()=>E??(E=(0,a.useFunc)(l,g.default));let y;if(R||d)y=l.let("valid"),o.block$data(y,n);else{if(!Array.isArray(_))throw new Error("ajv implementation error");const t=l.const("vSchema",h);y=(0,e.or)(..._.map((s,f)=>r(t,f)))}o.pass(y);function n(){l.assign(y,!1),l.forOf("v",h,t=>l.if((0,e._)`${b()}(${c}, ${t})`,()=>l.assign(y,!0).break()))}function r(t,s){const f=_[s];return typeof f=="object"&&f!==null?(0,e._)`${b()}(${c}, ${t}[${s}])`:(0,e._)`${c} === ${f}`}}};return Ze.default=v,Ze}var Lr;function ms(){if(Lr)return Ue;Lr=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e=ss(),a=as(),g=is(),u=cs(),v=us(),o=ls(),l=ds(),c=fs(),d=hs(),_=ps(),h=[e.default,a.default,g.default,u.default,v.default,o.default,l.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,_.default];return Ue.default=h,Ue}var xe={},Se={},Fr;function gn(){if(Fr)return Se;Fr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.validateAdditionalItems=void 0;const e=J(),a=X(),u={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:l,it:c}=o,{items:d}=l;if(!Array.isArray(d)){(0,a.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}v(o,d)}};function v(o,l){const{gen:c,schema:d,data:_,keyword:h,it:S}=o;S.items=!0;const R=c.const("len",(0,e._)`${_}.length`);if(d===!1)o.setParams({len:l.length}),o.pass((0,e._)`${R} <= ${l.length}`);else if(typeof d=="object"&&!(0,a.alwaysValidSchema)(S,d)){const b=c.var("valid",(0,e._)`${R} <= ${l.length}`);c.if((0,e.not)(b),()=>E(b)),o.ok(b)}function E(b){c.forRange("i",l.length,R,y=>{o.subschema({keyword:h,dataProp:y,dataPropType:a.Type.Num},b),S.allErrors||c.if((0,e.not)(b),()=>c.break())})}}return Se.validateAdditionalItems=v,Se.default=u,Se}var et={},Pe={},Kr;function $n(){if(Kr)return Pe;Kr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.validateTuple=void 0;const e=J(),a=X(),g=le(),u={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){const{schema:l,it:c}=o;if(Array.isArray(l))return v(o,"additionalItems",l);c.items=!0,!(0,a.alwaysValidSchema)(c,l)&&o.ok((0,g.validateArray)(o))}};function v(o,l,c=o.schema){const{gen:d,parentSchema:_,data:h,keyword:S,it:R}=o;y(_),R.opts.unevaluated&&c.length&&R.items!==!0&&(R.items=a.mergeEvaluated.items(d,c.length,R.items));const E=d.name("valid"),b=d.const("len",(0,e._)`${h}.length`);c.forEach((n,r)=>{(0,a.alwaysValidSchema)(R,n)||(d.if((0,e._)`${b} > ${r}`,()=>o.subschema({keyword:S,schemaProp:r,dataProp:r},E)),o.ok(E))});function y(n){const{opts:r,errSchemaPath:t}=R,s=c.length,f=s===n.minItems&&(s===n.maxItems||n[l]===!1);if(r.strictTuples&&!f){const m=`"${S}" is ${s}-tuple, but minItems or maxItems/${l} are not specified or different at path "${t}"`;(0,a.checkStrictMode)(R,m,r.strictTuples)}}}return Pe.validateTuple=v,Pe.default=u,Pe}var Hr;function ys(){if(Hr)return et;Hr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=$n(),a={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:g=>(0,e.validateTuple)(g,"items")};return et.default=a,et}var tt={},Gr;function vs(){if(Gr)return tt;Gr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=J(),a=X(),g=le(),u=gn(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:l}})=>(0,e.str)`must NOT have more than ${l} items`,params:({params:{len:l}})=>(0,e._)`{limit: ${l}}`},code(l){const{schema:c,parentSchema:d,it:_}=l,{prefixItems:h}=d;_.items=!0,!(0,a.alwaysValidSchema)(_,c)&&(h?(0,u.validateAdditionalItems)(l,h):l.ok((0,g.validateArray)(l)))}};return tt.default=o,tt}var rt={},Jr;function _s(){if(Jr)return rt;Jr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=J(),a=X(),u={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:v,max:o}})=>o===void 0?(0,e.str)`must contain at least ${v} valid item(s)`:(0,e.str)`must contain at least ${v} and no more than ${o} valid item(s)`,params:({params:{min:v,max:o}})=>o===void 0?(0,e._)`{minContains: ${v}}`:(0,e._)`{minContains: ${v}, maxContains: ${o}}`},code(v){const{gen:o,schema:l,parentSchema:c,data:d,it:_}=v;let h,S;const{minContains:R,maxContains:E}=c;_.opts.next?(h=R===void 0?1:R,S=E):h=1;const b=o.const("len",(0,e._)`${d}.length`);if(v.setParams({min:h,max:S}),S===void 0&&h===0){(0,a.checkStrictMode)(_,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(S!==void 0&&h>S){(0,a.checkStrictMode)(_,'"minContains" > "maxContains" is always invalid'),v.fail();return}if((0,a.alwaysValidSchema)(_,l)){let s=(0,e._)`${b} >= ${h}`;S!==void 0&&(s=(0,e._)`${s} && ${b} <= ${S}`),v.pass(s);return}_.items=!0;const y=o.name("valid");S===void 0&&h===1?r(y,()=>o.if(y,()=>o.break())):h===0?(o.let(y,!0),S!==void 0&&o.if((0,e._)`${d}.length > 0`,n)):(o.let(y,!1),n()),v.result(y,()=>v.reset());function n(){const s=o.name("_valid"),f=o.let("count",0);r(s,()=>o.if(s,()=>t(f)))}function r(s,f){o.forRange("i",0,b,m=>{v.subschema({keyword:"contains",dataProp:m,dataPropType:a.Type.Num,compositeRule:!0},s),f()})}function t(s){o.code((0,e._)`${s}++`),S===void 0?o.if((0,e._)`${s} >= ${h}`,()=>o.assign(y,!0).break()):(o.if((0,e._)`${s} > ${S}`,()=>o.assign(y,!1).break()),h===1?o.assign(y,!0):o.if((0,e._)`${s} >= ${h}`,()=>o.assign(y,!0)))}}};return rt.default=u,rt}var zt={},Wr;function gs(){return Wr||(Wr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const a=J(),g=X(),u=le();e.error={message:({params:{property:d,depsCount:_,deps:h}})=>{const S=_===1?"property":"properties";return(0,a.str)`must have ${S} ${h} when property ${d} is present`},params:({params:{property:d,depsCount:_,deps:h,missingProperty:S}})=>(0,a._)`{property: ${d},
6
- missingProperty: ${S},
7
- depsCount: ${_},
8
- deps: ${h}}`};const v={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(d){const[_,h]=o(d);l(d,_),c(d,h)}};function o({schema:d}){const _={},h={};for(const S in d){if(S==="__proto__")continue;const R=Array.isArray(d[S])?_:h;R[S]=d[S]}return[_,h]}function l(d,_=d.schema){const{gen:h,data:S,it:R}=d;if(Object.keys(_).length===0)return;const E=h.let("missing");for(const b in _){const y=_[b];if(y.length===0)continue;const n=(0,u.propertyInData)(h,S,b,R.opts.ownProperties);d.setParams({property:b,depsCount:y.length,deps:y.join(", ")}),R.allErrors?h.if(n,()=>{for(const r of y)(0,u.checkReportMissingProp)(d,r)}):(h.if((0,a._)`${n} && (${(0,u.checkMissingProp)(d,y,E)})`),(0,u.reportMissingProp)(d,E),h.else())}}e.validatePropertyDeps=l;function c(d,_=d.schema){const{gen:h,data:S,keyword:R,it:E}=d,b=h.name("valid");for(const y in _)(0,g.alwaysValidSchema)(E,_[y])||(h.if((0,u.propertyInData)(h,S,y,E.opts.ownProperties),()=>{const n=d.subschema({keyword:R,schemaProp:y},b);d.mergeValidEvaluated(n,b)},()=>h.var(b,!0)),d.ok(b))}e.validateSchemaDeps=c,e.default=v}(zt)),zt}var nt={},Br;function $s(){if(Br)return nt;Br=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=J(),a=X(),u={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:v})=>(0,e._)`{propertyName: ${v.propertyName}}`},code(v){const{gen:o,schema:l,data:c,it:d}=v;if((0,a.alwaysValidSchema)(d,l))return;const _=o.name("valid");o.forIn("key",c,h=>{v.setParams({propertyName:h}),v.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},_),o.if((0,e.not)(_),()=>{v.error(!0),d.allErrors||o.break()})}),v.ok(_)}};return nt.default=u,nt}var st={},Xr;function wn(){if(Xr)return st;Xr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=le(),a=J(),g=_e(),u=X(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,a._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:c,schema:d,parentSchema:_,data:h,errsCount:S,it:R}=l;if(!S)throw new Error("ajv implementation error");const{allErrors:E,opts:b}=R;if(R.props=!0,b.removeAdditional!=="all"&&(0,u.alwaysValidSchema)(R,d))return;const y=(0,e.allSchemaProperties)(_.properties),n=(0,e.allSchemaProperties)(_.patternProperties);r(),l.ok((0,a._)`${S} === ${g.default.errors}`);function r(){c.forIn("key",h,p=>{!y.length&&!n.length?f(p):c.if(t(p),()=>f(p))})}function t(p){let $;if(y.length>8){const k=(0,u.schemaRefOrVal)(R,_.properties,"properties");$=(0,e.isOwnProperty)(c,k,p)}else y.length?$=(0,a.or)(...y.map(k=>(0,a._)`${p} === ${k}`)):$=a.nil;return n.length&&($=(0,a.or)($,...n.map(k=>(0,a._)`${(0,e.usePattern)(l,k)}.test(${p})`))),(0,a.not)($)}function s(p){c.code((0,a._)`delete ${h}[${p}]`)}function f(p){if(b.removeAdditional==="all"||b.removeAdditional&&d===!1){s(p);return}if(d===!1){l.setParams({additionalProperty:p}),l.error(),E||c.break();return}if(typeof d=="object"&&!(0,u.alwaysValidSchema)(R,d)){const $=c.name("valid");b.removeAdditional==="failing"?(m(p,$,!1),c.if((0,a.not)($),()=>{l.reset(),s(p)})):(m(p,$),E||c.if((0,a.not)($),()=>c.break()))}}function m(p,$,k){const C={keyword:"additionalProperties",dataProp:p,dataPropType:u.Type.Str};k===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(C,$)}}};return st.default=o,st}var at={},Qr;function ws(){if(Qr)return at;Qr=1,Object.defineProperty(at,"__esModule",{value:!0});const e=bt(),a=le(),g=X(),u=wn(),v={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:l,schema:c,parentSchema:d,data:_,it:h}=o;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&u.default.code(new e.KeywordCxt(h,u.default,"additionalProperties"));const S=(0,a.allSchemaProperties)(c);for(const n of S)h.definedProperties.add(n);h.opts.unevaluated&&S.length&&h.props!==!0&&(h.props=g.mergeEvaluated.props(l,(0,g.toHash)(S),h.props));const R=S.filter(n=>!(0,g.alwaysValidSchema)(h,c[n]));if(R.length===0)return;const E=l.name("valid");for(const n of R)b(n)?y(n):(l.if((0,a.propertyInData)(l,_,n,h.opts.ownProperties)),y(n),h.allErrors||l.else().var(E,!0),l.endIf()),o.it.definedProperties.add(n),o.ok(E);function b(n){return h.opts.useDefaults&&!h.compositeRule&&c[n].default!==void 0}function y(n){o.subschema({keyword:"properties",schemaProp:n,dataProp:n},E)}}};return at.default=v,at}var ot={},Yr;function bs(){if(Yr)return ot;Yr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=le(),a=J(),g=X(),u=X(),v={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:l,schema:c,data:d,parentSchema:_,it:h}=o,{opts:S}=h,R=(0,e.allSchemaProperties)(c),E=R.filter(f=>(0,g.alwaysValidSchema)(h,c[f]));if(R.length===0||E.length===R.length&&(!h.opts.unevaluated||h.props===!0))return;const b=S.strictSchema&&!S.allowMatchingProperties&&_.properties,y=l.name("valid");h.props!==!0&&!(h.props instanceof a.Name)&&(h.props=(0,u.evaluatedPropsToName)(l,h.props));const{props:n}=h;r();function r(){for(const f of R)b&&t(f),h.allErrors?s(f):(l.var(y,!0),s(f),l.if(y))}function t(f){for(const m in b)new RegExp(f).test(m)&&(0,g.checkStrictMode)(h,`property ${m} matches pattern ${f} (use allowMatchingProperties)`)}function s(f){l.forIn("key",d,m=>{l.if((0,a._)`${(0,e.usePattern)(o,f)}.test(${m})`,()=>{const p=E.includes(f);p||o.subschema({keyword:"patternProperties",schemaProp:f,dataProp:m,dataPropType:u.Type.Str},y),h.opts.unevaluated&&n!==!0?l.assign((0,a._)`${n}[${m}]`,!0):!p&&!h.allErrors&&l.if((0,a.not)(y),()=>l.break())})})}}};return ot.default=v,ot}var it={},Zr;function Es(){if(Zr)return it;Zr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=X(),a={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(g){const{gen:u,schema:v,it:o}=g;if((0,e.alwaysValidSchema)(o,v)){g.fail();return}const l=u.name("valid");g.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),g.failResult(l,()=>g.reset(),()=>g.error())},error:{message:"must NOT be valid"}};return it.default=a,it}var ct={},xr;function Ss(){if(xr)return ct;xr=1,Object.defineProperty(ct,"__esModule",{value:!0});const a={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:le().validateUnion,error:{message:"must match a schema in anyOf"}};return ct.default=a,ct}var ut={},en;function Ps(){if(en)return ut;en=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=J(),a=X(),u={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:v})=>(0,e._)`{passingSchemas: ${v.passing}}`},code(v){const{gen:o,schema:l,parentSchema:c,it:d}=v;if(!Array.isArray(l))throw new Error("ajv implementation error");if(d.opts.discriminator&&c.discriminator)return;const _=l,h=o.let("valid",!1),S=o.let("passing",null),R=o.name("_valid");v.setParams({passing:S}),o.block(E),v.result(h,()=>v.reset(),()=>v.error(!0));function E(){_.forEach((b,y)=>{let n;(0,a.alwaysValidSchema)(d,b)?o.var(R,!0):n=v.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},R),y>0&&o.if((0,e._)`${R} && ${h}`).assign(h,!1).assign(S,(0,e._)`[${S}, ${y}]`).else(),o.if(R,()=>{o.assign(h,!0),o.assign(S,y),n&&v.mergeEvaluated(n,e.Name)})})}}};return ut.default=u,ut}var lt={},tn;function Rs(){if(tn)return lt;tn=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=X(),a={keyword:"allOf",schemaType:"array",code(g){const{gen:u,schema:v,it:o}=g;if(!Array.isArray(v))throw new Error("ajv implementation error");const l=u.name("valid");v.forEach((c,d)=>{if((0,e.alwaysValidSchema)(o,c))return;const _=g.subschema({keyword:"allOf",schemaProp:d},l);g.ok(l),g.mergeEvaluated(_)})}};return lt.default=a,lt}var dt={},rn;function Ns(){if(rn)return dt;rn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=J(),a=X(),u={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:l,parentSchema:c,it:d}=o;c.then===void 0&&c.else===void 0&&(0,a.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const _=v(d,"then"),h=v(d,"else");if(!_&&!h)return;const S=l.let("valid",!0),R=l.name("_valid");if(E(),o.reset(),_&&h){const y=l.let("ifClause");o.setParams({ifClause:y}),l.if(R,b("then",y),b("else",y))}else _?l.if(R,b("then")):l.if((0,e.not)(R),b("else"));o.pass(S,()=>o.error(!0));function E(){const y=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},R);o.mergeEvaluated(y)}function b(y,n){return()=>{const r=o.subschema({keyword:y},R);l.assign(S,R),o.mergeValidEvaluated(r,S),n?l.assign(n,(0,e._)`${y}`):o.setParams({ifClause:y})}}}};function v(o,l){const c=o.schema[l];return c!==void 0&&!(0,a.alwaysValidSchema)(o,c)}return dt.default=u,dt}var ft={},nn;function Os(){if(nn)return ft;nn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=X(),a={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:g,parentSchema:u,it:v}){u.if===void 0&&(0,e.checkStrictMode)(v,`"${g}" without "if" is ignored`)}};return ft.default=a,ft}var sn;function js(){if(sn)return xe;sn=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=gn(),a=ys(),g=$n(),u=vs(),v=_s(),o=gs(),l=$s(),c=wn(),d=ws(),_=bs(),h=Es(),S=Ss(),R=Ps(),E=Rs(),b=Ns(),y=Os();function n(r=!1){const t=[h.default,S.default,R.default,E.default,b.default,y.default,l.default,c.default,o.default,d.default,_.default];return r?t.push(a.default,u.default):t.push(e.default,g.default),t.push(v.default),t}return xe.default=n,xe}var ht={},pt={},an;function ks(){if(an)return pt;an=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=J(),g={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:u})=>(0,e.str)`must match format "${u}"`,params:({schemaCode:u})=>(0,e._)`{format: ${u}}`},code(u,v){const{gen:o,data:l,$data:c,schema:d,schemaCode:_,it:h}=u,{opts:S,errSchemaPath:R,schemaEnv:E,self:b}=h;if(!S.validateFormats)return;c?y():n();function y(){const r=o.scopeValue("formats",{ref:b.formats,code:S.code.formats}),t=o.const("fDef",(0,e._)`${r}[${_}]`),s=o.let("fType"),f=o.let("format");o.if((0,e._)`typeof ${t} == "object" && !(${t} instanceof RegExp)`,()=>o.assign(s,(0,e._)`${t}.type || "string"`).assign(f,(0,e._)`${t}.validate`),()=>o.assign(s,(0,e._)`"string"`).assign(f,t)),u.fail$data((0,e.or)(m(),p()));function m(){return S.strictSchema===!1?e.nil:(0,e._)`${_} && !${f}`}function p(){const $=E.$async?(0,e._)`(${t}.async ? await ${f}(${l}) : ${f}(${l}))`:(0,e._)`${f}(${l})`,k=(0,e._)`(typeof ${f} == "function" ? ${$} : ${f}.test(${l}))`;return(0,e._)`${f} && ${f} !== true && ${s} === ${v} && !${k}`}}function n(){const r=b.formats[d];if(!r){m();return}if(r===!0)return;const[t,s,f]=p(r);t===v&&u.pass($());function m(){if(S.strictSchema===!1){b.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${d}" ignored in schema at path "${R}"`}}function p(k){const C=k instanceof RegExp?(0,e.regexpCode)(k):S.code.formats?(0,e._)`${S.code.formats}${(0,e.getProperty)(d)}`:void 0,D=o.scopeValue("formats",{key:d,ref:k,code:C});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,e._)`${D}.validate`]:["string",k,D]}function $(){if(typeof r=="object"&&!(r instanceof RegExp)&&r.async){if(!E.$async)throw new Error("async format in sync schema");return(0,e._)`await ${f}(${l})`}return typeof s=="function"?(0,e._)`${f}(${l})`:(0,e._)`${f}.test(${l})`}}}};return pt.default=g,pt}var on;function Is(){if(on)return ht;on=1,Object.defineProperty(ht,"__esModule",{value:!0});const a=[ks().default];return ht.default=a,ht}var we={},cn;function Ts(){return cn||(cn=1,Object.defineProperty(we,"__esModule",{value:!0}),we.contentVocabulary=we.metadataVocabulary=void 0,we.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],we.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),we}var un;function qs(){if(un)return De;un=1,Object.defineProperty(De,"__esModule",{value:!0});const e=ns(),a=ms(),g=js(),u=Is(),v=Ts(),o=[e.default,a.default,(0,g.default)(),u.default,v.metadataVocabulary,v.contentVocabulary];return De.default=o,De}var mt={},ke={},ln;function Cs(){if(ln)return ke;ln=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.DiscrError=void 0;var e;return function(a){a.Tag="tag",a.Mapping="mapping"}(e||(ke.DiscrError=e={})),ke}var dn;function As(){if(dn)return mt;dn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=J(),a=Cs(),g=Ht(),u=Et(),v=X(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:d}})=>c===a.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,params:({params:{discrError:c,tag:d,tagName:_}})=>(0,e._)`{error: ${c}, tag: ${_}, tagValue: ${d}}`},code(c){const{gen:d,data:_,schema:h,parentSchema:S,it:R}=c,{oneOf:E}=S;if(!R.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=h.propertyName;if(typeof b!="string")throw new Error("discriminator: requires propertyName");if(h.mapping)throw new Error("discriminator: mapping is not supported");if(!E)throw new Error("discriminator: requires oneOf keyword");const y=d.let("valid",!1),n=d.const("tag",(0,e._)`${_}${(0,e.getProperty)(b)}`);d.if((0,e._)`typeof ${n} == "string"`,()=>r(),()=>c.error(!1,{discrError:a.DiscrError.Tag,tag:n,tagName:b})),c.ok(y);function r(){const f=s();d.if(!1);for(const m in f)d.elseIf((0,e._)`${n} === ${m}`),d.assign(y,t(f[m]));d.else(),c.error(!1,{discrError:a.DiscrError.Mapping,tag:n,tagName:b}),d.endIf()}function t(f){const m=d.name("valid"),p=c.subschema({keyword:"oneOf",schemaProp:f},m);return c.mergeEvaluated(p,e.Name),m}function s(){var f;const m={},p=k(S);let $=!0;for(let z=0;z<E.length;z++){let K=E[z];if(K?.$ref&&!(0,v.schemaHasRulesButRef)(K,R.self.RULES)){const B=K.$ref;if(K=g.resolveRef.call(R.self,R.schemaEnv.root,R.baseId,B),K instanceof g.SchemaEnv&&(K=K.schema),K===void 0)throw new u.default(R.opts.uriResolver,R.baseId,B)}const F=(f=K?.properties)===null||f===void 0?void 0:f[b];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);$=$&&(p||k(K)),C(F,z)}if(!$)throw new Error(`discriminator: "${b}" must be required`);return m;function k({required:z}){return Array.isArray(z)&&z.includes(b)}function C(z,K){if(z.const)D(z.const,K);else if(z.enum)for(const F of z.enum)D(F,K);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function D(z,K){if(typeof z!="string"||z in m)throw new Error(`discriminator: "${b}" values must be unique strings`);m[z]=K}}}};return mt.default=l,mt}const Ms="http://json-schema.org/draft-07/schema#",Ds="http://json-schema.org/draft-07/schema#",Vs="Core schema meta-schema",zs={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:[]}},Us=["object","boolean"],Ls={$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:"#"}},Fs={$schema:Ms,$id:Ds,title:Vs,definitions:zs,type:Us,properties:Ls,default:!0};var fn;function Ks(){return fn||(fn=1,function(e,a){Object.defineProperty(a,"__esModule",{value:!0}),a.MissingRefError=a.ValidationError=a.CodeGen=a.Name=a.nil=a.stringify=a.str=a._=a.KeywordCxt=a.Ajv=void 0;const g=es(),u=qs(),v=As(),o=Fs,l=["/properties"],c="http://json-schema.org/draft-07/schema";class d extends g.default{_addVocabularies(){super._addVocabularies(),u.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(v.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(o,l):o;this.addMetaSchema(b,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}a.Ajv=d,e.exports=a=d,e.exports.Ajv=d,Object.defineProperty(a,"__esModule",{value:!0}),a.default=d;var _=bt();Object.defineProperty(a,"KeywordCxt",{enumerable:!0,get:function(){return _.KeywordCxt}});var h=J();Object.defineProperty(a,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(a,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(a,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(a,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(a,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(a,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var S=Kt();Object.defineProperty(a,"ValidationError",{enumerable:!0,get:function(){return S.default}});var R=Et();Object.defineProperty(a,"MissingRefError",{enumerable:!0,get:function(){return R.default}})}(Te,Te.exports)),Te.exports}var Hs=Ks();const Gs=Mn(Hs),Js="https://schemas.oceanum.io/eidos/root.json";let Ie=null;const hn=async e=>{const a=await fetch(e);if(a.statusCode>=400)throw new Error("Loading error: "+a.statusCode);return a.body},Ws=async e=>{if(!Ie){const g=await hn(Js);Ie=await new Gs({allErrors:!0,verbose:!0,strict:!1,loadSchema:hn}).compileAsync(g)}if(!Ie(e)&&Ie.errors){const g=Ie.errors.map(u=>`${u.instancePath||"root"}: ${u.message} (${JSON.stringify(u.params||{})})`).join("; ");throw new Error(`EIDOS spec validation failed: ${g}`)}return!0},Bs="https://render.eidos.oceanum.io",bn=async(e,a,g={})=>{const{id:u,eventListener:v,renderer:o=Bs,authToken:l}=g,c=e.querySelector("iframe[data-eidos-renderer]"),d=e.getAttribute("data-eidos-initialized")==="true";if(c||d)throw new Error("EIDOS renderer already mounted in this container. Call destroy() before re-rendering.");e.setAttribute("data-eidos-initialized","true");try{await Ws(a)}catch(S){throw new Error(`Invalid Eidos Spec: ${S.message}`)}const _=mn(structuredClone(a)),h=u||a.id;return new Promise((S,R)=>{const E=document.createElement("iframe");E.src=`${o}?id=${h}`,E.width="100%",E.height="100%",E.frameBorder="0",E.setAttribute("data-eidos-renderer","true"),e.appendChild(E);let b=null,y=null;E.onload=()=>{const n=E.contentWindow,r=async t=>{const s=typeof t=="function"?await t():t;n?.postMessage({id:h,type:"auth",payload:s},"*")};b=t=>{t.source===n&&(t.data.id&&t.data.id!==h||(t.data.type==="init"?(n?.postMessage({id:h,type:"spec",payload:structuredClone(_)},"*"),l&&r(l)):(t.data.type||t.data.action||t.data.control)&&v?.(t.data)))},window.addEventListener("message",b),y=Cn(_,()=>{n?.postMessage({id:h,type:"spec",payload:An(_)},"*")}),l&&r(l),S({spec:_,updateAuth:r,iframe:E,destroy:()=>{b&&window.removeEventListener("message",b),y&&y(),E.remove(),e.removeAttribute("data-eidos-initialized")}})},E.onerror=()=>{R(new Error("Failed to load EIDOS renderer"))}})},En=Re.createContext(null),Xs=()=>{const e=Re.useContext(En);if(!e)throw new Error("useEidosSpec must be used within an EidosProvider");return e},Qs=({children:e,initialSpec:a,options:g={},containerStyle:u={width:"100%",height:"100%",position:"absolute"},onInitialized:v})=>{const o=Re.useRef(null),[l,c]=Re.useState(null),d=Re.useRef(!1);return Re.useEffect(()=>{if(!o.current||d.current)return;d.current=!0,(async()=>{try{const h=await bn(o.current,a,g);c(h.spec),v?.(h.spec)}catch(h){console.error("Failed to initialize EIDOS:",h),d.current=!1}})()},[a,g,v]),Nt.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[Nt.jsx("div",{ref:o,style:u}),l&&Nt.jsx(En.Provider,{value:l,children:e})]})};exports.EidosProvider=Qs;exports.render=bn;exports.useEidosSpec=Xs;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Nt=require("react/jsx-runtime"),Re=require("react"),Sn=Symbol(),Wt=Object.getPrototypeOf,zt=new WeakMap,Pn=e=>e&&(zt.has(e)?zt.get(e):Wt(e)===Object.prototype||Wt(e)===Array.prototype),Rn=e=>Pn(e)&&e[Sn]||null,Bt=(e,r=!0)=>{zt.set(e,r)},yt={},Ut=e=>typeof e=="object"&&e!==null,Nn=e=>Ut(e)&&!Ft.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise),fn=(e,r)=>{const g=Qt.get(e);if(g?.[0]===r)return g[1];const l=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return Bt(l,!0),Qt.set(e,[r,l]),Reflect.ownKeys(e).forEach(w=>{if(Object.getOwnPropertyDescriptor(l,w))return;const n=Reflect.get(e,w),{enumerable:d}=Reflect.getOwnPropertyDescriptor(e,w),c={value:n,enumerable:d,configurable:!0};if(Ft.has(n))Bt(n,!1);else if(be.has(n)){const[p,$]=be.get(n);c.value=fn(p,$())}Object.defineProperty(l,w,c)}),Object.preventExtensions(l)},On=(e,r,g,l)=>({deleteProperty(w,n){Reflect.get(w,n),g(n);const d=Reflect.deleteProperty(w,n);return d&&l(void 0),d},set(w,n,d,c){const p=!e()&&Reflect.has(w,n),$=Reflect.get(w,n,c);if(p&&(Xt($,d)||vt.has(d)&&Xt($,vt.get(d))))return!0;g(n),Ut(d)&&(d=Rn(d)||d);const y=!be.has(d)&&kn(d)?hn(d):d;return r(n,y),Reflect.set(w,n,y,c),l(void 0),!0}}),be=new WeakMap,Ft=new WeakSet,Qt=new WeakMap,Ot=[1],vt=new WeakMap;let Xt=Object.is,jn=(e,r)=>new Proxy(e,r),kn=Nn,In=fn,Tn=On;function hn(e={}){if(!Ut(e))throw new Error("object required");const r=vt.get(e);if(r)return r;let g=Ot[0];const l=new Set,w=(a,i=++Ot[0])=>{g!==i&&(n=g=i,l.forEach(t=>t(a,i)))};let n=g;const d=(a=Ot[0])=>(n!==a&&(n=a,p.forEach(([i])=>{const t=i[1](a);t>g&&(g=t)})),g),c=a=>(i,t)=>{let o;i&&(o=[...i],o[1]=[a,...o[1]]),w(o,t)},p=new Map,$=(a,i)=>{const t=!Ft.has(i)&&be.get(i);if(t){if((yt?"production":void 0)!=="production"&&p.has(a))throw new Error("prop listener already exists");if(l.size){const o=t[2](c(a));p.set(a,[t,o])}else p.set(a,[t])}},y=a=>{var i;const t=p.get(a);t&&(p.delete(a),(i=t[1])==null||i.call(t))},P=a=>(l.add(a),l.size===1&&p.forEach(([t,o],f)=>{if((yt?"production":void 0)!=="production"&&o)throw new Error("remove already exists");const s=t[2](c(f));p.set(f,[t,s])}),()=>{l.delete(a),l.size===0&&p.forEach(([t,o],f)=>{o&&(o(),p.set(f,[t]))})});let _=!0;const v=Tn(()=>_,$,y,w),m=jn(e,v);vt.set(e,m);const b=[e,d,P];return be.set(m,b),Reflect.ownKeys(e).forEach(a=>{const i=Object.getOwnPropertyDescriptor(e,a);"value"in i&&i.writable&&(m[a]=e[a])}),_=!1,m}function qn(e,r,g){const l=be.get(e);(yt?"production":void 0)!=="production"&&!l&&console.warn("Please use proxy object");let w;const n=[],d=l[2];let c=!1;const $=d(y=>{y&&n.push(y),w||(w=Promise.resolve().then(()=>{w=void 0,c&&r(n.splice(0))}))});return c=!0,()=>{c=!1,$()}}function Cn(e){const r=be.get(e);(yt?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");const[g,l]=r;return In(g,l())}function An(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Te={exports:{}},jt={},he={},ge={},kt={},It={},Tt={},Yt;function _t(){return Yt||(Yt=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 r{}e._CodeOrName=r,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class g extends r{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=g;class l extends r{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((o,f)=>`${o}${f}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((o,f)=>(f instanceof g&&(o[f.str]=(o[f.str]||0)+1),o),{})}}e._Code=l,e.nil=new l("");function w(i,...t){const o=[i[0]];let f=0;for(;f<t.length;)c(o,t[f]),o.push(i[++f]);return new l(o)}e._=w;const n=new l("+");function d(i,...t){const o=[v(i[0])];let f=0;for(;f<t.length;)o.push(n),c(o,t[f]),o.push(n,v(i[++f]));return p(o),new l(o)}e.str=d;function c(i,t){t instanceof l?i.push(...t._items):t instanceof g?i.push(t):i.push(P(t))}e.addCodeArg=c;function p(i){let t=1;for(;t<i.length-1;){if(i[t]===n){const o=$(i[t-1],i[t+1]);if(o!==void 0){i.splice(t-1,3,o);continue}i[t++]="+"}t++}}function $(i,t){if(t==='""')return i;if(i==='""')return t;if(typeof i=="string")return t instanceof g||i[i.length-1]!=='"'?void 0:typeof t!="string"?`${i.slice(0,-1)}${t}"`:t[0]==='"'?i.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(i instanceof g))return`"${i}${t.slice(1)}`}function y(i,t){return t.emptyStr()?i:i.emptyStr()?t:d`${i}${t}`}e.strConcat=y;function P(i){return typeof i=="number"||typeof i=="boolean"||i===null?i:v(Array.isArray(i)?i.join(","):i)}function _(i){return new l(v(i))}e.stringify=_;function v(i){return JSON.stringify(i).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function m(i){return typeof i=="string"&&e.IDENTIFIER.test(i)?new l(`.${i}`):w`[${i}]`}e.getProperty=m;function b(i){if(typeof i=="string"&&e.IDENTIFIER.test(i))return new l(`${i}`);throw new Error(`CodeGen: invalid export name: ${i}, use explicit $id name mapping`)}e.getEsmExportName=b;function a(i){return new l(i.toString())}e.regexpCode=a})(Tt)),Tt}var qt={},Zt;function xt(){return Zt||(Zt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const r=_t();class g extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`),this.value=$.value}}var l;(function(p){p[p.Started=0]="Started",p[p.Completed=1]="Completed"})(l||(e.UsedValueState=l={})),e.varKinds={const:new r.Name("const"),let:new r.Name("let"),var:new r.Name("var")};class w{constructor({prefixes:$,parent:y}={}){this._names={},this._prefixes=$,this._parent=y}toName($){return $ instanceof r.Name?$:this.name($)}name($){return new r.Name(this._newName($))}_newName($){const y=this._names[$]||this._nameGroup($);return`${$}${y.index++}`}_nameGroup($){var y,P;if(!((P=(y=this._parent)===null||y===void 0?void 0:y._prefixes)===null||P===void 0)&&P.has($)||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}e.Scope=w;class n extends r.Name{constructor($,y){super(y),this.prefix=$}setValue($,{property:y,itemIndex:P}){this.value=$,this.scopePath=(0,r._)`.${new r.Name(y)}[${P}]`}}e.ValueScopeName=n;const d=(0,r._)`\n`;class c extends w{constructor($){super($),this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?d:r.nil}}get(){return this._scope}name($){return new n($,this._newName($))}value($,y){var P;if(y.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const _=this.toName($),{prefix:v}=_,m=(P=y.key)!==null&&P!==void 0?P:y.ref;let b=this._values[v];if(b){const t=b.get(m);if(t)return t}else b=this._values[v]=new Map;b.set(m,_);const a=this._scope[v]||(this._scope[v]=[]),i=a.length;return a[i]=y.ref,_.setValue(y,{property:v,itemIndex:i}),_}getValue($,y){const P=this._values[$];if(P)return P.get(y)}scopeRefs($,y=this._values){return this._reduceValues(y,P=>{if(P.scopePath===void 0)throw new Error(`CodeGen: name "${P}" has no value`);return(0,r._)`${$}${P.scopePath}`})}scopeCode($=this._values,y,P){return this._reduceValues($,_=>{if(_.value===void 0)throw new Error(`CodeGen: name "${_}" has no value`);return _.value.code},y,P)}_reduceValues($,y,P={},_){let v=r.nil;for(const m in $){const b=$[m];if(!b)continue;const a=P[m]=P[m]||new Map;b.forEach(i=>{if(a.has(i))return;a.set(i,l.Started);let t=y(i);if(t){const o=this.opts.es5?e.varKinds.var:e.varKinds.const;v=(0,r._)`${v}${o} ${i} = ${t};${this.opts._n}`}else if(t=_?.(i))v=(0,r._)`${v}${t}${this.opts._n}`;else throw new g(i);a.set(i,l.Completed)})}return v}}e.ValueScope=c})(qt)),qt}var er;function J(){return er||(er=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 r=_t(),g=xt();var l=_t();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return l.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return l.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return l.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}});var w=xt();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return w.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return w.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return w.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return w.varKinds}}),e.operators={GT:new r._Code(">"),GTE:new r._Code(">="),LT:new r._Code("<"),LTE:new r._Code("<="),EQ:new r._Code("==="),NEQ:new r._Code("!=="),NOT:new r._Code("!"),OR:new r._Code("||"),AND:new r._Code("&&"),ADD:new r._Code("+")};class n{optimizeNodes(){return this}optimizeNames(u,S){return this}}class d extends n{constructor(u,S,I){super(),this.varKind=u,this.name=S,this.rhs=I}render({es5:u,_n:S}){const I=u?g.varKinds.var:this.varKind,z=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${z};`+S}optimizeNames(u,S){if(u[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,u,S)),this}get names(){return this.rhs instanceof r._CodeOrName?this.rhs.names:{}}}class c extends n{constructor(u,S,I){super(),this.lhs=u,this.rhs=S,this.sideEffects=I}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,S){if(!(this.lhs instanceof r.Name&&!u[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,u,S),this}get names(){const u=this.lhs instanceof r.Name?{}:{...this.lhs.names};return L(u,this.rhs)}}class p extends c{constructor(u,S,I,z){super(u,I,z),this.op=S}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}}class $ extends n{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}}class y extends n{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}}class P extends n{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}}class _ extends n{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,S){return this.code=B(this.code,u,S),this}get names(){return this.code instanceof r._CodeOrName?this.code.names:{}}}class v extends n{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((S,I)=>S+I.render(u),"")}optimizeNodes(){const{nodes:u}=this;let S=u.length;for(;S--;){const I=u[S].optimizeNodes();Array.isArray(I)?u.splice(S,1,...I):I?u[S]=I:u.splice(S,1)}return u.length>0?this:void 0}optimizeNames(u,S){const{nodes:I}=this;let z=I.length;for(;z--;){const F=I[z];F.optimizeNames(u,S)||(x(u,F.names),I.splice(z,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((u,S)=>K(u,S.names),{})}}class m extends v{render(u){return"{"+u._n+super.render(u)+"}"+u._n}}class b extends v{}class a extends m{}a.kind="else";class i extends m{constructor(u,S){super(S),this.condition=u}render(u){let S=`if(${this.condition})`+super.render(u);return this.else&&(S+="else "+this.else.render(u)),S}optimizeNodes(){super.optimizeNodes();const u=this.condition;if(u===!0)return this.nodes;let S=this.else;if(S){const I=S.optimizeNodes();S=this.else=Array.isArray(I)?new a(I):I}if(S)return u===!1?S instanceof i?S:S.nodes:this.nodes.length?this:new i(de(u),S instanceof i?[S]:S.nodes);if(!(u===!1||!this.nodes.length))return this}optimizeNames(u,S){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(u,S),!!(super.optimizeNames(u,S)||this.else))return this.condition=B(this.condition,u,S),this}get names(){const u=super.names;return L(u,this.condition),this.else&&K(u,this.else.names),u}}i.kind="if";class t extends m{}t.kind="for";class o extends t{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,S){if(super.optimizeNames(u,S))return this.iteration=B(this.iteration,u,S),this}get names(){return K(super.names,this.iteration.names)}}class f extends t{constructor(u,S,I,z){super(),this.varKind=u,this.name=S,this.from=I,this.to=z}render(u){const S=u.es5?g.varKinds.var:this.varKind,{name:I,from:z,to:F}=this;return`for(${S} ${I}=${z}; ${I}<${F}; ${I}++)`+super.render(u)}get names(){const u=L(super.names,this.from);return L(u,this.to)}}class s extends t{constructor(u,S,I,z){super(),this.loop=u,this.varKind=S,this.name=I,this.iterable=z}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,S){if(super.optimizeNames(u,S))return this.iterable=B(this.iterable,u,S),this}get names(){return K(super.names,this.iterable.names)}}class h extends m{constructor(u,S,I){super(),this.name=u,this.args=S,this.async=I}render(u){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(u)}}h.kind="func";class E extends v{render(u){return"return "+super.render(u)}}E.kind="return";class k extends m{render(u){let S="try"+super.render(u);return this.catch&&(S+=this.catch.render(u)),this.finally&&(S+=this.finally.render(u)),S}optimizeNodes(){var u,S;return super.optimizeNodes(),(u=this.catch)===null||u===void 0||u.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(u,S){var I,z;return super.optimizeNames(u,S),(I=this.catch)===null||I===void 0||I.optimizeNames(u,S),(z=this.finally)===null||z===void 0||z.optimizeNames(u,S),this}get names(){const u=super.names;return this.catch&&K(u,this.catch.names),this.finally&&K(u,this.finally.names),u}}class C extends m{constructor(u){super(),this.error=u}render(u){return`catch(${this.error})`+super.render(u)}}C.kind="catch";class D extends m{render(u){return"finally"+super.render(u)}}D.kind="finally";class V{constructor(u,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
2
+ `:""},this._extScope=u,this._scope=new g.Scope({parent:u}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(u){return this._scope.name(u)}scopeName(u){return this._extScope.name(u)}scopeValue(u,S){const I=this._extScope.value(u,S);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(u,S){return this._extScope.getValue(u,S)}scopeRefs(u){return this._extScope.scopeRefs(u,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(u,S,I,z){const F=this._scope.toName(S);return I!==void 0&&z&&(this._constants[F.str]=I),this._leafNode(new d(u,F,I)),F}const(u,S,I){return this._def(g.varKinds.const,u,S,I)}let(u,S,I){return this._def(g.varKinds.let,u,S,I)}var(u,S,I){return this._def(g.varKinds.var,u,S,I)}assign(u,S,I){return this._leafNode(new c(u,S,I))}add(u,S){return this._leafNode(new p(u,e.operators.ADD,S))}code(u){return typeof u=="function"?u():u!==r.nil&&this._leafNode(new _(u)),this}object(...u){const S=["{"];for(const[I,z]of u)S.length>1&&S.push(","),S.push(I),(I!==z||this.opts.es5)&&(S.push(":"),(0,r.addCodeArg)(S,z));return S.push("}"),new r._Code(S)}if(u,S,I){if(this._blockNode(new i(u)),S&&I)this.code(S).else().code(I).endIf();else if(S)this.code(S).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(u){return this._elseNode(new i(u))}else(){return this._elseNode(new a)}endIf(){return this._endBlockNode(i,a)}_for(u,S){return this._blockNode(u),S&&this.code(S).endFor(),this}for(u,S){return this._for(new o(u),S)}forRange(u,S,I,z,F=this.opts.es5?g.varKinds.var:g.varKinds.let){const X=this._scope.toName(u);return this._for(new f(F,X,S,I),()=>z(X))}forOf(u,S,I,z=g.varKinds.const){const F=this._scope.toName(u);if(this.opts.es5){const X=S instanceof r.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,r._)`${X}.length`,W=>{this.var(F,(0,r._)`${X}[${W}]`),I(F)})}return this._for(new s("of",z,F,S),()=>I(F))}forIn(u,S,I,z=this.opts.es5?g.varKinds.var:g.varKinds.const){if(this.opts.ownProperties)return this.forOf(u,(0,r._)`Object.keys(${S})`,I);const F=this._scope.toName(u);return this._for(new s("in",z,F,S),()=>I(F))}endFor(){return this._endBlockNode(t)}label(u){return this._leafNode(new $(u))}break(u){return this._leafNode(new y(u))}return(u){const S=new E;if(this._blockNode(S),this.code(u),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(u,S,I){if(!S&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const z=new k;if(this._blockNode(z),this.code(u),S){const F=this.name("e");this._currNode=z.catch=new C(F),S(F)}return I&&(this._currNode=z.finally=new D,this.code(I)),this._endBlockNode(C,D)}throw(u){return this._leafNode(new P(u))}block(u,S){return this._blockStarts.push(this._nodes.length),u&&this.code(u).endBlock(S),this}endBlock(u){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-S;if(I<0||u!==void 0&&I!==u)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${u} expected`);return this._nodes.length=S,this}func(u,S=r.nil,I,z){return this._blockNode(new h(u,S,I)),z&&this.code(z).endFunc(),this}endFunc(){return this._endBlockNode(h)}optimize(u=1){for(;u-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(u){return this._currNode.nodes.push(u),this}_blockNode(u){this._currNode.nodes.push(u),this._nodes.push(u)}_endBlockNode(u,S){const I=this._currNode;if(I instanceof u||S&&I instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${u.kind}/${S.kind}`:u.kind}"`)}_elseNode(u){const S=this._currNode;if(!(S instanceof i))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=u,this}get _root(){return this._nodes[0]}get _currNode(){const u=this._nodes;return u[u.length-1]}set _currNode(u){const S=this._nodes;S[S.length-1]=u}}e.CodeGen=V;function K(j,u){for(const S in u)j[S]=(j[S]||0)+(u[S]||0);return j}function L(j,u){return u instanceof r._CodeOrName?K(j,u.names):j}function B(j,u,S){if(j instanceof r.Name)return I(j);if(!z(j))return j;return new r._Code(j._items.reduce((F,X)=>(X instanceof r.Name&&(X=I(X)),X instanceof r._Code?F.push(...X._items):F.push(X),F),[]));function I(F){const X=S[F.str];return X===void 0||u[F.str]!==1?F:(delete u[F.str],X)}function z(F){return F instanceof r._Code&&F._items.some(X=>X instanceof r.Name&&u[X.str]===1&&S[X.str]!==void 0)}}function x(j,u){for(const S in u)j[S]=(j[S]||0)-(u[S]||0)}function de(j){return typeof j=="boolean"||typeof j=="number"||j===null?!j:(0,r._)`!${q(j)}`}e.not=de;const fe=N(e.operators.AND);function Z(...j){return j.reduce(fe)}e.and=Z;const ye=N(e.operators.OR);function A(...j){return j.reduce(ye)}e.or=A;function N(j){return(u,S)=>u===r.nil?S:S===r.nil?u:(0,r._)`${q(u)} ${j} ${q(S)}`}function q(j){return j instanceof r.Name?j:(0,r._)`(${j})`}})(It)),It}var H={},tr;function Q(){if(tr)return H;tr=1,Object.defineProperty(H,"__esModule",{value:!0}),H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;const e=J(),r=_t();function g(s){const h={};for(const E of s)h[E]=!0;return h}H.toHash=g;function l(s,h){return typeof h=="boolean"?h:Object.keys(h).length===0?!0:(w(s,h),!n(h,s.self.RULES.all))}H.alwaysValidSchema=l;function w(s,h=s.schema){const{opts:E,self:k}=s;if(!E.strictSchema||typeof h=="boolean")return;const C=k.RULES.keywords;for(const D in h)C[D]||f(s,`unknown keyword: "${D}"`)}H.checkUnknownRules=w;function n(s,h){if(typeof s=="boolean")return!s;for(const E in s)if(h[E])return!0;return!1}H.schemaHasRules=n;function d(s,h){if(typeof s=="boolean")return!s;for(const E in s)if(E!=="$ref"&&h.all[E])return!0;return!1}H.schemaHasRulesButRef=d;function c({topSchemaRef:s,schemaPath:h},E,k,C){if(!C){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,e._)`${E}`}return(0,e._)`${s}${h}${(0,e.getProperty)(k)}`}H.schemaRefOrVal=c;function p(s){return P(decodeURIComponent(s))}H.unescapeFragment=p;function $(s){return encodeURIComponent(y(s))}H.escapeFragment=$;function y(s){return typeof s=="number"?`${s}`:s.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=y;function P(s){return s.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=P;function _(s,h){if(Array.isArray(s))for(const E of s)h(E);else h(s)}H.eachItem=_;function v({mergeNames:s,mergeToName:h,mergeValues:E,resultToName:k}){return(C,D,V,K)=>{const L=V===void 0?D:V instanceof e.Name?(D instanceof e.Name?s(C,D,V):h(C,D,V),V):D instanceof e.Name?(h(C,V,D),D):E(D,V);return K===e.Name&&!(L instanceof e.Name)?k(C,L):L}}H.mergeEvaluated={props:v({mergeNames:(s,h,E)=>s.if((0,e._)`${E} !== true && ${h} !== undefined`,()=>{s.if((0,e._)`${h} === true`,()=>s.assign(E,!0),()=>s.assign(E,(0,e._)`${E} || {}`).code((0,e._)`Object.assign(${E}, ${h})`))}),mergeToName:(s,h,E)=>s.if((0,e._)`${E} !== true`,()=>{h===!0?s.assign(E,!0):(s.assign(E,(0,e._)`${E} || {}`),b(s,E,h))}),mergeValues:(s,h)=>s===!0?!0:{...s,...h},resultToName:m}),items:v({mergeNames:(s,h,E)=>s.if((0,e._)`${E} !== true && ${h} !== undefined`,()=>s.assign(E,(0,e._)`${h} === true ? true : ${E} > ${h} ? ${E} : ${h}`)),mergeToName:(s,h,E)=>s.if((0,e._)`${E} !== true`,()=>s.assign(E,h===!0?!0:(0,e._)`${E} > ${h} ? ${E} : ${h}`)),mergeValues:(s,h)=>s===!0?!0:Math.max(s,h),resultToName:(s,h)=>s.var("items",h)})};function m(s,h){if(h===!0)return s.var("props",!0);const E=s.var("props",(0,e._)`{}`);return h!==void 0&&b(s,E,h),E}H.evaluatedPropsToName=m;function b(s,h,E){Object.keys(E).forEach(k=>s.assign((0,e._)`${h}${(0,e.getProperty)(k)}`,!0))}H.setEvaluated=b;const a={};function i(s,h){return s.scopeValue("func",{ref:h,code:a[h.code]||(a[h.code]=new r._Code(h.code))})}H.useFunc=i;var t;(function(s){s[s.Num=0]="Num",s[s.Str=1]="Str"})(t||(H.Type=t={}));function o(s,h,E){if(s instanceof e.Name){const k=h===t.Num;return E?k?(0,e._)`"[" + ${s} + "]"`:(0,e._)`"['" + ${s} + "']"`:k?(0,e._)`"/" + ${s}`:(0,e._)`"/" + ${s}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,e.getProperty)(s).toString():"/"+y(s)}H.getErrorPath=o;function f(s,h,E=s.opts.strictSchema){if(E){if(h=`strict mode: ${h}`,E===!0)throw new Error(h);s.self.logger.warn(h)}}return H.checkStrictMode=f,H}var qe={},rr;function _e(){if(rr)return qe;rr=1,Object.defineProperty(qe,"__esModule",{value:!0});const e=J(),r={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 qe.default=r,qe}var nr;function $t(){return nr||(nr=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 r=J(),g=Q(),l=_e();e.keywordError={message:({keyword:a})=>(0,r.str)`must pass "${a}" keyword validation`},e.keyword$DataError={message:({keyword:a,schemaType:i})=>i?(0,r.str)`"${a}" keyword must be ${i} ($data)`:(0,r.str)`"${a}" keyword is invalid ($data)`};function w(a,i=e.keywordError,t,o){const{it:f}=a,{gen:s,compositeRule:h,allErrors:E}=f,k=P(a,i,t);o??(h||E)?p(s,k):$(f,(0,r._)`[${k}]`)}e.reportError=w;function n(a,i=e.keywordError,t){const{it:o}=a,{gen:f,compositeRule:s,allErrors:h}=o,E=P(a,i,t);p(f,E),s||h||$(o,l.default.vErrors)}e.reportExtraError=n;function d(a,i){a.assign(l.default.errors,i),a.if((0,r._)`${l.default.vErrors} !== null`,()=>a.if(i,()=>a.assign((0,r._)`${l.default.vErrors}.length`,i),()=>a.assign(l.default.vErrors,null)))}e.resetErrorsCount=d;function c({gen:a,keyword:i,schemaValue:t,data:o,errsCount:f,it:s}){if(f===void 0)throw new Error("ajv implementation error");const h=a.name("err");a.forRange("i",f,l.default.errors,E=>{a.const(h,(0,r._)`${l.default.vErrors}[${E}]`),a.if((0,r._)`${h}.instancePath === undefined`,()=>a.assign((0,r._)`${h}.instancePath`,(0,r.strConcat)(l.default.instancePath,s.errorPath))),a.assign((0,r._)`${h}.schemaPath`,(0,r.str)`${s.errSchemaPath}/${i}`),s.opts.verbose&&(a.assign((0,r._)`${h}.schema`,t),a.assign((0,r._)`${h}.data`,o))})}e.extendErrors=c;function p(a,i){const t=a.const("err",i);a.if((0,r._)`${l.default.vErrors} === null`,()=>a.assign(l.default.vErrors,(0,r._)`[${t}]`),(0,r._)`${l.default.vErrors}.push(${t})`),a.code((0,r._)`${l.default.errors}++`)}function $(a,i){const{gen:t,validateName:o,schemaEnv:f}=a;f.$async?t.throw((0,r._)`new ${a.ValidationError}(${i})`):(t.assign((0,r._)`${o}.errors`,i),t.return(!1))}const y={keyword:new r.Name("keyword"),schemaPath:new r.Name("schemaPath"),params:new r.Name("params"),propertyName:new r.Name("propertyName"),message:new r.Name("message"),schema:new r.Name("schema"),parentSchema:new r.Name("parentSchema")};function P(a,i,t){const{createErrors:o}=a.it;return o===!1?(0,r._)`{}`:_(a,i,t)}function _(a,i,t={}){const{gen:o,it:f}=a,s=[v(f,t),m(a,t)];return b(a,i,s),o.object(...s)}function v({errorPath:a},{instancePath:i}){const t=i?(0,r.str)`${a}${(0,g.getErrorPath)(i,g.Type.Str)}`:a;return[l.default.instancePath,(0,r.strConcat)(l.default.instancePath,t)]}function m({keyword:a,it:{errSchemaPath:i}},{schemaPath:t,parentSchema:o}){let f=o?i:(0,r.str)`${i}/${a}`;return t&&(f=(0,r.str)`${f}${(0,g.getErrorPath)(t,g.Type.Str)}`),[y.schemaPath,f]}function b(a,{params:i,message:t},o){const{keyword:f,data:s,schemaValue:h,it:E}=a,{opts:k,propertyName:C,topSchemaRef:D,schemaPath:V}=E;o.push([y.keyword,f],[y.params,typeof i=="function"?i(a):i||(0,r._)`{}`]),k.messages&&o.push([y.message,typeof t=="function"?t(a):t]),k.verbose&&o.push([y.schema,h],[y.parentSchema,(0,r._)`${D}${V}`],[l.default.data,s]),C&&o.push([y.propertyName,C])}})(kt)),kt}var sr;function Mn(){if(sr)return ge;sr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.boolOrEmptySchema=ge.topBoolOrEmptySchema=void 0;const e=$t(),r=J(),g=_e(),l={message:"boolean schema is false"};function w(c){const{gen:p,schema:$,validateName:y}=c;$===!1?d(c,!1):typeof $=="object"&&$.$async===!0?p.return(g.default.data):(p.assign((0,r._)`${y}.errors`,null),p.return(!0))}ge.topBoolOrEmptySchema=w;function n(c,p){const{gen:$,schema:y}=c;y===!1?($.var(p,!1),d(c)):$.var(p,!0)}ge.boolOrEmptySchema=n;function d(c,p){const{gen:$,data:y}=c,P={gen:$,keyword:"false schema",data:y,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,e.reportError)(P,l,void 0,p)}return ge}var re={},$e={},ar;function pn(){if(ar)return $e;ar=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.getRules=$e.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],r=new Set(e);function g(w){return typeof w=="string"&&r.has(w)}$e.isJSONType=g;function l(){const w={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...w,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},w.number,w.string,w.array,w.object],post:{rules:[]},all:{},keywords:{}}}return $e.getRules=l,$e}var pe={},or;function mn(){if(or)return pe;or=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.shouldUseRule=pe.shouldUseGroup=pe.schemaHasRulesForType=void 0;function e({schema:l,self:w},n){const d=w.RULES.types[n];return d&&d!==!0&&r(l,d)}pe.schemaHasRulesForType=e;function r(l,w){return w.rules.some(n=>g(l,n))}pe.shouldUseGroup=r;function g(l,w){var n;return l[w.keyword]!==void 0||((n=w.definition.implements)===null||n===void 0?void 0:n.some(d=>l[d]!==void 0))}return pe.shouldUseRule=g,pe}var ir;function gt(){if(ir)return re;ir=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=pn(),r=mn(),g=$t(),l=J(),w=Q();var n;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(n||(re.DataType=n={}));function d(t){const o=c(t.type);if(o.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!o.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&o.push("null")}return o}re.getSchemaTypes=d;function c(t){const o=Array.isArray(t)?t:t?[t]:[];if(o.every(e.isJSONType))return o;throw new Error("type must be JSONType or JSONType[]: "+o.join(","))}re.getJSONTypes=c;function p(t,o){const{gen:f,data:s,opts:h}=t,E=y(o,h.coerceTypes),k=o.length>0&&!(E.length===0&&o.length===1&&(0,r.schemaHasRulesForType)(t,o[0]));if(k){const C=m(o,s,h.strictNumbers,n.Wrong);f.if(C,()=>{E.length?P(t,o,E):a(t)})}return k}re.coerceAndCheckDataType=p;const $=new Set(["string","number","integer","boolean","null"]);function y(t,o){return o?t.filter(f=>$.has(f)||o==="array"&&f==="array"):[]}function P(t,o,f){const{gen:s,data:h,opts:E}=t,k=s.let("dataType",(0,l._)`typeof ${h}`),C=s.let("coerced",(0,l._)`undefined`);E.coerceTypes==="array"&&s.if((0,l._)`${k} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>s.assign(h,(0,l._)`${h}[0]`).assign(k,(0,l._)`typeof ${h}`).if(m(o,h,E.strictNumbers),()=>s.assign(C,h))),s.if((0,l._)`${C} !== undefined`);for(const V of f)($.has(V)||V==="array"&&E.coerceTypes==="array")&&D(V);s.else(),a(t),s.endIf(),s.if((0,l._)`${C} !== undefined`,()=>{s.assign(h,C),_(t,C)});function D(V){switch(V){case"string":s.elseIf((0,l._)`${k} == "number" || ${k} == "boolean"`).assign(C,(0,l._)`"" + ${h}`).elseIf((0,l._)`${h} === null`).assign(C,(0,l._)`""`);return;case"number":s.elseIf((0,l._)`${k} == "boolean" || ${h} === null
3
+ || (${k} == "string" && ${h} && ${h} == +${h})`).assign(C,(0,l._)`+${h}`);return;case"integer":s.elseIf((0,l._)`${k} === "boolean" || ${h} === null
4
+ || (${k} === "string" && ${h} && ${h} == +${h} && !(${h} % 1))`).assign(C,(0,l._)`+${h}`);return;case"boolean":s.elseIf((0,l._)`${h} === "false" || ${h} === 0 || ${h} === null`).assign(C,!1).elseIf((0,l._)`${h} === "true" || ${h} === 1`).assign(C,!0);return;case"null":s.elseIf((0,l._)`${h} === "" || ${h} === 0 || ${h} === false`),s.assign(C,null);return;case"array":s.elseIf((0,l._)`${k} === "string" || ${k} === "number"
5
+ || ${k} === "boolean" || ${h} === null`).assign(C,(0,l._)`[${h}]`)}}}function _({gen:t,parentData:o,parentDataProperty:f},s){t.if((0,l._)`${o} !== undefined`,()=>t.assign((0,l._)`${o}[${f}]`,s))}function v(t,o,f,s=n.Correct){const h=s===n.Correct?l.operators.EQ:l.operators.NEQ;let E;switch(t){case"null":return(0,l._)`${o} ${h} null`;case"array":E=(0,l._)`Array.isArray(${o})`;break;case"object":E=(0,l._)`${o} && typeof ${o} == "object" && !Array.isArray(${o})`;break;case"integer":E=k((0,l._)`!(${o} % 1) && !isNaN(${o})`);break;case"number":E=k();break;default:return(0,l._)`typeof ${o} ${h} ${t}`}return s===n.Correct?E:(0,l.not)(E);function k(C=l.nil){return(0,l.and)((0,l._)`typeof ${o} == "number"`,C,f?(0,l._)`isFinite(${o})`:l.nil)}}re.checkDataType=v;function m(t,o,f,s){if(t.length===1)return v(t[0],o,f,s);let h;const E=(0,w.toHash)(t);if(E.array&&E.object){const k=(0,l._)`typeof ${o} != "object"`;h=E.null?k:(0,l._)`!${o} || ${k}`,delete E.null,delete E.array,delete E.object}else h=l.nil;E.number&&delete E.integer;for(const k in E)h=(0,l.and)(h,v(k,o,f,s));return h}re.checkDataTypes=m;const b={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:o})=>typeof t=="string"?(0,l._)`{type: ${t}}`:(0,l._)`{type: ${o}}`};function a(t){const o=i(t);(0,g.reportError)(o,b)}re.reportTypeError=a;function i(t){const{gen:o,data:f,schema:s}=t,h=(0,w.schemaRefOrVal)(t,s,"type");return{gen:o,keyword:"type",data:f,schema:s.type,schemaCode:h,schemaValue:h,parentSchema:s,params:{},it:t}}return re}var Oe={},cr;function Dn(){if(cr)return Oe;cr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.assignDefaults=void 0;const e=J(),r=Q();function g(w,n){const{properties:d,items:c}=w.schema;if(n==="object"&&d)for(const p in d)l(w,p,d[p].default);else n==="array"&&Array.isArray(c)&&c.forEach((p,$)=>l(w,$,p.default))}Oe.assignDefaults=g;function l(w,n,d){const{gen:c,compositeRule:p,data:$,opts:y}=w;if(d===void 0)return;const P=(0,e._)`${$}${(0,e.getProperty)(n)}`;if(p){(0,r.checkStrictMode)(w,`default is ignored for: ${P}`);return}let _=(0,e._)`${P} === undefined`;y.useDefaults==="empty"&&(_=(0,e._)`${_} || ${P} === null || ${P} === ""`),c.if(_,(0,e._)`${P} = ${(0,e.stringify)(d)}`)}return Oe}var ue={},Y={},ur;function le(){if(ur)return Y;ur=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.validateUnion=Y.validateArray=Y.usePattern=Y.callValidateCode=Y.schemaProperties=Y.allSchemaProperties=Y.noPropertyInData=Y.propertyInData=Y.isOwnProperty=Y.hasPropFunc=Y.reportMissingProp=Y.checkMissingProp=Y.checkReportMissingProp=void 0;const e=J(),r=Q(),g=_e(),l=Q();function w(t,o){const{gen:f,data:s,it:h}=t;f.if(y(f,s,o,h.opts.ownProperties),()=>{t.setParams({missingProperty:(0,e._)`${o}`},!0),t.error()})}Y.checkReportMissingProp=w;function n({gen:t,data:o,it:{opts:f}},s,h){return(0,e.or)(...s.map(E=>(0,e.and)(y(t,o,E,f.ownProperties),(0,e._)`${h} = ${E}`)))}Y.checkMissingProp=n;function d(t,o){t.setParams({missingProperty:o},!0),t.error()}Y.reportMissingProp=d;function c(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Y.hasPropFunc=c;function p(t,o,f){return(0,e._)`${c(t)}.call(${o}, ${f})`}Y.isOwnProperty=p;function $(t,o,f,s){const h=(0,e._)`${o}${(0,e.getProperty)(f)} !== undefined`;return s?(0,e._)`${h} && ${p(t,o,f)}`:h}Y.propertyInData=$;function y(t,o,f,s){const h=(0,e._)`${o}${(0,e.getProperty)(f)} === undefined`;return s?(0,e.or)(h,(0,e.not)(p(t,o,f))):h}Y.noPropertyInData=y;function P(t){return t?Object.keys(t).filter(o=>o!=="__proto__"):[]}Y.allSchemaProperties=P;function _(t,o){return P(o).filter(f=>!(0,r.alwaysValidSchema)(t,o[f]))}Y.schemaProperties=_;function v({schemaCode:t,data:o,it:{gen:f,topSchemaRef:s,schemaPath:h,errorPath:E},it:k},C,D,V){const K=V?(0,e._)`${t}, ${o}, ${s}${h}`:o,L=[[g.default.instancePath,(0,e.strConcat)(g.default.instancePath,E)],[g.default.parentData,k.parentData],[g.default.parentDataProperty,k.parentDataProperty],[g.default.rootData,g.default.rootData]];k.opts.dynamicRef&&L.push([g.default.dynamicAnchors,g.default.dynamicAnchors]);const B=(0,e._)`${K}, ${f.object(...L)}`;return D!==e.nil?(0,e._)`${C}.call(${D}, ${B})`:(0,e._)`${C}(${B})`}Y.callValidateCode=v;const m=(0,e._)`new RegExp`;function b({gen:t,it:{opts:o}},f){const s=o.unicodeRegExp?"u":"",{regExp:h}=o.code,E=h(f,s);return t.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,e._)`${h.code==="new RegExp"?m:(0,l.useFunc)(t,h)}(${f}, ${s})`})}Y.usePattern=b;function a(t){const{gen:o,data:f,keyword:s,it:h}=t,E=o.name("valid");if(h.allErrors){const C=o.let("valid",!0);return k(()=>o.assign(C,!1)),C}return o.var(E,!0),k(()=>o.break()),E;function k(C){const D=o.const("len",(0,e._)`${f}.length`);o.forRange("i",0,D,V=>{t.subschema({keyword:s,dataProp:V,dataPropType:r.Type.Num},E),o.if((0,e.not)(E),C)})}}Y.validateArray=a;function i(t){const{gen:o,schema:f,keyword:s,it:h}=t;if(!Array.isArray(f))throw new Error("ajv implementation error");if(f.some(D=>(0,r.alwaysValidSchema)(h,D))&&!h.opts.unevaluated)return;const k=o.let("valid",!1),C=o.name("_valid");o.block(()=>f.forEach((D,V)=>{const K=t.subschema({keyword:s,schemaProp:V,compositeRule:!0},C);o.assign(k,(0,e._)`${k} || ${C}`),t.mergeValidEvaluated(K,C)||o.if((0,e.not)(k))})),t.result(k,()=>t.reset(),()=>t.error(!0))}return Y.validateUnion=i,Y}var lr;function Vn(){if(lr)return ue;lr=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.validateKeywordUsage=ue.validSchemaType=ue.funcKeywordCode=ue.macroKeywordCode=void 0;const e=J(),r=_e(),g=le(),l=$t();function w(_,v){const{gen:m,keyword:b,schema:a,parentSchema:i,it:t}=_,o=v.macro.call(t.self,a,i,t),f=$(m,b,o);t.opts.validateSchema!==!1&&t.self.validateSchema(o,!0);const s=m.name("valid");_.subschema({schema:o,schemaPath:e.nil,errSchemaPath:`${t.errSchemaPath}/${b}`,topSchemaRef:f,compositeRule:!0},s),_.pass(s,()=>_.error(!0))}ue.macroKeywordCode=w;function n(_,v){var m;const{gen:b,keyword:a,schema:i,parentSchema:t,$data:o,it:f}=_;p(f,v);const s=!o&&v.compile?v.compile.call(f.self,i,t,f):v.validate,h=$(b,a,s),E=b.let("valid");_.block$data(E,k),_.ok((m=v.valid)!==null&&m!==void 0?m:E);function k(){if(v.errors===!1)V(),v.modifying&&d(_),K(()=>_.error());else{const L=v.async?C():D();v.modifying&&d(_),K(()=>c(_,L))}}function C(){const L=b.let("ruleErrs",null);return b.try(()=>V((0,e._)`await `),B=>b.assign(E,!1).if((0,e._)`${B} instanceof ${f.ValidationError}`,()=>b.assign(L,(0,e._)`${B}.errors`),()=>b.throw(B))),L}function D(){const L=(0,e._)`${h}.errors`;return b.assign(L,null),V(e.nil),L}function V(L=v.async?(0,e._)`await `:e.nil){const B=f.opts.passContext?r.default.this:r.default.self,x=!("compile"in v&&!o||v.schema===!1);b.assign(E,(0,e._)`${L}${(0,g.callValidateCode)(_,h,B,x)}`,v.modifying)}function K(L){var B;b.if((0,e.not)((B=v.valid)!==null&&B!==void 0?B:E),L)}}ue.funcKeywordCode=n;function d(_){const{gen:v,data:m,it:b}=_;v.if(b.parentData,()=>v.assign(m,(0,e._)`${b.parentData}[${b.parentDataProperty}]`))}function c(_,v){const{gen:m}=_;m.if((0,e._)`Array.isArray(${v})`,()=>{m.assign(r.default.vErrors,(0,e._)`${r.default.vErrors} === null ? ${v} : ${r.default.vErrors}.concat(${v})`).assign(r.default.errors,(0,e._)`${r.default.vErrors}.length`),(0,l.extendErrors)(_)},()=>_.error())}function p({schemaEnv:_},v){if(v.async&&!_.$async)throw new Error("async keyword in sync schema")}function $(_,v,m){if(m===void 0)throw new Error(`keyword "${v}" failed to compile`);return _.scopeValue("keyword",typeof m=="function"?{ref:m}:{ref:m,code:(0,e.stringify)(m)})}function y(_,v,m=!1){return!v.length||v.some(b=>b==="array"?Array.isArray(_):b==="object"?_&&typeof _=="object"&&!Array.isArray(_):typeof _==b||m&&typeof _>"u")}ue.validSchemaType=y;function P({schema:_,opts:v,self:m,errSchemaPath:b},a,i){if(Array.isArray(a.keyword)?!a.keyword.includes(i):a.keyword!==i)throw new Error("ajv implementation error");const t=a.dependencies;if(t?.some(o=>!Object.prototype.hasOwnProperty.call(_,o)))throw new Error(`parent schema must have dependencies of ${i}: ${t.join(",")}`);if(a.validateSchema&&!a.validateSchema(_[i])){const f=`keyword "${i}" value is invalid at path "${b}": `+m.errorsText(a.validateSchema.errors);if(v.validateSchema==="log")m.logger.error(f);else throw new Error(f)}}return ue.validateKeywordUsage=P,ue}var me={},dr;function zn(){if(dr)return me;dr=1,Object.defineProperty(me,"__esModule",{value:!0}),me.extendSubschemaMode=me.extendSubschemaData=me.getSubschema=void 0;const e=J(),r=Q();function g(n,{keyword:d,schemaProp:c,schema:p,schemaPath:$,errSchemaPath:y,topSchemaRef:P}){if(d!==void 0&&p!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(d!==void 0){const _=n.schema[d];return c===void 0?{schema:_,schemaPath:(0,e._)`${n.schemaPath}${(0,e.getProperty)(d)}`,errSchemaPath:`${n.errSchemaPath}/${d}`}:{schema:_[c],schemaPath:(0,e._)`${n.schemaPath}${(0,e.getProperty)(d)}${(0,e.getProperty)(c)}`,errSchemaPath:`${n.errSchemaPath}/${d}/${(0,r.escapeFragment)(c)}`}}if(p!==void 0){if($===void 0||y===void 0||P===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:p,schemaPath:$,topSchemaRef:P,errSchemaPath:y}}throw new Error('either "keyword" or "schema" must be passed')}me.getSubschema=g;function l(n,d,{dataProp:c,dataPropType:p,data:$,dataTypes:y,propertyName:P}){if($!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:_}=d;if(c!==void 0){const{errorPath:m,dataPathArr:b,opts:a}=d,i=_.let("data",(0,e._)`${d.data}${(0,e.getProperty)(c)}`,!0);v(i),n.errorPath=(0,e.str)`${m}${(0,r.getErrorPath)(c,p,a.jsPropertySyntax)}`,n.parentDataProperty=(0,e._)`${c}`,n.dataPathArr=[...b,n.parentDataProperty]}if($!==void 0){const m=$ instanceof e.Name?$:_.let("data",$,!0);v(m),P!==void 0&&(n.propertyName=P)}y&&(n.dataTypes=y);function v(m){n.data=m,n.dataLevel=d.dataLevel+1,n.dataTypes=[],d.definedProperties=new Set,n.parentData=d.data,n.dataNames=[...d.dataNames,m]}}me.extendSubschemaData=l;function w(n,{jtdDiscriminator:d,jtdMetadata:c,compositeRule:p,createErrors:$,allErrors:y}){p!==void 0&&(n.compositeRule=p),$!==void 0&&(n.createErrors=$),y!==void 0&&(n.allErrors=y),n.jtdDiscriminator=d,n.jtdMetadata=c}return me.extendSubschemaMode=w,me}var ne={},Ct,fr;function yn(){return fr||(fr=1,Ct=function e(r,g){if(r===g)return!0;if(r&&g&&typeof r=="object"&&typeof g=="object"){if(r.constructor!==g.constructor)return!1;var l,w,n;if(Array.isArray(r)){if(l=r.length,l!=g.length)return!1;for(w=l;w--!==0;)if(!e(r[w],g[w]))return!1;return!0}if(r.constructor===RegExp)return r.source===g.source&&r.flags===g.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===g.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===g.toString();if(n=Object.keys(r),l=n.length,l!==Object.keys(g).length)return!1;for(w=l;w--!==0;)if(!Object.prototype.hasOwnProperty.call(g,n[w]))return!1;for(w=l;w--!==0;){var d=n[w];if(!e(r[d],g[d]))return!1}return!0}return r!==r&&g!==g}),Ct}var At={exports:{}},hr;function Un(){if(hr)return At.exports;hr=1;var e=At.exports=function(l,w,n){typeof w=="function"&&(n=w,w={}),n=w.cb||n;var d=typeof n=="function"?n:n.pre||function(){},c=n.post||function(){};r(w,d,c,l,"",l)};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 r(l,w,n,d,c,p,$,y,P,_){if(d&&typeof d=="object"&&!Array.isArray(d)){w(d,c,p,$,y,P,_);for(var v in d){var m=d[v];if(Array.isArray(m)){if(v in e.arrayKeywords)for(var b=0;b<m.length;b++)r(l,w,n,m[b],c+"/"+v+"/"+b,p,c,v,d,b)}else if(v in e.propsKeywords){if(m&&typeof m=="object")for(var a in m)r(l,w,n,m[a],c+"/"+v+"/"+g(a),p,c,v,d,a)}else(v in e.keywords||l.allKeys&&!(v in e.skipKeywords))&&r(l,w,n,m,c+"/"+v,p,c,v,d)}n(d,c,p,$,y,P,_)}}function g(l){return l.replace(/~/g,"~0").replace(/\//g,"~1")}return At.exports}var pr;function wt(){if(pr)return ne;pr=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.getSchemaRefs=ne.resolveUrl=ne.normalizeId=ne._getFullPath=ne.getFullPath=ne.inlineRef=void 0;const e=Q(),r=yn(),g=Un(),l=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function w(b,a=!0){return typeof b=="boolean"?!0:a===!0?!d(b):a?c(b)<=a:!1}ne.inlineRef=w;const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function d(b){for(const a in b){if(n.has(a))return!0;const i=b[a];if(Array.isArray(i)&&i.some(d)||typeof i=="object"&&d(i))return!0}return!1}function c(b){let a=0;for(const i in b){if(i==="$ref")return 1/0;if(a++,!l.has(i)&&(typeof b[i]=="object"&&(0,e.eachItem)(b[i],t=>a+=c(t)),a===1/0))return 1/0}return a}function p(b,a="",i){i!==!1&&(a=P(a));const t=b.parse(a);return $(b,t)}ne.getFullPath=p;function $(b,a){return b.serialize(a).split("#")[0]+"#"}ne._getFullPath=$;const y=/#\/?$/;function P(b){return b?b.replace(y,""):""}ne.normalizeId=P;function _(b,a,i){return i=P(i),b.resolve(a,i)}ne.resolveUrl=_;const v=/^[a-z_][-a-z0-9._]*$/i;function m(b,a){if(typeof b=="boolean")return{};const{schemaId:i,uriResolver:t}=this.opts,o=P(b[i]||a),f={"":o},s=p(t,o,!1),h={},E=new Set;return g(b,{allKeys:!0},(D,V,K,L)=>{if(L===void 0)return;const B=s+V;let x=f[L];typeof D[i]=="string"&&(x=de.call(this,D[i])),fe.call(this,D.$anchor),fe.call(this,D.$dynamicAnchor),f[V]=x;function de(Z){const ye=this.opts.uriResolver.resolve;if(Z=P(x?ye(x,Z):Z),E.has(Z))throw C(Z);E.add(Z);let A=this.refs[Z];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?k(D,A.schema,Z):Z!==P(B)&&(Z[0]==="#"?(k(D,h[Z],Z),h[Z]=D):this.refs[Z]=B),Z}function fe(Z){if(typeof Z=="string"){if(!v.test(Z))throw new Error(`invalid anchor "${Z}"`);de.call(this,`#${Z}`)}}}),h;function k(D,V,K){if(V!==void 0&&!r(D,V))throw C(K)}function C(D){return new Error(`reference "${D}" resolves to more than one schema`)}}return ne.getSchemaRefs=m,ne}var mr;function bt(){if(mr)return he;mr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getData=he.KeywordCxt=he.validateFunctionCode=void 0;const e=Mn(),r=gt(),g=mn(),l=gt(),w=Dn(),n=Vn(),d=zn(),c=J(),p=_e(),$=wt(),y=Q(),P=$t();function _(R){if(s(R)&&(E(R),f(R))){a(R);return}v(R,()=>(0,e.topBoolOrEmptySchema)(R))}he.validateFunctionCode=_;function v({gen:R,validateName:O,schema:T,schemaEnv:M,opts:U},G){U.code.es5?R.func(O,(0,c._)`${p.default.data}, ${p.default.valCxt}`,M.$async,()=>{R.code((0,c._)`"use strict"; ${t(T,U)}`),b(R,U),R.code(G)}):R.func(O,(0,c._)`${p.default.data}, ${m(U)}`,M.$async,()=>R.code(t(T,U)).code(G))}function m(R){return(0,c._)`{${p.default.instancePath}="", ${p.default.parentData}, ${p.default.parentDataProperty}, ${p.default.rootData}=${p.default.data}${R.dynamicRef?(0,c._)`, ${p.default.dynamicAnchors}={}`:c.nil}}={}`}function b(R,O){R.if(p.default.valCxt,()=>{R.var(p.default.instancePath,(0,c._)`${p.default.valCxt}.${p.default.instancePath}`),R.var(p.default.parentData,(0,c._)`${p.default.valCxt}.${p.default.parentData}`),R.var(p.default.parentDataProperty,(0,c._)`${p.default.valCxt}.${p.default.parentDataProperty}`),R.var(p.default.rootData,(0,c._)`${p.default.valCxt}.${p.default.rootData}`),O.dynamicRef&&R.var(p.default.dynamicAnchors,(0,c._)`${p.default.valCxt}.${p.default.dynamicAnchors}`)},()=>{R.var(p.default.instancePath,(0,c._)`""`),R.var(p.default.parentData,(0,c._)`undefined`),R.var(p.default.parentDataProperty,(0,c._)`undefined`),R.var(p.default.rootData,p.default.data),O.dynamicRef&&R.var(p.default.dynamicAnchors,(0,c._)`{}`)})}function a(R){const{schema:O,opts:T,gen:M}=R;v(R,()=>{T.$comment&&O.$comment&&L(R),D(R),M.let(p.default.vErrors,null),M.let(p.default.errors,0),T.unevaluated&&i(R),k(R),B(R)})}function i(R){const{gen:O,validateName:T}=R;R.evaluated=O.const("evaluated",(0,c._)`${T}.evaluated`),O.if((0,c._)`${R.evaluated}.dynamicProps`,()=>O.assign((0,c._)`${R.evaluated}.props`,(0,c._)`undefined`)),O.if((0,c._)`${R.evaluated}.dynamicItems`,()=>O.assign((0,c._)`${R.evaluated}.items`,(0,c._)`undefined`))}function t(R,O){const T=typeof R=="object"&&R[O.schemaId];return T&&(O.code.source||O.code.process)?(0,c._)`/*# sourceURL=${T} */`:c.nil}function o(R,O){if(s(R)&&(E(R),f(R))){h(R,O);return}(0,e.boolOrEmptySchema)(R,O)}function f({schema:R,self:O}){if(typeof R=="boolean")return!R;for(const T in R)if(O.RULES.all[T])return!0;return!1}function s(R){return typeof R.schema!="boolean"}function h(R,O){const{schema:T,gen:M,opts:U}=R;U.$comment&&T.$comment&&L(R),V(R),K(R);const G=M.const("_errs",p.default.errors);k(R,G),M.var(O,(0,c._)`${G} === ${p.default.errors}`)}function E(R){(0,y.checkUnknownRules)(R),C(R)}function k(R,O){if(R.opts.jtd)return de(R,[],!1,O);const T=(0,r.getSchemaTypes)(R.schema),M=(0,r.coerceAndCheckDataType)(R,T);de(R,T,!M,O)}function C(R){const{schema:O,errSchemaPath:T,opts:M,self:U}=R;O.$ref&&M.ignoreKeywordsWithRef&&(0,y.schemaHasRulesButRef)(O,U.RULES)&&U.logger.warn(`$ref: keywords ignored in schema at path "${T}"`)}function D(R){const{schema:O,opts:T}=R;O.default!==void 0&&T.useDefaults&&T.strictSchema&&(0,y.checkStrictMode)(R,"default is ignored in the schema root")}function V(R){const O=R.schema[R.opts.schemaId];O&&(R.baseId=(0,$.resolveUrl)(R.opts.uriResolver,R.baseId,O))}function K(R){if(R.schema.$async&&!R.schemaEnv.$async)throw new Error("async schema in sync schema")}function L({gen:R,schemaEnv:O,schema:T,errSchemaPath:M,opts:U}){const G=T.$comment;if(U.$comment===!0)R.code((0,c._)`${p.default.self}.logger.log(${G})`);else if(typeof U.$comment=="function"){const ee=(0,c.str)`${M}/$comment`,ce=R.scopeValue("root",{ref:O.root});R.code((0,c._)`${p.default.self}.opts.$comment(${G}, ${ee}, ${ce}.schema)`)}}function B(R){const{gen:O,schemaEnv:T,validateName:M,ValidationError:U,opts:G}=R;T.$async?O.if((0,c._)`${p.default.errors} === 0`,()=>O.return(p.default.data),()=>O.throw((0,c._)`new ${U}(${p.default.vErrors})`)):(O.assign((0,c._)`${M}.errors`,p.default.vErrors),G.unevaluated&&x(R),O.return((0,c._)`${p.default.errors} === 0`))}function x({gen:R,evaluated:O,props:T,items:M}){T instanceof c.Name&&R.assign((0,c._)`${O}.props`,T),M instanceof c.Name&&R.assign((0,c._)`${O}.items`,M)}function de(R,O,T,M){const{gen:U,schema:G,data:ee,allErrors:ce,opts:se,self:ae}=R,{RULES:te}=ae;if(G.$ref&&(se.ignoreKeywordsWithRef||!(0,y.schemaHasRulesButRef)(G,te))){U.block(()=>z(R,"$ref",te.all.$ref.definition));return}se.jtd||Z(R,O),U.block(()=>{for(const ie of te.rules)Ee(ie);Ee(te.post)});function Ee(ie){(0,g.shouldUseGroup)(G,ie)&&(ie.type?(U.if((0,l.checkDataType)(ie.type,ee,se.strictNumbers)),fe(R,ie),O.length===1&&O[0]===ie.type&&T&&(U.else(),(0,l.reportTypeError)(R)),U.endIf()):fe(R,ie),ce||U.if((0,c._)`${p.default.errors} === ${M||0}`))}}function fe(R,O){const{gen:T,schema:M,opts:{useDefaults:U}}=R;U&&(0,w.assignDefaults)(R,O.type),T.block(()=>{for(const G of O.rules)(0,g.shouldUseRule)(M,G)&&z(R,G.keyword,G.definition,O.type)})}function Z(R,O){R.schemaEnv.meta||!R.opts.strictTypes||(ye(R,O),R.opts.allowUnionTypes||A(R,O),N(R,R.dataTypes))}function ye(R,O){if(O.length){if(!R.dataTypes.length){R.dataTypes=O;return}O.forEach(T=>{j(R.dataTypes,T)||S(R,`type "${T}" not allowed by context "${R.dataTypes.join(",")}"`)}),u(R,O)}}function A(R,O){O.length>1&&!(O.length===2&&O.includes("null"))&&S(R,"use allowUnionTypes to allow union type keyword")}function N(R,O){const T=R.self.RULES.all;for(const M in T){const U=T[M];if(typeof U=="object"&&(0,g.shouldUseRule)(R.schema,U)){const{type:G}=U.definition;G.length&&!G.some(ee=>q(O,ee))&&S(R,`missing type "${G.join(",")}" for keyword "${M}"`)}}}function q(R,O){return R.includes(O)||O==="number"&&R.includes("integer")}function j(R,O){return R.includes(O)||O==="integer"&&R.includes("number")}function u(R,O){const T=[];for(const M of R.dataTypes)j(O,M)?T.push(M):O.includes("integer")&&M==="number"&&T.push("integer");R.dataTypes=T}function S(R,O){const T=R.schemaEnv.baseId+R.errSchemaPath;O+=` at "${T}" (strictTypes)`,(0,y.checkStrictMode)(R,O,R.opts.strictTypes)}class I{constructor(O,T,M){if((0,n.validateKeywordUsage)(O,T,M),this.gen=O.gen,this.allErrors=O.allErrors,this.keyword=M,this.data=O.data,this.schema=O.schema[M],this.$data=T.$data&&O.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,y.schemaRefOrVal)(O,this.schema,M,this.$data),this.schemaType=T.schemaType,this.parentSchema=O.schema,this.params={},this.it=O,this.def=T,this.$data)this.schemaCode=O.gen.const("vSchema",W(this.$data,O));else if(this.schemaCode=this.schemaValue,!(0,n.validSchemaType)(this.schema,T.schemaType,T.allowUndefined))throw new Error(`${M} value must be ${JSON.stringify(T.schemaType)}`);("code"in T?T.trackErrors:T.errors!==!1)&&(this.errsCount=O.gen.const("_errs",p.default.errors))}result(O,T,M){this.failResult((0,c.not)(O),T,M)}failResult(O,T,M){this.gen.if(O),M?M():this.error(),T?(this.gen.else(),T(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(O,T){this.failResult((0,c.not)(O),void 0,T)}fail(O){if(O===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(O),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(O){if(!this.$data)return this.fail(O);const{schemaCode:T}=this;this.fail((0,c._)`${T} !== undefined && (${(0,c.or)(this.invalid$data(),O)})`)}error(O,T,M){if(T){this.setParams(T),this._error(O,M),this.setParams({});return}this._error(O,M)}_error(O,T){(O?P.reportExtraError:P.reportError)(this,this.def.error,T)}$dataError(){(0,P.reportError)(this,this.def.$dataError||P.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,P.resetErrorsCount)(this.gen,this.errsCount)}ok(O){this.allErrors||this.gen.if(O)}setParams(O,T){T?Object.assign(this.params,O):this.params=O}block$data(O,T,M=c.nil){this.gen.block(()=>{this.check$data(O,M),T()})}check$data(O=c.nil,T=c.nil){if(!this.$data)return;const{gen:M,schemaCode:U,schemaType:G,def:ee}=this;M.if((0,c.or)((0,c._)`${U} === undefined`,T)),O!==c.nil&&M.assign(O,!0),(G.length||ee.validateSchema)&&(M.elseIf(this.invalid$data()),this.$dataError(),O!==c.nil&&M.assign(O,!1)),M.else()}invalid$data(){const{gen:O,schemaCode:T,schemaType:M,def:U,it:G}=this;return(0,c.or)(ee(),ce());function ee(){if(M.length){if(!(T instanceof c.Name))throw new Error("ajv implementation error");const se=Array.isArray(M)?M:[M];return(0,c._)`${(0,l.checkDataTypes)(se,T,G.opts.strictNumbers,l.DataType.Wrong)}`}return c.nil}function ce(){if(U.validateSchema){const se=O.scopeValue("validate$data",{ref:U.validateSchema});return(0,c._)`!${se}(${T})`}return c.nil}}subschema(O,T){const M=(0,d.getSubschema)(this.it,O);(0,d.extendSubschemaData)(M,this.it,O),(0,d.extendSubschemaMode)(M,O);const U={...this.it,...M,items:void 0,props:void 0};return o(U,T),U}mergeEvaluated(O,T){const{it:M,gen:U}=this;M.opts.unevaluated&&(M.props!==!0&&O.props!==void 0&&(M.props=y.mergeEvaluated.props(U,O.props,M.props,T)),M.items!==!0&&O.items!==void 0&&(M.items=y.mergeEvaluated.items(U,O.items,M.items,T)))}mergeValidEvaluated(O,T){const{it:M,gen:U}=this;if(M.opts.unevaluated&&(M.props!==!0||M.items!==!0))return U.if(T,()=>this.mergeEvaluated(O,c.Name)),!0}}he.KeywordCxt=I;function z(R,O,T,M){const U=new I(R,T,O);"code"in T?T.code(U,M):U.$data&&T.validate?(0,n.funcKeywordCode)(U,T):"macro"in T?(0,n.macroKeywordCode)(U,T):(T.compile||T.validate)&&(0,n.funcKeywordCode)(U,T)}const F=/^\/(?:[^~]|~0|~1)*$/,X=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function W(R,{dataLevel:O,dataNames:T,dataPathArr:M}){let U,G;if(R==="")return p.default.rootData;if(R[0]==="/"){if(!F.test(R))throw new Error(`Invalid JSON-pointer: ${R}`);U=R,G=p.default.rootData}else{const ae=X.exec(R);if(!ae)throw new Error(`Invalid JSON-pointer: ${R}`);const te=+ae[1];if(U=ae[2],U==="#"){if(te>=O)throw new Error(se("property/index",te));return M[O-te]}if(te>O)throw new Error(se("data",te));if(G=T[O-te],!U)return G}let ee=G;const ce=U.split("/");for(const ae of ce)ae&&(G=(0,c._)`${G}${(0,c.getProperty)((0,y.unescapeJsonPointer)(ae))}`,ee=(0,c._)`${ee} && ${G}`);return ee;function se(ae,te){return`Cannot access ${ae} ${te} levels up, current level is ${O}`}}return he.getData=W,he}var Ce={},yr;function Lt(){if(yr)return Ce;yr=1,Object.defineProperty(Ce,"__esModule",{value:!0});class e extends Error{constructor(g){super("validation failed"),this.errors=g,this.ajv=this.validation=!0}}return Ce.default=e,Ce}var Ae={},vr;function Et(){if(vr)return Ae;vr=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=wt();class r extends Error{constructor(l,w,n,d){super(d||`can't resolve reference ${n} from id ${w}`),this.missingRef=(0,e.resolveUrl)(l,w,n),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(l,this.missingRef))}}return Ae.default=r,Ae}var oe={},_r;function Kt(){if(_r)return oe;_r=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.resolveSchema=oe.getCompilingSchema=oe.resolveRef=oe.compileSchema=oe.SchemaEnv=void 0;const e=J(),r=Lt(),g=_e(),l=wt(),w=Q(),n=bt();class d{constructor(i){var t;this.refs={},this.dynamicAnchors={};let o;typeof i.schema=="object"&&(o=i.schema),this.schema=i.schema,this.schemaId=i.schemaId,this.root=i.root||this,this.baseId=(t=i.baseId)!==null&&t!==void 0?t:(0,l.normalizeId)(o?.[i.schemaId||"$id"]),this.schemaPath=i.schemaPath,this.localRefs=i.localRefs,this.meta=i.meta,this.$async=o?.$async,this.refs={}}}oe.SchemaEnv=d;function c(a){const i=y.call(this,a);if(i)return i;const t=(0,l.getFullPath)(this.opts.uriResolver,a.root.baseId),{es5:o,lines:f}=this.opts.code,{ownProperties:s}=this.opts,h=new e.CodeGen(this.scope,{es5:o,lines:f,ownProperties:s});let E;a.$async&&(E=h.scopeValue("Error",{ref:r.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const k=h.scopeName("validate");a.validateName=k;const C={gen:h,allErrors:this.opts.allErrors,data:g.default.data,parentData:g.default.parentData,parentDataProperty:g.default.parentDataProperty,dataNames:[g.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",this.opts.code.source===!0?{ref:a.schema,code:(0,e.stringify)(a.schema)}:{ref:a.schema}),validateName:k,ValidationError:E,schema:a.schema,schemaEnv:a,rootId:t,baseId:a.baseId||t,schemaPath:e.nil,errSchemaPath:a.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let D;try{this._compilations.add(a),(0,n.validateFunctionCode)(C),h.optimize(this.opts.code.optimize);const V=h.toString();D=`${h.scopeRefs(g.default.scope)}return ${V}`,this.opts.code.process&&(D=this.opts.code.process(D,a));const L=new Function(`${g.default.self}`,`${g.default.scope}`,D)(this,this.scope.get());if(this.scope.value(k,{ref:L}),L.errors=null,L.schema=a.schema,L.schemaEnv=a,a.$async&&(L.$async=!0),this.opts.code.source===!0&&(L.source={validateName:k,validateCode:V,scopeValues:h._values}),this.opts.unevaluated){const{props:B,items:x}=C;L.evaluated={props:B instanceof e.Name?void 0:B,items:x instanceof e.Name?void 0:x,dynamicProps:B instanceof e.Name,dynamicItems:x instanceof e.Name},L.source&&(L.source.evaluated=(0,e.stringify)(L.evaluated))}return a.validate=L,a}catch(V){throw delete a.validate,delete a.validateName,D&&this.logger.error("Error compiling schema, function code:",D),V}finally{this._compilations.delete(a)}}oe.compileSchema=c;function p(a,i,t){var o;t=(0,l.resolveUrl)(this.opts.uriResolver,i,t);const f=a.refs[t];if(f)return f;let s=_.call(this,a,t);if(s===void 0){const h=(o=a.localRefs)===null||o===void 0?void 0:o[t],{schemaId:E}=this.opts;h&&(s=new d({schema:h,schemaId:E,root:a,baseId:i}))}if(s!==void 0)return a.refs[t]=$.call(this,s)}oe.resolveRef=p;function $(a){return(0,l.inlineRef)(a.schema,this.opts.inlineRefs)?a.schema:a.validate?a:c.call(this,a)}function y(a){for(const i of this._compilations)if(P(i,a))return i}oe.getCompilingSchema=y;function P(a,i){return a.schema===i.schema&&a.root===i.root&&a.baseId===i.baseId}function _(a,i){let t;for(;typeof(t=this.refs[i])=="string";)i=t;return t||this.schemas[i]||v.call(this,a,i)}function v(a,i){const t=this.opts.uriResolver.parse(i),o=(0,l._getFullPath)(this.opts.uriResolver,t);let f=(0,l.getFullPath)(this.opts.uriResolver,a.baseId,void 0);if(Object.keys(a.schema).length>0&&o===f)return b.call(this,t,a);const s=(0,l.normalizeId)(o),h=this.refs[s]||this.schemas[s];if(typeof h=="string"){const E=v.call(this,a,h);return typeof E?.schema!="object"?void 0:b.call(this,t,E)}if(typeof h?.schema=="object"){if(h.validate||c.call(this,h),s===(0,l.normalizeId)(i)){const{schema:E}=h,{schemaId:k}=this.opts,C=E[k];return C&&(f=(0,l.resolveUrl)(this.opts.uriResolver,f,C)),new d({schema:E,schemaId:k,root:a,baseId:f})}return b.call(this,t,h)}}oe.resolveSchema=v;const m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function b(a,{baseId:i,schema:t,root:o}){var f;if(((f=a.fragment)===null||f===void 0?void 0:f[0])!=="/")return;for(const E of a.fragment.slice(1).split("/")){if(typeof t=="boolean")return;const k=t[(0,w.unescapeFragment)(E)];if(k===void 0)return;t=k;const C=typeof t=="object"&&t[this.opts.schemaId];!m.has(E)&&C&&(i=(0,l.resolveUrl)(this.opts.uriResolver,i,C))}let s;if(typeof t!="boolean"&&t.$ref&&!(0,w.schemaHasRulesButRef)(t,this.RULES)){const E=(0,l.resolveUrl)(this.opts.uriResolver,i,t.$ref);s=v.call(this,o,E)}const{schemaId:h}=this.opts;if(s=s||new d({schema:t,schemaId:h,root:o,baseId:i}),s.schema!==s.root.schema)return s}return oe}const Fn="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ln="Meta-schema for $data reference (JSON AnySchema extension proposal)",Kn="object",Hn=["$data"],Gn={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Jn=!1,Wn={$id:Fn,description:Ln,type:Kn,required:Hn,properties:Gn,additionalProperties:Jn};var Me={},je={exports:{}},Mt,gr;function vn(){if(gr)return Mt;gr=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=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 g(_){let v="",m=0,b=0;for(b=0;b<_.length;b++)if(m=_[b].charCodeAt(0),m!==48){if(!(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102))return"";v+=_[b];break}for(b+=1;b<_.length;b++){if(m=_[b].charCodeAt(0),!(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102))return"";v+=_[b]}return v}const l=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function w(_){return _.length=0,!0}function n(_,v,m){if(_.length){const b=g(_);if(b!=="")v.push(b);else return m.error=!0,!1;_.length=0}return!0}function d(_){let v=0;const m={error:!1,address:"",zone:""},b=[],a=[];let i=!1,t=!1,o=n;for(let f=0;f<_.length;f++){const s=_[f];if(!(s==="["||s==="]"))if(s===":"){if(i===!0&&(t=!0),!o(a,b,m))break;if(++v>7){m.error=!0;break}f>0&&_[f-1]===":"&&(i=!0),b.push(":");continue}else if(s==="%"){if(!o(a,b,m))break;o=w}else{a.push(s);continue}}return a.length&&(o===w?m.zone=a.join(""):t?b.push(a.join("")):b.push(g(a))),m.address=b.join(""),m}function c(_){if(p(_,":")<2)return{host:_,isIPV6:!1};const v=d(_);if(v.error)return{host:_,isIPV6:!1};{let m=v.address,b=v.address;return v.zone&&(m+="%"+v.zone,b+="%25"+v.zone),{host:m,isIPV6:!0,escapedHost:b}}}function p(_,v){let m=0;for(let b=0;b<_.length;b++)_[b]===v&&m++;return m}function $(_){let v=_;const m=[];let b=-1,a=0;for(;a=v.length;){if(a===1){if(v===".")break;if(v==="/"){m.push("/");break}else{m.push(v);break}}else if(a===2){if(v[0]==="."){if(v[1]===".")break;if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&(v[1]==="."||v[1]==="/")){m.push("/");break}}else if(a===3&&v==="/.."){m.length!==0&&m.pop(),m.push("/");break}if(v[0]==="."){if(v[1]==="."){if(v[2]==="/"){v=v.slice(3);continue}}else if(v[1]==="/"){v=v.slice(2);continue}}else if(v[0]==="/"&&v[1]==="."){if(v[2]==="/"){v=v.slice(2);continue}else if(v[2]==="."&&v[3]==="/"){v=v.slice(3),m.length!==0&&m.pop();continue}}if((b=v.indexOf("/",1))===-1){m.push(v);break}else m.push(v.slice(0,b)),v=v.slice(b)}return m.join("")}function y(_,v){const m=v!==!0?escape:unescape;return _.scheme!==void 0&&(_.scheme=m(_.scheme)),_.userinfo!==void 0&&(_.userinfo=m(_.userinfo)),_.host!==void 0&&(_.host=m(_.host)),_.path!==void 0&&(_.path=m(_.path)),_.query!==void 0&&(_.query=m(_.query)),_.fragment!==void 0&&(_.fragment=m(_.fragment)),_}function P(_){const v=[];if(_.userinfo!==void 0&&(v.push(_.userinfo),v.push("@")),_.host!==void 0){let m=unescape(_.host);if(!r(m)){const b=c(m);b.isIPV6===!0?m=`[${b.escapedHost}]`:m=_.host}v.push(m)}return(typeof _.port=="number"||typeof _.port=="string")&&(v.push(":"),v.push(String(_.port))),v.length?v.join(""):void 0}return Mt={nonSimpleDomain:l,recomposeAuthority:P,normalizeComponentEncoding:y,removeDotSegments:$,isIPv4:r,isUUID:e,normalizeIPv6:c,stringArrayToHexStripped:g},Mt}var Dt,$r;function Bn(){if($r)return Dt;$r=1;const{isUUID:e}=vn(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,g=["http","https","ws","wss","urn","urn:uuid"];function l(s){return g.indexOf(s)!==-1}function w(s){return s.secure===!0?!0:s.secure===!1?!1:s.scheme?s.scheme.length===3&&(s.scheme[0]==="w"||s.scheme[0]==="W")&&(s.scheme[1]==="s"||s.scheme[1]==="S")&&(s.scheme[2]==="s"||s.scheme[2]==="S"):!1}function n(s){return s.host||(s.error=s.error||"HTTP URIs must have a host."),s}function d(s){const h=String(s.scheme).toLowerCase()==="https";return(s.port===(h?443:80)||s.port==="")&&(s.port=void 0),s.path||(s.path="/"),s}function c(s){return s.secure=w(s),s.resourceName=(s.path||"/")+(s.query?"?"+s.query:""),s.path=void 0,s.query=void 0,s}function p(s){if((s.port===(w(s)?443:80)||s.port==="")&&(s.port=void 0),typeof s.secure=="boolean"&&(s.scheme=s.secure?"wss":"ws",s.secure=void 0),s.resourceName){const[h,E]=s.resourceName.split("?");s.path=h&&h!=="/"?h:void 0,s.query=E,s.resourceName=void 0}return s.fragment=void 0,s}function $(s,h){if(!s.path)return s.error="URN can not be parsed",s;const E=s.path.match(r);if(E){const k=h.scheme||s.scheme||"urn";s.nid=E[1].toLowerCase(),s.nss=E[2];const C=`${k}:${h.nid||s.nid}`,D=f(C);s.path=void 0,D&&(s=D.parse(s,h))}else s.error=s.error||"URN can not be parsed.";return s}function y(s,h){if(s.nid===void 0)throw new Error("URN without nid cannot be serialized");const E=h.scheme||s.scheme||"urn",k=s.nid.toLowerCase(),C=`${E}:${h.nid||k}`,D=f(C);D&&(s=D.serialize(s,h));const V=s,K=s.nss;return V.path=`${k||h.nid}:${K}`,h.skipEscape=!0,V}function P(s,h){const E=s;return E.uuid=E.nss,E.nss=void 0,!h.tolerant&&(!E.uuid||!e(E.uuid))&&(E.error=E.error||"UUID is not valid."),E}function _(s){const h=s;return h.nss=(s.uuid||"").toLowerCase(),h}const v={scheme:"http",domainHost:!0,parse:n,serialize:d},m={scheme:"https",domainHost:v.domainHost,parse:n,serialize:d},b={scheme:"ws",domainHost:!0,parse:c,serialize:p},a={scheme:"wss",domainHost:b.domainHost,parse:b.parse,serialize:b.serialize},o={http:v,https:m,ws:b,wss:a,urn:{scheme:"urn",parse:$,serialize:y,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:P,serialize:_,skipNormalize:!0}};Object.setPrototypeOf(o,null);function f(s){return s&&(o[s]||o[s.toLowerCase()])||void 0}return Dt={wsIsSecure:w,SCHEMES:o,isValidSchemeName:l,getSchemeHandler:f},Dt}var wr;function Qn(){if(wr)return je.exports;wr=1;const{normalizeIPv6:e,removeDotSegments:r,recomposeAuthority:g,normalizeComponentEncoding:l,isIPv4:w,nonSimpleDomain:n}=vn(),{SCHEMES:d,getSchemeHandler:c}=Bn();function p(a,i){return typeof a=="string"?a=_(m(a,i),i):typeof a=="object"&&(a=m(_(a,i),i)),a}function $(a,i,t){const o=t?Object.assign({scheme:"null"},t):{scheme:"null"},f=y(m(a,o),m(i,o),o,!0);return o.skipEscape=!0,_(f,o)}function y(a,i,t,o){const f={};return o||(a=m(_(a,t),t),i=m(_(i,t),t)),t=t||{},!t.tolerant&&i.scheme?(f.scheme=i.scheme,f.userinfo=i.userinfo,f.host=i.host,f.port=i.port,f.path=r(i.path||""),f.query=i.query):(i.userinfo!==void 0||i.host!==void 0||i.port!==void 0?(f.userinfo=i.userinfo,f.host=i.host,f.port=i.port,f.path=r(i.path||""),f.query=i.query):(i.path?(i.path[0]==="/"?f.path=r(i.path):((a.userinfo!==void 0||a.host!==void 0||a.port!==void 0)&&!a.path?f.path="/"+i.path:a.path?f.path=a.path.slice(0,a.path.lastIndexOf("/")+1)+i.path:f.path=i.path,f.path=r(f.path)),f.query=i.query):(f.path=a.path,i.query!==void 0?f.query=i.query:f.query=a.query),f.userinfo=a.userinfo,f.host=a.host,f.port=a.port),f.scheme=a.scheme),f.fragment=i.fragment,f}function P(a,i,t){return typeof a=="string"?(a=unescape(a),a=_(l(m(a,t),!0),{...t,skipEscape:!0})):typeof a=="object"&&(a=_(l(a,!0),{...t,skipEscape:!0})),typeof i=="string"?(i=unescape(i),i=_(l(m(i,t),!0),{...t,skipEscape:!0})):typeof i=="object"&&(i=_(l(i,!0),{...t,skipEscape:!0})),a.toLowerCase()===i.toLowerCase()}function _(a,i){const t={host:a.host,scheme:a.scheme,userinfo:a.userinfo,port:a.port,path:a.path,query:a.query,nid:a.nid,nss:a.nss,uuid:a.uuid,fragment:a.fragment,reference:a.reference,resourceName:a.resourceName,secure:a.secure,error:""},o=Object.assign({},i),f=[],s=c(o.scheme||t.scheme);s&&s.serialize&&s.serialize(t,o),t.path!==void 0&&(o.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),o.reference!=="suffix"&&t.scheme&&f.push(t.scheme,":");const h=g(t);if(h!==void 0&&(o.reference!=="suffix"&&f.push("//"),f.push(h),t.path&&t.path[0]!=="/"&&f.push("/")),t.path!==void 0){let E=t.path;!o.absolutePath&&(!s||!s.absolutePath)&&(E=r(E)),h===void 0&&E[0]==="/"&&E[1]==="/"&&(E="/%2F"+E.slice(2)),f.push(E)}return t.query!==void 0&&f.push("?",t.query),t.fragment!==void 0&&f.push("#",t.fragment),f.join("")}const v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function m(a,i){const t=Object.assign({},i),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let f=!1;t.reference==="suffix"&&(t.scheme?a=t.scheme+":"+a:a="//"+a);const s=a.match(v);if(s){if(o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]),o.host)if(w(o.host)===!1){const k=e(o.host);o.host=k.host.toLowerCase(),f=k.isIPV6}else f=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==o.reference&&(o.error=o.error||"URI is not a "+t.reference+" reference.");const h=c(t.scheme||o.scheme);if(!t.unicodeSupport&&(!h||!h.unicodeSupport)&&o.host&&(t.domainHost||h&&h.domainHost)&&f===!1&&n(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(E){o.error=o.error||"Host's domain name can not be converted to ASCII: "+E}(!h||h&&!h.skipNormalize)&&(a.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),h&&h.parse&&h.parse(o,t)}else o.error=o.error||"URI can not be parsed.";return o}const b={SCHEMES:d,normalize:p,resolve:$,resolveComponent:y,equal:P,serialize:_,parse:m};return je.exports=b,je.exports.default=b,je.exports.fastUri=b,je.exports}var br;function Xn(){if(br)return Me;br=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=Qn();return e.code='require("ajv/dist/runtime/uri").default',Me.default=e,Me}var Er;function Yn(){return Er||(Er=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 r=bt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var g=J();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});const l=Lt(),w=Et(),n=pn(),d=Kt(),c=J(),p=wt(),$=gt(),y=Q(),P=Wn,_=Xn(),v=(A,N)=>new RegExp(A,N);v.code="new RegExp";const m=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),a={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."},i={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},t=200;function o(A){var N,q,j,u,S,I,z,F,X,W,R,O,T,M,U,G,ee,ce,se,ae,te,Ee,ie,St,Pt;const Ne=A.strict,Rt=(N=A.code)===null||N===void 0?void 0:N.optimize,Gt=Rt===!0||Rt===void 0?1:Rt||0,Jt=(j=(q=A.code)===null||q===void 0?void 0:q.regExp)!==null&&j!==void 0?j:v,En=(u=A.uriResolver)!==null&&u!==void 0?u:_.default;return{strictSchema:(I=(S=A.strictSchema)!==null&&S!==void 0?S:Ne)!==null&&I!==void 0?I:!0,strictNumbers:(F=(z=A.strictNumbers)!==null&&z!==void 0?z:Ne)!==null&&F!==void 0?F:!0,strictTypes:(W=(X=A.strictTypes)!==null&&X!==void 0?X:Ne)!==null&&W!==void 0?W:"log",strictTuples:(O=(R=A.strictTuples)!==null&&R!==void 0?R:Ne)!==null&&O!==void 0?O:"log",strictRequired:(M=(T=A.strictRequired)!==null&&T!==void 0?T:Ne)!==null&&M!==void 0?M:!1,code:A.code?{...A.code,optimize:Gt,regExp:Jt}:{optimize:Gt,regExp:Jt},loopRequired:(U=A.loopRequired)!==null&&U!==void 0?U:t,loopEnum:(G=A.loopEnum)!==null&&G!==void 0?G:t,meta:(ee=A.meta)!==null&&ee!==void 0?ee:!0,messages:(ce=A.messages)!==null&&ce!==void 0?ce:!0,inlineRefs:(se=A.inlineRefs)!==null&&se!==void 0?se:!0,schemaId:(ae=A.schemaId)!==null&&ae!==void 0?ae:"$id",addUsedSchema:(te=A.addUsedSchema)!==null&&te!==void 0?te:!0,validateSchema:(Ee=A.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(ie=A.validateFormats)!==null&&ie!==void 0?ie:!0,unicodeRegExp:(St=A.unicodeRegExp)!==null&&St!==void 0?St:!0,int32range:(Pt=A.int32range)!==null&&Pt!==void 0?Pt:!0,uriResolver:En}}class f{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...o(N)};const{es5:q,lines:j}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:b,es5:q,lines:j}),this.logger=K(N.logger);const u=N.validateFormats;N.validateFormats=!1,this.RULES=(0,n.getRules)(),s.call(this,a,N,"NOT SUPPORTED"),s.call(this,i,N,"DEPRECATED","warn"),this._metaOpts=D.call(this),N.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords&&C.call(this,N.keywords),typeof N.meta=="object"&&this.addMetaSchema(N.meta),E.call(this),N.validateFormats=u}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:N,meta:q,schemaId:j}=this.opts;let u=P;j==="id"&&(u={...P},u.id=u.$id,delete u.$id),q&&N&&this.addMetaSchema(u,u[j],!1)}defaultMeta(){const{meta:N,schemaId:q}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[q]||N:void 0}validate(N,q){let j;if(typeof N=="string"){if(j=this.getSchema(N),!j)throw new Error(`no schema with key or ref "${N}"`)}else j=this.compile(N);const u=j(q);return"$async"in j||(this.errors=j.errors),u}compile(N,q){const j=this._addSchema(N,q);return j.validate||this._compileSchemaEnv(j)}compileAsync(N,q){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:j}=this.opts;return u.call(this,N,q);async function u(W,R){await S.call(this,W.$schema);const O=this._addSchema(W,R);return O.validate||I.call(this,O)}async function S(W){W&&!this.getSchema(W)&&await u.call(this,{$ref:W},!0)}async function I(W){try{return this._compileSchemaEnv(W)}catch(R){if(!(R instanceof w.default))throw R;return z.call(this,R),await F.call(this,R.missingSchema),I.call(this,W)}}function z({missingSchema:W,missingRef:R}){if(this.refs[W])throw new Error(`AnySchema ${W} is loaded but ${R} cannot be resolved`)}async function F(W){const R=await X.call(this,W);this.refs[W]||await S.call(this,R.$schema),this.refs[W]||this.addSchema(R,W,q)}async function X(W){const R=this._loading[W];if(R)return R;try{return await(this._loading[W]=j(W))}finally{delete this._loading[W]}}}addSchema(N,q,j,u=this.opts.validateSchema){if(Array.isArray(N)){for(const I of N)this.addSchema(I,void 0,j,u);return this}let S;if(typeof N=="object"){const{schemaId:I}=this.opts;if(S=N[I],S!==void 0&&typeof S!="string")throw new Error(`schema ${I} must be string`)}return q=(0,p.normalizeId)(q||S),this._checkUnique(q),this.schemas[q]=this._addSchema(N,j,q,u,!0),this}addMetaSchema(N,q,j=this.opts.validateSchema){return this.addSchema(N,q,!0,j),this}validateSchema(N,q){if(typeof N=="boolean")return!0;let j;if(j=N.$schema,j!==void 0&&typeof j!="string")throw new Error("$schema must be a string");if(j=j||this.opts.defaultMeta||this.defaultMeta(),!j)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const u=this.validate(j,N);if(!u&&q){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return u}getSchema(N){let q;for(;typeof(q=h.call(this,N))=="string";)N=q;if(q===void 0){const{schemaId:j}=this.opts,u=new d.SchemaEnv({schema:{},schemaId:j});if(q=d.resolveSchema.call(this,u,N),!q)return;this.refs[N]=q}return q.validate||this._compileSchemaEnv(q)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const q=h.call(this,N);return typeof q=="object"&&this._cache.delete(q.schema),delete this.schemas[N],delete this.refs[N],this}case"object":{const q=N;this._cache.delete(q);let j=N[this.opts.schemaId];return j&&(j=(0,p.normalizeId)(j),delete this.schemas[j],delete this.refs[j]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(const q of N)this.addKeyword(q);return this}addKeyword(N,q){let j;if(typeof N=="string")j=N,typeof q=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),q.keyword=j);else if(typeof N=="object"&&q===void 0){if(q=N,j=q.keyword,Array.isArray(j)&&!j.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B.call(this,j,q),!q)return(0,y.eachItem)(j,S=>x.call(this,S)),this;fe.call(this,q);const u={...q,type:(0,$.getJSONTypes)(q.type),schemaType:(0,$.getJSONTypes)(q.schemaType)};return(0,y.eachItem)(j,u.type.length===0?S=>x.call(this,S,u):S=>u.type.forEach(I=>x.call(this,S,u,I))),this}getKeyword(N){const q=this.RULES.all[N];return typeof q=="object"?q.definition:!!q}removeKeyword(N){const{RULES:q}=this;delete q.keywords[N],delete q.all[N];for(const j of q.rules){const u=j.rules.findIndex(S=>S.keyword===N);u>=0&&j.rules.splice(u,1)}return this}addFormat(N,q){return typeof q=="string"&&(q=new RegExp(q)),this.formats[N]=q,this}errorsText(N=this.errors,{separator:q=", ",dataVar:j="data"}={}){return!N||N.length===0?"No errors":N.map(u=>`${j}${u.instancePath} ${u.message}`).reduce((u,S)=>u+q+S)}$dataMetaSchema(N,q){const j=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(const u of q){const S=u.split("/").slice(1);let I=N;for(const z of S)I=I[z];for(const z in j){const F=j[z];if(typeof F!="object")continue;const{$data:X}=F.definition,W=I[z];X&&W&&(I[z]=ye(W))}}return N}_removeAllSchemas(N,q){for(const j in N){const u=N[j];(!q||q.test(j))&&(typeof u=="string"?delete N[j]:u&&!u.meta&&(this._cache.delete(u.schema),delete N[j]))}}_addSchema(N,q,j,u=this.opts.validateSchema,S=this.opts.addUsedSchema){let I;const{schemaId:z}=this.opts;if(typeof N=="object")I=N[z];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof N!="boolean")throw new Error("schema must be object or boolean")}let F=this._cache.get(N);if(F!==void 0)return F;j=(0,p.normalizeId)(I||j);const X=p.getSchemaRefs.call(this,N,j);return F=new d.SchemaEnv({schema:N,schemaId:z,meta:q,baseId:j,localRefs:X}),this._cache.set(F.schema,F),S&&!j.startsWith("#")&&(j&&this._checkUnique(j),this.refs[j]=F),u&&this.validateSchema(N,!0),F}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw new Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta?this._compileMetaSchema(N):d.compileSchema.call(this,N),!N.validate)throw new Error("ajv implementation error");return N.validate}_compileMetaSchema(N){const q=this.opts;this.opts=this._metaOpts;try{d.compileSchema.call(this,N)}finally{this.opts=q}}}f.ValidationError=l.default,f.MissingRefError=w.default,e.default=f;function s(A,N,q,j="error"){for(const u in A){const S=u;S in N&&this.logger[j](`${q}: option ${u}. ${A[S]}`)}}function h(A){return A=(0,p.normalizeId)(A),this.schemas[A]||this.refs[A]}function E(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const N in A)this.addSchema(A[N],N)}function k(){for(const A in this.opts.formats){const N=this.opts.formats[A];N&&this.addFormat(A,N)}}function C(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const N in A){const q=A[N];q.keyword||(q.keyword=N),this.addKeyword(q)}}function D(){const A={...this.opts};for(const N of m)delete A[N];return A}const V={log(){},warn(){},error(){}};function K(A){if(A===!1)return V;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const L=/^[a-z_$][a-z0-9_$:-]*$/i;function B(A,N){const{RULES:q}=this;if((0,y.eachItem)(A,j=>{if(q.keywords[j])throw new Error(`Keyword ${j} is already defined`);if(!L.test(j))throw new Error(`Keyword ${j} has invalid name`)}),!!N&&N.$data&&!("code"in N||"validate"in N))throw new Error('$data keyword must have "code" or "validate" function')}function x(A,N,q){var j;const u=N?.post;if(q&&u)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let I=u?S.post:S.rules.find(({type:F})=>F===q);if(I||(I={type:q,rules:[]},S.rules.push(I)),S.keywords[A]=!0,!N)return;const z={keyword:A,definition:{...N,type:(0,$.getJSONTypes)(N.type),schemaType:(0,$.getJSONTypes)(N.schemaType)}};N.before?de.call(this,I,z,N.before):I.rules.push(z),S.all[A]=z,(j=N.implements)===null||j===void 0||j.forEach(F=>this.addKeyword(F))}function de(A,N,q){const j=A.rules.findIndex(u=>u.keyword===q);j>=0?A.rules.splice(j,0,N):(A.rules.push(N),this.logger.warn(`rule ${q} is not defined`))}function fe(A){let{metaSchema:N}=A;N!==void 0&&(A.$data&&this.opts.$data&&(N=ye(N)),A.validateSchema=this.compile(N,!0))}const Z={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ye(A){return{anyOf:[A,Z]}}})(jt)),jt}var De={},Ve={},ze={},Sr;function Zn(){if(Sr)return ze;Sr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return ze.default=e,ze}var ve={},Pr;function xn(){if(Pr)return ve;Pr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.callRef=ve.getValidate=void 0;const e=Et(),r=le(),g=J(),l=_e(),w=Kt(),n=Q(),d={keyword:"$ref",schemaType:"string",code($){const{gen:y,schema:P,it:_}=$,{baseId:v,schemaEnv:m,validateName:b,opts:a,self:i}=_,{root:t}=m;if((P==="#"||P==="#/")&&v===t.baseId)return f();const o=w.resolveRef.call(i,t,v,P);if(o===void 0)throw new e.default(_.opts.uriResolver,v,P);if(o instanceof w.SchemaEnv)return s(o);return h(o);function f(){if(m===t)return p($,b,m,m.$async);const E=y.scopeValue("root",{ref:t});return p($,(0,g._)`${E}.validate`,t,t.$async)}function s(E){const k=c($,E);p($,k,E,E.$async)}function h(E){const k=y.scopeValue("schema",a.code.source===!0?{ref:E,code:(0,g.stringify)(E)}:{ref:E}),C=y.name("valid"),D=$.subschema({schema:E,dataTypes:[],schemaPath:g.nil,topSchemaRef:k,errSchemaPath:P},C);$.mergeEvaluated(D),$.ok(C)}}};function c($,y){const{gen:P}=$;return y.validate?P.scopeValue("validate",{ref:y.validate}):(0,g._)`${P.scopeValue("wrapper",{ref:y})}.validate`}ve.getValidate=c;function p($,y,P,_){const{gen:v,it:m}=$,{allErrors:b,schemaEnv:a,opts:i}=m,t=i.passContext?l.default.this:g.nil;_?o():f();function o(){if(!a.$async)throw new Error("async schema referenced by sync schema");const E=v.let("valid");v.try(()=>{v.code((0,g._)`await ${(0,r.callValidateCode)($,y,t)}`),h(y),b||v.assign(E,!0)},k=>{v.if((0,g._)`!(${k} instanceof ${m.ValidationError})`,()=>v.throw(k)),s(k),b||v.assign(E,!1)}),$.ok(E)}function f(){$.result((0,r.callValidateCode)($,y,t),()=>h(y),()=>s(y))}function s(E){const k=(0,g._)`${E}.errors`;v.assign(l.default.vErrors,(0,g._)`${l.default.vErrors} === null ? ${k} : ${l.default.vErrors}.concat(${k})`),v.assign(l.default.errors,(0,g._)`${l.default.vErrors}.length`)}function h(E){var k;if(!m.opts.unevaluated)return;const C=(k=P?.validate)===null||k===void 0?void 0:k.evaluated;if(m.props!==!0)if(C&&!C.dynamicProps)C.props!==void 0&&(m.props=n.mergeEvaluated.props(v,C.props,m.props));else{const D=v.var("props",(0,g._)`${E}.evaluated.props`);m.props=n.mergeEvaluated.props(v,D,m.props,g.Name)}if(m.items!==!0)if(C&&!C.dynamicItems)C.items!==void 0&&(m.items=n.mergeEvaluated.items(v,C.items,m.items));else{const D=v.var("items",(0,g._)`${E}.evaluated.items`);m.items=n.mergeEvaluated.items(v,D,m.items,g.Name)}}}return ve.callRef=p,ve.default=d,ve}var Rr;function es(){if(Rr)return Ve;Rr=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=Zn(),r=xn(),g=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];return Ve.default=g,Ve}var Ue={},Fe={},Nr;function ts(){if(Nr)return Fe;Nr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=J(),r=e.operators,g={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},l={message:({keyword:n,schemaCode:d})=>(0,e.str)`must be ${g[n].okStr} ${d}`,params:({keyword:n,schemaCode:d})=>(0,e._)`{comparison: ${g[n].okStr}, limit: ${d}}`},w={keyword:Object.keys(g),type:"number",schemaType:"number",$data:!0,error:l,code(n){const{keyword:d,data:c,schemaCode:p}=n;n.fail$data((0,e._)`${c} ${g[d].fail} ${p} || isNaN(${c})`)}};return Fe.default=w,Fe}var Le={},Or;function rs(){if(Or)return Le;Or=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=J(),g={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:l})=>(0,e.str)`must be multiple of ${l}`,params:({schemaCode:l})=>(0,e._)`{multipleOf: ${l}}`},code(l){const{gen:w,data:n,schemaCode:d,it:c}=l,p=c.opts.multipleOfPrecision,$=w.let("res"),y=p?(0,e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${p}`:(0,e._)`${$} !== parseInt(${$})`;l.fail$data((0,e._)`(${d} === 0 || (${$} = ${n}/${d}, ${y}))`)}};return Le.default=g,Le}var Ke={},He={},jr;function ns(){if(jr)return He;jr=1,Object.defineProperty(He,"__esModule",{value:!0});function e(r){const g=r.length;let l=0,w=0,n;for(;w<g;)l++,n=r.charCodeAt(w++),n>=55296&&n<=56319&&w<g&&(n=r.charCodeAt(w),(n&64512)===56320&&w++);return l}return He.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',He}var kr;function ss(){if(kr)return Ke;kr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=J(),r=Q(),g=ns(),w={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:d}){const c=n==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${c} than ${d} characters`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:d,data:c,schemaCode:p,it:$}=n,y=d==="maxLength"?e.operators.GT:e.operators.LT,P=$.opts.unicode===!1?(0,e._)`${c}.length`:(0,e._)`${(0,r.useFunc)(n.gen,g.default)}(${c})`;n.fail$data((0,e._)`${P} ${y} ${p}`)}};return Ke.default=w,Ke}var Ge={},Ir;function as(){if(Ir)return Ge;Ir=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=le(),r=Q(),g=J(),w={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,g.str)`must match pattern "${n}"`,params:({schemaCode:n})=>(0,g._)`{pattern: ${n}}`},code(n){const{gen:d,data:c,$data:p,schema:$,schemaCode:y,it:P}=n,_=P.opts.unicodeRegExp?"u":"";if(p){const{regExp:v}=P.opts.code,m=v.code==="new RegExp"?(0,g._)`new RegExp`:(0,r.useFunc)(d,v),b=d.let("valid");d.try(()=>d.assign(b,(0,g._)`${m}(${y}, ${_}).test(${c})`),()=>d.assign(b,!1)),n.fail$data((0,g._)`!${b}`)}else{const v=(0,e.usePattern)(n,$);n.fail$data((0,g._)`!${v}.test(${c})`)}}};return Ge.default=w,Ge}var Je={},Tr;function os(){if(Tr)return Je;Tr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=J(),g={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:l,schemaCode:w}){const n=l==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${n} than ${w} properties`},params:({schemaCode:l})=>(0,e._)`{limit: ${l}}`},code(l){const{keyword:w,data:n,schemaCode:d}=l,c=w==="maxProperties"?e.operators.GT:e.operators.LT;l.fail$data((0,e._)`Object.keys(${n}).length ${c} ${d}`)}};return Je.default=g,Je}var We={},qr;function is(){if(qr)return We;qr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=le(),r=J(),g=Q(),w={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:n}})=>(0,r.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,r._)`{missingProperty: ${n}}`},code(n){const{gen:d,schema:c,schemaCode:p,data:$,$data:y,it:P}=n,{opts:_}=P;if(!y&&c.length===0)return;const v=c.length>=_.loopRequired;if(P.allErrors?m():b(),_.strictRequired){const t=n.parentSchema.properties,{definedProperties:o}=n.it;for(const f of c)if(t?.[f]===void 0&&!o.has(f)){const s=P.schemaEnv.baseId+P.errSchemaPath,h=`required property "${f}" is not defined at "${s}" (strictRequired)`;(0,g.checkStrictMode)(P,h,P.opts.strictRequired)}}function m(){if(v||y)n.block$data(r.nil,a);else for(const t of c)(0,e.checkReportMissingProp)(n,t)}function b(){const t=d.let("missing");if(v||y){const o=d.let("valid",!0);n.block$data(o,()=>i(t,o)),n.ok(o)}else d.if((0,e.checkMissingProp)(n,c,t)),(0,e.reportMissingProp)(n,t),d.else()}function a(){d.forOf("prop",p,t=>{n.setParams({missingProperty:t}),d.if((0,e.noPropertyInData)(d,$,t,_.ownProperties),()=>n.error())})}function i(t,o){n.setParams({missingProperty:t}),d.forOf(t,p,()=>{d.assign(o,(0,e.propertyInData)(d,$,t,_.ownProperties)),d.if((0,r.not)(o),()=>{n.error(),d.break()})},r.nil)}}};return We.default=w,We}var Be={},Cr;function cs(){if(Cr)return Be;Cr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=J(),g={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:l,schemaCode:w}){const n=l==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${n} than ${w} items`},params:({schemaCode:l})=>(0,e._)`{limit: ${l}}`},code(l){const{keyword:w,data:n,schemaCode:d}=l,c=w==="maxItems"?e.operators.GT:e.operators.LT;l.fail$data((0,e._)`${n}.length ${c} ${d}`)}};return Be.default=g,Be}var Qe={},Xe={},Ar;function Ht(){if(Ar)return Xe;Ar=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=yn();return e.code='require("ajv/dist/runtime/equal").default',Xe.default=e,Xe}var Mr;function us(){if(Mr)return Qe;Mr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=gt(),r=J(),g=Q(),l=Ht(),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:d,j:c}})=>(0,r.str)`must NOT have duplicate items (items ## ${c} and ${d} are identical)`,params:({params:{i:d,j:c}})=>(0,r._)`{i: ${d}, j: ${c}}`},code(d){const{gen:c,data:p,$data:$,schema:y,parentSchema:P,schemaCode:_,it:v}=d;if(!$&&!y)return;const m=c.let("valid"),b=P.items?(0,e.getSchemaTypes)(P.items):[];d.block$data(m,a,(0,r._)`${_} === false`),d.ok(m);function a(){const f=c.let("i",(0,r._)`${p}.length`),s=c.let("j");d.setParams({i:f,j:s}),c.assign(m,!0),c.if((0,r._)`${f} > 1`,()=>(i()?t:o)(f,s))}function i(){return b.length>0&&!b.some(f=>f==="object"||f==="array")}function t(f,s){const h=c.name("item"),E=(0,e.checkDataTypes)(b,h,v.opts.strictNumbers,e.DataType.Wrong),k=c.const("indices",(0,r._)`{}`);c.for((0,r._)`;${f}--;`,()=>{c.let(h,(0,r._)`${p}[${f}]`),c.if(E,(0,r._)`continue`),b.length>1&&c.if((0,r._)`typeof ${h} == "string"`,(0,r._)`${h} += "_"`),c.if((0,r._)`typeof ${k}[${h}] == "number"`,()=>{c.assign(s,(0,r._)`${k}[${h}]`),d.error(),c.assign(m,!1).break()}).code((0,r._)`${k}[${h}] = ${f}`)})}function o(f,s){const h=(0,g.useFunc)(c,l.default),E=c.name("outer");c.label(E).for((0,r._)`;${f}--;`,()=>c.for((0,r._)`${s} = ${f}; ${s}--;`,()=>c.if((0,r._)`${h}(${p}[${f}], ${p}[${s}])`,()=>{d.error(),c.assign(m,!1).break(E)})))}}};return Qe.default=n,Qe}var Ye={},Dr;function ls(){if(Dr)return Ye;Dr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=J(),r=Q(),g=Ht(),w={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:n})=>(0,e._)`{allowedValue: ${n}}`},code(n){const{gen:d,data:c,$data:p,schemaCode:$,schema:y}=n;p||y&&typeof y=="object"?n.fail$data((0,e._)`!${(0,r.useFunc)(d,g.default)}(${c}, ${$})`):n.fail((0,e._)`${y} !== ${c}`)}};return Ye.default=w,Ye}var Ze={},Vr;function ds(){if(Vr)return Ze;Vr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=J(),r=Q(),g=Ht(),w={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:n})=>(0,e._)`{allowedValues: ${n}}`},code(n){const{gen:d,data:c,$data:p,schema:$,schemaCode:y,it:P}=n;if(!p&&$.length===0)throw new Error("enum must have non-empty array");const _=$.length>=P.opts.loopEnum;let v;const m=()=>v??(v=(0,r.useFunc)(d,g.default));let b;if(_||p)b=d.let("valid"),n.block$data(b,a);else{if(!Array.isArray($))throw new Error("ajv implementation error");const t=d.const("vSchema",y);b=(0,e.or)(...$.map((o,f)=>i(t,f)))}n.pass(b);function a(){d.assign(b,!1),d.forOf("v",y,t=>d.if((0,e._)`${m()}(${c}, ${t})`,()=>d.assign(b,!0).break()))}function i(t,o){const f=$[o];return typeof f=="object"&&f!==null?(0,e._)`${m()}(${c}, ${t}[${o}])`:(0,e._)`${c} === ${f}`}}};return Ze.default=w,Ze}var zr;function fs(){if(zr)return Ue;zr=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e=ts(),r=rs(),g=ss(),l=as(),w=os(),n=is(),d=cs(),c=us(),p=ls(),$=ds(),y=[e.default,r.default,g.default,l.default,w.default,n.default,d.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},p.default,$.default];return Ue.default=y,Ue}var xe={},Se={},Ur;function _n(){if(Ur)return Se;Ur=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.validateAdditionalItems=void 0;const e=J(),r=Q(),l={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:n}})=>(0,e.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,e._)`{limit: ${n}}`},code(n){const{parentSchema:d,it:c}=n,{items:p}=d;if(!Array.isArray(p)){(0,r.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}w(n,p)}};function w(n,d){const{gen:c,schema:p,data:$,keyword:y,it:P}=n;P.items=!0;const _=c.const("len",(0,e._)`${$}.length`);if(p===!1)n.setParams({len:d.length}),n.pass((0,e._)`${_} <= ${d.length}`);else if(typeof p=="object"&&!(0,r.alwaysValidSchema)(P,p)){const m=c.var("valid",(0,e._)`${_} <= ${d.length}`);c.if((0,e.not)(m),()=>v(m)),n.ok(m)}function v(m){c.forRange("i",d.length,_,b=>{n.subschema({keyword:y,dataProp:b,dataPropType:r.Type.Num},m),P.allErrors||c.if((0,e.not)(m),()=>c.break())})}}return Se.validateAdditionalItems=w,Se.default=l,Se}var et={},Pe={},Fr;function gn(){if(Fr)return Pe;Fr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.validateTuple=void 0;const e=J(),r=Q(),g=le(),l={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){const{schema:d,it:c}=n;if(Array.isArray(d))return w(n,"additionalItems",d);c.items=!0,!(0,r.alwaysValidSchema)(c,d)&&n.ok((0,g.validateArray)(n))}};function w(n,d,c=n.schema){const{gen:p,parentSchema:$,data:y,keyword:P,it:_}=n;b($),_.opts.unevaluated&&c.length&&_.items!==!0&&(_.items=r.mergeEvaluated.items(p,c.length,_.items));const v=p.name("valid"),m=p.const("len",(0,e._)`${y}.length`);c.forEach((a,i)=>{(0,r.alwaysValidSchema)(_,a)||(p.if((0,e._)`${m} > ${i}`,()=>n.subschema({keyword:P,schemaProp:i,dataProp:i},v)),n.ok(v))});function b(a){const{opts:i,errSchemaPath:t}=_,o=c.length,f=o===a.minItems&&(o===a.maxItems||a[d]===!1);if(i.strictTuples&&!f){const s=`"${P}" is ${o}-tuple, but minItems or maxItems/${d} are not specified or different at path "${t}"`;(0,r.checkStrictMode)(_,s,i.strictTuples)}}}return Pe.validateTuple=w,Pe.default=l,Pe}var Lr;function hs(){if(Lr)return et;Lr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=gn(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:g=>(0,e.validateTuple)(g,"items")};return et.default=r,et}var tt={},Kr;function ps(){if(Kr)return tt;Kr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=J(),r=Q(),g=le(),l=_n(),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:d}})=>(0,e.str)`must NOT have more than ${d} items`,params:({params:{len:d}})=>(0,e._)`{limit: ${d}}`},code(d){const{schema:c,parentSchema:p,it:$}=d,{prefixItems:y}=p;$.items=!0,!(0,r.alwaysValidSchema)($,c)&&(y?(0,l.validateAdditionalItems)(d,y):d.ok((0,g.validateArray)(d)))}};return tt.default=n,tt}var rt={},Hr;function ms(){if(Hr)return rt;Hr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=J(),r=Q(),l={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:w,max:n}})=>n===void 0?(0,e.str)`must contain at least ${w} valid item(s)`:(0,e.str)`must contain at least ${w} and no more than ${n} valid item(s)`,params:({params:{min:w,max:n}})=>n===void 0?(0,e._)`{minContains: ${w}}`:(0,e._)`{minContains: ${w}, maxContains: ${n}}`},code(w){const{gen:n,schema:d,parentSchema:c,data:p,it:$}=w;let y,P;const{minContains:_,maxContains:v}=c;$.opts.next?(y=_===void 0?1:_,P=v):y=1;const m=n.const("len",(0,e._)`${p}.length`);if(w.setParams({min:y,max:P}),P===void 0&&y===0){(0,r.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(P!==void 0&&y>P){(0,r.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),w.fail();return}if((0,r.alwaysValidSchema)($,d)){let o=(0,e._)`${m} >= ${y}`;P!==void 0&&(o=(0,e._)`${o} && ${m} <= ${P}`),w.pass(o);return}$.items=!0;const b=n.name("valid");P===void 0&&y===1?i(b,()=>n.if(b,()=>n.break())):y===0?(n.let(b,!0),P!==void 0&&n.if((0,e._)`${p}.length > 0`,a)):(n.let(b,!1),a()),w.result(b,()=>w.reset());function a(){const o=n.name("_valid"),f=n.let("count",0);i(o,()=>n.if(o,()=>t(f)))}function i(o,f){n.forRange("i",0,m,s=>{w.subschema({keyword:"contains",dataProp:s,dataPropType:r.Type.Num,compositeRule:!0},o),f()})}function t(o){n.code((0,e._)`${o}++`),P===void 0?n.if((0,e._)`${o} >= ${y}`,()=>n.assign(b,!0).break()):(n.if((0,e._)`${o} > ${P}`,()=>n.assign(b,!1).break()),y===1?n.assign(b,!0):n.if((0,e._)`${o} >= ${y}`,()=>n.assign(b,!0)))}}};return rt.default=l,rt}var Vt={},Gr;function ys(){return Gr||(Gr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const r=J(),g=Q(),l=le();e.error={message:({params:{property:p,depsCount:$,deps:y}})=>{const P=$===1?"property":"properties";return(0,r.str)`must have ${P} ${y} when property ${p} is present`},params:({params:{property:p,depsCount:$,deps:y,missingProperty:P}})=>(0,r._)`{property: ${p},
6
+ missingProperty: ${P},
7
+ depsCount: ${$},
8
+ deps: ${y}}`};const w={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(p){const[$,y]=n(p);d(p,$),c(p,y)}};function n({schema:p}){const $={},y={};for(const P in p){if(P==="__proto__")continue;const _=Array.isArray(p[P])?$:y;_[P]=p[P]}return[$,y]}function d(p,$=p.schema){const{gen:y,data:P,it:_}=p;if(Object.keys($).length===0)return;const v=y.let("missing");for(const m in $){const b=$[m];if(b.length===0)continue;const a=(0,l.propertyInData)(y,P,m,_.opts.ownProperties);p.setParams({property:m,depsCount:b.length,deps:b.join(", ")}),_.allErrors?y.if(a,()=>{for(const i of b)(0,l.checkReportMissingProp)(p,i)}):(y.if((0,r._)`${a} && (${(0,l.checkMissingProp)(p,b,v)})`),(0,l.reportMissingProp)(p,v),y.else())}}e.validatePropertyDeps=d;function c(p,$=p.schema){const{gen:y,data:P,keyword:_,it:v}=p,m=y.name("valid");for(const b in $)(0,g.alwaysValidSchema)(v,$[b])||(y.if((0,l.propertyInData)(y,P,b,v.opts.ownProperties),()=>{const a=p.subschema({keyword:_,schemaProp:b},m);p.mergeValidEvaluated(a,m)},()=>y.var(m,!0)),p.ok(m))}e.validateSchemaDeps=c,e.default=w})(Vt)),Vt}var nt={},Jr;function vs(){if(Jr)return nt;Jr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=J(),r=Q(),l={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:w})=>(0,e._)`{propertyName: ${w.propertyName}}`},code(w){const{gen:n,schema:d,data:c,it:p}=w;if((0,r.alwaysValidSchema)(p,d))return;const $=n.name("valid");n.forIn("key",c,y=>{w.setParams({propertyName:y}),w.subschema({keyword:"propertyNames",data:y,dataTypes:["string"],propertyName:y,compositeRule:!0},$),n.if((0,e.not)($),()=>{w.error(!0),p.allErrors||n.break()})}),w.ok($)}};return nt.default=l,nt}var st={},Wr;function $n(){if(Wr)return st;Wr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=le(),r=J(),g=_e(),l=Q(),n={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:d})=>(0,r._)`{additionalProperty: ${d.additionalProperty}}`},code(d){const{gen:c,schema:p,parentSchema:$,data:y,errsCount:P,it:_}=d;if(!P)throw new Error("ajv implementation error");const{allErrors:v,opts:m}=_;if(_.props=!0,m.removeAdditional!=="all"&&(0,l.alwaysValidSchema)(_,p))return;const b=(0,e.allSchemaProperties)($.properties),a=(0,e.allSchemaProperties)($.patternProperties);i(),d.ok((0,r._)`${P} === ${g.default.errors}`);function i(){c.forIn("key",y,h=>{!b.length&&!a.length?f(h):c.if(t(h),()=>f(h))})}function t(h){let E;if(b.length>8){const k=(0,l.schemaRefOrVal)(_,$.properties,"properties");E=(0,e.isOwnProperty)(c,k,h)}else b.length?E=(0,r.or)(...b.map(k=>(0,r._)`${h} === ${k}`)):E=r.nil;return a.length&&(E=(0,r.or)(E,...a.map(k=>(0,r._)`${(0,e.usePattern)(d,k)}.test(${h})`))),(0,r.not)(E)}function o(h){c.code((0,r._)`delete ${y}[${h}]`)}function f(h){if(m.removeAdditional==="all"||m.removeAdditional&&p===!1){o(h);return}if(p===!1){d.setParams({additionalProperty:h}),d.error(),v||c.break();return}if(typeof p=="object"&&!(0,l.alwaysValidSchema)(_,p)){const E=c.name("valid");m.removeAdditional==="failing"?(s(h,E,!1),c.if((0,r.not)(E),()=>{d.reset(),o(h)})):(s(h,E),v||c.if((0,r.not)(E),()=>c.break()))}}function s(h,E,k){const C={keyword:"additionalProperties",dataProp:h,dataPropType:l.Type.Str};k===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),d.subschema(C,E)}}};return st.default=n,st}var at={},Br;function _s(){if(Br)return at;Br=1,Object.defineProperty(at,"__esModule",{value:!0});const e=bt(),r=le(),g=Q(),l=$n(),w={keyword:"properties",type:"object",schemaType:"object",code(n){const{gen:d,schema:c,parentSchema:p,data:$,it:y}=n;y.opts.removeAdditional==="all"&&p.additionalProperties===void 0&&l.default.code(new e.KeywordCxt(y,l.default,"additionalProperties"));const P=(0,r.allSchemaProperties)(c);for(const a of P)y.definedProperties.add(a);y.opts.unevaluated&&P.length&&y.props!==!0&&(y.props=g.mergeEvaluated.props(d,(0,g.toHash)(P),y.props));const _=P.filter(a=>!(0,g.alwaysValidSchema)(y,c[a]));if(_.length===0)return;const v=d.name("valid");for(const a of _)m(a)?b(a):(d.if((0,r.propertyInData)(d,$,a,y.opts.ownProperties)),b(a),y.allErrors||d.else().var(v,!0),d.endIf()),n.it.definedProperties.add(a),n.ok(v);function m(a){return y.opts.useDefaults&&!y.compositeRule&&c[a].default!==void 0}function b(a){n.subschema({keyword:"properties",schemaProp:a,dataProp:a},v)}}};return at.default=w,at}var ot={},Qr;function gs(){if(Qr)return ot;Qr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=le(),r=J(),g=Q(),l=Q(),w={keyword:"patternProperties",type:"object",schemaType:"object",code(n){const{gen:d,schema:c,data:p,parentSchema:$,it:y}=n,{opts:P}=y,_=(0,e.allSchemaProperties)(c),v=_.filter(f=>(0,g.alwaysValidSchema)(y,c[f]));if(_.length===0||v.length===_.length&&(!y.opts.unevaluated||y.props===!0))return;const m=P.strictSchema&&!P.allowMatchingProperties&&$.properties,b=d.name("valid");y.props!==!0&&!(y.props instanceof r.Name)&&(y.props=(0,l.evaluatedPropsToName)(d,y.props));const{props:a}=y;i();function i(){for(const f of _)m&&t(f),y.allErrors?o(f):(d.var(b,!0),o(f),d.if(b))}function t(f){for(const s in m)new RegExp(f).test(s)&&(0,g.checkStrictMode)(y,`property ${s} matches pattern ${f} (use allowMatchingProperties)`)}function o(f){d.forIn("key",p,s=>{d.if((0,r._)`${(0,e.usePattern)(n,f)}.test(${s})`,()=>{const h=v.includes(f);h||n.subschema({keyword:"patternProperties",schemaProp:f,dataProp:s,dataPropType:l.Type.Str},b),y.opts.unevaluated&&a!==!0?d.assign((0,r._)`${a}[${s}]`,!0):!h&&!y.allErrors&&d.if((0,r.not)(b),()=>d.break())})})}}};return ot.default=w,ot}var it={},Xr;function $s(){if(Xr)return it;Xr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=Q(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(g){const{gen:l,schema:w,it:n}=g;if((0,e.alwaysValidSchema)(n,w)){g.fail();return}const d=l.name("valid");g.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},d),g.failResult(d,()=>g.reset(),()=>g.error())},error:{message:"must NOT be valid"}};return it.default=r,it}var ct={},Yr;function ws(){if(Yr)return ct;Yr=1,Object.defineProperty(ct,"__esModule",{value:!0});const r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:le().validateUnion,error:{message:"must match a schema in anyOf"}};return ct.default=r,ct}var ut={},Zr;function bs(){if(Zr)return ut;Zr=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=J(),r=Q(),l={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:w})=>(0,e._)`{passingSchemas: ${w.passing}}`},code(w){const{gen:n,schema:d,parentSchema:c,it:p}=w;if(!Array.isArray(d))throw new Error("ajv implementation error");if(p.opts.discriminator&&c.discriminator)return;const $=d,y=n.let("valid",!1),P=n.let("passing",null),_=n.name("_valid");w.setParams({passing:P}),n.block(v),w.result(y,()=>w.reset(),()=>w.error(!0));function v(){$.forEach((m,b)=>{let a;(0,r.alwaysValidSchema)(p,m)?n.var(_,!0):a=w.subschema({keyword:"oneOf",schemaProp:b,compositeRule:!0},_),b>0&&n.if((0,e._)`${_} && ${y}`).assign(y,!1).assign(P,(0,e._)`[${P}, ${b}]`).else(),n.if(_,()=>{n.assign(y,!0),n.assign(P,b),a&&w.mergeEvaluated(a,e.Name)})})}}};return ut.default=l,ut}var lt={},xr;function Es(){if(xr)return lt;xr=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=Q(),r={keyword:"allOf",schemaType:"array",code(g){const{gen:l,schema:w,it:n}=g;if(!Array.isArray(w))throw new Error("ajv implementation error");const d=l.name("valid");w.forEach((c,p)=>{if((0,e.alwaysValidSchema)(n,c))return;const $=g.subschema({keyword:"allOf",schemaProp:p},d);g.ok(d),g.mergeEvaluated($)})}};return lt.default=r,lt}var dt={},en;function Ss(){if(en)return dt;en=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=J(),r=Q(),l={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:n})=>(0,e.str)`must match "${n.ifClause}" schema`,params:({params:n})=>(0,e._)`{failingKeyword: ${n.ifClause}}`},code(n){const{gen:d,parentSchema:c,it:p}=n;c.then===void 0&&c.else===void 0&&(0,r.checkStrictMode)(p,'"if" without "then" and "else" is ignored');const $=w(p,"then"),y=w(p,"else");if(!$&&!y)return;const P=d.let("valid",!0),_=d.name("_valid");if(v(),n.reset(),$&&y){const b=d.let("ifClause");n.setParams({ifClause:b}),d.if(_,m("then",b),m("else",b))}else $?d.if(_,m("then")):d.if((0,e.not)(_),m("else"));n.pass(P,()=>n.error(!0));function v(){const b=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},_);n.mergeEvaluated(b)}function m(b,a){return()=>{const i=n.subschema({keyword:b},_);d.assign(P,_),n.mergeValidEvaluated(i,P),a?d.assign(a,(0,e._)`${b}`):n.setParams({ifClause:b})}}}};function w(n,d){const c=n.schema[d];return c!==void 0&&!(0,r.alwaysValidSchema)(n,c)}return dt.default=l,dt}var ft={},tn;function Ps(){if(tn)return ft;tn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=Q(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:g,parentSchema:l,it:w}){l.if===void 0&&(0,e.checkStrictMode)(w,`"${g}" without "if" is ignored`)}};return ft.default=r,ft}var rn;function Rs(){if(rn)return xe;rn=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=_n(),r=hs(),g=gn(),l=ps(),w=ms(),n=ys(),d=vs(),c=$n(),p=_s(),$=gs(),y=$s(),P=ws(),_=bs(),v=Es(),m=Ss(),b=Ps();function a(i=!1){const t=[y.default,P.default,_.default,v.default,m.default,b.default,d.default,c.default,n.default,p.default,$.default];return i?t.push(r.default,l.default):t.push(e.default,g.default),t.push(w.default),t}return xe.default=a,xe}var ht={},pt={},nn;function Ns(){if(nn)return pt;nn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=J(),g={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:l})=>(0,e.str)`must match format "${l}"`,params:({schemaCode:l})=>(0,e._)`{format: ${l}}`},code(l,w){const{gen:n,data:d,$data:c,schema:p,schemaCode:$,it:y}=l,{opts:P,errSchemaPath:_,schemaEnv:v,self:m}=y;if(!P.validateFormats)return;c?b():a();function b(){const i=n.scopeValue("formats",{ref:m.formats,code:P.code.formats}),t=n.const("fDef",(0,e._)`${i}[${$}]`),o=n.let("fType"),f=n.let("format");n.if((0,e._)`typeof ${t} == "object" && !(${t} instanceof RegExp)`,()=>n.assign(o,(0,e._)`${t}.type || "string"`).assign(f,(0,e._)`${t}.validate`),()=>n.assign(o,(0,e._)`"string"`).assign(f,t)),l.fail$data((0,e.or)(s(),h()));function s(){return P.strictSchema===!1?e.nil:(0,e._)`${$} && !${f}`}function h(){const E=v.$async?(0,e._)`(${t}.async ? await ${f}(${d}) : ${f}(${d}))`:(0,e._)`${f}(${d})`,k=(0,e._)`(typeof ${f} == "function" ? ${E} : ${f}.test(${d}))`;return(0,e._)`${f} && ${f} !== true && ${o} === ${w} && !${k}`}}function a(){const i=m.formats[p];if(!i){s();return}if(i===!0)return;const[t,o,f]=h(i);t===w&&l.pass(E());function s(){if(P.strictSchema===!1){m.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${p}" ignored in schema at path "${_}"`}}function h(k){const C=k instanceof RegExp?(0,e.regexpCode)(k):P.code.formats?(0,e._)`${P.code.formats}${(0,e.getProperty)(p)}`:void 0,D=n.scopeValue("formats",{key:p,ref:k,code:C});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,e._)`${D}.validate`]:["string",k,D]}function E(){if(typeof i=="object"&&!(i instanceof RegExp)&&i.async){if(!v.$async)throw new Error("async format in sync schema");return(0,e._)`await ${f}(${d})`}return typeof o=="function"?(0,e._)`${f}(${d})`:(0,e._)`${f}.test(${d})`}}}};return pt.default=g,pt}var sn;function Os(){if(sn)return ht;sn=1,Object.defineProperty(ht,"__esModule",{value:!0});const r=[Ns().default];return ht.default=r,ht}var we={},an;function js(){return an||(an=1,Object.defineProperty(we,"__esModule",{value:!0}),we.contentVocabulary=we.metadataVocabulary=void 0,we.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],we.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),we}var on;function ks(){if(on)return De;on=1,Object.defineProperty(De,"__esModule",{value:!0});const e=es(),r=fs(),g=Rs(),l=Os(),w=js(),n=[e.default,r.default,(0,g.default)(),l.default,w.metadataVocabulary,w.contentVocabulary];return De.default=n,De}var mt={},ke={},cn;function Is(){if(cn)return ke;cn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.DiscrError=void 0;var e;return(function(r){r.Tag="tag",r.Mapping="mapping"})(e||(ke.DiscrError=e={})),ke}var un;function Ts(){if(un)return mt;un=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=J(),r=Is(),g=Kt(),l=Et(),w=Q(),d={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:p}})=>c===r.DiscrError.Tag?`tag "${p}" must be string`:`value of tag "${p}" must be in oneOf`,params:({params:{discrError:c,tag:p,tagName:$}})=>(0,e._)`{error: ${c}, tag: ${$}, tagValue: ${p}}`},code(c){const{gen:p,data:$,schema:y,parentSchema:P,it:_}=c,{oneOf:v}=P;if(!_.opts.discriminator)throw new Error("discriminator: requires discriminator option");const m=y.propertyName;if(typeof m!="string")throw new Error("discriminator: requires propertyName");if(y.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");const b=p.let("valid",!1),a=p.const("tag",(0,e._)`${$}${(0,e.getProperty)(m)}`);p.if((0,e._)`typeof ${a} == "string"`,()=>i(),()=>c.error(!1,{discrError:r.DiscrError.Tag,tag:a,tagName:m})),c.ok(b);function i(){const f=o();p.if(!1);for(const s in f)p.elseIf((0,e._)`${a} === ${s}`),p.assign(b,t(f[s]));p.else(),c.error(!1,{discrError:r.DiscrError.Mapping,tag:a,tagName:m}),p.endIf()}function t(f){const s=p.name("valid"),h=c.subschema({keyword:"oneOf",schemaProp:f},s);return c.mergeEvaluated(h,e.Name),s}function o(){var f;const s={},h=k(P);let E=!0;for(let V=0;V<v.length;V++){let K=v[V];if(K?.$ref&&!(0,w.schemaHasRulesButRef)(K,_.self.RULES)){const B=K.$ref;if(K=g.resolveRef.call(_.self,_.schemaEnv.root,_.baseId,B),K instanceof g.SchemaEnv&&(K=K.schema),K===void 0)throw new l.default(_.opts.uriResolver,_.baseId,B)}const L=(f=K?.properties)===null||f===void 0?void 0:f[m];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${m}"`);E=E&&(h||k(K)),C(L,V)}if(!E)throw new Error(`discriminator: "${m}" must be required`);return s;function k({required:V}){return Array.isArray(V)&&V.includes(m)}function C(V,K){if(V.const)D(V.const,K);else if(V.enum)for(const L of V.enum)D(L,K);else throw new Error(`discriminator: "properties/${m}" must have "const" or "enum"`)}function D(V,K){if(typeof V!="string"||V in s)throw new Error(`discriminator: "${m}" values must be unique strings`);s[V]=K}}}};return mt.default=d,mt}const qs="http://json-schema.org/draft-07/schema#",Cs="http://json-schema.org/draft-07/schema#",As="Core schema meta-schema",Ms={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:[]}},Ds=["object","boolean"],Vs={$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:"#"}},zs={$schema:qs,$id:Cs,title:As,definitions:Ms,type:Ds,properties:Vs,default:!0};var ln;function Us(){return ln||(ln=1,(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.MissingRefError=r.ValidationError=r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=r.Ajv=void 0;const g=Yn(),l=ks(),w=Ts(),n=zs,d=["/properties"],c="http://json-schema.org/draft-07/schema";class p extends g.default{_addVocabularies(){super._addVocabularies(),l.default.forEach(m=>this.addVocabulary(m)),this.opts.discriminator&&this.addKeyword(w.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const m=this.opts.$data?this.$dataMetaSchema(n,d):n;this.addMetaSchema(m,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}r.Ajv=p,e.exports=r=p,e.exports.Ajv=p,Object.defineProperty(r,"__esModule",{value:!0}),r.default=p;var $=bt();Object.defineProperty(r,"KeywordCxt",{enumerable:!0,get:function(){return $.KeywordCxt}});var y=J();Object.defineProperty(r,"_",{enumerable:!0,get:function(){return y._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return y.str}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return y.stringify}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return y.nil}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return y.Name}}),Object.defineProperty(r,"CodeGen",{enumerable:!0,get:function(){return y.CodeGen}});var P=Lt();Object.defineProperty(r,"ValidationError",{enumerable:!0,get:function(){return P.default}});var _=Et();Object.defineProperty(r,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(Te,Te.exports)),Te.exports}var Fs=Us();const Ls=An(Fs),Ks="https://schemas.oceanum.io/eidos/root.json";let Ie=null;const dn=async e=>{const r=await fetch(e);if(r.statusCode>=400)throw new Error("Loading error: "+r.statusCode);return r.body},Hs=async e=>{if(!Ie){const g=await dn(Ks);Ie=await new Ls({allErrors:!0,verbose:!0,strict:!1,loadSchema:dn}).compileAsync(g)}if(!Ie(e)&&Ie.errors){const g=Ie.errors.map(l=>`${l.instancePath||"root"}: ${l.message} (${JSON.stringify(l.params||{})})`).join("; ");throw new Error(`EIDOS spec validation failed: ${g}`)}return!0},Gs="0.10.0",Js=Gs.split(".").slice(0,2).join("."),Ws=`https://render.eidos.oceanum.io/v${Js}/index.html`,wn=async(e,r,g={})=>{const{id:l,eventListener:w,renderer:n=Ws,authToken:d,onChange:c}=g,p=e.querySelector("iframe[data-eidos-renderer]"),$=e.getAttribute("data-eidos-initialized")==="true";if(p||$)throw new Error("EIDOS renderer already mounted in this container. Call destroy() before re-rendering.");e.setAttribute("data-eidos-initialized","true");try{await Hs(r)}catch(_){throw new Error(`Invalid Eidos Spec: ${_.message}`)}const y=hn(structuredClone(r)),P=l||r.id;return new Promise((_,v)=>{const m=document.createElement("iframe");m.src=`${n}?id=${P}`,m.width="100%",m.height="100%",m.frameBorder="0",m.setAttribute("data-eidos-renderer","true"),e.appendChild(m);let b=null,a=null;m.onload=()=>{const i=m.contentWindow,t=async f=>{const s=typeof f=="function"?await f():f;i?.postMessage({id:P,type:"auth",payload:s},"*")};b=f=>{f.source===i&&f.data?.type&&console.log("[EIDOS] Message from renderer:",f.data.type,f.data),f.source===i&&(f.data.id&&f.data.id!==P||(f.data.type==="init"?(i?.postMessage({id:P,type:"spec",payload:structuredClone(y)},"*"),d&&t(d)):(f.data.type||f.data.action||f.data.control)&&w?.(f.data)))},window.addEventListener("message",b),a=qn(y,()=>{const f=Cn(y);i?.postMessage({id:P,type:"spec",payload:f},"*"),c?.(f)}),d&&t(d),_({spec:y,updateAuth:t,triggerAction:f=>{i?.postMessage({id:P,type:"event",payload:f},"*")},iframe:m,destroy:()=>{b&&window.removeEventListener("message",b),a&&a(),m.remove(),e.removeAttribute("data-eidos-initialized")}})},m.onerror=()=>{v(new Error("Failed to load EIDOS renderer"))}})},bn=Re.createContext(null),Bs=()=>{const e=Re.useContext(bn);if(!e)throw new Error("useEidosSpec must be used within an EidosProvider");return e},Qs=({children:e,initialSpec:r,options:g={},containerStyle:l={width:"100%",height:"100%",position:"absolute"},onInitialized:w})=>{const n=Re.useRef(null),[d,c]=Re.useState(null),p=Re.useRef(!1);return Re.useEffect(()=>{if(!n.current||p.current)return;p.current=!0,(async()=>{try{const y=await wn(n.current,r,g);c(y.spec),w?.(y.spec)}catch(y){console.error("Failed to initialize EIDOS:",y),p.current=!1}})()},[r,g,w]),Nt.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[Nt.jsx("div",{ref:n,style:l}),d&&Nt.jsx(bn.Provider,{value:d,children:e})]})};exports.EidosProvider=Qs;exports.render=wn;exports.useEidosSpec=Bs;