@anov/cic-standard-sdk 0.0.11 → 0.0.12

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.
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function En(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Me={exports:{}},zt={},ge={},Pe={},Ft={},Lt={},Ut={},or;function wt(){return or||(or=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(s){if(super(),!e.IDENTIFIER.test(s))throw new Error("CodeGen: name must be a valid identifier");this.str=s}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class o extends t{constructor(s){super(),this._items=typeof s=="string"?[s]:s}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const s=this._items[0];return s===""||s==='""'}get str(){var s;return(s=this._str)!==null&&s!==void 0?s:this._str=this._items.reduce((c,y)=>`${c}${y}`,"")}get names(){var s;return(s=this._names)!==null&&s!==void 0?s:this._names=this._items.reduce((c,y)=>(y instanceof r&&(c[y.str]=(c[y.str]||0)+1),c),{})}}e._Code=o,e.nil=new o("");function h(l,...s){const c=[l[0]];let y=0;for(;y<s.length;)i(c,s[y]),c.push(l[++y]);return new o(c)}e._=h;const n=new o("+");function u(l,...s){const c=[_(l[0])];let y=0;for(;y<s.length;)c.push(n),i(c,s[y]),c.push(n,_(l[++y]));return f(c),new o(c)}e.str=u;function i(l,s){s instanceof o?l.push(...s._items):s instanceof r?l.push(s):l.push(E(s))}e.addCodeArg=i;function f(l){let s=1;for(;s<l.length-1;){if(l[s]===n){const c=$(l[s-1],l[s+1]);if(c!==void 0){l.splice(s-1,3,c);continue}l[s++]="+"}s++}}function $(l,s){if(s==='""')return l;if(l==='""')return s;if(typeof l=="string")return s instanceof r||l[l.length-1]!=='"'?void 0:typeof s!="string"?`${l.slice(0,-1)}${s}"`:s[0]==='"'?l.slice(0,-1)+s.slice(1):void 0;if(typeof s=="string"&&s[0]==='"'&&!(l instanceof r))return`"${l}${s.slice(1)}`}function g(l,s){return s.emptyStr()?l:l.emptyStr()?s:u`${l}${s}`}e.strConcat=g;function E(l){return typeof l=="number"||typeof l=="boolean"||l===null?l:_(Array.isArray(l)?l.join(","):l)}function v(l){return new o(_(l))}e.stringify=v;function _(l){return JSON.stringify(l).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=_;function b(l){return typeof l=="string"&&e.IDENTIFIER.test(l)?new o(`.${l}`):h`[${l}]`}e.getProperty=b;function w(l){if(typeof l=="string"&&e.IDENTIFIER.test(l))return new o(`${l}`);throw new Error(`CodeGen: invalid export name: ${l}, use explicit $id name mapping`)}e.getEsmExportName=w;function d(l){return new o(l.toString())}e.regexpCode=d})(Ut)),Ut}var Kt={},ar;function cr(){return ar||(ar=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=wt();class r extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`),this.value=$.value}}var o;(function(f){f[f.Started=0]="Started",f[f.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class h{constructor({prefixes:$,parent:g}={}){this._names={},this._prefixes=$,this._parent=g}toName($){return $ instanceof t.Name?$:this.name($)}name($){return new t.Name(this._newName($))}_newName($){const g=this._names[$]||this._nameGroup($);return`${$}${g.index++}`}_nameGroup($){var g,E;if(!((E=(g=this._parent)===null||g===void 0?void 0:g._prefixes)===null||E===void 0)&&E.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=h;class n extends t.Name{constructor($,g){super(g),this.prefix=$}setValue($,{property:g,itemIndex:E}){this.value=$,this.scopePath=(0,t._)`.${new t.Name(g)}[${E}]`}}e.ValueScopeName=n;const u=(0,t._)`\n`;class i extends h{constructor($){super($),this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?u:t.nil}}get(){return this._scope}name($){return new n($,this._newName($))}value($,g){var E;if(g.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName($),{prefix:_}=v,b=(E=g.key)!==null&&E!==void 0?E:g.ref;let w=this._values[_];if(w){const s=w.get(b);if(s)return s}else w=this._values[_]=new Map;w.set(b,v);const d=this._scope[_]||(this._scope[_]=[]),l=d.length;return d[l]=g.ref,v.setValue(g,{property:_,itemIndex:l}),v}getValue($,g){const E=this._values[$];if(E)return E.get(g)}scopeRefs($,g=this._values){return this._reduceValues(g,E=>{if(E.scopePath===void 0)throw new Error(`CodeGen: name "${E}" has no value`);return(0,t._)`${$}${E.scopePath}`})}scopeCode($=this._values,g,E){return this._reduceValues($,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},g,E)}_reduceValues($,g,E={},v){let _=t.nil;for(const b in $){const w=$[b];if(!w)continue;const d=E[b]=E[b]||new Map;w.forEach(l=>{if(d.has(l))return;d.set(l,o.Started);let s=g(l);if(s){const c=this.opts.es5?e.varKinds.var:e.varKinds.const;_=(0,t._)`${_}${c} ${l} = ${s};${this.opts._n}`}else if(s=v?.(l))_=(0,t._)`${_}${s}${this.opts._n}`;else throw new r(l);d.set(l,o.Completed)})}return _}}e.ValueScope=i})(Kt)),Kt}var dr;function G(){return dr||(dr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=wt(),r=cr();var o=wt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var h=cr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return h.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return h.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return h.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return h.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class n{optimizeNodes(){return this}optimizeNames(p,S){return this}}class u extends n{constructor(p,S,C){super(),this.varKind=p,this.name=S,this.rhs=C}render({es5:p,_n:S}){const C=p?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${U};`+S}optimizeNames(p,S){if(p[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,p,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends n{constructor(p,S,C){super(),this.lhs=p,this.rhs=S,this.sideEffects=C}render({_n:p}){return`${this.lhs} = ${this.rhs};`+p}optimizeNames(p,S){if(!(this.lhs instanceof t.Name&&!p[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,p,S),this}get names(){const p=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(p,this.rhs)}}class f extends i{constructor(p,S,C,U){super(p,C,U),this.op=S}render({_n:p}){return`${this.lhs} ${this.op}= ${this.rhs};`+p}}class $ extends n{constructor(p){super(),this.label=p,this.names={}}render({_n:p}){return`${this.label}:`+p}}class g extends n{constructor(p){super(),this.label=p,this.names={}}render({_n:p}){return`break${this.label?` ${this.label}`:""};`+p}}class E extends n{constructor(p){super(),this.error=p}render({_n:p}){return`throw ${this.error};`+p}get names(){return this.error.names}}class v extends n{constructor(p){super(),this.code=p}render({_n:p}){return`${this.code};`+p}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(p,S){return this.code=L(this.code,p,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class _ extends n{constructor(p=[]){super(),this.nodes=p}render(p){return this.nodes.reduce((S,C)=>S+C.render(p),"")}optimizeNodes(){const{nodes:p}=this;let S=p.length;for(;S--;){const C=p[S].optimizeNodes();Array.isArray(C)?p.splice(S,1,...C):C?p[S]=C:p.splice(S,1)}return p.length>0?this:void 0}optimizeNames(p,S){const{nodes:C}=this;let U=C.length;for(;U--;){const J=C[U];J.optimizeNames(p,S)||(Q(p,J.names),C.splice(U,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((p,S)=>V(p,S.names),{})}}class b extends _{render(p){return"{"+p._n+super.render(p)+"}"+p._n}}class w extends _{}class d extends b{}d.kind="else";class l extends b{constructor(p,S){super(S),this.condition=p}render(p){let S=`if(${this.condition})`+super.render(p);return this.else&&(S+="else "+this.else.render(p)),S}optimizeNodes(){super.optimizeNodes();const p=this.condition;if(p===!0)return this.nodes;let S=this.else;if(S){const C=S.optimizeNodes();S=this.else=Array.isArray(C)?new d(C):C}if(S)return p===!1?S instanceof l?S:S.nodes:this.nodes.length?this:new l(ie(p),S instanceof l?[S]:S.nodes);if(!(p===!1||!this.nodes.length))return this}optimizeNames(p,S){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(p,S),!!(super.optimizeNames(p,S)||this.else))return this.condition=L(this.condition,p,S),this}get names(){const p=super.names;return F(p,this.condition),this.else&&V(p,this.else.names),p}}l.kind="if";class s extends b{}s.kind="for";class c extends s{constructor(p){super(),this.iteration=p}render(p){return`for(${this.iteration})`+super.render(p)}optimizeNames(p,S){if(super.optimizeNames(p,S))return this.iteration=L(this.iteration,p,S),this}get names(){return V(super.names,this.iteration.names)}}class y extends s{constructor(p,S,C,U){super(),this.varKind=p,this.name=S,this.from=C,this.to=U}render(p){const S=p.es5?r.varKinds.var:this.varKind,{name:C,from:U,to:J}=this;return`for(${S} ${C}=${U}; ${C}<${J}; ${C}++)`+super.render(p)}get names(){const p=F(super.names,this.from);return F(p,this.to)}}class a extends s{constructor(p,S,C,U){super(),this.loop=p,this.varKind=S,this.name=C,this.iterable=U}render(p){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(p)}optimizeNames(p,S){if(super.optimizeNames(p,S))return this.iterable=L(this.iterable,p,S),this}get names(){return V(super.names,this.iterable.names)}}class m extends b{constructor(p,S,C){super(),this.name=p,this.args=S,this.async=C}render(p){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(p)}}m.kind="func";class P extends _{render(p){return"return "+super.render(p)}}P.kind="return";class R extends b{render(p){let S="try"+super.render(p);return this.catch&&(S+=this.catch.render(p)),this.finally&&(S+=this.finally.render(p)),S}optimizeNodes(){var p,S;return super.optimizeNodes(),(p=this.catch)===null||p===void 0||p.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(p,S){var C,U;return super.optimizeNames(p,S),(C=this.catch)===null||C===void 0||C.optimizeNames(p,S),(U=this.finally)===null||U===void 0||U.optimizeNames(p,S),this}get names(){const p=super.names;return this.catch&&V(p,this.catch.names),this.finally&&V(p,this.finally.names),p}}class T extends b{constructor(p){super(),this.error=p}render(p){return`catch(${this.error})`+super.render(p)}}T.kind="catch";class z extends b{render(p){return"finally"+super.render(p)}}z.kind="finally";class N{constructor(p,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
2
- `:""},this._extScope=p,this._scope=new r.Scope({parent:p}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(p){return this._scope.name(p)}scopeName(p){return this._extScope.name(p)}scopeValue(p,S){const C=this._extScope.value(p,S);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(p,S){return this._extScope.getValue(p,S)}scopeRefs(p){return this._extScope.scopeRefs(p,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(p,S,C,U){const J=this._scope.toName(S);return C!==void 0&&U&&(this._constants[J.str]=C),this._leafNode(new u(p,J,C)),J}const(p,S,C){return this._def(r.varKinds.const,p,S,C)}let(p,S,C){return this._def(r.varKinds.let,p,S,C)}var(p,S,C){return this._def(r.varKinds.var,p,S,C)}assign(p,S,C){return this._leafNode(new i(p,S,C))}add(p,S){return this._leafNode(new f(p,e.operators.ADD,S))}code(p){return typeof p=="function"?p():p!==t.nil&&this._leafNode(new v(p)),this}object(...p){const S=["{"];for(const[C,U]of p)S.length>1&&S.push(","),S.push(C),(C!==U||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,U));return S.push("}"),new t._Code(S)}if(p,S,C){if(this._blockNode(new l(p)),S&&C)this.code(S).else().code(C).endIf();else if(S)this.code(S).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(p){return this._elseNode(new l(p))}else(){return this._elseNode(new d)}endIf(){return this._endBlockNode(l,d)}_for(p,S){return this._blockNode(p),S&&this.code(S).endFor(),this}for(p,S){return this._for(new c(p),S)}forRange(p,S,C,U,J=this.opts.es5?r.varKinds.var:r.varKinds.let){const Z=this._scope.toName(p);return this._for(new y(J,Z,S,C),()=>U(Z))}forOf(p,S,C,U=r.varKinds.const){const J=this._scope.toName(p);if(this.opts.es5){const Z=S instanceof t.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,t._)`${Z}.length`,B=>{this.var(J,(0,t._)`${Z}[${B}]`),C(J)})}return this._for(new a("of",U,J,S),()=>C(J))}forIn(p,S,C,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(p,(0,t._)`Object.keys(${S})`,C);const J=this._scope.toName(p);return this._for(new a("in",U,J,S),()=>C(J))}endFor(){return this._endBlockNode(s)}label(p){return this._leafNode(new $(p))}break(p){return this._leafNode(new g(p))}return(p){const S=new P;if(this._blockNode(S),this.code(p),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(p,S,C){if(!S&&!C)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new R;if(this._blockNode(U),this.code(p),S){const J=this.name("e");this._currNode=U.catch=new T(J),S(J)}return C&&(this._currNode=U.finally=new z,this.code(C)),this._endBlockNode(T,z)}throw(p){return this._leafNode(new E(p))}block(p,S){return this._blockStarts.push(this._nodes.length),p&&this.code(p).endBlock(S),this}endBlock(p){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-S;if(C<0||p!==void 0&&C!==p)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${p} expected`);return this._nodes.length=S,this}func(p,S=t.nil,C,U){return this._blockNode(new m(p,S,C)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(m)}optimize(p=1){for(;p-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(p){return this._currNode.nodes.push(p),this}_blockNode(p){this._currNode.nodes.push(p),this._nodes.push(p)}_endBlockNode(p,S){const C=this._currNode;if(C instanceof p||S&&C instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${p.kind}/${S.kind}`:p.kind}"`)}_elseNode(p){const S=this._currNode;if(!(S instanceof l))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=p,this}get _root(){return this._nodes[0]}get _currNode(){const p=this._nodes;return p[p.length-1]}set _currNode(p){const S=this._nodes;S[S.length-1]=p}}e.CodeGen=N;function V(O,p){for(const S in p)O[S]=(O[S]||0)+(p[S]||0);return O}function F(O,p){return p instanceof t._CodeOrName?V(O,p.names):O}function L(O,p,S){if(O instanceof t.Name)return C(O);if(!U(O))return O;return new t._Code(O._items.reduce((J,Z)=>(Z instanceof t.Name&&(Z=C(Z)),Z instanceof t._Code?J.push(...Z._items):J.push(Z),J),[]));function C(J){const Z=S[J.str];return Z===void 0||p[J.str]!==1?J:(delete p[J.str],Z)}function U(J){return J instanceof t._Code&&J._items.some(Z=>Z instanceof t.Name&&p[Z.str]===1&&S[Z.str]!==void 0)}}function Q(O,p){for(const S in p)O[S]=(O[S]||0)-(p[S]||0)}function ie(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,t._)`!${D(O)}`}e.not=ie;const oe=j(e.operators.AND);function x(...O){return O.reduce(oe)}e.and=x;const fe=j(e.operators.OR);function M(...O){return O.reduce(fe)}e.or=M;function j(O){return(p,S)=>p===t.nil?S:S===t.nil?p:(0,t._)`${D(p)} ${O} ${D(S)}`}function D(O){return O instanceof t.Name?O:(0,t._)`(${O})`}})(Lt)),Lt}var H={},ur;function Y(){if(ur)return H;ur=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=G(),t=wt();function r(a){const m={};for(const P of a)m[P]=!0;return m}H.toHash=r;function o(a,m){return typeof m=="boolean"?m:Object.keys(m).length===0?!0:(h(a,m),!n(m,a.self.RULES.all))}H.alwaysValidSchema=o;function h(a,m=a.schema){const{opts:P,self:R}=a;if(!P.strictSchema||typeof m=="boolean")return;const T=R.RULES.keywords;for(const z in m)T[z]||y(a,`unknown keyword: "${z}"`)}H.checkUnknownRules=h;function n(a,m){if(typeof a=="boolean")return!a;for(const P in a)if(m[P])return!0;return!1}H.schemaHasRules=n;function u(a,m){if(typeof a=="boolean")return!a;for(const P in a)if(P!=="$ref"&&m.all[P])return!0;return!1}H.schemaHasRulesButRef=u;function i({topSchemaRef:a,schemaPath:m},P,R,T){if(!T){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${a}${m}${(0,e.getProperty)(R)}`}H.schemaRefOrVal=i;function f(a){return E(decodeURIComponent(a))}H.unescapeFragment=f;function $(a){return encodeURIComponent(g(a))}H.escapeFragment=$;function g(a){return typeof a=="number"?`${a}`:a.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=g;function E(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=E;function v(a,m){if(Array.isArray(a))for(const P of a)m(P);else m(a)}H.eachItem=v;function _({mergeNames:a,mergeToName:m,mergeValues:P,resultToName:R}){return(T,z,N,V)=>{const F=N===void 0?z:N instanceof e.Name?(z instanceof e.Name?a(T,z,N):m(T,z,N),N):z instanceof e.Name?(m(T,N,z),z):P(z,N);return V===e.Name&&!(F instanceof e.Name)?R(T,F):F}}H.mergeEvaluated={props:_({mergeNames:(a,m,P)=>a.if((0,e._)`${P} !== true && ${m} !== undefined`,()=>{a.if((0,e._)`${m} === true`,()=>a.assign(P,!0),()=>a.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${m})`))}),mergeToName:(a,m,P)=>a.if((0,e._)`${P} !== true`,()=>{m===!0?a.assign(P,!0):(a.assign(P,(0,e._)`${P} || {}`),w(a,P,m))}),mergeValues:(a,m)=>a===!0?!0:{...a,...m},resultToName:b}),items:_({mergeNames:(a,m,P)=>a.if((0,e._)`${P} !== true && ${m} !== undefined`,()=>a.assign(P,(0,e._)`${m} === true ? true : ${P} > ${m} ? ${P} : ${m}`)),mergeToName:(a,m,P)=>a.if((0,e._)`${P} !== true`,()=>a.assign(P,m===!0?!0:(0,e._)`${P} > ${m} ? ${P} : ${m}`)),mergeValues:(a,m)=>a===!0?!0:Math.max(a,m),resultToName:(a,m)=>a.var("items",m)})};function b(a,m){if(m===!0)return a.var("props",!0);const P=a.var("props",(0,e._)`{}`);return m!==void 0&&w(a,P,m),P}H.evaluatedPropsToName=b;function w(a,m,P){Object.keys(P).forEach(R=>a.assign((0,e._)`${m}${(0,e.getProperty)(R)}`,!0))}H.setEvaluated=w;const d={};function l(a,m){return a.scopeValue("func",{ref:m,code:d[m.code]||(d[m.code]=new t._Code(m.code))})}H.useFunc=l;var s;(function(a){a[a.Num=0]="Num",a[a.Str=1]="Str"})(s||(H.Type=s={}));function c(a,m,P){if(a instanceof e.Name){const R=m===s.Num;return P?R?(0,e._)`"[" + ${a} + "]"`:(0,e._)`"['" + ${a} + "']"`:R?(0,e._)`"/" + ${a}`:(0,e._)`"/" + ${a}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(a).toString():"/"+g(a)}H.getErrorPath=c;function y(a,m,P=a.opts.strictSchema){if(P){if(m=`strict mode: ${m}`,P===!0)throw new Error(m);a.self.logger.warn(m)}}return H.checkStrictMode=y,H}var Ae={},lr;function we(){if(lr)return Ae;lr=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=G(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ae.default=t,Ae}var fr;function Ct(){return fr||(fr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=G(),r=Y(),o=we();e.keywordError={message:({keyword:d})=>(0,t.str)`must pass "${d}" keyword validation`},e.keyword$DataError={message:({keyword:d,schemaType:l})=>l?(0,t.str)`"${d}" keyword must be ${l} ($data)`:(0,t.str)`"${d}" keyword is invalid ($data)`};function h(d,l=e.keywordError,s,c){const{it:y}=d,{gen:a,compositeRule:m,allErrors:P}=y,R=E(d,l,s);c??(m||P)?f(a,R):$(y,(0,t._)`[${R}]`)}e.reportError=h;function n(d,l=e.keywordError,s){const{it:c}=d,{gen:y,compositeRule:a,allErrors:m}=c,P=E(d,l,s);f(y,P),a||m||$(c,o.default.vErrors)}e.reportExtraError=n;function u(d,l){d.assign(o.default.errors,l),d.if((0,t._)`${o.default.vErrors} !== null`,()=>d.if(l,()=>d.assign((0,t._)`${o.default.vErrors}.length`,l),()=>d.assign(o.default.vErrors,null)))}e.resetErrorsCount=u;function i({gen:d,keyword:l,schemaValue:s,data:c,errsCount:y,it:a}){if(y===void 0)throw new Error("ajv implementation error");const m=d.name("err");d.forRange("i",y,o.default.errors,P=>{d.const(m,(0,t._)`${o.default.vErrors}[${P}]`),d.if((0,t._)`${m}.instancePath === undefined`,()=>d.assign((0,t._)`${m}.instancePath`,(0,t.strConcat)(o.default.instancePath,a.errorPath))),d.assign((0,t._)`${m}.schemaPath`,(0,t.str)`${a.errSchemaPath}/${l}`),a.opts.verbose&&(d.assign((0,t._)`${m}.schema`,s),d.assign((0,t._)`${m}.data`,c))})}e.extendErrors=i;function f(d,l){const s=d.const("err",l);d.if((0,t._)`${o.default.vErrors} === null`,()=>d.assign(o.default.vErrors,(0,t._)`[${s}]`),(0,t._)`${o.default.vErrors}.push(${s})`),d.code((0,t._)`${o.default.errors}++`)}function $(d,l){const{gen:s,validateName:c,schemaEnv:y}=d;y.$async?s.throw((0,t._)`new ${d.ValidationError}(${l})`):(s.assign((0,t._)`${c}.errors`,l),s.return(!1))}const g={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function E(d,l,s){const{createErrors:c}=d.it;return c===!1?(0,t._)`{}`:v(d,l,s)}function v(d,l,s={}){const{gen:c,it:y}=d,a=[_(y,s),b(d,s)];return w(d,l,a),c.object(...a)}function _({errorPath:d},{instancePath:l}){const s=l?(0,t.str)`${d}${(0,r.getErrorPath)(l,r.Type.Str)}`:d;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,s)]}function b({keyword:d,it:{errSchemaPath:l}},{schemaPath:s,parentSchema:c}){let y=c?l:(0,t.str)`${l}/${d}`;return s&&(y=(0,t.str)`${y}${(0,r.getErrorPath)(s,r.Type.Str)}`),[g.schemaPath,y]}function w(d,{params:l,message:s},c){const{keyword:y,data:a,schemaValue:m,it:P}=d,{opts:R,propertyName:T,topSchemaRef:z,schemaPath:N}=P;c.push([g.keyword,y],[g.params,typeof l=="function"?l(d):l||(0,t._)`{}`]),R.messages&&c.push([g.message,typeof s=="function"?s(d):s]),R.verbose&&c.push([g.schema,m],[g.parentSchema,(0,t._)`${z}${N}`],[o.default.data,a]),T&&c.push([g.propertyName,T])}})(Ft)),Ft}var pr;function cs(){if(pr)return Pe;pr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.boolOrEmptySchema=Pe.topBoolOrEmptySchema=void 0;const e=Ct(),t=G(),r=we(),o={message:"boolean schema is false"};function h(i){const{gen:f,schema:$,validateName:g}=i;$===!1?u(i,!1):typeof $=="object"&&$.$async===!0?f.return(r.default.data):(f.assign((0,t._)`${g}.errors`,null),f.return(!0))}Pe.topBoolOrEmptySchema=h;function n(i,f){const{gen:$,schema:g}=i;g===!1?($.var(f,!1),u(i)):$.var(f,!0)}Pe.boolOrEmptySchema=n;function u(i,f){const{gen:$,data:g}=i,E={gen:$,keyword:"false schema",data:g,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:i};(0,e.reportError)(E,o,void 0,f)}return Pe}var se={},Se={},mr;function kn(){if(mr)return Se;mr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.getRules=Se.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(h){return typeof h=="string"&&t.has(h)}Se.isJSONType=r;function o(){const h={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...h,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},h.number,h.string,h.array,h.object],post:{rules:[]},all:{},keywords:{}}}return Se.getRules=o,Se}var ve={},hr;function jn(){if(hr)return ve;hr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.shouldUseRule=ve.shouldUseGroup=ve.schemaHasRulesForType=void 0;function e({schema:o,self:h},n){const u=h.RULES.types[n];return u&&u!==!0&&t(o,u)}ve.schemaHasRulesForType=e;function t(o,h){return h.rules.some(n=>r(o,n))}ve.shouldUseGroup=t;function r(o,h){var n;return o[h.keyword]!==void 0||((n=h.definition.implements)===null||n===void 0?void 0:n.some(u=>o[u]!==void 0))}return ve.shouldUseRule=r,ve}var yr;function Pt(){if(yr)return se;yr=1,Object.defineProperty(se,"__esModule",{value:!0}),se.reportTypeError=se.checkDataTypes=se.checkDataType=se.coerceAndCheckDataType=se.getJSONTypes=se.getSchemaTypes=se.DataType=void 0;const e=kn(),t=jn(),r=Ct(),o=G(),h=Y();var n;(function(s){s[s.Correct=0]="Correct",s[s.Wrong=1]="Wrong"})(n||(se.DataType=n={}));function u(s){const c=i(s.type);if(c.includes("null")){if(s.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!c.length&&s.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');s.nullable===!0&&c.push("null")}return c}se.getSchemaTypes=u;function i(s){const c=Array.isArray(s)?s:s?[s]:[];if(c.every(e.isJSONType))return c;throw new Error("type must be JSONType or JSONType[]: "+c.join(","))}se.getJSONTypes=i;function f(s,c){const{gen:y,data:a,opts:m}=s,P=g(c,m.coerceTypes),R=c.length>0&&!(P.length===0&&c.length===1&&(0,t.schemaHasRulesForType)(s,c[0]));if(R){const T=b(c,a,m.strictNumbers,n.Wrong);y.if(T,()=>{P.length?E(s,c,P):d(s)})}return R}se.coerceAndCheckDataType=f;const $=new Set(["string","number","integer","boolean","null"]);function g(s,c){return c?s.filter(y=>$.has(y)||c==="array"&&y==="array"):[]}function E(s,c,y){const{gen:a,data:m,opts:P}=s,R=a.let("dataType",(0,o._)`typeof ${m}`),T=a.let("coerced",(0,o._)`undefined`);P.coerceTypes==="array"&&a.if((0,o._)`${R} == 'object' && Array.isArray(${m}) && ${m}.length == 1`,()=>a.assign(m,(0,o._)`${m}[0]`).assign(R,(0,o._)`typeof ${m}`).if(b(c,m,P.strictNumbers),()=>a.assign(T,m))),a.if((0,o._)`${T} !== undefined`);for(const N of y)($.has(N)||N==="array"&&P.coerceTypes==="array")&&z(N);a.else(),d(s),a.endIf(),a.if((0,o._)`${T} !== undefined`,()=>{a.assign(m,T),v(s,T)});function z(N){switch(N){case"string":a.elseIf((0,o._)`${R} == "number" || ${R} == "boolean"`).assign(T,(0,o._)`"" + ${m}`).elseIf((0,o._)`${m} === null`).assign(T,(0,o._)`""`);return;case"number":a.elseIf((0,o._)`${R} == "boolean" || ${m} === null
3
- || (${R} == "string" && ${m} && ${m} == +${m})`).assign(T,(0,o._)`+${m}`);return;case"integer":a.elseIf((0,o._)`${R} === "boolean" || ${m} === null
4
- || (${R} === "string" && ${m} && ${m} == +${m} && !(${m} % 1))`).assign(T,(0,o._)`+${m}`);return;case"boolean":a.elseIf((0,o._)`${m} === "false" || ${m} === 0 || ${m} === null`).assign(T,!1).elseIf((0,o._)`${m} === "true" || ${m} === 1`).assign(T,!0);return;case"null":a.elseIf((0,o._)`${m} === "" || ${m} === 0 || ${m} === false`),a.assign(T,null);return;case"array":a.elseIf((0,o._)`${R} === "string" || ${R} === "number"
5
- || ${R} === "boolean" || ${m} === null`).assign(T,(0,o._)`[${m}]`)}}}function v({gen:s,parentData:c,parentDataProperty:y},a){s.if((0,o._)`${c} !== undefined`,()=>s.assign((0,o._)`${c}[${y}]`,a))}function _(s,c,y,a=n.Correct){const m=a===n.Correct?o.operators.EQ:o.operators.NEQ;let P;switch(s){case"null":return(0,o._)`${c} ${m} null`;case"array":P=(0,o._)`Array.isArray(${c})`;break;case"object":P=(0,o._)`${c} && typeof ${c} == "object" && !Array.isArray(${c})`;break;case"integer":P=R((0,o._)`!(${c} % 1) && !isNaN(${c})`);break;case"number":P=R();break;default:return(0,o._)`typeof ${c} ${m} ${s}`}return a===n.Correct?P:(0,o.not)(P);function R(T=o.nil){return(0,o.and)((0,o._)`typeof ${c} == "number"`,T,y?(0,o._)`isFinite(${c})`:o.nil)}}se.checkDataType=_;function b(s,c,y,a){if(s.length===1)return _(s[0],c,y,a);let m;const P=(0,h.toHash)(s);if(P.array&&P.object){const R=(0,o._)`typeof ${c} != "object"`;m=P.null?R:(0,o._)`!${c} || ${R}`,delete P.null,delete P.array,delete P.object}else m=o.nil;P.number&&delete P.integer;for(const R in P)m=(0,o.and)(m,_(R,c,y,a));return m}se.checkDataTypes=b;const w={message:({schema:s})=>`must be ${s}`,params:({schema:s,schemaValue:c})=>typeof s=="string"?(0,o._)`{type: ${s}}`:(0,o._)`{type: ${c}}`};function d(s){const c=l(s);(0,r.reportError)(c,w)}se.reportTypeError=d;function l(s){const{gen:c,data:y,schema:a}=s,m=(0,h.schemaRefOrVal)(s,a,"type");return{gen:c,keyword:"type",data:y,schema:a.type,schemaCode:m,schemaValue:m,parentSchema:a,params:{},it:s}}return se}var Re={},gr;function ds(){if(gr)return Re;gr=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.assignDefaults=void 0;const e=G(),t=Y();function r(h,n){const{properties:u,items:i}=h.schema;if(n==="object"&&u)for(const f in u)o(h,f,u[f].default);else n==="array"&&Array.isArray(i)&&i.forEach((f,$)=>o(h,$,f.default))}Re.assignDefaults=r;function o(h,n,u){const{gen:i,compositeRule:f,data:$,opts:g}=h;if(u===void 0)return;const E=(0,e._)`${$}${(0,e.getProperty)(n)}`;if(f){(0,t.checkStrictMode)(h,`default is ignored for: ${E}`);return}let v=(0,e._)`${E} === undefined`;g.useDefaults==="empty"&&(v=(0,e._)`${v} || ${E} === null || ${E} === ""`),i.if(v,(0,e._)`${E} = ${(0,e.stringify)(u)}`)}return Re}var me={},X={},vr;function ye(){if(vr)return X;vr=1,Object.defineProperty(X,"__esModule",{value:!0}),X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;const e=G(),t=Y(),r=we(),o=Y();function h(s,c){const{gen:y,data:a,it:m}=s;y.if(g(y,a,c,m.opts.ownProperties),()=>{s.setParams({missingProperty:(0,e._)`${c}`},!0),s.error()})}X.checkReportMissingProp=h;function n({gen:s,data:c,it:{opts:y}},a,m){return(0,e.or)(...a.map(P=>(0,e.and)(g(s,c,P,y.ownProperties),(0,e._)`${m} = ${P}`)))}X.checkMissingProp=n;function u(s,c){s.setParams({missingProperty:c},!0),s.error()}X.reportMissingProp=u;function i(s){return s.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=i;function f(s,c,y){return(0,e._)`${i(s)}.call(${c}, ${y})`}X.isOwnProperty=f;function $(s,c,y,a){const m=(0,e._)`${c}${(0,e.getProperty)(y)} !== undefined`;return a?(0,e._)`${m} && ${f(s,c,y)}`:m}X.propertyInData=$;function g(s,c,y,a){const m=(0,e._)`${c}${(0,e.getProperty)(y)} === undefined`;return a?(0,e.or)(m,(0,e.not)(f(s,c,y))):m}X.noPropertyInData=g;function E(s){return s?Object.keys(s).filter(c=>c!=="__proto__"):[]}X.allSchemaProperties=E;function v(s,c){return E(c).filter(y=>!(0,t.alwaysValidSchema)(s,c[y]))}X.schemaProperties=v;function _({schemaCode:s,data:c,it:{gen:y,topSchemaRef:a,schemaPath:m,errorPath:P},it:R},T,z,N){const V=N?(0,e._)`${s}, ${c}, ${a}${m}`:c,F=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,P)],[r.default.parentData,R.parentData],[r.default.parentDataProperty,R.parentDataProperty],[r.default.rootData,r.default.rootData]];R.opts.dynamicRef&&F.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const L=(0,e._)`${V}, ${y.object(...F)}`;return z!==e.nil?(0,e._)`${T}.call(${z}, ${L})`:(0,e._)`${T}(${L})`}X.callValidateCode=_;const b=(0,e._)`new RegExp`;function w({gen:s,it:{opts:c}},y){const a=c.unicodeRegExp?"u":"",{regExp:m}=c.code,P=m(y,a);return s.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${m.code==="new RegExp"?b:(0,o.useFunc)(s,m)}(${y}, ${a})`})}X.usePattern=w;function d(s){const{gen:c,data:y,keyword:a,it:m}=s,P=c.name("valid");if(m.allErrors){const T=c.let("valid",!0);return R(()=>c.assign(T,!1)),T}return c.var(P,!0),R(()=>c.break()),P;function R(T){const z=c.const("len",(0,e._)`${y}.length`);c.forRange("i",0,z,N=>{s.subschema({keyword:a,dataProp:N,dataPropType:t.Type.Num},P),c.if((0,e.not)(P),T)})}}X.validateArray=d;function l(s){const{gen:c,schema:y,keyword:a,it:m}=s;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(m,z))&&!m.opts.unevaluated)return;const R=c.let("valid",!1),T=c.name("_valid");c.block(()=>y.forEach((z,N)=>{const V=s.subschema({keyword:a,schemaProp:N,compositeRule:!0},T);c.assign(R,(0,e._)`${R} || ${T}`),s.mergeValidEvaluated(V,T)||c.if((0,e.not)(R))})),s.result(R,()=>s.reset(),()=>s.error(!0))}return X.validateUnion=l,X}var _r;function us(){if(_r)return me;_r=1,Object.defineProperty(me,"__esModule",{value:!0}),me.validateKeywordUsage=me.validSchemaType=me.funcKeywordCode=me.macroKeywordCode=void 0;const e=G(),t=we(),r=ye(),o=Ct();function h(v,_){const{gen:b,keyword:w,schema:d,parentSchema:l,it:s}=v,c=_.macro.call(s.self,d,l,s),y=$(b,w,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);const a=b.name("valid");v.subschema({schema:c,schemaPath:e.nil,errSchemaPath:`${s.errSchemaPath}/${w}`,topSchemaRef:y,compositeRule:!0},a),v.pass(a,()=>v.error(!0))}me.macroKeywordCode=h;function n(v,_){var b;const{gen:w,keyword:d,schema:l,parentSchema:s,$data:c,it:y}=v;f(y,_);const a=!c&&_.compile?_.compile.call(y.self,l,s,y):_.validate,m=$(w,d,a),P=w.let("valid");v.block$data(P,R),v.ok((b=_.valid)!==null&&b!==void 0?b:P);function R(){if(_.errors===!1)N(),_.modifying&&u(v),V(()=>v.error());else{const F=_.async?T():z();_.modifying&&u(v),V(()=>i(v,F))}}function T(){const F=w.let("ruleErrs",null);return w.try(()=>N((0,e._)`await `),L=>w.assign(P,!1).if((0,e._)`${L} instanceof ${y.ValidationError}`,()=>w.assign(F,(0,e._)`${L}.errors`),()=>w.throw(L))),F}function z(){const F=(0,e._)`${m}.errors`;return w.assign(F,null),N(e.nil),F}function N(F=_.async?(0,e._)`await `:e.nil){const L=y.opts.passContext?t.default.this:t.default.self,Q=!("compile"in _&&!c||_.schema===!1);w.assign(P,(0,e._)`${F}${(0,r.callValidateCode)(v,m,L,Q)}`,_.modifying)}function V(F){var L;w.if((0,e.not)((L=_.valid)!==null&&L!==void 0?L:P),F)}}me.funcKeywordCode=n;function u(v){const{gen:_,data:b,it:w}=v;_.if(w.parentData,()=>_.assign(b,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function i(v,_){const{gen:b}=v;b.if((0,e._)`Array.isArray(${_})`,()=>{b.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${_} : ${t.default.vErrors}.concat(${_})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,o.extendErrors)(v)},()=>v.error())}function f({schemaEnv:v},_){if(_.async&&!v.$async)throw new Error("async keyword in sync schema")}function $(v,_,b){if(b===void 0)throw new Error(`keyword "${_}" failed to compile`);return v.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function g(v,_,b=!1){return!_.length||_.some(w=>w==="array"?Array.isArray(v):w==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==w||b&&typeof v>"u")}me.validSchemaType=g;function E({schema:v,opts:_,self:b,errSchemaPath:w},d,l){if(Array.isArray(d.keyword)?!d.keyword.includes(l):d.keyword!==l)throw new Error("ajv implementation error");const s=d.dependencies;if(s?.some(c=>!Object.prototype.hasOwnProperty.call(v,c)))throw new Error(`parent schema must have dependencies of ${l}: ${s.join(",")}`);if(d.validateSchema&&!d.validateSchema(v[l])){const y=`keyword "${l}" value is invalid at path "${w}": `+b.errorsText(d.validateSchema.errors);if(_.validateSchema==="log")b.logger.error(y);else throw new Error(y)}}return me.validateKeywordUsage=E,me}var _e={},$r;function ls(){if($r)return _e;$r=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.extendSubschemaMode=_e.extendSubschemaData=_e.getSubschema=void 0;const e=G(),t=Y();function r(n,{keyword:u,schemaProp:i,schema:f,schemaPath:$,errSchemaPath:g,topSchemaRef:E}){if(u!==void 0&&f!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(u!==void 0){const v=n.schema[u];return i===void 0?{schema:v,schemaPath:(0,e._)`${n.schemaPath}${(0,e.getProperty)(u)}`,errSchemaPath:`${n.errSchemaPath}/${u}`}:{schema:v[i],schemaPath:(0,e._)`${n.schemaPath}${(0,e.getProperty)(u)}${(0,e.getProperty)(i)}`,errSchemaPath:`${n.errSchemaPath}/${u}/${(0,t.escapeFragment)(i)}`}}if(f!==void 0){if($===void 0||g===void 0||E===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:f,schemaPath:$,topSchemaRef:E,errSchemaPath:g}}throw new Error('either "keyword" or "schema" must be passed')}_e.getSubschema=r;function o(n,u,{dataProp:i,dataPropType:f,data:$,dataTypes:g,propertyName:E}){if($!==void 0&&i!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:v}=u;if(i!==void 0){const{errorPath:b,dataPathArr:w,opts:d}=u,l=v.let("data",(0,e._)`${u.data}${(0,e.getProperty)(i)}`,!0);_(l),n.errorPath=(0,e.str)`${b}${(0,t.getErrorPath)(i,f,d.jsPropertySyntax)}`,n.parentDataProperty=(0,e._)`${i}`,n.dataPathArr=[...w,n.parentDataProperty]}if($!==void 0){const b=$ instanceof e.Name?$:v.let("data",$,!0);_(b),E!==void 0&&(n.propertyName=E)}g&&(n.dataTypes=g);function _(b){n.data=b,n.dataLevel=u.dataLevel+1,n.dataTypes=[],u.definedProperties=new Set,n.parentData=u.data,n.dataNames=[...u.dataNames,b]}}_e.extendSubschemaData=o;function h(n,{jtdDiscriminator:u,jtdMetadata:i,compositeRule:f,createErrors:$,allErrors:g}){f!==void 0&&(n.compositeRule=f),$!==void 0&&(n.createErrors=$),g!==void 0&&(n.allErrors=g),n.jtdDiscriminator=u,n.jtdMetadata=i}return _e.extendSubschemaMode=h,_e}var ae={},Jt,br;function In(){return br||(br=1,Jt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,h,n;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(h=o;h--!==0;)if(!e(t[h],r[h]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(n=Object.keys(t),o=n.length,o!==Object.keys(r).length)return!1;for(h=o;h--!==0;)if(!Object.prototype.hasOwnProperty.call(r,n[h]))return!1;for(h=o;h--!==0;){var u=n[h];if(!e(t[u],r[u]))return!1}return!0}return t!==t&&r!==r}),Jt}var Ht={exports:{}},wr;function fs(){if(wr)return Ht.exports;wr=1;var e=Ht.exports=function(o,h,n){typeof h=="function"&&(n=h,h={}),n=h.cb||n;var u=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};t(h,u,i,o,"",o)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(o,h,n,u,i,f,$,g,E,v){if(u&&typeof u=="object"&&!Array.isArray(u)){h(u,i,f,$,g,E,v);for(var _ in u){var b=u[_];if(Array.isArray(b)){if(_ in e.arrayKeywords)for(var w=0;w<b.length;w++)t(o,h,n,b[w],i+"/"+_+"/"+w,f,i,_,u,w)}else if(_ in e.propsKeywords){if(b&&typeof b=="object")for(var d in b)t(o,h,n,b[d],i+"/"+_+"/"+r(d),f,i,_,u,d)}else(_ in e.keywords||o.allKeys&&!(_ in e.skipKeywords))&&t(o,h,n,b,i+"/"+_,f,i,_,u)}n(u,i,f,$,g,E,v)}}function r(o){return o.replace(/~/g,"~0").replace(/\//g,"~1")}return Ht.exports}var Pr;function Nt(){if(Pr)return ae;Pr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.getSchemaRefs=ae.resolveUrl=ae.normalizeId=ae._getFullPath=ae.getFullPath=ae.inlineRef=void 0;const e=Y(),t=In(),r=fs(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function h(w,d=!0){return typeof w=="boolean"?!0:d===!0?!u(w):d?i(w)<=d:!1}ae.inlineRef=h;const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(w){for(const d in w){if(n.has(d))return!0;const l=w[d];if(Array.isArray(l)&&l.some(u)||typeof l=="object"&&u(l))return!0}return!1}function i(w){let d=0;for(const l in w){if(l==="$ref")return 1/0;if(d++,!o.has(l)&&(typeof w[l]=="object"&&(0,e.eachItem)(w[l],s=>d+=i(s)),d===1/0))return 1/0}return d}function f(w,d="",l){l!==!1&&(d=E(d));const s=w.parse(d);return $(w,s)}ae.getFullPath=f;function $(w,d){return w.serialize(d).split("#")[0]+"#"}ae._getFullPath=$;const g=/#\/?$/;function E(w){return w?w.replace(g,""):""}ae.normalizeId=E;function v(w,d,l){return l=E(l),w.resolve(d,l)}ae.resolveUrl=v;const _=/^[a-z_][-a-z0-9._]*$/i;function b(w,d){if(typeof w=="boolean")return{};const{schemaId:l,uriResolver:s}=this.opts,c=E(w[l]||d),y={"":c},a=f(s,c,!1),m={},P=new Set;return r(w,{allKeys:!0},(z,N,V,F)=>{if(F===void 0)return;const L=a+N;let Q=y[F];typeof z[l]=="string"&&(Q=ie.call(this,z[l])),oe.call(this,z.$anchor),oe.call(this,z.$dynamicAnchor),y[N]=Q;function ie(x){const fe=this.opts.uriResolver.resolve;if(x=E(Q?fe(Q,x):x),P.has(x))throw T(x);P.add(x);let M=this.refs[x];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?R(z,M.schema,x):x!==E(L)&&(x[0]==="#"?(R(z,m[x],x),m[x]=z):this.refs[x]=L),x}function oe(x){if(typeof x=="string"){if(!_.test(x))throw new Error(`invalid anchor "${x}"`);ie.call(this,`#${x}`)}}}),m;function R(z,N,V){if(N!==void 0&&!t(z,N))throw T(V)}function T(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ae.getSchemaRefs=b,ae}var Sr;function qt(){if(Sr)return ge;Sr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.getData=ge.KeywordCxt=ge.validateFunctionCode=void 0;const e=cs(),t=Pt(),r=jn(),o=Pt(),h=ds(),n=us(),u=ls(),i=G(),f=we(),$=Nt(),g=Y(),E=Ct();function v(k){if(a(k)&&(P(k),y(k))){d(k);return}_(k,()=>(0,e.topBoolOrEmptySchema)(k))}ge.validateFunctionCode=v;function _({gen:k,validateName:I,schema:q,schemaEnv:A,opts:K},W){K.code.es5?k.func(I,(0,i._)`${f.default.data}, ${f.default.valCxt}`,A.$async,()=>{k.code((0,i._)`"use strict"; ${s(q,K)}`),w(k,K),k.code(W)}):k.func(I,(0,i._)`${f.default.data}, ${b(K)}`,A.$async,()=>k.code(s(q,K)).code(W))}function b(k){return(0,i._)`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${k.dynamicRef?(0,i._)`, ${f.default.dynamicAnchors}={}`:i.nil}}={}`}function w(k,I){k.if(f.default.valCxt,()=>{k.var(f.default.instancePath,(0,i._)`${f.default.valCxt}.${f.default.instancePath}`),k.var(f.default.parentData,(0,i._)`${f.default.valCxt}.${f.default.parentData}`),k.var(f.default.parentDataProperty,(0,i._)`${f.default.valCxt}.${f.default.parentDataProperty}`),k.var(f.default.rootData,(0,i._)`${f.default.valCxt}.${f.default.rootData}`),I.dynamicRef&&k.var(f.default.dynamicAnchors,(0,i._)`${f.default.valCxt}.${f.default.dynamicAnchors}`)},()=>{k.var(f.default.instancePath,(0,i._)`""`),k.var(f.default.parentData,(0,i._)`undefined`),k.var(f.default.parentDataProperty,(0,i._)`undefined`),k.var(f.default.rootData,f.default.data),I.dynamicRef&&k.var(f.default.dynamicAnchors,(0,i._)`{}`)})}function d(k){const{schema:I,opts:q,gen:A}=k;_(k,()=>{q.$comment&&I.$comment&&F(k),z(k),A.let(f.default.vErrors,null),A.let(f.default.errors,0),q.unevaluated&&l(k),R(k),L(k)})}function l(k){const{gen:I,validateName:q}=k;k.evaluated=I.const("evaluated",(0,i._)`${q}.evaluated`),I.if((0,i._)`${k.evaluated}.dynamicProps`,()=>I.assign((0,i._)`${k.evaluated}.props`,(0,i._)`undefined`)),I.if((0,i._)`${k.evaluated}.dynamicItems`,()=>I.assign((0,i._)`${k.evaluated}.items`,(0,i._)`undefined`))}function s(k,I){const q=typeof k=="object"&&k[I.schemaId];return q&&(I.code.source||I.code.process)?(0,i._)`/*# sourceURL=${q} */`:i.nil}function c(k,I){if(a(k)&&(P(k),y(k))){m(k,I);return}(0,e.boolOrEmptySchema)(k,I)}function y({schema:k,self:I}){if(typeof k=="boolean")return!k;for(const q in k)if(I.RULES.all[q])return!0;return!1}function a(k){return typeof k.schema!="boolean"}function m(k,I){const{schema:q,gen:A,opts:K}=k;K.$comment&&q.$comment&&F(k),N(k),V(k);const W=A.const("_errs",f.default.errors);R(k,W),A.var(I,(0,i._)`${W} === ${f.default.errors}`)}function P(k){(0,g.checkUnknownRules)(k),T(k)}function R(k,I){if(k.opts.jtd)return ie(k,[],!1,I);const q=(0,t.getSchemaTypes)(k.schema),A=(0,t.coerceAndCheckDataType)(k,q);ie(k,q,!A,I)}function T(k){const{schema:I,errSchemaPath:q,opts:A,self:K}=k;I.$ref&&A.ignoreKeywordsWithRef&&(0,g.schemaHasRulesButRef)(I,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(k){const{schema:I,opts:q}=k;I.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,g.checkStrictMode)(k,"default is ignored in the schema root")}function N(k){const I=k.schema[k.opts.schemaId];I&&(k.baseId=(0,$.resolveUrl)(k.opts.uriResolver,k.baseId,I))}function V(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:k,schemaEnv:I,schema:q,errSchemaPath:A,opts:K}){const W=q.$comment;if(K.$comment===!0)k.code((0,i._)`${f.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const re=(0,i.str)`${A}/$comment`,pe=k.scopeValue("root",{ref:I.root});k.code((0,i._)`${f.default.self}.opts.$comment(${W}, ${re}, ${pe}.schema)`)}}function L(k){const{gen:I,schemaEnv:q,validateName:A,ValidationError:K,opts:W}=k;q.$async?I.if((0,i._)`${f.default.errors} === 0`,()=>I.return(f.default.data),()=>I.throw((0,i._)`new ${K}(${f.default.vErrors})`)):(I.assign((0,i._)`${A}.errors`,f.default.vErrors),W.unevaluated&&Q(k),I.return((0,i._)`${f.default.errors} === 0`))}function Q({gen:k,evaluated:I,props:q,items:A}){q instanceof i.Name&&k.assign((0,i._)`${I}.props`,q),A instanceof i.Name&&k.assign((0,i._)`${I}.items`,A)}function ie(k,I,q,A){const{gen:K,schema:W,data:re,allErrors:pe,opts:ce,self:de}=k,{RULES:ne}=de;if(W.$ref&&(ce.ignoreKeywordsWithRef||!(0,g.schemaHasRulesButRef)(W,ne))){K.block(()=>U(k,"$ref",ne.all.$ref.definition));return}ce.jtd||x(k,I),K.block(()=>{for(const le of ne.rules)ke(le);ke(ne.post)});function ke(le){(0,r.shouldUseGroup)(W,le)&&(le.type?(K.if((0,o.checkDataType)(le.type,re,ce.strictNumbers)),oe(k,le),I.length===1&&I[0]===le.type&&q&&(K.else(),(0,o.reportTypeError)(k)),K.endIf()):oe(k,le),pe||K.if((0,i._)`${f.default.errors} === ${A||0}`))}}function oe(k,I){const{gen:q,schema:A,opts:{useDefaults:K}}=k;K&&(0,h.assignDefaults)(k,I.type),q.block(()=>{for(const W of I.rules)(0,r.shouldUseRule)(A,W)&&U(k,W.keyword,W.definition,I.type)})}function x(k,I){k.schemaEnv.meta||!k.opts.strictTypes||(fe(k,I),k.opts.allowUnionTypes||M(k,I),j(k,k.dataTypes))}function fe(k,I){if(I.length){if(!k.dataTypes.length){k.dataTypes=I;return}I.forEach(q=>{O(k.dataTypes,q)||S(k,`type "${q}" not allowed by context "${k.dataTypes.join(",")}"`)}),p(k,I)}}function M(k,I){I.length>1&&!(I.length===2&&I.includes("null"))&&S(k,"use allowUnionTypes to allow union type keyword")}function j(k,I){const q=k.self.RULES.all;for(const A in q){const K=q[A];if(typeof K=="object"&&(0,r.shouldUseRule)(k.schema,K)){const{type:W}=K.definition;W.length&&!W.some(re=>D(I,re))&&S(k,`missing type "${W.join(",")}" for keyword "${A}"`)}}}function D(k,I){return k.includes(I)||I==="number"&&k.includes("integer")}function O(k,I){return k.includes(I)||I==="integer"&&k.includes("number")}function p(k,I){const q=[];for(const A of k.dataTypes)O(I,A)?q.push(A):I.includes("integer")&&A==="number"&&q.push("integer");k.dataTypes=q}function S(k,I){const q=k.schemaEnv.baseId+k.errSchemaPath;I+=` at "${q}" (strictTypes)`,(0,g.checkStrictMode)(k,I,k.opts.strictTypes)}class C{constructor(I,q,A){if((0,n.validateKeywordUsage)(I,q,A),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=A,this.data=I.data,this.schema=I.schema[A],this.$data=q.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,g.schemaRefOrVal)(I,this.schema,A,this.$data),this.schemaType=q.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=q,this.$data)this.schemaCode=I.gen.const("vSchema",B(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,n.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=I.gen.const("_errs",f.default.errors))}result(I,q,A){this.failResult((0,i.not)(I),q,A)}failResult(I,q,A){this.gen.if(I),A?A():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(I,q){this.failResult((0,i.not)(I),void 0,q)}fail(I){if(I===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(I),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);const{schemaCode:q}=this;this.fail((0,i._)`${q} !== undefined && (${(0,i.or)(this.invalid$data(),I)})`)}error(I,q,A){if(q){this.setParams(q),this._error(I,A),this.setParams({});return}this._error(I,A)}_error(I,q){(I?E.reportExtraError:E.reportError)(this,this.def.error,q)}$dataError(){(0,E.reportError)(this,this.def.$dataError||E.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,E.resetErrorsCount)(this.gen,this.errsCount)}ok(I){this.allErrors||this.gen.if(I)}setParams(I,q){q?Object.assign(this.params,I):this.params=I}block$data(I,q,A=i.nil){this.gen.block(()=>{this.check$data(I,A),q()})}check$data(I=i.nil,q=i.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:W,def:re}=this;A.if((0,i.or)((0,i._)`${K} === undefined`,q)),I!==i.nil&&A.assign(I,!0),(W.length||re.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),I!==i.nil&&A.assign(I,!1)),A.else()}invalid$data(){const{gen:I,schemaCode:q,schemaType:A,def:K,it:W}=this;return(0,i.or)(re(),pe());function re(){if(A.length){if(!(q instanceof i.Name))throw new Error("ajv implementation error");const ce=Array.isArray(A)?A:[A];return(0,i._)`${(0,o.checkDataTypes)(ce,q,W.opts.strictNumbers,o.DataType.Wrong)}`}return i.nil}function pe(){if(K.validateSchema){const ce=I.scopeValue("validate$data",{ref:K.validateSchema});return(0,i._)`!${ce}(${q})`}return i.nil}}subschema(I,q){const A=(0,u.getSubschema)(this.it,I);(0,u.extendSubschemaData)(A,this.it,I),(0,u.extendSubschemaMode)(A,I);const K={...this.it,...A,items:void 0,props:void 0};return c(K,q),K}mergeEvaluated(I,q){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&I.props!==void 0&&(A.props=g.mergeEvaluated.props(K,I.props,A.props,q)),A.items!==!0&&I.items!==void 0&&(A.items=g.mergeEvaluated.items(K,I.items,A.items,q)))}mergeValidEvaluated(I,q){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(q,()=>this.mergeEvaluated(I,i.Name)),!0}}ge.KeywordCxt=C;function U(k,I,q,A){const K=new C(k,q,I);"code"in q?q.code(K,A):K.$data&&q.validate?(0,n.funcKeywordCode)(K,q):"macro"in q?(0,n.macroKeywordCode)(K,q):(q.compile||q.validate)&&(0,n.funcKeywordCode)(K,q)}const J=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(k,{dataLevel:I,dataNames:q,dataPathArr:A}){let K,W;if(k==="")return f.default.rootData;if(k[0]==="/"){if(!J.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);K=k,W=f.default.rootData}else{const de=Z.exec(k);if(!de)throw new Error(`Invalid JSON-pointer: ${k}`);const ne=+de[1];if(K=de[2],K==="#"){if(ne>=I)throw new Error(ce("property/index",ne));return A[I-ne]}if(ne>I)throw new Error(ce("data",ne));if(W=q[I-ne],!K)return W}let re=W;const pe=K.split("/");for(const de of pe)de&&(W=(0,i._)`${W}${(0,i.getProperty)((0,g.unescapeJsonPointer)(de))}`,re=(0,i._)`${re} && ${W}`);return re;function ce(de,ne){return`Cannot access ${de} ${ne} levels up, current level is ${I}`}}return ge.getData=B,ge}var Ve={},Er;function Xt(){if(Er)return Ve;Er=1,Object.defineProperty(Ve,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ve.default=e,Ve}var ze={},kr;function Dt(){if(kr)return ze;kr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=Nt();class t extends Error{constructor(o,h,n,u){super(u||`can't resolve reference ${n} from id ${h}`),this.missingRef=(0,e.resolveUrl)(o,h,n),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}return ze.default=t,ze}var ue={},jr;function xt(){if(jr)return ue;jr=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.resolveSchema=ue.getCompilingSchema=ue.resolveRef=ue.compileSchema=ue.SchemaEnv=void 0;const e=G(),t=Xt(),r=we(),o=Nt(),h=Y(),n=qt();class u{constructor(l){var s;this.refs={},this.dynamicAnchors={};let c;typeof l.schema=="object"&&(c=l.schema),this.schema=l.schema,this.schemaId=l.schemaId,this.root=l.root||this,this.baseId=(s=l.baseId)!==null&&s!==void 0?s:(0,o.normalizeId)(c?.[l.schemaId||"$id"]),this.schemaPath=l.schemaPath,this.localRefs=l.localRefs,this.meta=l.meta,this.$async=c?.$async,this.refs={}}}ue.SchemaEnv=u;function i(d){const l=g.call(this,d);if(l)return l;const s=(0,o.getFullPath)(this.opts.uriResolver,d.root.baseId),{es5:c,lines:y}=this.opts.code,{ownProperties:a}=this.opts,m=new e.CodeGen(this.scope,{es5:c,lines:y,ownProperties:a});let P;d.$async&&(P=m.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const R=m.scopeName("validate");d.validateName=R;const T={gen:m,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:m.scopeValue("schema",this.opts.code.source===!0?{ref:d.schema,code:(0,e.stringify)(d.schema)}:{ref:d.schema}),validateName:R,ValidationError:P,schema:d.schema,schemaEnv:d,rootId:s,baseId:d.baseId||s,schemaPath:e.nil,errSchemaPath:d.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(d),(0,n.validateFunctionCode)(T),m.optimize(this.opts.code.optimize);const N=m.toString();z=`${m.scopeRefs(r.default.scope)}return ${N}`,this.opts.code.process&&(z=this.opts.code.process(z,d));const F=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(R,{ref:F}),F.errors=null,F.schema=d.schema,F.schemaEnv=d,d.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:R,validateCode:N,scopeValues:m._values}),this.opts.unevaluated){const{props:L,items:Q}=T;F.evaluated={props:L instanceof e.Name?void 0:L,items:Q instanceof e.Name?void 0:Q,dynamicProps:L instanceof e.Name,dynamicItems:Q instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return d.validate=F,d}catch(N){throw delete d.validate,delete d.validateName,z&&this.logger.error("Error compiling schema, function code:",z),N}finally{this._compilations.delete(d)}}ue.compileSchema=i;function f(d,l,s){var c;s=(0,o.resolveUrl)(this.opts.uriResolver,l,s);const y=d.refs[s];if(y)return y;let a=v.call(this,d,s);if(a===void 0){const m=(c=d.localRefs)===null||c===void 0?void 0:c[s],{schemaId:P}=this.opts;m&&(a=new u({schema:m,schemaId:P,root:d,baseId:l}))}if(a!==void 0)return d.refs[s]=$.call(this,a)}ue.resolveRef=f;function $(d){return(0,o.inlineRef)(d.schema,this.opts.inlineRefs)?d.schema:d.validate?d:i.call(this,d)}function g(d){for(const l of this._compilations)if(E(l,d))return l}ue.getCompilingSchema=g;function E(d,l){return d.schema===l.schema&&d.root===l.root&&d.baseId===l.baseId}function v(d,l){let s;for(;typeof(s=this.refs[l])=="string";)l=s;return s||this.schemas[l]||_.call(this,d,l)}function _(d,l){const s=this.opts.uriResolver.parse(l),c=(0,o._getFullPath)(this.opts.uriResolver,s);let y=(0,o.getFullPath)(this.opts.uriResolver,d.baseId,void 0);if(Object.keys(d.schema).length>0&&c===y)return w.call(this,s,d);const a=(0,o.normalizeId)(c),m=this.refs[a]||this.schemas[a];if(typeof m=="string"){const P=_.call(this,d,m);return typeof P?.schema!="object"?void 0:w.call(this,s,P)}if(typeof m?.schema=="object"){if(m.validate||i.call(this,m),a===(0,o.normalizeId)(l)){const{schema:P}=m,{schemaId:R}=this.opts,T=P[R];return T&&(y=(0,o.resolveUrl)(this.opts.uriResolver,y,T)),new u({schema:P,schemaId:R,root:d,baseId:y})}return w.call(this,s,m)}}ue.resolveSchema=_;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(d,{baseId:l,schema:s,root:c}){var y;if(((y=d.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const P of d.fragment.slice(1).split("/")){if(typeof s=="boolean")return;const R=s[(0,h.unescapeFragment)(P)];if(R===void 0)return;s=R;const T=typeof s=="object"&&s[this.opts.schemaId];!b.has(P)&&T&&(l=(0,o.resolveUrl)(this.opts.uriResolver,l,T))}let a;if(typeof s!="boolean"&&s.$ref&&!(0,h.schemaHasRulesButRef)(s,this.RULES)){const P=(0,o.resolveUrl)(this.opts.uriResolver,l,s.$ref);a=_.call(this,c,P)}const{schemaId:m}=this.opts;if(a=a||new u({schema:s,schemaId:m,root:c,baseId:l}),a.schema!==a.root.schema)return a}return ue}const ps="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",ms="Meta-schema for $data reference (JSON AnySchema extension proposal)",hs="object",ys=["$data"],gs={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},vs=!1,_s={$id:ps,description:ms,type:hs,required:ys,properties:gs,additionalProperties:vs};var Fe={},Ce={exports:{}},Gt,Ir;function On(){if(Ir)return Gt;Ir=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function r(v){let _="",b=0,w=0;for(w=0;w<v.length;w++)if(b=v[w].charCodeAt(0),b!==48){if(!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";_+=v[w];break}for(w+=1;w<v.length;w++){if(b=v[w].charCodeAt(0),!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";_+=v[w]}return _}const o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function h(v){return v.length=0,!0}function n(v,_,b){if(v.length){const w=r(v);if(w!=="")_.push(w);else return b.error=!0,!1;v.length=0}return!0}function u(v){let _=0;const b={error:!1,address:"",zone:""},w=[],d=[];let l=!1,s=!1,c=n;for(let y=0;y<v.length;y++){const a=v[y];if(!(a==="["||a==="]"))if(a===":"){if(l===!0&&(s=!0),!c(d,w,b))break;if(++_>7){b.error=!0;break}y>0&&v[y-1]===":"&&(l=!0),w.push(":");continue}else if(a==="%"){if(!c(d,w,b))break;c=h}else{d.push(a);continue}}return d.length&&(c===h?b.zone=d.join(""):s?w.push(d.join("")):w.push(r(d))),b.address=w.join(""),b}function i(v){if(f(v,":")<2)return{host:v,isIPV6:!1};const _=u(v);if(_.error)return{host:v,isIPV6:!1};{let b=_.address,w=_.address;return _.zone&&(b+="%"+_.zone,w+="%25"+_.zone),{host:b,isIPV6:!0,escapedHost:w}}}function f(v,_){let b=0;for(let w=0;w<v.length;w++)v[w]===_&&b++;return b}function $(v){let _=v;const b=[];let w=-1,d=0;for(;d=_.length;){if(d===1){if(_===".")break;if(_==="/"){b.push("/");break}else{b.push(_);break}}else if(d===2){if(_[0]==="."){if(_[1]===".")break;if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&(_[1]==="."||_[1]==="/")){b.push("/");break}}else if(d===3&&_==="/.."){b.length!==0&&b.pop(),b.push("/");break}if(_[0]==="."){if(_[1]==="."){if(_[2]==="/"){_=_.slice(3);continue}}else if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&_[1]==="."){if(_[2]==="/"){_=_.slice(2);continue}else if(_[2]==="."&&_[3]==="/"){_=_.slice(3),b.length!==0&&b.pop();continue}}if((w=_.indexOf("/",1))===-1){b.push(_);break}else b.push(_.slice(0,w)),_=_.slice(w)}return b.join("")}function g(v,_){const b=_!==!0?escape:unescape;return v.scheme!==void 0&&(v.scheme=b(v.scheme)),v.userinfo!==void 0&&(v.userinfo=b(v.userinfo)),v.host!==void 0&&(v.host=b(v.host)),v.path!==void 0&&(v.path=b(v.path)),v.query!==void 0&&(v.query=b(v.query)),v.fragment!==void 0&&(v.fragment=b(v.fragment)),v}function E(v){const _=[];if(v.userinfo!==void 0&&(_.push(v.userinfo),_.push("@")),v.host!==void 0){let b=unescape(v.host);if(!t(b)){const w=i(b);w.isIPV6===!0?b=`[${w.escapedHost}]`:b=v.host}_.push(b)}return(typeof v.port=="number"||typeof v.port=="string")&&(_.push(":"),_.push(String(v.port))),_.length?_.join(""):void 0}return Gt={nonSimpleDomain:o,recomposeAuthority:E,normalizeComponentEncoding:g,removeDotSegments:$,isIPv4:t,isUUID:e,normalizeIPv6:i,stringArrayToHexStripped:r},Gt}var Wt,Or;function $s(){if(Or)return Wt;Or=1;const{isUUID:e}=On(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function o(a){return r.indexOf(a)!==-1}function h(a){return a.secure===!0?!0:a.secure===!1?!1:a.scheme?a.scheme.length===3&&(a.scheme[0]==="w"||a.scheme[0]==="W")&&(a.scheme[1]==="s"||a.scheme[1]==="S")&&(a.scheme[2]==="s"||a.scheme[2]==="S"):!1}function n(a){return a.host||(a.error=a.error||"HTTP URIs must have a host."),a}function u(a){const m=String(a.scheme).toLowerCase()==="https";return(a.port===(m?443:80)||a.port==="")&&(a.port=void 0),a.path||(a.path="/"),a}function i(a){return a.secure=h(a),a.resourceName=(a.path||"/")+(a.query?"?"+a.query:""),a.path=void 0,a.query=void 0,a}function f(a){if((a.port===(h(a)?443:80)||a.port==="")&&(a.port=void 0),typeof a.secure=="boolean"&&(a.scheme=a.secure?"wss":"ws",a.secure=void 0),a.resourceName){const[m,P]=a.resourceName.split("?");a.path=m&&m!=="/"?m:void 0,a.query=P,a.resourceName=void 0}return a.fragment=void 0,a}function $(a,m){if(!a.path)return a.error="URN can not be parsed",a;const P=a.path.match(t);if(P){const R=m.scheme||a.scheme||"urn";a.nid=P[1].toLowerCase(),a.nss=P[2];const T=`${R}:${m.nid||a.nid}`,z=y(T);a.path=void 0,z&&(a=z.parse(a,m))}else a.error=a.error||"URN can not be parsed.";return a}function g(a,m){if(a.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=m.scheme||a.scheme||"urn",R=a.nid.toLowerCase(),T=`${P}:${m.nid||R}`,z=y(T);z&&(a=z.serialize(a,m));const N=a,V=a.nss;return N.path=`${R||m.nid}:${V}`,m.skipEscape=!0,N}function E(a,m){const P=a;return P.uuid=P.nss,P.nss=void 0,!m.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function v(a){const m=a;return m.nss=(a.uuid||"").toLowerCase(),m}const _={scheme:"http",domainHost:!0,parse:n,serialize:u},b={scheme:"https",domainHost:_.domainHost,parse:n,serialize:u},w={scheme:"ws",domainHost:!0,parse:i,serialize:f},d={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},c={http:_,https:b,ws:w,wss:d,urn:{scheme:"urn",parse:$,serialize:g,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:E,serialize:v,skipNormalize:!0}};Object.setPrototypeOf(c,null);function y(a){return a&&(c[a]||c[a.toLowerCase()])||void 0}return Wt={wsIsSecure:h,SCHEMES:c,isValidSchemeName:o,getSchemeHandler:y},Wt}var Rr;function bs(){if(Rr)return Ce.exports;Rr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:o,isIPv4:h,nonSimpleDomain:n}=On(),{SCHEMES:u,getSchemeHandler:i}=$s();function f(d,l){return typeof d=="string"?d=v(b(d,l),l):typeof d=="object"&&(d=b(v(d,l),l)),d}function $(d,l,s){const c=s?Object.assign({scheme:"null"},s):{scheme:"null"},y=g(b(d,c),b(l,c),c,!0);return c.skipEscape=!0,v(y,c)}function g(d,l,s,c){const y={};return c||(d=b(v(d,s),s),l=b(v(l,s),s)),s=s||{},!s.tolerant&&l.scheme?(y.scheme=l.scheme,y.userinfo=l.userinfo,y.host=l.host,y.port=l.port,y.path=t(l.path||""),y.query=l.query):(l.userinfo!==void 0||l.host!==void 0||l.port!==void 0?(y.userinfo=l.userinfo,y.host=l.host,y.port=l.port,y.path=t(l.path||""),y.query=l.query):(l.path?(l.path[0]==="/"?y.path=t(l.path):((d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)&&!d.path?y.path="/"+l.path:d.path?y.path=d.path.slice(0,d.path.lastIndexOf("/")+1)+l.path:y.path=l.path,y.path=t(y.path)),y.query=l.query):(y.path=d.path,l.query!==void 0?y.query=l.query:y.query=d.query),y.userinfo=d.userinfo,y.host=d.host,y.port=d.port),y.scheme=d.scheme),y.fragment=l.fragment,y}function E(d,l,s){return typeof d=="string"?(d=unescape(d),d=v(o(b(d,s),!0),{...s,skipEscape:!0})):typeof d=="object"&&(d=v(o(d,!0),{...s,skipEscape:!0})),typeof l=="string"?(l=unescape(l),l=v(o(b(l,s),!0),{...s,skipEscape:!0})):typeof l=="object"&&(l=v(o(l,!0),{...s,skipEscape:!0})),d.toLowerCase()===l.toLowerCase()}function v(d,l){const s={host:d.host,scheme:d.scheme,userinfo:d.userinfo,port:d.port,path:d.path,query:d.query,nid:d.nid,nss:d.nss,uuid:d.uuid,fragment:d.fragment,reference:d.reference,resourceName:d.resourceName,secure:d.secure,error:""},c=Object.assign({},l),y=[],a=i(c.scheme||s.scheme);a&&a.serialize&&a.serialize(s,c),s.path!==void 0&&(c.skipEscape?s.path=unescape(s.path):(s.path=escape(s.path),s.scheme!==void 0&&(s.path=s.path.split("%3A").join(":")))),c.reference!=="suffix"&&s.scheme&&y.push(s.scheme,":");const m=r(s);if(m!==void 0&&(c.reference!=="suffix"&&y.push("//"),y.push(m),s.path&&s.path[0]!=="/"&&y.push("/")),s.path!==void 0){let P=s.path;!c.absolutePath&&(!a||!a.absolutePath)&&(P=t(P)),m===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),y.push(P)}return s.query!==void 0&&y.push("?",s.query),s.fragment!==void 0&&y.push("#",s.fragment),y.join("")}const _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(d,l){const s=Object.assign({},l),c={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;s.reference==="suffix"&&(s.scheme?d=s.scheme+":"+d:d="//"+d);const a=d.match(_);if(a){if(c.scheme=a[1],c.userinfo=a[3],c.host=a[4],c.port=parseInt(a[5],10),c.path=a[6]||"",c.query=a[7],c.fragment=a[8],isNaN(c.port)&&(c.port=a[5]),c.host)if(h(c.host)===!1){const R=e(c.host);c.host=R.host.toLowerCase(),y=R.isIPV6}else y=!0;c.scheme===void 0&&c.userinfo===void 0&&c.host===void 0&&c.port===void 0&&c.query===void 0&&!c.path?c.reference="same-document":c.scheme===void 0?c.reference="relative":c.fragment===void 0?c.reference="absolute":c.reference="uri",s.reference&&s.reference!=="suffix"&&s.reference!==c.reference&&(c.error=c.error||"URI is not a "+s.reference+" reference.");const m=i(s.scheme||c.scheme);if(!s.unicodeSupport&&(!m||!m.unicodeSupport)&&c.host&&(s.domainHost||m&&m.domainHost)&&y===!1&&n(c.host))try{c.host=URL.domainToASCII(c.host.toLowerCase())}catch(P){c.error=c.error||"Host's domain name can not be converted to ASCII: "+P}(!m||m&&!m.skipNormalize)&&(d.indexOf("%")!==-1&&(c.scheme!==void 0&&(c.scheme=unescape(c.scheme)),c.host!==void 0&&(c.host=unescape(c.host))),c.path&&(c.path=escape(unescape(c.path))),c.fragment&&(c.fragment=encodeURI(decodeURIComponent(c.fragment)))),m&&m.parse&&m.parse(c,s)}else c.error=c.error||"URI can not be parsed.";return c}const w={SCHEMES:u,normalize:f,resolve:$,resolveComponent:g,equal:E,serialize:v,parse:b};return Ce.exports=w,Ce.exports.default=w,Ce.exports.fastUri=w,Ce.exports}var Cr;function ws(){if(Cr)return Fe;Cr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=bs();return e.code='require("ajv/dist/runtime/uri").default',Fe.default=e,Fe}var Nr;function Ps(){return Nr||(Nr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=qt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=G();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const o=Xt(),h=Dt(),n=kn(),u=xt(),i=G(),f=Nt(),$=Pt(),g=Y(),E=_s,v=ws(),_=(M,j)=>new RegExp(M,j);_.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),d={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."},l={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},s=200;function c(M){var j,D,O,p,S,C,U,J,Z,B,k,I,q,A,K,W,re,pe,ce,de,ne,ke,le,Mt,At;const Oe=M.strict,Vt=(j=M.code)===null||j===void 0?void 0:j.optimize,sr=Vt===!0||Vt===void 0?1:Vt||0,ir=(O=(D=M.code)===null||D===void 0?void 0:D.regExp)!==null&&O!==void 0?O:_,as=(p=M.uriResolver)!==null&&p!==void 0?p:v.default;return{strictSchema:(C=(S=M.strictSchema)!==null&&S!==void 0?S:Oe)!==null&&C!==void 0?C:!0,strictNumbers:(J=(U=M.strictNumbers)!==null&&U!==void 0?U:Oe)!==null&&J!==void 0?J:!0,strictTypes:(B=(Z=M.strictTypes)!==null&&Z!==void 0?Z:Oe)!==null&&B!==void 0?B:"log",strictTuples:(I=(k=M.strictTuples)!==null&&k!==void 0?k:Oe)!==null&&I!==void 0?I:"log",strictRequired:(A=(q=M.strictRequired)!==null&&q!==void 0?q:Oe)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:sr,regExp:ir}:{optimize:sr,regExp:ir},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:s,loopEnum:(W=M.loopEnum)!==null&&W!==void 0?W:s,meta:(re=M.meta)!==null&&re!==void 0?re:!0,messages:(pe=M.messages)!==null&&pe!==void 0?pe:!0,inlineRefs:(ce=M.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(de=M.schemaId)!==null&&de!==void 0?de:"$id",addUsedSchema:(ne=M.addUsedSchema)!==null&&ne!==void 0?ne:!0,validateSchema:(ke=M.validateSchema)!==null&&ke!==void 0?ke:!0,validateFormats:(le=M.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(Mt=M.unicodeRegExp)!==null&&Mt!==void 0?Mt:!0,int32range:(At=M.int32range)!==null&&At!==void 0?At:!0,uriResolver:as}}class y{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...c(j)};const{es5:D,lines:O}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:w,es5:D,lines:O}),this.logger=V(j.logger);const p=j.validateFormats;j.validateFormats=!1,this.RULES=(0,n.getRules)(),a.call(this,d,j,"NOT SUPPORTED"),a.call(this,l,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&R.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&T.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),P.call(this),j.validateFormats=p}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:D,schemaId:O}=this.opts;let p=E;O==="id"&&(p={...E},p.id=p.$id,delete p.$id),D&&j&&this.addMetaSchema(p,p[O],!1)}defaultMeta(){const{meta:j,schemaId:D}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[D]||j:void 0}validate(j,D){let O;if(typeof j=="string"){if(O=this.getSchema(j),!O)throw new Error(`no schema with key or ref "${j}"`)}else O=this.compile(j);const p=O(D);return"$async"in O||(this.errors=O.errors),p}compile(j,D){const O=this._addSchema(j,D);return O.validate||this._compileSchemaEnv(O)}compileAsync(j,D){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:O}=this.opts;return p.call(this,j,D);async function p(B,k){await S.call(this,B.$schema);const I=this._addSchema(B,k);return I.validate||C.call(this,I)}async function S(B){B&&!this.getSchema(B)&&await p.call(this,{$ref:B},!0)}async function C(B){try{return this._compileSchemaEnv(B)}catch(k){if(!(k instanceof h.default))throw k;return U.call(this,k),await J.call(this,k.missingSchema),C.call(this,B)}}function U({missingSchema:B,missingRef:k}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${k} cannot be resolved`)}async function J(B){const k=await Z.call(this,B);this.refs[B]||await S.call(this,k.$schema),this.refs[B]||this.addSchema(k,B,D)}async function Z(B){const k=this._loading[B];if(k)return k;try{return await(this._loading[B]=O(B))}finally{delete this._loading[B]}}}addSchema(j,D,O,p=this.opts.validateSchema){if(Array.isArray(j)){for(const C of j)this.addSchema(C,void 0,O,p);return this}let S;if(typeof j=="object"){const{schemaId:C}=this.opts;if(S=j[C],S!==void 0&&typeof S!="string")throw new Error(`schema ${C} must be string`)}return D=(0,f.normalizeId)(D||S),this._checkUnique(D),this.schemas[D]=this._addSchema(j,O,D,p,!0),this}addMetaSchema(j,D,O=this.opts.validateSchema){return this.addSchema(j,D,!0,O),this}validateSchema(j,D){if(typeof j=="boolean")return!0;let O;if(O=j.$schema,O!==void 0&&typeof O!="string")throw new Error("$schema must be a string");if(O=O||this.opts.defaultMeta||this.defaultMeta(),!O)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const p=this.validate(O,j);if(!p&&D){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return p}getSchema(j){let D;for(;typeof(D=m.call(this,j))=="string";)j=D;if(D===void 0){const{schemaId:O}=this.opts,p=new u.SchemaEnv({schema:{},schemaId:O});if(D=u.resolveSchema.call(this,p,j),!D)return;this.refs[j]=D}return D.validate||this._compileSchemaEnv(D)}removeSchema(j){if(j instanceof RegExp)return this._removeAllSchemas(this.schemas,j),this._removeAllSchemas(this.refs,j),this;switch(typeof j){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const D=m.call(this,j);return typeof D=="object"&&this._cache.delete(D.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const D=j;this._cache.delete(D);let O=j[this.opts.schemaId];return O&&(O=(0,f.normalizeId)(O),delete this.schemas[O],delete this.refs[O]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const D of j)this.addKeyword(D);return this}addKeyword(j,D){let O;if(typeof j=="string")O=j,typeof D=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),D.keyword=O);else if(typeof j=="object"&&D===void 0){if(D=j,O=D.keyword,Array.isArray(O)&&!O.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,O,D),!D)return(0,g.eachItem)(O,S=>Q.call(this,S)),this;oe.call(this,D);const p={...D,type:(0,$.getJSONTypes)(D.type),schemaType:(0,$.getJSONTypes)(D.schemaType)};return(0,g.eachItem)(O,p.type.length===0?S=>Q.call(this,S,p):S=>p.type.forEach(C=>Q.call(this,S,p,C))),this}getKeyword(j){const D=this.RULES.all[j];return typeof D=="object"?D.definition:!!D}removeKeyword(j){const{RULES:D}=this;delete D.keywords[j],delete D.all[j];for(const O of D.rules){const p=O.rules.findIndex(S=>S.keyword===j);p>=0&&O.rules.splice(p,1)}return this}addFormat(j,D){return typeof D=="string"&&(D=new RegExp(D)),this.formats[j]=D,this}errorsText(j=this.errors,{separator:D=", ",dataVar:O="data"}={}){return!j||j.length===0?"No errors":j.map(p=>`${O}${p.instancePath} ${p.message}`).reduce((p,S)=>p+D+S)}$dataMetaSchema(j,D){const O=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const p of D){const S=p.split("/").slice(1);let C=j;for(const U of S)C=C[U];for(const U in O){const J=O[U];if(typeof J!="object")continue;const{$data:Z}=J.definition,B=C[U];Z&&B&&(C[U]=fe(B))}}return j}_removeAllSchemas(j,D){for(const O in j){const p=j[O];(!D||D.test(O))&&(typeof p=="string"?delete j[O]:p&&!p.meta&&(this._cache.delete(p.schema),delete j[O]))}}_addSchema(j,D,O,p=this.opts.validateSchema,S=this.opts.addUsedSchema){let C;const{schemaId:U}=this.opts;if(typeof j=="object")C=j[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let J=this._cache.get(j);if(J!==void 0)return J;O=(0,f.normalizeId)(C||O);const Z=f.getSchemaRefs.call(this,j,O);return J=new u.SchemaEnv({schema:j,schemaId:U,meta:D,baseId:O,localRefs:Z}),this._cache.set(J.schema,J),S&&!O.startsWith("#")&&(O&&this._checkUnique(O),this.refs[O]=J),p&&this.validateSchema(j,!0),J}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):u.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const D=this.opts;this.opts=this._metaOpts;try{u.compileSchema.call(this,j)}finally{this.opts=D}}}y.ValidationError=o.default,y.MissingRefError=h.default,e.default=y;function a(M,j,D,O="error"){for(const p in M){const S=p;S in j&&this.logger[O](`${D}: option ${p}. ${M[S]}`)}}function m(M){return M=(0,f.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const j in M)this.addSchema(M[j],j)}function R(){for(const M in this.opts.formats){const j=this.opts.formats[M];j&&this.addFormat(M,j)}}function T(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in M){const D=M[j];D.keyword||(D.keyword=j),this.addKeyword(D)}}function z(){const M={...this.opts};for(const j of b)delete M[j];return M}const N={log(){},warn(){},error(){}};function V(M){if(M===!1)return N;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function L(M,j){const{RULES:D}=this;if((0,g.eachItem)(M,O=>{if(D.keywords[O])throw new Error(`Keyword ${O} is already defined`);if(!F.test(O))throw new Error(`Keyword ${O} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function Q(M,j,D){var O;const p=j?.post;if(D&&p)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let C=p?S.post:S.rules.find(({type:J})=>J===D);if(C||(C={type:D,rules:[]},S.rules.push(C)),S.keywords[M]=!0,!j)return;const U={keyword:M,definition:{...j,type:(0,$.getJSONTypes)(j.type),schemaType:(0,$.getJSONTypes)(j.schemaType)}};j.before?ie.call(this,C,U,j.before):C.rules.push(U),S.all[M]=U,(O=j.implements)===null||O===void 0||O.forEach(J=>this.addKeyword(J))}function ie(M,j,D){const O=M.rules.findIndex(p=>p.keyword===D);O>=0?M.rules.splice(O,0,j):(M.rules.push(j),this.logger.warn(`rule ${D} is not defined`))}function oe(M){let{metaSchema:j}=M;j!==void 0&&(M.$data&&this.opts.$data&&(j=fe(j)),M.validateSchema=this.compile(j,!0))}const x={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function fe(M){return{anyOf:[M,x]}}})(zt)),zt}var Le={},Ue={},Ke={},qr;function Ss(){if(qr)return Ke;qr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ke.default=e,Ke}var $e={},Dr;function Es(){if(Dr)return $e;Dr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.callRef=$e.getValidate=void 0;const e=Dt(),t=ye(),r=G(),o=we(),h=xt(),n=Y(),u={keyword:"$ref",schemaType:"string",code($){const{gen:g,schema:E,it:v}=$,{baseId:_,schemaEnv:b,validateName:w,opts:d,self:l}=v,{root:s}=b;if((E==="#"||E==="#/")&&_===s.baseId)return y();const c=h.resolveRef.call(l,s,_,E);if(c===void 0)throw new e.default(v.opts.uriResolver,_,E);if(c instanceof h.SchemaEnv)return a(c);return m(c);function y(){if(b===s)return f($,w,b,b.$async);const P=g.scopeValue("root",{ref:s});return f($,(0,r._)`${P}.validate`,s,s.$async)}function a(P){const R=i($,P);f($,R,P,P.$async)}function m(P){const R=g.scopeValue("schema",d.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),T=g.name("valid"),z=$.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:R,errSchemaPath:E},T);$.mergeEvaluated(z),$.ok(T)}}};function i($,g){const{gen:E}=$;return g.validate?E.scopeValue("validate",{ref:g.validate}):(0,r._)`${E.scopeValue("wrapper",{ref:g})}.validate`}$e.getValidate=i;function f($,g,E,v){const{gen:_,it:b}=$,{allErrors:w,schemaEnv:d,opts:l}=b,s=l.passContext?o.default.this:r.nil;v?c():y();function c(){if(!d.$async)throw new Error("async schema referenced by sync schema");const P=_.let("valid");_.try(()=>{_.code((0,r._)`await ${(0,t.callValidateCode)($,g,s)}`),m(g),w||_.assign(P,!0)},R=>{_.if((0,r._)`!(${R} instanceof ${b.ValidationError})`,()=>_.throw(R)),a(R),w||_.assign(P,!1)}),$.ok(P)}function y(){$.result((0,t.callValidateCode)($,g,s),()=>m(g),()=>a(g))}function a(P){const R=(0,r._)`${P}.errors`;_.assign(o.default.vErrors,(0,r._)`${o.default.vErrors} === null ? ${R} : ${o.default.vErrors}.concat(${R})`),_.assign(o.default.errors,(0,r._)`${o.default.vErrors}.length`)}function m(P){var R;if(!b.opts.unevaluated)return;const T=(R=E?.validate)===null||R===void 0?void 0:R.evaluated;if(b.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(b.props=n.mergeEvaluated.props(_,T.props,b.props));else{const z=_.var("props",(0,r._)`${P}.evaluated.props`);b.props=n.mergeEvaluated.props(_,z,b.props,r.Name)}if(b.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(b.items=n.mergeEvaluated.items(_,T.items,b.items));else{const z=_.var("items",(0,r._)`${P}.evaluated.items`);b.items=n.mergeEvaluated.items(_,z,b.items,r.Name)}}}return $e.callRef=f,$e.default=u,$e}var Tr;function ks(){if(Tr)return Ue;Tr=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e=Ss(),t=Es(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Ue.default=r,Ue}var Je={},He={},Mr;function js(){if(Mr)return He;Mr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=G(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},o={message:({keyword:n,schemaCode:u})=>(0,e.str)`must be ${r[n].okStr} ${u}`,params:({keyword:n,schemaCode:u})=>(0,e._)`{comparison: ${r[n].okStr}, limit: ${u}}`},h={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:o,code(n){const{keyword:u,data:i,schemaCode:f}=n;n.fail$data((0,e._)`${i} ${r[u].fail} ${f} || isNaN(${i})`)}};return He.default=h,He}var Ge={},Ar;function Is(){if(Ar)return Ge;Ar=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=G(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>(0,e.str)`must be multiple of ${o}`,params:({schemaCode:o})=>(0,e._)`{multipleOf: ${o}}`},code(o){const{gen:h,data:n,schemaCode:u,it:i}=o,f=i.opts.multipleOfPrecision,$=h.let("res"),g=f?(0,e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${f}`:(0,e._)`${$} !== parseInt(${$})`;o.fail$data((0,e._)`(${u} === 0 || (${$} = ${n}/${u}, ${g}))`)}};return Ge.default=r,Ge}var We={},Be={},Vr;function Os(){if(Vr)return Be;Vr=1,Object.defineProperty(Be,"__esModule",{value:!0});function e(t){const r=t.length;let o=0,h=0,n;for(;h<r;)o++,n=t.charCodeAt(h++),n>=55296&&n<=56319&&h<r&&(n=t.charCodeAt(h),(n&64512)===56320&&h++);return o}return Be.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Be}var zr;function Rs(){if(zr)return We;zr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=G(),t=Y(),r=Os(),h={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:u}){const i=n==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${u} characters`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:u,data:i,schemaCode:f,it:$}=n,g=u==="maxLength"?e.operators.GT:e.operators.LT,E=$.opts.unicode===!1?(0,e._)`${i}.length`:(0,e._)`${(0,t.useFunc)(n.gen,r.default)}(${i})`;n.fail$data((0,e._)`${E} ${g} ${f}`)}};return We.default=h,We}var Ye={},Fr;function Cs(){if(Fr)return Ye;Fr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=ye(),t=G(),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:h})=>(0,t.str)`must match pattern "${h}"`,params:({schemaCode:h})=>(0,t._)`{pattern: ${h}}`},code(h){const{data:n,$data:u,schema:i,schemaCode:f,it:$}=h,g=$.opts.unicodeRegExp?"u":"",E=u?(0,t._)`(new RegExp(${f}, ${g}))`:(0,e.usePattern)(h,i);h.fail$data((0,t._)`!${E}.test(${n})`)}};return Ye.default=o,Ye}var Ze={},Lr;function Ns(){if(Lr)return Ze;Lr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=G(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:h}){const n=o==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${n} than ${h} properties`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:h,data:n,schemaCode:u}=o,i=h==="maxProperties"?e.operators.GT:e.operators.LT;o.fail$data((0,e._)`Object.keys(${n}).length ${i} ${u}`)}};return Ze.default=r,Ze}var Qe={},Ur;function qs(){if(Ur)return Qe;Ur=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=ye(),t=G(),r=Y(),h={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:n}})=>(0,t.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,t._)`{missingProperty: ${n}}`},code(n){const{gen:u,schema:i,schemaCode:f,data:$,$data:g,it:E}=n,{opts:v}=E;if(!g&&i.length===0)return;const _=i.length>=v.loopRequired;if(E.allErrors?b():w(),v.strictRequired){const s=n.parentSchema.properties,{definedProperties:c}=n.it;for(const y of i)if(s?.[y]===void 0&&!c.has(y)){const a=E.schemaEnv.baseId+E.errSchemaPath,m=`required property "${y}" is not defined at "${a}" (strictRequired)`;(0,r.checkStrictMode)(E,m,E.opts.strictRequired)}}function b(){if(_||g)n.block$data(t.nil,d);else for(const s of i)(0,e.checkReportMissingProp)(n,s)}function w(){const s=u.let("missing");if(_||g){const c=u.let("valid",!0);n.block$data(c,()=>l(s,c)),n.ok(c)}else u.if((0,e.checkMissingProp)(n,i,s)),(0,e.reportMissingProp)(n,s),u.else()}function d(){u.forOf("prop",f,s=>{n.setParams({missingProperty:s}),u.if((0,e.noPropertyInData)(u,$,s,v.ownProperties),()=>n.error())})}function l(s,c){n.setParams({missingProperty:s}),u.forOf(s,f,()=>{u.assign(c,(0,e.propertyInData)(u,$,s,v.ownProperties)),u.if((0,t.not)(c),()=>{n.error(),u.break()})},t.nil)}}};return Qe.default=h,Qe}var Xe={},Kr;function Ds(){if(Kr)return Xe;Kr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=G(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:h}){const n=o==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${n} than ${h} items`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:h,data:n,schemaCode:u}=o,i=h==="maxItems"?e.operators.GT:e.operators.LT;o.fail$data((0,e._)`${n}.length ${i} ${u}`)}};return Xe.default=r,Xe}var xe={},et={},Jr;function er(){if(Jr)return et;Jr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=In();return e.code='require("ajv/dist/runtime/equal").default',et.default=e,et}var Hr;function Ts(){if(Hr)return xe;Hr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=Pt(),t=G(),r=Y(),o=er(),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:u,j:i}})=>(0,t.str)`must NOT have duplicate items (items ## ${i} and ${u} are identical)`,params:({params:{i:u,j:i}})=>(0,t._)`{i: ${u}, j: ${i}}`},code(u){const{gen:i,data:f,$data:$,schema:g,parentSchema:E,schemaCode:v,it:_}=u;if(!$&&!g)return;const b=i.let("valid"),w=E.items?(0,e.getSchemaTypes)(E.items):[];u.block$data(b,d,(0,t._)`${v} === false`),u.ok(b);function d(){const y=i.let("i",(0,t._)`${f}.length`),a=i.let("j");u.setParams({i:y,j:a}),i.assign(b,!0),i.if((0,t._)`${y} > 1`,()=>(l()?s:c)(y,a))}function l(){return w.length>0&&!w.some(y=>y==="object"||y==="array")}function s(y,a){const m=i.name("item"),P=(0,e.checkDataTypes)(w,m,_.opts.strictNumbers,e.DataType.Wrong),R=i.const("indices",(0,t._)`{}`);i.for((0,t._)`;${y}--;`,()=>{i.let(m,(0,t._)`${f}[${y}]`),i.if(P,(0,t._)`continue`),w.length>1&&i.if((0,t._)`typeof ${m} == "string"`,(0,t._)`${m} += "_"`),i.if((0,t._)`typeof ${R}[${m}] == "number"`,()=>{i.assign(a,(0,t._)`${R}[${m}]`),u.error(),i.assign(b,!1).break()}).code((0,t._)`${R}[${m}] = ${y}`)})}function c(y,a){const m=(0,r.useFunc)(i,o.default),P=i.name("outer");i.label(P).for((0,t._)`;${y}--;`,()=>i.for((0,t._)`${a} = ${y}; ${a}--;`,()=>i.if((0,t._)`${m}(${f}[${y}], ${f}[${a}])`,()=>{u.error(),i.assign(b,!1).break(P)})))}}};return xe.default=n,xe}var tt={},Gr;function Ms(){if(Gr)return tt;Gr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=G(),t=Y(),r=er(),h={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:n})=>(0,e._)`{allowedValue: ${n}}`},code(n){const{gen:u,data:i,$data:f,schemaCode:$,schema:g}=n;f||g&&typeof g=="object"?n.fail$data((0,e._)`!${(0,t.useFunc)(u,r.default)}(${i}, ${$})`):n.fail((0,e._)`${g} !== ${i}`)}};return tt.default=h,tt}var rt={},Wr;function As(){if(Wr)return rt;Wr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=G(),t=Y(),r=er(),h={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:u,data:i,$data:f,schema:$,schemaCode:g,it:E}=n;if(!f&&$.length===0)throw new Error("enum must have non-empty array");const v=$.length>=E.opts.loopEnum;let _;const b=()=>_??(_=(0,t.useFunc)(u,r.default));let w;if(v||f)w=u.let("valid"),n.block$data(w,d);else{if(!Array.isArray($))throw new Error("ajv implementation error");const s=u.const("vSchema",g);w=(0,e.or)(...$.map((c,y)=>l(s,y)))}n.pass(w);function d(){u.assign(w,!1),u.forOf("v",g,s=>u.if((0,e._)`${b()}(${i}, ${s})`,()=>u.assign(w,!0).break()))}function l(s,c){const y=$[c];return typeof y=="object"&&y!==null?(0,e._)`${b()}(${i}, ${s}[${c}])`:(0,e._)`${i} === ${y}`}}};return rt.default=h,rt}var Br;function Vs(){if(Br)return Je;Br=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=js(),t=Is(),r=Rs(),o=Cs(),h=Ns(),n=qs(),u=Ds(),i=Ts(),f=Ms(),$=As(),g=[e.default,t.default,r.default,o.default,h.default,n.default,u.default,i.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,$.default];return Je.default=g,Je}var nt={},je={},Yr;function Rn(){if(Yr)return je;Yr=1,Object.defineProperty(je,"__esModule",{value:!0}),je.validateAdditionalItems=void 0;const e=G(),t=Y(),o={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:u,it:i}=n,{items:f}=u;if(!Array.isArray(f)){(0,t.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas');return}h(n,f)}};function h(n,u){const{gen:i,schema:f,data:$,keyword:g,it:E}=n;E.items=!0;const v=i.const("len",(0,e._)`${$}.length`);if(f===!1)n.setParams({len:u.length}),n.pass((0,e._)`${v} <= ${u.length}`);else if(typeof f=="object"&&!(0,t.alwaysValidSchema)(E,f)){const b=i.var("valid",(0,e._)`${v} <= ${u.length}`);i.if((0,e.not)(b),()=>_(b)),n.ok(b)}function _(b){i.forRange("i",u.length,v,w=>{n.subschema({keyword:g,dataProp:w,dataPropType:t.Type.Num},b),E.allErrors||i.if((0,e.not)(b),()=>i.break())})}}return je.validateAdditionalItems=h,je.default=o,je}var st={},Ie={},Zr;function Cn(){if(Zr)return Ie;Zr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.validateTuple=void 0;const e=G(),t=Y(),r=ye(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){const{schema:u,it:i}=n;if(Array.isArray(u))return h(n,"additionalItems",u);i.items=!0,!(0,t.alwaysValidSchema)(i,u)&&n.ok((0,r.validateArray)(n))}};function h(n,u,i=n.schema){const{gen:f,parentSchema:$,data:g,keyword:E,it:v}=n;w($),v.opts.unevaluated&&i.length&&v.items!==!0&&(v.items=t.mergeEvaluated.items(f,i.length,v.items));const _=f.name("valid"),b=f.const("len",(0,e._)`${g}.length`);i.forEach((d,l)=>{(0,t.alwaysValidSchema)(v,d)||(f.if((0,e._)`${b} > ${l}`,()=>n.subschema({keyword:E,schemaProp:l,dataProp:l},_)),n.ok(_))});function w(d){const{opts:l,errSchemaPath:s}=v,c=i.length,y=c===d.minItems&&(c===d.maxItems||d[u]===!1);if(l.strictTuples&&!y){const a=`"${E}" is ${c}-tuple, but minItems or maxItems/${u} are not specified or different at path "${s}"`;(0,t.checkStrictMode)(v,a,l.strictTuples)}}}return Ie.validateTuple=h,Ie.default=o,Ie}var Qr;function zs(){if(Qr)return st;Qr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=Cn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return st.default=t,st}var it={},Xr;function Fs(){if(Xr)return it;Xr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=G(),t=Y(),r=ye(),o=Rn(),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:u}})=>(0,e.str)`must NOT have more than ${u} items`,params:({params:{len:u}})=>(0,e._)`{limit: ${u}}`},code(u){const{schema:i,parentSchema:f,it:$}=u,{prefixItems:g}=f;$.items=!0,!(0,t.alwaysValidSchema)($,i)&&(g?(0,o.validateAdditionalItems)(u,g):u.ok((0,r.validateArray)(u)))}};return it.default=n,it}var ot={},xr;function Ls(){if(xr)return ot;xr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=G(),t=Y(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:h,max:n}})=>n===void 0?(0,e.str)`must contain at least ${h} valid item(s)`:(0,e.str)`must contain at least ${h} and no more than ${n} valid item(s)`,params:({params:{min:h,max:n}})=>n===void 0?(0,e._)`{minContains: ${h}}`:(0,e._)`{minContains: ${h}, maxContains: ${n}}`},code(h){const{gen:n,schema:u,parentSchema:i,data:f,it:$}=h;let g,E;const{minContains:v,maxContains:_}=i;$.opts.next?(g=v===void 0?1:v,E=_):g=1;const b=n.const("len",(0,e._)`${f}.length`);if(h.setParams({min:g,max:E}),E===void 0&&g===0){(0,t.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(E!==void 0&&g>E){(0,t.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),h.fail();return}if((0,t.alwaysValidSchema)($,u)){let c=(0,e._)`${b} >= ${g}`;E!==void 0&&(c=(0,e._)`${c} && ${b} <= ${E}`),h.pass(c);return}$.items=!0;const w=n.name("valid");E===void 0&&g===1?l(w,()=>n.if(w,()=>n.break())):g===0?(n.let(w,!0),E!==void 0&&n.if((0,e._)`${f}.length > 0`,d)):(n.let(w,!1),d()),h.result(w,()=>h.reset());function d(){const c=n.name("_valid"),y=n.let("count",0);l(c,()=>n.if(c,()=>s(y)))}function l(c,y){n.forRange("i",0,b,a=>{h.subschema({keyword:"contains",dataProp:a,dataPropType:t.Type.Num,compositeRule:!0},c),y()})}function s(c){n.code((0,e._)`${c}++`),E===void 0?n.if((0,e._)`${c} >= ${g}`,()=>n.assign(w,!0).break()):(n.if((0,e._)`${c} > ${E}`,()=>n.assign(w,!1).break()),g===1?n.assign(w,!0):n.if((0,e._)`${c} >= ${g}`,()=>n.assign(w,!0)))}}};return ot.default=o,ot}var Bt={},en;function Us(){return en||(en=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=G(),r=Y(),o=ye();e.error={message:({params:{property:f,depsCount:$,deps:g}})=>{const E=$===1?"property":"properties";return(0,t.str)`must have ${E} ${g} when property ${f} is present`},params:({params:{property:f,depsCount:$,deps:g,missingProperty:E}})=>(0,t._)`{property: ${f},
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function In(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ze={exports:{}},Lt={},ve={},Ee={},Ut={},Kt={},Jt={},dr;function Et(){return dr||(dr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(r){if(super(),!e.IDENTIFIER.test(r))throw new Error("CodeGen: name must be a valid identifier");this.str=r}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class i extends t{constructor(r){super(),this._items=typeof r=="string"?[r]:r}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const r=this._items[0];return r===""||r==='""'}get str(){var r;return(r=this._str)!==null&&r!==void 0?r:this._str=this._items.reduce((c,g)=>`${c}${g}`,"")}get names(){var r;return(r=this._names)!==null&&r!==void 0?r:this._names=this._items.reduce((c,g)=>(g instanceof n&&(c[g.str]=(c[g.str]||0)+1),c),{})}}e._Code=i,e.nil=new i("");function y(u,...r){const c=[u[0]];let g=0;for(;g<r.length;)d(c,r[g]),c.push(u[++g]);return new i(c)}e._=y;const s=new i("+");function l(u,...r){const c=[v(u[0])];let g=0;for(;g<r.length;)c.push(s),d(c,r[g]),c.push(s,v(u[++g]));return f(c),new i(c)}e.str=l;function d(u,r){r instanceof i?u.push(...r._items):r instanceof n?u.push(r):u.push(E(r))}e.addCodeArg=d;function f(u){let r=1;for(;r<u.length-1;){if(u[r]===s){const c=w(u[r-1],u[r+1]);if(c!==void 0){u.splice(r-1,3,c);continue}u[r++]="+"}r++}}function w(u,r){if(r==='""')return u;if(u==='""')return r;if(typeof u=="string")return r instanceof n||u[u.length-1]!=='"'?void 0:typeof r!="string"?`${u.slice(0,-1)}${r}"`:r[0]==='"'?u.slice(0,-1)+r.slice(1):void 0;if(typeof r=="string"&&r[0]==='"'&&!(u instanceof n))return`"${u}${r.slice(1)}`}function $(u,r){return r.emptyStr()?u:u.emptyStr()?r:l`${u}${r}`}e.strConcat=$;function E(u){return typeof u=="number"||typeof u=="boolean"||u===null?u:v(Array.isArray(u)?u.join(","):u)}function _(u){return new i(v(u))}e.stringify=_;function v(u){return JSON.stringify(u).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function b(u){return typeof u=="string"&&e.IDENTIFIER.test(u)?new i(`.${u}`):y`[${u}]`}e.getProperty=b;function h(u){if(typeof u=="string"&&e.IDENTIFIER.test(u))return new i(`${u}`);throw new Error(`CodeGen: invalid export name: ${u}, use explicit $id name mapping`)}e.getEsmExportName=h;function a(u){return new i(u.toString())}e.regexpCode=a})(Jt)),Jt}var Ht={},ur;function lr(){return ur||(ur=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Et();class n extends Error{constructor(w){super(`CodeGen: "code" for ${w} not defined`),this.value=w.value}}var i;(function(f){f[f.Started=0]="Started",f[f.Completed=1]="Completed"})(i||(e.UsedValueState=i={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class y{constructor({prefixes:w,parent:$}={}){this._names={},this._prefixes=w,this._parent=$}toName(w){return w instanceof t.Name?w:this.name(w)}name(w){return new t.Name(this._newName(w))}_newName(w){const $=this._names[w]||this._nameGroup(w);return`${w}${$.index++}`}_nameGroup(w){var $,E;if(!((E=($=this._parent)===null||$===void 0?void 0:$._prefixes)===null||E===void 0)&&E.has(w)||this._prefixes&&!this._prefixes.has(w))throw new Error(`CodeGen: prefix "${w}" is not allowed in this scope`);return this._names[w]={prefix:w,index:0}}}e.Scope=y;class s extends t.Name{constructor(w,$){super($),this.prefix=w}setValue(w,{property:$,itemIndex:E}){this.value=w,this.scopePath=(0,t._)`.${new t.Name($)}[${E}]`}}e.ValueScopeName=s;const l=(0,t._)`\n`;class d extends y{constructor(w){super(w),this._values={},this._scope=w.scope,this.opts={...w,_n:w.lines?l:t.nil}}get(){return this._scope}name(w){return new s(w,this._newName(w))}value(w,$){var E;if($.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const _=this.toName(w),{prefix:v}=_,b=(E=$.key)!==null&&E!==void 0?E:$.ref;let h=this._values[v];if(h){const r=h.get(b);if(r)return r}else h=this._values[v]=new Map;h.set(b,_);const a=this._scope[v]||(this._scope[v]=[]),u=a.length;return a[u]=$.ref,_.setValue($,{property:v,itemIndex:u}),_}getValue(w,$){const E=this._values[w];if(E)return E.get($)}scopeRefs(w,$=this._values){return this._reduceValues($,E=>{if(E.scopePath===void 0)throw new Error(`CodeGen: name "${E}" has no value`);return(0,t._)`${w}${E.scopePath}`})}scopeCode(w=this._values,$,E){return this._reduceValues(w,_=>{if(_.value===void 0)throw new Error(`CodeGen: name "${_}" has no value`);return _.value.code},$,E)}_reduceValues(w,$,E={},_){let v=t.nil;for(const b in w){const h=w[b];if(!h)continue;const a=E[b]=E[b]||new Map;h.forEach(u=>{if(a.has(u))return;a.set(u,i.Started);let r=$(u);if(r){const c=this.opts.es5?e.varKinds.var:e.varKinds.const;v=(0,t._)`${v}${c} ${u} = ${r};${this.opts._n}`}else if(r=_?.(u))v=(0,t._)`${v}${r}${this.opts._n}`;else throw new n(u);a.set(u,i.Completed)})}return v}}e.ValueScope=d})(Ht)),Ht}var fr;function G(){return fr||(fr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Et(),n=lr();var i=Et();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return i.Name}});var y=lr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return y.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return y.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return y.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return y.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(p,S){return this}}class l extends s{constructor(p,S,N){super(),this.varKind=p,this.name=S,this.rhs=N}render({es5:p,_n:S}){const N=p?n.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${U};`+S}optimizeNames(p,S){if(p[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,p,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class d extends s{constructor(p,S,N){super(),this.lhs=p,this.rhs=S,this.sideEffects=N}render({_n:p}){return`${this.lhs} = ${this.rhs};`+p}optimizeNames(p,S){if(!(this.lhs instanceof t.Name&&!p[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,p,S),this}get names(){const p=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(p,this.rhs)}}class f extends d{constructor(p,S,N,U){super(p,N,U),this.op=S}render({_n:p}){return`${this.lhs} ${this.op}= ${this.rhs};`+p}}class w extends s{constructor(p){super(),this.label=p,this.names={}}render({_n:p}){return`${this.label}:`+p}}class $ extends s{constructor(p){super(),this.label=p,this.names={}}render({_n:p}){return`break${this.label?` ${this.label}`:""};`+p}}class E extends s{constructor(p){super(),this.error=p}render({_n:p}){return`throw ${this.error};`+p}get names(){return this.error.names}}class _ extends s{constructor(p){super(),this.code=p}render({_n:p}){return`${this.code};`+p}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(p,S){return this.code=L(this.code,p,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class v extends s{constructor(p=[]){super(),this.nodes=p}render(p){return this.nodes.reduce((S,N)=>S+N.render(p),"")}optimizeNodes(){const{nodes:p}=this;let S=p.length;for(;S--;){const N=p[S].optimizeNodes();Array.isArray(N)?p.splice(S,1,...N):N?p[S]=N:p.splice(S,1)}return p.length>0?this:void 0}optimizeNames(p,S){const{nodes:N}=this;let U=N.length;for(;U--;){const J=N[U];J.optimizeNames(p,S)||(Q(p,J.names),N.splice(U,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((p,S)=>V(p,S.names),{})}}class b extends v{render(p){return"{"+p._n+super.render(p)+"}"+p._n}}class h extends v{}class a extends b{}a.kind="else";class u extends b{constructor(p,S){super(S),this.condition=p}render(p){let S=`if(${this.condition})`+super.render(p);return this.else&&(S+="else "+this.else.render(p)),S}optimizeNodes(){super.optimizeNodes();const p=this.condition;if(p===!0)return this.nodes;let S=this.else;if(S){const N=S.optimizeNodes();S=this.else=Array.isArray(N)?new a(N):N}if(S)return p===!1?S instanceof u?S:S.nodes:this.nodes.length?this:new u(ie(p),S instanceof u?[S]:S.nodes);if(!(p===!1||!this.nodes.length))return this}optimizeNames(p,S){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(p,S),!!(super.optimizeNames(p,S)||this.else))return this.condition=L(this.condition,p,S),this}get names(){const p=super.names;return F(p,this.condition),this.else&&V(p,this.else.names),p}}u.kind="if";class r extends b{}r.kind="for";class c extends r{constructor(p){super(),this.iteration=p}render(p){return`for(${this.iteration})`+super.render(p)}optimizeNames(p,S){if(super.optimizeNames(p,S))return this.iteration=L(this.iteration,p,S),this}get names(){return V(super.names,this.iteration.names)}}class g extends r{constructor(p,S,N,U){super(),this.varKind=p,this.name=S,this.from=N,this.to=U}render(p){const S=p.es5?n.varKinds.var:this.varKind,{name:N,from:U,to:J}=this;return`for(${S} ${N}=${U}; ${N}<${J}; ${N}++)`+super.render(p)}get names(){const p=F(super.names,this.from);return F(p,this.to)}}class o extends r{constructor(p,S,N,U){super(),this.loop=p,this.varKind=S,this.name=N,this.iterable=U}render(p){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(p)}optimizeNames(p,S){if(super.optimizeNames(p,S))return this.iterable=L(this.iterable,p,S),this}get names(){return V(super.names,this.iterable.names)}}class m extends b{constructor(p,S,N){super(),this.name=p,this.args=S,this.async=N}render(p){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(p)}}m.kind="func";class P extends v{render(p){return"return "+super.render(p)}}P.kind="return";class O extends b{render(p){let S="try"+super.render(p);return this.catch&&(S+=this.catch.render(p)),this.finally&&(S+=this.finally.render(p)),S}optimizeNodes(){var p,S;return super.optimizeNodes(),(p=this.catch)===null||p===void 0||p.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(p,S){var N,U;return super.optimizeNames(p,S),(N=this.catch)===null||N===void 0||N.optimizeNames(p,S),(U=this.finally)===null||U===void 0||U.optimizeNames(p,S),this}get names(){const p=super.names;return this.catch&&V(p,this.catch.names),this.finally&&V(p,this.finally.names),p}}class T extends b{constructor(p){super(),this.error=p}render(p){return`catch(${this.error})`+super.render(p)}}T.kind="catch";class z extends b{render(p){return"finally"+super.render(p)}}z.kind="finally";class C{constructor(p,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
2
+ `:""},this._extScope=p,this._scope=new n.Scope({parent:p}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(p){return this._scope.name(p)}scopeName(p){return this._extScope.name(p)}scopeValue(p,S){const N=this._extScope.value(p,S);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(p,S){return this._extScope.getValue(p,S)}scopeRefs(p){return this._extScope.scopeRefs(p,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(p,S,N,U){const J=this._scope.toName(S);return N!==void 0&&U&&(this._constants[J.str]=N),this._leafNode(new l(p,J,N)),J}const(p,S,N){return this._def(n.varKinds.const,p,S,N)}let(p,S,N){return this._def(n.varKinds.let,p,S,N)}var(p,S,N){return this._def(n.varKinds.var,p,S,N)}assign(p,S,N){return this._leafNode(new d(p,S,N))}add(p,S){return this._leafNode(new f(p,e.operators.ADD,S))}code(p){return typeof p=="function"?p():p!==t.nil&&this._leafNode(new _(p)),this}object(...p){const S=["{"];for(const[N,U]of p)S.length>1&&S.push(","),S.push(N),(N!==U||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,U));return S.push("}"),new t._Code(S)}if(p,S,N){if(this._blockNode(new u(p)),S&&N)this.code(S).else().code(N).endIf();else if(S)this.code(S).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(p){return this._elseNode(new u(p))}else(){return this._elseNode(new a)}endIf(){return this._endBlockNode(u,a)}_for(p,S){return this._blockNode(p),S&&this.code(S).endFor(),this}for(p,S){return this._for(new c(p),S)}forRange(p,S,N,U,J=this.opts.es5?n.varKinds.var:n.varKinds.let){const x=this._scope.toName(p);return this._for(new g(J,x,S,N),()=>U(x))}forOf(p,S,N,U=n.varKinds.const){const J=this._scope.toName(p);if(this.opts.es5){const x=S instanceof t.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,t._)`${x}.length`,B=>{this.var(J,(0,t._)`${x}[${B}]`),N(J)})}return this._for(new o("of",U,J,S),()=>N(J))}forIn(p,S,N,U=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(p,(0,t._)`Object.keys(${S})`,N);const J=this._scope.toName(p);return this._for(new o("in",U,J,S),()=>N(J))}endFor(){return this._endBlockNode(r)}label(p){return this._leafNode(new w(p))}break(p){return this._leafNode(new $(p))}return(p){const S=new P;if(this._blockNode(S),this.code(p),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(p,S,N){if(!S&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new O;if(this._blockNode(U),this.code(p),S){const J=this.name("e");this._currNode=U.catch=new T(J),S(J)}return N&&(this._currNode=U.finally=new z,this.code(N)),this._endBlockNode(T,z)}throw(p){return this._leafNode(new E(p))}block(p,S){return this._blockStarts.push(this._nodes.length),p&&this.code(p).endBlock(S),this}endBlock(p){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-S;if(N<0||p!==void 0&&N!==p)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${p} expected`);return this._nodes.length=S,this}func(p,S=t.nil,N,U){return this._blockNode(new m(p,S,N)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(m)}optimize(p=1){for(;p-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(p){return this._currNode.nodes.push(p),this}_blockNode(p){this._currNode.nodes.push(p),this._nodes.push(p)}_endBlockNode(p,S){const N=this._currNode;if(N instanceof p||S&&N instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${p.kind}/${S.kind}`:p.kind}"`)}_elseNode(p){const S=this._currNode;if(!(S instanceof u))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=p,this}get _root(){return this._nodes[0]}get _currNode(){const p=this._nodes;return p[p.length-1]}set _currNode(p){const S=this._nodes;S[S.length-1]=p}}e.CodeGen=C;function V(R,p){for(const S in p)R[S]=(R[S]||0)+(p[S]||0);return R}function F(R,p){return p instanceof t._CodeOrName?V(R,p.names):R}function L(R,p,S){if(R instanceof t.Name)return N(R);if(!U(R))return R;return new t._Code(R._items.reduce((J,x)=>(x instanceof t.Name&&(x=N(x)),x instanceof t._Code?J.push(...x._items):J.push(x),J),[]));function N(J){const x=S[J.str];return x===void 0||p[J.str]!==1?J:(delete p[J.str],x)}function U(J){return J instanceof t._Code&&J._items.some(x=>x instanceof t.Name&&p[x.str]===1&&S[x.str]!==void 0)}}function Q(R,p){for(const S in p)R[S]=(R[S]||0)-(p[S]||0)}function ie(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,t._)`!${D(R)}`}e.not=ie;const oe=j(e.operators.AND);function X(...R){return R.reduce(oe)}e.and=X;const pe=j(e.operators.OR);function M(...R){return R.reduce(pe)}e.or=M;function j(R){return(p,S)=>p===t.nil?S:S===t.nil?p:(0,t._)`${D(p)} ${R} ${D(S)}`}function D(R){return R instanceof t.Name?R:(0,t._)`(${R})`}})(Kt)),Kt}var H={},pr;function Y(){if(pr)return H;pr=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=G(),t=Et();function n(o){const m={};for(const P of o)m[P]=!0;return m}H.toHash=n;function i(o,m){return typeof m=="boolean"?m:Object.keys(m).length===0?!0:(y(o,m),!s(m,o.self.RULES.all))}H.alwaysValidSchema=i;function y(o,m=o.schema){const{opts:P,self:O}=o;if(!P.strictSchema||typeof m=="boolean")return;const T=O.RULES.keywords;for(const z in m)T[z]||g(o,`unknown keyword: "${z}"`)}H.checkUnknownRules=y;function s(o,m){if(typeof o=="boolean")return!o;for(const P in o)if(m[P])return!0;return!1}H.schemaHasRules=s;function l(o,m){if(typeof o=="boolean")return!o;for(const P in o)if(P!=="$ref"&&m.all[P])return!0;return!1}H.schemaHasRulesButRef=l;function d({topSchemaRef:o,schemaPath:m},P,O,T){if(!T){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${o}${m}${(0,e.getProperty)(O)}`}H.schemaRefOrVal=d;function f(o){return E(decodeURIComponent(o))}H.unescapeFragment=f;function w(o){return encodeURIComponent($(o))}H.escapeFragment=w;function $(o){return typeof o=="number"?`${o}`:o.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=$;function E(o){return o.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=E;function _(o,m){if(Array.isArray(o))for(const P of o)m(P);else m(o)}H.eachItem=_;function v({mergeNames:o,mergeToName:m,mergeValues:P,resultToName:O}){return(T,z,C,V)=>{const F=C===void 0?z:C instanceof e.Name?(z instanceof e.Name?o(T,z,C):m(T,z,C),C):z instanceof e.Name?(m(T,C,z),z):P(z,C);return V===e.Name&&!(F instanceof e.Name)?O(T,F):F}}H.mergeEvaluated={props:v({mergeNames:(o,m,P)=>o.if((0,e._)`${P} !== true && ${m} !== undefined`,()=>{o.if((0,e._)`${m} === true`,()=>o.assign(P,!0),()=>o.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${m})`))}),mergeToName:(o,m,P)=>o.if((0,e._)`${P} !== true`,()=>{m===!0?o.assign(P,!0):(o.assign(P,(0,e._)`${P} || {}`),h(o,P,m))}),mergeValues:(o,m)=>o===!0?!0:{...o,...m},resultToName:b}),items:v({mergeNames:(o,m,P)=>o.if((0,e._)`${P} !== true && ${m} !== undefined`,()=>o.assign(P,(0,e._)`${m} === true ? true : ${P} > ${m} ? ${P} : ${m}`)),mergeToName:(o,m,P)=>o.if((0,e._)`${P} !== true`,()=>o.assign(P,m===!0?!0:(0,e._)`${P} > ${m} ? ${P} : ${m}`)),mergeValues:(o,m)=>o===!0?!0:Math.max(o,m),resultToName:(o,m)=>o.var("items",m)})};function b(o,m){if(m===!0)return o.var("props",!0);const P=o.var("props",(0,e._)`{}`);return m!==void 0&&h(o,P,m),P}H.evaluatedPropsToName=b;function h(o,m,P){Object.keys(P).forEach(O=>o.assign((0,e._)`${m}${(0,e.getProperty)(O)}`,!0))}H.setEvaluated=h;const a={};function u(o,m){return o.scopeValue("func",{ref:m,code:a[m.code]||(a[m.code]=new t._Code(m.code))})}H.useFunc=u;var r;(function(o){o[o.Num=0]="Num",o[o.Str=1]="Str"})(r||(H.Type=r={}));function c(o,m,P){if(o instanceof e.Name){const O=m===r.Num;return P?O?(0,e._)`"[" + ${o} + "]"`:(0,e._)`"['" + ${o} + "']"`:O?(0,e._)`"/" + ${o}`:(0,e._)`"/" + ${o}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(o).toString():"/"+$(o)}H.getErrorPath=c;function g(o,m,P=o.opts.strictSchema){if(P){if(m=`strict mode: ${m}`,P===!0)throw new Error(m);o.self.logger.warn(m)}}return H.checkStrictMode=g,H}var Fe={},mr;function Se(){if(mr)return Fe;mr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=G(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Fe.default=t,Fe}var hr;function Dt(){return hr||(hr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=G(),n=Y(),i=Se();e.keywordError={message:({keyword:a})=>(0,t.str)`must pass "${a}" keyword validation`},e.keyword$DataError={message:({keyword:a,schemaType:u})=>u?(0,t.str)`"${a}" keyword must be ${u} ($data)`:(0,t.str)`"${a}" keyword is invalid ($data)`};function y(a,u=e.keywordError,r,c){const{it:g}=a,{gen:o,compositeRule:m,allErrors:P}=g,O=E(a,u,r);c??(m||P)?f(o,O):w(g,(0,t._)`[${O}]`)}e.reportError=y;function s(a,u=e.keywordError,r){const{it:c}=a,{gen:g,compositeRule:o,allErrors:m}=c,P=E(a,u,r);f(g,P),o||m||w(c,i.default.vErrors)}e.reportExtraError=s;function l(a,u){a.assign(i.default.errors,u),a.if((0,t._)`${i.default.vErrors} !== null`,()=>a.if(u,()=>a.assign((0,t._)`${i.default.vErrors}.length`,u),()=>a.assign(i.default.vErrors,null)))}e.resetErrorsCount=l;function d({gen:a,keyword:u,schemaValue:r,data:c,errsCount:g,it:o}){if(g===void 0)throw new Error("ajv implementation error");const m=a.name("err");a.forRange("i",g,i.default.errors,P=>{a.const(m,(0,t._)`${i.default.vErrors}[${P}]`),a.if((0,t._)`${m}.instancePath === undefined`,()=>a.assign((0,t._)`${m}.instancePath`,(0,t.strConcat)(i.default.instancePath,o.errorPath))),a.assign((0,t._)`${m}.schemaPath`,(0,t.str)`${o.errSchemaPath}/${u}`),o.opts.verbose&&(a.assign((0,t._)`${m}.schema`,r),a.assign((0,t._)`${m}.data`,c))})}e.extendErrors=d;function f(a,u){const r=a.const("err",u);a.if((0,t._)`${i.default.vErrors} === null`,()=>a.assign(i.default.vErrors,(0,t._)`[${r}]`),(0,t._)`${i.default.vErrors}.push(${r})`),a.code((0,t._)`${i.default.errors}++`)}function w(a,u){const{gen:r,validateName:c,schemaEnv:g}=a;g.$async?r.throw((0,t._)`new ${a.ValidationError}(${u})`):(r.assign((0,t._)`${c}.errors`,u),r.return(!1))}const $={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function E(a,u,r){const{createErrors:c}=a.it;return c===!1?(0,t._)`{}`:_(a,u,r)}function _(a,u,r={}){const{gen:c,it:g}=a,o=[v(g,r),b(a,r)];return h(a,u,o),c.object(...o)}function v({errorPath:a},{instancePath:u}){const r=u?(0,t.str)`${a}${(0,n.getErrorPath)(u,n.Type.Str)}`:a;return[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,r)]}function b({keyword:a,it:{errSchemaPath:u}},{schemaPath:r,parentSchema:c}){let g=c?u:(0,t.str)`${u}/${a}`;return r&&(g=(0,t.str)`${g}${(0,n.getErrorPath)(r,n.Type.Str)}`),[$.schemaPath,g]}function h(a,{params:u,message:r},c){const{keyword:g,data:o,schemaValue:m,it:P}=a,{opts:O,propertyName:T,topSchemaRef:z,schemaPath:C}=P;c.push([$.keyword,g],[$.params,typeof u=="function"?u(a):u||(0,t._)`{}`]),O.messages&&c.push([$.message,typeof r=="function"?r(a):r]),O.verbose&&c.push([$.schema,m],[$.parentSchema,(0,t._)`${z}${C}`],[i.default.data,o]),T&&c.push([$.propertyName,T])}})(Ut)),Ut}var yr;function ls(){if(yr)return Ee;yr=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.boolOrEmptySchema=Ee.topBoolOrEmptySchema=void 0;const e=Dt(),t=G(),n=Se(),i={message:"boolean schema is false"};function y(d){const{gen:f,schema:w,validateName:$}=d;w===!1?l(d,!1):typeof w=="object"&&w.$async===!0?f.return(n.default.data):(f.assign((0,t._)`${$}.errors`,null),f.return(!0))}Ee.topBoolOrEmptySchema=y;function s(d,f){const{gen:w,schema:$}=d;$===!1?(w.var(f,!1),l(d)):w.var(f,!0)}Ee.boolOrEmptySchema=s;function l(d,f){const{gen:w,data:$}=d,E={gen:w,keyword:"false schema",data:$,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:d};(0,e.reportError)(E,i,void 0,f)}return Ee}var se={},ke={},gr;function Rn(){if(gr)return ke;gr=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.getRules=ke.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(y){return typeof y=="string"&&t.has(y)}ke.isJSONType=n;function i(){const y={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...y,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},y.number,y.string,y.array,y.object],post:{rules:[]},all:{},keywords:{}}}return ke.getRules=i,ke}var _e={},vr;function On(){if(vr)return _e;vr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:i,self:y},s){const l=y.RULES.types[s];return l&&l!==!0&&t(i,l)}_e.schemaHasRulesForType=e;function t(i,y){return y.rules.some(s=>n(i,s))}_e.shouldUseGroup=t;function n(i,y){var s;return i[y.keyword]!==void 0||((s=y.definition.implements)===null||s===void 0?void 0:s.some(l=>i[l]!==void 0))}return _e.shouldUseRule=n,_e}var _r;function kt(){if(_r)return se;_r=1,Object.defineProperty(se,"__esModule",{value:!0}),se.reportTypeError=se.checkDataTypes=se.checkDataType=se.coerceAndCheckDataType=se.getJSONTypes=se.getSchemaTypes=se.DataType=void 0;const e=Rn(),t=On(),n=Dt(),i=G(),y=Y();var s;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(s||(se.DataType=s={}));function l(r){const c=d(r.type);if(c.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!c.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&c.push("null")}return c}se.getSchemaTypes=l;function d(r){const c=Array.isArray(r)?r:r?[r]:[];if(c.every(e.isJSONType))return c;throw new Error("type must be JSONType or JSONType[]: "+c.join(","))}se.getJSONTypes=d;function f(r,c){const{gen:g,data:o,opts:m}=r,P=$(c,m.coerceTypes),O=c.length>0&&!(P.length===0&&c.length===1&&(0,t.schemaHasRulesForType)(r,c[0]));if(O){const T=b(c,o,m.strictNumbers,s.Wrong);g.if(T,()=>{P.length?E(r,c,P):a(r)})}return O}se.coerceAndCheckDataType=f;const w=new Set(["string","number","integer","boolean","null"]);function $(r,c){return c?r.filter(g=>w.has(g)||c==="array"&&g==="array"):[]}function E(r,c,g){const{gen:o,data:m,opts:P}=r,O=o.let("dataType",(0,i._)`typeof ${m}`),T=o.let("coerced",(0,i._)`undefined`);P.coerceTypes==="array"&&o.if((0,i._)`${O} == 'object' && Array.isArray(${m}) && ${m}.length == 1`,()=>o.assign(m,(0,i._)`${m}[0]`).assign(O,(0,i._)`typeof ${m}`).if(b(c,m,P.strictNumbers),()=>o.assign(T,m))),o.if((0,i._)`${T} !== undefined`);for(const C of g)(w.has(C)||C==="array"&&P.coerceTypes==="array")&&z(C);o.else(),a(r),o.endIf(),o.if((0,i._)`${T} !== undefined`,()=>{o.assign(m,T),_(r,T)});function z(C){switch(C){case"string":o.elseIf((0,i._)`${O} == "number" || ${O} == "boolean"`).assign(T,(0,i._)`"" + ${m}`).elseIf((0,i._)`${m} === null`).assign(T,(0,i._)`""`);return;case"number":o.elseIf((0,i._)`${O} == "boolean" || ${m} === null
3
+ || (${O} == "string" && ${m} && ${m} == +${m})`).assign(T,(0,i._)`+${m}`);return;case"integer":o.elseIf((0,i._)`${O} === "boolean" || ${m} === null
4
+ || (${O} === "string" && ${m} && ${m} == +${m} && !(${m} % 1))`).assign(T,(0,i._)`+${m}`);return;case"boolean":o.elseIf((0,i._)`${m} === "false" || ${m} === 0 || ${m} === null`).assign(T,!1).elseIf((0,i._)`${m} === "true" || ${m} === 1`).assign(T,!0);return;case"null":o.elseIf((0,i._)`${m} === "" || ${m} === 0 || ${m} === false`),o.assign(T,null);return;case"array":o.elseIf((0,i._)`${O} === "string" || ${O} === "number"
5
+ || ${O} === "boolean" || ${m} === null`).assign(T,(0,i._)`[${m}]`)}}}function _({gen:r,parentData:c,parentDataProperty:g},o){r.if((0,i._)`${c} !== undefined`,()=>r.assign((0,i._)`${c}[${g}]`,o))}function v(r,c,g,o=s.Correct){const m=o===s.Correct?i.operators.EQ:i.operators.NEQ;let P;switch(r){case"null":return(0,i._)`${c} ${m} null`;case"array":P=(0,i._)`Array.isArray(${c})`;break;case"object":P=(0,i._)`${c} && typeof ${c} == "object" && !Array.isArray(${c})`;break;case"integer":P=O((0,i._)`!(${c} % 1) && !isNaN(${c})`);break;case"number":P=O();break;default:return(0,i._)`typeof ${c} ${m} ${r}`}return o===s.Correct?P:(0,i.not)(P);function O(T=i.nil){return(0,i.and)((0,i._)`typeof ${c} == "number"`,T,g?(0,i._)`isFinite(${c})`:i.nil)}}se.checkDataType=v;function b(r,c,g,o){if(r.length===1)return v(r[0],c,g,o);let m;const P=(0,y.toHash)(r);if(P.array&&P.object){const O=(0,i._)`typeof ${c} != "object"`;m=P.null?O:(0,i._)`!${c} || ${O}`,delete P.null,delete P.array,delete P.object}else m=i.nil;P.number&&delete P.integer;for(const O in P)m=(0,i.and)(m,v(O,c,g,o));return m}se.checkDataTypes=b;const h={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:c})=>typeof r=="string"?(0,i._)`{type: ${r}}`:(0,i._)`{type: ${c}}`};function a(r){const c=u(r);(0,n.reportError)(c,h)}se.reportTypeError=a;function u(r){const{gen:c,data:g,schema:o}=r,m=(0,y.schemaRefOrVal)(r,o,"type");return{gen:c,keyword:"type",data:g,schema:o.type,schemaCode:m,schemaValue:m,parentSchema:o,params:{},it:r}}return se}var qe={},$r;function fs(){if($r)return qe;$r=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.assignDefaults=void 0;const e=G(),t=Y();function n(y,s){const{properties:l,items:d}=y.schema;if(s==="object"&&l)for(const f in l)i(y,f,l[f].default);else s==="array"&&Array.isArray(d)&&d.forEach((f,w)=>i(y,w,f.default))}qe.assignDefaults=n;function i(y,s,l){const{gen:d,compositeRule:f,data:w,opts:$}=y;if(l===void 0)return;const E=(0,e._)`${w}${(0,e.getProperty)(s)}`;if(f){(0,t.checkStrictMode)(y,`default is ignored for: ${E}`);return}let _=(0,e._)`${E} === undefined`;$.useDefaults==="empty"&&(_=(0,e._)`${_} || ${E} === null || ${E} === ""`),d.if(_,(0,e._)`${E} = ${(0,e.stringify)(l)}`)}return qe}var he={},Z={},br;function ge(){if(br)return Z;br=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.validateUnion=Z.validateArray=Z.usePattern=Z.callValidateCode=Z.schemaProperties=Z.allSchemaProperties=Z.noPropertyInData=Z.propertyInData=Z.isOwnProperty=Z.hasPropFunc=Z.reportMissingProp=Z.checkMissingProp=Z.checkReportMissingProp=void 0;const e=G(),t=Y(),n=Se(),i=Y();function y(r,c){const{gen:g,data:o,it:m}=r;g.if($(g,o,c,m.opts.ownProperties),()=>{r.setParams({missingProperty:(0,e._)`${c}`},!0),r.error()})}Z.checkReportMissingProp=y;function s({gen:r,data:c,it:{opts:g}},o,m){return(0,e.or)(...o.map(P=>(0,e.and)($(r,c,P,g.ownProperties),(0,e._)`${m} = ${P}`)))}Z.checkMissingProp=s;function l(r,c){r.setParams({missingProperty:c},!0),r.error()}Z.reportMissingProp=l;function d(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Z.hasPropFunc=d;function f(r,c,g){return(0,e._)`${d(r)}.call(${c}, ${g})`}Z.isOwnProperty=f;function w(r,c,g,o){const m=(0,e._)`${c}${(0,e.getProperty)(g)} !== undefined`;return o?(0,e._)`${m} && ${f(r,c,g)}`:m}Z.propertyInData=w;function $(r,c,g,o){const m=(0,e._)`${c}${(0,e.getProperty)(g)} === undefined`;return o?(0,e.or)(m,(0,e.not)(f(r,c,g))):m}Z.noPropertyInData=$;function E(r){return r?Object.keys(r).filter(c=>c!=="__proto__"):[]}Z.allSchemaProperties=E;function _(r,c){return E(c).filter(g=>!(0,t.alwaysValidSchema)(r,c[g]))}Z.schemaProperties=_;function v({schemaCode:r,data:c,it:{gen:g,topSchemaRef:o,schemaPath:m,errorPath:P},it:O},T,z,C){const V=C?(0,e._)`${r}, ${c}, ${o}${m}`:c,F=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,P)],[n.default.parentData,O.parentData],[n.default.parentDataProperty,O.parentDataProperty],[n.default.rootData,n.default.rootData]];O.opts.dynamicRef&&F.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const L=(0,e._)`${V}, ${g.object(...F)}`;return z!==e.nil?(0,e._)`${T}.call(${z}, ${L})`:(0,e._)`${T}(${L})`}Z.callValidateCode=v;const b=(0,e._)`new RegExp`;function h({gen:r,it:{opts:c}},g){const o=c.unicodeRegExp?"u":"",{regExp:m}=c.code,P=m(g,o);return r.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${m.code==="new RegExp"?b:(0,i.useFunc)(r,m)}(${g}, ${o})`})}Z.usePattern=h;function a(r){const{gen:c,data:g,keyword:o,it:m}=r,P=c.name("valid");if(m.allErrors){const T=c.let("valid",!0);return O(()=>c.assign(T,!1)),T}return c.var(P,!0),O(()=>c.break()),P;function O(T){const z=c.const("len",(0,e._)`${g}.length`);c.forRange("i",0,z,C=>{r.subschema({keyword:o,dataProp:C,dataPropType:t.Type.Num},P),c.if((0,e.not)(P),T)})}}Z.validateArray=a;function u(r){const{gen:c,schema:g,keyword:o,it:m}=r;if(!Array.isArray(g))throw new Error("ajv implementation error");if(g.some(z=>(0,t.alwaysValidSchema)(m,z))&&!m.opts.unevaluated)return;const O=c.let("valid",!1),T=c.name("_valid");c.block(()=>g.forEach((z,C)=>{const V=r.subschema({keyword:o,schemaProp:C,compositeRule:!0},T);c.assign(O,(0,e._)`${O} || ${T}`),r.mergeValidEvaluated(V,T)||c.if((0,e.not)(O))})),r.result(O,()=>r.reset(),()=>r.error(!0))}return Z.validateUnion=u,Z}var wr;function ps(){if(wr)return he;wr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.validateKeywordUsage=he.validSchemaType=he.funcKeywordCode=he.macroKeywordCode=void 0;const e=G(),t=Se(),n=ge(),i=Dt();function y(_,v){const{gen:b,keyword:h,schema:a,parentSchema:u,it:r}=_,c=v.macro.call(r.self,a,u,r),g=w(b,h,c);r.opts.validateSchema!==!1&&r.self.validateSchema(c,!0);const o=b.name("valid");_.subschema({schema:c,schemaPath:e.nil,errSchemaPath:`${r.errSchemaPath}/${h}`,topSchemaRef:g,compositeRule:!0},o),_.pass(o,()=>_.error(!0))}he.macroKeywordCode=y;function s(_,v){var b;const{gen:h,keyword:a,schema:u,parentSchema:r,$data:c,it:g}=_;f(g,v);const o=!c&&v.compile?v.compile.call(g.self,u,r,g):v.validate,m=w(h,a,o),P=h.let("valid");_.block$data(P,O),_.ok((b=v.valid)!==null&&b!==void 0?b:P);function O(){if(v.errors===!1)C(),v.modifying&&l(_),V(()=>_.error());else{const F=v.async?T():z();v.modifying&&l(_),V(()=>d(_,F))}}function T(){const F=h.let("ruleErrs",null);return h.try(()=>C((0,e._)`await `),L=>h.assign(P,!1).if((0,e._)`${L} instanceof ${g.ValidationError}`,()=>h.assign(F,(0,e._)`${L}.errors`),()=>h.throw(L))),F}function z(){const F=(0,e._)`${m}.errors`;return h.assign(F,null),C(e.nil),F}function C(F=v.async?(0,e._)`await `:e.nil){const L=g.opts.passContext?t.default.this:t.default.self,Q=!("compile"in v&&!c||v.schema===!1);h.assign(P,(0,e._)`${F}${(0,n.callValidateCode)(_,m,L,Q)}`,v.modifying)}function V(F){var L;h.if((0,e.not)((L=v.valid)!==null&&L!==void 0?L:P),F)}}he.funcKeywordCode=s;function l(_){const{gen:v,data:b,it:h}=_;v.if(h.parentData,()=>v.assign(b,(0,e._)`${h.parentData}[${h.parentDataProperty}]`))}function d(_,v){const{gen:b}=_;b.if((0,e._)`Array.isArray(${v})`,()=>{b.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${v} : ${t.default.vErrors}.concat(${v})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,i.extendErrors)(_)},()=>_.error())}function f({schemaEnv:_},v){if(v.async&&!_.$async)throw new Error("async keyword in sync schema")}function w(_,v,b){if(b===void 0)throw new Error(`keyword "${v}" failed to compile`);return _.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function $(_,v,b=!1){return!v.length||v.some(h=>h==="array"?Array.isArray(_):h==="object"?_&&typeof _=="object"&&!Array.isArray(_):typeof _==h||b&&typeof _>"u")}he.validSchemaType=$;function E({schema:_,opts:v,self:b,errSchemaPath:h},a,u){if(Array.isArray(a.keyword)?!a.keyword.includes(u):a.keyword!==u)throw new Error("ajv implementation error");const r=a.dependencies;if(r?.some(c=>!Object.prototype.hasOwnProperty.call(_,c)))throw new Error(`parent schema must have dependencies of ${u}: ${r.join(",")}`);if(a.validateSchema&&!a.validateSchema(_[u])){const g=`keyword "${u}" value is invalid at path "${h}": `+b.errorsText(a.validateSchema.errors);if(v.validateSchema==="log")b.logger.error(g);else throw new Error(g)}}return he.validateKeywordUsage=E,he}var $e={},Pr;function ms(){if(Pr)return $e;Pr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=G(),t=Y();function n(s,{keyword:l,schemaProp:d,schema:f,schemaPath:w,errSchemaPath:$,topSchemaRef:E}){if(l!==void 0&&f!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){const _=s.schema[l];return d===void 0?{schema:_,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${s.errSchemaPath}/${l}`}:{schema:_[d],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(d)}`,errSchemaPath:`${s.errSchemaPath}/${l}/${(0,t.escapeFragment)(d)}`}}if(f!==void 0){if(w===void 0||$===void 0||E===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:f,schemaPath:w,topSchemaRef:E,errSchemaPath:$}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=n;function i(s,l,{dataProp:d,dataPropType:f,data:w,dataTypes:$,propertyName:E}){if(w!==void 0&&d!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:_}=l;if(d!==void 0){const{errorPath:b,dataPathArr:h,opts:a}=l,u=_.let("data",(0,e._)`${l.data}${(0,e.getProperty)(d)}`,!0);v(u),s.errorPath=(0,e.str)`${b}${(0,t.getErrorPath)(d,f,a.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${d}`,s.dataPathArr=[...h,s.parentDataProperty]}if(w!==void 0){const b=w instanceof e.Name?w:_.let("data",w,!0);v(b),E!==void 0&&(s.propertyName=E)}$&&(s.dataTypes=$);function v(b){s.data=b,s.dataLevel=l.dataLevel+1,s.dataTypes=[],l.definedProperties=new Set,s.parentData=l.data,s.dataNames=[...l.dataNames,b]}}$e.extendSubschemaData=i;function y(s,{jtdDiscriminator:l,jtdMetadata:d,compositeRule:f,createErrors:w,allErrors:$}){f!==void 0&&(s.compositeRule=f),w!==void 0&&(s.createErrors=w),$!==void 0&&(s.allErrors=$),s.jtdDiscriminator=l,s.jtdMetadata=d}return $e.extendSubschemaMode=y,$e}var ae={},Gt,Sr;function Nn(){return Sr||(Sr=1,Gt=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,y,s;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(y=i;y--!==0;)if(!e(t[y],n[y]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(n).length)return!1;for(y=i;y--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[y]))return!1;for(y=i;y--!==0;){var l=s[y];if(!e(t[l],n[l]))return!1}return!0}return t!==t&&n!==n}),Gt}var Wt={exports:{}},Er;function hs(){if(Er)return Wt.exports;Er=1;var e=Wt.exports=function(i,y,s){typeof y=="function"&&(s=y,y={}),s=y.cb||s;var l=typeof s=="function"?s:s.pre||function(){},d=s.post||function(){};t(y,l,d,i,"",i)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(i,y,s,l,d,f,w,$,E,_){if(l&&typeof l=="object"&&!Array.isArray(l)){y(l,d,f,w,$,E,_);for(var v in l){var b=l[v];if(Array.isArray(b)){if(v in e.arrayKeywords)for(var h=0;h<b.length;h++)t(i,y,s,b[h],d+"/"+v+"/"+h,f,d,v,l,h)}else if(v in e.propsKeywords){if(b&&typeof b=="object")for(var a in b)t(i,y,s,b[a],d+"/"+v+"/"+n(a),f,d,v,l,a)}else(v in e.keywords||i.allKeys&&!(v in e.skipKeywords))&&t(i,y,s,b,d+"/"+v,f,d,v,l)}s(l,d,f,w,$,E,_)}}function n(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}return Wt.exports}var kr;function Tt(){if(kr)return ae;kr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.getSchemaRefs=ae.resolveUrl=ae.normalizeId=ae._getFullPath=ae.getFullPath=ae.inlineRef=void 0;const e=Y(),t=Nn(),n=hs(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function y(h,a=!0){return typeof h=="boolean"?!0:a===!0?!l(h):a?d(h)<=a:!1}ae.inlineRef=y;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(h){for(const a in h){if(s.has(a))return!0;const u=h[a];if(Array.isArray(u)&&u.some(l)||typeof u=="object"&&l(u))return!0}return!1}function d(h){let a=0;for(const u in h){if(u==="$ref")return 1/0;if(a++,!i.has(u)&&(typeof h[u]=="object"&&(0,e.eachItem)(h[u],r=>a+=d(r)),a===1/0))return 1/0}return a}function f(h,a="",u){u!==!1&&(a=E(a));const r=h.parse(a);return w(h,r)}ae.getFullPath=f;function w(h,a){return h.serialize(a).split("#")[0]+"#"}ae._getFullPath=w;const $=/#\/?$/;function E(h){return h?h.replace($,""):""}ae.normalizeId=E;function _(h,a,u){return u=E(u),h.resolve(a,u)}ae.resolveUrl=_;const v=/^[a-z_][-a-z0-9._]*$/i;function b(h,a){if(typeof h=="boolean")return{};const{schemaId:u,uriResolver:r}=this.opts,c=E(h[u]||a),g={"":c},o=f(r,c,!1),m={},P=new Set;return n(h,{allKeys:!0},(z,C,V,F)=>{if(F===void 0)return;const L=o+C;let Q=g[F];typeof z[u]=="string"&&(Q=ie.call(this,z[u])),oe.call(this,z.$anchor),oe.call(this,z.$dynamicAnchor),g[C]=Q;function ie(X){const pe=this.opts.uriResolver.resolve;if(X=E(Q?pe(Q,X):X),P.has(X))throw T(X);P.add(X);let M=this.refs[X];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?O(z,M.schema,X):X!==E(L)&&(X[0]==="#"?(O(z,m[X],X),m[X]=z):this.refs[X]=L),X}function oe(X){if(typeof X=="string"){if(!v.test(X))throw new Error(`invalid anchor "${X}"`);ie.call(this,`#${X}`)}}}),m;function O(z,C,V){if(C!==void 0&&!t(z,C))throw T(V)}function T(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ae.getSchemaRefs=b,ae}var jr;function Mt(){if(jr)return ve;jr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.getData=ve.KeywordCxt=ve.validateFunctionCode=void 0;const e=ls(),t=kt(),n=On(),i=kt(),y=fs(),s=ps(),l=ms(),d=G(),f=Se(),w=Tt(),$=Y(),E=Dt();function _(k){if(o(k)&&(P(k),g(k))){a(k);return}v(k,()=>(0,e.topBoolOrEmptySchema)(k))}ve.validateFunctionCode=_;function v({gen:k,validateName:I,schema:q,schemaEnv:A,opts:K},W){K.code.es5?k.func(I,(0,d._)`${f.default.data}, ${f.default.valCxt}`,A.$async,()=>{k.code((0,d._)`"use strict"; ${r(q,K)}`),h(k,K),k.code(W)}):k.func(I,(0,d._)`${f.default.data}, ${b(K)}`,A.$async,()=>k.code(r(q,K)).code(W))}function b(k){return(0,d._)`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${k.dynamicRef?(0,d._)`, ${f.default.dynamicAnchors}={}`:d.nil}}={}`}function h(k,I){k.if(f.default.valCxt,()=>{k.var(f.default.instancePath,(0,d._)`${f.default.valCxt}.${f.default.instancePath}`),k.var(f.default.parentData,(0,d._)`${f.default.valCxt}.${f.default.parentData}`),k.var(f.default.parentDataProperty,(0,d._)`${f.default.valCxt}.${f.default.parentDataProperty}`),k.var(f.default.rootData,(0,d._)`${f.default.valCxt}.${f.default.rootData}`),I.dynamicRef&&k.var(f.default.dynamicAnchors,(0,d._)`${f.default.valCxt}.${f.default.dynamicAnchors}`)},()=>{k.var(f.default.instancePath,(0,d._)`""`),k.var(f.default.parentData,(0,d._)`undefined`),k.var(f.default.parentDataProperty,(0,d._)`undefined`),k.var(f.default.rootData,f.default.data),I.dynamicRef&&k.var(f.default.dynamicAnchors,(0,d._)`{}`)})}function a(k){const{schema:I,opts:q,gen:A}=k;v(k,()=>{q.$comment&&I.$comment&&F(k),z(k),A.let(f.default.vErrors,null),A.let(f.default.errors,0),q.unevaluated&&u(k),O(k),L(k)})}function u(k){const{gen:I,validateName:q}=k;k.evaluated=I.const("evaluated",(0,d._)`${q}.evaluated`),I.if((0,d._)`${k.evaluated}.dynamicProps`,()=>I.assign((0,d._)`${k.evaluated}.props`,(0,d._)`undefined`)),I.if((0,d._)`${k.evaluated}.dynamicItems`,()=>I.assign((0,d._)`${k.evaluated}.items`,(0,d._)`undefined`))}function r(k,I){const q=typeof k=="object"&&k[I.schemaId];return q&&(I.code.source||I.code.process)?(0,d._)`/*# sourceURL=${q} */`:d.nil}function c(k,I){if(o(k)&&(P(k),g(k))){m(k,I);return}(0,e.boolOrEmptySchema)(k,I)}function g({schema:k,self:I}){if(typeof k=="boolean")return!k;for(const q in k)if(I.RULES.all[q])return!0;return!1}function o(k){return typeof k.schema!="boolean"}function m(k,I){const{schema:q,gen:A,opts:K}=k;K.$comment&&q.$comment&&F(k),C(k),V(k);const W=A.const("_errs",f.default.errors);O(k,W),A.var(I,(0,d._)`${W} === ${f.default.errors}`)}function P(k){(0,$.checkUnknownRules)(k),T(k)}function O(k,I){if(k.opts.jtd)return ie(k,[],!1,I);const q=(0,t.getSchemaTypes)(k.schema),A=(0,t.coerceAndCheckDataType)(k,q);ie(k,q,!A,I)}function T(k){const{schema:I,errSchemaPath:q,opts:A,self:K}=k;I.$ref&&A.ignoreKeywordsWithRef&&(0,$.schemaHasRulesButRef)(I,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(k){const{schema:I,opts:q}=k;I.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,$.checkStrictMode)(k,"default is ignored in the schema root")}function C(k){const I=k.schema[k.opts.schemaId];I&&(k.baseId=(0,w.resolveUrl)(k.opts.uriResolver,k.baseId,I))}function V(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:k,schemaEnv:I,schema:q,errSchemaPath:A,opts:K}){const W=q.$comment;if(K.$comment===!0)k.code((0,d._)`${f.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const re=(0,d.str)`${A}/$comment`,me=k.scopeValue("root",{ref:I.root});k.code((0,d._)`${f.default.self}.opts.$comment(${W}, ${re}, ${me}.schema)`)}}function L(k){const{gen:I,schemaEnv:q,validateName:A,ValidationError:K,opts:W}=k;q.$async?I.if((0,d._)`${f.default.errors} === 0`,()=>I.return(f.default.data),()=>I.throw((0,d._)`new ${K}(${f.default.vErrors})`)):(I.assign((0,d._)`${A}.errors`,f.default.vErrors),W.unevaluated&&Q(k),I.return((0,d._)`${f.default.errors} === 0`))}function Q({gen:k,evaluated:I,props:q,items:A}){q instanceof d.Name&&k.assign((0,d._)`${I}.props`,q),A instanceof d.Name&&k.assign((0,d._)`${I}.items`,A)}function ie(k,I,q,A){const{gen:K,schema:W,data:re,allErrors:me,opts:ce,self:de}=k,{RULES:ne}=de;if(W.$ref&&(ce.ignoreKeywordsWithRef||!(0,$.schemaHasRulesButRef)(W,ne))){K.block(()=>U(k,"$ref",ne.all.$ref.definition));return}ce.jtd||X(k,I),K.block(()=>{for(const le of ne.rules)Ie(le);Ie(ne.post)});function Ie(le){(0,n.shouldUseGroup)(W,le)&&(le.type?(K.if((0,i.checkDataType)(le.type,re,ce.strictNumbers)),oe(k,le),I.length===1&&I[0]===le.type&&q&&(K.else(),(0,i.reportTypeError)(k)),K.endIf()):oe(k,le),me||K.if((0,d._)`${f.default.errors} === ${A||0}`))}}function oe(k,I){const{gen:q,schema:A,opts:{useDefaults:K}}=k;K&&(0,y.assignDefaults)(k,I.type),q.block(()=>{for(const W of I.rules)(0,n.shouldUseRule)(A,W)&&U(k,W.keyword,W.definition,I.type)})}function X(k,I){k.schemaEnv.meta||!k.opts.strictTypes||(pe(k,I),k.opts.allowUnionTypes||M(k,I),j(k,k.dataTypes))}function pe(k,I){if(I.length){if(!k.dataTypes.length){k.dataTypes=I;return}I.forEach(q=>{R(k.dataTypes,q)||S(k,`type "${q}" not allowed by context "${k.dataTypes.join(",")}"`)}),p(k,I)}}function M(k,I){I.length>1&&!(I.length===2&&I.includes("null"))&&S(k,"use allowUnionTypes to allow union type keyword")}function j(k,I){const q=k.self.RULES.all;for(const A in q){const K=q[A];if(typeof K=="object"&&(0,n.shouldUseRule)(k.schema,K)){const{type:W}=K.definition;W.length&&!W.some(re=>D(I,re))&&S(k,`missing type "${W.join(",")}" for keyword "${A}"`)}}}function D(k,I){return k.includes(I)||I==="number"&&k.includes("integer")}function R(k,I){return k.includes(I)||I==="integer"&&k.includes("number")}function p(k,I){const q=[];for(const A of k.dataTypes)R(I,A)?q.push(A):I.includes("integer")&&A==="number"&&q.push("integer");k.dataTypes=q}function S(k,I){const q=k.schemaEnv.baseId+k.errSchemaPath;I+=` at "${q}" (strictTypes)`,(0,$.checkStrictMode)(k,I,k.opts.strictTypes)}class N{constructor(I,q,A){if((0,s.validateKeywordUsage)(I,q,A),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=A,this.data=I.data,this.schema=I.schema[A],this.$data=q.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,$.schemaRefOrVal)(I,this.schema,A,this.$data),this.schemaType=q.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=q,this.$data)this.schemaCode=I.gen.const("vSchema",B(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=I.gen.const("_errs",f.default.errors))}result(I,q,A){this.failResult((0,d.not)(I),q,A)}failResult(I,q,A){this.gen.if(I),A?A():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(I,q){this.failResult((0,d.not)(I),void 0,q)}fail(I){if(I===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(I),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);const{schemaCode:q}=this;this.fail((0,d._)`${q} !== undefined && (${(0,d.or)(this.invalid$data(),I)})`)}error(I,q,A){if(q){this.setParams(q),this._error(I,A),this.setParams({});return}this._error(I,A)}_error(I,q){(I?E.reportExtraError:E.reportError)(this,this.def.error,q)}$dataError(){(0,E.reportError)(this,this.def.$dataError||E.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,E.resetErrorsCount)(this.gen,this.errsCount)}ok(I){this.allErrors||this.gen.if(I)}setParams(I,q){q?Object.assign(this.params,I):this.params=I}block$data(I,q,A=d.nil){this.gen.block(()=>{this.check$data(I,A),q()})}check$data(I=d.nil,q=d.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:W,def:re}=this;A.if((0,d.or)((0,d._)`${K} === undefined`,q)),I!==d.nil&&A.assign(I,!0),(W.length||re.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),I!==d.nil&&A.assign(I,!1)),A.else()}invalid$data(){const{gen:I,schemaCode:q,schemaType:A,def:K,it:W}=this;return(0,d.or)(re(),me());function re(){if(A.length){if(!(q instanceof d.Name))throw new Error("ajv implementation error");const ce=Array.isArray(A)?A:[A];return(0,d._)`${(0,i.checkDataTypes)(ce,q,W.opts.strictNumbers,i.DataType.Wrong)}`}return d.nil}function me(){if(K.validateSchema){const ce=I.scopeValue("validate$data",{ref:K.validateSchema});return(0,d._)`!${ce}(${q})`}return d.nil}}subschema(I,q){const A=(0,l.getSubschema)(this.it,I);(0,l.extendSubschemaData)(A,this.it,I),(0,l.extendSubschemaMode)(A,I);const K={...this.it,...A,items:void 0,props:void 0};return c(K,q),K}mergeEvaluated(I,q){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&I.props!==void 0&&(A.props=$.mergeEvaluated.props(K,I.props,A.props,q)),A.items!==!0&&I.items!==void 0&&(A.items=$.mergeEvaluated.items(K,I.items,A.items,q)))}mergeValidEvaluated(I,q){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(q,()=>this.mergeEvaluated(I,d.Name)),!0}}ve.KeywordCxt=N;function U(k,I,q,A){const K=new N(k,q,I);"code"in q?q.code(K,A):K.$data&&q.validate?(0,s.funcKeywordCode)(K,q):"macro"in q?(0,s.macroKeywordCode)(K,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(K,q)}const J=/^\/(?:[^~]|~0|~1)*$/,x=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(k,{dataLevel:I,dataNames:q,dataPathArr:A}){let K,W;if(k==="")return f.default.rootData;if(k[0]==="/"){if(!J.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);K=k,W=f.default.rootData}else{const de=x.exec(k);if(!de)throw new Error(`Invalid JSON-pointer: ${k}`);const ne=+de[1];if(K=de[2],K==="#"){if(ne>=I)throw new Error(ce("property/index",ne));return A[I-ne]}if(ne>I)throw new Error(ce("data",ne));if(W=q[I-ne],!K)return W}let re=W;const me=K.split("/");for(const de of me)de&&(W=(0,d._)`${W}${(0,d.getProperty)((0,$.unescapeJsonPointer)(de))}`,re=(0,d._)`${re} && ${W}`);return re;function ce(de,ne){return`Cannot access ${de} ${ne} levels up, current level is ${I}`}}return ve.getData=B,ve}var Le={},Ir;function er(){if(Ir)return Le;Ir=1,Object.defineProperty(Le,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Le.default=e,Le}var Ue={},Rr;function At(){if(Rr)return Ue;Rr=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e=Tt();class t extends Error{constructor(i,y,s,l){super(l||`can't resolve reference ${s} from id ${y}`),this.missingRef=(0,e.resolveUrl)(i,y,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(i,this.missingRef))}}return Ue.default=t,Ue}var ue={},Or;function tr(){if(Or)return ue;Or=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.resolveSchema=ue.getCompilingSchema=ue.resolveRef=ue.compileSchema=ue.SchemaEnv=void 0;const e=G(),t=er(),n=Se(),i=Tt(),y=Y(),s=Mt();class l{constructor(u){var r;this.refs={},this.dynamicAnchors={};let c;typeof u.schema=="object"&&(c=u.schema),this.schema=u.schema,this.schemaId=u.schemaId,this.root=u.root||this,this.baseId=(r=u.baseId)!==null&&r!==void 0?r:(0,i.normalizeId)(c?.[u.schemaId||"$id"]),this.schemaPath=u.schemaPath,this.localRefs=u.localRefs,this.meta=u.meta,this.$async=c?.$async,this.refs={}}}ue.SchemaEnv=l;function d(a){const u=$.call(this,a);if(u)return u;const r=(0,i.getFullPath)(this.opts.uriResolver,a.root.baseId),{es5:c,lines:g}=this.opts.code,{ownProperties:o}=this.opts,m=new e.CodeGen(this.scope,{es5:c,lines:g,ownProperties:o});let P;a.$async&&(P=m.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const O=m.scopeName("validate");a.validateName=O;const T={gen:m,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:m.scopeValue("schema",this.opts.code.source===!0?{ref:a.schema,code:(0,e.stringify)(a.schema)}:{ref:a.schema}),validateName:O,ValidationError:P,schema:a.schema,schemaEnv:a,rootId:r,baseId:a.baseId||r,schemaPath:e.nil,errSchemaPath:a.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(a),(0,s.validateFunctionCode)(T),m.optimize(this.opts.code.optimize);const C=m.toString();z=`${m.scopeRefs(n.default.scope)}return ${C}`,this.opts.code.process&&(z=this.opts.code.process(z,a));const F=new Function(`${n.default.self}`,`${n.default.scope}`,z)(this,this.scope.get());if(this.scope.value(O,{ref:F}),F.errors=null,F.schema=a.schema,F.schemaEnv=a,a.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:O,validateCode:C,scopeValues:m._values}),this.opts.unevaluated){const{props:L,items:Q}=T;F.evaluated={props:L instanceof e.Name?void 0:L,items:Q instanceof e.Name?void 0:Q,dynamicProps:L instanceof e.Name,dynamicItems:Q instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return a.validate=F,a}catch(C){throw delete a.validate,delete a.validateName,z&&this.logger.error("Error compiling schema, function code:",z),C}finally{this._compilations.delete(a)}}ue.compileSchema=d;function f(a,u,r){var c;r=(0,i.resolveUrl)(this.opts.uriResolver,u,r);const g=a.refs[r];if(g)return g;let o=_.call(this,a,r);if(o===void 0){const m=(c=a.localRefs)===null||c===void 0?void 0:c[r],{schemaId:P}=this.opts;m&&(o=new l({schema:m,schemaId:P,root:a,baseId:u}))}if(o!==void 0)return a.refs[r]=w.call(this,o)}ue.resolveRef=f;function w(a){return(0,i.inlineRef)(a.schema,this.opts.inlineRefs)?a.schema:a.validate?a:d.call(this,a)}function $(a){for(const u of this._compilations)if(E(u,a))return u}ue.getCompilingSchema=$;function E(a,u){return a.schema===u.schema&&a.root===u.root&&a.baseId===u.baseId}function _(a,u){let r;for(;typeof(r=this.refs[u])=="string";)u=r;return r||this.schemas[u]||v.call(this,a,u)}function v(a,u){const r=this.opts.uriResolver.parse(u),c=(0,i._getFullPath)(this.opts.uriResolver,r);let g=(0,i.getFullPath)(this.opts.uriResolver,a.baseId,void 0);if(Object.keys(a.schema).length>0&&c===g)return h.call(this,r,a);const o=(0,i.normalizeId)(c),m=this.refs[o]||this.schemas[o];if(typeof m=="string"){const P=v.call(this,a,m);return typeof P?.schema!="object"?void 0:h.call(this,r,P)}if(typeof m?.schema=="object"){if(m.validate||d.call(this,m),o===(0,i.normalizeId)(u)){const{schema:P}=m,{schemaId:O}=this.opts,T=P[O];return T&&(g=(0,i.resolveUrl)(this.opts.uriResolver,g,T)),new l({schema:P,schemaId:O,root:a,baseId:g})}return h.call(this,r,m)}}ue.resolveSchema=v;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(a,{baseId:u,schema:r,root:c}){var g;if(((g=a.fragment)===null||g===void 0?void 0:g[0])!=="/")return;for(const P of a.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const O=r[(0,y.unescapeFragment)(P)];if(O===void 0)return;r=O;const T=typeof r=="object"&&r[this.opts.schemaId];!b.has(P)&&T&&(u=(0,i.resolveUrl)(this.opts.uriResolver,u,T))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,y.schemaHasRulesButRef)(r,this.RULES)){const P=(0,i.resolveUrl)(this.opts.uriResolver,u,r.$ref);o=v.call(this,c,P)}const{schemaId:m}=this.opts;if(o=o||new l({schema:r,schemaId:m,root:c,baseId:u}),o.schema!==o.root.schema)return o}return ue}const ys="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",gs="Meta-schema for $data reference (JSON AnySchema extension proposal)",vs="object",_s=["$data"],$s={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},bs=!1,ws={$id:ys,description:gs,type:vs,required:_s,properties:$s,additionalProperties:bs};var Ke={},De={exports:{}},Bt,Nr;function Cn(){if(Nr)return Bt;Nr=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(_){let v="",b=0,h=0;for(h=0;h<_.length;h++)if(b=_[h].charCodeAt(0),b!==48){if(!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";v+=_[h];break}for(h+=1;h<_.length;h++){if(b=_[h].charCodeAt(0),!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";v+=_[h]}return v}const i=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y(_){return _.length=0,!0}function s(_,v,b){if(_.length){const h=n(_);if(h!=="")v.push(h);else return b.error=!0,!1;_.length=0}return!0}function l(_){let v=0;const b={error:!1,address:"",zone:""},h=[],a=[];let u=!1,r=!1,c=s;for(let g=0;g<_.length;g++){const o=_[g];if(!(o==="["||o==="]"))if(o===":"){if(u===!0&&(r=!0),!c(a,h,b))break;if(++v>7){b.error=!0;break}g>0&&_[g-1]===":"&&(u=!0),h.push(":");continue}else if(o==="%"){if(!c(a,h,b))break;c=y}else{a.push(o);continue}}return a.length&&(c===y?b.zone=a.join(""):r?h.push(a.join("")):h.push(n(a))),b.address=h.join(""),b}function d(_){if(f(_,":")<2)return{host:_,isIPV6:!1};const v=l(_);if(v.error)return{host:_,isIPV6:!1};{let b=v.address,h=v.address;return v.zone&&(b+="%"+v.zone,h+="%25"+v.zone),{host:b,isIPV6:!0,escapedHost:h}}}function f(_,v){let b=0;for(let h=0;h<_.length;h++)_[h]===v&&b++;return b}function w(_){let v=_;const b=[];let h=-1,a=0;for(;a=v.length;){if(a===1){if(v===".")break;if(v==="/"){b.push("/");break}else{b.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]==="/")){b.push("/");break}}else if(a===3&&v==="/.."){b.length!==0&&b.pop(),b.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),b.length!==0&&b.pop();continue}}if((h=v.indexOf("/",1))===-1){b.push(v);break}else b.push(v.slice(0,h)),v=v.slice(h)}return b.join("")}function $(_,v){const b=v!==!0?escape:unescape;return _.scheme!==void 0&&(_.scheme=b(_.scheme)),_.userinfo!==void 0&&(_.userinfo=b(_.userinfo)),_.host!==void 0&&(_.host=b(_.host)),_.path!==void 0&&(_.path=b(_.path)),_.query!==void 0&&(_.query=b(_.query)),_.fragment!==void 0&&(_.fragment=b(_.fragment)),_}function E(_){const v=[];if(_.userinfo!==void 0&&(v.push(_.userinfo),v.push("@")),_.host!==void 0){let b=unescape(_.host);if(!t(b)){const h=d(b);h.isIPV6===!0?b=`[${h.escapedHost}]`:b=_.host}v.push(b)}return(typeof _.port=="number"||typeof _.port=="string")&&(v.push(":"),v.push(String(_.port))),v.length?v.join(""):void 0}return Bt={nonSimpleDomain:i,recomposeAuthority:E,normalizeComponentEncoding:$,removeDotSegments:w,isIPv4:t,isUUID:e,normalizeIPv6:d,stringArrayToHexStripped:n},Bt}var Yt,Cr;function Ps(){if(Cr)return Yt;Cr=1;const{isUUID:e}=Cn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function i(o){return n.indexOf(o)!==-1}function y(o){return o.secure===!0?!0:o.secure===!1?!1:o.scheme?o.scheme.length===3&&(o.scheme[0]==="w"||o.scheme[0]==="W")&&(o.scheme[1]==="s"||o.scheme[1]==="S")&&(o.scheme[2]==="s"||o.scheme[2]==="S"):!1}function s(o){return o.host||(o.error=o.error||"HTTP URIs must have a host."),o}function l(o){const m=String(o.scheme).toLowerCase()==="https";return(o.port===(m?443:80)||o.port==="")&&(o.port=void 0),o.path||(o.path="/"),o}function d(o){return o.secure=y(o),o.resourceName=(o.path||"/")+(o.query?"?"+o.query:""),o.path=void 0,o.query=void 0,o}function f(o){if((o.port===(y(o)?443:80)||o.port==="")&&(o.port=void 0),typeof o.secure=="boolean"&&(o.scheme=o.secure?"wss":"ws",o.secure=void 0),o.resourceName){const[m,P]=o.resourceName.split("?");o.path=m&&m!=="/"?m:void 0,o.query=P,o.resourceName=void 0}return o.fragment=void 0,o}function w(o,m){if(!o.path)return o.error="URN can not be parsed",o;const P=o.path.match(t);if(P){const O=m.scheme||o.scheme||"urn";o.nid=P[1].toLowerCase(),o.nss=P[2];const T=`${O}:${m.nid||o.nid}`,z=g(T);o.path=void 0,z&&(o=z.parse(o,m))}else o.error=o.error||"URN can not be parsed.";return o}function $(o,m){if(o.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=m.scheme||o.scheme||"urn",O=o.nid.toLowerCase(),T=`${P}:${m.nid||O}`,z=g(T);z&&(o=z.serialize(o,m));const C=o,V=o.nss;return C.path=`${O||m.nid}:${V}`,m.skipEscape=!0,C}function E(o,m){const P=o;return P.uuid=P.nss,P.nss=void 0,!m.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function _(o){const m=o;return m.nss=(o.uuid||"").toLowerCase(),m}const v={scheme:"http",domainHost:!0,parse:s,serialize:l},b={scheme:"https",domainHost:v.domainHost,parse:s,serialize:l},h={scheme:"ws",domainHost:!0,parse:d,serialize:f},a={scheme:"wss",domainHost:h.domainHost,parse:h.parse,serialize:h.serialize},c={http:v,https:b,ws:h,wss:a,urn:{scheme:"urn",parse:w,serialize:$,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:E,serialize:_,skipNormalize:!0}};Object.setPrototypeOf(c,null);function g(o){return o&&(c[o]||c[o.toLowerCase()])||void 0}return Yt={wsIsSecure:y,SCHEMES:c,isValidSchemeName:i,getSchemeHandler:g},Yt}var qr;function Ss(){if(qr)return De.exports;qr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:i,isIPv4:y,nonSimpleDomain:s}=Cn(),{SCHEMES:l,getSchemeHandler:d}=Ps();function f(a,u){return typeof a=="string"?a=_(b(a,u),u):typeof a=="object"&&(a=b(_(a,u),u)),a}function w(a,u,r){const c=r?Object.assign({scheme:"null"},r):{scheme:"null"},g=$(b(a,c),b(u,c),c,!0);return c.skipEscape=!0,_(g,c)}function $(a,u,r,c){const g={};return c||(a=b(_(a,r),r),u=b(_(u,r),r)),r=r||{},!r.tolerant&&u.scheme?(g.scheme=u.scheme,g.userinfo=u.userinfo,g.host=u.host,g.port=u.port,g.path=t(u.path||""),g.query=u.query):(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0?(g.userinfo=u.userinfo,g.host=u.host,g.port=u.port,g.path=t(u.path||""),g.query=u.query):(u.path?(u.path[0]==="/"?g.path=t(u.path):((a.userinfo!==void 0||a.host!==void 0||a.port!==void 0)&&!a.path?g.path="/"+u.path:a.path?g.path=a.path.slice(0,a.path.lastIndexOf("/")+1)+u.path:g.path=u.path,g.path=t(g.path)),g.query=u.query):(g.path=a.path,u.query!==void 0?g.query=u.query:g.query=a.query),g.userinfo=a.userinfo,g.host=a.host,g.port=a.port),g.scheme=a.scheme),g.fragment=u.fragment,g}function E(a,u,r){return typeof a=="string"?(a=unescape(a),a=_(i(b(a,r),!0),{...r,skipEscape:!0})):typeof a=="object"&&(a=_(i(a,!0),{...r,skipEscape:!0})),typeof u=="string"?(u=unescape(u),u=_(i(b(u,r),!0),{...r,skipEscape:!0})):typeof u=="object"&&(u=_(i(u,!0),{...r,skipEscape:!0})),a.toLowerCase()===u.toLowerCase()}function _(a,u){const r={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:""},c=Object.assign({},u),g=[],o=d(c.scheme||r.scheme);o&&o.serialize&&o.serialize(r,c),r.path!==void 0&&(c.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),c.reference!=="suffix"&&r.scheme&&g.push(r.scheme,":");const m=n(r);if(m!==void 0&&(c.reference!=="suffix"&&g.push("//"),g.push(m),r.path&&r.path[0]!=="/"&&g.push("/")),r.path!==void 0){let P=r.path;!c.absolutePath&&(!o||!o.absolutePath)&&(P=t(P)),m===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),g.push(P)}return r.query!==void 0&&g.push("?",r.query),r.fragment!==void 0&&g.push("#",r.fragment),g.join("")}const v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(a,u){const r=Object.assign({},u),c={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let g=!1;r.reference==="suffix"&&(r.scheme?a=r.scheme+":"+a:a="//"+a);const o=a.match(v);if(o){if(c.scheme=o[1],c.userinfo=o[3],c.host=o[4],c.port=parseInt(o[5],10),c.path=o[6]||"",c.query=o[7],c.fragment=o[8],isNaN(c.port)&&(c.port=o[5]),c.host)if(y(c.host)===!1){const O=e(c.host);c.host=O.host.toLowerCase(),g=O.isIPV6}else g=!0;c.scheme===void 0&&c.userinfo===void 0&&c.host===void 0&&c.port===void 0&&c.query===void 0&&!c.path?c.reference="same-document":c.scheme===void 0?c.reference="relative":c.fragment===void 0?c.reference="absolute":c.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==c.reference&&(c.error=c.error||"URI is not a "+r.reference+" reference.");const m=d(r.scheme||c.scheme);if(!r.unicodeSupport&&(!m||!m.unicodeSupport)&&c.host&&(r.domainHost||m&&m.domainHost)&&g===!1&&s(c.host))try{c.host=URL.domainToASCII(c.host.toLowerCase())}catch(P){c.error=c.error||"Host's domain name can not be converted to ASCII: "+P}(!m||m&&!m.skipNormalize)&&(a.indexOf("%")!==-1&&(c.scheme!==void 0&&(c.scheme=unescape(c.scheme)),c.host!==void 0&&(c.host=unescape(c.host))),c.path&&(c.path=escape(unescape(c.path))),c.fragment&&(c.fragment=encodeURI(decodeURIComponent(c.fragment)))),m&&m.parse&&m.parse(c,r)}else c.error=c.error||"URI can not be parsed.";return c}const h={SCHEMES:l,normalize:f,resolve:w,resolveComponent:$,equal:E,serialize:_,parse:b};return De.exports=h,De.exports.default=h,De.exports.fastUri=h,De.exports}var Dr;function Es(){if(Dr)return Ke;Dr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=Ss();return e.code='require("ajv/dist/runtime/uri").default',Ke.default=e,Ke}var Tr;function ks(){return Tr||(Tr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Mt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=G();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const i=er(),y=At(),s=Rn(),l=tr(),d=G(),f=Tt(),w=kt(),$=Y(),E=ws,_=Es(),v=(M,j)=>new RegExp(M,j);v.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],h=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."},u={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},r=200;function c(M){var j,D,R,p,S,N,U,J,x,B,k,I,q,A,K,W,re,me,ce,de,ne,Ie,le,Vt,zt;const Ce=M.strict,Ft=(j=M.code)===null||j===void 0?void 0:j.optimize,ar=Ft===!0||Ft===void 0?1:Ft||0,cr=(R=(D=M.code)===null||D===void 0?void 0:D.regExp)!==null&&R!==void 0?R:v,us=(p=M.uriResolver)!==null&&p!==void 0?p:_.default;return{strictSchema:(N=(S=M.strictSchema)!==null&&S!==void 0?S:Ce)!==null&&N!==void 0?N:!0,strictNumbers:(J=(U=M.strictNumbers)!==null&&U!==void 0?U:Ce)!==null&&J!==void 0?J:!0,strictTypes:(B=(x=M.strictTypes)!==null&&x!==void 0?x:Ce)!==null&&B!==void 0?B:"log",strictTuples:(I=(k=M.strictTuples)!==null&&k!==void 0?k:Ce)!==null&&I!==void 0?I:"log",strictRequired:(A=(q=M.strictRequired)!==null&&q!==void 0?q:Ce)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:ar,regExp:cr}:{optimize:ar,regExp:cr},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:r,loopEnum:(W=M.loopEnum)!==null&&W!==void 0?W:r,meta:(re=M.meta)!==null&&re!==void 0?re:!0,messages:(me=M.messages)!==null&&me!==void 0?me:!0,inlineRefs:(ce=M.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(de=M.schemaId)!==null&&de!==void 0?de:"$id",addUsedSchema:(ne=M.addUsedSchema)!==null&&ne!==void 0?ne:!0,validateSchema:(Ie=M.validateSchema)!==null&&Ie!==void 0?Ie:!0,validateFormats:(le=M.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(Vt=M.unicodeRegExp)!==null&&Vt!==void 0?Vt:!0,int32range:(zt=M.int32range)!==null&&zt!==void 0?zt:!0,uriResolver:us}}class g{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...c(j)};const{es5:D,lines:R}=this.opts.code;this.scope=new d.ValueScope({scope:{},prefixes:h,es5:D,lines:R}),this.logger=V(j.logger);const p=j.validateFormats;j.validateFormats=!1,this.RULES=(0,s.getRules)(),o.call(this,a,j,"NOT SUPPORTED"),o.call(this,u,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&O.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&T.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),P.call(this),j.validateFormats=p}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:D,schemaId:R}=this.opts;let p=E;R==="id"&&(p={...E},p.id=p.$id,delete p.$id),D&&j&&this.addMetaSchema(p,p[R],!1)}defaultMeta(){const{meta:j,schemaId:D}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[D]||j:void 0}validate(j,D){let R;if(typeof j=="string"){if(R=this.getSchema(j),!R)throw new Error(`no schema with key or ref "${j}"`)}else R=this.compile(j);const p=R(D);return"$async"in R||(this.errors=R.errors),p}compile(j,D){const R=this._addSchema(j,D);return R.validate||this._compileSchemaEnv(R)}compileAsync(j,D){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:R}=this.opts;return p.call(this,j,D);async function p(B,k){await S.call(this,B.$schema);const I=this._addSchema(B,k);return I.validate||N.call(this,I)}async function S(B){B&&!this.getSchema(B)&&await p.call(this,{$ref:B},!0)}async function N(B){try{return this._compileSchemaEnv(B)}catch(k){if(!(k instanceof y.default))throw k;return U.call(this,k),await J.call(this,k.missingSchema),N.call(this,B)}}function U({missingSchema:B,missingRef:k}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${k} cannot be resolved`)}async function J(B){const k=await x.call(this,B);this.refs[B]||await S.call(this,k.$schema),this.refs[B]||this.addSchema(k,B,D)}async function x(B){const k=this._loading[B];if(k)return k;try{return await(this._loading[B]=R(B))}finally{delete this._loading[B]}}}addSchema(j,D,R,p=this.opts.validateSchema){if(Array.isArray(j)){for(const N of j)this.addSchema(N,void 0,R,p);return this}let S;if(typeof j=="object"){const{schemaId:N}=this.opts;if(S=j[N],S!==void 0&&typeof S!="string")throw new Error(`schema ${N} must be string`)}return D=(0,f.normalizeId)(D||S),this._checkUnique(D),this.schemas[D]=this._addSchema(j,R,D,p,!0),this}addMetaSchema(j,D,R=this.opts.validateSchema){return this.addSchema(j,D,!0,R),this}validateSchema(j,D){if(typeof j=="boolean")return!0;let R;if(R=j.$schema,R!==void 0&&typeof R!="string")throw new Error("$schema must be a string");if(R=R||this.opts.defaultMeta||this.defaultMeta(),!R)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const p=this.validate(R,j);if(!p&&D){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return p}getSchema(j){let D;for(;typeof(D=m.call(this,j))=="string";)j=D;if(D===void 0){const{schemaId:R}=this.opts,p=new l.SchemaEnv({schema:{},schemaId:R});if(D=l.resolveSchema.call(this,p,j),!D)return;this.refs[j]=D}return D.validate||this._compileSchemaEnv(D)}removeSchema(j){if(j instanceof RegExp)return this._removeAllSchemas(this.schemas,j),this._removeAllSchemas(this.refs,j),this;switch(typeof j){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const D=m.call(this,j);return typeof D=="object"&&this._cache.delete(D.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const D=j;this._cache.delete(D);let R=j[this.opts.schemaId];return R&&(R=(0,f.normalizeId)(R),delete this.schemas[R],delete this.refs[R]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const D of j)this.addKeyword(D);return this}addKeyword(j,D){let R;if(typeof j=="string")R=j,typeof D=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),D.keyword=R);else if(typeof j=="object"&&D===void 0){if(D=j,R=D.keyword,Array.isArray(R)&&!R.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,R,D),!D)return(0,$.eachItem)(R,S=>Q.call(this,S)),this;oe.call(this,D);const p={...D,type:(0,w.getJSONTypes)(D.type),schemaType:(0,w.getJSONTypes)(D.schemaType)};return(0,$.eachItem)(R,p.type.length===0?S=>Q.call(this,S,p):S=>p.type.forEach(N=>Q.call(this,S,p,N))),this}getKeyword(j){const D=this.RULES.all[j];return typeof D=="object"?D.definition:!!D}removeKeyword(j){const{RULES:D}=this;delete D.keywords[j],delete D.all[j];for(const R of D.rules){const p=R.rules.findIndex(S=>S.keyword===j);p>=0&&R.rules.splice(p,1)}return this}addFormat(j,D){return typeof D=="string"&&(D=new RegExp(D)),this.formats[j]=D,this}errorsText(j=this.errors,{separator:D=", ",dataVar:R="data"}={}){return!j||j.length===0?"No errors":j.map(p=>`${R}${p.instancePath} ${p.message}`).reduce((p,S)=>p+D+S)}$dataMetaSchema(j,D){const R=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const p of D){const S=p.split("/").slice(1);let N=j;for(const U of S)N=N[U];for(const U in R){const J=R[U];if(typeof J!="object")continue;const{$data:x}=J.definition,B=N[U];x&&B&&(N[U]=pe(B))}}return j}_removeAllSchemas(j,D){for(const R in j){const p=j[R];(!D||D.test(R))&&(typeof p=="string"?delete j[R]:p&&!p.meta&&(this._cache.delete(p.schema),delete j[R]))}}_addSchema(j,D,R,p=this.opts.validateSchema,S=this.opts.addUsedSchema){let N;const{schemaId:U}=this.opts;if(typeof j=="object")N=j[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let J=this._cache.get(j);if(J!==void 0)return J;R=(0,f.normalizeId)(N||R);const x=f.getSchemaRefs.call(this,j,R);return J=new l.SchemaEnv({schema:j,schemaId:U,meta:D,baseId:R,localRefs:x}),this._cache.set(J.schema,J),S&&!R.startsWith("#")&&(R&&this._checkUnique(R),this.refs[R]=J),p&&this.validateSchema(j,!0),J}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):l.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const D=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,j)}finally{this.opts=D}}}g.ValidationError=i.default,g.MissingRefError=y.default,e.default=g;function o(M,j,D,R="error"){for(const p in M){const S=p;S in j&&this.logger[R](`${D}: option ${p}. ${M[S]}`)}}function m(M){return M=(0,f.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const j in M)this.addSchema(M[j],j)}function O(){for(const M in this.opts.formats){const j=this.opts.formats[M];j&&this.addFormat(M,j)}}function T(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in M){const D=M[j];D.keyword||(D.keyword=j),this.addKeyword(D)}}function z(){const M={...this.opts};for(const j of b)delete M[j];return M}const C={log(){},warn(){},error(){}};function V(M){if(M===!1)return C;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function L(M,j){const{RULES:D}=this;if((0,$.eachItem)(M,R=>{if(D.keywords[R])throw new Error(`Keyword ${R} is already defined`);if(!F.test(R))throw new Error(`Keyword ${R} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function Q(M,j,D){var R;const p=j?.post;if(D&&p)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let N=p?S.post:S.rules.find(({type:J})=>J===D);if(N||(N={type:D,rules:[]},S.rules.push(N)),S.keywords[M]=!0,!j)return;const U={keyword:M,definition:{...j,type:(0,w.getJSONTypes)(j.type),schemaType:(0,w.getJSONTypes)(j.schemaType)}};j.before?ie.call(this,N,U,j.before):N.rules.push(U),S.all[M]=U,(R=j.implements)===null||R===void 0||R.forEach(J=>this.addKeyword(J))}function ie(M,j,D){const R=M.rules.findIndex(p=>p.keyword===D);R>=0?M.rules.splice(R,0,j):(M.rules.push(j),this.logger.warn(`rule ${D} is not defined`))}function oe(M){let{metaSchema:j}=M;j!==void 0&&(M.$data&&this.opts.$data&&(j=pe(j)),M.validateSchema=this.compile(j,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(M){return{anyOf:[M,X]}}})(Lt)),Lt}var Je={},He={},Ge={},Mr;function js(){if(Mr)return Ge;Mr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ge.default=e,Ge}var be={},Ar;function Is(){if(Ar)return be;Ar=1,Object.defineProperty(be,"__esModule",{value:!0}),be.callRef=be.getValidate=void 0;const e=At(),t=ge(),n=G(),i=Se(),y=tr(),s=Y(),l={keyword:"$ref",schemaType:"string",code(w){const{gen:$,schema:E,it:_}=w,{baseId:v,schemaEnv:b,validateName:h,opts:a,self:u}=_,{root:r}=b;if((E==="#"||E==="#/")&&v===r.baseId)return g();const c=y.resolveRef.call(u,r,v,E);if(c===void 0)throw new e.default(_.opts.uriResolver,v,E);if(c instanceof y.SchemaEnv)return o(c);return m(c);function g(){if(b===r)return f(w,h,b,b.$async);const P=$.scopeValue("root",{ref:r});return f(w,(0,n._)`${P}.validate`,r,r.$async)}function o(P){const O=d(w,P);f(w,O,P,P.$async)}function m(P){const O=$.scopeValue("schema",a.code.source===!0?{ref:P,code:(0,n.stringify)(P)}:{ref:P}),T=$.name("valid"),z=w.subschema({schema:P,dataTypes:[],schemaPath:n.nil,topSchemaRef:O,errSchemaPath:E},T);w.mergeEvaluated(z),w.ok(T)}}};function d(w,$){const{gen:E}=w;return $.validate?E.scopeValue("validate",{ref:$.validate}):(0,n._)`${E.scopeValue("wrapper",{ref:$})}.validate`}be.getValidate=d;function f(w,$,E,_){const{gen:v,it:b}=w,{allErrors:h,schemaEnv:a,opts:u}=b,r=u.passContext?i.default.this:n.nil;_?c():g();function c(){if(!a.$async)throw new Error("async schema referenced by sync schema");const P=v.let("valid");v.try(()=>{v.code((0,n._)`await ${(0,t.callValidateCode)(w,$,r)}`),m($),h||v.assign(P,!0)},O=>{v.if((0,n._)`!(${O} instanceof ${b.ValidationError})`,()=>v.throw(O)),o(O),h||v.assign(P,!1)}),w.ok(P)}function g(){w.result((0,t.callValidateCode)(w,$,r),()=>m($),()=>o($))}function o(P){const O=(0,n._)`${P}.errors`;v.assign(i.default.vErrors,(0,n._)`${i.default.vErrors} === null ? ${O} : ${i.default.vErrors}.concat(${O})`),v.assign(i.default.errors,(0,n._)`${i.default.vErrors}.length`)}function m(P){var O;if(!b.opts.unevaluated)return;const T=(O=E?.validate)===null||O===void 0?void 0:O.evaluated;if(b.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(b.props=s.mergeEvaluated.props(v,T.props,b.props));else{const z=v.var("props",(0,n._)`${P}.evaluated.props`);b.props=s.mergeEvaluated.props(v,z,b.props,n.Name)}if(b.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(b.items=s.mergeEvaluated.items(v,T.items,b.items));else{const z=v.var("items",(0,n._)`${P}.evaluated.items`);b.items=s.mergeEvaluated.items(v,z,b.items,n.Name)}}}return be.callRef=f,be.default=l,be}var Vr;function Rs(){if(Vr)return He;Vr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=js(),t=Is(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return He.default=n,He}var We={},Be={},zr;function Os(){if(zr)return Be;zr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=G(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},i={message:({keyword:s,schemaCode:l})=>(0,e.str)`must be ${n[s].okStr} ${l}`,params:({keyword:s,schemaCode:l})=>(0,e._)`{comparison: ${n[s].okStr}, limit: ${l}}`},y={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:i,code(s){const{keyword:l,data:d,schemaCode:f}=s;s.fail$data((0,e._)`${d} ${n[l].fail} ${f} || isNaN(${d})`)}};return Be.default=y,Be}var Ye={},Fr;function Ns(){if(Fr)return Ye;Fr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=G(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:i})=>(0,e.str)`must be multiple of ${i}`,params:({schemaCode:i})=>(0,e._)`{multipleOf: ${i}}`},code(i){const{gen:y,data:s,schemaCode:l,it:d}=i,f=d.opts.multipleOfPrecision,w=y.let("res"),$=f?(0,e._)`Math.abs(Math.round(${w}) - ${w}) > 1e-${f}`:(0,e._)`${w} !== parseInt(${w})`;i.fail$data((0,e._)`(${l} === 0 || (${w} = ${s}/${l}, ${$}))`)}};return Ye.default=n,Ye}var xe={},Qe={},Lr;function Cs(){if(Lr)return Qe;Lr=1,Object.defineProperty(Qe,"__esModule",{value:!0});function e(t){const n=t.length;let i=0,y=0,s;for(;y<n;)i++,s=t.charCodeAt(y++),s>=55296&&s<=56319&&y<n&&(s=t.charCodeAt(y),(s&64512)===56320&&y++);return i}return Qe.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Qe}var Ur;function qs(){if(Ur)return xe;Ur=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=G(),t=Y(),n=Cs(),y={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:l}){const d=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${d} than ${l} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:l,data:d,schemaCode:f,it:w}=s,$=l==="maxLength"?e.operators.GT:e.operators.LT,E=w.opts.unicode===!1?(0,e._)`${d}.length`:(0,e._)`${(0,t.useFunc)(s.gen,n.default)}(${d})`;s.fail$data((0,e._)`${E} ${$} ${f}`)}};return xe.default=y,xe}var Ze={},Kr;function Ds(){if(Kr)return Ze;Kr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=ge(),t=G(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:y})=>(0,t.str)`must match pattern "${y}"`,params:({schemaCode:y})=>(0,t._)`{pattern: ${y}}`},code(y){const{data:s,$data:l,schema:d,schemaCode:f,it:w}=y,$=w.opts.unicodeRegExp?"u":"",E=l?(0,t._)`(new RegExp(${f}, ${$}))`:(0,e.usePattern)(y,d);y.fail$data((0,t._)`!${E}.test(${s})`)}};return Ze.default=i,Ze}var Xe={},Jr;function Ts(){if(Jr)return Xe;Jr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=G(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:y}){const s=i==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${y} properties`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:y,data:s,schemaCode:l}=i,d=y==="maxProperties"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`Object.keys(${s}).length ${d} ${l}`)}};return Xe.default=n,Xe}var et={},Hr;function Ms(){if(Hr)return et;Hr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=ge(),t=G(),n=Y(),y={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:l,schema:d,schemaCode:f,data:w,$data:$,it:E}=s,{opts:_}=E;if(!$&&d.length===0)return;const v=d.length>=_.loopRequired;if(E.allErrors?b():h(),_.strictRequired){const r=s.parentSchema.properties,{definedProperties:c}=s.it;for(const g of d)if(r?.[g]===void 0&&!c.has(g)){const o=E.schemaEnv.baseId+E.errSchemaPath,m=`required property "${g}" is not defined at "${o}" (strictRequired)`;(0,n.checkStrictMode)(E,m,E.opts.strictRequired)}}function b(){if(v||$)s.block$data(t.nil,a);else for(const r of d)(0,e.checkReportMissingProp)(s,r)}function h(){const r=l.let("missing");if(v||$){const c=l.let("valid",!0);s.block$data(c,()=>u(r,c)),s.ok(c)}else l.if((0,e.checkMissingProp)(s,d,r)),(0,e.reportMissingProp)(s,r),l.else()}function a(){l.forOf("prop",f,r=>{s.setParams({missingProperty:r}),l.if((0,e.noPropertyInData)(l,w,r,_.ownProperties),()=>s.error())})}function u(r,c){s.setParams({missingProperty:r}),l.forOf(r,f,()=>{l.assign(c,(0,e.propertyInData)(l,w,r,_.ownProperties)),l.if((0,t.not)(c),()=>{s.error(),l.break()})},t.nil)}}};return et.default=y,et}var tt={},Gr;function As(){if(Gr)return tt;Gr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=G(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:y}){const s=i==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${y} items`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:y,data:s,schemaCode:l}=i,d=y==="maxItems"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`${s}.length ${d} ${l}`)}};return tt.default=n,tt}var rt={},nt={},Wr;function rr(){if(Wr)return nt;Wr=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=Nn();return e.code='require("ajv/dist/runtime/equal").default',nt.default=e,nt}var Br;function Vs(){if(Br)return rt;Br=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=kt(),t=G(),n=Y(),i=rr(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:l,j:d}})=>(0,t.str)`must NOT have duplicate items (items ## ${d} and ${l} are identical)`,params:({params:{i:l,j:d}})=>(0,t._)`{i: ${l}, j: ${d}}`},code(l){const{gen:d,data:f,$data:w,schema:$,parentSchema:E,schemaCode:_,it:v}=l;if(!w&&!$)return;const b=d.let("valid"),h=E.items?(0,e.getSchemaTypes)(E.items):[];l.block$data(b,a,(0,t._)`${_} === false`),l.ok(b);function a(){const g=d.let("i",(0,t._)`${f}.length`),o=d.let("j");l.setParams({i:g,j:o}),d.assign(b,!0),d.if((0,t._)`${g} > 1`,()=>(u()?r:c)(g,o))}function u(){return h.length>0&&!h.some(g=>g==="object"||g==="array")}function r(g,o){const m=d.name("item"),P=(0,e.checkDataTypes)(h,m,v.opts.strictNumbers,e.DataType.Wrong),O=d.const("indices",(0,t._)`{}`);d.for((0,t._)`;${g}--;`,()=>{d.let(m,(0,t._)`${f}[${g}]`),d.if(P,(0,t._)`continue`),h.length>1&&d.if((0,t._)`typeof ${m} == "string"`,(0,t._)`${m} += "_"`),d.if((0,t._)`typeof ${O}[${m}] == "number"`,()=>{d.assign(o,(0,t._)`${O}[${m}]`),l.error(),d.assign(b,!1).break()}).code((0,t._)`${O}[${m}] = ${g}`)})}function c(g,o){const m=(0,n.useFunc)(d,i.default),P=d.name("outer");d.label(P).for((0,t._)`;${g}--;`,()=>d.for((0,t._)`${o} = ${g}; ${o}--;`,()=>d.if((0,t._)`${m}(${f}[${g}], ${f}[${o}])`,()=>{l.error(),d.assign(b,!1).break(P)})))}}};return rt.default=s,rt}var st={},Yr;function zs(){if(Yr)return st;Yr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=G(),t=Y(),n=rr(),y={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:l,data:d,$data:f,schemaCode:w,schema:$}=s;f||$&&typeof $=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(l,n.default)}(${d}, ${w})`):s.fail((0,e._)`${$} !== ${d}`)}};return st.default=y,st}var it={},xr;function Fs(){if(xr)return it;xr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=G(),t=Y(),n=rr(),y={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:l,data:d,$data:f,schema:w,schemaCode:$,it:E}=s;if(!f&&w.length===0)throw new Error("enum must have non-empty array");const _=w.length>=E.opts.loopEnum;let v;const b=()=>v??(v=(0,t.useFunc)(l,n.default));let h;if(_||f)h=l.let("valid"),s.block$data(h,a);else{if(!Array.isArray(w))throw new Error("ajv implementation error");const r=l.const("vSchema",$);h=(0,e.or)(...w.map((c,g)=>u(r,g)))}s.pass(h);function a(){l.assign(h,!1),l.forOf("v",$,r=>l.if((0,e._)`${b()}(${d}, ${r})`,()=>l.assign(h,!0).break()))}function u(r,c){const g=w[c];return typeof g=="object"&&g!==null?(0,e._)`${b()}(${d}, ${r}[${c}])`:(0,e._)`${d} === ${g}`}}};return it.default=y,it}var Qr;function Ls(){if(Qr)return We;Qr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=Os(),t=Ns(),n=qs(),i=Ds(),y=Ts(),s=Ms(),l=As(),d=Vs(),f=zs(),w=Fs(),$=[e.default,t.default,n.default,i.default,y.default,s.default,l.default,d.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,w.default];return We.default=$,We}var ot={},Re={},Zr;function qn(){if(Zr)return Re;Zr=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.validateAdditionalItems=void 0;const e=G(),t=Y(),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:l,it:d}=s,{items:f}=l;if(!Array.isArray(f)){(0,t.checkStrictMode)(d,'"additionalItems" is ignored when "items" is not an array of schemas');return}y(s,f)}};function y(s,l){const{gen:d,schema:f,data:w,keyword:$,it:E}=s;E.items=!0;const _=d.const("len",(0,e._)`${w}.length`);if(f===!1)s.setParams({len:l.length}),s.pass((0,e._)`${_} <= ${l.length}`);else if(typeof f=="object"&&!(0,t.alwaysValidSchema)(E,f)){const b=d.var("valid",(0,e._)`${_} <= ${l.length}`);d.if((0,e.not)(b),()=>v(b)),s.ok(b)}function v(b){d.forRange("i",l.length,_,h=>{s.subschema({keyword:$,dataProp:h,dataPropType:t.Type.Num},b),E.allErrors||d.if((0,e.not)(b),()=>d.break())})}}return Re.validateAdditionalItems=y,Re.default=i,Re}var at={},Oe={},Xr;function Dn(){if(Xr)return Oe;Xr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.validateTuple=void 0;const e=G(),t=Y(),n=ge(),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:l,it:d}=s;if(Array.isArray(l))return y(s,"additionalItems",l);d.items=!0,!(0,t.alwaysValidSchema)(d,l)&&s.ok((0,n.validateArray)(s))}};function y(s,l,d=s.schema){const{gen:f,parentSchema:w,data:$,keyword:E,it:_}=s;h(w),_.opts.unevaluated&&d.length&&_.items!==!0&&(_.items=t.mergeEvaluated.items(f,d.length,_.items));const v=f.name("valid"),b=f.const("len",(0,e._)`${$}.length`);d.forEach((a,u)=>{(0,t.alwaysValidSchema)(_,a)||(f.if((0,e._)`${b} > ${u}`,()=>s.subschema({keyword:E,schemaProp:u,dataProp:u},v)),s.ok(v))});function h(a){const{opts:u,errSchemaPath:r}=_,c=d.length,g=c===a.minItems&&(c===a.maxItems||a[l]===!1);if(u.strictTuples&&!g){const o=`"${E}" is ${c}-tuple, but minItems or maxItems/${l} are not specified or different at path "${r}"`;(0,t.checkStrictMode)(_,o,u.strictTuples)}}}return Oe.validateTuple=y,Oe.default=i,Oe}var en;function Us(){if(en)return at;en=1,Object.defineProperty(at,"__esModule",{value:!0});const e=Dn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return at.default=t,at}var ct={},tn;function Ks(){if(tn)return ct;tn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=G(),t=Y(),n=ge(),i=qn(),s={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:d,parentSchema:f,it:w}=l,{prefixItems:$}=f;w.items=!0,!(0,t.alwaysValidSchema)(w,d)&&($?(0,i.validateAdditionalItems)(l,$):l.ok((0,n.validateArray)(l)))}};return ct.default=s,ct}var dt={},rn;function Js(){if(rn)return dt;rn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=G(),t=Y(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:y,max:s}})=>s===void 0?(0,e.str)`must contain at least ${y} valid item(s)`:(0,e.str)`must contain at least ${y} and no more than ${s} valid item(s)`,params:({params:{min:y,max:s}})=>s===void 0?(0,e._)`{minContains: ${y}}`:(0,e._)`{minContains: ${y}, maxContains: ${s}}`},code(y){const{gen:s,schema:l,parentSchema:d,data:f,it:w}=y;let $,E;const{minContains:_,maxContains:v}=d;w.opts.next?($=_===void 0?1:_,E=v):$=1;const b=s.const("len",(0,e._)`${f}.length`);if(y.setParams({min:$,max:E}),E===void 0&&$===0){(0,t.checkStrictMode)(w,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(E!==void 0&&$>E){(0,t.checkStrictMode)(w,'"minContains" > "maxContains" is always invalid'),y.fail();return}if((0,t.alwaysValidSchema)(w,l)){let c=(0,e._)`${b} >= ${$}`;E!==void 0&&(c=(0,e._)`${c} && ${b} <= ${E}`),y.pass(c);return}w.items=!0;const h=s.name("valid");E===void 0&&$===1?u(h,()=>s.if(h,()=>s.break())):$===0?(s.let(h,!0),E!==void 0&&s.if((0,e._)`${f}.length > 0`,a)):(s.let(h,!1),a()),y.result(h,()=>y.reset());function a(){const c=s.name("_valid"),g=s.let("count",0);u(c,()=>s.if(c,()=>r(g)))}function u(c,g){s.forRange("i",0,b,o=>{y.subschema({keyword:"contains",dataProp:o,dataPropType:t.Type.Num,compositeRule:!0},c),g()})}function r(c){s.code((0,e._)`${c}++`),E===void 0?s.if((0,e._)`${c} >= ${$}`,()=>s.assign(h,!0).break()):(s.if((0,e._)`${c} > ${E}`,()=>s.assign(h,!1).break()),$===1?s.assign(h,!0):s.if((0,e._)`${c} >= ${$}`,()=>s.assign(h,!0)))}}};return dt.default=i,dt}var xt={},nn;function Hs(){return nn||(nn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=G(),n=Y(),i=ge();e.error={message:({params:{property:f,depsCount:w,deps:$}})=>{const E=w===1?"property":"properties";return(0,t.str)`must have ${E} ${$} when property ${f} is present`},params:({params:{property:f,depsCount:w,deps:$,missingProperty:E}})=>(0,t._)`{property: ${f},
6
6
  missingProperty: ${E},
7
- depsCount: ${$},
8
- deps: ${g}}`};const h={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(f){const[$,g]=n(f);u(f,$),i(f,g)}};function n({schema:f}){const $={},g={};for(const E in f){if(E==="__proto__")continue;const v=Array.isArray(f[E])?$:g;v[E]=f[E]}return[$,g]}function u(f,$=f.schema){const{gen:g,data:E,it:v}=f;if(Object.keys($).length===0)return;const _=g.let("missing");for(const b in $){const w=$[b];if(w.length===0)continue;const d=(0,o.propertyInData)(g,E,b,v.opts.ownProperties);f.setParams({property:b,depsCount:w.length,deps:w.join(", ")}),v.allErrors?g.if(d,()=>{for(const l of w)(0,o.checkReportMissingProp)(f,l)}):(g.if((0,t._)`${d} && (${(0,o.checkMissingProp)(f,w,_)})`),(0,o.reportMissingProp)(f,_),g.else())}}e.validatePropertyDeps=u;function i(f,$=f.schema){const{gen:g,data:E,keyword:v,it:_}=f,b=g.name("valid");for(const w in $)(0,r.alwaysValidSchema)(_,$[w])||(g.if((0,o.propertyInData)(g,E,w,_.opts.ownProperties),()=>{const d=f.subschema({keyword:v,schemaProp:w},b);f.mergeValidEvaluated(d,b)},()=>g.var(b,!0)),f.ok(b))}e.validateSchemaDeps=i,e.default=h})(Bt)),Bt}var at={},tn;function Ks(){if(tn)return at;tn=1,Object.defineProperty(at,"__esModule",{value:!0});const e=G(),t=Y(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:h})=>(0,e._)`{propertyName: ${h.propertyName}}`},code(h){const{gen:n,schema:u,data:i,it:f}=h;if((0,t.alwaysValidSchema)(f,u))return;const $=n.name("valid");n.forIn("key",i,g=>{h.setParams({propertyName:g}),h.subschema({keyword:"propertyNames",data:g,dataTypes:["string"],propertyName:g,compositeRule:!0},$),n.if((0,e.not)($),()=>{h.error(!0),f.allErrors||n.break()})}),h.ok($)}};return at.default=o,at}var ct={},rn;function Nn(){if(rn)return ct;rn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=ye(),t=G(),r=we(),o=Y(),n={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:u})=>(0,t._)`{additionalProperty: ${u.additionalProperty}}`},code(u){const{gen:i,schema:f,parentSchema:$,data:g,errsCount:E,it:v}=u;if(!E)throw new Error("ajv implementation error");const{allErrors:_,opts:b}=v;if(v.props=!0,b.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(v,f))return;const w=(0,e.allSchemaProperties)($.properties),d=(0,e.allSchemaProperties)($.patternProperties);l(),u.ok((0,t._)`${E} === ${r.default.errors}`);function l(){i.forIn("key",g,m=>{!w.length&&!d.length?y(m):i.if(s(m),()=>y(m))})}function s(m){let P;if(w.length>8){const R=(0,o.schemaRefOrVal)(v,$.properties,"properties");P=(0,e.isOwnProperty)(i,R,m)}else w.length?P=(0,t.or)(...w.map(R=>(0,t._)`${m} === ${R}`)):P=t.nil;return d.length&&(P=(0,t.or)(P,...d.map(R=>(0,t._)`${(0,e.usePattern)(u,R)}.test(${m})`))),(0,t.not)(P)}function c(m){i.code((0,t._)`delete ${g}[${m}]`)}function y(m){if(b.removeAdditional==="all"||b.removeAdditional&&f===!1){c(m);return}if(f===!1){u.setParams({additionalProperty:m}),u.error(),_||i.break();return}if(typeof f=="object"&&!(0,o.alwaysValidSchema)(v,f)){const P=i.name("valid");b.removeAdditional==="failing"?(a(m,P,!1),i.if((0,t.not)(P),()=>{u.reset(),c(m)})):(a(m,P),_||i.if((0,t.not)(P),()=>i.break()))}}function a(m,P,R){const T={keyword:"additionalProperties",dataProp:m,dataPropType:o.Type.Str};R===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),u.subschema(T,P)}}};return ct.default=n,ct}var dt={},nn;function Js(){if(nn)return dt;nn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=qt(),t=ye(),r=Y(),o=Nn(),h={keyword:"properties",type:"object",schemaType:"object",code(n){const{gen:u,schema:i,parentSchema:f,data:$,it:g}=n;g.opts.removeAdditional==="all"&&f.additionalProperties===void 0&&o.default.code(new e.KeywordCxt(g,o.default,"additionalProperties"));const E=(0,t.allSchemaProperties)(i);for(const d of E)g.definedProperties.add(d);g.opts.unevaluated&&E.length&&g.props!==!0&&(g.props=r.mergeEvaluated.props(u,(0,r.toHash)(E),g.props));const v=E.filter(d=>!(0,r.alwaysValidSchema)(g,i[d]));if(v.length===0)return;const _=u.name("valid");for(const d of v)b(d)?w(d):(u.if((0,t.propertyInData)(u,$,d,g.opts.ownProperties)),w(d),g.allErrors||u.else().var(_,!0),u.endIf()),n.it.definedProperties.add(d),n.ok(_);function b(d){return g.opts.useDefaults&&!g.compositeRule&&i[d].default!==void 0}function w(d){n.subschema({keyword:"properties",schemaProp:d,dataProp:d},_)}}};return dt.default=h,dt}var ut={},sn;function Hs(){if(sn)return ut;sn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=ye(),t=G(),r=Y(),o=Y(),h={keyword:"patternProperties",type:"object",schemaType:"object",code(n){const{gen:u,schema:i,data:f,parentSchema:$,it:g}=n,{opts:E}=g,v=(0,e.allSchemaProperties)(i),_=v.filter(y=>(0,r.alwaysValidSchema)(g,i[y]));if(v.length===0||_.length===v.length&&(!g.opts.unevaluated||g.props===!0))return;const b=E.strictSchema&&!E.allowMatchingProperties&&$.properties,w=u.name("valid");g.props!==!0&&!(g.props instanceof t.Name)&&(g.props=(0,o.evaluatedPropsToName)(u,g.props));const{props:d}=g;l();function l(){for(const y of v)b&&s(y),g.allErrors?c(y):(u.var(w,!0),c(y),u.if(w))}function s(y){for(const a in b)new RegExp(y).test(a)&&(0,r.checkStrictMode)(g,`property ${a} matches pattern ${y} (use allowMatchingProperties)`)}function c(y){u.forIn("key",f,a=>{u.if((0,t._)`${(0,e.usePattern)(n,y)}.test(${a})`,()=>{const m=_.includes(y);m||n.subschema({keyword:"patternProperties",schemaProp:y,dataProp:a,dataPropType:o.Type.Str},w),g.opts.unevaluated&&d!==!0?u.assign((0,t._)`${d}[${a}]`,!0):!m&&!g.allErrors&&u.if((0,t.not)(w),()=>u.break())})})}}};return ut.default=h,ut}var lt={},on;function Gs(){if(on)return lt;on=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:o,schema:h,it:n}=r;if((0,e.alwaysValidSchema)(n,h)){r.fail();return}const u=o.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},u),r.failResult(u,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return lt.default=t,lt}var ft={},an;function Ws(){if(an)return ft;an=1,Object.defineProperty(ft,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ye().validateUnion,error:{message:"must match a schema in anyOf"}};return ft.default=t,ft}var pt={},cn;function Bs(){if(cn)return pt;cn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=G(),t=Y(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:h})=>(0,e._)`{passingSchemas: ${h.passing}}`},code(h){const{gen:n,schema:u,parentSchema:i,it:f}=h;if(!Array.isArray(u))throw new Error("ajv implementation error");if(f.opts.discriminator&&i.discriminator)return;const $=u,g=n.let("valid",!1),E=n.let("passing",null),v=n.name("_valid");h.setParams({passing:E}),n.block(_),h.result(g,()=>h.reset(),()=>h.error(!0));function _(){$.forEach((b,w)=>{let d;(0,t.alwaysValidSchema)(f,b)?n.var(v,!0):d=h.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},v),w>0&&n.if((0,e._)`${v} && ${g}`).assign(g,!1).assign(E,(0,e._)`[${E}, ${w}]`).else(),n.if(v,()=>{n.assign(g,!0),n.assign(E,w),d&&h.mergeEvaluated(d,e.Name)})})}}};return pt.default=o,pt}var mt={},dn;function Ys(){if(dn)return mt;dn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:o,schema:h,it:n}=r;if(!Array.isArray(h))throw new Error("ajv implementation error");const u=o.name("valid");h.forEach((i,f)=>{if((0,e.alwaysValidSchema)(n,i))return;const $=r.subschema({keyword:"allOf",schemaProp:f},u);r.ok(u),r.mergeEvaluated($)})}};return mt.default=t,mt}var ht={},un;function Zs(){if(un)return ht;un=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=G(),t=Y(),o={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:u,parentSchema:i,it:f}=n;i.then===void 0&&i.else===void 0&&(0,t.checkStrictMode)(f,'"if" without "then" and "else" is ignored');const $=h(f,"then"),g=h(f,"else");if(!$&&!g)return;const E=u.let("valid",!0),v=u.name("_valid");if(_(),n.reset(),$&&g){const w=u.let("ifClause");n.setParams({ifClause:w}),u.if(v,b("then",w),b("else",w))}else $?u.if(v,b("then")):u.if((0,e.not)(v),b("else"));n.pass(E,()=>n.error(!0));function _(){const w=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);n.mergeEvaluated(w)}function b(w,d){return()=>{const l=n.subschema({keyword:w},v);u.assign(E,v),n.mergeValidEvaluated(l,E),d?u.assign(d,(0,e._)`${w}`):n.setParams({ifClause:w})}}}};function h(n,u){const i=n.schema[u];return i!==void 0&&!(0,t.alwaysValidSchema)(n,i)}return ht.default=o,ht}var yt={},ln;function Qs(){if(ln)return yt;ln=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:o,it:h}){o.if===void 0&&(0,e.checkStrictMode)(h,`"${r}" without "if" is ignored`)}};return yt.default=t,yt}var fn;function Xs(){if(fn)return nt;fn=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=Rn(),t=zs(),r=Cn(),o=Fs(),h=Ls(),n=Us(),u=Ks(),i=Nn(),f=Js(),$=Hs(),g=Gs(),E=Ws(),v=Bs(),_=Ys(),b=Zs(),w=Qs();function d(l=!1){const s=[g.default,E.default,v.default,_.default,b.default,w.default,u.default,i.default,n.default,f.default,$.default];return l?s.push(t.default,o.default):s.push(e.default,r.default),s.push(h.default),s}return nt.default=d,nt}var gt={},vt={},pn;function xs(){if(pn)return vt;pn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=G(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,e.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,e._)`{format: ${o}}`},code(o,h){const{gen:n,data:u,$data:i,schema:f,schemaCode:$,it:g}=o,{opts:E,errSchemaPath:v,schemaEnv:_,self:b}=g;if(!E.validateFormats)return;i?w():d();function w(){const l=n.scopeValue("formats",{ref:b.formats,code:E.code.formats}),s=n.const("fDef",(0,e._)`${l}[${$}]`),c=n.let("fType"),y=n.let("format");n.if((0,e._)`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>n.assign(c,(0,e._)`${s}.type || "string"`).assign(y,(0,e._)`${s}.validate`),()=>n.assign(c,(0,e._)`"string"`).assign(y,s)),o.fail$data((0,e.or)(a(),m()));function a(){return E.strictSchema===!1?e.nil:(0,e._)`${$} && !${y}`}function m(){const P=_.$async?(0,e._)`(${s}.async ? await ${y}(${u}) : ${y}(${u}))`:(0,e._)`${y}(${u})`,R=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${u}))`;return(0,e._)`${y} && ${y} !== true && ${c} === ${h} && !${R}`}}function d(){const l=b.formats[f];if(!l){a();return}if(l===!0)return;const[s,c,y]=m(l);s===h&&o.pass(P());function a(){if(E.strictSchema===!1){b.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${f}" ignored in schema at path "${v}"`}}function m(R){const T=R instanceof RegExp?(0,e.regexpCode)(R):E.code.formats?(0,e._)`${E.code.formats}${(0,e.getProperty)(f)}`:void 0,z=n.scopeValue("formats",{key:f,ref:R,code:T});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,e._)`${z}.validate`]:["string",R,z]}function P(){if(typeof l=="object"&&!(l instanceof RegExp)&&l.async){if(!_.$async)throw new Error("async format in sync schema");return(0,e._)`await ${y}(${u})`}return typeof c=="function"?(0,e._)`${y}(${u})`:(0,e._)`${y}.test(${u})`}}}};return vt.default=r,vt}var mn;function ei(){if(mn)return gt;mn=1,Object.defineProperty(gt,"__esModule",{value:!0});const t=[xs().default];return gt.default=t,gt}var Ee={},hn;function ti(){return hn||(hn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.contentVocabulary=Ee.metadataVocabulary=void 0,Ee.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ee.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ee}var yn;function ri(){if(yn)return Le;yn=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=ks(),t=Vs(),r=Xs(),o=ei(),h=ti(),n=[e.default,t.default,(0,r.default)(),o.default,h.metadataVocabulary,h.contentVocabulary];return Le.default=n,Le}var _t={},Ne={},gn;function ni(){if(gn)return Ne;gn=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Ne.DiscrError=e={})),Ne}var vn;function si(){if(vn)return _t;vn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=G(),t=ni(),r=xt(),o=Dt(),h=Y(),u={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:i,tagName:f}})=>i===t.DiscrError.Tag?`tag "${f}" must be string`:`value of tag "${f}" must be in oneOf`,params:({params:{discrError:i,tag:f,tagName:$}})=>(0,e._)`{error: ${i}, tag: ${$}, tagValue: ${f}}`},code(i){const{gen:f,data:$,schema:g,parentSchema:E,it:v}=i,{oneOf:_}=E;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=g.propertyName;if(typeof b!="string")throw new Error("discriminator: requires propertyName");if(g.mapping)throw new Error("discriminator: mapping is not supported");if(!_)throw new Error("discriminator: requires oneOf keyword");const w=f.let("valid",!1),d=f.const("tag",(0,e._)`${$}${(0,e.getProperty)(b)}`);f.if((0,e._)`typeof ${d} == "string"`,()=>l(),()=>i.error(!1,{discrError:t.DiscrError.Tag,tag:d,tagName:b})),i.ok(w);function l(){const y=c();f.if(!1);for(const a in y)f.elseIf((0,e._)`${d} === ${a}`),f.assign(w,s(y[a]));f.else(),i.error(!1,{discrError:t.DiscrError.Mapping,tag:d,tagName:b}),f.endIf()}function s(y){const a=f.name("valid"),m=i.subschema({keyword:"oneOf",schemaProp:y},a);return i.mergeEvaluated(m,e.Name),a}function c(){var y;const a={},m=R(E);let P=!0;for(let N=0;N<_.length;N++){let V=_[N];if(V?.$ref&&!(0,h.schemaHasRulesButRef)(V,v.self.RULES)){const L=V.$ref;if(V=r.resolveRef.call(v.self,v.schemaEnv.root,v.baseId,L),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new o.default(v.opts.uriResolver,v.baseId,L)}const F=(y=V?.properties)===null||y===void 0?void 0:y[b];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);P=P&&(m||R(V)),T(F,N)}if(!P)throw new Error(`discriminator: "${b}" must be required`);return a;function R({required:N}){return Array.isArray(N)&&N.includes(b)}function T(N,V){if(N.const)z(N.const,V);else if(N.enum)for(const F of N.enum)z(F,V);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function z(N,V){if(typeof N!="string"||N in a)throw new Error(`discriminator: "${b}" values must be unique strings`);a[N]=V}}}};return _t.default=u,_t}const ii="http://json-schema.org/draft-07/schema#",oi="http://json-schema.org/draft-07/schema#",ai="Core schema meta-schema",ci={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:[]}},di=["object","boolean"],ui={$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:"#"}},li={$schema:ii,$id:oi,title:ai,definitions:ci,type:di,properties:ui,default:!0};var _n;function qn(){return _n||(_n=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=Ps(),o=ri(),h=si(),n=li,u=["/properties"],i="http://json-schema.org/draft-07/schema";class f extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(h.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(n,u):n;this.addMetaSchema(b,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv=f,e.exports=t=f,e.exports.Ajv=f,Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var $=qt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return $.KeywordCxt}});var g=G();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});var E=Xt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return E.default}});var v=Dt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(Me,Me.exports)),Me.exports}var fi=qn();const pi=En(fi);var $t={exports:{}},Yt={},$n;function mi(){return $n||($n=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(N,V){return{validate:N,compare:V}}e.fullFormats={date:t(n,u),time:t(f(!0),$),"date-time":t(v(!0),_),"iso-time":t(f(),g),"iso-date-time":t(v(),b),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:l,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:c,int32:{type:"number",validate:m},int64:{type:"number",validate:P},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,u),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,b),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(N){return N%4===0&&(N%100!==0||N%400===0)}const o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,h=[0,31,28,31,30,31,30,31,31,30,31,30,31];function n(N){const V=o.exec(N);if(!V)return!1;const F=+V[1],L=+V[2],Q=+V[3];return L>=1&&L<=12&&Q>=1&&Q<=(L===2&&r(F)?29:h[L])}function u(N,V){if(N&&V)return N>V?1:N<V?-1:0}const i=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function f(N){return function(F){const L=i.exec(F);if(!L)return!1;const Q=+L[1],ie=+L[2],oe=+L[3],x=L[4],fe=L[5]==="-"?-1:1,M=+(L[6]||0),j=+(L[7]||0);if(M>23||j>59||N&&!x)return!1;if(Q<=23&&ie<=59&&oe<60)return!0;const D=ie-j*fe,O=Q-M*fe-(D<0?1:0);return(O===23||O===-1)&&(D===59||D===-1)&&oe<61}}function $(N,V){if(!(N&&V))return;const F=new Date("2020-01-01T"+N).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function g(N,V){if(!(N&&V))return;const F=i.exec(N),L=i.exec(V);if(F&&L)return N=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],N>V?1:N<V?-1:0}const E=/t|\s/i;function v(N){const V=f(N);return function(L){const Q=L.split(E);return Q.length===2&&n(Q[0])&&V(Q[1])}}function _(N,V){if(!(N&&V))return;const F=new Date(N).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function b(N,V){if(!(N&&V))return;const[F,L]=N.split(E),[Q,ie]=V.split(E),oe=u(F,Q);if(oe!==void 0)return oe||$(L,ie)}const w=/\/|:/,d=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function l(N){return w.test(N)&&d.test(N)}const s=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function c(N){return s.lastIndex=0,s.test(N)}const y=-2147483648,a=2**31-1;function m(N){return Number.isInteger(N)&&N<=a&&N>=y}function P(N){return Number.isInteger(N)}function R(){return!0}const T=/[^\\]\\Z/;function z(N){if(T.test(N))return!1;try{return new RegExp(N),!0}catch{return!1}}})(Yt)),Yt}var Zt={},bn;function hi(){return bn||(bn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=qn(),r=G(),o=r.operators,h={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},n={message:({keyword:i,schemaCode:f})=>(0,r.str)`should be ${h[i].okStr} ${f}`,params:({keyword:i,schemaCode:f})=>(0,r._)`{comparison: ${h[i].okStr}, limit: ${f}}`};e.formatLimitDefinition={keyword:Object.keys(h),type:"string",schemaType:"string",$data:!0,error:n,code(i){const{gen:f,data:$,schemaCode:g,keyword:E,it:v}=i,{opts:_,self:b}=v;if(!_.validateFormats)return;const w=new t.KeywordCxt(v,b.RULES.all.format.definition,"format");w.$data?d():l();function d(){const c=f.scopeValue("formats",{ref:b.formats,code:_.code.formats}),y=f.const("fmt",(0,r._)`${c}[${w.schemaCode}]`);i.fail$data((0,r.or)((0,r._)`typeof ${y} != "object"`,(0,r._)`${y} instanceof RegExp`,(0,r._)`typeof ${y}.compare != "function"`,s(y)))}function l(){const c=w.schema,y=b.formats[c];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${E}": format "${c}" does not define "compare" function`);const a=f.scopeValue("formats",{key:c,ref:y,code:_.code.formats?(0,r._)`${_.code.formats}${(0,r.getProperty)(c)}`:void 0});i.fail$data(s(a))}function s(c){return(0,r._)`${c}.compare(${$}, ${g}) ${h[E].fail} 0`}},dependencies:["format"]};const u=i=>(i.addKeyword(e.formatLimitDefinition),i);e.default=u})(Zt)),Zt}var wn;function yi(){return wn||(wn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=mi(),o=hi(),h=G(),n=new h.Name("fullFormats"),u=new h.Name("fastFormats"),i=($,g={keywords:!0})=>{if(Array.isArray(g))return f($,g,r.fullFormats,n),$;const[E,v]=g.mode==="fast"?[r.fastFormats,u]:[r.fullFormats,n],_=g.formats||r.formatNames;return f($,_,E,v),g.keywords&&(0,o.default)($),$};i.get=($,g="full")=>{const v=(g==="fast"?r.fastFormats:r.fullFormats)[$];if(!v)throw new Error(`Unknown format "${$}"`);return v};function f($,g,E,v){var _,b;(_=(b=$.opts.code).formats)!==null&&_!==void 0||(b.formats=(0,h._)`require("ajv-formats/dist/formats").${v}`);for(const w of g)$.addFormat(w,E[w])}e.exports=t=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i})($t,$t.exports)),$t.exports}var gi=yi();const vi=En(gi),_i="http://json-schema.org/draft-07/schema#",$i="#/definitions/CICConfig",bi=JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"依赖项"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}'),Te={$schema:_i,$ref:$i,definitions:bi},qe=e=>typeof e=="number"&&isFinite(e)&&e>0,tr=()=>{const e=globalThis;if(e?.crypto?.randomUUID)return e.crypto.randomUUID();if(e?.crypto?.getRandomValues){const t=new Uint8Array(16);e.crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const r=Array.from(t,o=>o.toString(16).padStart(2,"0"));return`${r[0]}${r[1]}${r[2]}${r[3]}-${r[4]}${r[5]}-${r[6]}${r[7]}-${r[8]}${r[9]}-${r[10]}${r[11]}${r[12]}${r[13]}${r[14]}${r[15]}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})},ee=e=>{if(!Array.isArray(e))return[];const t=e.map(i=>{const f=i.path??i.instancePath??"",$=i.keyword,g=i.params||{};let E=i.message||"";if($==="required"&&g.missingProperty&&(E=`缺少必填字段:${g.missingProperty}`),$==="type"&&i.schema&&(E=`类型必须为:${i.schema}`),$==="enum"){const v=Array.isArray(g.allowedValues)?g.allowedValues:void 0;E=v?`取值必须为枚举之一:${v.join(", ")}`:"取值必须为枚举之一"}if($==="const"){const v=g.allowedValue;E=v!==void 0?`取值必须为:${JSON.stringify(v)}`:"必须等于常量"}return $==="additionalProperties"&&g.additionalProperty&&(E=`不允许额外字段:${g.additionalProperty}`),{path:f,message:E,keyword:$,params:g}}),r={},o=[];for(const i of t){const f=i.keyword==="required"?`${i.keyword}|${i.path}|${i.params?.missingProperty}`:`${i.keyword}|${i.path}|${JSON.stringify(i.params||{})}`;r[f]||(r[f]=!0,o.push(i))}const n=o.some(i=>i.keyword!=="anyOf")?o.filter(i=>i.keyword!=="anyOf"):o,u=i=>i.keyword==="required"&&(i.params?.missingProperty==="type"||i.params?.missingProperty==="role")?0:i.keyword==="required"&&i.params?.missingProperty==="id"?1:i.keyword==="required"?2:3;return n.sort((i,f)=>u(i)-u(f)),n},he=(e,t)=>{if(!t||typeof t!="object")return e;const r=e||{};for(const o of Object.keys(t))(!(o in r)||r[o]===void 0)&&(r[o]=t[o]);return r},be=(e,t)=>!t||!t.length?[]:t.map(r=>({...r,path:`${e}${r.path||""}`})),Qt=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch(t){return{ok:!1,errors:[{path:"",message:`JSON 解析失败:${t?.message||String(t)}`,keyword:"type",params:{}}]}}},Dn=e=>e.map(t=>({path:"",message:`缺少必填字段:${t}`,keyword:"required",params:{missingProperty:t}})),rr=(e,t,r,o)=>{const h=e;if(h&&typeof h=="object"&&typeof h[o]=="string"){const i=r[h[o]];if(i)return i(e)?{ok:!0}:{ok:!1,errors:ee(i.errors||[])}}if(t(e))return{ok:!0};const u=ee(t.errors||[]);if(!h||typeof h!="object"||typeof h[o]!="string"){const i=Dn([o,"id"]);return{ok:!1,errors:ee(i)}}return{ok:!1,errors:u}},nr=(e,t,r,o,h,n,u=[n,"id"])=>{const i=r(e,t);if(i&&typeof i=="object"&&typeof i[n]=="string"){const $=h[i[n]];if($)return $(i)?{ok:!0,value:i}:{ok:!1,errors:ee($.errors||[])}}if(o(i))return{ok:!0,value:i};if(!i||typeof i[n]!="string"){const $=Dn(u);return{ok:!1,errors:ee($)}}return{ok:!1,errors:ee(o.errors||[])}};let bt=null;const Tn=()=>(bt||(bt=new pi({allErrors:!0,strict:!1}),vi(bt)),bt),Pn=new Map,wi=JSON.stringify(Te),Pi={CICPage:["#/definitions/CICPage","#/$defs/CICPage","#/properties/pages/items","#/definitions/CICConfig/properties/pages/items"],Meta:["#/definitions/Meta","#/$defs/Meta","#/properties/meta"],Layout:["#/definitions/Layout","#/$defs/Layout","#/properties/meta/properties/layout"],ComponentInstance:["#/definitions/ComponentInstance","#/$defs/ComponentInstance"],ViewComponentInstance:["#/definitions/ViewComponentInstance","#/$defs/ViewComponentInstance"],ContainerComponentInstance:["#/definitions/ContainerComponentInstance","#/$defs/ContainerComponentInstance"],LogicComponentInstanceRef:["#/definitions/LogicComponentInstanceRef","#/$defs/LogicComponentInstanceRef"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],DataSourceRest:["#/definitions/DataSourceRest","#/$defs/DataSourceRest"],DataSourceWebSocket:["#/definitions/DataSourceWebSocket","#/$defs/DataSourceWebSocket"],DataSourceStatic:["#/definitions/DataSourceStatic","#/$defs/DataSourceStatic"],DataSourceFunction:["#/definitions/DataSourceFunction","#/$defs/DataSourceFunction"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],JSDependency:["#/definitions/JSDependency","#/$defs/JSDependency"],CSSDependency:["#/definitions/CSSDependency","#/$defs/CSSDependency"],FontDependency:["#/definitions/FontDependency","#/$defs/FontDependency"],ImageDependency:["#/definitions/ImageDependency","#/$defs/ImageDependency"],JSONDependency:["#/definitions/JSONDependency","#/$defs/JSONDependency"],WasmDependency:["#/definitions/WasmDependency","#/$defs/WasmDependency"],OtherDependency:["#/definitions/OtherDependency","#/$defs/OtherDependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},Si=(e,t)=>e.compile({$ref:t,definitions:Te.definitions,properties:Te.properties}),te=e=>{const t=Tn(),r=`type:${e}::${wi}`,o=Pn.get(r);if(o)return o;const h=Pi[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const n of h)try{const u=Si(t,n);return Pn.set(r,u),u}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Mn=te("DataSourceItem"),An=te("DataSourceRest"),Vn=te("DataSourceWebSocket"),zn=te("DataSourceStatic"),Fn=te("DataSourceFunction"),Ei=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=tr()),r.type&&(r.type==="rest"?(t?.strict||("pollInterval"in r&&qe(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),"timeout"in r&&qe(r.timeout)&&(r.timeout=Math.round(r.timeout))),he(r,t?.defaults)):r.type==="websocket"?(r.heartbeat&&typeof r.heartbeat=="object"&&(t?.strict||"interval"in r.heartbeat&&qe(r.heartbeat.interval)&&(r.heartbeat.interval=Math.round(r.heartbeat.interval))),t?.strict||"pollInterval"in r&&qe(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),he(r,t?.defaults)):r.type==="static"?t?.strict||he(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&qe(r.timeout)&&(r.timeout=Math.round(r.timeout)),t?.strict||he(r,t?.defaults))),r},ki=e=>rr(e,Mn,{rest:An,websocket:Vn,static:zn,function:Fn},"type"),Ln=(e,t)=>nr(e,t,Ei,Mn,{rest:An,websocket:Vn,static:zn,function:Fn},"type",["type","id"]),Un=te("ComponentInstance"),Kn=te("ViewComponentInstance"),Jn=te("ContainerComponentInstance"),Hn=te("LogicComponentInstanceRef"),ji=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=tr()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),he(r,t?.defaults),r},Ii=e=>rr(e,Un,{view:Kn,container:Jn,logic:Hn},"role"),Gn=(e,t)=>nr(e,t,ji,Un,{view:Kn,container:Jn,logic:Hn},"role",["role","id"]),St=te("CICPage"),Oi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=tr()),t?.strict||he(r,t?.defaults),r},Ri=e=>St(e)?{ok:!0}:{ok:!1,errors:ee(St.errors||[])},Wn=(e,t)=>{const r=Oi(e,t);return St(r)?{ok:!0,value:r}:{ok:!1,errors:ee(St.errors||[])}},Et=te("Meta"),kt=te("Layout"),Ci=e=>Et(e)?{ok:!0}:{ok:!1,errors:ee(Et.errors||[])},Ni=e=>kt(e)?{ok:!0}:{ok:!1,errors:ee(kt.errors||[])},Bn=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return Et(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Et.errors||[])}},Yn=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return kt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(kt.errors||[])}},jt=te("Variables"),qi=e=>jt(e)?{ok:!0}:{ok:!1,errors:ee(jt.errors||[])},Zn=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return jt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(jt.errors||[])}},Qn=te("Dependency"),Xn=te("JSDependency"),xn=te("CSSDependency"),es=te("FontDependency"),ts=te("ImageDependency"),rs=te("JSONDependency"),ns=te("WasmDependency"),ss=te("OtherDependency"),Di=e=>rr(e,Qn,{js:Xn,css:xn,font:es,image:ts,json:rs,wasm:ns,other:ss},"type"),is=(e,t)=>nr(e,t,(o,h)=>h?.strict?o:he(o,h?.defaults),Qn,{js:Xn,css:xn,font:es,image:ts,json:rs,wasm:ns,other:ss},"type",["type","id"]),It=te("RegistryComponents"),Ti=e=>It(e)?{ok:!0}:{ok:!1,errors:ee(It.errors||[])},os=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return It(r)?{ok:!0,value:r}:{ok:!1,errors:ee(It.errors||[])}};let Ot,Sn;const Mi=()=>{const e=Tn(),t=JSON.stringify(Te);(!Ot||Sn!==t)&&(Ot=e.compile(Te),Sn=t)},Rt=e=>{try{return Mi(),Ot(e)?{ok:!0}:{ok:!1,errors:ee(Ot.errors||[])}}catch(t){const r=[{path:"",message:t?.message||String(t),keyword:"anyOf",params:{}}];return{ok:!1,errors:ee(r)}}},Ai=(e,t)=>{if(e&&typeof e=="object")return De(e,t);const r=(e||"").trim();if(!(r.startsWith("{")||r.startsWith("[")))return{ok:!1,errors:ee([{path:"",message:"非 JSON 字符串输入,请使用 importCICAsync(pathOrUrl) 进行路径/URL 导入",keyword:"type",params:{}}])};const h=Qt(r);return h.ok?De(h.value,t):{ok:!1,errors:h.errors}},Vi=async(e,t)=>{if(e&&typeof e=="object")return De(e,t);const r=(e||"").trim();if(r.startsWith("{")||r.startsWith("[")){const n=Qt(r);return n.ok?De(n.value,t):{ok:!1,errors:n.errors}}if(!(typeof globalThis.fetch=="function"))return{ok:!1,errors:ee([{path:"",message:"当前环境不支持路径/URL 导入(缺少 fetch),请传入 JSON 字符串或对象",keyword:"type",params:{}}])};if(/^file:\/\//i.test(r))return{ok:!1,errors:ee([{path:"",message:"不支持 file:// 方案,请使用 http(s) 或相对/绝对路径(同源)",keyword:"type",params:{}}])};try{const n=await globalThis.fetch(r);if(!n||!n.ok){const f=[{path:"",message:`网络或资源错误:${n?.status} ${n?.statusText||""}`.trim(),keyword:"type",params:{}}];return{ok:!1,errors:ee(f)}}const u=await n.text(),i=Qt(u);return i.ok?De(i.value,t):{ok:!1,errors:i.errors}}catch(n){const u=[{path:"",message:`请求失败:${n?.message||n}`,keyword:"type",params:{}}];return{ok:!1,errors:ee(u)}}},zi=e=>{const t=Rt(e);if(!t.ok)return{ok:!1,errors:t.errors};const r={version:e.version,meta:e.meta,pages:e.pages,registry:e.registry,variables:e.variables,deps:e.deps,extensions:e.extensions};return{ok:!0,value:JSON.stringify(r,null,2)}},De=(e,t)=>{const r=typeof e=="object"?{...e}:e,o=[];if(!r||typeof r!="object")return o.push({path:"",message:"配置必须为对象",keyword:"type",params:{schema:"object"}}),{ok:!1,errors:ee(o)};if(r.version||o.push({path:"/version",message:"缺少必填字段:version",keyword:"required",params:{missingProperty:"version"}}),r.meta||o.push({path:"/meta",message:"缺少必填字段:meta",keyword:"required",params:{missingProperty:"meta"}}),r.pages||o.push({path:"/pages",message:"缺少必填字段:pages",keyword:"required",params:{missingProperty:"pages"}}),o.length)return{ok:!1,errors:ee(o)};const h=Bn(r.meta,t?.meta);if(h.ok||o.push(...be("/meta",h.errors)),r.meta?.layout){const u=Yn(r.meta.layout,t?.layout);u.ok?r.meta.layout=u.value:o.push(...be("/meta/layout",u.errors))}if(h.ok&&(r.meta=h.value),r.variables){const u=Zn(r.variables,t?.variables);u.ok?r.variables=u.value:o.push(...be("/variables",u.errors))}if(r.registry?.components){const u=[];for(let i=0;i<r.registry.components.length;i++){const f=os(r.registry.components[i],t?.registry);f.ok?u.push(f.value):o.push(...be(`/registry/components[${i}]`,f.errors))}r.registry.components=u}if(r.deps){const u=[];for(let i=0;i<r.deps.length;i++){const f=is(r.deps[i],t?.dependency);f.ok?u.push(f.value):o.push(...be(`/deps[${i}]`,f.errors))}r.deps=u}if(Array.isArray(r.pages)){const u=[];for(let i=0;i<r.pages.length;i++){const f=r.pages[i],$=Wn(f,t?.page);if(!$.ok){o.push(...be(`/pages[${i}]`,$.errors));continue}const g=$.value;if(Array.isArray(f.components)){const E=[];for(let v=0;v<f.components.length;v++){const _=Gn(f.components[v],t?.component);_.ok?E.push(_.value):o.push(...be(`/pages[${i}]/components[${v}]`,_.errors))}g.components=E}if(Array.isArray(f.dataSources)){const E=[];for(let v=0;v<f.dataSources.length;v++){const _=Ln(f.dataSources[v],t?.dataSource);_.ok?E.push(_.value):o.push(...be(`/pages[${i}]/dataSources[${v}]`,_.errors))}g.dataSources=E}u.push(g)}r.pages=u}if(o.length)return{ok:!1,errors:ee(o)};const n=Rt(r);return n.ok?{ok:!0,value:r}:{ok:!1,errors:n.errors}};class Tt{config;constructor(t){const r=Rt(t);if(!r.ok)throw new Error(`Invalid CIC Configuration: ${JSON.stringify(r.errors)}`);this.config=t}getConfig(){return this.config}findComponent(t){let r;return this.walkComponents(o=>o.id===t?(r=o,!1):!0),r}findPageByComponent(t){let r;return this.walkComponents((o,h)=>o.id===t?(r=h,!1):!0),r}getVariable(t,r){const o=this.config.variables;if(o){if(t.componentId&&o.component&&o.component[t.componentId]){const h=o.component[t.componentId][r];if(h)return h.value??h.default}if(t.pageId&&o.page&&o.page[t.pageId]){const h=o.page[t.pageId][r];if(h)return h.value??h.default}if(o.global&&o.global[r]){const h=o.global[r];return h.value??h.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,o,h,n]=r;if(o==="global")return this.getVariable({},n);if(o==="page")return this.getVariable({pageId:h},n);if(o==="component")return this.getVariable({componentId:h},n)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const o=[];for(const n of r.components||[])o.push({node:n});let h=!1;for(;o.length>0&&!h;){const{node:n,parent:u}=o.pop();if(t(n,r,u)===!1){h=!0;break}if(n.children&&n.children.length>0)for(let f=n.children.length-1;f>=0;f--)o.push({node:n.children[f],parent:n})}if(h)break}}static getValueByPath(t,r,o){if(t==null||!r)return o;const h=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(u=>{u.trim()&&h.push(u.trim())});let n=t;for(const u of h){if(n==null)return o;n=n[u]}return n===void 0?o:n}static traverseTree(t,r,o){const h=Array.isArray(t)?t:[t];for(const n of h)r(n,o)!==!1&&n.children&&n.children.length>0&&Tt.traverseTree(n.children,r,n)}static createDataSource=Ln;static validateDataSource=ki;static createComponent=Gn;static validateComponent=Ii;static createPage=Wn;static validatePage=Ri;static createMeta=Bn;static createLayout=Yn;static validateMeta=Ci;static validateLayout=Ni;static createVariables=Zn;static validateVariables=qi;static createDependency=is;static validateDependency=Di;static createRegistryComponent=os;static validateRegistryComponent=Ti;static importCIC=Ai;static exportCIC=zi;static validateCIC=Rt;static importCICAsync=Vi}globalThis.CICSDK=Tt;exports.CICSDK=Tt;
7
+ depsCount: ${w},
8
+ deps: ${$}}`};const y={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(f){const[w,$]=s(f);l(f,w),d(f,$)}};function s({schema:f}){const w={},$={};for(const E in f){if(E==="__proto__")continue;const _=Array.isArray(f[E])?w:$;_[E]=f[E]}return[w,$]}function l(f,w=f.schema){const{gen:$,data:E,it:_}=f;if(Object.keys(w).length===0)return;const v=$.let("missing");for(const b in w){const h=w[b];if(h.length===0)continue;const a=(0,i.propertyInData)($,E,b,_.opts.ownProperties);f.setParams({property:b,depsCount:h.length,deps:h.join(", ")}),_.allErrors?$.if(a,()=>{for(const u of h)(0,i.checkReportMissingProp)(f,u)}):($.if((0,t._)`${a} && (${(0,i.checkMissingProp)(f,h,v)})`),(0,i.reportMissingProp)(f,v),$.else())}}e.validatePropertyDeps=l;function d(f,w=f.schema){const{gen:$,data:E,keyword:_,it:v}=f,b=$.name("valid");for(const h in w)(0,n.alwaysValidSchema)(v,w[h])||($.if((0,i.propertyInData)($,E,h,v.opts.ownProperties),()=>{const a=f.subschema({keyword:_,schemaProp:h},b);f.mergeValidEvaluated(a,b)},()=>$.var(b,!0)),f.ok(b))}e.validateSchemaDeps=d,e.default=y})(xt)),xt}var ut={},sn;function Gs(){if(sn)return ut;sn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=G(),t=Y(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:y})=>(0,e._)`{propertyName: ${y.propertyName}}`},code(y){const{gen:s,schema:l,data:d,it:f}=y;if((0,t.alwaysValidSchema)(f,l))return;const w=s.name("valid");s.forIn("key",d,$=>{y.setParams({propertyName:$}),y.subschema({keyword:"propertyNames",data:$,dataTypes:["string"],propertyName:$,compositeRule:!0},w),s.if((0,e.not)(w),()=>{y.error(!0),f.allErrors||s.break()})}),y.ok(w)}};return ut.default=i,ut}var lt={},on;function Tn(){if(on)return lt;on=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=ge(),t=G(),n=Se(),i=Y(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:d,schema:f,parentSchema:w,data:$,errsCount:E,it:_}=l;if(!E)throw new Error("ajv implementation error");const{allErrors:v,opts:b}=_;if(_.props=!0,b.removeAdditional!=="all"&&(0,i.alwaysValidSchema)(_,f))return;const h=(0,e.allSchemaProperties)(w.properties),a=(0,e.allSchemaProperties)(w.patternProperties);u(),l.ok((0,t._)`${E} === ${n.default.errors}`);function u(){d.forIn("key",$,m=>{!h.length&&!a.length?g(m):d.if(r(m),()=>g(m))})}function r(m){let P;if(h.length>8){const O=(0,i.schemaRefOrVal)(_,w.properties,"properties");P=(0,e.isOwnProperty)(d,O,m)}else h.length?P=(0,t.or)(...h.map(O=>(0,t._)`${m} === ${O}`)):P=t.nil;return a.length&&(P=(0,t.or)(P,...a.map(O=>(0,t._)`${(0,e.usePattern)(l,O)}.test(${m})`))),(0,t.not)(P)}function c(m){d.code((0,t._)`delete ${$}[${m}]`)}function g(m){if(b.removeAdditional==="all"||b.removeAdditional&&f===!1){c(m);return}if(f===!1){l.setParams({additionalProperty:m}),l.error(),v||d.break();return}if(typeof f=="object"&&!(0,i.alwaysValidSchema)(_,f)){const P=d.name("valid");b.removeAdditional==="failing"?(o(m,P,!1),d.if((0,t.not)(P),()=>{l.reset(),c(m)})):(o(m,P),v||d.if((0,t.not)(P),()=>d.break()))}}function o(m,P,O){const T={keyword:"additionalProperties",dataProp:m,dataPropType:i.Type.Str};O===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(T,P)}}};return lt.default=s,lt}var ft={},an;function Ws(){if(an)return ft;an=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=Mt(),t=ge(),n=Y(),i=Tn(),y={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:l,schema:d,parentSchema:f,data:w,it:$}=s;$.opts.removeAdditional==="all"&&f.additionalProperties===void 0&&i.default.code(new e.KeywordCxt($,i.default,"additionalProperties"));const E=(0,t.allSchemaProperties)(d);for(const a of E)$.definedProperties.add(a);$.opts.unevaluated&&E.length&&$.props!==!0&&($.props=n.mergeEvaluated.props(l,(0,n.toHash)(E),$.props));const _=E.filter(a=>!(0,n.alwaysValidSchema)($,d[a]));if(_.length===0)return;const v=l.name("valid");for(const a of _)b(a)?h(a):(l.if((0,t.propertyInData)(l,w,a,$.opts.ownProperties)),h(a),$.allErrors||l.else().var(v,!0),l.endIf()),s.it.definedProperties.add(a),s.ok(v);function b(a){return $.opts.useDefaults&&!$.compositeRule&&d[a].default!==void 0}function h(a){s.subschema({keyword:"properties",schemaProp:a,dataProp:a},v)}}};return ft.default=y,ft}var pt={},cn;function Bs(){if(cn)return pt;cn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=ge(),t=G(),n=Y(),i=Y(),y={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:l,schema:d,data:f,parentSchema:w,it:$}=s,{opts:E}=$,_=(0,e.allSchemaProperties)(d),v=_.filter(g=>(0,n.alwaysValidSchema)($,d[g]));if(_.length===0||v.length===_.length&&(!$.opts.unevaluated||$.props===!0))return;const b=E.strictSchema&&!E.allowMatchingProperties&&w.properties,h=l.name("valid");$.props!==!0&&!($.props instanceof t.Name)&&($.props=(0,i.evaluatedPropsToName)(l,$.props));const{props:a}=$;u();function u(){for(const g of _)b&&r(g),$.allErrors?c(g):(l.var(h,!0),c(g),l.if(h))}function r(g){for(const o in b)new RegExp(g).test(o)&&(0,n.checkStrictMode)($,`property ${o} matches pattern ${g} (use allowMatchingProperties)`)}function c(g){l.forIn("key",f,o=>{l.if((0,t._)`${(0,e.usePattern)(s,g)}.test(${o})`,()=>{const m=v.includes(g);m||s.subschema({keyword:"patternProperties",schemaProp:g,dataProp:o,dataPropType:i.Type.Str},h),$.opts.unevaluated&&a!==!0?l.assign((0,t._)`${a}[${o}]`,!0):!m&&!$.allErrors&&l.if((0,t.not)(h),()=>l.break())})})}}};return pt.default=y,pt}var mt={},dn;function Ys(){if(dn)return mt;dn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:i,schema:y,it:s}=n;if((0,e.alwaysValidSchema)(s,y)){n.fail();return}const l=i.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return mt.default=t,mt}var ht={},un;function xs(){if(un)return ht;un=1,Object.defineProperty(ht,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ge().validateUnion,error:{message:"must match a schema in anyOf"}};return ht.default=t,ht}var yt={},ln;function Qs(){if(ln)return yt;ln=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=G(),t=Y(),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:y})=>(0,e._)`{passingSchemas: ${y.passing}}`},code(y){const{gen:s,schema:l,parentSchema:d,it:f}=y;if(!Array.isArray(l))throw new Error("ajv implementation error");if(f.opts.discriminator&&d.discriminator)return;const w=l,$=s.let("valid",!1),E=s.let("passing",null),_=s.name("_valid");y.setParams({passing:E}),s.block(v),y.result($,()=>y.reset(),()=>y.error(!0));function v(){w.forEach((b,h)=>{let a;(0,t.alwaysValidSchema)(f,b)?s.var(_,!0):a=y.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},_),h>0&&s.if((0,e._)`${_} && ${$}`).assign($,!1).assign(E,(0,e._)`[${E}, ${h}]`).else(),s.if(_,()=>{s.assign($,!0),s.assign(E,h),a&&y.mergeEvaluated(a,e.Name)})})}}};return yt.default=i,yt}var gt={},fn;function Zs(){if(fn)return gt;fn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:i,schema:y,it:s}=n;if(!Array.isArray(y))throw new Error("ajv implementation error");const l=i.name("valid");y.forEach((d,f)=>{if((0,e.alwaysValidSchema)(s,d))return;const w=n.subschema({keyword:"allOf",schemaProp:f},l);n.ok(l),n.mergeEvaluated(w)})}};return gt.default=t,gt}var vt={},pn;function Xs(){if(pn)return vt;pn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=G(),t=Y(),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:l,parentSchema:d,it:f}=s;d.then===void 0&&d.else===void 0&&(0,t.checkStrictMode)(f,'"if" without "then" and "else" is ignored');const w=y(f,"then"),$=y(f,"else");if(!w&&!$)return;const E=l.let("valid",!0),_=l.name("_valid");if(v(),s.reset(),w&&$){const h=l.let("ifClause");s.setParams({ifClause:h}),l.if(_,b("then",h),b("else",h))}else w?l.if(_,b("then")):l.if((0,e.not)(_),b("else"));s.pass(E,()=>s.error(!0));function v(){const h=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},_);s.mergeEvaluated(h)}function b(h,a){return()=>{const u=s.subschema({keyword:h},_);l.assign(E,_),s.mergeValidEvaluated(u,E),a?l.assign(a,(0,e._)`${h}`):s.setParams({ifClause:h})}}}};function y(s,l){const d=s.schema[l];return d!==void 0&&!(0,t.alwaysValidSchema)(s,d)}return vt.default=i,vt}var _t={},mn;function ei(){if(mn)return _t;mn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:i,it:y}){i.if===void 0&&(0,e.checkStrictMode)(y,`"${n}" without "if" is ignored`)}};return _t.default=t,_t}var hn;function ti(){if(hn)return ot;hn=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=qn(),t=Us(),n=Dn(),i=Ks(),y=Js(),s=Hs(),l=Gs(),d=Tn(),f=Ws(),w=Bs(),$=Ys(),E=xs(),_=Qs(),v=Zs(),b=Xs(),h=ei();function a(u=!1){const r=[$.default,E.default,_.default,v.default,b.default,h.default,l.default,d.default,s.default,f.default,w.default];return u?r.push(t.default,i.default):r.push(e.default,n.default),r.push(y.default),r}return ot.default=a,ot}var $t={},bt={},yn;function ri(){if(yn)return bt;yn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=G(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,e.str)`must match format "${i}"`,params:({schemaCode:i})=>(0,e._)`{format: ${i}}`},code(i,y){const{gen:s,data:l,$data:d,schema:f,schemaCode:w,it:$}=i,{opts:E,errSchemaPath:_,schemaEnv:v,self:b}=$;if(!E.validateFormats)return;d?h():a();function h(){const u=s.scopeValue("formats",{ref:b.formats,code:E.code.formats}),r=s.const("fDef",(0,e._)`${u}[${w}]`),c=s.let("fType"),g=s.let("format");s.if((0,e._)`typeof ${r} == "object" && !(${r} instanceof RegExp)`,()=>s.assign(c,(0,e._)`${r}.type || "string"`).assign(g,(0,e._)`${r}.validate`),()=>s.assign(c,(0,e._)`"string"`).assign(g,r)),i.fail$data((0,e.or)(o(),m()));function o(){return E.strictSchema===!1?e.nil:(0,e._)`${w} && !${g}`}function m(){const P=v.$async?(0,e._)`(${r}.async ? await ${g}(${l}) : ${g}(${l}))`:(0,e._)`${g}(${l})`,O=(0,e._)`(typeof ${g} == "function" ? ${P} : ${g}.test(${l}))`;return(0,e._)`${g} && ${g} !== true && ${c} === ${y} && !${O}`}}function a(){const u=b.formats[f];if(!u){o();return}if(u===!0)return;const[r,c,g]=m(u);r===y&&i.pass(P());function o(){if(E.strictSchema===!1){b.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${f}" ignored in schema at path "${_}"`}}function m(O){const T=O instanceof RegExp?(0,e.regexpCode)(O):E.code.formats?(0,e._)`${E.code.formats}${(0,e.getProperty)(f)}`:void 0,z=s.scopeValue("formats",{key:f,ref:O,code:T});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,e._)`${z}.validate`]:["string",O,z]}function P(){if(typeof u=="object"&&!(u instanceof RegExp)&&u.async){if(!v.$async)throw new Error("async format in sync schema");return(0,e._)`await ${g}(${l})`}return typeof c=="function"?(0,e._)`${g}(${l})`:(0,e._)`${g}.test(${l})`}}}};return bt.default=n,bt}var gn;function ni(){if(gn)return $t;gn=1,Object.defineProperty($t,"__esModule",{value:!0});const t=[ri().default];return $t.default=t,$t}var je={},vn;function si(){return vn||(vn=1,Object.defineProperty(je,"__esModule",{value:!0}),je.contentVocabulary=je.metadataVocabulary=void 0,je.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],je.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),je}var _n;function ii(){if(_n)return Je;_n=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=Rs(),t=Ls(),n=ti(),i=ni(),y=si(),s=[e.default,t.default,(0,n.default)(),i.default,y.metadataVocabulary,y.contentVocabulary];return Je.default=s,Je}var wt={},Te={},$n;function oi(){if($n)return Te;$n=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Te.DiscrError=e={})),Te}var bn;function ai(){if(bn)return wt;bn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=G(),t=oi(),n=tr(),i=At(),y=Y(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:d,tagName:f}})=>d===t.DiscrError.Tag?`tag "${f}" must be string`:`value of tag "${f}" must be in oneOf`,params:({params:{discrError:d,tag:f,tagName:w}})=>(0,e._)`{error: ${d}, tag: ${w}, tagValue: ${f}}`},code(d){const{gen:f,data:w,schema:$,parentSchema:E,it:_}=d,{oneOf:v}=E;if(!_.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=$.propertyName;if(typeof b!="string")throw new Error("discriminator: requires propertyName");if($.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");const h=f.let("valid",!1),a=f.const("tag",(0,e._)`${w}${(0,e.getProperty)(b)}`);f.if((0,e._)`typeof ${a} == "string"`,()=>u(),()=>d.error(!1,{discrError:t.DiscrError.Tag,tag:a,tagName:b})),d.ok(h);function u(){const g=c();f.if(!1);for(const o in g)f.elseIf((0,e._)`${a} === ${o}`),f.assign(h,r(g[o]));f.else(),d.error(!1,{discrError:t.DiscrError.Mapping,tag:a,tagName:b}),f.endIf()}function r(g){const o=f.name("valid"),m=d.subschema({keyword:"oneOf",schemaProp:g},o);return d.mergeEvaluated(m,e.Name),o}function c(){var g;const o={},m=O(E);let P=!0;for(let C=0;C<v.length;C++){let V=v[C];if(V?.$ref&&!(0,y.schemaHasRulesButRef)(V,_.self.RULES)){const L=V.$ref;if(V=n.resolveRef.call(_.self,_.schemaEnv.root,_.baseId,L),V instanceof n.SchemaEnv&&(V=V.schema),V===void 0)throw new i.default(_.opts.uriResolver,_.baseId,L)}const F=(g=V?.properties)===null||g===void 0?void 0:g[b];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);P=P&&(m||O(V)),T(F,C)}if(!P)throw new Error(`discriminator: "${b}" must be required`);return o;function O({required:C}){return Array.isArray(C)&&C.includes(b)}function T(C,V){if(C.const)z(C.const,V);else if(C.enum)for(const F of C.enum)z(F,V);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function z(C,V){if(typeof C!="string"||C in o)throw new Error(`discriminator: "${b}" values must be unique strings`);o[C]=V}}}};return wt.default=l,wt}const ci="http://json-schema.org/draft-07/schema#",di="http://json-schema.org/draft-07/schema#",ui="Core schema meta-schema",li={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:[]}},fi=["object","boolean"],pi={$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:"#"}},mi={$schema:ci,$id:di,title:ui,definitions:li,type:fi,properties:pi,default:!0};var wn;function Mn(){return wn||(wn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=ks(),i=ii(),y=ai(),s=mi,l=["/properties"],d="http://json-schema.org/draft-07/schema";class f extends n.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(y.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(s,l):s;this.addMetaSchema(b,d,!1),this.refs["http://json-schema.org/schema"]=d}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(d)?d:void 0)}}t.Ajv=f,e.exports=t=f,e.exports.Ajv=f,Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var w=Mt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return w.KeywordCxt}});var $=G();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return $._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return $.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return $.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return $.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return $.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return $.CodeGen}});var E=er();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return E.default}});var _=At();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(ze,ze.exports)),ze.exports}var hi=Mn();const yi=In(hi);var Pt={exports:{}},Qt={},Pn;function gi(){return Pn||(Pn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(C,V){return{validate:C,compare:V}}e.fullFormats={date:t(s,l),time:t(f(!0),w),"date-time":t(_(!0),v),"iso-time":t(f(),$),"iso-date-time":t(_(),b),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:u,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:c,int32:{type:"number",validate:m},int64:{type:"number",validate:P},float:{type:"number",validate:O},double:{type:"number",validate:O},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,l),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,w),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,$),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,b),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(C){return C%4===0&&(C%100!==0||C%400===0)}const i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,y=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(C){const V=i.exec(C);if(!V)return!1;const F=+V[1],L=+V[2],Q=+V[3];return L>=1&&L<=12&&Q>=1&&Q<=(L===2&&n(F)?29:y[L])}function l(C,V){if(C&&V)return C>V?1:C<V?-1:0}const d=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function f(C){return function(F){const L=d.exec(F);if(!L)return!1;const Q=+L[1],ie=+L[2],oe=+L[3],X=L[4],pe=L[5]==="-"?-1:1,M=+(L[6]||0),j=+(L[7]||0);if(M>23||j>59||C&&!X)return!1;if(Q<=23&&ie<=59&&oe<60)return!0;const D=ie-j*pe,R=Q-M*pe-(D<0?1:0);return(R===23||R===-1)&&(D===59||D===-1)&&oe<61}}function w(C,V){if(!(C&&V))return;const F=new Date("2020-01-01T"+C).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function $(C,V){if(!(C&&V))return;const F=d.exec(C),L=d.exec(V);if(F&&L)return C=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],C>V?1:C<V?-1:0}const E=/t|\s/i;function _(C){const V=f(C);return function(L){const Q=L.split(E);return Q.length===2&&s(Q[0])&&V(Q[1])}}function v(C,V){if(!(C&&V))return;const F=new Date(C).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function b(C,V){if(!(C&&V))return;const[F,L]=C.split(E),[Q,ie]=V.split(E),oe=l(F,Q);if(oe!==void 0)return oe||w(L,ie)}const h=/\/|:/,a=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function u(C){return h.test(C)&&a.test(C)}const r=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function c(C){return r.lastIndex=0,r.test(C)}const g=-2147483648,o=2**31-1;function m(C){return Number.isInteger(C)&&C<=o&&C>=g}function P(C){return Number.isInteger(C)}function O(){return!0}const T=/[^\\]\\Z/;function z(C){if(T.test(C))return!1;try{return new RegExp(C),!0}catch{return!1}}})(Qt)),Qt}var Zt={},Sn;function vi(){return Sn||(Sn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Mn(),n=G(),i=n.operators,y={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:d,schemaCode:f})=>(0,n.str)`should be ${y[d].okStr} ${f}`,params:({keyword:d,schemaCode:f})=>(0,n._)`{comparison: ${y[d].okStr}, limit: ${f}}`};e.formatLimitDefinition={keyword:Object.keys(y),type:"string",schemaType:"string",$data:!0,error:s,code(d){const{gen:f,data:w,schemaCode:$,keyword:E,it:_}=d,{opts:v,self:b}=_;if(!v.validateFormats)return;const h=new t.KeywordCxt(_,b.RULES.all.format.definition,"format");h.$data?a():u();function a(){const c=f.scopeValue("formats",{ref:b.formats,code:v.code.formats}),g=f.const("fmt",(0,n._)`${c}[${h.schemaCode}]`);d.fail$data((0,n.or)((0,n._)`typeof ${g} != "object"`,(0,n._)`${g} instanceof RegExp`,(0,n._)`typeof ${g}.compare != "function"`,r(g)))}function u(){const c=h.schema,g=b.formats[c];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${E}": format "${c}" does not define "compare" function`);const o=f.scopeValue("formats",{key:c,ref:g,code:v.code.formats?(0,n._)`${v.code.formats}${(0,n.getProperty)(c)}`:void 0});d.fail$data(r(o))}function r(c){return(0,n._)`${c}.compare(${w}, ${$}) ${y[E].fail} 0`}},dependencies:["format"]};const l=d=>(d.addKeyword(e.formatLimitDefinition),d);e.default=l})(Zt)),Zt}var En;function _i(){return En||(En=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=gi(),i=vi(),y=G(),s=new y.Name("fullFormats"),l=new y.Name("fastFormats"),d=(w,$={keywords:!0})=>{if(Array.isArray($))return f(w,$,n.fullFormats,s),w;const[E,_]=$.mode==="fast"?[n.fastFormats,l]:[n.fullFormats,s],v=$.formats||n.formatNames;return f(w,v,E,_),$.keywords&&(0,i.default)(w),w};d.get=(w,$="full")=>{const _=($==="fast"?n.fastFormats:n.fullFormats)[w];if(!_)throw new Error(`Unknown format "${w}"`);return _};function f(w,$,E,_){var v,b;(v=(b=w.opts.code).formats)!==null&&v!==void 0||(b.formats=(0,y._)`require("ajv-formats/dist/formats").${_}`);for(const h of $)w.addFormat(h,E[h])}e.exports=t=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d})(Pt,Pt.exports)),Pt.exports}var $i=_i();const bi=In($i),wi="http://json-schema.org/draft-07/schema#",Pi="#/definitions/CICConfig",Si=JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"description":{"type":"string"},"extensions":{"type":"object","additionalProperties":{}},"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"依赖项"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}'),Ve={$schema:wi,$ref:Pi,definitions:Si},fe={REQUIRED:"required",TYPE:"type",ENUM:"enum",CONST:"const",ADDITIONAL:"additionalProperties",ANY_OF:"anyOf"},we={TYPE:"/type",VALUE:"/value",DEFAULT:"/default",ARGS:"/args"},Ne={missing:e=>`缺少必填字段:${e}`,type:e=>`类型必须为:${e}`,enum:e=>`取值必须为枚举之一:${e.join(", ")}`,constOne:e=>`取值必须为:${JSON.stringify(e)}`,additionalProp:e=>`不允许额外字段:${e}`},Me=e=>typeof e=="number"&&Number.isFinite(e)&&e>0,nr=()=>{const e=globalThis;if(e?.crypto?.randomUUID)return e.crypto.randomUUID();if(e?.crypto?.getRandomValues){const t=new Uint8Array(16);e.crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const n=Array.from(t,i=>i.toString(16).padStart(2,"0"));return`${n.slice(0,4).join("")}-${n.slice(4,6).join("")}-${n.slice(6,8).join("")}-${n.slice(8,10).join("")}-${n.slice(10).join("")}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16|0;return(t==="x"?n:n&3|8).toString(16)})},ee=e=>{if(!Array.isArray(e))return[];const t=h=>{const a=h.instancePath||h.path||"",u=h.keyword,r=h.params||{};let c=h.message||"";switch(u){case fe.REQUIRED:r.missingProperty&&(c=Ne.missing(r.missingProperty));break;case fe.TYPE:h.schema&&(c=Ne.type(h.schema));break;case fe.ENUM:Array.isArray(r.allowedValues)&&(c=Ne.enum(r.allowedValues));break;case fe.CONST:c=r.allowedValue!==void 0?Ne.constOne(r.allowedValue):"必须等于常量";break;case fe.ADDITIONAL:r.additionalProperty&&(c=Ne.additionalProp(r.additionalProperty));break}return{path:a,message:c,keyword:u,params:r}},n=e.map(t),i=[],y=new Map,s=new Set;for(const h of n)if(h.keyword===fe.CONST&&h.path.endsWith(we.TYPE)){const a=h.path,u=y.get(a)||{path:h.path,values:[]},r=h.params?.allowedValue;r!==void 0&&!u.values.includes(r)&&u.values.push(r),y.set(a,u)}else i.push(h);for(const[,h]of y)if(h.values.length<=1)h.values.length===1&&i.push({path:h.path,keyword:fe.CONST,params:{allowedValue:h.values[0]},message:Ne.constOne(h.values[0])});else{const a=h.path.replace(new RegExp(`${we.TYPE}$`),"");s.add(a)}const l=i,d=new Set,f=[];for(const h of l){const a=`${h.keyword}|${h.path}|${JSON.stringify(h.params??{})}`;d.has(a)||(d.add(a),f.push(h))}const w=new Map,$=h=>{if(!h)return"";const a=h.match(new RegExp(`^(.*?)(?:${we.TYPE}|${we.VALUE}|${we.DEFAULT}|${we.ARGS})(?:$|\\/)`));return a?a[1]:h};for(const h of f){const a=$(h.path),u=w.get(a)||[];u.push(h),w.set(a,u)}const E=[];for(const[h,a]of w.entries()){if(!s.has(h)){E.push(...a);continue}for(const r of a){const c=r.keyword===fe.TYPE&&(r.path===`${h}${we.VALUE}`||r.path===`${h}${we.DEFAULT}`),g=r.keyword===fe.ADDITIONAL&&r.path===h&&r.params?.additionalProperty==="args";c||g||E.push(r)}}const v=E.some(h=>h.keyword!==fe.ANY_OF)?E.filter(h=>h.keyword!==fe.ANY_OF):E,b=h=>{if(h.keyword===fe.REQUIRED){const a=h.params?.missingProperty;return a==="type"||a==="role"?0:a==="id"?1:2}return 3};return v.sort((h,a)=>b(h)-b(a))},ye=(e,t)=>{if(!t||typeof t!="object")return e;const n=e??{};for(const i of Object.keys(t))(!(i in n)||n[i]===void 0)&&(n[i]=t[i]);return n},Pe=(e,t)=>t?.length?t.map(n=>({...n,path:`${e}${n.path?`.${n.path}`:""}`})):[],Xt=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch(t){return{ok:!1,errors:[{path:"",keyword:"type",message:`JSON 解析失败:${t?.message??String(t)}`}]}}},Ei=e=>e.map(t=>({path:"",keyword:"required",params:{missingProperty:t},message:`缺少必填字段:${t}`})),An=({input:e,normalize:t,base:n,branches:i,key:y,missingKeys:s,onSuccess:l})=>{const d=t?t(e):e,f=d;if(f&&typeof f=="object"&&typeof f[y]=="string"){const w=i[f[y]];if(w)return w(f)?l(f):{ok:!1,errors:ee(w.errors)}}return n(d)?l(d):!f||typeof f[y]!="string"?{ok:!1,errors:Ei(s)}:{ok:!1,errors:ee(n.errors)}},sr=(e,t,n,i)=>An({input:e,base:t,branches:n,key:i,missingKeys:[i,"id"],onSuccess:()=>({ok:!0})}),ir=(e,t,n,i,y,s,l=[s,"id"])=>An({input:e,normalize:d=>n(d,t),base:i,branches:y,key:s,missingKeys:l,onSuccess:d=>({ok:!0,value:d})});let St=null;const Vn=()=>(St||(St=new yi({allErrors:!0,strict:!1}),bi(St)),St),kn=new Map,ki=JSON.stringify(Ve),ji={CICPage:["#/definitions/CICPage","#/$defs/CICPage","#/properties/pages/items","#/definitions/CICConfig/properties/pages/items"],Meta:["#/definitions/Meta","#/$defs/Meta","#/properties/meta"],Layout:["#/definitions/Layout","#/$defs/Layout","#/properties/meta/properties/layout"],ComponentInstance:["#/definitions/ComponentInstance","#/$defs/ComponentInstance"],ViewComponentInstance:["#/definitions/ViewComponentInstance","#/$defs/ViewComponentInstance"],ContainerComponentInstance:["#/definitions/ContainerComponentInstance","#/$defs/ContainerComponentInstance"],LogicComponentInstanceRef:["#/definitions/LogicComponentInstanceRef","#/$defs/LogicComponentInstanceRef"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],DataSourceRest:["#/definitions/DataSourceRest","#/$defs/DataSourceRest"],DataSourceWebSocket:["#/definitions/DataSourceWebSocket","#/$defs/DataSourceWebSocket"],DataSourceStatic:["#/definitions/DataSourceStatic","#/$defs/DataSourceStatic"],DataSourceFunction:["#/definitions/DataSourceFunction","#/$defs/DataSourceFunction"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],JSDependency:["#/definitions/JSDependency","#/$defs/JSDependency"],CSSDependency:["#/definitions/CSSDependency","#/$defs/CSSDependency"],FontDependency:["#/definitions/FontDependency","#/$defs/FontDependency"],ImageDependency:["#/definitions/ImageDependency","#/$defs/ImageDependency"],JSONDependency:["#/definitions/JSONDependency","#/$defs/JSONDependency"],WasmDependency:["#/definitions/WasmDependency","#/$defs/WasmDependency"],OtherDependency:["#/definitions/OtherDependency","#/$defs/OtherDependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},Ii=(e,t)=>e.compile({$ref:t,definitions:Ve.definitions,properties:Ve.properties}),te=e=>{const t=Vn(),n=`type:${e}::${ki}`,i=kn.get(n);if(i)return i;const y=ji[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const s of y)try{const l=Ii(t,s);return kn.set(n,l),l}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},zn=te("DataSourceItem"),Fn=te("DataSourceRest"),Ln=te("DataSourceWebSocket"),Un=te("DataSourceStatic"),Kn=te("DataSourceFunction"),Ri=(e,t)=>{const n={...e};return t?.generateId&&!n.id&&(n.id=nr()),n.type&&(n.type==="rest"?(t?.strict||("pollInterval"in n&&Me(n.pollInterval)&&(n.pollInterval=Math.round(n.pollInterval)),"timeout"in n&&Me(n.timeout)&&(n.timeout=Math.round(n.timeout))),ye(n,t?.defaults)):n.type==="websocket"?(n.heartbeat&&typeof n.heartbeat=="object"&&(t?.strict||"interval"in n.heartbeat&&Me(n.heartbeat.interval)&&(n.heartbeat.interval=Math.round(n.heartbeat.interval))),t?.strict||"pollInterval"in n&&Me(n.pollInterval)&&(n.pollInterval=Math.round(n.pollInterval)),ye(n,t?.defaults)):n.type==="static"?t?.strict||ye(n,t?.defaults):n.type==="function"&&(t?.strict||"timeout"in n&&Me(n.timeout)&&(n.timeout=Math.round(n.timeout)),t?.strict||ye(n,t?.defaults))),n},Oi=e=>sr(e,zn,{rest:Fn,websocket:Ln,static:Un,function:Kn},"type"),Jn=(e,t)=>ir(e,t,Ri,zn,{rest:Fn,websocket:Ln,static:Un,function:Kn},"type",["type","id"]),Hn=te("ComponentInstance"),Gn=te("ViewComponentInstance"),Wn=te("ContainerComponentInstance"),Bn=te("LogicComponentInstanceRef"),Ni=(e,t)=>{const n={...e};return t?.generateId&&!n.id&&(n.id=nr()),t?.strict||(n.role==="view"?delete n.children:n.role==="container"?delete n.component:n.role==="logic"&&delete n.children),ye(n,t?.defaults),n},Ci=e=>sr(e,Hn,{view:Gn,container:Wn,logic:Bn},"role"),Yn=(e,t)=>ir(e,t,Ni,Hn,{view:Gn,container:Wn,logic:Bn},"role",["role","id"]),jt=te("CICPage"),qi=(e,t)=>{const n={...e};return t?.generateId&&!n.id&&(n.id=nr()),t?.strict||ye(n,t?.defaults),n},Di=e=>jt(e)?{ok:!0}:{ok:!1,errors:ee(jt.errors||[])},xn=(e,t)=>{const n=qi(e,t);return jt(n)?{ok:!0,value:n}:{ok:!1,errors:ee(jt.errors||[])}},It=te("Meta"),Rt=te("Layout"),Ti=e=>It(e)?{ok:!0}:{ok:!1,errors:ee(It.errors||[])},Mi=e=>Rt(e)?{ok:!0}:{ok:!1,errors:ee(Rt.errors||[])},Qn=(e,t)=>{const n=t?.strict?e:ye(e,t?.defaults);return It(n)?{ok:!0,value:n}:{ok:!1,errors:ee(It.errors||[])}},Zn=(e,t)=>{const n=t?.strict?e:ye(e,t?.defaults);return Rt(n)?{ok:!0,value:n}:{ok:!1,errors:ee(Rt.errors||[])}},Ot=te("Variables"),Ai=e=>Ot(e)?{ok:!0}:{ok:!1,errors:ee(Ot.errors||[])},Xn=(e,t)=>{const n=t?.strict?e:ye(e,t?.defaults);return Ot(n)?{ok:!0,value:n}:{ok:!1,errors:ee(Ot.errors||[])}},es=te("Dependency"),ts=te("JSDependency"),rs=te("CSSDependency"),ns=te("FontDependency"),ss=te("ImageDependency"),is=te("JSONDependency"),os=te("WasmDependency"),as=te("OtherDependency"),Vi=e=>sr(e,es,{js:ts,css:rs,font:ns,image:ss,json:is,wasm:os,other:as},"type"),cs=(e,t)=>ir(e,t,(i,y)=>y?.strict?i:ye(i,y?.defaults),es,{js:ts,css:rs,font:ns,image:ss,json:is,wasm:os,other:as},"type",["type","id"]),Nt=te("RegistryComponents"),zi=e=>Nt(e)?{ok:!0}:{ok:!1,errors:ee(Nt.errors||[])},ds=(e,t)=>{const n=t?.strict?e:ye(e,t?.defaults);return Nt(n)?{ok:!0,value:n}:{ok:!1,errors:ee(Nt.errors||[])}};let Ct,jn;const Fi=()=>{const e=Vn(),t=JSON.stringify(Ve);(!Ct||jn!==t)&&(Ct=e.compile(Ve),jn=t)},qt=e=>{try{return Fi(),Ct(e)?{ok:!0}:{ok:!1,errors:ee(Ct.errors||[])}}catch(t){const n=[{path:"",message:t?.message||String(t),keyword:"anyOf",params:{}}];return{ok:!1,errors:ee(n)}}},Li=(e,t)=>{if(e&&typeof e=="object")return Ae(e,t);const n=(e||"").trim();if(!(n.startsWith("{")||n.startsWith("[")))return{ok:!1,errors:ee([{path:"",message:"非 JSON 字符串输入,请使用 importCICAsync(pathOrUrl) 进行路径/URL 导入",keyword:"type",params:{}}])};const y=Xt(n);return y.ok?Ae(y.value,t):{ok:!1,errors:y.errors}},Ui=async(e,t)=>{if(e&&typeof e=="object")return Ae(e,t);const n=(e||"").trim();if(n.startsWith("{")||n.startsWith("[")){const s=Xt(n);return s.ok?Ae(s.value,t):{ok:!1,errors:s.errors}}if(!(typeof globalThis.fetch=="function"))return{ok:!1,errors:ee([{path:"",message:"当前环境不支持路径/URL 导入(缺少 fetch),请传入 JSON 字符串或对象",keyword:"type",params:{}}])};if(/^file:\/\//i.test(n))return{ok:!1,errors:ee([{path:"",message:"不支持 file:// 方案,请使用 http(s) 或相对/绝对路径(同源)",keyword:"type",params:{}}])};try{const s=await globalThis.fetch(n);if(!s||!s.ok){const f=[{path:"",message:`网络或资源错误:${s?.status} ${s?.statusText||""}`.trim(),keyword:"type",params:{}}];return{ok:!1,errors:ee(f)}}const l=await s.text(),d=Xt(l);return d.ok?Ae(d.value,t):{ok:!1,errors:d.errors}}catch(s){const l=[{path:"",message:`请求失败:${s?.message||s}`,keyword:"type",params:{}}];return{ok:!1,errors:ee(l)}}},Ki=e=>{const t=qt(e);if(!t.ok)return{ok:!1,errors:t.errors};const n={version:e.version,meta:e.meta,pages:e.pages,registry:e.registry,variables:e.variables,deps:e.deps,extensions:e.extensions};return{ok:!0,value:JSON.stringify(n,null,2)}},Ae=(e,t)=>{const n=typeof e=="object"?{...e}:e,i=[];if(!n||typeof n!="object")return i.push({path:"",message:"配置必须为对象",keyword:"type",params:{schema:"object"}}),{ok:!1,errors:ee(i)};if(n.version||i.push({path:"/version",message:"缺少必填字段:version",keyword:"required",params:{missingProperty:"version"}}),n.meta||i.push({path:"/meta",message:"缺少必填字段:meta",keyword:"required",params:{missingProperty:"meta"}}),n.pages||i.push({path:"/pages",message:"缺少必填字段:pages",keyword:"required",params:{missingProperty:"pages"}}),i.length)return{ok:!1,errors:ee(i)};const y=Qn(n.meta,t?.meta);if(y.ok||i.push(...Pe("/meta",y.errors)),n.meta?.layout){const l=Zn(n.meta.layout,t?.layout);l.ok?n.meta.layout=l.value:i.push(...Pe("/meta/layout",l.errors))}if(y.ok&&(n.meta=y.value),n.variables){const l=Xn(n.variables,t?.variables);l.ok?n.variables=l.value:i.push(...Pe("/variables",l.errors))}if(n.registry?.components){const l=[];for(let d=0;d<n.registry.components.length;d++){const f=ds(n.registry.components[d],t?.registry);f.ok?l.push(f.value):i.push(...Pe(`/registry/components[${d}]`,f.errors))}n.registry.components=l}if(n.deps){const l=[];for(let d=0;d<n.deps.length;d++){const f=cs(n.deps[d],t?.dependency);f.ok?l.push(f.value):i.push(...Pe(`/deps[${d}]`,f.errors))}n.deps=l}if(Array.isArray(n.pages)){const l=[];for(let d=0;d<n.pages.length;d++){const f=n.pages[d],w=xn(f,t?.page);if(!w.ok){i.push(...Pe(`/pages[${d}]`,w.errors));continue}const $=w.value;if(Array.isArray(f.components)){const E=[];for(let _=0;_<f.components.length;_++){const v=Yn(f.components[_],t?.component);v.ok?E.push(v.value):i.push(...Pe(`/pages[${d}]/components[${_}]`,v.errors))}$.components=E}if(Array.isArray(f.dataSources)){const E=[];for(let _=0;_<f.dataSources.length;_++){const v=Jn(f.dataSources[_],t?.dataSource);v.ok?E.push(v.value):i.push(...Pe(`/pages[${d}]/dataSources[${_}]`,v.errors))}$.dataSources=E}l.push($)}n.pages=l}if(i.length)return{ok:!1,errors:ee(i)};const s=qt(n);return s.ok?{ok:!0,value:n}:{ok:!1,errors:s.errors}};class or{config;constructor(t){const n=qt(t);if(!n.ok)throw new Error(`Invalid CIC Configuration: ${JSON.stringify(n.errors)}`);this.config=t}getConfig(){return this.config}findComponent(t){let n;return this.walkComponents(i=>i.id===t?(n=i,!1):!0),n}findPageByComponent(t){let n;return this.walkComponents((i,y)=>i.id===t?(n=y,!1):!0),n}getVariable(t,n){const i=this.config.variables;if(i){if(t.componentId&&i.component&&i.component[t.componentId]){const y=i.component[t.componentId][n];if(y)return y.value??y.default}if(t.pageId&&i.page&&i.page[t.pageId]){const y=i.page[t.pageId][n];if(y)return y.value??y.default}if(i.global&&i.global[n]){const y=i.global[n];return y.value??y.default}}}getVariableByRef(t){const n=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!n)return;const[,i,y,s]=n;if(i==="global")return this.getVariable({},s);if(i==="page")return this.getVariable({pageId:y},s);if(i==="component")return this.getVariable({componentId:y},s)}walkComponents(t){if(this.config.pages)for(const n of this.config.pages){const i=[];for(const s of n.components||[])i.push({node:s});let y=!1;for(;i.length>0&&!y;){const{node:s,parent:l}=i.pop();if(t(s,n,l)===!1){y=!0;break}if(s.children&&s.children.length>0)for(let f=s.children.length-1;f>=0;f--)i.push({node:s.children[f],parent:s})}if(y)break}}static getValueByPath(t,n,i){if(t==null||!n)return i;const y=[];n.replace(/\[(\d+)\]/g,".$1").split(".").forEach(l=>{l.trim()&&y.push(l.trim())});let s=t;for(const l of y){if(s==null)return i;s=s[l]}return s===void 0?i:s}static traverseTree(t,n,i){const y=Array.isArray(t)?t:[t];for(const s of y)n(s,i)!==!1&&s.children&&s.children.length>0&&or.traverseTree(s.children,n,s)}static createDataSource=Jn;static validateDataSource=Oi;static createComponent=Yn;static validateComponent=Ci;static createPage=xn;static validatePage=Di;static createMeta=Qn;static createLayout=Zn;static validateMeta=Ti;static validateLayout=Mi;static createVariables=Xn;static validateVariables=Ai;static createDependency=cs;static validateDependency=Vi;static createRegistryComponent=ds;static validateRegistryComponent=zi;static importCIC=Li;static exportCIC=Ki;static validateCIC=qt;static importCICAsync=Ui}exports.CICSDK=or;