@povio/openapi-codegen-cli
Version:
**NOTE:** This CLI tool is primarily designed for use within our organization. The generated code output aligns with our internal template. If you are using this tool without our internal template, make sure to use it in **standalone** mode.
9 lines (8 loc) • 478 kB
JavaScript
"use strict";var mE=Object.create;var xi=Object.defineProperty;var hE=Object.getOwnPropertyDescriptor;var gE=Object.getOwnPropertyNames;var yE=Object.getPrototypeOf,vE=Object.prototype.hasOwnProperty;var o=(e,t)=>xi(e,"name",{value:t,configurable:!0});var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),SE=(e,t)=>{for(var r in t)xi(e,r,{get:t[r],enumerable:!0})},Rd=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gE(t))!vE.call(e,i)&&i!==r&&xi(e,i,{get:()=>t[i],enumerable:!(n=hE(t,i))||n.enumerable});return e};var Ge=(e,t,r)=>(r=e!=null?mE(yE(e)):{},Rd(t||!e||!e.__esModule?xi(r,"default",{value:e,enumerable:!0}):r,e)),bE=e=>Rd(xi({},"__esModule",{value:!0}),e);var Fe=h((Le,Nd)=>{"use strict";var Yo=/^win/.test(process.platform),_E=/\//g,PE=/^(\w{2,}):\/\//i,Cd=Nd.exports,EE=/~1/g,OE=/~0/g,vc=[/\?/g,"%3F",/\#/g,"%23"],Sc=[/\%23/g,"#",/\%24/g,"$",/\%26/g,"&",/\%2C/g,",",/\%40/g,"@"];Le.parse=require("url").parse;Le.resolve=require("url").resolve;Le.cwd=o(function(){if(process.browser)return location.href;let t=process.cwd(),r=t.slice(-1);return r==="/"||r==="\\"?t:t+"/"},"cwd");Le.getProtocol=o(function(t){let r=PE.exec(t);if(r)return r[1].toLowerCase()},"getProtocol");Le.getExtension=o(function(t){let r=t.lastIndexOf(".");return r>=0?t.substr(r).toLowerCase():""},"getExtension");Le.getHash=o(function(t){let r=t.indexOf("#");return r>=0?t.substr(r):"#"},"getHash");Le.stripHash=o(function(t){let r=t.indexOf("#");return r>=0&&(t=t.substr(0,r)),t},"stripHash");Le.isHttp=o(function(t){let r=Cd.getProtocol(t);return r==="http"||r==="https"?!0:r===void 0?process.browser:!1},"isHttp");Le.isFileSystemPath=o(function(t){if(process.browser)return!1;let r=Cd.getProtocol(t);return r===void 0||r==="file"},"isFileSystemPath");Le.fromFileSystemPath=o(function(t){Yo&&(t=t.replace(/\\/g,"/")),t=encodeURI(t);for(let r=0;r<vc.length;r+=2)t=t.replace(vc[r],vc[r+1]);return t},"fromFileSystemPath");Le.toFileSystemPath=o(function(t,r){t=decodeURI(t);for(let i=0;i<Sc.length;i+=2)t=t.replace(Sc[i],Sc[i+1]);let n=t.substr(0,7).toLowerCase()==="file://";return n&&(t=t[7]==="/"?t.substr(8):t.substr(7),Yo&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),r?t="file:///"+t:(n=!1,t=Yo?t:"/"+t)),Yo&&!n&&(t=t.replace(_E,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t},"toFileSystemPath");Le.safePointerToPath=o(function(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(r=>decodeURIComponent(r).replace(EE,"/").replace(OE,"~"))},"safePointerToPath")});var Jo=h(Ai=>{"use strict";var kd=require("util"),$E=Fe();Ai.format=kd.format;Ai.inherits=kd.inherits;Ai.swaggerParamRegExp=/\{([^/}]+)}/g;var xE=["get","post","put","delete","patch","options","head","trace"];function bc(e,t){if(e.url&&e.url.startsWith("/")){let r=$E.parse(t),n=r.protocol+"//"+r.hostname+e.url;return e.url=n,e}}o(bc,"fixServers");function AE(e,t){e.openapi&&t&&(t.startsWith("http:")||t.startsWith("https:"))&&(e.servers&&e.servers.map(r=>bc(r,t)),["paths","webhooks"].forEach(r=>{Object.keys(e[r]||[]).forEach(n=>{let i=e[r][n];Object.keys(i).forEach(s=>{s==="servers"?i[s].map(a=>bc(a,t)):xE.includes(s)&&i[s].servers&&i[s].servers.map(a=>bc(a,t))})})}))}o(AE,"fixOasRelativeServers");Ai.fixOasRelativeServers=AE});var Xo=h(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.getDeepKeys=Sn.toJSON=void 0;var wE=["function","symbol","undefined"],IE=["constructor","prototype","__proto__"],TE=Object.getPrototypeOf({});function RE(){let e={},t=this;for(let r of jd(t))if(typeof r=="string"){let n=t[r],i=typeof n;wE.includes(i)||(e[r]=n)}return e}o(RE,"toJSON");Sn.toJSON=RE;function jd(e,t=[]){let r=[];for(;e&&e!==TE;)r=r.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let n=new Set(r);for(let i of t.concat(IE))n.delete(i);return n}o(jd,"getDeepKeys");Sn.getDeepKeys=jd});var _c=h(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.addInspectMethod=bn.format=void 0;var qd=require("util"),CE=Xo(),Md=qd.inspect.custom||Symbol.for("nodejs.util.inspect.custom");bn.format=qd.format;function NE(e){e[Md]=kE}o(NE,"addInspectMethod");bn.addInspectMethod=NE;function kE(){let e={},t=this;for(let r of CE.getDeepKeys(t)){let n=t[r];e[r]=n}return delete e[Md],e}o(kE,"inspect")});var Fd=h(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.lazyJoinStacks=yt.joinStacks=yt.isWritableStack=yt.isLazyStack=void 0;var jE=/\r?\n/,qE=/\bono[ @]/;function ME(e){return!!(e&&e.configurable&&typeof e.get=="function")}o(ME,"isLazyStack");yt.isLazyStack=ME;function DE(e){return!!(!e||e.writable||typeof e.set=="function")}o(DE,"isWritableStack");yt.isWritableStack=DE;function Dd(e,t){let r=Ld(e.stack),n=t?t.stack:void 0;return r&&n?r+`
`+n:r||n}o(Dd,"joinStacks");yt.joinStacks=Dd;function LE(e,t,r){r?Object.defineProperty(t,"stack",{get:o(()=>{let n=e.get.apply(t);return Dd({stack:n},r)},"get"),enumerable:!1,configurable:!0}):FE(t,e)}o(LE,"lazyJoinStacks");yt.lazyJoinStacks=LE;function Ld(e){if(e){let t=e.split(jE),r;for(let n=0;n<t.length;n++){let i=t[n];if(qE.test(i))r===void 0&&(r=n);else if(r!==void 0){t.splice(r,n-r);break}}if(t.length>0)return t.join(`
`)}return e}o(Ld,"popStack");function FE(e,t){Object.defineProperty(e,"stack",{get:o(()=>Ld(t.get.apply(e)),"get"),enumerable:!1,configurable:!0})}o(FE,"lazyPopStack")});var Bd=h(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.extendError=void 0;var Hd=_c(),es=Fd(),Vd=Xo(),HE=["name","message","stack"];function VE(e,t,r){let n=e;return BE(n,t),t&&typeof t=="object"&&UE(n,t),n.toJSON=Vd.toJSON,Hd.addInspectMethod&&Hd.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}o(VE,"extendError");ts.extendError=VE;function BE(e,t){let r=Object.getOwnPropertyDescriptor(e,"stack");es.isLazyStack(r)?es.lazyJoinStacks(r,e,t):es.isWritableStack(r)&&(e.stack=es.joinStacks(e,t))}o(BE,"extendStack");function UE(e,t){let r=Vd.getDeepKeys(t,HE),n=e,i=t;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}o(UE,"mergeErrors")});var Ud=h(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.normalizeArgs=_n.normalizeOptions=void 0;var GE=_c();function ZE(e){return e=e||{},{concatMessages:e.concatMessages===void 0?!0:!!e.concatMessages,format:e.format===void 0?GE.format:typeof e.format=="function"?e.format:!1}}o(ZE,"normalizeOptions");_n.normalizeOptions=ZE;function zE(e,t){let r,n,i,s="";return typeof e[0]=="string"?i=e:typeof e[1]=="string"?(e[0]instanceof Error?r=e[0]:n=e[0],i=e.slice(1)):(r=e[0],n=e[1],i=e.slice(2)),i.length>0&&(t.format?s=t.format.apply(void 0,i):s=i.join(" ")),t.concatMessages&&r&&r.message&&(s+=(s?`
`:"")+r.message),{originalError:r,props:n,message:s}}o(zE,"normalizeArgs");_n.normalizeArgs=zE});var Ec=h(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.Ono=void 0;var rs=Bd(),Gd=Ud(),KE=Xo(),QE=Pc;ns.Ono=QE;function Pc(e,t){t=Gd.normalizeOptions(t);function r(...n){let{originalError:i,props:s,message:a}=Gd.normalizeArgs(n,t),c=new e(a);return rs.extendError(c,i,s)}return o(r,"ono"),r[Symbol.species]=e,r}o(Pc,"Ono");Pc.toJSON=o(function(t){return KE.toJSON.call(t)},"toJSON");Pc.extend=o(function(t,r,n){return n||r instanceof Error?rs.extendError(t,r,n):r?rs.extendError(t,void 0,r):rs.extendError(t)},"extend")});var Zd=h(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.ono=void 0;var Nr=Ec(),WE=vt;is.ono=WE;vt.error=new Nr.Ono(Error);vt.eval=new Nr.Ono(EvalError);vt.range=new Nr.Ono(RangeError);vt.reference=new Nr.Ono(ReferenceError);vt.syntax=new Nr.Ono(SyntaxError);vt.type=new Nr.Ono(TypeError);vt.uri=new Nr.Ono(URIError);var YE=vt;function vt(...e){let t=e[0];if(typeof t=="object"&&typeof t.name=="string"){for(let r of Object.values(YE))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(t instanceof n||t.name===n.name))return r.apply(void 0,e)}}return vt.error.apply(void 0,e)}o(vt,"ono")});var Kd=h(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});var lM=require("util")});var it=h((nt,Pn)=>{"use strict";var JE=nt&&nt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:o(function(){return t[r]},"get")})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),XE=nt&&nt.__exportStar||function(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&JE(t,e,r)};Object.defineProperty(nt,"__esModule",{value:!0});nt.ono=void 0;var Qd=Zd();Object.defineProperty(nt,"ono",{enumerable:!0,get:o(function(){return Qd.ono},"get")});var e2=Ec();Object.defineProperty(nt,"Ono",{enumerable:!0,get:o(function(){return e2.Ono},"get")});XE(Kd(),nt);nt.default=Qd.ono;typeof Pn=="object"&&typeof Pn.exports=="object"&&(Pn.exports=Object.assign(Pn.exports.default,Pn.exports))});var Ti=h(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});M.regexpCode=M.getEsmExportName=M.getProperty=M.safeStringify=M.stringify=M.strConcat=M.addCodeArg=M.str=M._=M.nil=M._Code=M.Name=M.IDENTIFIER=M._CodeOrName=void 0;var xc=class xc{};o(xc,"_CodeOrName");var wi=xc;M._CodeOrName=wi;M.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ac=class Ac extends wi{constructor(t){if(super(),!M.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};o(Ac,"Name");var kr=Ac;M.Name=kr;var wc=class wc extends wi{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof kr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};o(wc,"_Code");var Ze=wc;M._Code=Ze;M.nil=new Ze("");function Wd(e,...t){let r=[e[0]],n=0;for(;n<t.length;)$c(r,t[n]),r.push(e[++n]);return new Ze(r)}o(Wd,"_");M._=Wd;var Oc=new Ze("+");function Yd(e,...t){let r=[Ii(e[0])],n=0;for(;n<t.length;)r.push(Oc),$c(r,t[n]),r.push(Oc,Ii(e[++n]));return t2(r),new Ze(r)}o(Yd,"str");M.str=Yd;function $c(e,t){t instanceof Ze?e.push(...t._items):t instanceof kr?e.push(t):e.push(i2(t))}o($c,"addCodeArg");M.addCodeArg=$c;function t2(e){let t=1;for(;t<e.length-1;){if(e[t]===Oc){let r=r2(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}o(t2,"optimize");function r2(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof kr||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof kr))return`"${e}${t.slice(1)}`}o(r2,"mergeExprItems");function n2(e,t){return t.emptyStr()?e:e.emptyStr()?t:Yd`${e}${t}`}o(n2,"strConcat");M.strConcat=n2;function i2(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ii(Array.isArray(e)?e.join(","):e)}o(i2,"interpolate");function o2(e){return new Ze(Ii(e))}o(o2,"stringify");M.stringify=o2;function Ii(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Ii,"safeStringify");M.safeStringify=Ii;function s2(e){return typeof e=="string"&&M.IDENTIFIER.test(e)?new Ze(`.${e}`):Wd`[${e}]`}o(s2,"getProperty");M.getProperty=s2;function a2(e){if(typeof e=="string"&&M.IDENTIFIER.test(e))return new Ze(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}o(a2,"getEsmExportName");M.getEsmExportName=a2;function c2(e){return new Ze(e.toString())}o(c2,"regexpCode");M.regexpCode=c2});var jc=h(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.ValueScope=ke.ValueScopeName=ke.Scope=ke.varKinds=ke.UsedValueState=void 0;var Ne=Ti(),Rc=class Rc extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}};o(Rc,"ValueError");var Ic=Rc,os;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(os||(ke.UsedValueState=os={}));ke.varKinds={const:new Ne.Name("const"),let:new Ne.Name("let"),var:new Ne.Name("var")};var Cc=class Cc{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ne.Name?t:this.name(t)}name(t){return new Ne.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};o(Cc,"Scope");var ss=Cc;ke.Scope=ss;var Nc=class Nc extends Ne.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ne._)`.${new Ne.Name(r)}[${n}]`}};o(Nc,"ValueScopeName");var as=Nc;ke.ValueScopeName=as;var u2=(0,Ne._)`\n`,kc=class kc extends ss{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?u2:Ne.nil}}get(){return this._scope}name(t){return new as(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(t),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[s];if(c){let f=c.get(a);if(f)return f}else c=this._values[s]=new Map;c.set(a,i);let u=this._scope[s]||(this._scope[s]=[]),l=u.length;return u[l]=r.ref,i.setValue(r,{property:s,itemIndex:l}),i}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ne._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(t,r,n={},i){let s=Ne.nil;for(let a in t){let c=t[a];if(!c)continue;let u=n[a]=n[a]||new Map;c.forEach(l=>{if(u.has(l))return;u.set(l,os.Started);let f=r(l);if(f){let p=this.opts.es5?ke.varKinds.var:ke.varKinds.const;s=(0,Ne._)`${s}${p} ${l} = ${f};${this.opts._n}`}else if(f=i==null?void 0:i(l))s=(0,Ne._)`${s}${f}${this.opts._n}`;else throw new Ic(l);u.set(l,os.Completed)})}return s}};o(kc,"ValueScope");var Tc=kc;ke.ValueScope=Tc});var w=h(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.or=R.and=R.not=R.CodeGen=R.operators=R.varKinds=R.ValueScopeName=R.ValueScope=R.Scope=R.Name=R.regexpCode=R.stringify=R.getProperty=R.nil=R.strConcat=R.str=R._=void 0;var j=Ti(),ot=jc(),Xt=Ti();Object.defineProperty(R,"_",{enumerable:!0,get:o(function(){return Xt._},"get")});Object.defineProperty(R,"str",{enumerable:!0,get:o(function(){return Xt.str},"get")});Object.defineProperty(R,"strConcat",{enumerable:!0,get:o(function(){return Xt.strConcat},"get")});Object.defineProperty(R,"nil",{enumerable:!0,get:o(function(){return Xt.nil},"get")});Object.defineProperty(R,"getProperty",{enumerable:!0,get:o(function(){return Xt.getProperty},"get")});Object.defineProperty(R,"stringify",{enumerable:!0,get:o(function(){return Xt.stringify},"get")});Object.defineProperty(R,"regexpCode",{enumerable:!0,get:o(function(){return Xt.regexpCode},"get")});Object.defineProperty(R,"Name",{enumerable:!0,get:o(function(){return Xt.Name},"get")});var ps=jc();Object.defineProperty(R,"Scope",{enumerable:!0,get:o(function(){return ps.Scope},"get")});Object.defineProperty(R,"ValueScope",{enumerable:!0,get:o(function(){return ps.ValueScope},"get")});Object.defineProperty(R,"ValueScopeName",{enumerable:!0,get:o(function(){return ps.ValueScopeName},"get")});Object.defineProperty(R,"varKinds",{enumerable:!0,get:o(function(){return ps.varKinds},"get")});R.operators={GT:new j._Code(">"),GTE:new j._Code(">="),LT:new j._Code("<"),LTE:new j._Code("<="),EQ:new j._Code("==="),NEQ:new j._Code("!=="),NOT:new j._Code("!"),OR:new j._Code("||"),AND:new j._Code("&&"),ADD:new j._Code("+")};var Kc=class Kc{optimizeNodes(){return this}optimizeNames(t,r){return this}};o(Kc,"Node");var Ht=Kc,Qc=class Qc extends Ht{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?ot.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=$n(this.rhs,t,r)),this}get names(){return this.rhs instanceof j._CodeOrName?this.rhs.names:{}}};o(Qc,"Def");var qc=Qc,Wc=class Wc extends Ht{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof j.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=$n(this.rhs,t,r),this}get names(){let t=this.lhs instanceof j.Name?{}:{...this.lhs.names};return ls(t,this.rhs)}};o(Wc,"Assign");var cs=Wc,Yc=class Yc extends cs{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}};o(Yc,"AssignOp");var Mc=Yc,Jc=class Jc extends Ht{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}};o(Jc,"Label");var Dc=Jc,Xc=class Xc extends Ht{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}};o(Xc,"Break");var Lc=Xc,eu=class eu extends Ht{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}};o(eu,"Throw");var Fc=eu,tu=class tu extends Ht{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=$n(this.code,t,r),this}get names(){return this.code instanceof j._CodeOrName?this.code.names:{}}};o(tu,"AnyCode");var Hc=tu,ru=class ru extends Ht{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(t,r)||(l2(t,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Mr(t,r.names),{})}};o(ru,"ParentNode");var Ri=ru,nu=class nu extends Ri{render(t){return"{"+t._n+super.render(t)+"}"+t._n}};o(nu,"BlockNode");var Vt=nu,iu=class iu extends Ri{};o(iu,"Root");var Vc=iu,ou=class ou extends Vt{};o(ou,"Else");var On=ou;On.kind="else";var En=class En extends Vt{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new On(n):n}if(r)return t===!1?r instanceof En?r:r.nodes:this.nodes.length?this:new En(Jd(t),r instanceof En?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=$n(this.condition,t,r),this}get names(){let t=super.names;return ls(t,this.condition),this.else&&Mr(t,this.else.names),t}};o(En,"If");var jr=En;jr.kind="if";var su=class su extends Vt{};o(su,"For");var qr=su;qr.kind="for";var au=class au extends qr{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=$n(this.iteration,t,r),this}get names(){return Mr(super.names,this.iteration.names)}};o(au,"ForLoop");var Bc=au,cu=class cu extends qr{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?ot.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(t)}get names(){let t=ls(super.names,this.from);return ls(t,this.to)}};o(cu,"ForRange");var Uc=cu,uu=class uu extends qr{constructor(t,r,n,i){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=i}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=$n(this.iterable,t,r),this}get names(){return Mr(super.names,this.iterable.names)}};o(uu,"ForIter");var us=uu,lu=class lu extends Vt{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};o(lu,"Func");var Ci=lu;Ci.kind="func";var pu=class pu extends Ri{render(t){return"return "+super.render(t)}};o(pu,"Return");var Ni=pu;Ni.kind="return";var fu=class fu extends Vt{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,i;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Mr(t,this.catch.names),this.finally&&Mr(t,this.finally.names),t}};o(fu,"Try");var Gc=fu,du=class du extends Vt{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};o(du,"Catch");var ki=du;ki.kind="catch";var mu=class mu extends Vt{render(t){return"finally"+super.render(t)}};o(mu,"Finally");var ji=mu;ji.kind="finally";var hu=class hu{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
`:""},this._extScope=t,this._scope=new ot.Scope({parent:t}),this._nodes=[new Vc]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new qc(t,s,n)),s}const(t,r,n){return this._def(ot.varKinds.const,t,r,n)}let(t,r,n){return this._def(ot.varKinds.let,t,r,n)}var(t,r,n){return this._def(ot.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new cs(t,r,n))}add(t,r){return this._leafNode(new Mc(t,R.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==j.nil&&this._leafNode(new Hc(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,j.addCodeArg)(r,i));return r.push("}"),new j._Code(r)}if(t,r,n){if(this._blockNode(new jr(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new jr(t))}else(){return this._elseNode(new On)}endIf(){return this._endBlockNode(jr,On)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Bc(t),r)}forRange(t,r,n,i,s=this.opts.es5?ot.varKinds.var:ot.varKinds.let){let a=this._scope.toName(t);return this._for(new Uc(s,a,r,n),()=>i(a))}forOf(t,r,n,i=ot.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let a=r instanceof j.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,j._)`${a}.length`,c=>{this.var(s,(0,j._)`${a}[${c}]`),n(s)})}return this._for(new us("of",i,s,r),()=>n(s))}forIn(t,r,n,i=this.opts.es5?ot.varKinds.var:ot.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,j._)`Object.keys(${r})`,n);let s=this._scope.toName(t);return this._for(new us("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(qr)}label(t){return this._leafNode(new Dc(t))}break(t){return this._leafNode(new Lc(t))}return(t){let r=new Ni;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ni)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Gc;if(this._blockNode(i),this.code(t),r){let s=this.name("e");this._currNode=i.catch=new ki(s),r(s)}return n&&(this._currNode=i.finally=new ji,this.code(n)),this._endBlockNode(ki,ji)}throw(t){return this._leafNode(new Fc(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=j.nil,n,i){return this._blockNode(new Ci(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Ci)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof jr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};o(hu,"CodeGen");var Zc=hu;R.CodeGen=Zc;function Mr(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}o(Mr,"addNames");function ls(e,t){return t instanceof j._CodeOrName?Mr(e,t.names):e}o(ls,"addExprNames");function $n(e,t,r){if(e instanceof j.Name)return n(e);if(!i(e))return e;return new j._Code(e._items.reduce((s,a)=>(a instanceof j.Name&&(a=n(a)),a instanceof j._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||t[s.str]!==1?s:(delete t[s.str],a)}function i(s){return s instanceof j._Code&&s._items.some(a=>a instanceof j.Name&&t[a.str]===1&&r[a.str]!==void 0)}}o($n,"optimizeExpr");function l2(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}o(l2,"subtractNames");function Jd(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,j._)`!${zc(e)}`}o(Jd,"not");R.not=Jd;var p2=Xd(R.operators.AND);function f2(...e){return e.reduce(p2)}o(f2,"and");R.and=f2;var d2=Xd(R.operators.OR);function m2(...e){return e.reduce(d2)}o(m2,"or");R.or=m2;function Xd(e){return(t,r)=>t===j.nil?r:r===j.nil?t:(0,j._)`${zc(t)} ${e} ${zc(r)}`}o(Xd,"mappend");function zc(e){return e instanceof j.Name?e:(0,j._)`(${e})`}o(zc,"par")});var N=h(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.checkStrictMode=C.getErrorPath=C.Type=C.useFunc=C.setEvaluated=C.evaluatedPropsToName=C.mergeEvaluated=C.eachItem=C.unescapeJsonPointer=C.escapeJsonPointer=C.escapeFragment=C.unescapeFragment=C.schemaRefOrVal=C.schemaHasRulesButRef=C.schemaHasRules=C.checkUnknownRules=C.alwaysValidSchema=C.toHash=void 0;var V=w(),h2=Ti();function g2(e){let t={};for(let r of e)t[r]=!0;return t}o(g2,"toHash");C.toHash=g2;function y2(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(rm(e,t),!nm(t,e.self.RULES.all))}o(y2,"alwaysValidSchema");C.alwaysValidSchema=y2;function rm(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let s in t)i[s]||sm(e,`unknown keyword: "${s}"`)}o(rm,"checkUnknownRules");C.checkUnknownRules=rm;function nm(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}o(nm,"schemaHasRules");C.schemaHasRules=nm;function v2(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}o(v2,"schemaHasRulesButRef");C.schemaHasRulesButRef=v2;function S2({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,V._)`${r}`}return(0,V._)`${e}${t}${(0,V.getProperty)(n)}`}o(S2,"schemaRefOrVal");C.schemaRefOrVal=S2;function b2(e){return im(decodeURIComponent(e))}o(b2,"unescapeFragment");C.unescapeFragment=b2;function _2(e){return encodeURIComponent(yu(e))}o(_2,"escapeFragment");C.escapeFragment=_2;function yu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}o(yu,"escapeJsonPointer");C.escapeJsonPointer=yu;function im(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o(im,"unescapeJsonPointer");C.unescapeJsonPointer=im;function P2(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}o(P2,"eachItem");C.eachItem=P2;function em({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,s,a,c)=>{let u=a===void 0?s:a instanceof V.Name?(s instanceof V.Name?e(i,s,a):t(i,s,a),a):s instanceof V.Name?(t(i,a,s),s):r(s,a);return c===V.Name&&!(u instanceof V.Name)?n(i,u):u}}o(em,"makeMergeEvaluated");C.mergeEvaluated={props:em({mergeNames:o((e,t,r)=>e.if((0,V._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,V._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,V._)`${r} || {}`).code((0,V._)`Object.assign(${r}, ${t})`))}),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,V._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,V._)`${r} || {}`),vu(e,r,t))}),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:{...e,...t},"mergeValues"),resultToName:om}),items:em({mergeNames:o((e,t,r)=>e.if((0,V._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,V._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,V._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,V._)`${r} > ${t} ? ${r} : ${t}`)),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:o((e,t)=>e.var("items",t),"resultToName")})};function om(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,V._)`{}`);return t!==void 0&&vu(e,r,t),r}o(om,"evaluatedPropsToName");C.evaluatedPropsToName=om;function vu(e,t,r){Object.keys(r).forEach(n=>e.assign((0,V._)`${t}${(0,V.getProperty)(n)}`,!0))}o(vu,"setEvaluated");C.setEvaluated=vu;var tm={};function E2(e,t){return e.scopeValue("func",{ref:t,code:tm[t.code]||(tm[t.code]=new h2._Code(t.code))})}o(E2,"useFunc");C.useFunc=E2;var gu;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(gu||(C.Type=gu={}));function O2(e,t,r){if(e instanceof V.Name){let n=t===gu.Num;return r?n?(0,V._)`"[" + ${e} + "]"`:(0,V._)`"['" + ${e} + "']"`:n?(0,V._)`"/" + ${e}`:(0,V._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,V.getProperty)(e).toString():"/"+yu(e)}o(O2,"getErrorPath");C.getErrorPath=O2;function sm(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}o(sm,"checkStrictMode");C.checkStrictMode=sm});var ze=h(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});var ve=w(),$2={data:new ve.Name("data"),valCxt:new ve.Name("valCxt"),instancePath:new ve.Name("instancePath"),parentData:new ve.Name("parentData"),parentDataProperty:new ve.Name("parentDataProperty"),rootData:new ve.Name("rootData"),dynamicAnchors:new ve.Name("dynamicAnchors"),vErrors:new ve.Name("vErrors"),errors:new ve.Name("errors"),this:new ve.Name("this"),self:new ve.Name("self"),scope:new ve.Name("scope"),json:new ve.Name("json"),jsonPos:new ve.Name("jsonPos"),jsonLen:new ve.Name("jsonLen"),jsonPart:new ve.Name("jsonPart")};Su.default=$2});var qi=h(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.extendErrors=Se.resetErrorsCount=Se.reportExtraError=Se.reportError=Se.keyword$DataError=Se.keywordError=void 0;var q=w(),fs=N(),Ae=ze();Se.keywordError={message:o(({keyword:e})=>(0,q.str)`must pass "${e}" keyword validation`,"message")};Se.keyword$DataError={message:o(({keyword:e,schemaType:t})=>t?(0,q.str)`"${e}" keyword must be ${t} ($data)`:(0,q.str)`"${e}" keyword is invalid ($data)`,"message")};function x2(e,t=Se.keywordError,r,n){let{it:i}=e,{gen:s,compositeRule:a,allErrors:c}=i,u=um(e,t,r);n??(a||c)?am(s,u):cm(i,(0,q._)`[${u}]`)}o(x2,"reportError");Se.reportError=x2;function A2(e,t=Se.keywordError,r){let{it:n}=e,{gen:i,compositeRule:s,allErrors:a}=n,c=um(e,t,r);am(i,c),s||a||cm(n,Ae.default.vErrors)}o(A2,"reportExtraError");Se.reportExtraError=A2;function w2(e,t){e.assign(Ae.default.errors,t),e.if((0,q._)`${Ae.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,q._)`${Ae.default.vErrors}.length`,t),()=>e.assign(Ae.default.vErrors,null)))}o(w2,"resetErrorsCount");Se.resetErrorsCount=w2;function I2({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=e.name("err");e.forRange("i",i,Ae.default.errors,c=>{e.const(a,(0,q._)`${Ae.default.vErrors}[${c}]`),e.if((0,q._)`${a}.instancePath === undefined`,()=>e.assign((0,q._)`${a}.instancePath`,(0,q.strConcat)(Ae.default.instancePath,s.errorPath))),e.assign((0,q._)`${a}.schemaPath`,(0,q.str)`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign((0,q._)`${a}.schema`,r),e.assign((0,q._)`${a}.data`,n))})}o(I2,"extendErrors");Se.extendErrors=I2;function am(e,t){let r=e.const("err",t);e.if((0,q._)`${Ae.default.vErrors} === null`,()=>e.assign(Ae.default.vErrors,(0,q._)`[${r}]`),(0,q._)`${Ae.default.vErrors}.push(${r})`),e.code((0,q._)`${Ae.default.errors}++`)}o(am,"addError");function cm(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,q._)`new ${e.ValidationError}(${t})`):(r.assign((0,q._)`${n}.errors`,t),r.return(!1))}o(cm,"returnErrors");var Dr={keyword:new q.Name("keyword"),schemaPath:new q.Name("schemaPath"),params:new q.Name("params"),propertyName:new q.Name("propertyName"),message:new q.Name("message"),schema:new q.Name("schema"),parentSchema:new q.Name("parentSchema")};function um(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,q._)`{}`:T2(e,t,r)}o(um,"errorObjectCode");function T2(e,t,r={}){let{gen:n,it:i}=e,s=[R2(i,r),C2(e,r)];return N2(e,t,s),n.object(...s)}o(T2,"errorObject");function R2({errorPath:e},{instancePath:t}){let r=t?(0,q.str)`${e}${(0,fs.getErrorPath)(t,fs.Type.Str)}`:e;return[Ae.default.instancePath,(0,q.strConcat)(Ae.default.instancePath,r)]}o(R2,"errorInstancePath");function C2({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,q.str)`${t}/${e}`;return r&&(i=(0,q.str)`${i}${(0,fs.getErrorPath)(r,fs.Type.Str)}`),[Dr.schemaPath,i]}o(C2,"errorSchemaPath");function N2(e,{params:t,message:r},n){let{keyword:i,data:s,schemaValue:a,it:c}=e,{opts:u,propertyName:l,topSchemaRef:f,schemaPath:p}=c;n.push([Dr.keyword,i],[Dr.params,typeof t=="function"?t(e):t||(0,q._)`{}`]),u.messages&&n.push([Dr.message,typeof r=="function"?r(e):r]),u.verbose&&n.push([Dr.schema,a],[Dr.parentSchema,(0,q._)`${f}${p}`],[Ae.default.data,s]),l&&n.push([Dr.propertyName,l])}o(N2,"extraErrorProps")});var pm=h(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.boolOrEmptySchema=xn.topBoolOrEmptySchema=void 0;var k2=qi(),j2=w(),q2=ze(),M2={message:"boolean schema is false"};function D2(e){let{gen:t,schema:r,validateName:n}=e;r===!1?lm(e,!1):typeof r=="object"&&r.$async===!0?t.return(q2.default.data):(t.assign((0,j2._)`${n}.errors`,null),t.return(!0))}o(D2,"topBoolOrEmptySchema");xn.topBoolOrEmptySchema=D2;function L2(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),lm(e)):r.var(t,!0)}o(L2,"boolOrEmptySchema");xn.boolOrEmptySchema=L2;function lm(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,k2.reportError)(i,M2,void 0,t)}o(lm,"falseSchemaError")});var bu=h(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.getRules=An.isJSONType=void 0;var F2=["string","number","integer","boolean","null","object","array"],H2=new Set(F2);function V2(e){return typeof e=="string"&&H2.has(e)}o(V2,"isJSONType");An.isJSONType=V2;function B2(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}o(B2,"getRules");An.getRules=B2});var _u=h(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.shouldUseRule=er.shouldUseGroup=er.schemaHasRulesForType=void 0;function U2({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&fm(e,n)}o(U2,"schemaHasRulesForType");er.schemaHasRulesForType=U2;function fm(e,t){return t.rules.some(r=>dm(e,r))}o(fm,"shouldUseGroup");er.shouldUseGroup=fm;function dm(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}o(dm,"shouldUseRule");er.shouldUseRule=dm});var Mi=h(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.reportTypeError=be.checkDataTypes=be.checkDataType=be.coerceAndCheckDataType=be.getJSONTypes=be.getSchemaTypes=be.DataType=void 0;var G2=bu(),Z2=_u(),z2=qi(),I=w(),mm=N(),wn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(wn||(be.DataType=wn={}));function K2(e){let t=hm(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}o(K2,"getSchemaTypes");be.getSchemaTypes=K2;function hm(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(G2.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}o(hm,"getJSONTypes");be.getJSONTypes=hm;function Q2(e,t){let{gen:r,data:n,opts:i}=e,s=W2(t,i.coerceTypes),a=t.length>0&&!(s.length===0&&t.length===1&&(0,Z2.schemaHasRulesForType)(e,t[0]));if(a){let c=Eu(t,n,i.strictNumbers,wn.Wrong);r.if(c,()=>{s.length?Y2(e,t,s):Ou(e)})}return a}o(Q2,"coerceAndCheckDataType");be.coerceAndCheckDataType=Q2;var gm=new Set(["string","number","integer","boolean","null"]);function W2(e,t){return t?e.filter(r=>gm.has(r)||t==="array"&&r==="array"):[]}o(W2,"coerceToTypes");function Y2(e,t,r){let{gen:n,data:i,opts:s}=e,a=n.let("dataType",(0,I._)`typeof ${i}`),c=n.let("coerced",(0,I._)`undefined`);s.coerceTypes==="array"&&n.if((0,I._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,I._)`${i}[0]`).assign(a,(0,I._)`typeof ${i}`).if(Eu(t,i,s.strictNumbers),()=>n.assign(c,i))),n.if((0,I._)`${c} !== undefined`);for(let l of r)(gm.has(l)||l==="array"&&s.coerceTypes==="array")&&u(l);n.else(),Ou(e),n.endIf(),n.if((0,I._)`${c} !== undefined`,()=>{n.assign(i,c),J2(e,c)});function u(l){switch(l){case"string":n.elseIf((0,I._)`${a} == "number" || ${a} == "boolean"`).assign(c,(0,I._)`"" + ${i}`).elseIf((0,I._)`${i} === null`).assign(c,(0,I._)`""`);return;case"number":n.elseIf((0,I._)`${a} == "boolean" || ${i} === null
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(c,(0,I._)`+${i}`);return;case"integer":n.elseIf((0,I._)`${a} === "boolean" || ${i} === null
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(c,(0,I._)`+${i}`);return;case"boolean":n.elseIf((0,I._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(c,!1).elseIf((0,I._)`${i} === "true" || ${i} === 1`).assign(c,!0);return;case"null":n.elseIf((0,I._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(c,null);return;case"array":n.elseIf((0,I._)`${a} === "string" || ${a} === "number"
|| ${a} === "boolean" || ${i} === null`).assign(c,(0,I._)`[${i}]`)}}o(u,"coerceSpecificType")}o(Y2,"coerceData");function J2({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,I._)`${t} !== undefined`,()=>e.assign((0,I._)`${t}[${r}]`,n))}o(J2,"assignParentData");function Pu(e,t,r,n=wn.Correct){let i=n===wn.Correct?I.operators.EQ:I.operators.NEQ,s;switch(e){case"null":return(0,I._)`${t} ${i} null`;case"array":s=(0,I._)`Array.isArray(${t})`;break;case"object":s=(0,I._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=a((0,I._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=a();break;default:return(0,I._)`typeof ${t} ${i} ${e}`}return n===wn.Correct?s:(0,I.not)(s);function a(c=I.nil){return(0,I.and)((0,I._)`typeof ${t} == "number"`,c,r?(0,I._)`isFinite(${t})`:I.nil)}}o(Pu,"checkDataType");be.checkDataType=Pu;function Eu(e,t,r,n){if(e.length===1)return Pu(e[0],t,r,n);let i,s=(0,mm.toHash)(e);if(s.array&&s.object){let a=(0,I._)`typeof ${t} != "object"`;i=s.null?a:(0,I._)`!${t} || ${a}`,delete s.null,delete s.array,delete s.object}else i=I.nil;s.number&&delete s.integer;for(let a in s)i=(0,I.and)(i,Pu(a,t,r,n));return i}o(Eu,"checkDataTypes");be.checkDataTypes=Eu;var X2={message:o(({schema:e})=>`must be ${e}`,"message"),params:o(({schema:e,schemaValue:t})=>typeof e=="string"?(0,I._)`{type: ${e}}`:(0,I._)`{type: ${t}}`,"params")};function Ou(e){let t=eO(e);(0,z2.reportError)(t,X2)}o(Ou,"reportTypeError");be.reportTypeError=Ou;function eO(e){let{gen:t,data:r,schema:n}=e,i=(0,mm.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}o(eO,"getTypeErrorContext")});var vm=h(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.assignDefaults=void 0;var In=w(),tO=N();function rO(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let i in r)ym(e,i,r[i].default);else t==="array"&&Array.isArray(n)&&n.forEach((i,s)=>ym(e,s,i.default))}o(rO,"assignDefaults");ds.assignDefaults=rO;function ym(e,t,r){let{gen:n,compositeRule:i,data:s,opts:a}=e;if(r===void 0)return;let c=(0,In._)`${s}${(0,In.getProperty)(t)}`;if(i){(0,tO.checkStrictMode)(e,`default is ignored for: ${c}`);return}let u=(0,In._)`${c} === undefined`;a.useDefaults==="empty"&&(u=(0,In._)`${u} || ${c} === null || ${c} === ""`),n.if(u,(0,In._)`${c} = ${(0,In.stringify)(r)}`)}o(ym,"assignDefault")});var Ke=h(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.validateUnion=H.validateArray=H.usePattern=H.callValidateCode=H.schemaProperties=H.allSchemaProperties=H.noPropertyInData=H.propertyInData=H.isOwnProperty=H.hasPropFunc=H.reportMissingProp=H.checkMissingProp=H.checkReportMissingProp=void 0;var G=w(),$u=N(),tr=ze(),nO=N();function iO(e,t){let{gen:r,data:n,it:i}=e;r.if(Au(r,n,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:(0,G._)`${t}`},!0),e.error()})}o(iO,"checkReportMissingProp");H.checkReportMissingProp=iO;function oO({gen:e,data:t,it:{opts:r}},n,i){return(0,G.or)(...n.map(s=>(0,G.and)(Au(e,t,s,r.ownProperties),(0,G._)`${i} = ${s}`)))}o(oO,"checkMissingProp");H.checkMissingProp=oO;function sO(e,t){e.setParams({missingProperty:t},!0),e.error()}o(sO,"reportMissingProp");H.reportMissingProp=sO;function Sm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,G._)`Object.prototype.hasOwnProperty`})}o(Sm,"hasPropFunc");H.hasPropFunc=Sm;function xu(e,t,r){return(0,G._)`${Sm(e)}.call(${t}, ${r})`}o(xu,"isOwnProperty");H.isOwnProperty=xu;function aO(e,t,r,n){let i=(0,G._)`${t}${(0,G.getProperty)(r)} !== undefined`;return n?(0,G._)`${i} && ${xu(e,t,r)}`:i}o(aO,"propertyInData");H.propertyInData=aO;function Au(e,t,r,n){let i=(0,G._)`${t}${(0,G.getProperty)(r)} === undefined`;return n?(0,G.or)(i,(0,G.not)(xu(e,t,r))):i}o(Au,"noPropertyInData");H.noPropertyInData=Au;function bm(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}o(bm,"allSchemaProperties");H.allSchemaProperties=bm;function cO(e,t){return bm(t).filter(r=>!(0,$u.alwaysValidSchema)(e,t[r]))}o(cO,"schemaProperties");H.schemaProperties=cO;function uO({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},c,u,l){let f=l?(0,G._)`${e}, ${t}, ${n}${i}`:t,p=[[tr.default.instancePath,(0,G.strConcat)(tr.default.instancePath,s)],[tr.default.parentData,a.parentData],[tr.default.parentDataProperty,a.parentDataProperty],[tr.default.rootData,tr.default.rootData]];a.opts.dynamicRef&&p.push([tr.default.dynamicAnchors,tr.default.dynamicAnchors]);let d=(0,G._)`${f}, ${r.object(...p)}`;return u!==G.nil?(0,G._)`${c}.call(${u}, ${d})`:(0,G._)`${c}(${d})`}o(uO,"callValidateCode");H.callValidateCode=uO;var lO=(0,G._)`new RegExp`;function pO({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,s=i(r,n);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,G._)`${i.code==="new RegExp"?lO:(0,nO.useFunc)(e,i)}(${r}, ${n})`})}o(pO,"usePattern");H.usePattern=pO;function fO(e){let{gen:t,data:r,keyword:n,it:i}=e,s=t.name("valid");if(i.allErrors){let c=t.let("valid",!0);return a(()=>t.assign(c,!1)),c}return t.var(s,!0),a(()=>t.break()),s;function a(c){let u=t.const("len",(0,G._)`${r}.length`);t.forRange("i",0,u,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:$u.Type.Num},s),t.if((0,G.not)(s),c)})}o(a,"validateItems")}o(fO,"validateArray");H.validateArray=fO;function dO(e){let{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,$u.alwaysValidSchema)(i,u))&&!i.opts.unevaluated)return;let a=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((u,l)=>{let f=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},c);t.assign(a,(0,G._)`${a} || ${c}`),e.mergeValidEvaluated(f,c)||t.if((0,G.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}o(dO,"validateUnion");H.validateUnion=dO});var Em=h(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.validateKeywordUsage=St.validSchemaType=St.funcKeywordCode=St.macroKeywordCode=void 0;var we=w(),Lr=ze(),mO=Ke(),hO=qi();function gO(e,t){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=e,c=t.macro.call(a.self,i,s,a),u=Pm(r,n,c);a.opts.validateSchema!==!1&&a.self.validateSchema(c,!0);let l=r.name("valid");e.subschema({schema:c,schemaPath:we.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}o(gO,"macroKeywordCode");St.macroKeywordCode=gO;function yO(e,t){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:c,it:u}=e;SO(u,t);let l=!c&&t.compile?t.compile.call(u.self,s,a,u):t.validate,f=Pm(n,i,l),p=n.let("valid");e.block$data(p,d),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function d(){if(t.errors===!1)y(),t.modifying&&_m(e),v(()=>e.error());else{let S=t.async?m():g();t.modifying&&_m(e),v(()=>vO(e,S))}}o(d,"validateKeyword");function m(){let S=n.let("ruleErrs",null);return n.try(()=>y((0,we._)`await `),b=>n.assign(p,!1).if((0,we._)`${b} instanceof ${u.ValidationError}`,()=>n.assign(S,(0,we._)`${b}.errors`),()=>n.throw(b))),S}o(m,"validateAsync");function g(){let S=(0,we._)`${f}.errors`;return n.assign(S,null),y(we.nil),S}o(g,"validateSync");function y(S=t.async?(0,we._)`await `:we.nil){let b=u.opts.passContext?Lr.default.this:Lr.default.self,P=!("compile"in t&&!c||t.schema===!1);n.assign(p,(0,we._)`${S}${(0,mO.callValidateCode)(e,f,b,P)}`,t.modifying)}o(y,"assignValid");function v(S){var b;n.if((0,we.not)((b=t.valid)!==null&&b!==void 0?b:p),S)}o(v,"reportErrs")}o(yO,"funcKeywordCode");St.funcKeywordCode=yO;function _m(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,we._)`${n.parentData}[${n.parentDataProperty}]`))}o(_m,"modifyData");function vO(e,t){let{gen:r}=e;r.if((0,we._)`Array.isArray(${t})`,()=>{r.assign(Lr.default.vErrors,(0,we._)`${Lr.default.vErrors} === null ? ${t} : ${Lr.default.vErrors}.concat(${t})`).assign(Lr.default.errors,(0,we._)`${Lr.default.vErrors}.length`),(0,hO.extendErrors)(e)},()=>e.error())}o(vO,"addErrs");function SO({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}o(SO,"checkAsyncKeyword");function Pm(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,we.stringify)(r)})}o(Pm,"useKeyword");function bO(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}o(bO,"validSchemaType");St.validSchemaType=bO;function _O({schema:e,opts:t,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a!=null&&a.some(c=>!Object.prototype.hasOwnProperty.call(e,c)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}o(_O,"validateKeywordUsage");St.validateKeywordUsage=_O});var $m=h(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.extendSubschemaMode=rr.extendSubschemaData=rr.getSubschema=void 0;var bt=w(),Om=N();function PO(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let c=e.schema[t];return r===void 0?{schema:c,schemaPath:(0,bt._)`${e.schemaPath}${(0,bt.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:c[r],schemaPath:(0,bt._)`${e.schemaPath}${(0,bt.getProperty)(t)}${(0,bt.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Om.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}o(PO,"getSubschema");rr.getSubschema=PO;function EO(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and